feat: invert codegen hight to low convertion (#131)

* feat: invert codegen hight to low convertion
feat: added copy and GetEntryAddress
feat: handle truncated DMAC

* feat: always use address on analyzer now

* feat: correct pick syscalls ID

* feat: added deci2Call

* feat: added wip dbcmain IOP

* feat: added InitTLB
feat: added err logs on thread for debug sus crash

* fix: fix SetupHeap for strange cases

* feat: fix incorrect SetupHeap test(it use a wrong idea on how heap allocate memory)

* feat: added memalign and memalign_r
feat: added GetOsdConfigParam2 and  SetOsdConfigParam2 but idk if was a good idea

* feat: added more memory stuff

* feat: back to library functions
This commit is contained in:
Ranieri
2026-06-13 16:39:39 -03:00
committed by GitHub
parent 7562ec14c9
commit 790aaf4cda
27 changed files with 1299 additions and 158 deletions
+10 -16
View File
@@ -1163,23 +1163,11 @@ void PS2Runtime::handleSyscall(uint8_t *rdram, R5900Context *ctx, uint32_t encod
"This breaks the atomic basic block model and is structurally unsupported by the emulator.");
}
// Try immediate first
if (encodedSyscallId != 0 && ps2_syscalls::dispatchNumericSyscall(encodedSyscallId, rdram, ctx, this))
{
return;
}
const uint32_t syscallId = (encodedSyscallId != 0u)
? encodedSyscallId
: getRegU32(ctx, 3); // $v1 / $3 is the EE kernel syscall number
// Try $v1 (standard)
const uint32_t syscallFromV1 = getRegU32(ctx, 3); // $v1
if (ps2_syscalls::dispatchNumericSyscall(syscallFromV1, rdram, ctx, this))
{
return;
}
// Try $v0 (negative syscalls)
const uint32_t syscallFromV0 = getRegU32(ctx, 2); // $v0 (some ABIs)
if (syscallFromV0 != syscallFromV1 &&
ps2_syscalls::dispatchNumericSyscall(syscallFromV0, rdram, ctx, this))
if (ps2_syscalls::dispatchNumericSyscall(syscallId, rdram, ctx, this))
{
return;
}
@@ -1671,6 +1659,12 @@ uint32_t PS2Runtime::guestHeapEnd() const
return m_guestHeapConfigured ? m_guestHeapEnd : m_guestHeapSuggestedBase;
}
uint32_t PS2Runtime::guestHeapLimit() const
{
std::lock_guard<std::mutex> lock(m_guestHeapMutex);
return m_guestHeapConfigured ? m_guestHeapLimit : m_guestHeapSuggestedBase;
}
uint32_t PS2Runtime::reserveAsyncCallbackStack(uint32_t size, uint32_t alignment)
{
if (size == 0u)