Changes

Jump to navigation Jump to search
Line 92: Line 92:  
** "texture_replace/": Contains "MarioSunshine.har" and "MarioSunshine.hix".
 
** "texture_replace/": Contains "MarioSunshine.har" and "MarioSunshine.hix".
 
** "video_replace/MarioSunshine/": Contains MP4 videos.
 
** "video_replace/MarioSunshine/": Contains MP4 videos.
 +
 +
== AOT NRO ==
 +
This section documents the AOT NRO. There are only two symbols from NRO which the main-codebin does lookup for and uses: "SetGekkoMemoryPointer" and "GetStatifierInfo".
 +
 +
During initialization, <code>nn::os::AllocateAddressRegion</code> is used with size 0x100200000. Then <code>nn::os::AllocateMemoryPages</code> is used (which uses [[SVC#MapPhysicalMemory|svcMapPhysicalMemory]]):
 +
* base+0 size 0x1000 is allocated.
 +
* base+0x80000000 size 0x1800000 is allocated.
 +
* base+0xE0000000 size 0x4000 is allocated.
 +
* base+0xFFF00000 size 0x200000 is allocated.
 +
 +
Initially SetGekkoMemoryPointer is called with base+0x80000000, however at some point it's called (?) with base+0.
 +
 +
The AOT NRO does all main-memory accesses by accessing {global ptr set by SetGekkoMemoryPointer}+{ppc_addr}. Therefore, above base+0 == ppc_addr 0x0. Since svcMapPhysicalMemory is used above, attempting to access any PPC-addrs not in the allocated regions above will result in the emulator crashing due to accessing unmapped memory - accessing non-PPC emulator data with invalid PPC-addrs is not possible. These crashes may happen when attempting to run a different .dol with the emulator as previously mentioned.
    
= SuperMarioGalaxy =
 
= SuperMarioGalaxy =

Navigation menu