git.y1.nz

gbdk-2020

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

commit 380d0633c8b0c597ed18dc4822f3a9e4a9aa3750
parent 9bdca4da3b063f6293689977c3328fec93566aec
Author: Toxa <untoxa@mail.ru>
Date:   Mon, 29 Nov 2021 20:01:26 +0300

use defines to wrap SDCC specific features

Diffstat:
Mgbdk-lib/include/asm/gbz80/types.h5++++-
Mgbdk-lib/include/asm/types.h2++
Mgbdk-lib/include/asm/z80/types.h32+++++++++++++++++++++++++++-----
3 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/gbdk-lib/include/asm/gbz80/types.h b/gbdk-lib/include/asm/gbz80/types.h @@ -9,6 +9,8 @@ #error gbz80 only. #endif +#ifdef __SDCC + #define NONBANKED __nonbanked /**< Placed in the non-banked lower 16K region (bank 0), regardless of the bank selected by it's source file. */ #define BANKED __banked /**< The function will use banked sdcc calls, and is placed in the bank selected by it's source file (or compiler switches). */ @@ -21,7 +23,6 @@ @see enable_interrupts, disable_interrupts */ - #define CRITICAL __critical /** Indicate to the compiler the function will be used as an interrupt handler. @@ -35,6 +36,8 @@ */ #define INTERRUPT __interrupt +#endif + /** Signed eight bit. */ typedef signed char INT8; diff --git a/gbdk-lib/include/asm/types.h b/gbdk-lib/include/asm/types.h @@ -22,8 +22,10 @@ #ifdef __SDCC #define PRESERVES_REGS(...) __preserves_regs(__VA_ARGS__) +#define NAKED __naked #else #define PRESERVES_REGS(...) +#define NAKED #endif #ifndef NONBANKED diff --git a/gbdk-lib/include/asm/z80/types.h b/gbdk-lib/include/asm/z80/types.h @@ -10,17 +10,39 @@ #endif #ifdef __SDCC + #define Z88DK_CALLEE __z88dk_callee #define Z88DK_FASTCALL __z88dk_fastcall + +#define NONBANKED __nonbanked /**< Placed in the non-banked lower 16K region (bank 0), regardless of the bank selected by it's source file. */ +#define BANKED __banked /**< The function will use banked sdcc calls, and is placed in the bank selected by it's source file (or compiler switches). */ + +/** Use to create a block of of code which should execute with interrupts temporarily turned off. + + __Do not__ use @ref CRITICAL and @ref INTERRUPT attributes for a + function added via add_VBL() (or LCD, etc). The attributes + are only required when constructing a bare jump from the + interrupt vector itself. + + @see enable_interrupts, disable_interrupts +*/ +#define CRITICAL __critical + +/** Indicate to the compiler the function will be used as an interrupt handler. + + __Do not__ use @ref CRITICAL and @ref INTERRUPT attributes for a + function added via add_VBL() (or LCD, etc). The attributes + are only required when constructing a bare jump from the + interrupt vector itself. +*/ +#define INTERRUPT __interrupt + #else + #define Z88DK_CALLEE #define Z88DK_FASTCALL -#endif -#define NONBANKED __nonbanked -#define BANKED __banked -#define CRITICAL __critical -#define INTERRUPT __interrupt +#endif /** Signed eight bit. */

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