git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit 9bdca4da3b063f6293689977c3328fec93566aec
parent 0287f49e84175ec5fddc2e709cef7a905ae4e5b6
Author: Toxa <untoxa@mail.ru>
Date:   Mon, 29 Nov 2021 16:33:13 +0300

fix intellisense: define custom SDCC attributes through macros

Diffstat:
Mgbdk-lib/include/asm/gbz80/string.h12++++++------
Mgbdk-lib/include/asm/types.h54+++++++++++++++++++++++++++++-------------------------
Mgbdk-lib/include/asm/z80/string.h4++--
Mgbdk-lib/include/asm/z80/types.h8++++++++
Mgbdk-lib/include/gb/gb.h88++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mgbdk-lib/include/gb/gbdecompress.h9+++++----
Mgbdk-lib/include/gb/metasprites.h2+-
Mgbdk-lib/include/gb/sgb.h4++--
Mgbdk-lib/include/gbdk/rledecompress.h4++--
Mgbdk-lib/include/rand.h4++--
Mgbdk-lib/include/sms/gbdecompress.h3++-
Mgbdk-lib/include/sms/metasprites.h7++++---
Mgbdk-lib/include/sms/sms.h74+++++++++++++++++++++++++++++++++++++-------------------------------------
13 files changed, 144 insertions(+), 129 deletions(-)

