git.y1.nz

gbdk-2020

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

commit f0911ec978ea9c57cd1456d0579067cfceab7485
parent 48e050eddacb8a73f2ee50680fb26e2c972de48a
Author: toxa <untoxa@mail.ru>
Date:   Mon,  5 Oct 2020 19:44:36 +0300

disable ability of switching upper MBC5 ROM banks SWITCH_ROM_MBC5 macro, you can use SWITCH_ROM_MBC5_8M when making a 8MB rom, but note that automatic tracking of the bank number won't be avaliable

Diffstat:
Mgbdk-lib/include/gb/gb.h10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gbdk-lib/include/gb/gb.h b/gbdk-lib/include/gb/gb.h @@ -269,13 +269,17 @@ __REG _current_bank; *(unsigned char *)0x6000 = 0x01 /* Note the order used here. Writing the other way around - * on a MBC1 always selects bank 0 (d'oh) + * on a MBC1 always selects bank 1 */ /** MBC5 */ #define SWITCH_ROM_MBC5(b) \ _current_bank = (b), \ - *(unsigned char *)0x3000 = (UINT16)(b) >> 8, \ - *(unsigned char *)0x2000 = (UINT8)(b) + *(unsigned char *)0x3000 = 0, \ + *(unsigned char *)0x2000 = (b) + +#define SWITCH_ROM_MBC5_8M(b) \ + *(unsigned char *)0x3000 = ((UINT16)(b) >> 8), \ + *(unsigned char *)0x2000 = (b) #define SWITCH_RAM_MBC5(b) \ *(unsigned char *)0x4000 = (b)

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