Merge pull request #590 from cxd4/most_remaining_x64_breakpoints

PIF RAM mutual DMA x64 breakpoints replaced with fast C
This commit is contained in:
zilmar 2015-09-15 10:55:40 +10:00
commit c3b394607c
3 changed files with 15 additions and 53 deletions

View File

@ -40,7 +40,7 @@ CMipsMemoryVM::CMipsMemoryVM( CMipsMemory_CallBack * CallBack, bool SavesReadOnl
m_IMEM = NULL;
}
static unsigned long swap32by8(unsigned long word)
unsigned long swap32by8(unsigned long word)
{
const unsigned long swapped =
#if defined(_MSC_VER)

View File

@ -10,6 +10,8 @@
****************************************************************************/
#pragma once
extern unsigned long swap32by8(unsigned long word);
class CMipsMemoryVM :
public CMipsMemory,
public CTransVaddr,

View File

@ -302,34 +302,14 @@ void CPifRam::SI_DMA_READ()
}
else
{
#ifdef _M_IX86
_asm
size_t i;
for (i = 0; i < 64; i += 4)
{
mov edi, dword ptr [SI_DRAM_ADDR_REG]
mov edi, dword ptr [edi]
add edi, RDRAM
mov ecx, PifRamPos
mov edx, 0
memcpyloop:
mov eax, dword ptr [ecx + edx]
bswap eax
mov dword ptr [edi + edx],eax
mov eax, dword ptr [ecx + edx + 4]
bswap eax
mov dword ptr [edi + edx + 4],eax
mov eax, dword ptr [ecx + edx + 8]
bswap eax
mov dword ptr [edi + edx + 8],eax
mov eax, dword ptr [ecx + edx + 12]
bswap eax
mov dword ptr [edi + edx + 12],eax
add edx, 16
cmp edx, 64
jb memcpyloop
*(unsigned __int32 *)&RDRAM[SI_DRAM_ADDR_REG + i] = swap32by8(
*(unsigned __int32 *)&PifRamPos[i]
);
}
#else
g_Notify->BreakPoint(__FILEW__,__LINE__);
#endif
}
if (LogOptions.LogPRDMAMemStores)
@ -413,34 +393,14 @@ void CPifRam::SI_DMA_WRITE()
}
else
{
#ifdef _M_IX86
_asm
size_t i;
for (i = 0; i < 64; i += 4)
{
mov ecx, dword ptr [SI_DRAM_ADDR_REG]
mov ecx, dword ptr [ecx]
add ecx, RDRAM
mov edi, PifRamPos
mov edx, 0
memcpyloop:
mov eax, dword ptr [ecx + edx]
bswap eax
mov dword ptr [edi + edx],eax
mov eax, dword ptr [ecx + edx + 4]
bswap eax
mov dword ptr [edi + edx + 4],eax
mov eax, dword ptr [ecx + edx + 8]
bswap eax
mov dword ptr [edi + edx + 8],eax
mov eax, dword ptr [ecx + edx + 12]
bswap eax
mov dword ptr [edi + edx + 12],eax
add edx, 16
cmp edx, 64
jb memcpyloop
*(unsigned __int32 *)&PifRamPos[i] = swap32by8(
*(unsigned __int32 *)&RDRAM[SI_DRAM_ADDR_REG + i]
);
}
#else
g_Notify->BreakPoint(__FILEW__,__LINE__);
#endif
}
if (LogOptions.LogPRDMAMemLoads)