mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-26 08:51:05 -04:00
ed8b3ebee1
* feat(recomp): Reduce recompiler output memory usage Stream output generation, add low-memory config controls, and avoid pathological indirect-jump switch expansion in generated C++. Low-memory mode now avoids retaining per-instruction disassembly strings while still emitting asm comments during output generation. Output workers are bounded/configurable, combined output is streamed, and decoded buffers are released after generation. Also document the new output memory settings. * fix(recomp): added tests for unregistered JR/JALR, updated fallback logic to cover JR/JALR, moved Rabbitizer formatting into R5900Decoder
67 lines
1.8 KiB
TOML
67 lines
1.8 KiB
TOML
[general]
|
|
# Path to input ELF file
|
|
input = "path/to/your/ps2_game.elf"
|
|
|
|
# Path to output directory
|
|
output = "output/"
|
|
|
|
# Single file output mode (false for one file per function)
|
|
single_file_output = false
|
|
|
|
# Lower peak memory by avoiding retained disassembly strings and forcing serial output generation.
|
|
low_memory_mode = false
|
|
|
|
# Function generation workers. 0 uses nproc - 1 when at least 2 hardware threads are available; 1 disables parallel generation.
|
|
# Limited to nproc * 2 to avoid oversubscription.
|
|
output_worker_threads = 0
|
|
|
|
# Path to runtime header (optional)
|
|
runtime_header = "include/ps2_runtime.h"
|
|
|
|
# Functions to stub (these will generate wrappers to runtime syscall/stub handlers when names match)
|
|
# You can also bind stripped functions by address with "handler@0xADDRESS".
|
|
# Generic temporary handlers are available: ret0, ret1, reta0.
|
|
stubs = [
|
|
"printf",
|
|
"malloc",
|
|
"free",
|
|
"memcpy",
|
|
"memset",
|
|
"strncpy",
|
|
"sprintf",
|
|
# "sceCdRead@0x00123456",
|
|
# "SifLoadModule@0x00127890",
|
|
# "ret0@0x001D9410",
|
|
]
|
|
|
|
# Functions to skip (these will not be recompiled)
|
|
skip = ["abort", "exit", "_exit"]
|
|
|
|
# Patches to apply during recompilation
|
|
[patches]
|
|
# Individual instruction patches
|
|
instructions = [
|
|
{ address = "0x100004", value = "0x00000000" }, # NOP an instruction
|
|
{ address = "0x100104", value = "0x24040000" }, # Change an immediate value
|
|
]
|
|
|
|
# Function hook patches (not yet implemented)
|
|
[[patches.hook]]
|
|
function = "printf"
|
|
code = '''
|
|
// Custom printf implementation
|
|
void printf(uint8_t* rdram, R5900Context* ctx) {
|
|
// Implementation here
|
|
}
|
|
'''
|
|
|
|
# Function replacement patches (not yet implemented)
|
|
[[patches.func]]
|
|
address = "0x100000"
|
|
code = '''
|
|
// Custom implementation for function at 0x100000
|
|
void func_00100000(uint8_t* rdram, R5900Context* ctx) {
|
|
// Implementation here
|
|
}
|
|
'''
|