summaryrefslogtreecommitdiff
path: root/gb.h
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-06-26 18:51:44 -0400
committerPaul Duncan <pabs@pablotron.org>2018-06-26 18:51:44 -0400
commitd5d0b54054f5db7cad86fc08c1a12857b2ac04ca (patch)
tree86de7598cf0251ed243479652d7c221367777474 /gb.h
parente608f0d1449fe112ff1c0be2aec0ca5f8bab3232 (diff)
downloadgb-c-d5d0b54054f5db7cad86fc08c1a12857b2ac04ca.tar.bz2
gb-c-d5d0b54054f5db7cad86fc08c1a12857b2ac04ca.zip
s/rgb_frame/fb/, add oam_cache, fix several instructions
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
};