GBDK 2020 Docs  4.3.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 RGB(r,g,b) RGB_TO_NES(((r) | ((g) << 2) | ((b) << 4)))
37 #define RGB8(r,g,b) RGB_TO_NES((((r) >> 6) | (((g) >> 6) << 2) | (((b) >> 6) << 4)))
38 #define RGBHTML(RGB24bit) RGB_TO_NES((((RGB24bit) >> 22) | ((((RGB24bit) & 0xFFFF) >> 14) << 2) | ((((RGB24bit) & 0xFF) >> 6) << 4)))
39 
45 #define RGB_RED 0x16 // EGA12
46 #define RGB_DARKRED 0x06 // EGA4
47 #define RGB_GREEN 0x2A // EGA10
48 #define RGB_DARKGREEN 0x1A // EGA2
49 #define RGB_BLUE 0x12 // EGA9
50 #define RGB_DARKBLUE 0x02 // EGA1
51 #define RGB_YELLOW 0x28 // EGA14
52 #define RGB_DARKYELLOW 0x18 // EGA6
53 #define RGB_CYAN 0x2C // EGA11
54 #define RGB_AQUA 0x1C // EGA3
55 #define RGB_PINK 0x24 // EGA13
56 #define RGB_PURPLE 0x14 // EGA5
57 #define RGB_BLACK 0x0F // EGA0
58 #define RGB_DARKGRAY 0x00 // EGA8
59 #define RGB_LIGHTGRAY 0x10 // EGA7
60 #define RGB_WHITE 0x30 // EGA15
61 
63 
64 void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS;
65 
66 void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS;
67 
68 void set_bkg_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS;
69 
70 void set_sprite_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS;
71 
85 #define J_UP 0x08U
86 #define J_DOWN 0x04U
87 #define J_LEFT 0x02U
88 #define J_RIGHT 0x01U
89 #define J_A 0x80U
90 #define J_B 0x40U
91 #define J_SELECT 0x20U
92 #define J_START 0x10U
93 
98 #define M_DRAWING 0x01U
99 #define M_TEXT_OUT 0x02U
100 #define M_TEXT_INOUT 0x03U
106 #define M_NO_SCROLL 0x04U
110 #define M_NO_INTERP 0x08U
111 
116 #define S_PALETTE 0x10U
120 #define S_FLIPX 0x40U
124 #define S_FLIPY 0x80U
129 #define S_PRIORITY 0x20U
133 #define S_PAL(n) n
134 
135 /* DMG Palettes */
136 #define DMG_BLACK 0x03
137 #define DMG_DARK_GRAY 0x02
138 #define DMG_LITE_GRAY 0x01
139 #define DMG_WHITE 0x00
159 #define DMG_PALETTE(C0, C1, C2, C3) ((uint8_t)((((C3) & 0x03) << 6) | (((C2) & 0x03) << 4) | (((C1) & 0x03) << 2) | ((C0) & 0x03)))
160 
161 /* Limits */
164 #define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH
167 #define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT
168 
171 typedef void (*int_handler)(void) NONBANKED;
172 
180 void remove_VBL(int_handler h) NO_OVERLAY_LOCALS;
181 
185 void remove_LCD(int_handler h) NO_OVERLAY_LOCALS;
186 
215 void add_VBL(int_handler h) NO_OVERLAY_LOCALS;
216 
249 void add_LCD(int_handler h) NO_OVERLAY_LOCALS;
250 
253 #define MAX_LCD_ISR_CALLS 4
254 
261 void mode(uint8_t m) NO_OVERLAY_LOCALS;
262 
267 uint8_t get_mode(void) NO_OVERLAY_LOCALS;
268 
272 inline uint8_t get_system(void) {
274  return SYSTEM_60HZ;
275  else
276  return SYSTEM_50HZ;
277 }
278 
285 extern volatile uint16_t sys_time;
286 
297 extern volatile uint8_t _current_bank;
298 #define CURRENT_BANK _current_bank
299 
309 #ifndef BANK
310 #define BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME )
311 #endif
312 
325 #define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \
326 __asm \
327  .local b___func_ ## VARNAME \
328  ___bank_ ## VARNAME = b___func_ ## VARNAME \
329  .globl ___bank_ ## VARNAME \
330 __endasm; \
331 }
332 
342 #define BANKREF_EXTERN(VARNAME) extern const void __bank_ ## VARNAME;
343 
347 #define SWITCH_ROM_DUMMY(b)
348 
352 #define SWITCH_ROM_UNROM(b) _switch_prg0(b)
353 
359 #define SWITCH_ROM SWITCH_ROM_UNROM
360 
365 #define SWITCH_RAM(b) 0
366 
370 #define ENABLE_RAM
371 
375 #define DISABLE_RAM
376 
381 void delay(uint16_t d) NO_OVERLAY_LOCALS;
382 
392 uint8_t joypad(void) NO_OVERLAY_LOCALS;
393 
402 uint8_t waitpad(uint8_t mask) NO_OVERLAY_LOCALS;
403 
407 void waitpadup(void) NO_OVERLAY_LOCALS;
408 
414 typedef struct {
415  uint8_t npads;
416  union {
417  struct {
418  uint8_t joy0, joy1, joy2, joy3;
419  };
420  uint8_t joypads[4];
421  };
422 } joypads_t;
423 
432 uint8_t joypad_init(uint8_t npads, joypads_t * joypads) NO_OVERLAY_LOCALS;
433 
438 void joypad_ex(joypads_t * joypads) NO_OVERLAY_LOCALS;
439 
440 
441 
450 inline void enable_interrupts(void) {
451  __asm__("cli");
452 }
453 
466 inline void disable_interrupts(void) {
467  __asm__("sei");
468 }
469 
479 void vsync(void) NO_OVERLAY_LOCALS;
480 
483 void wait_vbl_done(void) NO_OVERLAY_LOCALS;
484 
489 void display_on(void) NO_OVERLAY_LOCALS;
490 
494 void display_off(void) NO_OVERLAY_LOCALS;
495 
498 void refresh_OAM(void) NO_OVERLAY_LOCALS;
499 
503 #define DISPLAY_ON \
504  display_on();
505 
509 #define DISPLAY_OFF \
510  display_off();
511 
515 #define HIDE_LEFT_COLUMN \
516  shadow_PPUMASK &= ~(PPUMASK_SHOW_BG_LC | PPUMASK_SHOW_SPR_LC); \
517 
521 #define SHOW_LEFT_COLUMN \
522  shadow_PPUMASK |= (PPUMASK_SHOW_BG_LC | PPUMASK_SHOW_SPR_LC);
523 
527 #define SET_BORDER_COLOR(C)
528 
532 #define SHOW_BKG \
533  shadow_PPUMASK |= PPUMASK_SHOW_BG;
534 
538 #define HIDE_BKG \
539  shadow_PPUMASK &= ~PPUMASK_SHOW_BG;
540 
544 #define SHOW_SPRITES \
545  shadow_PPUMASK |= PPUMASK_SHOW_SPR;
546 
550 #define HIDE_SPRITES \
551  shadow_PPUMASK &= ~PPUMASK_SHOW_SPR;
552 
556 #define SPRITES_8x16 \
557  shadow_PPUCTRL |= PPUCTRL_SPR_8X16;
558 
562 #define SPRITES_8x8 \
563  shadow_PPUCTRL &= ~PPUCTRL_SPR_8X16;
564 
565 
566 
573 void set_vram_byte(uint8_t * addr, uint8_t v) NO_OVERLAY_LOCALS;
574 
578 uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
579 
580 #define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0)))
581 
584 inline void set_2bpp_palette(uint16_t palette) {
585  palette;
586 }
587 
589 void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) NO_OVERLAY_LOCALS;
590 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
591  set_1bpp_colors_ex(fgcolor, bgcolor, 0);
592 }
593 
603 void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
604 #define set_bkg_2bpp_data set_bkg_data
605 
617 void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
618 
637 void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) NO_OVERLAY_LOCALS;
638 #define set_tile_map set_bkg_tiles
639 
663 void set_bkg_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes) NO_OVERLAY_LOCALS;
664 
688 inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes)
689 {
690  set_bkg_attributes_nes16x16(x >> 1, y >> 1, (w + 1) >> 1, (h + 1) >> 1, attributes);
691 }
737 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;
738 
751 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)
752 {
753  set_bkg_submap_attributes_nes16x16(x >> 1, y >> 1, (w + 1) >> 1, (h + 1) >> 1, attributes, map_w >> 1);
754 }
755 
756 
758 
777 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) {
778  _map_tile_offset = base_tile;
779  set_bkg_tiles(x, y, w, h, tiles);
780  _map_tile_offset = 0;
781 }
782 
783 
812 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;
813 #define set_tile_submap set_bkg_submap
814 
815 
817 
837 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) {
838  _submap_tile_offset = base_tile;
839  set_bkg_submap(x, y, w, h, map, map_w);
841 }
842 
843 
855 void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) NO_OVERLAY_LOCALS;
856 
857 
865 uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) NO_OVERLAY_LOCALS;
866 #define set_tile_xy set_bkg_tile_xy
867 
875 void set_bkg_attribute_xy_nes16x16(uint8_t x, uint8_t y, uint8_t a) NO_OVERLAY_LOCALS;
876 
890 {
891  set_bkg_attribute_xy_nes16x16(x >> 1, y >> 1, a);
892 }
893 #define set_attribute_xy set_bkg_attribute_xy
894 
901 uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
902 
903 
917 inline void move_bkg(uint8_t x, uint8_t y) {
918  bkg_scroll_x = x, bkg_scroll_y = y;
919 }
920 
921 
931 inline void scroll_bkg(int8_t x, int8_t y) {
932  bkg_scroll_x += x, bkg_scroll_y += y;
933 }
934 
935 
947 void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
948 #define set_sprite_2bpp_data set_sprite_data
949 
961 void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
962 
969 typedef struct OAM_item_t {
970  uint8_t y; //< Y coordinate of the sprite on screen - 1
971  uint8_t tile; //< Sprite tile number
972  uint8_t prop; //< OAM Property Flags
973  uint8_t x; //< X coordinate of the sprite on screen
975 
976 
979 extern volatile struct OAM_item_t shadow_OAM[];
980 
984 
985 #define DISABLE_OAM_DMA \
986  _shadow_OAM_base = 0
987 
990 #define DISABLE_VBL_TRANSFER DISABLE_OAM_DMA
991 
992 #define ENABLE_OAM_DMA \
993  _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
994 
997 #define ENABLE_VBL_TRANSFER ENABLE_OAM_DMA
998 
1001 #define MAX_HARDWARE_SPRITES 64
1002 
1005 #define HARDWARE_SPRITE_CAN_FLIP_X 1
1006 
1009 #define HARDWARE_SPRITE_CAN_FLIP_Y 1
1010 
1013 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
1014  _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
1015 }
1016 
1030 void set_sprite_tile(uint8_t nb, uint8_t tile) NO_OVERLAY_LOCALS;
1031 
1032 
1039 uint8_t get_sprite_tile(uint8_t nb) NO_OVERLAY_LOCALS;
1040 
1041 
1079 void set_sprite_prop(uint8_t nb, uint8_t prop) NO_OVERLAY_LOCALS;
1080 
1081 
1087 uint8_t get_sprite_prop(uint8_t nb) NO_OVERLAY_LOCALS;
1088 
1089 
1099 void move_sprite(uint8_t nb, uint8_t x, uint8_t y) NO_OVERLAY_LOCALS;
1100 
1101 
1112 void scroll_sprite(uint8_t nb, int8_t x, int8_t y) NO_OVERLAY_LOCALS;
1113 
1114 
1119 void hide_sprite(uint8_t nb) NO_OVERLAY_LOCALS;
1120 
1121 
1122 
1130 void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) NO_OVERLAY_LOCALS;
1131 
1132 
1151 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;
1152 
1158 inline void set_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
1159  if (first_tile < 256) {
1160  set_bkg_data(first_tile, nb_tiles, data);
1161  if(first_tile + nb_tiles > 256)
1162  set_sprite_data(first_tile - 256, nb_tiles, data);
1163  } else {
1164  set_sprite_data(first_tile - 256, nb_tiles, data);
1165  }
1166 }
1167 
1179 void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
1180 
1190 void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS;
1191 
1205 inline void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
1206  if (first_tile < 256) {
1207  set_bkg_native_data(first_tile, nb_tiles, data);
1208  if(first_tile + nb_tiles > 256)
1209  set_sprite_native_data(first_tile - 256, nb_tiles, data);
1210  } else {
1211  set_sprite_native_data(first_tile - 256, nb_tiles, data);
1212  }
1213 }
1214 
1220 void init_bkg(uint8_t c) NO_OVERLAY_LOCALS;
1221 
1229 void vmemset (void *s, uint8_t c, size_t n) NO_OVERLAY_LOCALS;
1230 
1239 void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) NO_OVERLAY_LOCALS;
1240 #define fill_rect fill_bkg_rect
1241 
1249 void flush_shadow_attributes(void) NO_OVERLAY_LOCALS;
1250 
1251 uint8_t _switch_prg0(uint8_t bank) NO_OVERLAY_LOCALS;
1252 
1253 #endif /* _NES_H */
char c
Definition: string.h:20
#define NONBANKED
Definition: types.h:40
uint16_t palette_color_t
Definition: cgb.h:85
uint8_t d
Definition: gb.h:414
uint8_t h
Definition: gb.h:414
__SHADOW_REG bkg_scroll_x
Definition: hardware.h:56
__SHADOW_REG bkg_scroll_y
Definition: hardware.h:57
uint8_t waitpad(uint8_t mask) NO_OVERLAY_LOCALS
void flush_shadow_attributes(void) NO_OVERLAY_LOCALS
void set_bkg_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes) NO_OVERLAY_LOCALS
void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) NO_OVERLAY_LOCALS
volatile uint8_t _current_bank
Definition: gb.h:522
#define SYSTEM_BITS_NTSC
Definition: nes.h:28
void scroll_bkg(int8_t x, int8_t y)
Definition: nes.h:931
void delay(uint16_t d) NO_OVERLAY_LOCALS
void enable_interrupts(void)
Definition: nes.h:450
uint16_t _current_1bpp_colors
void set_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: nes.h:1158
void disable_interrupts(void)
Definition: nes.h:466
void vmemset(void *s, uint8_t c, size_t n) NO_OVERLAY_LOCALS
void set_sprite_tile(uint8_t nb, uint8_t tile) NO_OVERLAY_LOCALS
Definition: gb.h:1874
uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) NO_OVERLAY_LOCALS
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:751
volatile struct OAM_item_t shadow_OAM[]
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
void move_sprite(uint8_t nb, uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
Definition: gb.h:1960
uint8_t get_system(void)
Definition: nes.h:272
void display_on(void) NO_OVERLAY_LOCALS
void add_VBL(int_handler h) NO_OVERLAY_LOCALS
void set_vram_byte(uint8_t *addr, uint8_t v) NO_OVERLAY_LOCALS
void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
uint8_t joypad_init(uint8_t npads, joypads_t *joypads) NO_OVERLAY_LOCALS
void scroll_sprite(uint8_t nb, int8_t x, int8_t y) NO_OVERLAY_LOCALS
Definition: gb.h:1976
uint8_t get_sprite_tile(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:1885
void remove_VBL(int_handler h) NO_OVERLAY_LOCALS
void move_bkg(uint8_t x, uint8_t y)
Definition: nes.h:917
uint8_t _shadow_OAM_base
Definition: gb.h:1824
void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
void wait_vbl_done(void) NO_OVERLAY_LOCALS
void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
Definition: gb.h:2155
void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: nes.h:1205
void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) NO_OVERLAY_LOCALS
void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) NO_OVERLAY_LOCALS
void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
Definition: gb.h:2172
void refresh_OAM(void) NO_OVERLAY_LOCALS
void vsync(void) NO_OVERLAY_LOCALS
volatile uint16_t sys_time
const uint8_t _SYSTEM
void set_bkg_attribute_xy_nes16x16(uint8_t x, uint8_t y, uint8_t a) NO_OVERLAY_LOCALS
void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS
void set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
Definition: nes.h:889
uint8_t _switch_prg0(uint8_t bank) NO_OVERLAY_LOCALS
void SET_SHADOW_OAM_ADDRESS(void *address)
Definition: nes.h:1013
uint8_t get_sprite_prop(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:1943
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:777
void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *attributes)
Definition: nes.h:688
struct OAM_item_t OAM_item_t
uint8_t joypad(void) NO_OVERLAY_LOCALS
void hide_sprite(uint8_t nb) NO_OVERLAY_LOCALS
Definition: gb.h:1988
void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
void(* int_handler)(void) NONBANKED
Definition: nes.h:171
void set_sprite_prop(uint8_t nb, uint8_t prop) NO_OVERLAY_LOCALS
Definition: gb.h:1933
void display_off(void) NO_OVERLAY_LOCALS
Definition: msx.h:248
#define SYSTEM_60HZ
Definition: nes.h:33
uint8_t palette_color_t
Definition: nes.h:62
void set_2bpp_palette(uint16_t palette)
Definition: nes.h:584
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
uint8_t _map_tile_offset
void set_bkg_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS
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
void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) NO_OVERLAY_LOCALS
uint8_t _submap_tile_offset
void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) NO_OVERLAY_LOCALS
uint8_t get_mode(void) NO_OVERLAY_LOCALS
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:837
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:619
void remove_LCD(int_handler h) NO_OVERLAY_LOCALS
void set_sprite_palette_entry(uint8_t palette, uint8_t entry, palette_color_t rgb_data) NO_OVERLAY_LOCALS
void init_bkg(uint8_t c) NO_OVERLAY_LOCALS
void add_LCD(int_handler h) NO_OVERLAY_LOCALS
#define SYSTEM_50HZ
Definition: nes.h:34
uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) NO_OVERLAY_LOCALS
void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) NO_OVERLAY_LOCALS
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
Definition: nes.h:590
void mode(uint8_t m) NO_OVERLAY_LOCALS
void waitpadup(void) NO_OVERLAY_LOCALS
void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) NO_OVERLAY_LOCALS
void joypad_ex(joypads_t *joypads) NO_OVERLAY_LOCALS
unsigned char uint8_t
Definition: stdint.h:51
unsigned short int uint16_t
Definition: stdint.h:52
signed char int8_t
Definition: stdint.h:43
Definition: gb.h:1811
uint8_t x
Definition: gb.h:1812
uint8_t prop
Definition: gb.h:1814
uint8_t tile
Definition: gb.h:1813
uint8_t y
Definition: gb.h:1812
Definition: gb.h:743