git.y1.nz

gbdk-2020

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

commit 582fb3da2191bc46a5391f13893da28e08b775ac
parent 0a28368ce3e3b9e1d8524a0624c06d9dbc153cae
Author: Toxa <untoxa@mail.ru>
Date:   Tue, 14 Sep 2021 16:12:18 +0300

fix definitions for SDCC #12674

Diffstat:
Mgbdk-lib/examples/gb/samptest/sample.h2+-
Mgbdk-lib/include/gb/cgb.h12++++--------
Mgbdk-lib/include/gb/gb.h4++--
Mgbdk-lib/include/gb/metasprites.h2+-
Mgbdk-lib/include/gb/sgb.h2+-
Mgbdk-lib/include/gbdk/console.h4++--
Mgbdk-lib/include/rand.h6+++---
Mgbdk-lib/include/sms/sms.h4++--
Mgbdk-lib/include/stdatomic.h2+-
Mgbdk-lib/libc/sprintf.c5+++--
10 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/gbdk-lib/examples/gb/samptest/sample.h b/gbdk-lib/examples/gb/samptest/sample.h @@ -15,6 +15,6 @@ /** Play the given, appropriatly formatted sample. */ -void play_sample(uint8_t *start, uint16_t len) NONBANKED; +void play_sample(uint8_t *start, uint16_t len) OLDCALL; #endif /* _SAMPLE_H */ diff --git a/gbdk-lib/include/gb/cgb.h b/gbdk-lib/include/gb/cgb.h @@ -99,8 +99,7 @@ typedef uint16_t palette_entry_t; /**< 16 bit color entry */ @see RGB(), set_bkg_palette_entry() */ -void -set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, palette_entry_t *rgb_data) OLDCALL; +void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, palette_entry_t *rgb_data) OLDCALL; /** Set CGB sprite palette(s). @@ -117,8 +116,7 @@ set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, palette_entry_t *rgb @see RGB(), set_sprite_palette_entry() */ -void -set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, palette_entry_t *rgb_data) OLDCALL; +void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, palette_entry_t *rgb_data) OLDCALL; /** Sets a single color in the specified CGB background palette. @@ -129,8 +127,7 @@ set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, palette_entry_t * @see set_bkg_palette(), RGB() */ -void -set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL; +void set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL; /** Sets a single color in the specified CGB sprite palette. @@ -140,8 +137,7 @@ set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL @see set_sprite_palette(), RGB() */ -void -set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL; +void set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL; /** Set CPU speed to slow (Normal Speed) operation. diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -321,7 +321,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() __preserves_regs(b, c); +uint8_t get_mode() OLDCALL __preserves_regs(b, c); /** GB CPU type @@ -561,7 +561,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() __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. diff --git a/gbdk-lib/include/gb/metasprites.h b/gbdk-lib/include/gb/metasprites.h @@ -96,7 +96,7 @@ static uint8_t __move_metasprite(uint8_t id, uint8_t x, uint8_t y) OLDCALL; static uint8_t __move_metasprite_vflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL; static uint8_t __move_metasprite_hflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL; static uint8_t __move_metasprite_hvflip(uint8_t id, uint8_t x, uint8_t y) OLDCALL; -static void __hide_metasprite(uint8_t id); +static void __hide_metasprite(uint8_t id) OLDCALL; /** * Hides all hardware sprites in range from <= X < to 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() __preserves_regs(b, c); +uint8_t sgb_check() OLDCALL __preserves_regs(b, c); /** Transfer a SGB packet diff --git a/gbdk-lib/include/gbdk/console.h b/gbdk-lib/include/gbdk/console.h @@ -20,13 +20,13 @@ void gotoxy(uint8_t x, uint8_t y) OLDCALL; @see gotoxy() */ -uint8_t posx(); +uint8_t posx() OLDCALL; /** Returns the current Y position of the cursor. @see gotoxy() */ -uint8_t posy(); +uint8_t posy() OLDCALL; /** Writes out a single character at the current cursor position. diff --git a/gbdk-lib/include/rand.h b/gbdk-lib/include/rand.h @@ -34,13 +34,13 @@ void initrand(uint16_t seed) __z88dk_fastcall; @ref initrand() should be used to initialize the random number generator before using rand() */ -int8_t rand(); +int8_t rand() OLDCALL; /** Returns a random word (16 bit) value. @ref initrand() should be used to initialize the random number generator before using rand() */ -uint16_t randw(); +uint16_t randw() OLDCALL; /** Random generator using the linear lagged additive method @@ -61,6 +61,6 @@ void initarand(uint16_t seed) __z88dk_fastcall; @ref initarand() should be used to initialize the random number generator before using arand() */ -int8_t arand(); +int8_t arand() OLDCALL; #endif diff --git a/gbdk-lib/include/sms/sms.h b/gbdk-lib/include/sms/sms.h @@ -98,7 +98,7 @@ void mode(uint8_t m) OLDCALL; @see M_TEXT_OUT, M_TEXT_INOUT, M_NO_SCROLL, M_NO_INTERP */ -uint8_t get_mode(); +uint8_t get_mode() OLDCALL; /* Interrupt flags */ /** Disable calling of interrupt service routines @@ -392,7 +392,7 @@ void delay(uint16_t d) __z88dk_fastcall; /** Reads and returns the current state of the joypad. */ -uint8_t joypad() __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. */ diff --git a/gbdk-lib/include/stdatomic.h b/gbdk-lib/include/stdatomic.h @@ -11,7 +11,7 @@ typedef struct {unsigned char flag;} atomic_flag; #error Support for atomic_flag not implemented #endif -_Bool atomic_flag_test_and_set(volatile atomic_flag *object); +_Bool atomic_flag_test_and_set(volatile atomic_flag *object) OLDCALL; void atomic_flag_clear(volatile atomic_flag *object); diff --git a/gbdk-lib/libc/sprintf.c b/gbdk-lib/libc/sprintf.c @@ -1,8 +1,9 @@ +#include <types.h> #include <stdio.h> #include <stdarg.h> #include <stdlib.h> -typedef void (*emitter_t)(char, char **); +typedef void (*emitter_t)(char, char **) OLDCALL; static const char _hex[] = "0123456789ABCDEF"; @@ -97,7 +98,7 @@ void __printf(const char *format, emitter_t emitter, char **pData, va_list va) } } -static void _sprintf_emitter(char c, char ** pData) +static void _sprintf_emitter(char c, char ** pData) OLDCALL { **pData = c; (*pData)++;

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