User Tools

Site Tools


kirby64_the_crystal_shards:file_systems

File Systems

Kirby 64 uses a couple different addressing systems to point to resources in ROM.

Bank-index addressing

A “bank-index” is a 32-bit value containing a bank number and an index to refer to a block of data. The upper 16 bits contain the bank number and the lower 16 bits contain the index. The bank number selects the bank base address from an array, and the index number selects an offset from another array, and adds it to the base address. Confusingly, there are (at least?) two distinct sets of banks that use this type of addressing.

Bank Set 1

This bank set contains miscellaneous data including level settings and particle textures.

Bank #Base addressOffset array
0x00000x004F32900x0006CA0C
0x00010x007BACA00x0006FA64
0x00020x009646600x000712D0
0x00030x00BD6DB00x000730C4
0x00070x01D287200x00077F30

Bank Set 2

This bank set contains contains mesh textures.

Bank #Base addressOffset array
0x0000??
0x00010x005B53600x0006D1E4
0x00020x00858740?
0x00030x009D8CB00x000D9268
0x00050x011291B00x00074A0C
0x00070x01BD5C800x00076B28

The functions at 0x800A9AA8 and 0x800A8BAC are used to load data from Bank Set 1 and Bank Set 2, respectively. These functions return a pointer to the data after it's loaded into memory. The engine keeps track of what has been loaded; if the block of data corresponding to the provided bank-index is already in memory, these function will simply return a pointer to that block without loading more data.

void *func_800A9AA8(u32 bankIndex); // bank set 1 loader/address resolver
void *func_800A8BAC(u32 bankIndex); // bank set 2 loader/address resolver

List-index addressing

A “list-index” is a 32-bit value containing a bank number and an index to refer to a block of data. The upper 16 bits contain the list number and the lower 16 bits contain the index. The list number selects a list from an array, and the index number selects a ROM start and end address pair from the list. It seems this form of addressing is specifically used to refer to Geometry Blocks.

List #Address arrayDescription
0x00000x0006C8F0?
0x00010x0006CA44?
0x00020x0006FA94?
0x00030x00071300?
0x0004??
0x0005??
0x0006??
0x00070x00076490Level geometry

The function at 0x800A9864 is used to load data and return a pointer to it, given a list-index.

void func_800A9864(u32 listIndex, u32 arg1, u32 arg2);
kirby64_the_crystal_shards/file_systems.txt · Last modified: 2021/01/07 23:25 by someone2639