gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 83d474472984c3665d9888a62519780c0bdf47c9 parent 644e0fad3598708859acb52f563c44fa71bbefba Author: Toxa <untoxa@mail.ru> Date: Mon, 6 Feb 2023 01:24:16 +0300 fix most of the "function declarator with no prototype" warnings Diffstat:
| M | gbdk-lib/include/assert.h | 2 | +- |
| M | gbdk-lib/include/gb/cgb.h | 8 | ++++---- |
| M | gbdk-lib/include/gb/crash_handler.h | 2 | +- |
| M | gbdk-lib/include/gb/gb.h | 32 | ++++++++++++++++---------------- |
| M | gbdk-lib/include/gb/sgb.h | 2 | +- |
| M | gbdk-lib/include/gbdk/console.h | 6 | +++--- |
| M | gbdk-lib/include/gbdk/emu_debug.h | 4 | ++-- |
| M | gbdk-lib/include/gbdk/far_ptr.h | 2 | +- |
| M | gbdk-lib/include/gbdk/font.h | 2 | +- |
| M | gbdk-lib/include/gbdk/incbin.h | 4 | ++-- |
| M | gbdk-lib/include/msx/msx.h | 20 | ++++++++++---------- |
| M | gbdk-lib/include/nes/nes.h | 24 | ++++++++++++------------ |
| M | gbdk-lib/include/sms/sms.h | 24 | ++++++++++++------------ |
| M | gbdk-lib/include/stdio.h | 2 | +- |
| M | gbdk-lib/include/time.h | 2 | +- |
15 files changed, 68 insertions(+), 68 deletions(-)
diff --git a/gbdk-lib/include/assert.h b/gbdk-lib/include/assert.h @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/gbdk-lib/include/gb/cgb.h b/gbdk-lib/include/gb/cgb.h @@ -157,7 +157,7 @@ void set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) @see cpu_fast() */ -void cpu_slow(); +void cpu_slow(void); /** Set CPU speed to fast (CGB Double Speed) operation. @@ -171,7 +171,7 @@ void cpu_slow(); @see cpu_slow(), _cpu */ -void cpu_fast(); +void cpu_fast(void); /** Set palette, compatible with the DMG/GBP. @@ -181,10 +181,10 @@ void cpu_fast(); \li You can check to see if @ref _cpu == @ref CGB_TYPE before using this function. */ -void set_default_palette(); +void set_default_palette(void); /** This function is obsolete */ -void cgb_compatibility(); +void cgb_compatibility(void); #endif /* _CGB_H */ diff --git a/gbdk-lib/include/gb/crash_handler.h b/gbdk-lib/include/gb/crash_handler.h @@ -19,7 +19,7 @@ See the intro for this file for more details. */ -void __HandleCrash(); +void __HandleCrash(void); static void * __CRASH_HANDLER_INIT = &__HandleCrash; #endif diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -340,7 +340,7 @@ void add_JOY(int_handler h); \endcode @see wait_int_handler() */ -void nowait_int_handler(); +void nowait_int_handler(void); /** Default Interrupt handler chain terminator that waits for @@ -355,11 +355,11 @@ void nowait_int_handler(); @see nowait_int_handler() */ -void wait_int_handler(); +void wait_int_handler(void); /** Cancel pending interrupts */ -inline uint8_t cancel_pending_interrupts() { +inline uint8_t cancel_pending_interrupts(void) { return IF_REG = 0; } @@ -375,7 +375,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(void) OLDCALL PRESERVES_REGS(b, c); /** GB CPU type @@ -427,7 +427,7 @@ extern volatile uint16_t sys_time; @see add_SIO(), remove_SIO() @see set_interrupts() with @ref SIO_IFLAG */ -void send_byte(); +void send_byte(void); /** Serial Link: Receive a byte from the serial port into @ref _io_in @@ -436,7 +436,7 @@ void send_byte(); @see add_SIO(), remove_SIO() @see set_interrupts() with @ref SIO_IFLAG */ -void receive_byte(); +void receive_byte(void); /** Serial Link: Current IO Status. An OR of IO_* */ extern volatile uint8_t _io_status; @@ -499,7 +499,7 @@ __REG _current_bank; Use @ref BANKREF_EXTERN() within another source file to make the variable and it's data accesible there. */ -#define BANKREF(VARNAME) void __func_ ## VARNAME() __banked __naked { \ +#define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \ __asm \ .local b___func_ ## VARNAME \ ___bank_ ## VARNAME = b___func_ ## VARNAME \ @@ -660,7 +660,7 @@ void delay(uint16_t d) PRESERVES_REGS(h, l); @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(void) PRESERVES_REGS(b, c, h, l); /** Waits until at least one of the buttons given in mask are pressed. @@ -681,7 +681,7 @@ uint8_t waitpad(uint8_t mask) PRESERVES_REGS(b, c, h, l); 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(void) PRESERVES_REGS(a, b, c, d, e, h, l); /** Multiplayer joypad structure. @@ -727,7 +727,7 @@ void joypad_ex(joypads_t * joypads) 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(void) PRESERVES_REGS(a, b, c, d, e, h, l) { __asm__("ei"); } @@ -743,7 +743,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(void) PRESERVES_REGS(a, b, c, d, e, h, l) { __asm__("di"); } @@ -762,7 +762,7 @@ void set_interrupts(uint8_t flags) PRESERVES_REGS(b, c, d, e, h, l); /** Performs a warm reset by reloading the CPU value then jumping to the start of crt0 (0x0150) */ -void reset(); +void reset(void); /** HALTs the CPU and waits for the vertical blank interrupt. @@ -774,22 +774,22 @@ void reset(); never return. If the screen is off this function returns immediately. */ -void vsync() PRESERVES_REGS(b, c, d, e, h, l); +void vsync(void) PRESERVES_REGS(b, c, d, e, h, l); /** Obsolete */ -void wait_vbl_done() PRESERVES_REGS(b, c, d, e, h, l); +void wait_vbl_done(void) 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(void) 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(void) PRESERVES_REGS(b, c, d, e, h, l); /** Copies data from somewhere in the lower address space to part of hi-ram. 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(void) 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() OLDCALL; +uint8_t posx(void) OLDCALL; /** Returns the current Y position of the cursor. @see gotoxy() */ -uint8_t posy() OLDCALL; +uint8_t posy(void) OLDCALL; /** Writes out a single character at the current cursor position. @@ -39,7 +39,7 @@ void setchar(char c) OLDCALL; /** Clears the screen */ -void cls(); +void cls(void); #endif /* _CONSOLE_H */ diff --git a/gbdk-lib/include/gbdk/emu_debug.h b/gbdk-lib/include/gbdk/emu_debug.h @@ -133,8 +133,8 @@ __endasm */ #if defined(NINTENDO) -void EMU_profiler_message(); -#define BGB_profiler_message() EMU_profiler_message() +void EMU_profiler_message(void); +#define BGB_profiler_message EMU_profiler_message() #endif // NINTENDO /** Print the string and arguments given by format to the emulator debug message window diff --git a/gbdk-lib/include/gbdk/far_ptr.h b/gbdk-lib/include/gbdk/far_ptr.h @@ -86,7 +86,7 @@ extern volatile FAR_PTR __call_banked_ptr; extern volatile void * __call_banked_addr; extern volatile uint8_t __call_banked_bank; -void __call__banked(); +void __call__banked(void); /** Obtain a far pointer at runtime @param ofs Memory address within the given Segment (Bank) diff --git a/gbdk-lib/include/gbdk/font.h b/gbdk-lib/include/gbdk/font.h @@ -40,7 +40,7 @@ extern uint8_t font_ibm_fixed[]; /** Initializes the font system. Should be called before other font functions. */ -void font_init(); +void font_init(void); /** Load a font and set it as the current font. @param font Pointer to a font to load (usually a gbdk font) diff --git a/gbdk-lib/include/gbdk/incbin.h b/gbdk-lib/include/gbdk/incbin.h @@ -67,7 +67,7 @@ extern const void __bank_ ## VARNAME; */ #if defined(__TARGET_nes) // mos6502 target does not support banking yet - omit "__banked" keyword, and assume bank is 0 in asm code -#define INCBIN(VARNAME, FILEPATH) void __func_ ## VARNAME() __naked { \ +#define INCBIN(VARNAME, FILEPATH) void __func_ ## VARNAME(void) __naked { \ __asm \ _ ## VARNAME:: \ 1$: \ @@ -82,7 +82,7 @@ __endasm; \ } #else // Use __banked keyword and 'b' prefix for other targets -#define INCBIN(VARNAME, FILEPATH) void __func_ ## VARNAME() __banked __naked { \ +#define INCBIN(VARNAME, FILEPATH) void __func_ ## VARNAME(void) __banked __naked { \ __asm \ _ ## VARNAME:: \ 1$: \ diff --git a/gbdk-lib/include/msx/msx.h b/gbdk-lib/include/msx/msx.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() OLDCALL; +uint8_t get_mode(void) OLDCALL; /* Interrupt flags */ /** Disable calling of interrupt service routines @@ -212,17 +212,17 @@ inline void scroll_bkg(int8_t x, int8_t y) { never return. If the screen is off this function returns immediately. */ -void vsync() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); +void vsync(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); /** Obsolete */ -void wait_vbl_done() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); +void wait_vbl_done(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); /** Turns the display off. @see DISPLAY_ON */ -inline void display_off() { +inline void display_off(void) { __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) &= (~R1_DISP_ON)); } @@ -240,7 +240,7 @@ inline void display_off() { /** Copies data from shadow OAM to OAM */ -void refresh_OAM(); +void refresh_OAM(void); /** Blanks leftmost column, so it is not garbaged when you use horizontal scroll @see SHOW_LEFT_COLUMN @@ -337,7 +337,7 @@ extern volatile uint8_t _current_bank; Use @ref BANKREF_EXTERN() within another source file to make the variable and it's data accesible there. */ -#define BANKREF(VARNAME) void __func_ ## VARNAME() __banked __naked { \ +#define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \ __asm \ .local b___func_ ## VARNAME \ ___bank_ ## VARNAME = b___func_ ## VARNAME \ @@ -396,7 +396,7 @@ 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(void) OLDCALL PRESERVES_REGS(b, c, d, e, h, iyh, iyl); /** Waits until at least one of the buttons given in mask are pressed. */ @@ -407,7 +407,7 @@ uint8_t waitpad(uint8_t mask) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl 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(void) PRESERVES_REGS(b, c, d, e, iyh, iyl); /** Multiplayer joypad structure. @@ -474,8 +474,8 @@ typedef uint8_t palette_color_t; #error Unrecognized port #endif -void set_default_palette(); -inline void cpu_fast() {} +void set_default_palette(void); +inline void cpu_fast(void) {} 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 diff --git a/gbdk-lib/include/nes/nes.h b/gbdk-lib/include/nes/nes.h @@ -160,7 +160,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; +uint8_t get_mode(void) OLDCALL; /** Global Time Counter in VBL periods (60Hz) @@ -224,7 +224,7 @@ extern volatile uint8_t _current_bank; /** Dummy macro for no-bank-switching WIP prototype @param b ROM bank to switch to */ -#define SWITCH_ROM_DUMMY(b) +#define SWITCH_ROM_DUMMY(b) /** Makes default mapper switch the active ROM bank @param b ROM bank to switch to (max 255) @@ -248,7 +248,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; +uint8_t joypad(void) OLDCALL; /** Waits until at least one of the buttons given in mask are pressed. @@ -263,7 +263,7 @@ uint8_t waitpad(uint8_t mask) OLDCALL; /** Waits for the directional pad and all buttons to be released. */ -void waitpadup(); +void waitpadup(void); /** Multiplayer joypad structure. @@ -306,7 +306,7 @@ void joypad_ex(joypads_t * joypads) OLDCALL; @see disable_interrupts, set_interrupts, CRITICAL */ -inline void enable_interrupts() { +inline void enable_interrupts(void) { __asm__("cli"); } @@ -322,7 +322,7 @@ inline void enable_interrupts() { @see enable_interrupts, set_interrupts, CRITICAL */ -inline void disable_interrupts() { +inline void disable_interrupts(void) { __asm__("sei"); } @@ -335,22 +335,22 @@ inline void disable_interrupts() { Warning: If the VBL interrupt is disabled, this function will never return. */ -void vsync(); +void vsync(void); /** Obsolete */ -void wait_vbl_done(); +void wait_vbl_done(void); /** Turns the display off. Waits until the VBL interrupt before turning the display off. @see DISPLAY_ON */ -void display_off(); +void display_off(void); /** Copies data from shadow OAM to OAM */ -void refresh_OAM(); +void refresh_OAM(void); /** Turns the display back on. @see display_off, DISPLAY_OFF @@ -504,7 +504,7 @@ void set_bkg_tiles(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *ti D3-D2: Top-right 16x16 pixels D5-D4: Bottom-left 16x16 pixels D7-D6: Bottom-right 16x16 pixels - + https://www.nesdev.org/wiki/PPU_attribute_tables @see SHOW_BKG @@ -586,7 +586,7 @@ inline void set_bkg_attributes(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const */ void set_bkg_submap_attributes_nes16x16(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *map, uint8_t map_w) OLDCALL; -/** Sets a rectangular area of the Background Tile Map attributes using +/** Sets a rectangular area of the Background Tile Map attributes using a sub-region from a source tile map. Useful for scrolling implementations of maps larger than 32 x 30 tiles. diff --git a/gbdk-lib/include/sms/sms.h b/gbdk-lib/include/sms/sms.h @@ -102,7 +102,7 @@ void mode(uint8_t m) OLDCALL; @see M_TEXT_OUT, M_TEXT_INOUT, M_NO_SCROLL, M_NO_INTERP */ -uint8_t get_mode() OLDCALL; +uint8_t get_mode(void) OLDCALL; /* Interrupt flags */ /** Disable calling of interrupt service routines @@ -191,7 +191,7 @@ void add_JOY(int_handler h) Z88DK_FASTCALL; /** Cancel pending interrupts */ -inline uint8_t cancel_pending_interrupts() { +inline uint8_t cancel_pending_interrupts(void) { return VDP_STATUS; } @@ -216,17 +216,17 @@ inline void scroll_bkg(int8_t x, int8_t y) { never return. If the screen is off this function returns immediately. */ -void vsync() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); +void vsync(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); /** Obsolete */ -void wait_vbl_done() PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); +void wait_vbl_done(void) PRESERVES_REGS(b, c, d, e, h, l, iyh, iyl); /** Turns the display off. @see DISPLAY_ON */ -inline void display_off() { +inline void display_off(void) { __WRITE_VDP_REG(VDP_R1, __READ_VDP_REG(VDP_R1) &= (~R1_DISP_ON)); } @@ -244,7 +244,7 @@ inline void display_off() { /** Copies data from shadow OAM to OAM */ -void refresh_OAM(); +void refresh_OAM(void); /** Blanks leftmost column, so it is not garbaged when you use horizontal scroll @see SHOW_LEFT_COLUMN @@ -341,7 +341,7 @@ extern volatile uint16_t sys_time; Use @ref BANKREF_EXTERN() within another source file to make the variable and it's data accesible there. */ -#define BANKREF(VARNAME) void __func_ ## VARNAME() __banked __naked { \ +#define BANKREF(VARNAME) void __func_ ## VARNAME(void) __banked __naked { \ __asm \ .local b___func_ ## VARNAME \ ___bank_ ## VARNAME = b___func_ ## VARNAME \ @@ -400,7 +400,7 @@ 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(void) OLDCALL PRESERVES_REGS(b, c, d, e, h, iyh, iyl); /** Waits until at least one of the buttons given in mask are pressed. */ @@ -411,7 +411,7 @@ uint8_t waitpad(uint8_t mask) Z88DK_FASTCALL PRESERVES_REGS(b, c, d, e, iyh, iyl 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(void) PRESERVES_REGS(b, c, d, e, iyh, iyl); /** Multiplayer joypad structure. @@ -510,12 +510,12 @@ typedef uint16_t palette_color_t; #error Unrecognized port #endif -void set_default_palette(); -inline void cgb_compatibility() { +void set_default_palette(void); +inline void cgb_compatibility(void) { set_default_palette(); } -inline void cpu_fast() {} +inline void cpu_fast(void) {} 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 diff --git a/gbdk-lib/include/stdio.h b/gbdk-lib/include/stdio.h @@ -71,6 +71,6 @@ char *gets(char *s) OLDCALL; /** getchar() Reads and returns a single character from stdin. */ -char getchar() OLDCALL; +char getchar(void) OLDCALL; #endif diff --git a/gbdk-lib/include/time.h b/gbdk-lib/include/time.h @@ -22,7 +22,7 @@ typedef uint16_t time_t; @see sys_time, time() */ -clock_t clock() OLDCALL; +clock_t clock(void) OLDCALL; /** Converts clock() time to Seconds
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.