User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

yoshis_story:file_system [2019/10/04 17:11] (current)
shygoo created
Line 1: Line 1:
 +====== 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^
 +Bank-offsets are 32 bits, containing a 4-bit bank number and a 24-bit offset:
 +<​code>​---- bbbb oooooooooooooooooooooooo</​code>​
 +|-|unused bits|
 +|b|4-bit bank number|
 +|o|24-bit offset|
 +So a bank-offset to ROM address conversion formula could look something like this:
 +<code C>
 +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