Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2018-04-24 15:43:25

endrift
New member
Registered: 2017-05-24
Posts: 7

MBC6 (WIP)

Researching Net de Get: Minigame @ 100 cartridge (the only MBC6 game)

Register descriptions:

0x0000: Standard SRAM access control (0/A, etc)
0x0400: SRAM bank 0 control (0xA000-0xAFFF, 0x1000 bytes per bank, 8 banks total)
0x0800: SRAM bank 1 control (0xB000-0xBFFF, 0x1000 bytes per bank, 8 banks total)
0x0C00: Flash chip control register:
- Write 01: Enable writing to chip (via standard commands)
0x1000: Enable/disable access to flash chip control register:
- 00: Disabled
- 01: Enabled
0x2000: ROM bank 0 bank ID (0x4000-0x5FFF, wraps, 0 can be mapped in freely, setting top bit seems to unmap ROM)
0x2800: ROM bank 0 bank type (0 = ROM, 8 = flash, other bits unknown)
0x3000: ROM bank 1 bank ID (0x6000-0x7FFF, wraps, 0 can be mapped in freely, setting top bit seems to unmap ROM)
0x3800: ROM bank 1 bank type (0 = ROM, 8 = flash, other bits unknown)

Uses standard flash commands with addresses 2:5555 (store AA) and 1:4AAA (store 55) (bank 0) / 2:7555 (store AA) and 1:6AAA (store 55) (bank 1)

Simple code for getting JEDEC mfg/dev IDs (C2/81):

Code:

    ld a, 1
    ld [$1000], a ; Enable access to flash ctl reg
    ld [$0c00], a ; Turn on write mode
    xor a
    ld [$1000], a ; Disable access to flash ctl reg
    ld a, 2
    ld [$3000], a ; Map physical bank 2 into bank 1 address space
    ld a, 8
    ld [$3800], a ; Map flash
    ld a, $AA
    ld [$7555], a ; Write AA to 2:7555 (flash handshake)
    ld a, 1
    ld [$3000], a ; Map physical bank 1 into bank 1 address space
    ld a, $55
    ld [$6AAA], a ; Write 55 to 1:6AAA (flash handshake)
    ld a, 2
    ld [$3000], a ; Map physical bank 2 into bank 1 address space
    ld a, $90
    ld [$7555], a ; Write 90 to 2:7555 (JEDEC ID mode)
    ld a, 0
    ld [$3000], a ; Map physical bank 0 into bank 1 address space
    ld a, [$6000] ; Load JEDEC manufacturer ID (C2, Macronix)
    ld a, [$6001] ; Load JEDEC device ID (81, MX29F008TC-14)

https://pbs.twimg.com/media/DbCvy_IVwAEHkQ-.png
Just implementing RAM/ROM bank switching is enough to make the game playable.

Last edited by endrift (2018-04-24 19:34:43)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson