Skip to content

Commit 7d6c09c

Browse files
committed
fix: disable xaudio hack and work with cs recursion count as big-endian
1 parent c789ca8 commit 7d6c09c

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

MarathonRecomp/kernel/imports.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,9 @@ uint32_t KeSetAffinityThread(uint32_t Thread, uint32_t Affinity, be<uint32_t>* l
722722
void RtlLeaveCriticalSection(XRTL_CRITICAL_SECTION* cs)
723723
{
724724
// printf("RtlLeaveCriticalSection");
725-
cs->RecursionCount--;
725+
cs->RecursionCount = cs->RecursionCount.get() - 1;
726726

727-
if (cs->RecursionCount != 0)
727+
if (cs->RecursionCount.get() != 0)
728728
return;
729729

730730
std::atomic_ref owningThread(cs->OwningThread);
@@ -746,7 +746,7 @@ void RtlEnterCriticalSection(XRTL_CRITICAL_SECTION* cs)
746746

747747
if (owningThread.compare_exchange_weak(previousOwner, thisThread) || previousOwner == thisThread)
748748
{
749-
cs->RecursionCount++;
749+
cs->RecursionCount = cs->RecursionCount.get() + 1;
750750
return;
751751
}
752752

@@ -1263,7 +1263,7 @@ bool RtlTryEnterCriticalSection(XRTL_CRITICAL_SECTION* cs)
12631263

12641264
if (owningThread.compare_exchange_weak(previousOwner, thisThread) || previousOwner == thisThread)
12651265
{
1266-
cs->RecursionCount++;
1266+
cs->RecursionCount = cs->RecursionCount.get() + 1;
12671267
return true;
12681268
}
12691269

MarathonRecompLib/config/Marathon.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ address = 0x82512B04
127127
registers = ["r4", "r31"]
128128
after_instruction = true
129129

130-
[[midasm_hook]]
131-
name = "IgnoreXAudioLockPlsFixAndDeleteThisMidasm"
132-
address = 0x8255AAE8
133-
registers = ["r11"]
134-
jump_address = 0x8255AB24
130+
#[[midasm_hook]]
131+
#name = "IgnoreXAudioLockPlsFixAndDeleteThisMidasm"
132+
#address = 0x8255AAE8
133+
#registers = ["r11"]
134+
#jump_address = 0x8255AB24
135135

136136
#[[midasm_hook]]
137137
#name = "DebugZlibMidAsmHook"

tools/XenonRecomp

0 commit comments

Comments
 (0)