User Tools

Site Tools


yoshis_story:file_system

Differences

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^
 +|0x00|0x00001060|
 +|0x01|0x00000000|
 +|0x02|0x00000000|
 +|0x03|0x00526EC0|
 +|0x04|0x00B47A10|
 +|0x05|0x00000000|
 +|0x06|0x00000000|
 +|0x07|0x00000000|
 +|0x08|0x00000000|
 +|0x09|0x00000000|
 +|0x0A|0x00000000|
 +|0x0B|0x00000000|
 +|0x0C|0x00000000|
 +|0x0D|0x00000000|
 +|0x0E|0x00000000|
 +|0x0F|0x00000000|
 +
 +Bank-offsets are 32 bits, containing a 4-bit bank number and a 24-bit offset:
 +<​code>​---- bbbb oooooooooooooooooooooooo</​code>​
 +
 +^Bitfield^Description^
 +|-|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;
 +}
 +</​code>​
yoshis_story/file_system.txt ยท Last modified: 2019/10/04 17:11 by shygoo