New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile the ARAM DMA exception checks into the JIT block #1012
Conversation
I can confirm this as fixing the music in Burnout 2 in JIT and Interpreter. JITIL just crashes as soon as the game starts up, so, whatever. No known regressions that I can find in any of my other games. |
if (jit && PC != 0 && (jit->js.dspARAMAddresses.find(PC)) == (jit->js.dspARAMAddresses.end()) && (g_dspState.DSPControl.ARAM & g_dspState.DSPControl.ARAM_mask)) | ||
{ | ||
int type = GetOpInfo(Memory::ReadUnchecked_U32(PC))->type; | ||
if (type == OPTYPE_STORE || type == OPTYPE_STOREFP || (type == OPTYPE_PS && GetOpInfo(Memory::ReadUnchecked_U32(PC))->opname == "psq_st")) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Have actioned the review comments. |
|
||
if ((g_dspState.DSPControl.Hex >> 1) & g_dspState.DSPControl.Hex & (INT_DSP | INT_ARAM | INT_AID)) | ||
{ | ||
if (jit && PC != 0 && (jit->js.dspARAMAddresses.find(PC)) == (jit->js.dspARAMAddresses.end()) && (g_dspState.DSPControl.ARAM & g_dspState.DSPControl.ARAM_mask)) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
54d1c39
to
8e80161
Compare
@Sonicadvance1 I have replaced the jit usage with JitInterface in the update. |
8e80161
to
92bccb6
Compare
ERROR_LOG(POWERPC, "Unknown exception check type"); | ||
} | ||
|
||
if (PC != 0 && (exception_addresses->find(PC)) == (exception_addresses->end())) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Any more comments or blocking issues for this? |
@@ -544,7 +544,8 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc | |||
} | |||
|
|||
// Add an external exception check if the instruction writes to the FIFO. | |||
if (jit->js.fifoWriteAddresses.find(ops[i].address) != jit->js.fifoWriteAddresses.end()) | |||
if (jit->js.fifoWriteAddresses.find(ops[i].address) != jit->js.fifoWriteAddresses.end() || | |||
jit->js.dspARAMAddresses.find(ops[i].address) != jit->js.dspARAMAddresses.end()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Still running some tests on this code. |
What happened to IRC @skidau ? |
overlord connects but is silent since Saturday morning @delroth |
@skidau your bnc is gone. Need to find another. Or connect directly. |
… style to FIFO writes. This ensures that the ARAM DMA is handled soon after the DMA completes. Fixes issue 7122 and issue 7342.
…n and out of Resident Evil 2 and 3. Removed the special case for short transfers as it is no longer required.
…able. Updated ARAM DMA and FIFO write exception checking to uses these types. Conflicts: Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp Source/Core/Core/PowerPC/PPCTables.h
…ted the existing code to utilise the interface.
92bccb6
to
c83987a
Compare
…uired. Detects a situation where the game is writing to the dcache at the address being DMA'd. As we do not have dcache emulation, invalid data is being DMA'd causing audio glitches. The following code detects this and enables the DMA to complete instantly before the invalid data is written. Added accurate ARAM DMA transfer timing. Removed the addition of DSP exception checking.
c83987a
to
86b6dfe
Compare
Added a small note for instant dma.
Compile the ARAM DMA exception checks into the JIT block
CoreTiming::ScheduleEvent_Threadsafe(ticksToTransfer, et_CompleteARAM); | ||
|
||
if (instant_dma) | ||
CoreTiming::ForceExceptionCheck(100); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Compile the ARAM DMA exception checks into the JIT block in a similar style to FIFO writes. This ensures that the ARAM DMA is handled soon after the DMA completes. Fixes issue 7122 and issue 7342.
UPDATE: To keep Resident Evil 2 and 3 from cutting in and out, added a exception check. Also, removed the special case for short ARAM DMA transfers as that is no longer required.