diff options
author | Paul Duncan <pabs@pablotron.org> | 2018-06-20 18:29:22 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2018-06-20 18:29:22 -0400 |
commit | 2ce21e092161fcc41fa51b365aeb4dd071d7e949 (patch) | |
tree | eb54c217ea33dd6b7787856ecf9fe9ac633b48bb /gb.h | |
parent | 4f058726584b60a8c976715a35f488875cac7aa8 (diff) | |
download | gb-c-2ce21e092161fcc41fa51b365aeb4dd071d7e949.tar.bz2 gb-c-2ce21e092161fcc41fa51b365aeb4dd071d7e949.zip |
add gb.h, add gb_init(), gb_get_rgb_frame(), disable bios
Diffstat (limited to 'gb.h')
-rw-r--r-- | gb.h | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -25,12 +25,14 @@ 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) + typedef struct { struct { - _Bool in_bios; + // _Bool in_bios; // FIXME: combine these? - uint8_t bios[0x100]; // bios (256 bytes) uint8_t ram[0x2000]; // working ram (8k) uint8_t eram[65536]; // external ram (banked, up to 64k) uint8_t vram[0x2000]; // vram (8k) @@ -95,7 +97,7 @@ typedef struct { obp1, line, lyc; - uint8_t rgb[3 * 160 * 144]; + uint8_t rgb[GB_FRAME_SIZE]; uint32_t frame; } gpu; @@ -116,6 +118,12 @@ typedef struct { } cpu; } gb_t; +void gb_init(gb_t * const, const uint8_t *rom, const uint32_t rom_size); +void gb_set_buttons(gb_t * const, const uint8_t); +void gb_frame(gb_t * const); +void gb_step(gb_t * const); +const uint8_t *gb_get_rgb_frame(const gb_t * const); + #ifdef __cplusplus }; #endif /* __cplusplus */ |