dmac: limit address to the scratch pad memory

Help dma tests
This commit is contained in:
Gregory Hainaut 2016-01-27 22:23:23 +01:00
parent c037686a26
commit c959424957
1 changed files with 18 additions and 3 deletions

View File

@ -374,13 +374,27 @@ __fi bool dmacWrite32( u32 mem, mem32_t& value )
return false;
}
icase(fromSPR_SADR)
{
// Address must be QW aligned and fit in the 16K range of SPR
psHu32(mem) = value & 0x3FF0;
return false;
}
icase(toSPR_SADR)
{
// Address must be QW aligned and fit in the 16K range of SPR
psHu32(mem) = value & 0x3FF0;
return false;
}
icase(D9_CHCR) // dma9 - toSPR
{
DMA_LOG("SPR1dma EXECUTE (toSPR), value=0x%x", value);
DmaExec(dmaSPR1, mem, value);
return false;
}
icase(DMAC_CTRL)
{
u32 oldvalue = psHu32(mem);
@ -420,6 +434,7 @@ __fi bool dmacWrite32( u32 mem, mem32_t& value )
cpuTestDMACInts();
return false;
}
icase(DMAC_STAT)
{
HW_LOG("DMAC_STAT Write 32bit %x", value);
@ -451,8 +466,8 @@ __fi bool dmacWrite32( u32 mem, mem32_t& value )
// DMA Writes are invalid to everything except the STR on CHCR when it is busy
// There's timing problems with many games. Gamefix time!
if( CHECK_DMABUSYHACK && (mem & 0xf0) )
{
if((psHu32(mem & ~0xff) & 0x100) && dmacRegs.ctrl.DMAE && !psHu8(DMAC_ENABLER+2))
{
if((psHu32(mem & ~0xff) & 0x100) && dmacRegs.ctrl.DMAE && !psHu8(DMAC_ENABLER+2))
{
DevCon.Warning("Gamefix: Write to DMA addr %x while STR is busy! Ignoring", mem);
return false;