GBDK 2020 Docs  4.3.0
API Documentation for GBDK 2020
gb.h
Go to the documentation of this file.
1 
4 #ifndef _GB_H
5 #define _GB_H
6 
7 #include <types.h>
8 #include <stdint.h>
9 #include <gbdk/version.h>
10 #include <gb/hardware.h>
11 
12 // Here NINTENDO means Game Boy & related clones
13 #define NINTENDO
14 
15 #ifdef SEGA
16 #undef SEGA
17 #endif
18 
19 #ifdef NINTENDO_NES
20 #undef NINTENDO_NES
21 #endif
22 
23 #ifdef MSX
24 #undef MSX
25 #endif
26 
27 #define SYSTEM_60HZ 0x00
28 #define SYSTEM_50HZ 0x01
29 
30 #if defined(__TARGET_ap)
31 #define ANALOGUEPOCKET
32 #elif defined(__TARGET_gb)
33 #define GAMEBOY
34 #elif defined(__TARGET_duck)
35 #define MEGADUCK
36 #endif
37 
38 
52 #define J_UP 0x04U
53 #define J_DOWN 0x08U
54 #define J_LEFT 0x02U
55 #define J_RIGHT 0x01U
56 #define J_A 0x10U
57 #define J_B 0x20U
58 #define J_SELECT 0x40U
59 #define J_START 0x80U
60 
65 #define M_DRAWING 0x01U
66 #define M_TEXT_OUT 0x02U
67 #define M_TEXT_INOUT 0x03U
73 #define M_NO_SCROLL 0x04U
77 #define M_NO_INTERP 0x08U
78 
83 #define S_BANK 0x08U
88 #define S_PALETTE 0x10U
92 #define S_FLIPX 0x20U
96 #define S_FLIPY 0x40U
101 #define S_PRIORITY 0x80U
105 #define S_PAL(n) n
106 
107 /* Interrupt flags */
110 #define EMPTY_IFLAG 0x00U
116 #define VBL_IFLAG 0x01U
120 #define LCD_IFLAG 0x02U
124 #define TIM_IFLAG 0x04U
128 #define SIO_IFLAG 0x08U
132 #define JOY_IFLAG 0x10U
133 
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
170 #define MINWNDPOSX DEVICE_WINDOW_PX_OFFSET_X
173 #define MINWNDPOSY DEVICE_WINDOW_PX_OFFSET_Y
176 #define MAXWNDPOSX (DEVICE_WINDOW_PX_OFFSET_X + DEVICE_SCREEN_PX_WIDTH - 1)
179 #define MAXWNDPOSY (DEVICE_WINDOW_PX_OFFSET_Y + DEVICE_SCREEN_PX_HEIGHT - 1)
180 
181 
184 typedef void (*int_handler)(void) NONBANKED;
185 
194 
199 
204 
217 
222 
247 
287 
302 
319 
336 
337 
362 
363 
380 
381 
394 void wait_int_handler(void);
395 
399  return IF_REG = 0;
400 }
401 
408 void mode(uint8_t m);
409 
415 
421 inline uint8_t get_system(void) {
422  return SYSTEM_60HZ;
423 }
424 
429 extern uint8_t _cpu;
430 
433 #define DMG_TYPE 0x01
436 #define MGB_TYPE 0xFF
439 #define CGB_TYPE 0x11
440 
445 extern uint8_t _is_GBA;
446 
449 #define GBA_NOT_DETECTED 0x00
452 #define GBA_DETECTED 0x01
453 
456 #define DEVICE_SUPPORTS_COLOR (_cpu == CGB_TYPE)
457 
464 extern volatile uint16_t sys_time;
465 
466 
467 
475 void send_byte(void);
476 
484 void receive_byte(void);
485 
487 extern volatile uint8_t _io_status;
488 
491 extern volatile uint8_t _io_in;
492 
495 extern volatile uint8_t _io_out;
496 
497 /* Status codes */
499 #define IO_IDLE 0x00U
501 #define IO_SENDING 0x01U
503 #define IO_RECEIVING 0x02U
505 #define IO_ERROR 0x04U
506 
507 
508 
523 #define CURRENT_BANK _current_bank
524 
534 #ifndef BANK
535 #define BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME )
536 #endif
537 
550 #define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \
551 __asm \
552  .local b___func_ ## VARNAME \
553  ___bank_ ## VARNAME = b___func_ ## VARNAME \
554  .globl ___bank_ ## VARNAME \
555 __endasm; \
556 }
557 
567 #define BANKREF_EXTERN(VARNAME) extern const void __bank_ ## VARNAME;
568 
584 #define SWITCH_ROM(b) (_current_bank = (b), rROMB0 = (b))
585 
586 #if defined(__TARGET_duck)
587 
588 #define SWITCH_RAM(b) (0)
589 
590 #define ENABLE_RAM
591 
592 #define DISABLE_RAM
593 
594 #else
595 
603 #define SWITCH_RAM(b) (rRAMB = (b))
604 
607 #define ENABLE_RAM (rRAMG = 0x0A)
608 
611 #define DISABLE_RAM (rRAMG = 0x00)
612 
613 #endif
614 
618 #define SWITCH_ROM_MEGADUCK(b) SWITCH_ROM(b)
619 
628 #define SWITCH_ROM_MBC1(b) SWITCH_ROM(b)
629 
637 #define SWITCH_RAM_MBC1(b) SWITCH_RAM(b)
638 
641 #define ENABLE_RAM_MBC1 ENABLE_RAM
642 
645 #define DISABLE_RAM_MBC1 DISABLE_RAM
646 
647 #define SWITCH_16_8_MODE_MBC1 (*(volatile uint8_t *)0x6000 = 0x00)
648 
649 #define SWITCH_4_32_MODE_MBC1 (*(volatile uint8_t *)0x6000 = 0x01)
650 
663 #define SWITCH_ROM_MBC5(b) (_current_bank = (b), rROMB1 = 0, rROMB0 = (b))
664 
678 #define SWITCH_ROM_MBC5_8M(b) (rROMB1 = ((uint16_t)(b) >> 8), rROMB0 = (b))
679 
685 #define SWITCH_RAM_MBC5(b) SWITCH_RAM(b)
686 
689 #define ENABLE_RAM_MBC5 ENABLE_RAM
690 
693 #define DISABLE_RAM_MBC5 DISABLE_RAM
694 
695 
696 
702 
703 
704 
716 
730 
736 void waitpadup(void) PRESERVES_REGS(a, b, c, d, e, h, l);
737 
743 typedef struct {
745  union {
746  struct {
747  uint8_t joy0, joy1, joy2, joy3;
748  };
749  uint8_t joypads[4];
750  };
751 } joypads_t;
752 
763 
771 
772 
773 
782 inline void enable_interrupts(void) PRESERVES_REGS(a, b, c, d, e, h, l) {
783  __asm__("ei");
784 }
785 
798 inline void disable_interrupts(void) PRESERVES_REGS(a, b, c, d, e, h, l) {
799  __asm__("di");
800 }
801 
813 
825 void reset(void);
826 
838 void vsync(void) PRESERVES_REGS(b, c, d, e, h, l);
839 
843 void wait_vbl_done(void) PRESERVES_REGS(b, c, d, e, h, l);
844 
850 void display_off(void) PRESERVES_REGS(b, c, d, e, h, l);
851 
854 void refresh_OAM(void) PRESERVES_REGS(b, c, d, e, h, l);
855 
856 
862 void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL PRESERVES_REGS(b, c);
863 
864 
868 #define DISPLAY_ON \
869  LCDC_REG|=LCDCF_ON
870 
876 #define DISPLAY_OFF \
877  display_off();
878 
881 #define HIDE_LEFT_COLUMN
882 
885 #define SHOW_LEFT_COLUMN
886 
889 #define SET_BORDER_COLOR(C)
890 
900 #define SHOW_BKG \
901  LCDC_REG|=LCDCF_BGON
902 
912 #define HIDE_BKG \
913  LCDC_REG&=~LCDCF_BGON
914 
924 #define SHOW_WIN \
925  LCDC_REG|=LCDCF_WINON
926 
930 #define HIDE_WIN \
931  LCDC_REG&=~LCDCF_WINON
932 
936 #define SHOW_SPRITES \
937  LCDC_REG|=LCDCF_OBJON
938 
944 #define HIDE_SPRITES \
945  LCDC_REG&=~LCDCF_OBJON
946 
950 #define SPRITES_8x16 \
951  LCDC_REG|=LCDCF_OBJ16
952 
956 #define SPRITES_8x8 \
957  LCDC_REG&=~LCDCF_OBJ16
958 
959 
960 
968 
981 
982 
987 
988 #define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0)))
989 
992 inline void set_2bpp_palette(uint16_t palette) {
993  palette;
994 }
995 
997 
1006 
1026 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
1027  set_1bpp_colors_ex(fgcolor, bgcolor, 0);
1028 }
1029 
1047 void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1048 #define set_bkg_2bpp_data set_bkg_data
1049 
1068 void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1069 
1090 void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1091 
1092 
1146 #define set_tile_map set_bkg_tiles
1147 
1148 
1149 extern uint8_t _map_tile_offset;
1150 
1169 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) {
1170  _map_tile_offset = base_tile;
1171  set_bkg_tiles(x, y, w, h, tiles);
1172  _map_tile_offset = 0;
1173 }
1174 
1175 
1224 inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
1225 {
1227  set_bkg_tiles(x, y, w, h, tiles);
1228  VBK_REG = VBK_TILES;
1229 }
1230 
1231 
1277 void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL;
1278 #define set_tile_submap set_bkg_submap
1279 
1280 
1282 
1302 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) {
1303  _submap_tile_offset = base_tile;
1304  set_bkg_submap(x, y, w, h, map, map_w);
1305  _submap_tile_offset = 0;
1306 }
1307 
1308 
1356 inline void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
1357 {
1359  set_bkg_submap(x, y, w, h, map, map_w);
1360  VBK_REG = VBK_TILES;
1361 }
1362 
1363 
1388 
1389 
1398 #define set_tile_xy set_bkg_tile_xy
1399 
1409 {
1410  uint8_t* addr;
1412  addr = set_bkg_tile_xy(x, y, a);
1413  VBK_REG = VBK_TILES;
1414  return addr;
1415 }
1416 #define set_attribute_xy set_bkg_attribute_xy
1417 
1433 
1434 
1448 inline void move_bkg(uint8_t x, uint8_t y) {
1449  SCX_REG=x, SCY_REG=y;
1450 }
1451 
1452 
1462 inline void scroll_bkg(int8_t x, int8_t y) {
1463  SCX_REG+=x, SCY_REG+=y;
1464 }
1465 
1466 
1467 
1472 
1486 void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1487 
1488 
1507 void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1508 
1509 
1527 void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1528 
1529 
1562 
1563 
1582 inline void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile) {
1583  _map_tile_offset = base_tile;
1584  set_win_tiles(x, y, w, h, tiles);
1585  _map_tile_offset = 0;
1586 }
1587 
1635 void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL;
1636 
1637 
1657 inline void set_win_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) {
1658  _submap_tile_offset = base_tile;
1659  set_win_submap(x, y, w, h, map, map_w);
1660  _submap_tile_offset = 0;
1661 }
1662 
1663 
1688 
1689 
1698 
1699 
1713 
1714 
1726 inline void move_win(uint8_t x, uint8_t y) {
1727  WX_REG=x, WY_REG=y;
1728 }
1729 
1730 
1740 inline void scroll_win(int8_t x, int8_t y) {
1741  WX_REG+=x, WY_REG+=y;
1742 }
1743 
1744 
1745 
1761 void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1762 #define set_sprite_2bpp_data set_sprite_data
1763 
1782 void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1783 
1802 void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1803 
1804 
1811 typedef struct OAM_item_t {
1812  uint8_t y, x; //< X, Y Coordinates of the sprite on screen
1813  uint8_t tile; //< Sprite tile number
1814  uint8_t prop; //< OAM Property Flags
1816 
1817 
1820 extern volatile struct OAM_item_t shadow_OAM[];
1821 
1825 
1826 #define DISABLE_OAM_DMA \
1827  _shadow_OAM_base = 0
1828 
1831 #define DISABLE_VBL_TRANSFER DISABLE_OAM_DMA
1832 
1833 #define ENABLE_OAM_DMA \
1834  _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
1835 
1838 #define ENABLE_VBL_TRANSFER ENABLE_OAM_DMA
1839 
1842 #define MAX_HARDWARE_SPRITES 40
1843 
1846 #define HARDWARE_SPRITE_CAN_FLIP_X 1
1847 
1850 #define HARDWARE_SPRITE_CAN_FLIP_Y 1
1851 
1854 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
1855  _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
1856 }
1857 
1875  shadow_OAM[nb].tile=tile;
1876 }
1877 
1878 
1886  return shadow_OAM[nb].tile;
1887 }
1888 
1889 
1934  shadow_OAM[nb].prop=prop;
1935 }
1936 
1937 
1944  return shadow_OAM[nb].prop;
1945 }
1946 
1947 
1960 inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) {
1961  OAM_item_t * itm = &shadow_OAM[nb];
1962  itm->y=y, itm->x=x;
1963 }
1964 
1965 
1976 inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) {
1977  OAM_item_t * itm = &shadow_OAM[nb];
1978  itm->y+=y, itm->x+=x;
1979 }
1980 
1981 
1988 inline void hide_sprite(uint8_t nb) {
1989  shadow_OAM[nb].y = 0;
1990 }
1991 
1992 
1993 
2009 void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len);
2010 
2011 
2033 void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len);
2034 
2047 void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len);
2048 
2049 
2050 
2074 void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL;
2075 
2086 void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b, c);
2087 
2115 void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL;
2116 
2117 
2132 inline void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
2133  if (first_tile < 256) {
2134  set_bkg_data(first_tile, nb_tiles, data);
2135  } else {
2136  set_sprite_data(first_tile - 256, nb_tiles, data);
2137  }
2138 }
2139 
2155 inline void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
2156  set_bkg_data(first_tile, nb_tiles, data);
2157 }
2158 
2172 inline void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
2173  set_sprite_data(first_tile, nb_tiles, data);
2174 }
2175 
2182 
2189 
2197 void vmemset (void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b, c);
2198 
2199 
2200 
2210 #define fill_rect fill_bkg_rect
2211 
2221 
2222 #endif /* _GB_H */
#define OLDCALL
Definition: types.h:21
#define NONBANKED
Definition: types.h:40
#define PRESERVES_REGS(...)
Definition: types.h:32
#define __REG
Definition: hardware.h:14
__REG WY_REG
Definition: hardware.h:305
__REG SCY_REG
Definition: hardware.h:289
__REG WX_REG
Definition: hardware.h:307
#define VBK_ATTRIBUTES
Definition: hardware.h:322
__REG IF_REG
Definition: hardware.h:88
__REG VBK_REG
Definition: hardware.h:316
#define VBK_TILES
Definition: hardware.h:320
__REG SCX_REG
Definition: hardware.h:291
volatile uint8_t _io_in
void set_sprite_tile(uint8_t nb, uint8_t tile)
Definition: gb.h:1874
uint8_t d
Definition: gb.h:414
uint8_t c
Definition: gb.h:414
void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
Definition: gb.h:1224
void send_byte(void)
void scroll_win(int8_t x, int8_t y)
Definition: gb.h:1740
void refresh_OAM(void) PRESERVES_REGS(b
void set_win_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: gb.h:1657
void set_bkg_submap_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
Definition: gb.h:1356
void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) OLDCALL
void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
void scroll_bkg(int8_t x, int8_t y)
Definition: gb.h:1462
uint16_t _current_1bpp_colors
void set_vram_byte(uint8_t *addr, uint8_t v) PRESERVES_REGS(b
void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len)
uint8_t get_win_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
volatile uint8_t _io_status
void remove_SIO(int_handler h)
void receive_byte(void)
volatile struct OAM_item_t shadow_OAM[]
void reset(void)
uint8_t * set_bkg_attribute_xy(uint8_t x, uint8_t y, uint8_t a)
Definition: gb.h:1408
uint8_t get_system(void)
Definition: gb.h:421
uint8_t joypad(void) PRESERVES_REGS(b
void init_bkg(uint8_t c) OLDCALL PRESERVES_REGS(b
void b
Definition: gb.h:736
void wait_int_handler(void)
void nowait_int_handler(void)
uint8_t _is_GBA
uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
void set_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len)
void add_low_priority_TIM(int_handler h)
void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL
void remove_TIM(int_handler h)
void move_bkg(uint8_t x, uint8_t y)
Definition: gb.h:1448
void remove_JOY(int_handler h)
void remove_LCD(int_handler h)
void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: gb.h:2132
uint8_t get_sprite_prop(uint8_t nb)
Definition: gb.h:1943
void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
Definition: gb.h:1976
void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b
void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
void set_win_based_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles, uint8_t base_tile)
Definition: gb.h:1582
void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len)
volatile uint16_t sys_time
void delay(uint16_t d) PRESERVES_REGS(h
__REG _shadow_OAM_base
Definition: gb.h:1824
void SET_SHADOW_OAM_ADDRESS(void *address)
Definition: gb.h:1854
void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
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: gb.h:1169
void wait_vbl_done(void) PRESERVES_REGS(b
void add_VBL(int_handler h)
uint8_t _cpu
void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
struct OAM_item_t OAM_item_t
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
void(* int_handler)(void) NONBANKED
Definition: gb.h:184
void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL PRESERVES_REGS(b
void vmemset(void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b
__REG _current_bank
Definition: gb.h:522
#define SYSTEM_60HZ
Definition: gb.h:27
void set_sprite_prop(uint8_t nb, uint8_t prop)
Definition: gb.h:1933
void add_TIM(int_handler h)
uint8_t get_mode(void) PRESERVES_REGS(b
void set_2bpp_palette(uint16_t palette)
Definition: gb.h:992
void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b
uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b
uint8_t _map_tile_offset
void set_sprite_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: gb.h:2172
uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t)
void enable_interrupts(void) PRESERVES_REGS(a
void display_off(void) PRESERVES_REGS(b
void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
Definition: gb.h:1960
uint8_t _submap_tile_offset
void joypad_ex(joypads_t *joypads) PRESERVES_REGS(b
uint8_t joypad_init(uint8_t npads, joypads_t *joypads) OLDCALL
uint8_t h
Definition: gb.h:414
uint8_t waitpad(uint8_t mask) PRESERVES_REGS(b
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: gb.h:1302
void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b
void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t)
void remove_VBL(int_handler h)
volatile uint8_t _io_out
void set_bkg_native_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data)
Definition: gb.h:2155
void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
void hide_sprite(uint8_t nb)
Definition: gb.h:1988
void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
void waitpadup(void) PRESERVES_REGS(a
void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
Definition: msx.h:619
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
Definition: gb.h:1026
void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b
uint8_t cancel_pending_interrupts(void)
Definition: gb.h:398
void add_LCD(int_handler h)
uint8_t get_vram_byte(uint8_t *addr) PRESERVES_REGS(b
void add_JOY(int_handler h)
void disable_interrupts(void) PRESERVES_REGS(a
void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b
void add_SIO(int_handler h)
void set_interrupts(uint8_t flags) PRESERVES_REGS(b
uint8_t e
Definition: gb.h:414
void move_win(uint8_t x, uint8_t y)
Definition: gb.h:1726
void vsync(void) PRESERVES_REGS(b
uint8_t get_sprite_tile(uint8_t nb)
Definition: gb.h:1885
void init_win(uint8_t c) OLDCALL PRESERVES_REGS(b
uint8_t l
Definition: gb.h:414
void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL
Definition: msx.h:622
void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL
void mode(uint8_t m)
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
uint8_t joy0
Definition: gb.h:747
uint8_t npads
Definition: gb.h:744