summaryrefslogtreecommitdiff
path: root/gb.h
diff options
context:
space:
mode:
Diffstat (limited to 'gb.h')
-rw-r--r--gb.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/gb.h b/gb.h
index 15bd75e..e027ee7 100644
--- a/gb.h
+++ b/gb.h
@@ -25,8 +25,8 @@ typedef enum {
#define GB_BTN_SELECT (1 << 6)
#define GB_BTN_START (1 << 7)
-// frame size, in bytes
-#define GB_FRAME_SIZE (3 * 160 * 144)
+// frame buffer size, in bytes
+#define GB_FB_SIZE (3 * 160 * 144)
typedef struct gb_t_ gb_t;
@@ -116,8 +116,22 @@ struct gb_t_ {
obp1,
line,
lyc;
- uint8_t rgb[GB_FRAME_SIZE];
+
+ // frame buffer
+ uint8_t fb[GB_FB_SIZE];
+
+ // frame counter
uint32_t frame;
+
+ struct {
+ uint8_t x, y, tile;
+ bool priority,
+ y_flip,
+ x_flip,
+ palette;
+ } oam_cache[40];
+
+ bool oam_dirty;
} gpu;
struct {
@@ -148,7 +162,7 @@ void gb_set_buttons(gb_t * const, const uint8_t);
void gb_frame(gb_t * const);
void gb_step(gb_t * const);
_Bool gb_disasm(gb_t * const, char * const, size_t * const);
-const uint8_t *gb_get_rgb_frame(const gb_t * const);
+const uint8_t *gb_get_frame(const gb_t * const);
#ifdef __cplusplus
};