GBDK 2020 Docs  4.1.1
API Documentation for GBDK 2020
sms.h
Go to the documentation of this file.
1 
4 #ifndef _SMS_H
5 #define _SMS_H
6 
7 #include <types.h>
8 #include <stdint.h>
9 #include <gbdk/version.h>
10 #include <sms/hardware.h>
11 
12 #define SEGA
13 #ifdef NINTENDO
14 #undef NINTENDO
15 #endif
16 #if defined(__TARGET_sms)
17 #define MASTERSYSTEM
18 #elif defined(__TARGET_gg)
19 #define GAMEGEAR
20 #endif
21 
22 
23 #define VBK_REG VDP_ATTR_SHIFT
24 
38 #define J_UP 0b00000001
39 #define J_DOWN 0b00000010
40 #define J_LEFT 0b00000100
41 #define J_RIGHT 0b00001000
42 #define J_A 0b00010000
43 #define J_B 0b00100000
44 #if defined(__TARGET_sms)
45 #define J_SELECT 0b00100000
46 #define J_START 0b00010000
47 #elif defined(__TARGET_gg)
48 #define J_SELECT 0b00100000
49 #define J_START 0b10000000
50 #endif
51 
56 #define M_TEXT_OUT 0x02U
57 #define M_TEXT_INOUT 0x03U
63 #define M_NO_SCROLL 0x04U
67 #define M_NO_INTERP 0x08U
68 
71 #define S_FLIPX 0x02U
74 #define S_FLIPY 0x04U
77 #define S_PALETTE 0x08U
80 #define S_PRIORITY 0x10U
84 #define S_PAL(n) 0
85 
86 // VDP helper macros
87 #define __WRITE_VDP_REG(REG, v) shadow_##REG=(v);__critical{VDP_CMD=(shadow_##REG),VDP_CMD=REG;}
88 #define __READ_VDP_REG(REG) shadow_##REG
89 
92 
100 
106 
107 /* Interrupt flags */
110 #define EMPTY_IFLAG 0x00U
116 #define VBL_IFLAG 0x01U
120 #define LCD_IFLAG 0x02U
123 #define TIM_IFLAG 0x04U
126 #define SIO_IFLAG 0x08U
129 #define JOY_IFLAG 0x10U
130 
132 
133 /* Limits */
136 #define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH
139 #define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT
142 #define MINWNDPOSX 0x00U
145 #define MINWNDPOSY 0x00U
148 #define MAXWNDPOSX 0x00U
151 #define MAXWNDPOSY 0x00U
152 
153 
156 typedef void (*int_handler)(void) NONBANKED;
157 
162 
167 
171 
175 
179 
183 
187 
191 
195  return VDP_STATUS;
196 }
197 
198 inline void move_bkg(uint8_t x, uint8_t y) {
201 }
202 
203 inline void scroll_bkg(int8_t x, int8_t y) {
205  int16_t tmp = __READ_VDP_REG(VDP_RSCY) + y;
206  __WRITE_VDP_REG(VDP_RSCY, (tmp < 0) ? 224 + tmp : tmp % 224u);
207 }
208 
219 void vsync(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl);
220 
223 void wait_vbl_done(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl);
224 
229 inline void display_off(void) {
231 }
232 
236 #define DISPLAY_ON \
237  __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) |= R1_DISP_ON)
238 
242 #define DISPLAY_OFF \
243  display_off();
244 
247 void refresh_OAM(void);
248 
252 #define HIDE_LEFT_COLUMN \
253  __WRITE_VDP_REG(VDP_R0, __READ_VDP_REG(VDP_R0) |= R0_LCB)
254 
258 #define SHOW_LEFT_COLUMN \
259  __WRITE_VDP_REG(VDP_R0, __READ_VDP_REG(VDP_R0) &= (~R0_LCB))
260 
264 #define SHOW_BKG
265 
269 #define HIDE_BKG
270 
274 #define SHOW_WIN
275 
279 #define HIDE_WIN
280 
284 #define SHOW_SPRITES
285 
289 #define HIDE_SPRITES
290 
293 #define SPRITES_8x16 \
294  __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) |= R1_SPR_8X16)
295 
298 #define SPRITES_8x8 \
299  __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) &= (~R1_SPR_8X16))
300 
304 #define DEVICE_SUPPORTS_COLOR (TRUE)
305 
312 extern volatile uint16_t sys_time;
313 
316 #define _current_bank MAP_FRAME1
317 #define CURRENT_BANK MAP_FRAME1
318 
328 #ifndef BANK
329 #define BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME )
330 #endif
331 
344 #define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \
345 __asm \
346  .local b___func_ ## VARNAME \
347  ___bank_ ## VARNAME = b___func_ ## VARNAME \
348  .globl ___bank_ ## VARNAME \
349 __endasm; \
350 }
351 
361 #define BANKREF_EXTERN(VARNAME) extern const void __bank_ ## VARNAME;
362 
363 
368 #define SWITCH_ROM(b) MAP_FRAME1=(b)
369 #define SWITCH_ROM1 SWITCH_ROM
370 
375 #define SWITCH_ROM2(b) MAP_FRAME2=(b)
376 
381 #define SWITCH_RAM(b) RAM_CONTROL=((b)&1)?RAM_CONTROL|RAMCTL_BANK:RAM_CONTROL&(~RAMCTL_BANK)
382 
386 #define ENABLE_RAM RAM_CONTROL|=RAMCTL_RAM
387 
391 #define DISABLE_RAM RAM_CONTROL&=(~RAMCTL_RAM)
392 
393 
399 
400 
404 
408 
414 void waitpadup(void) PRESERVES_REGS(b, c, d, e, iyh, iyl);
415 
421 typedef struct {
422  uint8_t npads;
423  union {
424  struct {
425  uint8_t joy0, joy1, joy2, joy3;
426  };
427  uint8_t joypads[4];
428  };
429 } joypads_t;
430 
440 
448 
449 
450 #if defined(__TARGET_sms)
451 
452 #define RGB(r,g,b) ((r) | ((g) << 2) | ((b) << 4))
453 #define RGB8(r,g,b) (((r) >> 6) | (((g) >> 6) << 2) | (((b) >> 6) << 4))
454 #define RGBHTML(RGB24bit) (((RGB24bit) >> 22) | ((((RGB24bit) & 0xFFFF) >> 14) << 2) | ((((RGB24bit) & 0xFF) >> 6) << 4))
455 
458 #define RGB_RED RGB( 3, 0, 0)
459 #define RGB_DARKRED RGB( 2, 0, 0)
460 #define RGB_GREEN RGB( 0, 3, 0)
461 #define RGB_DARKGREEN RGB( 0, 2, 0)
462 #define RGB_BLUE RGB( 0, 0, 3)
463 #define RGB_DARKBLUE RGB( 0, 0, 2)
464 #define RGB_YELLOW RGB( 3, 3, 0)
465 #define RGB_DARKYELLOW RGB( 2, 2, 0)
466 #define RGB_CYAN RGB( 0, 3, 3)
467 #define RGB_AQUA RGB( 3, 1, 2)
468 #define RGB_PINK RGB( 3, 0, 3)
469 #define RGB_PURPLE RGB( 2, 0, 2)
470 #define RGB_BLACK RGB( 0, 0, 0)
471 #define RGB_DARKGRAY RGB( 1, 1, 1)
472 #define RGB_LIGHTGRAY RGB( 2, 2, 2)
473 #define RGB_WHITE RGB( 3, 3, 3)
474 
475 typedef uint8_t palette_color_t;
476 
477 #elif defined(__TARGET_gg)
478 
479 #define RGB(r,g,b) ((uint16_t)(r) | (uint16_t)((g) << 4) | (uint16_t)((b) << 8))
480 #define RGB8(r,g,b) ((uint16_t)((r) >> 4) | ((uint16_t)((g) >> 4) << 4) | ((uint16_t)((b) >> 4) << 8))
481 #define RGBHTML(RGB24bit) (((RGB24bit) >> 20) | ((((RGB24bit) & 0xFFFF) >> 12) << 4)|((((RGB24bit) & 0xFF) >> 4) << 8))
482 
485 #define RGB_RED RGB(15, 0, 0)
486 #define RGB_DARKRED RGB( 7, 0, 0)
487 #define RGB_GREEN RGB( 0, 15, 0)
488 #define RGB_DARKGREEN RGB( 0, 7, 0)
489 #define RGB_BLUE RGB( 0, 0, 15)
490 #define RGB_DARKBLUE RGB( 0, 0, 7)
491 #define RGB_YELLOW RGB(15, 15, 0)
492 #define RGB_DARKYELLOW RGB( 7, 7, 0)
493 #define RGB_CYAN RGB( 0, 15, 15)
494 #define RGB_AQUA RGB(14, 2, 11)
495 #define RGB_PINK RGB(15, 0, 15)
496 #define RGB_PURPLE RGB(10, 0, 10)
497 #define RGB_BLACK RGB( 0, 0, 0)
498 #define RGB_DARKGRAY RGB( 5, 5, 5)
499 #define RGB_LIGHTGRAY RGB(10, 10, 10)
500 #define RGB_WHITE RGB(15, 15, 15)
501 
502 #define RGB_LIGHTFLESH RGB(15, 10, 7)
503 #define RGB_BROWN RGB( 5, 5, 0)
504 #define RGB_ORANGE RGB(15, 10, 0)
505 #define RGB_TEAL RGB( 7, 7, 0)
506 
507 typedef uint16_t palette_color_t;
508 
509 #else
510 #error Unrecognized port
511 #endif
512 
514 inline void cgb_compatibility(void) {
516 }
517 
518 inline void cpu_fast(void) {}
519 
521 #define set_bkg_palette_entry set_palette_entry
522 #define set_sprite_palette_entry(palette,entry,rgb_data) set_palette_entry(1,entry,rgb_data)
523 void set_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) Z88DK_CALLEE;
524 #define set_bkg_palette set_palette
525 #define set_sprite_palette(first_palette,nb_palettes,rgb_data) set_palette(1,1,rgb_data)
526 
527 void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
528 inline void set_bkg_4bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
529  set_native_tile_data(start, ntiles, src);
530 }
531 inline void set_sprite_4bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
532  set_native_tile_data((uint8_t)(start) + 0x100u, ntiles, src);
533 }
534 
535 #define COMPAT_PALETTE(C0,C1,C2,C3) (((uint16_t)(C3) << 12) | ((uint16_t)(C2) << 8) | ((uint16_t)(C1) << 4) | (uint16_t)(C0))
537 inline void set_2bpp_palette(uint16_t palette) {
538  _current_2bpp_palette = palette;
539 }
540 void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
541 inline void set_bkg_data(uint16_t start, uint16_t ntiles, const void *src) {
542  set_tile_2bpp_data(start, ntiles, src, _current_2bpp_palette);
543 }
544 inline void set_sprite_data(uint16_t start, uint16_t ntiles, const void *src) {
545  set_tile_2bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_2bpp_palette);
546 }
547 inline void set_bkg_2bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
548  set_tile_2bpp_data(start, ntiles, src, _current_2bpp_palette);
549 }
550 inline void set_sprite_2bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
551  set_tile_2bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_2bpp_palette);
552 }
553 
555 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
556  _current_1bpp_colors = ((uint16_t)bgcolor << 8) | fgcolor;
557 }
558 void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
559 inline void set_bkg_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
560  set_tile_1bpp_data(start, ntiles, src, _current_1bpp_colors);
561 }
562 inline void set_sprite_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
563  set_tile_1bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_1bpp_colors);
564 }
565 
566 
575 void set_data(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
576 void vmemcpy(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
577 
580 #define set_bkg_tiles set_tile_map_compat
581 #define set_win_tiles set_tile_map_compat
582 
584 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) {
585  _map_tile_offset = base_tile;
586  set_tile_map_compat(x, y, w, h, tiles);
587  _map_tile_offset = 0;
588 }
589 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) {
590  _map_tile_offset = base_tile;
591  set_tile_map_compat(x, y, w, h, tiles);
592  _map_tile_offset = 0;
593 }
594 
595 inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
596 {
598  set_bkg_tiles(x, y, w, h, tiles);
599  VBK_REG = VBK_TILES;
600 }
601 
604 inline void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) {
605  set_tile_submap_compat(x, y, w, h, map_w, map);
606 }
607 inline void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) {
608  set_tile_submap_compat(x, y, w, h, map_w, map);
609 }
610 
612 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) {
613  _submap_tile_offset = base_tile;
614  set_tile_submap_compat(x, y, w, h, map_w, map);
616 }
617 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) {
618  _submap_tile_offset = base_tile;
619  set_tile_submap_compat(x, y, w, h, map_w, map);
621 }
622 
623 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)
624 {
626  set_bkg_submap(x, y, w, h, map, map_w);
627  VBK_REG = VBK_TILES;
628 }
629 
632 #define fill_bkg_rect fill_rect_compat
633 #define fill_win_rect fill_rect_compat
634 
637 extern volatile uint8_t shadow_OAM[];
638 
641 extern volatile uint8_t _shadow_OAM_base;
642 
667 extern volatile uint8_t _shadow_OAM_OFF;
668 
671 #define DISABLE_VBL_TRANSFER \
672  _shadow_OAM_base = 0
673 
676 #define ENABLE_VBL_TRANSFER \
677  _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
678 
681 #define MAX_HARDWARE_SPRITES 64
682 
685 #define HARDWARE_SPRITE_CAN_FLIP_X 0
686 
689 #define HARDWARE_SPRITE_CAN_FLIP_Y 0
690 
693 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
694  _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
695 }
696 
713 inline void set_sprite_tile(uint8_t nb, uint8_t tile) {
714  shadow_OAM[0x41+(nb << 1)] = tile;
715 }
716 
717 
725  return shadow_OAM[0x41+(nb << 1)];
726 }
727 
728 inline void set_sprite_prop(uint8_t nb, uint8_t prop) {
729  nb; prop;
730 }
731 
733  nb;
734  return 0;
735 }
736 
749 inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) {
750  shadow_OAM[nb] = (y < VDP_SAT_TERM) ? y : 0xC0;
751  shadow_OAM[0x40+(nb << 1)] = x;
752 }
753 
754 
765 inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) {
766  uint8_t new_y = shadow_OAM[nb] + y;
767  shadow_OAM[nb] = (new_y < VDP_SAT_TERM) ? new_y : 0xC0;
768  shadow_OAM[0x40+(nb << 1)] = x;
769 }
770 
771 
776 inline void hide_sprite(uint8_t nb) {
777  shadow_OAM[nb] = 0xC0;
778 }
779 
787 
796 
805 #define set_bkg_tile_xy set_tile_xy
806 #define set_win_tile_xy set_tile_xy
807 
812 #define get_win_xy_addr get_bkg_xy_addr
813 
814 #endif /* _SMS_H */
#define OLDCALL
Definition: types.h:21
#define NONBANKED
Definition: types.h:38
#define PRESERVES_REGS(...)
Definition: types.h:31
#define Z88DK_CALLEE
Definition: types.h:45
#define Z88DK_FASTCALL
Definition: types.h:46
uint16_t palette_color_t
Definition: cgb.h:85
#define VBK_ATTRIBUTES
Definition: hardware.h:318
#define VBK_TILES
Definition: hardware.h:316
void b
Definition: gb.h:665
#define VDP_RSCY
Definition: hardware.h:133
#define VDP_R1
Definition: hardware.h:73
#define VDP_RSCX
Definition: hardware.h:128
#define VDP_SAT_TERM
Definition: hardware.h:186
#define R1_DISP_ON
Definition: hardware.h:78
void set_sprite_tile(uint8_t nb, uint8_t tile)
Definition: sms.h:713
void d
Definition: sms.h:90
void c
Definition: sms.h:90
void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles)
Definition: sms.h:595
void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
Definition: sms.h:604
void set_sprite_2bpp_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: sms.h:550
void set_tile_map(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) Z88DK_CALLEE PRESERVES_REGS(iyh
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: sms.h:617
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: sms.h:623
void joypad_ex(joypads_t *joypads) Z88DK_FASTCALL PRESERVES_REGS(iyh
void h
Definition: sms.h:219
void scroll_bkg(int8_t x, int8_t y)
Definition: sms.h:203
void set_sprite_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: sms.h:544
void delay(uint16_t d) Z88DK_FASTCALL
uint16_t _current_2bpp_palette
void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE PRESERVES_REGS(iyh
void set_sprite_4bpp_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: sms.h:531
uint16_t _current_1bpp_colors
void set_default_palette(void)
void set_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) Z88DK_CALLEE PRESERVES_REGS(iyh
void set_sprite_1bpp_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: sms.h:562
void add_SIO(int_handler h) Z88DK_FASTCALL
void vmemcpy(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh
void remove_JOY(int_handler h) Z88DK_FASTCALL
volatile uint8_t _shadow_OAM_OFF
void mode(uint8_t m) OLDCALL
uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) Z88DK_CALLEE PRESERVES_REGS(iyh
void add_JOY(int_handler h) Z88DK_FASTCALL
void WRITE_VDP_CMD(uint16_t cmd) Z88DK_FASTCALL PRESERVES_REGS(b
void set_bkg_1bpp_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: sms.h:559
void add_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b
volatile uint8_t _shadow_OAM_base
Definition: gb.h:1657
uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) Z88DK_CALLEE PRESERVES_REGS(iyh
uint8_t joypad(void) OLDCALL PRESERVES_REGS(b
void move_bkg(uint8_t x, uint8_t y)
Definition: sms.h:198
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh
void cgb_compatibility(void)
Definition: sms.h:514
uint8_t get_sprite_prop(uint8_t nb)
Definition: sms.h:732
#define VBK_REG
Definition: sms.h:23
void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
Definition: sms.h:765
void add_TIM(int_handler h) Z88DK_FASTCALL
uint8_t get_mode(void) OLDCALL
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: sms.h:589
void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) Z88DK_CALLEE PRESERVES_REGS(iyh
volatile uint16_t sys_time
uint8_t waitpad(uint8_t mask) Z88DK_FASTCALL PRESERVES_REGS(b
void set_tile_map_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) Z88DK_CALLEE PRESERVES_REGS(iyh
void SET_SHADOW_OAM_ADDRESS(void *address)
Definition: sms.h:693
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: sms.h:584
void set_bkg_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: sms.h:541
void wait_vbl_done(void) PRESERVES_REGS(b
void set_tile_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) Z88DK_CALLEE PRESERVES_REGS(iyh
void cpu_fast(void)
Definition: sms.h:518
void set_data(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh
void set_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) Z88DK_CALLEE
void(* int_handler)(void) NONBANKED
Definition: sms.h:156
#define __READ_VDP_REG(REG)
Definition: sms.h:88
void remove_TIM(int_handler h) Z88DK_FASTCALL
void remove_SIO(int_handler h) Z88DK_FASTCALL
void remove_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(iyh
void set_sprite_prop(uint8_t nb, uint8_t prop)
Definition: sms.h:728
#define set_bkg_tiles
Definition: sms.h:580
void set_2bpp_palette(uint16_t palette)
Definition: sms.h:537
void WRITE_VDP_DATA(uint16_t data) Z88DK_FASTCALL PRESERVES_REGS(b
#define __WRITE_VDP_REG(REG, v)
Definition: sms.h:87
void set_bkg_2bpp_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: sms.h:547
uint8_t _map_tile_offset
void remove_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b
void iyh
Definition: sms.h:90
void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
Definition: sms.h:749
uint8_t _submap_tile_offset
void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) Z88DK_CALLEE PRESERVES_REGS(iyh
void set_tile_submap_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t map_w, const uint8_t *map) Z88DK_CALLEE PRESERVES_REGS(iyh
void fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) Z88DK_CALLEE PRESERVES_REGS(iyh
void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w)
Definition: sms.h:607
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: sms.h:612
uint8_t joypad_init(uint8_t npads, joypads_t *joypads) Z88DK_CALLEE
void refresh_OAM(void)
void waitpadup(void) PRESERVES_REGS(b
void hide_sprite(uint8_t nb)
Definition: sms.h:776
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
Definition: sms.h:555
uint8_t cancel_pending_interrupts(void)
Definition: sms.h:194
void add_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(d
void e
Definition: sms.h:90
void set_interrupts(uint8_t flags) Z88DK_FASTCALL
void set_bkg_4bpp_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: sms.h:528
volatile uint8_t shadow_OAM[]
void iyl
Definition: sms.h:90
void fill_rect_compat(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) Z88DK_CALLEE PRESERVES_REGS(iyh
void vsync(void) PRESERVES_REGS(b
uint8_t get_sprite_tile(uint8_t nb)
Definition: sms.h:724
void l
Definition: sms.h:219
void set_vram_byte(uint8_t *addr, uint8_t v) Z88DK_CALLEE PRESERVES_REGS(iyh
void display_off(void)
Definition: sms.h:229
short int int16_t
Definition: stdint.h:44
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:672