Skip to content
Seeky edited this page Dec 28, 2024 · 3 revisions

Game Heaps

The game's memory is split into 9 main heaps, or 10 in Korean:

Id Name Notes
0 Main
1 Map Cleared on map change
2 Unused
3 Ext Seems linked to the graphical effect for showing many NPCs at once (Dimentio clones, cutscene audiences, ...)
4 Effect Visual effects such as footsteps
5 WPAD Given to SDK controller library
6 Sound Given to NW4R sound
7 Smart Automatically compacted and garbage collected
8 Unused (Non-Korean only)
8 Font (Korean only)
9 Unused (Korean only)

The splitting is done by memInit, with sizes determined by size_table.

Size table

The size table is an array of the following struct

Offset Size Description
0x0 4 Size type (1 = kilobytes, 0 = percentage of remaining memory after others allocated)
0x4 4 Size

Values in US and JP

All US and JP revisions place heaps 0-4 in MEM1 and 5-8 in MEM2, with the following sizes:

Id Size
0 9216 KB
1 6144 KB
2 256 KB
3 256 KB
4 100% of remaining MEM1 space
---- ------
5 128 KB
6 17408 KB
7 100% of remaining MEM1 space
8 1 KB

Values in EU

The EU revisions place heaps 0-3 in MEM1 and 4-8 in MEM2, with the following sizes:

Id Size
0 9216 KB
1 6144 KB
2 100% remaining MEM1
---- ------
3 256 KB
4 256 KB
5 128 KB
6 17408 KB
7 100% remaining MEM2
8 1 KB

Values in KR

The Korean version of the game places heaps 0-3 in MEM1 and 4-9 in MEM2, with the following sizes:

Id Size
0 9216KB
1 6144KB
2 100% remaining MEM1
---- -------
3 256KB
4 256KB
5 128KB
6 17408KB
7 100% remaining MEM2
8 1312KB
9 1KB
Clone this wiki locally