Talk:Revolution OS

From WiiBrew
Jump to navigation Jump to search

Should this be split or moved to Revolution OS?

"SDK" could be a bit misleading, since it sounds like it's talking about leaked content, and most of the interesting stuff seems to be part of "Revolution OS" internally. Hallowizer (talk) 02:52, 28 November 2021 (CET)

Explanation of registers

These are actually properties of the PowerPC ABI, to my understanding. I've been trying to find the appropriate documentation, but the best I can find is this document (note: loads only via HTTP, not HTTPS; IA mirror) for 32-bit PPC but I think it's a bit too old, and this document (for 64-bit PPC, too new, but it talks about EABI). In Table 3-3 (on page 3-14) of the old document, R14-R31 are documented as registers for local variables (I don't think the environment pointer is applicable for C++), and also as "nonvolatile"/callee-saved. R1 is the stack pointer. R11 is supposed to point just past the register save area, and is defined for exactly the use you're seeing with one function that saves everything (see page 3-35 and 3-36 of the old document).

R13 is the small data area (SDA) pointer, which is documented on page 4-12 of the old document. It's a place to store small variables. R2 is the small data area 2 pointer, though it's marked as reserved in the old document (look in Table 2-4 in the new one). SDA2 is apparently an optional feature that can't be used in shared object files, but does seem to show up here. What I've seen it used for in practice is mostly floats and short string constants. Like any address, the locations of both where these point to and where data is stored relative to them might change across versions, but often will be in a similar order if not in the exact same place.

Ghidra-GameCube-Loader is supposed to find the SDA pointer values and create xrefs so that they decompile nicely. But that might not be working. --Pokechu22 (talk) 20:16, 5 December 2021 (CET)

I actually wasn't able to get Ghidra-GameCube-Loader to work, so I manually set the memory map. That's probably the issue. Hallowizer (talk) 20:27, 5 December 2021 (CET)
After getting the function list from System Menu 2.0U, I noticed that the functions that save and load r14+ have names in that list: _savefpr_23, _restfpr_23, _savegpr_14, _savegpr_15, _savegpr_16, _savegpr_17 Hallowizer (talk) 06:27, 5 January 2022 (CET)