Memmap: get rid of unused junk.

This should make it a bit more clear what interfaces we're actually
exposing for memory access at the moment.
This commit is contained in:
magumagu 2014-05-25 16:30:04 -07:00
parent 44f481ec13
commit ec9dd80b7f
3 changed files with 11 additions and 29 deletions

View File

@ -237,7 +237,7 @@ void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength)
void DMA_LCToMemory(const u32 _MemAddr, const u32 _CacheAddr, const u32 _iNumBlocks) void DMA_LCToMemory(const u32 _MemAddr, const u32 _CacheAddr, const u32 _iNumBlocks)
{ {
const u8 *src = GetCachePtr() + (_CacheAddr & 0x3FFFF); const u8 *src = m_pL1Cache + (_CacheAddr & 0x3FFFF);
u8 *dst = GetPointer(_MemAddr); u8 *dst = GetPointer(_MemAddr);
if ((dst != nullptr) && (src != nullptr) && (_MemAddr & 3) == 0 && (_CacheAddr & 3) == 0) if ((dst != nullptr) && (src != nullptr) && (_MemAddr & 3) == 0 && (_CacheAddr & 3) == 0)
@ -257,7 +257,7 @@ void DMA_LCToMemory(const u32 _MemAddr, const u32 _CacheAddr, const u32 _iNumBlo
void DMA_MemoryToLC(const u32 _CacheAddr, const u32 _MemAddr, const u32 _iNumBlocks) void DMA_MemoryToLC(const u32 _CacheAddr, const u32 _MemAddr, const u32 _iNumBlocks)
{ {
const u8 *src = GetPointer(_MemAddr); const u8 *src = GetPointer(_MemAddr);
u8 *dst = GetCachePtr() + (_CacheAddr & 0x3FFFF); u8 *dst = m_pL1Cache + (_CacheAddr & 0x3FFFF);
if ((dst != nullptr) && (src != nullptr) && (_MemAddr & 3) == 0 && (_CacheAddr & 3) == 0) if ((dst != nullptr) && (src != nullptr) && (_MemAddr & 3) == 0 && (_CacheAddr & 3) == 0)
{ {
@ -333,7 +333,7 @@ u8 *GetPointer(const u32 _Address)
case 0xe: case 0xe:
if (_Address < (0xE0000000 + L1_CACHE_SIZE)) if (_Address < (0xE0000000 + L1_CACHE_SIZE))
return GetCachePtr() + (_Address & L1_CACHE_MASK); return m_pL1Cache + (_Address & L1_CACHE_MASK);
else else
break; break;

View File

@ -95,17 +95,6 @@ void WriteUnchecked_U32(const u32 _Data, const u32 _Address);
bool IsRAMAddress(const u32 addr, bool allow_locked_cache = false, bool allow_fake_vmem = false); bool IsRAMAddress(const u32 addr, bool allow_locked_cache = false, bool allow_fake_vmem = false);
inline u8* GetCachePtr() {return m_pL1Cache;}
inline u8* GetMainRAMPtr() {return m_pRAM;}
inline u32 ReadFast32(const u32 _Address)
{
#if _ARCH_32
return Common::swap32(*(u32 *)(base + (_Address & MEMVIEW32_MASK))); // ReadUnchecked_U32(_Address);
#else
return Common::swap32(*(u32 *)(base + _Address));
#endif
}
// used by interpreter to read instructions, uses iCache // used by interpreter to read instructions, uses iCache
u32 Read_Opcode(const u32 _Address); u32 Read_Opcode(const u32 _Address);
// this is used by Debugger a lot. // this is used by Debugger a lot.
@ -115,11 +104,6 @@ u32 Read_Instruction(const u32 _Address);
// For use by emulator // For use by emulator
// Read and write functions
#define NUMHWMEMFUN 64
#define HWSHIFT 10
#define HW_MASK 0x3FF
u8 Read_U8(const u32 _Address); u8 Read_U8(const u32 _Address);
u16 Read_U16(const u32 _Address); u16 Read_U16(const u32 _Address);
u32 Read_U32(const u32 _Address); u32 Read_U32(const u32 _Address);
@ -133,9 +117,6 @@ double Read_F64(const u32 _Address);
u32 Read_U8_ZX(const u32 _Address); u32 Read_U8_ZX(const u32 _Address);
u32 Read_U16_ZX(const u32 _Address); u32 Read_U16_ZX(const u32 _Address);
// used by JIT (Jit64::lXz)
u32 EFB_Read(const u32 addr);
void Write_U8(const u8 _Data, const u32 _Address); void Write_U8(const u8 _Data, const u32 _Address);
void Write_U16(const u16 _Data, const u32 _Address); void Write_U16(const u16 _Data, const u32 _Address);
void Write_U32(const u32 _Data, const u32 _Address); void Write_U32(const u32 _Data, const u32 _Address);
@ -148,7 +129,6 @@ void Write_U64_Swap(const u64 _Data, const u32 _Address);
// Useful helper functions, used by ARM JIT // Useful helper functions, used by ARM JIT
void Write_F64(const double _Data, const u32 _Address); void Write_F64(const double _Data, const u32 _Address);
void WriteHW_U32(const u32 _Data, const u32 _Address);
void GetString(std::string& _string, const u32 _Address); void GetString(std::string& _string, const u32 _Address);
void WriteBigEData(const u8 *_pData, const u32 _Address, const size_t size); void WriteBigEData(const u8 *_pData, const u32 _Address, const size_t size);
@ -169,9 +149,6 @@ enum XCheckTLBFlag
}; };
u32 TranslateAddress(u32 _Address, XCheckTLBFlag _Flag); u32 TranslateAddress(u32 _Address, XCheckTLBFlag _Flag);
void InvalidateTLBEntry(u32 _Address); void InvalidateTLBEntry(u32 _Address);
void GenerateDSIException(u32 _EffectiveAdress, bool _bWrite);
void GenerateISIException(u32 _EffectiveAdress);
extern u32 pagetable_base; extern u32 pagetable_base;
extern u32 pagetable_hashmask; extern u32 pagetable_hashmask;
}; };

View File

@ -71,7 +71,7 @@ inline u64 bswap(u64 val) {return Common::swap64(val);}
// Nasty but necessary. Super Mario Galaxy pointer relies on this stuff. // Nasty but necessary. Super Mario Galaxy pointer relies on this stuff.
u32 EFB_Read(const u32 addr) static u32 EFB_Read(const u32 addr)
{ {
u32 var = 0; u32 var = 0;
// Convert address to coordinates. It's possible that this should be done // Convert address to coordinates. It's possible that this should be done
@ -90,6 +90,8 @@ u32 EFB_Read(const u32 addr)
return var; return var;
} }
static void GenerateDSIException(u32 _EffectiveAddress, bool _bWrite);
template <typename T> template <typename T>
inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_address, Memory::XCheckTLBFlag flag) inline void ReadFromHardware(T &_var, const u32 em_address, const u32 effective_address, Memory::XCheckTLBFlag flag)
{ {
@ -232,6 +234,9 @@ inline void WriteToHardware(u32 em_address, const T data, u32 effective_address,
/* These functions are primarily called by the Interpreter functions and are routed to the correct /* These functions are primarily called by the Interpreter functions and are routed to the correct
location through ReadFromHardware and WriteToHardware */ location through ReadFromHardware and WriteToHardware */
// ---------------- // ----------------
static void GenerateISIException(u32 effective_address);
u32 Read_Opcode(u32 _Address) u32 Read_Opcode(u32 _Address)
{ {
if (_Address == 0x00000000) if (_Address == 0x00000000)
@ -550,7 +555,7 @@ union UPTE2
u32 Hex; u32 Hex;
}; };
void GenerateDSIException(u32 _EffectiveAddress, bool _bWrite) static void GenerateDSIException(u32 _EffectiveAddress, bool _bWrite)
{ {
if (_bWrite) if (_bWrite)
PowerPC::ppcState.spr[SPR_DSISR] = PPC_EXC_DSISR_PAGE | PPC_EXC_DSISR_STORE; PowerPC::ppcState.spr[SPR_DSISR] = PPC_EXC_DSISR_PAGE | PPC_EXC_DSISR_STORE;
@ -563,7 +568,7 @@ void GenerateDSIException(u32 _EffectiveAddress, bool _bWrite)
} }
void GenerateISIException(u32 _EffectiveAddress) static void GenerateISIException(u32 _EffectiveAddress)
{ {
// Address of instruction could not be translated // Address of instruction could not be translated
NPC = _EffectiveAddress; NPC = _EffectiveAddress;