decomp-toolkit icon indicating copy to clipboard operation
decomp-toolkit copied to clipboard

Support virtual addresses for RELs

Open vabold opened this issue 7 months ago • 0 comments

Known usecases include Mario Kart Wii and Super Paper Mario.

In some circumstances, the memory allocation for static RELs is deterministic, and leads to RELs being placed consistently at the same memory addresses. As a result, communities often refer to REL addresses by their virtual addresses instead of their relative offset. Thus, it would be nice to have an option to use virtual addresses for splits and symbols.

An ideal solution would be allowing specifying where a REL (and its .bss section) would be placed in memory.

For MKW PAL, the REL buffer is allocated to virtual address 0x805102E0, and the bss is allocated to virtual address 0x809BD6E0.

As a test split for MKW PAL:

game/field/BoxColManager.cpp:
	.text       start:0x00275130 end:0x00276B1C
	.rodata     start:0x000150C8 end:0x000150E0
	.data       start:0x0001EC18 end:0x0001EC28
	.bss        start:0x00005810 end:0x00005818

would become:

game/field/BoxColManager.cpp:
	.text       start:0x807854E4 end:0x80786ED0
	.rodata     start:0x808A47E8 end:0x808A4800
	.data       start:0x808D17E8 end:0x808D17F8
	.bss        start:0x809C2EF0 end:0x809C2EF8

vabold avatar May 02 '25 21:05 vabold