User Tools

Site Tools


yoshis_story:file_system

File System


ROM "bank-offset" addressing

Yoshi's Story uses 32-bit “bank-offsets” to point to resources in ROM. The bank table is located at 0x000A79D4 in ROM (0x800A6DD4 in RAM) as an array of bank base addresses. There are 16 available slots for bank addresses, but only bank numbers 0x00, 0x03, and 0x04 seem to be used by the game.

Bank #ROM address
0x000x00001060
0x010x00000000
0x020x00000000
0x030x00526EC0
0x040x00B47A10
0x050x00000000
0x060x00000000
0x070x00000000
0x080x00000000
0x090x00000000
0x0A0x00000000
0x0B0x00000000
0x0C0x00000000
0x0D0x00000000
0x0E0x00000000
0x0F0x00000000

Bank-offsets are 32 bits, containing a 4-bit bank number and a 24-bit offset:

---- bbbb oooooooooooooooooooooooo
BitfieldDescription
-unused bits
b4-bit bank number
o24-bit offset

So a bank-offset to ROM address conversion formula could look something like this:

u32 boToAddress(u32 bankOffset)
{
    u8  bankNum = (bankOffset >> 24) & 0x0F;
    u32 offset = bankOffset & 0x00FFFFFF;
    u32 romAddress = gRomBanks[bankNum] + offset;
    return romAddress;
}
yoshis_story/file_system.txt · Last modified: 2019/10/04 17:11 by shygoo