mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-05 06:22:45 +01:00
Merge pull request #407 from Subv/arbiter
AddressArbiter: Ported arbitration type 2 from 3dmoo.
This commit is contained in:
commit
cc23269ff4
1 changed files with 11 additions and 0 deletions
|
@ -52,6 +52,17 @@ ResultCode ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s3
|
|||
}
|
||||
break;
|
||||
|
||||
case ArbitrationType::DecrementAndWaitIfLessThan:
|
||||
{
|
||||
s32 memory_value = Memory::Read32(address) - 1;
|
||||
Memory::Write32(address, memory_value);
|
||||
if (memory_value <= value) {
|
||||
Kernel::WaitCurrentThread(WAITTYPE_ARB, handle, address);
|
||||
HLE::Reschedule(__func__);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
LOG_ERROR(Kernel, "unknown type=%d", type);
|
||||
return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Usage);
|
||||
|
|
Loading…
Reference in a new issue