git.y1.nz

gbdk-2020

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

commit 7884a373e4cbedbcb2c662d311e627b608c01f44
parent b48cde5d07788ba41e1f587e1aae04fcb91e01c8
Author: Toxa <56631470+untoxa@users.noreply.github.com>
Date:   Wed, 20 May 2026 14:46:04 +0300

Define DEVICE_SUPPORTS_WINDOW to indicate which devices support window layer
Diffstat:
Mgbdk-lib/examples/cross-platform/text_advanced_dialogue/src/main.c9++++-----
Mgbdk-lib/include/gb/gb.h4++++
Mgbdk-lib/include/msx/msx.h4++++
Mgbdk-lib/include/nes/nes.h7+++++++
Mgbdk-lib/include/sms/sms.h4++++
5 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/gbdk-lib/examples/cross-platform/text_advanced_dialogue/src/main.c b/gbdk-lib/examples/cross-platform/text_advanced_dialogue/src/main.c @@ -19,7 +19,7 @@ #define BYTES_PER_TILE 1 #endif -#if defined(SEGA) || defined(NINTENDO_NES) +#if !DEVICE_SUPPORTS_WINDOW #define get_winbkg_xy_addr get_bkg_xy_addr #define set_winbkg_based_tiles set_bkg_based_tiles @@ -49,7 +49,7 @@ uint8_t loadedCharacterCount=0; void MoveWindow(void){ - #if !defined(SEGA) && !defined(NINTENDO_NES) + #if DEVICE_SUPPORTS_WINDOW move_win(7,windowYPosition); @@ -345,8 +345,7 @@ void DrawTextAdvanced(char* text){ void ClearScreen(void){ - #if !defined(SEGA) && !defined(NINTENDO_NES) - // Game Gear doesn't have a window. + #if DEVICE_SUPPORTS_WINDOW fill_win_rect(0,0,DEVICE_SCREEN_WIDTH,DEVICE_SCREEN_HEIGHT,0); #endif fill_bkg_rect(0,0,DEVICE_SCREEN_WIDTH,DEVICE_SCREEN_HEIGHT,0); @@ -357,7 +356,7 @@ void main(void) DISPLAY_ON; SHOW_BKG; - #if !defined(SEGA) && !defined(NINTENDO_NES) + #if DEVICE_SUPPORTS_WINDOW SHOW_WIN; #endif diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -460,6 +460,10 @@ extern uint8_t _is_GBA; */ #define DEVICE_SUPPORTS_COLOR (_cpu == CGB_TYPE) +/** Macro returns TRUE if device supports window layer + */ +#define DEVICE_SUPPORTS_WINDOW (TRUE) + /** Global Time Counter in VBL periods (60Hz) Increments once per Frame diff --git a/gbdk-lib/include/msx/msx.h b/gbdk-lib/include/msx/msx.h @@ -326,6 +326,10 @@ void refresh_OAM(void); */ #define DEVICE_SUPPORTS_COLOR (TRUE) +/** Macro returns TRUE if device supports window layer + */ +#define DEVICE_SUPPORTS_WINDOW (FALSE) + /** Global Time Counter in VBL periods (60Hz) Increments once per Frame diff --git a/gbdk-lib/include/nes/nes.h b/gbdk-lib/include/nes/nes.h @@ -651,6 +651,13 @@ void refresh_OAM(void) NO_OVERLAY_LOCALS; */ #define DEVICE_SUPPORTS_COLOR (TRUE) +/** Macro returns TRUE if device supports window layer + */ +#ifdef NES_WINDOW_LAYER +#define DEVICE_SUPPORTS_WINDOW (TRUE) +#else +#define DEVICE_SUPPORTS_WINDOW (FALSE) +#endif /** * Set byte in vram at given memory location diff --git a/gbdk-lib/include/sms/sms.h b/gbdk-lib/include/sms/sms.h @@ -331,6 +331,10 @@ void refresh_OAM(void); */ #define DEVICE_SUPPORTS_COLOR (TRUE) +/** Macro returns TRUE if device supports window layer + */ +#define DEVICE_SUPPORTS_WINDOW (FALSE) + /** Global Time Counter in VBL periods (60Hz) Increments once per Frame

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