GBDK 2020 Docs 4.4.0 API Documentation for GBDK 2020

nes.h
Go to the documentation of this file.
1
4 #ifndef _NES_H
5 #define _NES_H
6
7 #include <types.h>
8 #include <stdint.h>
9 #include <gbdk/version.h>
10 #include <nes/hardware.h>
11 #include <nes/rgb_to_nes_macro.h>
12
13 #define NINTENDO_NES
14
15 // Here NINTENDO means Game Boy & related clones
16 #ifdef NINTENDO
17 #undef NINTENDO
18 #endif
19
20 #ifdef SEGA
21 #undef SEGA
22 #endif
23
24 #ifdef MSX
25 #undef MSX
26 #endif
27
28 #define SYSTEM_BITS_NTSC 0x00
29 #define SYSTEM_BITS_PAL 0x40
30 #define SYSTEM_BITS_DENDY 0x80
31 extern const uint8_t _SYSTEM;
32
33 #define SYSTEM_60HZ 0x00
34 #define SYSTEM_50HZ 0x01
35
36 #define TIMER_VBLANK_PARITY_MODE_SYSTEM_60HZ 0x78
37 #define TIMER_VBLANK_PARITY_MODE_SYSTEM_50HZ 0x5D
38
39 #define RGB(r,g,b) RGB_TO_NES(((r) | ((g) << 2) | ((b) << 4)))
40 #define RGB8(r,g,b) RGB_TO_NES((((r) >> 6) | (((g) >> 6) << 2) | (((b) >> 6) << 4)))
41 #define RGBHTML(RGB24bit) RGB_TO_NES((((RGB24bit) >> 22) | ((((RGB24bit) & 0xFFFF) >> 14) << 2) | ((((RGB24bit) & 0xFF) >> 6) << 4)))
42
48 #define RGB_RED 0x16 // EGA12
49 #define RGB_DARKRED 0x06 // EGA4
50 #define RGB_GREEN 0x2A // EGA10
51 #define RGB_DARKGREEN 0x1A // EGA2
52 #define RGB_BLUE 0x12 // EGA9
53 #define RGB_DARKBLUE 0x02 // EGA1
54 #define RGB_YELLOW 0x28 // EGA14
55 #define RGB_DARKYELLOW 0x18 // EGA6
56 #define RGB_CYAN 0x2C // EGA11
57 #define RGB_AQUA 0x1C // EGA3
58 #define RGB_PINK 0x24 // EGA13
59 #define RGB_PURPLE 0x14 // EGA5
60 #define RGB_BLACK 0x0F // EGA0
61 #define RGB_DARKGRAY 0x00 // EGA8
62 #define RGB_LIGHTGRAY 0x10 // EGA7
63 #define RGB_WHITE 0x30 // EGA15
64
65 typedef uint8_t palette_color_t;
66
67 void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS;
68
69 void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS;
70
71 void set_bkg_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS;
72
73 void set_sprite_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS;
74
88 #define J_UP 0x08U
89 #define J_DOWN 0x04U
90 #define J_LEFT 0x02U
91 #define J_RIGHT 0x01U
92 #define J_A 0x80U
93 #define J_B 0x40U
94 #define J_SELECT 0x20U
95 #define J_START 0x10U
96
101 #define M_DRAWING 0x01U
102 #define M_TEXT_OUT 0x02U
103 #define M_TEXT_INOUT 0x03U
109 #define M_NO_SCROLL 0x04U
113 #define M_NO_INTERP 0x08U
114
119 #define S_PALETTE 0x10U
123 #define S_FLIPX 0x40U
127 #define S_FLIPY 0x80U
132 #define S_PRIORITY 0x20U
136 #define S_PAL(n) n
137
138 /* Interrupt flags */
141 #define EMPTY_IFLAG 0x00U
147 #define VBL_IFLAG 0x01U
151 #define LCD_IFLAG 0x02U
155 #define TIM_IFLAG 0x04U
156
157 /* DMG Palettes */
158 #define DMG_BLACK 0x03
159 #define DMG_DARK_GRAY 0x02
160 #define DMG_LITE_GRAY 0x01
161 #define DMG_WHITE 0x00
181 #define DMG_PALETTE(C0, C1, C2, C3) ((uint8_t)((((C3) & 0x03) << 6) | (((C2) & 0x03) << 4) | (((C1) & 0x03) << 2) | ((C0) & 0x03)))
182
183 /* Limits */
186 #define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH
189 #define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT
190
193 typedef void (*int_handler)(void) NONBANKED;
194
202 void remove_VBL(int_handler h) NO_OVERLAY_LOCALS;
203
207 void remove_LCD(int_handler h) NO_OVERLAY_LOCALS;
208
212 void remove_TIM(int_handler h) NO_OVERLAY_LOCALS;
213
242 void add_VBL(int_handler h) NO_OVERLAY_LOCALS;
243
276 void add_LCD(int_handler h) NO_OVERLAY_LOCALS;
277
295 void add_TIM(int_handler h) NO_OVERLAY_LOCALS;
296
299 #define MAX_LCD_ISR_CALLS 4
300
307 void mode(uint8_t m) NO_OVERLAY_LOCALS;
308
313 uint8_t get_mode(void) NO_OVERLAY_LOCALS;
314
318 inline uint8_t get_system(void) {
319 if(_SYSTEM == SYSTEM_BITS_NTSC)
320 return SYSTEM_60HZ;
321 else
322 return SYSTEM_50HZ;
323 }
324
331 extern volatile uint16_t sys_time;
332
343 extern volatile uint8_t _current_bank;
344 #define CURRENT_BANK _current_bank
345
355 #ifndef BANK
356 #define BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME )
357 #endif
358
371 #define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \
372 __asm \
373 .local b___func_ ## VARNAME \
374 ___bank_ ## VARNAME = b___func_ ## VARNAME \
375 .globl ___bank_ ## VARNAME \
376 __endasm; \
377 }
378
388 #define BANKREF_EXTERN(VARNAME) extern const void __bank_ ## VARNAME;
389
393 #define SWITCH_ROM_DUMMY(b)
394
398 #define SWITCH_ROM_UNROM(b) _switch_prg0(b)
399
405 #define SWITCH_ROM SWITCH_ROM_UNROM
406
411 #define SWITCH_RAM(b) 0
412
416 #define ENABLE_RAM
417
421 #define DISABLE_RAM
422
427 void delay(uint16_t d) NO_OVERLAY_LOCALS;
428
438 uint8_t joypad(void) NO_OVERLAY_LOCALS;
439
448 uint8_t waitpad(uint8_t mask) NO_OVERLAY_LOCALS;
449
453 void waitpadup(void) NO_OVERLAY_LOCALS;
454
460 typedef struct {
461 uint8_t npads;
462 union {
463 struct {
464 uint8_t joy0, joy1, joy2, joy3;
465 };
466 uint8_t joypads[4];
467 };
468 } joypads_t;
469
478 uint8_t joypad_init(uint8_t npads, joypads_t * joypads) NO_OVERLAY_LOCALS;
479
484 void joypad_ex(joypads_t * joypads) NO_OVERLAY_LOCALS;
485
486
487
496 inline void enable_interrupts(void) {
497 __asm__("cli");
498 }
499
512 inline void disable_interrupts(void) {
513 __asm__("sei");
514 }
515
521 void set_interrupts(uint8_t flags) NO_OVERLAY_LOCALS;
522
534 inline void reset(void) {
535 __asm__("jmp [0xFFFC]");
536 }
537
547 void vsync(void) NO_OVERLAY_LOCALS;
548
551 void wait_vbl_done(void) NO_OVERLAY_LOCALS;
552
557 void display_on(void) NO_OVERLAY_LOCALS;
558
562 void display_off(void) NO_OVERLAY_LOCALS;
563
566 void refresh_OAM(void) NO_OVERLAY_LOCALS;
567
571 #define DISPLAY_ON \
572 display_on();
573
577 #define DISPLAY_OFF \
578 display_off();
579
583 #define HIDE_LEFT_COLUMN \
584 shadow_PPUMASK &= ~(PPUMASK_SHOW_BG_LC | PPUMASK_SHOW_SPR_LC); \
585
589 #define SHOW_LEFT_COLUMN \
590 shadow_PPUMASK |= (PPUMASK_SHOW_BG_LC | PPUMASK_SHOW_SPR_LC);
591
595 #define SET_BORDER_COLOR(C)
596
600 #define SHOW_BKG \
601 shadow_PPUMASK |= PPUMASK_SHOW_BG;
602
606 #define HIDE_BKG \
607 shadow_PPUMASK &= ~PPUMASK_SHOW_BG;
608
612 #define SHOW_SPRITES \
613 shadow_PPUMASK |= PPUMASK_SHOW_SPR;
614
618 #define HIDE_SPRITES \
619 shadow_PPUMASK &= ~PPUMASK_SHOW_SPR;
620
624 #define SPRITES_8x16 \
625 shadow_PPUCTRL |= PPUCTRL_SPR_8X16;
626
630 #define SPRITES_8x8 \
631 shadow_PPUCTRL &= ~PPUCTRL_SPR_8X16;
632
633
634
641 void set_vram_byte(uint8_t * addr, uint8_t v) NO_OVERLAY_LOCALS;
642
646 uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
647
648 #define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0)))
649
652 inline void set_2bpp_palette(uint16_t palette) {
653 palette;
654 }
655
656 extern uint16_t _current_1bpp_colors;
657 void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) NO_OVERLAY_LOCALS;
658 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
659 set_1bpp_colors_ex(fgcolor, bgcolor, 0);
660 }
661
671 void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
672 #define set_bkg_2bpp_data set_bkg_data
673
685 void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
686
705 void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) NO_OVERLAY_LOCALS;
706 #define set_tile_map set_bkg_tiles
707
731 void set_bkg_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes) NO_OVERLAY_LOCALS;
732
756 inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes)
757 {
758 set_bkg_attributes_nes16x16(x >> 1, y >> 1, (w + 1) >> 1, (h + 1) >> 1, attributes);
759 }
805 void set_bkg_submap_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) NO_OVERLAY_LOCALS;
806
819 inline void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes, uint8_t map_w)
820 {
821 set_bkg_submap_attributes_nes16x16(x >> 1, y >> 1, (w + 1) >> 1, (h + 1) >> 1, attributes, (map_w + 1) >> 1);
822 }
823
824
825 extern uint8_t _map_tile_offset;
826
845 inline void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) {
846 _map_tile_offset = base_tile;
847 set_bkg_tiles(x, y, w, h, tiles);
848 _map_tile_offset = 0;
849 }
850
851
880 void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) NO_OVERLAY_LOCALS;
881 #define set_tile_submap set_bkg_submap
882
883
884 extern uint8_t _submap_tile_offset;
885
905 inline void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile) {
906 _submap_tile_offset = base_tile;
907 set_bkg_submap(x, y, w, h, map, map_w);
908 _submap_tile_offset = 0;
909 }
910
911
923 void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) NO_OVERLAY_LOCALS;
924
925
933 uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) NO_OVERLAY_LOCALS;
934 #define set_tile_xy set_bkg_tile_xy
935
943 void set_bkg_attribute_xy_nes16x16(uint8_t x, uint8_t y, uint8_t a) NO_OVERLAY_LOCALS;
944
957 inline void set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
958 {
959 set_bkg_attribute_xy_nes16x16(x >> 1, y >> 1, a);
960 }
961 #define set_attribute_xy set_bkg_attribute_xy
962
969 uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
970
971
985 inline void move_bkg(uint8_t x, uint8_t y) {
986 bkg_scroll_x = x, bkg_scroll_y = y;
987 }
988
989
999 inline void scroll_bkg(int8_t x, int8_t y) {
1000 bkg_scroll_x += x, bkg_scroll_y += y;
1001 }
1002
1003
1015 void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
1016 #define set_sprite_2bpp_data set_sprite_data
1017
1029 void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
1030
1037 typedef struct OAM_item_t {
1038 uint8_t y; //< Y coordinate of the sprite on screen - 1
1039 uint8_t tile; //< Sprite tile number
1040 uint8_t prop; //< OAM Property Flags
1041 uint8_t x; //< X coordinate of the sprite on screen
1042 } OAM_item_t;
1043
1044
1047 extern volatile struct OAM_item_t shadow_OAM[];
1048
1051 extern uint8_t _shadow_OAM_base;
1052
1053 #define DISABLE_OAM_DMA \
1054 _shadow_OAM_base = 0
1055
1058 #define DISABLE_VBL_TRANSFER DISABLE_OAM_DMA
1059
1060 #define ENABLE_OAM_DMA \
1061 _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
1062
1065 #define ENABLE_VBL_TRANSFER ENABLE_OAM_DMA
1066
1069 #define MAX_HARDWARE_SPRITES 64
1070
1073 #define HARDWARE_SPRITE_CAN_FLIP_X 1
1074
1077 #define HARDWARE_SPRITE_CAN_FLIP_Y 1
1078
1081 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
1082 _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
1083 }
1084
1098 void set_sprite_tile(uint8_t nb, uint8_t tile) NO_OVERLAY_LOCALS;
1099
1100
1107 uint8_t get_sprite_tile(uint8_t nb) NO_OVERLAY_LOCALS;
1108
1109
1147 void set_sprite_prop(uint8_t nb, uint8_t prop) NO_OVERLAY_LOCALS;
1148
1149
1155 uint8_t get_sprite_prop(uint8_t nb) NO_OVERLAY_LOCALS;
1156
1157
1167 void move_sprite(uint8_t nb, uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
1168
1169
1180 void scroll_sprite(uint8_t nb, int8_t x, int8_t y) NO_OVERLAY_LOCALS;
1181
1182
1187 void hide_sprite(uint8_t nb) NO_OVERLAY_LOCALS;
1188
1189
1190
1198 void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) NO_OVERLAY_LOCALS;
1199
1200
1219 void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) NO_OVERLAY_LOCALS;
1220
1226 inline void set_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
1227 if (first_tile < 256) {
1228 set_bkg_data(first_tile, nb_tiles, data);
1229 if(first_tile + nb_tiles > 256)
1230 set_sprite_data(first_tile - 256, nb_tiles, data);
1231 } else {
1232 set_sprite_data(first_tile - 256, nb_tiles, data);
1233 }
1234 }
1235
1247 void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
1248
1258 void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
1259
1273 inline void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
1274 if (first_tile < 256) {
1275 set_bkg_native_data(first_tile, nb_tiles, data);
1276 if(first_tile + nb_tiles > 256)
1277 set_sprite_native_data(first_tile - 256, nb_tiles, data);
1278 } else {
1279 set_sprite_native_data(first_tile - 256, nb_tiles, data);
1280 }
1281 }
1282
1288 void init_bkg(uint8_t c) NO_OVERLAY_LOCALS;
1289
1297 void vmemset (void *s, uint8_t c, size_t n) NO_OVERLAY_LOCALS;
1298
1307 void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) NO_OVERLAY_LOCALS;
1308 #define fill_rect fill_bkg_rect
1309
1317 void flush_shadow_attributes(void) NO_OVERLAY_LOCALS;
1318
1319 uint8_t _switch_prg0(uint8_t bank) NO_OVERLAY_LOCALS;
1320
1321 #endif /* _NES_H */
c
char c
Definition: string.h:20
NONBANKED
#define NONBANKED
Definition: types.h:40
palette_color_t
uint16_t palette_color_t
Definition: cgb.h:85
d
uint8_t d
Definition: gb.h:419
h
uint8_t h
Definition: gb.h:419
hardware.h
bkg_scroll_x
__SHADOW_REG bkg_scroll_x
Definition: hardware.h:56
bkg_scroll_y
__SHADOW_REG bkg_scroll_y
Definition: hardware.h:57
waitpad
uint8_t waitpad(uint8_t mask) NO_OVERLAY_LOCALS
flush_shadow_attributes
void flush_shadow_attributes(void) NO_OVERLAY_LOCALS
set_bkg_attributes_nes16x16
void set_bkg_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes) NO_OVERLAY_LOCALS
set_1bpp_colors_ex
void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) NO_OVERLAY_LOCALS
_current_bank
volatile uint8_t _current_bank
Definition: gb.h:534
set_interrupts
void set_interrupts(uint8_t flags) NO_OVERLAY_LOCALS
SYSTEM_BITS_NTSC
#define SYSTEM_BITS_NTSC
Definition: nes.h:28
scroll_bkg
void scroll_bkg(int8_t x, int8_t y)
Definition: nes.h:999
delay
void delay(uint16_t d) NO_OVERLAY_LOCALS
enable_interrupts
void enable_interrupts(void)
Definition: nes.h:496
_current_1bpp_colors
uint16_t _current_1bpp_colors
set_tile_data
void set_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: nes.h:1226
disable_interrupts
void disable_interrupts(void)
Definition: nes.h:512
vmemset
void vmemset(void *s, uint8_t c, size_t n) NO_OVERLAY_LOCALS
set_sprite_tile
void set_sprite_tile(uint8_t nb, uint8_t tile) NO_OVERLAY_LOCALS
Definition: gb.h:1886
set_bkg_tile_xy
uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) NO_OVERLAY_LOCALS
set_bkg_submap_attributes
void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes, uint8_t map_w)
Definition: nes.h:819
shadow_OAM
volatile struct OAM_item_t shadow_OAM[]
set_tiles
void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) NO_OVERLAY_LOCALS
reset
void reset(void)
Definition: nes.h:534
move_sprite
void move_sprite(uint8_t nb, uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
Definition: gb.h:1972
get_system
uint8_t get_system(void)
Definition: nes.h:318
display_on
void display_on(void) NO_OVERLAY_LOCALS
add_VBL
void add_VBL(int_handler h) NO_OVERLAY_LOCALS
set_vram_byte
void set_vram_byte(uint8_t *addr, uint8_t v) NO_OVERLAY_LOCALS
set_bkg_data
void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
joypad_init
uint8_t joypad_init(uint8_t npads, joypads_t *joypads) NO_OVERLAY_LOCALS
scroll_sprite
void scroll_sprite(uint8_t nb, int8_t x, int8_t y) NO_OVERLAY_LOCALS
Definition: gb.h:1988
get_sprite_tile
uint8_t get_sprite_tile(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:1897
remove_VBL
void remove_VBL(int_handler h) NO_OVERLAY_LOCALS
move_bkg
void move_bkg(uint8_t x, uint8_t y)
Definition: nes.h:985
_shadow_OAM_base
uint8_t _shadow_OAM_base
Definition: gb.h:1836
set_sprite_1bpp_data
void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
wait_vbl_done
void wait_vbl_done(void) NO_OVERLAY_LOCALS
set_bkg_native_data
void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
Definition: gb.h:2167
set_native_tile_data
void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: nes.h:1273
fill_bkg_rect
void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) NO_OVERLAY_LOCALS
set_bkg_tiles
void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) NO_OVERLAY_LOCALS
set_sprite_native_data
void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
Definition: gb.h:2184
refresh_OAM
void refresh_OAM(void) NO_OVERLAY_LOCALS
vsync
void vsync(void) NO_OVERLAY_LOCALS
sys_time
volatile uint16_t sys_time
_SYSTEM
const uint8_t _SYSTEM
set_bkg_attribute_xy_nes16x16
void set_bkg_attribute_xy_nes16x16(uint8_t x, uint8_t y, uint8_t a) NO_OVERLAY_LOCALS
set_sprite_palette
void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS
set_bkg_attribute_xy
void set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
Definition: nes.h:957
_switch_prg0
uint8_t _switch_prg0(uint8_t bank) NO_OVERLAY_LOCALS
SET_SHADOW_OAM_ADDRESS
void SET_SHADOW_OAM_ADDRESS(void *address)
Definition: nes.h:1081
get_sprite_prop
uint8_t get_sprite_prop(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:1955
set_bkg_based_tiles
void set_bkg_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
Definition: nes.h:845
set_bkg_attributes
void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes)
Definition: nes.h:756
OAM_item_t
struct OAM_item_t OAM_item_t
joypad
uint8_t joypad(void) NO_OVERLAY_LOCALS
hide_sprite
void hide_sprite(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:2000
set_bkg_1bpp_data
void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
int_handler
void(* int_handler)(void) NONBANKED
Definition: nes.h:193
remove_TIM
void remove_TIM(int_handler h) NO_OVERLAY_LOCALS
set_sprite_prop
void set_sprite_prop(uint8_t nb, uint8_t prop) NO_OVERLAY_LOCALS
Definition: gb.h:1945
display_off
void display_off(void) NO_OVERLAY_LOCALS
Definition: msx.h:248
SYSTEM_60HZ
#define SYSTEM_60HZ
Definition: nes.h:33
palette_color_t
uint8_t palette_color_t
Definition: nes.h:65
set_2bpp_palette
void set_2bpp_palette(uint16_t palette)
Definition: nes.h:652
get_bkg_xy_addr
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
_map_tile_offset
uint8_t _map_tile_offset
set_bkg_palette_entry
void set_bkg_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS
set_bkg_submap_attributes_nes16x16
void set_bkg_submap_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) NO_OVERLAY_LOCALS
set_bkg_palette
void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS
_submap_tile_offset
uint8_t _submap_tile_offset
get_bkg_tiles
void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) NO_OVERLAY_LOCALS
get_mode
uint8_t get_mode(void) NO_OVERLAY_LOCALS
set_bkg_based_submap
void set_bkg_based_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w, uint8_t base_tile)
Definition: nes.h:905
set_bkg_submap
void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) NO_OVERLAY_LOCALS
Definition: msx.h:627
remove_LCD
void remove_LCD(int_handler h) NO_OVERLAY_LOCALS
add_TIM
void add_TIM(int_handler h) NO_OVERLAY_LOCALS
set_sprite_palette_entry
void set_sprite_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS
init_bkg
void init_bkg(uint8_t c) NO_OVERLAY_LOCALS
add_LCD
void add_LCD(int_handler h) NO_OVERLAY_LOCALS
SYSTEM_50HZ
#define SYSTEM_50HZ
Definition: nes.h:34
get_bkg_tile_xy
uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
set_sprite_data
void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
set_1bpp_colors
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
Definition: nes.h:658
mode
void mode(uint8_t m) NO_OVERLAY_LOCALS
waitpadup
void waitpadup(void) NO_OVERLAY_LOCALS
set_data
void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) NO_OVERLAY_LOCALS
joypad_ex
void joypad_ex(joypads_t *joypads) NO_OVERLAY_LOCALS
rgb_to_nes_macro.h
stdint.h
uint8_t
unsigned char uint8_t
Definition: stdint.h:51
uint16_t
unsigned short int uint16_t
Definition: stdint.h:52
int8_t
signed char int8_t
Definition: stdint.h:43
OAM_item_t
Definition: gb.h:1823
OAM_item_t::x
uint8_t x
Definition: gb.h:1824
OAM_item_t::prop
uint8_t prop
Definition: gb.h:1826
OAM_item_t::tile
uint8_t tile
Definition: gb.h:1825
OAM_item_t::y
uint8_t y
Definition: gb.h:1824
joypads_t
Definition: gb.h:755
version.h