Skip to content

Commit

Permalink
fixing mergefail
Browse files Browse the repository at this point in the history
  • Loading branch information
booto committed Jun 19, 2013
1 parent 2ea3343 commit 66636b2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 63 deletions.
22 changes: 14 additions & 8 deletions Source/Core/Core/Src/HW/DSP.cpp
Expand Up @@ -30,6 +30,7 @@
#include "CPU.h"
#include "MemoryUtil.h"
#include "Memmap.h"
#include "MMUTable.h"
#include "ProcessorInterface.h"
#include "AudioInterface.h"
#include "../PowerPC/PowerPC.h"
Expand Down Expand Up @@ -687,6 +688,7 @@ void UpdateAudioDMA()

void Do_ARAM_DMA()
{
u64 tmp;
if (g_arDMA.Cnt.count == 32)
{
// Beyond Good and Evil (GGEE41) sends count 32
Expand Down Expand Up @@ -726,19 +728,20 @@ void Do_ARAM_DMA()
{
while (g_arDMA.Cnt.count)
{
tmp = Common::swap64(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask]);
// These are logically seperated in code to show that a memory map has been set up
// See below in the write section for more information
if ((g_ARAM_Info.Hex & 0xf) == 3)
{
Memory::Write_U64_Swap(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask], g_arDMA.MMAddr);
MMUTable::write64(MMUTable::EmuPointer(g_arDMA.MMAddr), tmp, ACCESS_MASK_PHYSICAL);
}
else if ((g_ARAM_Info.Hex & 0xf) == 4)
{
Memory::Write_U64_Swap(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask], g_arDMA.MMAddr);
MMUTable::write64(MMUTable::EmuPointer(g_arDMA.MMAddr), tmp, ACCESS_MASK_PHYSICAL);
}
else
{
Memory::Write_U64_Swap(*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask], g_arDMA.MMAddr);
MMUTable::write64(MMUTable::EmuPointer(g_arDMA.MMAddr), tmp, ACCESS_MASK_PHYSICAL);
}

g_arDMA.MMAddr += 8;
Expand All @@ -751,7 +754,7 @@ void Do_ARAM_DMA()
// Assuming no external ARAM installed; returns zeroes on out of bounds reads (verified on real HW)
while (g_arDMA.Cnt.count)
{
Memory::Write_U64(0, g_arDMA.MMAddr);
MMUTable::write64(MMUTable::EmuPointer(g_arDMA.MMAddr), tmp, ACCESS_MASK_PHYSICAL);
g_arDMA.MMAddr += 8;
g_arDMA.ARAddr += 8;
g_arDMA.Cnt.count -= 8;
Expand All @@ -772,21 +775,24 @@ void Do_ARAM_DMA()
{
while (g_arDMA.Cnt.count)
{
MMUTable::read64(MMUTable::EmuPointer(g_arDMA.MMAddr), tmp, ACCESS_MASK_PHYSICAL);
tmp = Common::swap64(tmp);

if ((g_ARAM_Info.Hex & 0xf) == 3)
{
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = tmp;
}
else if ((g_ARAM_Info.Hex & 0xf) == 4)
{
if (g_arDMA.ARAddr < 0x400000)
{
*(u64*)&g_ARAM.ptr[(g_arDMA.ARAddr + 0x400000) & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
*(u64*)&g_ARAM.ptr[(g_arDMA.ARAddr + 0x400000) & g_ARAM.mask] = tmp;
}
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = tmp;
}
else
{
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = Common::swap64(Memory::Read_U64(g_arDMA.MMAddr));
*(u64*)&g_ARAM.ptr[g_arDMA.ARAddr & g_ARAM.mask] = tmp;
}

g_arDMA.MMAddr += 8;
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/Src/HW/MMUTable.cpp
Expand Up @@ -393,6 +393,7 @@ static void unmap_pte(int pteg_index, u32 pteh, u32 ptel)
if(i==16)
{
// WARN_LOG(MASTER_LOG, "couldn't find vsid in segment registers, sad day");
/*
for(i=0;i<4; i++)
{
WARN_LOG(MASTER_LOG, "SR%02d: 0x%08x SR%02d: 0x%08x SR%02d: 0x%08x SR%02d: 0x%08x",
Expand All @@ -401,6 +402,7 @@ static void unmap_pte(int pteg_index, u32 pteh, u32 ptel)
4*i+2, PowerPC::ppcState.sr[4*i+2],
4*i+3, PowerPC::ppcState.sr[4*i+3]);
}
*/
return;
}

Expand Down
55 changes: 0 additions & 55 deletions Source/Core/Core/Src/HW/Memmap.cpp
Expand Up @@ -783,59 +783,6 @@ void WriteBigEData(const u8 *_pData, const u32 _Address, const u32 _iSize)
memcpy(GetPointer(_Address), _pData, _iSize);
}

void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength)
{
u8 *ptr = GetPointer(_Address);
if (ptr != NULL)
{
memset(ptr,_iValue,_iLength);
}
else
{
for (u32 i = 0; i < _iLength; i++)
Write_U8(_iValue, _Address + i);
}
<<<<<<< HEAD
u32 inst = *(u32*)(iCache + addr);
if (inst == JIT_ICACHE_INVALID_WORD)
inst = Memory::ReadUnchecked_U32(_Address);
else
inst = Common::swap32(inst);
#else
u32 inst = Memory::ReadUnchecked_U32(_Address);
#endif
if ((inst & 0xfc000000) == 0)
{
inst = jit->GetBlockCache()->GetOriginalFirstOp(inst);
}
return inst;
}

// WARNING! No checks!
// We assume that _Address is cached
void Write_Opcode_JIT(const u32 _Address, const u32 _Value)
{
#ifdef JIT_UNLIMITED_ICACHE
if (_Address & JIT_ICACHE_VMEM_BIT)
{
*(u32*)(jit->GetBlockCache()->GetICacheVMEM() + (_Address & JIT_ICACHE_MASK)) = Common::swap32(_Value);
}
else if (_Address & JIT_ICACHE_EXRAM_BIT)
{
*(u32*)(jit->GetBlockCache()->GetICacheEx() + (_Address & JIT_ICACHEEX_MASK)) = Common::swap32(_Value);
}
else
*(u32*)(jit->GetBlockCache()->GetICache() + (_Address & JIT_ICACHE_MASK)) = Common::swap32(_Value);
#else
Memory::WriteUnchecked_U32(_Value, _Address);
#endif
}

void WriteBigEData(const u8 *_pData, const u32 _Address, const u32 _iSize)
{
memcpy(GetPointer(_Address), _pData, _iSize);
}

void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength)
{
MMUTable::memset_emu(MMUTable::EmuPointer(_Address), _iValue, _iLength);
Expand All @@ -851,8 +798,6 @@ void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength)
Write_U8(_iValue, _Address + i);
}
*/
=======
>>>>>>> master
}

void DMA_LCToMemory(const u32 _MemAddr, const u32 _CacheAddr, const u32 _iNumBlocks)
Expand Down

0 comments on commit 66636b2

Please sign in to comment.