Skip to content
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

Merged
merged 6 commits into from Sep 28, 2014

Conversation

skidau
Copy link
Contributor

@skidau skidau commented Sep 7, 2014

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.

@JMC47
Copy link
Contributor

JMC47 commented Sep 7, 2014

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.

@skidau
Copy link
Contributor Author

skidau commented Sep 7, 2014

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.

@skidau
Copy link
Contributor Author

skidau commented Sep 7, 2014

@Sonicadvance1 I have replaced the jit usage with JitInterface in the update.

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.

@JMC47
Copy link
Contributor

JMC47 commented Sep 15, 2014

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.

@skidau
Copy link
Contributor Author

skidau commented Sep 16, 2014

Still running some tests on this code.

@Parlane
Copy link
Member

Parlane commented Sep 16, 2014

What happened to IRC @skidau ?

@skidau
Copy link
Contributor Author

skidau commented Sep 16, 2014

overlord connects but is silent since Saturday morning @delroth

@Parlane
Copy link
Member

Parlane commented Sep 16, 2014

@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.
…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.
Added a small note for instant dma.
skidau added a commit that referenced this pull request Sep 28, 2014
Compile the ARAM DMA exception checks into the JIT block
@skidau skidau merged commit afccf22 into dolphin-emu:master Sep 28, 2014
CoreTiming::ScheduleEvent_Threadsafe(ticksToTransfer, et_CompleteARAM);

if (instant_dma)
CoreTiming::ForceExceptionCheck(100);

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants