GBDK 2020 Docs 4.4.0 API Documentation for GBDK 2020

msx.h
Go to the documentation of this file.
1
4 #ifndef _MSX_H
5 #define _MSX_H
6
7 #include <types.h>
8 #include <stdint.h>
9 #include <gbdk/version.h>
10 #include <msx/hardware.h>
11
12 #define MSX
13
14 // Here NINTENDO means Game Boy & related clones
15 #ifdef NINTENDO
16 #undef NINTENDO
17 #endif
18
19 #ifdef NINTENDO_NES
20 #undef NINTENDO_NES
21 #endif
22
23 #ifdef SEGA
24 #undef SEGA
25 #endif
26
27 #if defined(__TARGET_msxdos)
28 #define MSXDOS
29 #endif
30
31 extern const uint8_t _SYSTEM;
32
33 #define SYSTEM_60HZ 0x00
34 #define SYSTEM_50HZ 0x01
35
36 #define VBK_REG VDP_ATTR_SHIFT
37
51 #define J_UP 0b00100000
52 #define J_DOWN 0b01000000
53 #define J_LEFT 0b00010000
54 #define J_RIGHT 0b10000000
55 #define J_A 0b00000001
56 #define J_B 0b00000100
57 #define J_SELECT 0b00001000
58 #define J_START 0b00000010
59
64 #define M_TEXT_OUT 0x02U
65 #define M_TEXT_INOUT 0x03U
71 #define M_NO_SCROLL 0x04U
75 #define M_NO_INTERP 0x08U
76
79 #define S_BANK 0x01U
82 #define S_FLIPX 0x02U
85 #define S_FLIPY 0x04U
88 #define S_PALETTE 0x08U
91 #define S_PRIORITY 0x10U
95 #define S_PAL(n) (((n) & 0x01U) << 3)
96
97 // VDP helper macros
98 #define __WRITE_VDP_REG_UNSAFE(REG, v) shadow_##REG=(v),VDP_CMD=(shadow_##REG),VDP_CMD=REG
99 #define __WRITE_VDP_REG(REG, v) shadow_##REG=(v);__asm__("di");VDP_CMD=(shadow_##REG);VDP_CMD=REG;__asm__("ei")
100 #define __READ_VDP_REG(REG) shadow_##REG
101
102 void WRITE_VDP_CMD(uint16_t cmd) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl);
103 void WRITE_VDP_DATA(uint16_t data) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl);
104
111 void mode(uint8_t m) OLDCALL;
112
117 uint8_t get_mode(void) OLDCALL;
118
122 inline uint8_t get_system(void) {
123 return _SYSTEM;
124 }
125
126 /* Interrupt flags */
129 #define EMPTY_IFLAG 0x00U
135 #define VBL_IFLAG 0x01U
139 #define LCD_IFLAG 0x02U
142 #define TIM_IFLAG 0x04U
145 #define SIO_IFLAG 0x08U
148 #define JOY_IFLAG 0x10U
149
150 void set_interrupts(uint8_t flags) Z88DK_FASTCALL;
151
152 /* Limits */
155 #define SCREENWIDTH DEVICE_SCREEN_PX_WIDTH
158 #define SCREENHEIGHT DEVICE_SCREEN_PX_HEIGHT
161 #define MINWNDPOSX 0x00U
164 #define MINWNDPOSY 0x00U
167 #define MAXWNDPOSX 0x00U
170 #define MAXWNDPOSY 0x00U
171
172
175 typedef void (*int_handler)(void) NONBANKED;
176
180 void remove_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(iyh, iyl);
181
185 void remove_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b, c, iyh, iyl);
186
187 void remove_TIM(int_handler h) Z88DK_FASTCALL;
188 void remove_SIO(int_handler h) Z88DK_FASTCALL;
189 void remove_JOY(int_handler h) Z88DK_FASTCALL;
190
193 void add_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(d, e, iyh, iyl);
194
197 void add_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b, c, iyh, iyl);
198
201 void add_TIM(int_handler h) Z88DK_FASTCALL;
202
205 void add_SIO(int_handler h) Z88DK_FASTCALL;
206
209 void add_JOY(int_handler h) Z88DK_FASTCALL;
210
213 inline uint8_t cancel_pending_interrupts(void) {
214 return VDP_STATUS;
215 }
216
217 inline void move_bkg(uint8_t x, uint8_t y) {
218 __WRITE_VDP_REG(VDP_RSCX, -x);
219 __WRITE_VDP_REG(VDP_RSCY, y);
220 }
221
222 inline void scroll_bkg(int8_t x, int8_t y) {
223 __WRITE_VDP_REG(VDP_RSCX, __READ_VDP_REG(VDP_RSCX) - x);
224 int16_t tmp = __READ_VDP_REG(VDP_RSCY) + y;
225 __WRITE_VDP_REG(VDP_RSCY, (tmp < 0) ? 224 + tmp : tmp % 224u);
226 }
227
238 void vsync(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl);
239
242 void wait_vbl_done(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl);
243
248 inline void display_off(void) {
249 __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) &= (~R1_DISP_ON));
250 }
251
255 #define DISPLAY_ON \
256 __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) |= R1_DISP_ON)
257
261 #define DISPLAY_OFF \
262 display_off();
263
266 void refresh_OAM(void);
267
271 #define HIDE_LEFT_COLUMN \
272 __WRITE_VDP_REG(VDP_R0, __READ_VDP_REG(VDP_R0) |= R0_LCB)
273
277 #define SHOW_LEFT_COLUMN \
278 __WRITE_VDP_REG(VDP_R0, __READ_VDP_REG(VDP_R0) &= (~R0_LCB))
279
282 #define SET_BORDER_COLOR(C) __WRITE_VDP_REG(VDP_R7, ((C) | 0xf0u))
283
287 #define SHOW_BKG
288
292 #define HIDE_BKG
293
297 #define SHOW_WIN
298
302 #define HIDE_WIN
303
307 #define SHOW_SPRITES
308
312 #define HIDE_SPRITES
313
316 #define SPRITES_16x16 \
317 __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) |= R1_SPR_16X16)
318
321 #define SPRITES_8x8 \
322 __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) &= (~R1_SPR_16X16))
323
327 #define DEVICE_SUPPORTS_COLOR (TRUE)
328
335 extern volatile uint16_t sys_time;
336
342 extern volatile uint8_t _vbl_done;
343 #define VBL_DONE _vbl_done
344
350 uint8_t get_r_reg(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl);
351
352 #define DIV_REG get_r_reg()
353
356 extern volatile uint8_t _current_bank;
357 #define CURRENT_BANK _current_bank
358
368 #ifndef BANK
369 #define BANK(VARNAME) ( (uint8_t) & __bank_ ## VARNAME )
370 #endif
371
384 #define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \
385 __asm \
386 .local b___func_ ## VARNAME \
387 ___bank_ ## VARNAME = b___func_ ## VARNAME \
388 .globl ___bank_ ## VARNAME \
389 __endasm; \
390 }
391
401 #define BANKREF_EXTERN(VARNAME) extern const void __bank_ ## VARNAME;
402
403
408 void SWITCH_ROM(uint8_t bank) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl);
409 #define SWITCH_ROM1 SWITCH_ROM
410
415 #define SWITCH_ROM2(b) MAP_FRAME2=(b)
416
421 #define SWITCH_RAM(b) RAM_CONTROL=((b)&1)?RAM_CONTROL|RAMCTL_BANK:RAM_CONTROL&(~RAMCTL_BANK)
422
426 #define ENABLE_RAM RAM_CONTROL|=RAMCTL_RAM
427
431 #define DISABLE_RAM RAM_CONTROL&=(~RAMCTL_RAM)
432
433
438 void delay(uint16_t d) Z88DK_FASTCALL;
439
440
443 uint8_t joypad(void) OLDCALL PRESERVES_REGS(b, c, d, e, h, iyh, iyl);
444
447 uint8_t waitpad(uint8_t mask) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl);
448
454 void waitpadup(void) PRESERVES_REGS(b, c, d, e, iyh, iyl);
455
461 typedef struct {
462 uint8_t npads;
463 union {
464 struct {
465 uint8_t joy0, joy1, joy2, joy3;
466 };
467 uint8_t joypads[4];
468 };
469 } joypads_t;
470
479 uint8_t joypad_init(uint8_t npads, joypads_t * joypads) Z88DK_CALLEE;
480
487 void joypad_ex(joypads_t * joypads) Z88DK_FASTCALL PRESERVES_REGS(iyh, iyl);
488
489
498 inline void enable_interrupts(void) PRESERVES_REGS(a, b, c, d, e, h, l, iyh, iyl) {
499 __asm__("ei");
500 }
501
514 inline void disable_interrupts(void) PRESERVES_REGS(a, b, c, d, e, h, l, iyh, iyl) {
515 __asm__("di");
516 }
517
518
519 #if defined(__TARGET_msxdos)
520
521 #define RGB(r,g,b) ((r) | ((g) << 2) | ((b) << 4))
522 #define RGB8(r,g,b) (((r) >> 6) | (((g) >> 6) << 2) | (((b) >> 6) << 4))
523 #define RGBHTML(RGB24bit) (((RGB24bit) >> 22) | ((((RGB24bit) & 0xFFFF) >> 14) << 2) | ((((RGB24bit) & 0xFF) >> 6) << 4))
524
527 #define RGB_RED RGB( 3, 0, 0)
528 #define RGB_DARKRED RGB( 2, 0, 0)
529 #define RGB_GREEN RGB( 0, 3, 0)
530 #define RGB_DARKGREEN RGB( 0, 2, 0)
531 #define RGB_BLUE RGB( 0, 0, 3)
532 #define RGB_DARKBLUE RGB( 0, 0, 2)
533 #define RGB_YELLOW RGB( 3, 3, 0)
534 #define RGB_DARKYELLOW RGB( 2, 2, 0)
535 #define RGB_CYAN RGB( 0, 3, 3)
536 #define RGB_AQUA RGB( 3, 1, 2)
537 #define RGB_PINK RGB( 3, 0, 3)
538 #define RGB_PURPLE RGB( 2, 0, 2)
539 #define RGB_BLACK RGB( 0, 0, 0)
540 #define RGB_DARKGRAY RGB( 1, 1, 1)
541 #define RGB_LIGHTGRAY RGB( 2, 2, 2)
542 #define RGB_WHITE RGB( 3, 3, 3)
543
544 typedef uint8_t palette_color_t;
545
546 #else
547 #error Unrecognized port
548 #endif
549
550 void set_default_palette(void);
551 inline void cpu_fast(void) {}
552
553 void set_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
554 #define set_bkg_palette_entry set_palette_entry
555 #define set_sprite_palette_entry(palette,entry,rgb_data) set_palette_entry(1,entry,rgb_data)
556 void set_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) Z88DK_CALLEE;
557 #define set_bkg_palette set_palette
558 #define set_sprite_palette(first_palette,nb_palettes,rgb_data) set_palette(1,1,rgb_data)
559
560 void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE;
561 inline void set_bkg_4bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
562 set_native_tile_data(start, ntiles, src);
563 }
564 void set_sprite_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE;
565 inline void set_native_sprite_data(uint16_t start, uint16_t ntiles, const void *src) {
566 set_sprite_1bpp_data(start, ntiles, src);
567 }
568
569 #define COMPAT_PALETTE(C0,C1,C2,C3) (((uint16_t)(C3) << 12) | ((uint16_t)(C2) << 8) | ((uint16_t)(C1) << 4) | (uint16_t)(C0))
570 extern uint16_t _current_2bpp_palette;
571 inline void set_2bpp_palette(uint16_t palette) {
572 _current_2bpp_palette = palette;
573 }
574 //void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
575 inline void set_bkg_data(uint16_t start, uint16_t ntiles, const void *src) {
576 set_native_tile_data(start, ntiles, src);
577 }
578 inline void set_sprite_data(uint16_t start, uint16_t ntiles, const void *src) {
579 set_sprite_1bpp_data(start, ntiles, src);
580 }
581 //inline void set_bkg_2bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
582 // set_tile_2bpp_data(start, ntiles, src, _current_2bpp_palette);
583 //}
584 //inline void set_sprite_2bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
585 // set_tile_2bpp_data((uint8_t)(start) + 0x100u, ntiles, src, _current_2bpp_palette);
586 //}
587
588 extern uint16_t _current_1bpp_colors;
589 inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) {
590 _current_1bpp_colors = ((uint16_t)bgcolor << 8) | fgcolor;
591 }
592 void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
593 inline void set_bkg_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) {
594 set_tile_1bpp_data(start, ntiles, src, _current_1bpp_colors);
595 }
596
597
606 void set_data(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
607 void vmemcpy(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
608
609 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, iyl);
610 #define set_bkg_tiles set_tile_map
611 #define set_win_tiles set_tile_map
612
613 extern uint8_t _map_tile_offset;
614 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) {
615 _map_tile_offset = base_tile;
616 set_tile_map(x, y, w, h, tiles);
617 _map_tile_offset = 0;
618 }
619 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) {
620 _map_tile_offset = base_tile;
621 set_tile_map(x, y, w, h, tiles);
622 _map_tile_offset = 0;
623 }
624
625 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, iyl);
626 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, iyl);
627 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) {
628 set_tile_submap_compat(x, y, w, h, map_w, map);
629 }
630 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) {
631 set_tile_submap_compat(x, y, w, h, map_w, map);
632 }
633
634 extern uint8_t _submap_tile_offset;
635 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) {
636 _submap_tile_offset = base_tile;
637 set_tile_submap_compat(x, y, w, h, map_w, map);
638 _submap_tile_offset = 0;
639 }
640 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) {
641 _submap_tile_offset = base_tile;
642 set_tile_submap_compat(x, y, w, h, map_w, map);
643 _submap_tile_offset = 0;
644 }
645
646 void fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
647 #define fill_bkg_rect fill_rect
648 #define fill_win_rect fill_rect
649
656 typedef struct OAM_item_t {
657 uint8_t y, x; //< X, Y Coordinates of the sprite on screen
658 uint8_t tile; //< Sprite tile number
659 uint8_t prop; //< OAM Property Flags
660 } OAM_item_t;
661
662
665 extern volatile struct OAM_item_t shadow_OAM[];
666
669 extern volatile uint8_t _shadow_OAM_base;
670
695 extern volatile uint8_t _shadow_OAM_OFF;
696
699 #define DISABLE_VBL_TRANSFER \
700 _shadow_OAM_base = 0
701
704 #define ENABLE_VBL_TRANSFER \
705 _shadow_OAM_base = (uint8_t)((uint16_t)&shadow_OAM >> 8)
706
709 #define MAX_HARDWARE_SPRITES 32
710
713 #define HARDWARE_SPRITE_CAN_FLIP_X 0
714
717 #define HARDWARE_SPRITE_CAN_FLIP_Y 0
718
721 inline void SET_SHADOW_OAM_ADDRESS(void * address) {
722 _shadow_OAM_base = (uint8_t)((uint16_t)address >> 8);
723 }
724
741 inline void set_sprite_tile(uint8_t nb, uint8_t tile) {
742 shadow_OAM[nb].tile=tile;
743 }
744
745
752 inline uint8_t get_sprite_tile(uint8_t nb) {
753 return shadow_OAM[nb].tile;
754 }
755
756 inline void set_sprite_prop(uint8_t nb, uint8_t prop) {
757 shadow_OAM[nb].prop = prop;
758 }
759
760 inline uint8_t get_sprite_prop(uint8_t nb) {
761 return shadow_OAM[nb].prop;
762 }
763
776 inline void move_sprite(uint8_t nb, uint8_t x, uint8_t y) {
777 OAM_item_t * itm = &shadow_OAM[nb];
778 itm->y=y, itm->x=x;
779 }
780
781
792 inline void scroll_sprite(uint8_t nb, int8_t x, int8_t y) {
793 OAM_item_t * itm = &shadow_OAM[nb];
794 itm->y+=y, itm->x+=x;
795 }
796
797
802 inline void hide_sprite(uint8_t nb) {
803 shadow_OAM[nb].y = 0xC0;
804 }
805
812 void set_vram_byte(uint8_t * addr, uint8_t v) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
813
821 uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
822
830 uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
831 #define set_bkg_tile_xy set_tile_xy
832 #define set_win_tile_xy set_tile_xy
833
837 uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl);
838 #define get_win_xy_addr get_bkg_xy_addr
839
840 #endif /* _MSX_H */
OLDCALL
#define OLDCALL
Definition: types.h:21
NONBANKED
#define NONBANKED
Definition: types.h:40
PRESERVES_REGS
#define PRESERVES_REGS(...)
Definition: types.h:32
Z88DK_CALLEE
#define Z88DK_CALLEE
Definition: types.h:46
Z88DK_FASTCALL
#define Z88DK_FASTCALL
Definition: types.h:47
palette_color_t
uint16_t palette_color_t
Definition: cgb.h:85
hardware.h
VDP_RSCY
#define VDP_RSCY
Definition: hardware.h:113
VDP_R1
#define VDP_R1
Definition: hardware.h:53
VDP_RSCX
#define VDP_RSCX
Definition: hardware.h:108
R1_DISP_ON
#define R1_DISP_ON
Definition: hardware.h:58
set_sprite_tile
void set_sprite_tile(uint8_t nb, uint8_t tile)
Definition: msx.h:741
_current_bank
volatile uint8_t _current_bank
Definition: gb.h:534
d
void d
Definition: msx.h:102
c
void c
Definition: msx.h:102
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)
Definition: msx.h:627
set_tile_map
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
set_win_based_submap
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: msx.h:640
joypad_ex
void joypad_ex(joypads_t *joypads) Z88DK_FASTCALL PRESERVES_REGS(iyh
scroll_bkg
void scroll_bkg(int8_t x, int8_t y)
Definition: msx.h:222
set_sprite_data
void set_sprite_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: msx.h:578
delay
void delay(uint16_t d) Z88DK_FASTCALL
_current_2bpp_palette
uint16_t _current_2bpp_palette
_current_1bpp_colors
uint16_t _current_1bpp_colors
set_default_palette
void set_default_palette(void)
set_palette_entry
void set_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) Z88DK_CALLEE PRESERVES_REGS(iyh
add_SIO
void add_SIO(int_handler h) Z88DK_FASTCALL
vmemcpy
void vmemcpy(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh
remove_JOY
void remove_JOY(int_handler h) Z88DK_FASTCALL
shadow_OAM
volatile struct OAM_item_t shadow_OAM[]
_vbl_done
volatile uint8_t _vbl_done
Definition: gb.h:476
_shadow_OAM_OFF
volatile uint8_t _shadow_OAM_OFF
mode
void mode(uint8_t m) OLDCALL
set_native_sprite_data
void set_native_sprite_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: msx.h:565
get_system
uint8_t get_system(void)
Definition: msx.h:122
set_attributed_tile_xy
uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) Z88DK_CALLEE PRESERVES_REGS(iyh
add_JOY
void add_JOY(int_handler h) Z88DK_FASTCALL
WRITE_VDP_CMD
void WRITE_VDP_CMD(uint16_t cmd) Z88DK_FASTCALL PRESERVES_REGS(b
b
void b
Definition: msx.h:498
set_bkg_1bpp_data
void set_bkg_1bpp_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: msx.h:593
add_LCD
void add_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b
_shadow_OAM_base
volatile uint8_t _shadow_OAM_base
Definition: gb.h:1836
set_tile_xy
uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) Z88DK_CALLEE PRESERVES_REGS(iyh
set_sprite_1bpp_data
void set_sprite_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE
Definition: sms.h:661
joypad
uint8_t joypad(void) OLDCALL PRESERVES_REGS(b
move_bkg
void move_bkg(uint8_t x, uint8_t y)
Definition: msx.h:217
get_bkg_xy_addr
uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh
get_sprite_prop
uint8_t get_sprite_prop(uint8_t nb)
Definition: msx.h:760
scroll_sprite
void scroll_sprite(uint8_t nb, int8_t x, int8_t y)
Definition: msx.h:792
add_TIM
void add_TIM(int_handler h) Z88DK_FASTCALL
get_mode
uint8_t get_mode(void) OLDCALL
set_win_based_tiles
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: msx.h:619
set_tile_1bpp_data
void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) Z88DK_CALLEE PRESERVES_REGS(iyh
sys_time
volatile uint16_t sys_time
_SYSTEM
const uint8_t _SYSTEM
waitpad
uint8_t waitpad(uint8_t mask) Z88DK_FASTCALL PRESERVES_REGS(b
SET_SHADOW_OAM_ADDRESS
void SET_SHADOW_OAM_ADDRESS(void *address)
Definition: msx.h:721
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: msx.h:614
set_bkg_data
void set_bkg_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: msx.h:575
wait_vbl_done
void wait_vbl_done(void) PRESERVES_REGS(b
set_tile_submap
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
cpu_fast
void cpu_fast(void)
Definition: msx.h:551
get_r_reg
uint8_t get_r_reg(void) PRESERVES_REGS(b
OAM_item_t
struct OAM_item_t OAM_item_t
set_data
void set_data(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh
int_handler
void(* int_handler)(void) NONBANKED
Definition: msx.h:175
__READ_VDP_REG
#define __READ_VDP_REG(REG)
Definition: msx.h:100
remove_TIM
void remove_TIM(int_handler h) Z88DK_FASTCALL
remove_SIO
void remove_SIO(int_handler h) Z88DK_FASTCALL
remove_VBL
void remove_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(iyh
set_sprite_prop
void set_sprite_prop(uint8_t nb, uint8_t prop)
Definition: msx.h:756
set_2bpp_palette
void set_2bpp_palette(uint16_t palette)
Definition: msx.h:571
WRITE_VDP_DATA
void WRITE_VDP_DATA(uint16_t data) Z88DK_FASTCALL PRESERVES_REGS(b
__WRITE_VDP_REG
#define __WRITE_VDP_REG(REG, v)
Definition: msx.h:99
_map_tile_offset
uint8_t _map_tile_offset
remove_LCD
void remove_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b
enable_interrupts
void enable_interrupts(void) PRESERVES_REGS(a
iyh
void iyh
Definition: msx.h:102
move_sprite
void move_sprite(uint8_t nb, uint8_t x, uint8_t y)
Definition: msx.h:776
_submap_tile_offset
uint8_t _submap_tile_offset
set_tile_submap_compat
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
h
void h
Definition: msx.h:238
fill_rect
void fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) Z88DK_CALLEE PRESERVES_REGS(iyh
set_win_submap
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: msx.h:630
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: msx.h:635
joypad_init
uint8_t joypad_init(uint8_t npads, joypads_t *joypads) Z88DK_CALLEE
refresh_OAM
void refresh_OAM(void)
waitpadup
void waitpadup(void) PRESERVES_REGS(b
SWITCH_ROM
void SWITCH_ROM(uint8_t bank) Z88DK_FASTCALL PRESERVES_REGS(b
hide_sprite
void hide_sprite(uint8_t nb)
Definition: msx.h:802
set_1bpp_colors
void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor)
Definition: msx.h:589
cancel_pending_interrupts
uint8_t cancel_pending_interrupts(void)
Definition: msx.h:213
disable_interrupts
void disable_interrupts(void) PRESERVES_REGS(a
add_VBL
void add_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(d
set_native_tile_data
void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE
e
void e
Definition: msx.h:102
set_interrupts
void set_interrupts(uint8_t flags) Z88DK_FASTCALL
set_bkg_4bpp_data
void set_bkg_4bpp_data(uint16_t start, uint16_t ntiles, const void *src)
Definition: msx.h:561
iyl
void iyl
Definition: msx.h:102
set_palette
void set_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) Z88DK_CALLEE
vsync
void vsync(void) PRESERVES_REGS(b
get_sprite_tile
uint8_t get_sprite_tile(uint8_t nb)
Definition: msx.h:752
l
void l
Definition: msx.h:238
set_vram_byte
void set_vram_byte(uint8_t *addr, uint8_t v) Z88DK_CALLEE PRESERVES_REGS(iyh
display_off
void display_off(void)
Definition: msx.h:248
stdint.h
int16_t
short int int16_t
Definition: stdint.h:44
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