git.y1.nz

gbdk-2020

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

commit 32fecd08d8e125e209690ba20130c1a73364b0b5
parent f4674cf102ec6379be826db96124af3a6746f20b
Author: Toxa <untoxa@mail.ru>
Date:   Tue, 20 Feb 2024 23:09:12 +0300

prevent ROM bank switching on the real hardware when trying to enable or switch SRAM banks on the MegaDuck

Diffstat:
Mgbdk-lib/include/gb/gb.h16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -566,6 +566,16 @@ __endasm; \ */ #define SWITCH_ROM(b) (_current_bank = (b), rROMB0 = (b)) +#if defined(__TARGET_duck) + +#define SWITCH_RAM(b) + +#define ENABLE_RAM + +#define DISABLE_RAM + +#else + /** Switches SRAM bank on MBC1 and other compatible MBCs @param b SRAM bank to switch to @@ -575,10 +585,16 @@ __endasm; \ */ #define SWITCH_RAM(b) (rRAMB = (b)) +/** Enables SRAM on MBC1 and other compatible MBCs +*/ #define ENABLE_RAM (rRAMG = 0x0A) +/** Disables SRAM on MBC1 and other compatible MBCs +*/ #define DISABLE_RAM (rRAMG = 0x00) +#endif + /** Makes MEGADUCK MBC switch the active ROM bank @param b ROM bank to switch to (max `3` for 64K, or `7` for 128K) */

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