diff --git a/gbdk-lib/include/asm/gbz80/string.h b/gbdk-lib/include/asm/gbz80/string.h @@ -17,7 +17,7 @@ @return A pointer to dest */ -char *strcpy(char *dest, const char *src) OLDCALL __preserves_regs(b, c); +char *strcpy(char *dest, const char *src) OLDCALL PRESERVES_REGS(b, c); /** Compares strings @@ -29,7 +29,7 @@ char *strcpy(char *dest, const char *src) OLDCALL __preserves_regs(b, c); \li 0 if __s1__ == __s2__ \li < 0 if __s1__ < __s2__ */ -int strcmp(const char *s1, const char *s2) OLDCALL __preserves_regs(b, c); +int strcmp(const char *s1, const char *s2) OLDCALL PRESERVES_REGS(b, c); /** Copies n bytes from memory area src to memory area dest. @@ -39,7 +39,7 @@ int strcmp(const char *s1, const char *s2) OLDCALL __preserves_regs(b, c); @param src Buffer to copy from @param len Number of Bytes to copy */ -void *memcpy(void *dest, const void *src, size_t len) OLDCALL __preserves_regs(b, c); +void *memcpy(void *dest, const void *src, size_t len) OLDCALL PRESERVES_REGS(b, c); /** Copies n bytes from memory area src to memory area dest, areas may overlap */ @@ -51,7 +51,7 @@ void *memmove (void *dest, const void *src, size_t n); @param c char value to fill with (truncated from int) @param n Number of bytes to fill */ -void *memset (void *s, int c, size_t n) OLDCALL __preserves_regs(b, c); +void *memset (void *s, int c, size_t n) OLDCALL PRESERVES_REGS(b, c); /** Reverses the characters in a string @@ -63,7 +63,7 @@ void *memset (void *s, int c, size_t n) OLDCALL __preserves_regs(b, c); Returns: Pointer to __s__ */ -char *reverse(char *s) OLDCALL __preserves_regs(b, c); +char *reverse(char *s) OLDCALL PRESERVES_REGS(b, c); /** Concatenate Strings. Appends string __s2__ to the end of string __s1__ @@ -84,7 +84,7 @@ char *strcat(char *s1, const char *s2); Returns: Length of string not including the terminating `\0' character. */ -int strlen(const char *s) OLDCALL __preserves_regs(b, c); +int strlen(const char *s) OLDCALL PRESERVES_REGS(b, c); /**Concatenate at most __n__ characters from string __s2__ onto the end of __s1__. diff --git a/gbdk-lib/include/asm/types.h b/gbdk-lib/include/asm/types.h @@ -4,14 +4,12 @@ #ifndef ASM_TYPES_INCLUDE #define ASM_TYPES_INCLUDE -#ifdef __PORT_gbz80 - #include <asm/gbz80/types.h> +#if defined(__PORT_gbz80) +#include <asm/gbz80/types.h> +#elif defined(__PORT_z80) +#include <asm/z80/types.h> #else - #ifdef __PORT_z80 - #include <asm/z80/types.h> - #else - #error Unrecognised port - #endif +#error Unrecognised port #endif #ifndef OLDCALL @@ -22,6 +20,12 @@ #endif #endif +#ifdef __SDCC +#define PRESERVES_REGS(...) __preserves_regs(__VA_ARGS__) +#else +#define PRESERVES_REGS(...) +#endif + #ifndef NONBANKED #define NONBANKED #endif @@ -38,26 +42,26 @@ /** TRUE or FALSE. @anchor file_asm_types_h */ -typedef INT8 BOOLEAN; +typedef INT8 BOOLEAN; /** Signed 8 bit. */ -typedef INT8 BYTE; +typedef INT8 BYTE; /** Unsigned 8 bit. */ -typedef UINT8 UBYTE; +typedef UINT8 UBYTE; /** Signed 16 bit */ -typedef INT16 WORD; +typedef INT16 WORD; /** Unsigned 16 bit */ -typedef UINT16 UWORD; +typedef UINT16 UWORD; /** Signed 32 bit */ -typedef INT32 LWORD; +typedef INT32 LWORD; /** Unsigned 32 bit */ -typedef UINT32 ULWORD; +typedef UINT32 ULWORD; /** Signed 32 bit */ -typedef INT32 DWORD; +typedef INT32 DWORD; /** Unsigned 32 bit */ -typedef UINT32 UDWORD; +typedef UINT32 UDWORD; /** Useful definition for working with 8 bit + 8 bit fixed point values @@ -66,15 +70,15 @@ typedef UINT32 UDWORD; Use `.b.h` and `.b.l` (or just `.h` and `.l`) to directly access it's high and low unsigned 8 bit values. */ typedef union _fixed { - struct { - UBYTE l; - UBYTE h; - }; - struct { - UBYTE l; - UBYTE h; - } b; - UWORD w; + struct { + UBYTE l; + UBYTE h; + }; + struct { + UBYTE l; + UBYTE h; + } b; + UWORD w; } fixed; #endif diff --git a/gbdk-lib/include/asm/z80/string.h b/gbdk-lib/include/asm/z80/string.h @@ -51,7 +51,7 @@ void *memmove (void *dest, const void *src, size_t n) OLDCALL; @param c char value to fill with (truncated from int) @param n Number of bytes to fill */ -void *memset (void *s, int c, size_t n) __z88dk_callee; +void *memset (void *s, int c, size_t n) Z88DK_CALLEE; /** Reverses the characters in a string @@ -139,6 +139,6 @@ char *strncpy(char *s1, const char *s2, int n) NONBANKED; \li 0 if __buf1__ == __buf2__ \li < 0 if __buf1__ < __buf2__ */ -int memcmp(const void *buf1, const void *buf2, size_t count) __z88dk_callee; +int memcmp(const void *buf1, const void *buf2, size_t count) Z88DK_CALLEE; #endif diff --git a/gbdk-lib/include/asm/z80/types.h b/gbdk-lib/include/asm/z80/types.h @@ -9,6 +9,14 @@ #error z80 only. #endif +#ifdef __SDCC +#define Z88DK_CALLEE __z88dk_callee +#define Z88DK_FASTCALL __z88dk_fastcall +#else +#define Z88DK_CALLEE +#define Z88DK_FASTCALL +#endif + #define NONBANKED __nonbanked #define BANKED __banked #define CRITICAL __critical diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -323,7 +323,7 @@ void mode(uint8_t m) OLDCALL; @see M_DRAWING, M_TEXT_OUT, M_TEXT_INOUT, M_NO_SCROLL, M_NO_INTERP */ -uint8_t get_mode() OLDCALL __preserves_regs(b, c); +uint8_t get_mode() OLDCALL PRESERVES_REGS(b, c); /** GB CPU type @@ -573,7 +573,7 @@ void delay(uint16_t d) OLDCALL; @see J_START, J_SELECT, J_A, J_B, J_UP, J_DOWN, J_LEFT, J_RIGHT */ -uint8_t joypad() OLDCALL __preserves_regs(b, c, h, l); +uint8_t joypad() OLDCALL PRESERVES_REGS(b, c, h, l); /** Waits until at least one of the buttons given in mask are pressed. @@ -587,14 +587,14 @@ uint8_t joypad() OLDCALL __preserves_regs(b, c, h, l); @see joypad @see J_START, J_SELECT, J_A, J_B, J_UP, J_DOWN, J_LEFT, J_RIGHT */ -uint8_t waitpad(uint8_t mask) OLDCALL __preserves_regs(b, c); +uint8_t waitpad(uint8_t mask) OLDCALL PRESERVES_REGS(b, c); /** Waits for the directional pad and all buttons to be released. Note: Checks in a loop that doesn't HALT at all, so the CPU will be maxed out until this call returns. */ -void waitpadup() __preserves_regs(a, b, c, d, e, h, l); +void waitpadup() PRESERVES_REGS(a, b, c, d, e, h, l); /** Multiplayer joypad structure. @@ -628,7 +628,7 @@ uint8_t joypad_init(uint8_t npads, joypads_t * joypads) OLDCALL; @see joypad_init(), joypads_t */ -void joypad_ex(joypads_t * joypads) OLDCALL __preserves_regs(b, c); +void joypad_ex(joypads_t * joypads) OLDCALL PRESERVES_REGS(b, c); @@ -640,7 +640,7 @@ void joypad_ex(joypads_t * joypads) OLDCALL __preserves_regs(b, c); @see disable_interrupts, set_interrupts, CRITICAL */ -inline void enable_interrupts() __preserves_regs(a, b, c, d, e, h, l) { +inline void enable_interrupts() PRESERVES_REGS(a, b, c, d, e, h, l) { __asm__("ei"); } @@ -656,7 +656,7 @@ inline void enable_interrupts() __preserves_regs(a, b, c, d, e, h, l) { @see enable_interrupts, set_interrupts, CRITICAL */ -inline void disable_interrupts() __preserves_regs(a, b, c, d, e, h, l) { +inline void disable_interrupts() PRESERVES_REGS(a, b, c, d, e, h, l) { __asm__("di"); } @@ -666,7 +666,7 @@ inline void disable_interrupts() __preserves_regs(a, b, c, d, e, h, l) { @see enable_interrupts(), disable_interrupts() @see VBL_IFLAG, LCD_IFLAG, TIM_IFLAG, SIO_IFLAG, JOY_IFLAG */ -void set_interrupts(uint8_t flags) OLDCALL __preserves_regs(b, c, d, e); +void set_interrupts(uint8_t flags) OLDCALL PRESERVES_REGS(b, c, d, e); /** Performs a warm reset by reloading the CPU value then jumping to the start of crt0 (0x0150) @@ -683,18 +683,18 @@ void reset(); never return. If the screen is off this function returns immediately. */ -void wait_vbl_done() __preserves_regs(b, c, d, e, h, l); +void wait_vbl_done() PRESERVES_REGS(b, c, d, e, h, l); /** Turns the display off. Waits until the VBL interrupt before turning the display off. @see DISPLAY_ON */ -void display_off() __preserves_regs(b, c, d, e, h, l); +void display_off() PRESERVES_REGS(b, c, d, e, h, l); /** Copies data from shadow OAM to OAM */ -void refresh_OAM() __preserves_regs(b, c, d, e, h, l); +void refresh_OAM() PRESERVES_REGS(b, c, d, e, h, l); /** Copies data from somewhere in the lower address space to part of hi-ram. @@ -702,7 +702,7 @@ void refresh_OAM() __preserves_regs(b, c, d, e, h, l); @param src Area to copy from @param n Number of bytes to copy. */ -void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL __preserves_regs(b, c); +void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL PRESERVES_REGS(b, c); /** Turns the display back on. @@ -781,7 +781,7 @@ void hiramcpy(uint8_t dst, const void *src, uint8_t n) OLDCALL __preserves_regs( * @param addr address to write to * @param v value */ -void set_vram_byte(uint8_t * addr, uint8_t v) OLDCALL __preserves_regs(b, c); +void set_vram_byte(uint8_t * addr, uint8_t v) OLDCALL PRESERVES_REGS(b, c); /** * Get byte from vram at given memory location @@ -789,13 +789,13 @@ void set_vram_byte(uint8_t * addr, uint8_t v) OLDCALL __preserves_regs(b, c); * @param addr address to read from * @return read value */ -uint8_t get_vram_byte(uint8_t * addr) OLDCALL __preserves_regs(b, c); +uint8_t get_vram_byte(uint8_t * addr) OLDCALL PRESERVES_REGS(b, c); /** * Get address of X,Y tile of background map */ -uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b, c); +uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c); #define COMPAT_PALETTE(C0,C1,C2,C3) ((uint8_t)(((C3) << 6) | ((C2) << 4) | ((C1) << 2) | (C0))) @@ -828,7 +828,7 @@ inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) { @see set_win_data, set_tile_data */ -void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b, c); +void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c); #define set_bkg_2bpp_data set_bkg_data /** Sets VRAM Tile Pattern data for the Background / Window using 1bpp source data @@ -846,7 +846,7 @@ void set_bkg_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLD @see SHOW_BKG, HIDE_BKG, set_bkg_tiles */ -void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b, c); +void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c); /** Copies from Background / Window VRAM Tile Pattern data into a buffer @@ -862,7 +862,7 @@ void set_bkg_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data @see get_win_data, get_data */ -void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b, c); +void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c); /** Sets a rectangular region of Background Tile Map. @@ -917,7 +917,7 @@ void get_bkg_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL _ @see SHOW_BKG @see set_bkg_data, set_bkg_submap, set_win_tiles, set_tiles */ -void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL __preserves_regs(b, c); +void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c); #define set_tile_map set_bkg_tiles @@ -970,7 +970,7 @@ void set_bkg_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *m @see get_win_tiles, get_bkg_tile_xy, get_tiles, get_vram_byte */ -void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL __preserves_regs(b, c); +void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c); /** @@ -980,7 +980,7 @@ void get_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) O * @param t tile index * @return returns the address of tile, so you may use faster set_vram_byte() later */ -uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL __preserves_regs(b, c); +uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL PRESERVES_REGS(b, c); #define set_tile_xy set_bkg_tile_xy /** @@ -989,7 +989,7 @@ uint8_t * set_bkg_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL __preserves_r * @param y Y-coordinate * @return returns tile index */ -uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b, c); +uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c); /** Moves the Background Layer to the position specified in __x__ and __y__ in pixels. @@ -1028,7 +1028,7 @@ inline void scroll_bkg(int8_t x, int8_t y) { /** * Get address of X,Y tile of window map */ -uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b, c); +uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c); /** Sets VRAM Tile Pattern data for the Window / Background @@ -1043,7 +1043,7 @@ uint8_t * get_win_xy_addr(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b, c); @see set_win_tiles, set_bkg_data, set_data @see SHOW_WIN, HIDE_WIN */ -void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b, c); +void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c); /** Sets VRAM Tile Pattern data for the Window / Background using 1bpp source data @@ -1057,7 +1057,7 @@ void set_win_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLD @see set_bkg_data, set_bkg_1bpp_data, set_win_data */ -void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b, c); +void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c); /** Copies from Window / Background VRAM Tile Pattern data into a buffer @@ -1071,7 +1071,7 @@ void set_win_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data @see get_bkg_data, get_data */ -void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b, c); +void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c); /** Sets a rectangular region of the Window Tile Map. @@ -1105,7 +1105,7 @@ void get_win_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL _ @see SHOW_WIN, HIDE_WIN, set_win_submap, set_bkg_tiles, set_bkg_data, set_tiles */ -void set_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL __preserves_regs(b, c); +void set_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c); /** Sets a rectangular area of the Window Tile Map using a sub-region @@ -1158,7 +1158,7 @@ void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *m @see get_bkg_tiles, get_bkg_tile_xy, get_tiles, get_vram_byte */ -void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL __preserves_regs(b, c); +void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c); /** @@ -1168,7 +1168,7 @@ void get_win_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *tiles) O * @param t tile index * @return returns the address of tile, so you may use faster set_vram_byte() later */ -uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL __preserves_regs(b, c); +uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL PRESERVES_REGS(b, c); /** @@ -1177,7 +1177,7 @@ uint8_t * set_win_tile_xy(uint8_t x, uint8_t y, uint8_t t) OLDCALL __preserves_r * @param y Y-coordinate * @return returns the tile index */ -uint8_t get_win_tile_xy(uint8_t x, uint8_t y) OLDCALL __preserves_regs(b, c); +uint8_t get_win_tile_xy(uint8_t x, uint8_t y) OLDCALL PRESERVES_REGS(b, c); /** Moves the Window to the __x__, __y__ position on the screen. @@ -1226,7 +1226,7 @@ inline void scroll_win(int8_t x, int8_t y) { \li VBK_REG=0 indicates the first bank \li VBK_REG=1 indicates the second */ -void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b, c); +void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c); #define set_sprite_2bpp_data set_sprite_data /** Sets VRAM Tile Pattern data for Sprites using 1bpp source data @@ -1244,7 +1244,7 @@ void set_sprite_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) @see SHOW_SPRITES, HIDE_SPRITES, set_sprite_tile */ -void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL __preserves_regs(b, c); +void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data) OLDCALL PRESERVES_REGS(b, c); /** Copies from Sprite VRAM Tile Pattern data into a buffer @@ -1258,7 +1258,7 @@ void set_sprite_1bpp_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *d Each Tile is 16 bytes, so the buffer pointed to by __data__ should be at least __nb_tiles__ x 16 bytes in size. */ -void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL __preserves_regs(b, c); +void get_sprite_data(uint8_t first_tile, uint8_t nb_tiles, uint8_t *data) OLDCALL PRESERVES_REGS(b, c); /** Sprite Attributes structure @@ -1442,7 +1442,7 @@ inline void hide_sprite(uint8_t nb) { @see set_bkg_data, set_win_data, set_tile_data */ -void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) OLDCALL __preserves_regs(b, c); +void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) OLDCALL PRESERVES_REGS(b, c); /** Copies arbitrary data from an address in VRAM into a buffer @@ -1460,7 +1460,7 @@ void set_data(uint8_t *vram_addr, const uint8_t *data, uint16_t len) OLDCALL __p @see get_bkg_data, get_win_data */ -void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len) OLDCALL __preserves_regs(b, c); +void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len) OLDCALL PRESERVES_REGS(b, c); /** Copies arbitrary data from an address in VRAM into a buffer @@ -1474,7 +1474,7 @@ void get_data(uint8_t *data, uint8_t *vram_addr, uint16_t len) OLDCALL __preserv \li VBK_REG=0 indicates the first bank \li VBK_REG=1 indicates the second */ -void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len) OLDCALL __preserves_regs(b, c); +void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len) OLDCALL PRESERVES_REGS(b, c); @@ -1501,7 +1501,7 @@ void vmemcpy(uint8_t *dest, uint8_t *sour, uint16_t len) OLDCALL __preserves_reg @see set_bkg_tiles, set_win_tiles */ -void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL __preserves_regs(b, c); +void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, const uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c); /** Sets VRAM Tile Pattern data starting from given base address without taking into account the state of LCDC bit 4. @@ -1513,7 +1513,7 @@ void set_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, c @see set_bkg_data, set_win_data, set_data */ -void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL __preserves_regs(b, c); +void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, uint8_t base) OLDCALL PRESERVES_REGS(b, c); /** Copies a rectangular region of Tile Map entries from a given VRAM Address into a buffer without taking into account the state of LCDC bit 4. @@ -1536,7 +1536,7 @@ void set_tile_data(uint8_t first_tile, uint8_t nb_tiles, const uint8_t *data, ui @see get_bkg_tiles, get_win_tiles */ -void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL __preserves_regs(b, c); +void get_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t *vram_addr, uint8_t *tiles) OLDCALL PRESERVES_REGS(b, c); /** Sets VRAM Tile Pattern data in the native format @@ -1567,14 +1567,14 @@ inline void set_native_tile_data(uint16_t first_tile, uint8_t nb_tiles, const ui Note: This function avoids writes during modes 2 & 3 */ -void init_win(uint8_t c) OLDCALL __preserves_regs(b, c); +void init_win(uint8_t c) OLDCALL PRESERVES_REGS(b, c); /** Initializes the entire Background Tile Map with Tile Number __c__ @param c Tile number to fill with Note: This function avoids writes during modes 2 & 3 */ -void init_bkg(uint8_t c) OLDCALL __preserves_regs(b, c); +void init_bkg(uint8_t c) OLDCALL PRESERVES_REGS(b, c); /** Fills the VRAM memory region __s__ of size __n__ with Tile Number __c__ @param s Start address in VRAM @@ -1583,7 +1583,7 @@ void init_bkg(uint8_t c) OLDCALL __preserves_regs(b, c); Note: This function avoids writes during modes 2 & 3 */ -void vmemset (void *s, uint8_t c, size_t n) OLDCALL __preserves_regs(b, c); +void vmemset (void *s, uint8_t c, size_t n) OLDCALL PRESERVES_REGS(b, c); @@ -1595,7 +1595,7 @@ void vmemset (void *s, uint8_t c, size_t n) OLDCALL __preserves_regs(b, c); @param h Height of area to set in tiles. Range 0 - 31 @param tile Fill value */ -void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL __preserves_regs(b, c); +void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b, c); #define fill_rect fill_bkg_rect /** Fills a rectangular region of Tile Map entries for the Window layer with tile. @@ -1606,6 +1606,6 @@ void fill_bkg_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLD @param h Height of area to set in tiles. Range 0 - 31 @param tile Fill value */ -void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL __preserves_regs(b, c); +void fill_win_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tile) OLDCALL PRESERVES_REGS(b, c); #endif /* _GB_H */ diff --git a/gbdk-lib/include/gb/gbdecompress.h b/gbdk-lib/include/gb/gbdecompress.h @@ -8,6 +8,7 @@ #ifndef __GBDECOMPRESS_H_INCLUDE #define __GBDECOMPRESS_H_INCLUDE +#include <types.h> #include <stdint.h> /** gb-decompress data from sour into dest @@ -17,7 +18,7 @@ @see gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data */ -uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) OLDCALL __preserves_regs(b, c); +uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) OLDCALL PRESERVES_REGS(b, c); /** gb-decompress background tiles into VRAM @@ -29,7 +30,7 @@ uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) OLDCALL __preserves @see gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data */ -void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t * sour) OLDCALL __preserves_regs(b, c); +void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t * sour) OLDCALL PRESERVES_REGS(b, c); /** gb-decompress window tiles into VRAM @@ -44,7 +45,7 @@ void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t * sour) OLDCALL __ @see gb_decompress, gb_decompress_bkg_data, gb_decompress_sprite_data */ -void gb_decompress_win_data(uint8_t first_tile, const uint8_t * sour) OLDCALL __preserves_regs(b, c); +void gb_decompress_win_data(uint8_t first_tile, const uint8_t * sour) OLDCALL PRESERVES_REGS(b, c); /** gb-decompress sprite tiles into VRAM @@ -56,6 +57,6 @@ void gb_decompress_win_data(uint8_t first_tile, const uint8_t * sour) OLDCALL __ @see gb_decompress, gb_decompress_bkg_data, gb_decompress_win_data */ -void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t * sour) OLDCALL __preserves_regs(b, c); +void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t * sour) OLDCALL PRESERVES_REGS(b, c); #endif diff --git a/gbdk-lib/include/gb/metasprites.h b/gbdk-lib/include/gb/metasprites.h @@ -103,7 +103,7 @@ static void __hide_metasprite(uint8_t id) OLDCALL; * @param from start OAM index * @param to finish OAM index */ -void hide_sprites_range(UINT8 from, UINT8 to) OLDCALL __preserves_regs(b, c); +void hide_sprites_range(UINT8 from, UINT8 to) OLDCALL PRESERVES_REGS(b, c); /** Moves metasprite to the absolute position x and y diff --git a/gbdk-lib/include/gb/sgb.h b/gbdk-lib/include/gb/sgb.h @@ -37,7 +37,7 @@ /** Returns a non-null value if running on Super GameBoy */ -uint8_t sgb_check() OLDCALL __preserves_regs(b, c); +uint8_t sgb_check() OLDCALL PRESERVES_REGS(b, c); /** Transfer a SGB packet @@ -51,6 +51,6 @@ uint8_t sgb_check() OLDCALL __preserves_regs(b, c); @see sgb_check() */ -void sgb_transfer(uint8_t * packet) OLDCALL __preserves_regs(b, c); +void sgb_transfer(uint8_t * packet) OLDCALL PRESERVES_REGS(b, c); #endif /* _SGB_H */ diff --git a/gbdk-lib/include/gbdk/rledecompress.h b/gbdk-lib/include/gbdk/rledecompress.h @@ -38,8 +38,8 @@ uint8_t rle_init(void * data) OLDCALL; */ uint8_t rle_decompress(void * dest, uint8_t len) OLDCALL; #elif defined(__TARGET_sms) || defined(__TARGET_gg) -uint8_t rle_init(void * data) __z88dk_fastcall; -uint8_t rle_decompress(void * dest, uint8_t len) __z88dk_callee; +uint8_t rle_init(void * data) Z88DK_FASTCALL; +uint8_t rle_decompress(void * dest, uint8_t len) Z88DK_CALLEE; #else #error Unrecognized port #endif diff --git a/gbdk-lib/include/rand.h b/gbdk-lib/include/rand.h @@ -27,7 +27,7 @@ #if defined(__PORT_gbz80) void initrand(uint16_t seed) OLDCALL; #elif defined(__PORT_z80) -void initrand(uint16_t seed) __z88dk_fastcall; +void initrand(uint16_t seed) Z88DK_FASTCALL; #endif /** Returns a random byte (8 bit) value. @@ -54,7 +54,7 @@ uint16_t randw() OLDCALL; #if defined(__PORT_gbz80) void initarand(uint16_t seed) OLDCALL; #elif defined(__PORT_z80) -void initarand(uint16_t seed) __z88dk_fastcall; +void initarand(uint16_t seed) Z88DK_FASTCALL; #endif /** Returns a random number generated with the linear lagged additive method. diff --git a/gbdk-lib/include/sms/gbdecompress.h b/gbdk-lib/include/sms/gbdecompress.h @@ -7,6 +7,7 @@ #ifndef __GBDECOMPRESS_H_INCLUDE #define __GBDECOMPRESS_H_INCLUDE +#include <types.h> #include <stdint.h> /** gb-decompress data from sour into dest @@ -18,6 +19,6 @@ @see gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data */ -uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) __z88dk_callee __preserves_regs(b, c); +uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest) Z88DK_CALLEE PRESERVES_REGS(b, c); #endif diff --git a/gbdk-lib/include/sms/metasprites.h b/gbdk-lib/include/sms/metasprites.h @@ -35,6 +35,7 @@ #define _METASPRITES_H_INCLUDE #include <sms/hardware.h> +#include <types.h> #include <stdint.h> /** Metasprite sub-item structure @@ -63,15 +64,15 @@ extern uint8_t __current_base_tile; extern uint8_t __render_shadow_OAM; -static uint8_t __move_metasprite(uint8_t id, uint8_t x, uint8_t y) __z88dk_callee __preserves_regs(iyh,iyl); -static void __hide_metasprite(uint8_t id) __z88dk_fastcall __preserves_regs(iyh,iyl); +static uint8_t __move_metasprite(uint8_t id, uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); +static void __hide_metasprite(uint8_t id) Z88DK_FASTCALL PRESERVES_REGS(iyh, iyl); /** * Hides all hardware sprites in range from <= X < to * @param from start OAM index * @param to finish OAM index */ -void hide_sprites_range(UINT8 from, UINT8 to) __z88dk_callee __preserves_regs(iyh,iyl); +void hide_sprites_range(UINT8 from, UINT8 to) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); /** Moves metasprite to the absolute position x and y diff --git a/gbdk-lib/include/sms/sms.h b/gbdk-lib/include/sms/sms.h @@ -83,8 +83,8 @@ #define __WRITE_VDP_REG(REG, v) shadow_##REG=(v);__critical{VDP_CMD=(shadow_##REG),VDP_CMD=REG;} #define __READ_VDP_REG(REG) shadow_##REG -void WRITE_VDP_CMD(uint16_t cmd) __z88dk_fastcall __preserves_regs(b, c, d, e, iyh, iyl); -void WRITE_VDP_DATA(uint16_t data) __z88dk_fastcall __preserves_regs(b, c, d, e, iyh, iyl); +void WRITE_VDP_CMD(uint16_t cmd) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl); +void WRITE_VDP_DATA(uint16_t data) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl); /** Set the current screen mode - one of M_* modes @@ -124,7 +124,7 @@ uint8_t get_mode() OLDCALL; */ #define JOY_IFLAG 0x10U -void set_interrupts(uint8_t flags) __z88dk_fastcall; +void set_interrupts(uint8_t flags) Z88DK_FASTCALL; /* Limits */ /** Width of the visible screen in pixels. @@ -154,36 +154,36 @@ typedef void (*int_handler)(void) NONBANKED; /** Removes the VBL interrupt handler. @see add_VBL() */ -void remove_VBL(int_handler h) __z88dk_fastcall __preserves_regs(iyh, iyl); +void remove_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(iyh, iyl); /** Removes the LCD interrupt handler. @see add_LCD(), remove_VBL() */ -void remove_LCD(int_handler h) __z88dk_fastcall __preserves_regs(b, c, iyh, iyl); +void remove_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b, c, iyh, iyl); -void remove_TIM(int_handler h) __z88dk_fastcall; -void remove_SIO(int_handler h) __z88dk_fastcall; -void remove_JOY(int_handler h) __z88dk_fastcall; +void remove_TIM(int_handler h) Z88DK_FASTCALL; +void remove_SIO(int_handler h) Z88DK_FASTCALL; +void remove_JOY(int_handler h) Z88DK_FASTCALL; /** Adds a V-blank interrupt handler. */ -void add_VBL(int_handler h) __z88dk_fastcall __preserves_regs(d, e, iyh, iyl); +void add_VBL(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(d, e, iyh, iyl); /** Adds a LCD interrupt handler. */ -void add_LCD(int_handler h) __z88dk_fastcall __preserves_regs(b, c, iyh, iyl); +void add_LCD(int_handler h) Z88DK_FASTCALL PRESERVES_REGS(b, c, iyh, iyl); /** Does nothing on SMS/GG */ -void add_TIM(int_handler h) __z88dk_fastcall; +void add_TIM(int_handler h) Z88DK_FASTCALL; /** Does nothing on SMS/GG */ -void add_SIO(int_handler h) __z88dk_fastcall; +void add_SIO(int_handler h) Z88DK_FASTCALL; /** Does nothing on SMS/GG */ -void add_JOY(int_handler h) __z88dk_fastcall; +void add_JOY(int_handler h) Z88DK_FASTCALL; /** Cancel pending interrupts */ @@ -212,7 +212,7 @@ inline void scroll_bkg(int8_t x, int8_t y) { never return. If the screen is off this function returns immediately. */ -void wait_vbl_done() __preserves_regs(b, c, d, e, h, l, iyh, iyl); +void wait_vbl_done() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); /** Turns the display off. @@ -387,23 +387,23 @@ __endasm; \ Uses no timers or interrupts, and can be called with interrupts disabled */ -void delay(uint16_t d) __z88dk_fastcall; +void delay(uint16_t d) Z88DK_FASTCALL; /** Reads and returns the current state of the joypad. */ -uint8_t joypad() OLDCALL __preserves_regs(b, c, d, e, h, iyh, iyl); +uint8_t joypad() OLDCALL PRESERVES_REGS(b, c, d, e, h, iyh, iyl); /** Waits until at least one of the buttons given in mask are pressed. */ -uint8_t waitpad(uint8_t mask) __z88dk_fastcall __preserves_regs(b, c, d, e, iyh, iyl); +uint8_t waitpad(uint8_t mask) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl); /** Waits for the directional pad and all buttons to be released. Note: Checks in a loop that doesn't HALT at all, so the CPU will be maxed out until this call returns. */ -void waitpadup() __preserves_regs(b, c, d, e, iyh, iyl); +void waitpadup() PRESERVES_REGS(b, c, d, e, iyh, iyl); /** Multiplayer joypad structure. @@ -428,7 +428,7 @@ typedef struct { @returns number of joypads avaliable @see joypad_ex(), joypads_t */ -uint8_t joypad_init(uint8_t npads, joypads_t * joypads) __z88dk_callee; +uint8_t joypad_init(uint8_t npads, joypads_t * joypads) Z88DK_CALLEE; /** Polls all avaliable joypads @param joypads pointer to joypads_t structure to be filled with joypad statuses, @@ -436,7 +436,7 @@ uint8_t joypad_init(uint8_t npads, joypads_t * joypads) __z88dk_callee; @see joypad_init(), joypads_t */ -void joypad_ex(joypads_t * joypads) __z88dk_fastcall __preserves_regs(iyh, iyl); +void joypad_ex(joypads_t * joypads) Z88DK_FASTCALL PRESERVES_REGS(iyh, iyl); #if defined(__TARGET_sms) @@ -505,14 +505,14 @@ typedef uint16_t palette_color_t; void set_default_palette(); inline void cpu_fast() {} -void set_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) __z88dk_callee __preserves_regs(iyh, iyl); +void set_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); #define set_bkg_palette_entry set_palette_entry #define set_sprite_palette_entry(palette,entry,rgb_data) set_palette_entry(1,entry,rgb_data) -void set_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) __z88dk_callee; +void set_palette(uint8_t first_palette, uint8_t nb_palettes, palette_color_t *rgb_data) Z88DK_CALLEE; #define set_bkg_palette set_palette #define set_sprite_palette(first_palette,nb_palettes,rgb_data) set_palette(1,1,rgb_data) -void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) __z88dk_callee __preserves_regs(iyh,iyl); +void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); inline void set_bkg_4bpp_data(uint16_t start, uint16_t ntiles, const void *src) { set_native_tile_data(start, ntiles, src); } @@ -525,7 +525,7 @@ extern uint16_t _current_2bpp_palette; inline void set_2bpp_palette(uint16_t palette) { _current_2bpp_palette = palette; } -void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) __z88dk_callee __preserves_regs(iyh,iyl); +void set_tile_2bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t palette) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); inline void set_bkg_data(uint16_t start, uint16_t ntiles, const void *src) { set_tile_2bpp_data(start, ntiles, src, _current_2bpp_palette); } @@ -543,7 +543,7 @@ extern uint16_t _current_1bpp_colors; inline void set_1bpp_colors(uint8_t fgcolor, uint8_t bgcolor) { _current_1bpp_colors = ((uint16_t)bgcolor << 8) | fgcolor; } -void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) __z88dk_callee __preserves_regs(iyh,iyl); +void set_tile_1bpp_data(uint16_t start, uint16_t ntiles, const void *src, uint16_t colors) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); inline void set_bkg_1bpp_data(uint16_t start, uint16_t ntiles, const void *src) { set_tile_1bpp_data(start, ntiles, src, _current_1bpp_colors); } @@ -560,16 +560,16 @@ inline void set_sprite_1bpp_data(uint16_t start, uint16_t ntiles, const void *sr Copies __size__ bytes from a buffer at _src__ to VRAM starting at __dst__. */ -void set_data(uint16_t dst, const void *src, uint16_t size) __z88dk_callee __preserves_regs(iyh, iyl); -void vmemcpy(uint16_t dst, const void *src, uint16_t size) __z88dk_callee __preserves_regs(iyh, iyl); +void set_data(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); +void vmemcpy(uint16_t dst, const void *src, uint16_t size) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); -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); -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, iyl); +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); +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, iyl); #define set_bkg_tiles set_tile_map_compat #define set_win_tiles set_tile_map_compat -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); -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); +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); +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); 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) { set_tile_submap_compat(x, y, w, h, map_w, map); } @@ -577,8 +577,8 @@ inline void set_win_submap(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uin set_tile_submap_compat(x, y, w, h, map_w, map); } -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); -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, iyl); +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); +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, iyl); #define fill_bkg_rect fill_rect_compat #define fill_win_rect fill_rect_compat @@ -725,7 +725,7 @@ inline void hide_sprite(uint8_t nb) { * @param addr address to write to * @param v value */ -void set_vram_byte(uint8_t * addr, uint8_t v) __z88dk_callee __preserves_regs(iyh, iyl); +void set_vram_byte(uint8_t * addr, uint8_t v) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); /** * Set single tile t with attributes on background layer at x,y @@ -734,7 +734,7 @@ void set_vram_byte(uint8_t * addr, uint8_t v) __z88dk_callee __preserves_regs(iy * @param t tile index * @return returns the address of tile, so you may use faster set_vram_byte() later */ -uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) __z88dk_callee __preserves_regs(iyh, iyl); +uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); /** * Set single tile t on background layer at x,y @@ -743,14 +743,14 @@ uint8_t * set_attributed_tile_xy(uint8_t x, uint8_t y, uint16_t t) __z88dk_calle * @param t tile index * @return returns the address of tile, so you may use faster set_vram_byte() later */ -uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) __z88dk_callee __preserves_regs(iyh, iyl); +uint8_t * set_tile_xy(uint8_t x, uint8_t y, uint8_t t) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); #define set_bkg_tile_xy set_tile_xy #define set_win_tile_xy set_tile_xy /** * Get address of X,Y tile of background map */ -uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) __z88dk_callee __preserves_regs(iyh, iyl); +uint8_t * get_bkg_xy_addr(uint8_t x, uint8_t y) Z88DK_CALLEE PRESERVES_REGS(iyh, iyl); #define get_win_xy_addr get_bkg_xy_addr #endif /* _SMS_H */

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.