git.y1.nz

gbdk-2020

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

commit 47f7e526fa66b6ee946d5df82cd3692d046b43a7
parent 8a9f731236a4a2490a21241d3e8d5c80d32d2118
Author: toxa <untoxa@mail.ru>
Date:   Sun, 25 Oct 2020 14:24:12 +0300

CRITICAL and INTERRUPT definition in addition to BANKED and NONBANKED

Diffstat:
Mgbdk-lib/examples/gb/comm.c2+-
Mgbdk-lib/examples/gb/irq.c10+++++++---
Mgbdk-lib/examples/gb/wobble.c2+-
Mgbdk-lib/include/asm/gbz80/types.h2++
Mgbdk-lib/include/asm/types.h7++++++-
5 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/gbdk-lib/examples/gb/comm.c b/gbdk-lib/examples/gb/comm.c @@ -16,7 +16,7 @@ void main(void) puts(" START : Send"); puts(" SELECT : Receive"); - __critical { + CRITICAL { add_SIO(nowait_int_handler); // disable waiting VRAM state before return set_interrupts(SIO_IFLAG); // disable other interrupts } diff --git a/gbdk-lib/examples/gb/irq.c b/gbdk-lib/examples/gb/irq.c @@ -23,13 +23,17 @@ void print_counter() unsigned int cnt; // Ensure mutual exclusion - __critical { cnt = tim_cnt; } + CRITICAL { + cnt = tim_cnt; + } printf(" TIM %u", cnt); gotoxy(9, posy()); // Ensure mutual exclusion - __critical { cnt = vbl_cnt; } + CRITICAL { + cnt = vbl_cnt; + } printf("- VBL %u\n", cnt); } @@ -37,7 +41,7 @@ void print_counter() void main() { // Ensure mutual exclusion - __critical { + CRITICAL { vbl_cnt = tim_cnt = 0; add_VBL(vbl); add_TIM(tim); diff --git a/gbdk-lib/examples/gb/wobble.c b/gbdk-lib/examples/gb/wobble.c @@ -14,7 +14,7 @@ void scanline_isr() { void main() { printf("This is\na wobble\ntest\nfor DMG\n|\n|\n|\n|\n|"); - __critical { + CRITICAL { STAT_REG = 0x18; add_LCD(scanline_isr); } diff --git a/gbdk-lib/include/asm/gbz80/types.h b/gbdk-lib/include/asm/gbz80/types.h @@ -10,6 +10,8 @@ #define NONBANKED __nonbanked #define BANKED __banked +#define CRITICAL __critical +#define INTERRUPT __interrupt /** Signed eight bit. */ diff --git a/gbdk-lib/include/asm/types.h b/gbdk-lib/include/asm/types.h @@ -15,10 +15,15 @@ #ifndef NONBANKED #define NONBANKED #endif - #ifndef BANKED #define BANKED #endif +#ifndef CRITICAL +#define CRITICAL +#endif +#ifndef INTERRUPT +#define INTERRUPT +#endif /** TRUE or FALSE. */

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