GB WLA-DX (WLA-GB) correct configuration of MBC1 banks (128KB)

GB & Gameboy Color Programming (with the GBZ80 CPU)
Post Reply
siudym
Posts: 1
Joined: Wed Nov 03, 2021 9:15 pm

GB WLA-DX (WLA-GB) correct configuration of MBC1 banks (128KB)

Post by siudym » Sun Nov 07, 2021 10:03 am

I have a problem with the WLA-GB configuration. I don't know how to correctly define BANKS and SLOTS numbers. Generally I want $ 0000 (16KB) as fixed bank and $ 4000 (16KB) as swappable and switchable to other banks (2-7).

Two examples of setting up banks: Both work and this is unclear to me.

First example I have BANK 0 in SLOT 0 as .ORGA $ 0000 by default, another BANK 1 in SLOT 1 as .ORGA $ 4000 and the other BANK 2-7 as .ORGA $ 4000 (they are switchable from SLOT 1 $ 4000 so I guess it should be?)

Second example I have BANK 0 in SLOT 0 as .ORG $ 0000, another BANK 1 in SLOT 1 as also .ORG $ 0000 and the other BANKS also .ORG $ 0000 (when .ORGA was there, it wouldn't compile and a compile error popped up).

I don't know what is correct because both examples work ....
Should DEFAULTSLOT stay as 1 or 0?

#####################
BANK 0 ORGA $0000
OTHER BANKS (1-7) ORGA $4000:
#####################

Code: Select all


.GBHEADER

	NAME "MBC1 DEMO"
	CARTRIDGETYPE $01				; MBC1 (00-ROMONLY,01-MBC1,$05-MBC2...)
	RAMSIZE $00					; no external RAM in the cartridge (00-no,01-2KB,02-8KB,03-32KB...)
	COUNTRYCODE $01					; outside Japan
	NINTENDOLOGO
	LICENSEECODENEW "SV"
	ROMDMG						; DMG rom

.ENDGB

.MEMORYMAP

	DEFAULTSLOT 1					; 0 or 1 ??

	SLOTSIZE $4000
	SLOT 0 $0000
	SLOT 1 $4000

.ENDME

.ROMBANKSIZE $4000
.ROMBANKS 8						; 128KB

;--------------BANKS:

.BANK 0 SLOT 0				; SLOT 0 default BANK 0 (fixed slot)
.ORGA $0000

.BANK 1 SLOT 1				; SLOT 1 default BANK 1 (swappable slot)
.ORGA $4000

.BANK 2					; banks 2-7 switchable in SLOT 1
.ORGA $4000

.BANK 3
.ORGA $4000

.BANK 4
.ORGA $4000

.BANK 5
.ORGA $4000

.BANK 6
.ORGA $4000

.BANK 7
.ORGA $4000

#####################
ALL BANKS ORG $0000
#####################

Code: Select all


.GBHEADER

	NAME "MBC1 DEMO"
	CARTRIDGETYPE $01				; MBC1 (00-ROMONLY,01-MBC1,$05-MBC2...)
	RAMSIZE $00					; no external RAM in the cartridge (00-no,01-2KB,02-8KB,03-32KB...)
	COUNTRYCODE $01					; outside Japan
	NINTENDOLOGO
	LICENSEECODENEW "SV"
	ROMDMG						; DMG rom

.ENDGB

.MEMORYMAP

	DEFAULTSLOT 1					; 0 or 1?

	SLOTSIZE $4000
	SLOT 0 $0000
	SLOT 1 $4000

.ENDME

.ROMBANKSIZE $4000
.ROMBANKS 8						; 128KB

;--------------BANKS:

.BANK 0	SLOT 0
.ORG $0000

.BANK 1 SLOT 1
.ORG $0000

.BANK 2
.ORG $0000

.BANK 3
.ORG $0000

.BANK 4
.ORG $0000

.BANK 5
.ORG $0000

.BANK 6
.ORG $0000

.BANK 7
.ORG $0000


Post Reply

Return to “Gameboy Assembly Programming”