GBDK 2020 Docs  4.1.1
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 #define NINTENDO
13 #ifdef SEGA
14 #undef SEGA
15 #endif
16 #if defined(__TARGET_ap)
17 #define ANALOGUEPOCKET
18 #elif defined(__TARGET_gb)
19 #define GAMEBOY
20 #elif defined(__TARGET_duck)
21 #define MEGADUCK
22 #endif
23 
24 
38 #define J_UP 0x04U
39 #define J_DOWN 0x08U
40 #define J_LEFT 0x02U
41 #define J_RIGHT 0x01U
42 #define J_A 0x10U
43 #define J_B 0x20U
44 #define J_SELECT 0x40U
45 #define J_START 0x80U
46 
51 #define M_DRAWING 0x01U
52 #define M_TEXT_OUT 0x02U
53 #define M_TEXT_INOUT 0x03U
59 #define M_NO_SCROLL 0x04U
63 #define M_NO_INTERP 0x08U
64 
69 #define S_PALETTE 0x10U
73 #define S_FLIPX 0x20U
77 #define S_FLIPY 0x40U
82 #define S_PRIORITY 0x80U
86 #define S_PAL(n) n
87 
88 /* Interrupt flags */
91 #define EMPTY_IFLAG 0x00U
97 #define VBL_IFLAG 0x01U
101 #define LCD_IFLAG 0x02U
105 #define TIM_IFLAG 0x04U
109 #define SIO_IFLAG 0x08U
113 #define JOY_IFLAG 0x10U
114 
115 
116 /* DMG Palettes */
117 #define DMG_BLACK 0x03
118 #define DMG_DARK_GRAY 0x02
119 #define DMG_LITE_GRAY 0x01
120 #define DMG_WHITE 0x00
140 #define DMG_PALETTE(C0, C1, C2, C3) ((uint8_t)((((C3) & 0x03) << 6) | (((C2) & 0x03) << 4) | (((C1) & 0x03) << 2) | ((C0) & 0x03)))
141 
142 /* Limits */
145 #define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH
148 #define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT
151 #define MINWNDPOSX 0x07U
154 #define MINWNDPOSY 0x00U
157 #define MAXWNDPOSX 0xA6U
160 #define MAXWNDPOSY 0x8FU
161 
162 
165 typedef void (*int_handler)(void) NONBANKED;
166 
175 
180 
185 
199 
204 
229 
264 
279 
296 
309 
310 
326 
327 
344 
345 
358 void wait_int_handler(void);
359 
363  return IF_REG = 0;
364 }
365 
373 
379 
384 extern uint8_t _cpu;
385 
388 #define DMG_TYPE 0x01
391 #define MGB_TYPE 0xFF
394 #define CGB_TYPE 0x11
395 
400 extern uint8_t _is_GBA;
401 
404 #define GBA_NOT_DETECTED 0x00
407 #define GBA_DETECTED 0x01
408 
411 #define DEVICE_SUPPORTS_COLOR (_cpu == CGB_TYPE)
412 
419 extern volatile uint16_t sys_time;
420 
421 
422 
430 void send_byte(void);
431 
439 void receive_byte(void);
440 
442 extern volatile uint8_t _io_status;
443 
446 extern volatile uint8_t _io_in;
447 
450 extern volatile uint8_t _io_out;
451 
452 /* Status codes */
454 #define IO_IDLE 0x00U
456 #define IO_SENDING 0x01U
458 #define IO_RECEIVING 0x02U
460 #define IO_ERROR 0x04U
461 
462 
463 
475 #define CURRENT_BANK _current_bank
476 
486 #ifndef BANK
487 #define BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME )
488 #endif
489 
502 #define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \
503 __asm \
504  .local b___func_ ## VARNAME \
505  ___bank_ ## VARNAME = b___func_ ## VARNAME \
506  .globl ___bank_ ## VARNAME \
507 __endasm; \
508 }
509 
519 #define BANKREF_EXTERN(VARNAME) extern const void __bank_ ## VARNAME;
520 
536 #define SWITCH_ROM(b) (_current_bank = (b), rROMB0 = (b))
537 
538 #define SWITCH_RAM(b) (rRAMB = (b))
539 
540 #define ENABLE_RAM (rRAMG = 0x0A)
541 
542 #define DISABLE_RAM (rRAMG = 0x00)
543 
547 #define SWITCH_ROM_MEGADUCK(b) SWITCH_ROM(b)
548 
557 #define SWITCH_ROM_MBC1(b) SWITCH_ROM(b)
558 
562 #define SWITCH_RAM_MBC1(b) SWITCH_RAM(b)
563 
572 #define ENABLE_RAM_MBC1 ENABLE_RAM
573 
576 #define DISABLE_RAM_MBC1 DISABLE_RAM
577 
578 #define SWITCH_16_8_MODE_MBC1 (*(volatile uint8_t *)0x6000 = 0x00)
579 
580 #define SWITCH_4_32_MODE_MBC1 (*(volatile uint8_t *)0x6000 = 0x01)
581 
594 #define SWITCH_ROM_MBC5(b) (_current_bank = (b), rROMB1 = 0, rROMB0 = (b))
595 
609 #define SWITCH_ROM_MBC5_8M(b) (rROMB1 = ((uint16_t)(b) >> 8), rROMB0 = (b))
610 
614 #define SWITCH_RAM_MBC5(b) SWITCH_RAM(b)
615 
618 #define ENABLE_RAM_MBC5 ENABLE_RAM
619 
622 #define DISABLE_RAM_MBC5 DISABLE_RAM
623 
624 
625 
631 
632 
633 
645 
659 
665 void waitpadup(void) PRESERVES_REGS(a, b, c, d, e, h, l);
666 
672 typedef struct {
674  union {
675  struct {
676  uint8_t joy0, joy1, joy2, joy3;
677  };
678  uint8_t joypads[4];
679  };
680 } joypads_t;
681 
692 
700 
701 
702 
711 inline void enable_interrupts(void) PRESERVES_REGS(a, b, c, d, e, h, l) {
712  __asm__("ei");
713 }
714 
727 inline void disable_interrupts(void) PRESERVES_REGS(a, b, c, d, e, h, l) {
728  __asm__("di");
729 }
730 
742 
746 void reset(void);
747 
759 void vsync(void) PRESERVES_REGS(b, c, d, e, h, l);
760 
764 void wait_vbl_done(void) PRESERVES_REGS(b, c, d, e, h, l);
765 
771 void display_off(void) PRESERVES_REGS(b, c, d, e, h, l);
772 
775 void refresh_OAM(void) PRESERVES_REGS(b, c, d, e, h, l);
776 
777 
783 void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL PRESERVES_REGS(b, c);
784 
785 
789 #define DISPLAY_ON \
790  LCDC_REG|=LCDCF_ON
791 
795 #define DISPLAY_OFF \
796  display_off();
797 
800 #define HIDE_LEFT_COLUMN
801 
804 #define SHOW_LEFT_COLUMN
805 
809 #define SHOW_BKG \
810  LCDC_REG|=LCDCF_BGON
811 
815 #define HIDE_BKG \
816  LCDC_REG&=~LCDCF_BGON
817 
827 #define SHOW_WIN \
828  LCDC_REG|=LCDCF_WINON
829 
833 #define HIDE_WIN \
834  LCDC_REG&=~LCDCF_WINON
835 
839 #define SHOW_SPRITES \
840  LCDC_REG|=LCDCF_OBJON
841 
847 #define HIDE_SPRITES \
848  LCDC_REG&=~LCDCF_OBJON
849 
853 #define SPRITES_8x16 \
854  LCDC_REG|=LCDCF_OBJ16
855 
859 #define SPRITES_8x8 \
860  LCDC_REG&=~LCDCF_OBJ16
861 
862 
863 
871 
879 
880 
885 
886 #define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0)))
887 
890 inline void set_2bpp_palette(uint16_t palette) {
891  palette;
892 }
893 
895 
904 
924 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
925  set_1bpp_colors_ex(fgcolor, bgcolor, 0);
926 }
927 
945 void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
946 #define set_bkg_2bpp_data set_bkg_data
947 
966 void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
967 
982 void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
983 
984 
1038 #define set_tile_map set_bkg_tiles
1039 
1040 
1041 extern uint8_t _map_tile_offset;
1042 
1061 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) {
1062  _map_tile_offset = base_tile;
1063  set_bkg_tiles(x, y, w, h, tiles);
1064  _map_tile_offset = 0;
1065 }
1066 
1067 
1114 inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
1115 {
1117  set_bkg_tiles(x, y, w, h, tiles);
1118  VBK_REG = VBK_TILES;
1119 }
1120 
1121 
1167 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;
1168 #define set_tile_submap set_bkg_submap
1169 
1170 
1172 
1192 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) {
1193  _submap_tile_offset = base_tile;
1194  set_bkg_submap(x, y, w, h, map, map_w);
1195  _submap_tile_offset = 0;
1196 }
1197 
1198 
1244 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)
1245 {
1247  set_bkg_submap(x, y, w, h, map, map_w);
1248  VBK_REG = VBK_TILES;
1249 }
1250 
1251 
1271 
1272 
1281 #define set_tile_xy set_bkg_tile_xy
1282 
1290 
1291 
1305 inline void move_bkg(uint8_t x, uint8_t y) {
1306  SCX_REG=x, SCY_REG=y;
1307 }
1308 
1309 
1319 inline void scroll_bkg(int8_t x, int8_t y) {
1320  SCX_REG+=x, SCY_REG+=y;
1321 }
1322 
1323 
1324 
1329 
1343 void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1344 
1345 
1364 void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1365 
1366 
1378 void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1379 
1380 
1413 
1414 
1433 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) {
1434  _map_tile_offset = base_tile;
1435  set_win_tiles(x, y, w, h, tiles);
1436  _map_tile_offset = 0;
1437 }
1438 
1486 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;
1487 
1488 
1508 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) {
1509  _submap_tile_offset = base_tile;
1510  set_win_submap(x, y, w, h, map, map_w);
1511  _submap_tile_offset = 0;
1512 }
1513 
1514 
1533 
1534 
1543 
1544 
1552 
1553 
1565 inline void move_win(uint8_t x, uint8_t y) {
1566  WX_REG=x, WY_REG=y;
1567 }
1568 
1569 
1579 inline void scroll_win(int8_t x, int8_t y) {
1580  WX_REG+=x, WY_REG+=y;
1581 }
1582 
1583 
1584 
1600 void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1601 #define set_sprite_2bpp_data set_sprite_data
1602 
1621 void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1622 
1635 void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c);
1636 
1637 
1644 typedef struct OAM_item_t {
1645  uint8_t y, x; //< X, Y Coordinates of the sprite on screen
1646  uint8_t tile; //< Sprite tile number
1647  uint8_t prop; //< OAM Property Flags
1649 
1650 
1653 extern volatile struct OAM_item_t shadow_OAM[];
1654 
1658 
1659 #define DISABLE_OAM_DMA \
1660  _shadow_OAM_base = 0
1661 
1664 #define DISABLE_VBL_TRANSFER DISABLE_OAM_DMA
1665 
1666 #define ENABLE_OAM_DMA \
1667  _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
1668 
1671 #define ENABLE_VBL_TRANSFER ENABLE_OAM_DMA
1672 
1675 #define MAX_HARDWARE_SPRITES 40
1676 
1679 #define HARDWARE_SPRITE_CAN_FLIP_X 1
1680 
1683 #define HARDWARE_SPRITE_CAN_FLIP_Y 1
1684 
1687 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
1688  _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
1689 }
1690 
1708  shadow_OAM[nb].tile=tile;
1709 }
1710 
1711 
1719  return shadow_OAM[nb].tile;
1720 }
1721 
1722 
1754  shadow_OAM[nb].prop=prop;
1755 }
1756 
1757 
1764  return shadow_OAM[nb].prop;
1765 }
1766 
1767 
1780 inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) {
1781  OAM_item_t * itm = &shadow_OAM[nb];
1782  itm->y=y, itm->x=x;
1783 }
1784 
1785 
1796 inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) {
1797  OAM_item_t * itm = &shadow_OAM[nb];
1798  itm->y+=y, itm->x+=x;
1799 }
1800 
1801 
1808 inline void hide_sprite(uint8_t nb) {
1809  shadow_OAM[nb].y = 0;
1810 }
1811 
1812 
1813 
1829 void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len);
1830 
1831 
1847 void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len);
1848 
1861 void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len);
1862 
1863 
1864 
1888 void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL;
1889 
1900 void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b, c);
1901 
1923 void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL;
1924 
1925 
1940 inline void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const uint8_t *data) {
1941  if (first_tile < 256) {
1942  set_bkg_data(first_tile, nb_tiles, data);
1943  } else {
1944  set_sprite_data(first_tile - 256, nb_tiles, data);
1945  }
1946 }
1947 
1948 
1955 
1962 
1970 void vmemset (void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b, c);
1971 
1972 
1973 
1983 #define fill_rect fill_bkg_rect
1984 
1994 
1995 #endif /* _GB_H */
#define OLDCALL
Definition: types.h:21
#define NONBANKED
Definition: types.h:38
#define PRESERVES_REGS(...)
Definition: types.h:31
#define __REG
Definition: hardware.h:14
__REG WY_REG
Definition: hardware.h:301
__REG SCY_REG
Definition: hardware.h:285
__REG WX_REG
Definition: hardware.h:303
#define VBK_ATTRIBUTES
Definition: hardware.h:318
__REG IF_REG
Definition: hardware.h:84
__REG VBK_REG
Definition: hardware.h:312
#define VBK_TILES
Definition: hardware.h:316
__REG SCX_REG
Definition: hardware.h:287
volatile uint8_t _io_in
void set_sprite_tile(uint8_t nb, uint8_t tile)
Definition: gb.h:1707
void d
Definition: gb.h:665
uint8_t c
Definition: gb.h:378
void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
Definition: gb.h:1114
uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL PRESERVES_REGS(b
void send_byte(void)
void scroll_win(int8_t x, int8_t y)
Definition: gb.h:1579
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:1508
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:1244
void set_1bpp_colors_ex(uint8_t fgcolor, uint8_t bgcolor, uint8_t mode) OLDCALL
uint8_t h
Definition: gb.h:644
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:1319
uint16_t _current_1bpp_colors
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)
void mode(uint8_t m) OLDCALL
uint8_t joypad(void) PRESERVES_REGS(b
void init_bkg(uint8_t c) OLDCALL PRESERVES_REGS(b
void b
Definition: gb.h:665
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:1305
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:1940
uint8_t get_sprite_prop(uint8_t nb)
Definition: gb.h:1763
void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
Definition: gb.h:1796
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_vram_byte(uint8_t *addr, uint8_t v) 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:1433
void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b
uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) 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:1657
uint8_t get_mode(void) OLDCALL PRESERVES_REGS(b
void SET_SHADOW_OAM_ADDRESS(void *address)
Definition: gb.h:1687
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:1061
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:165
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:474
void set_sprite_prop(uint8_t nb, uint8_t prop)
Definition: gb.h:1753
void add_TIM(int_handler h)
void set_2bpp_palette(uint16_t palette)
Definition: gb.h:890
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 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:1780
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 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:1192
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
void remove_VBL(int_handler h)
volatile uint8_t _io_out
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:1808
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:554
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
Definition: gb.h:924
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:362
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
void e
Definition: gb.h:665
void move_win(uint8_t x, uint8_t y)
Definition: gb.h:1565
void vsync(void) PRESERVES_REGS(b
uint8_t get_sprite_tile(uint8_t nb)
Definition: gb.h:1718
void init_win(uint8_t c) OLDCALL PRESERVES_REGS(b
void l
Definition: gb.h:630
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:557
void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL
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:1644
uint8_t x
Definition: gb.h:1645
uint8_t prop
Definition: gb.h:1647
uint8_t tile
Definition: gb.h:1646
uint8_t y
Definition: gb.h:1645
Definition: gb.h:672
uint8_t joy0
Definition: gb.h:676
uint8_t npads
Definition: gb.h:673