summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2010-03-07 16:37:35 +0000
committerhrydgard <hrydgard@gmail.com>2010-03-07 16:37:35 +0000
commit470db5965e6df643262edf93aea52fcbcb137338 (patch)
tree23f2ef91eb0e63838098c228520374c394695bc1 /Source
parent2dabcb881cff02d082f09096ddbd5ee4342a68b8 (diff)
Minor optimization that's been sitting on my harddrive for a while.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5165 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/Src/HW/MemmapFunctions.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/Core/Core/Src/HW/MemmapFunctions.cpp b/Source/Core/Core/Src/HW/MemmapFunctions.cpp
index 7dfea699dc..7e26e10514 100644
--- a/Source/Core/Core/Src/HW/MemmapFunctions.cpp
+++ b/Source/Core/Core/Src/HW/MemmapFunctions.cpp
@@ -17,6 +17,7 @@
#include "Common.h"
+#include "GPFifo.h"
#include "Memmap.h"
#include "WII_IOB.h"
#include "../Core.h"
@@ -209,14 +210,23 @@ inline void ReadFromHardware(T &_var, u32 em_address, u32 effective_address, Mem
_var = bswap((*(const T*)&m_pRAM[tlb_addr & RAM_MASK]));
}
- /* Debugging: CheckForBadAddresses##_type(em_address, _var, true);*/
+ // Debugging: CheckForBadAddresses##_type(em_address, _var, true);
}
template <class T>
inline void WriteToHardware(u32 em_address, const T data, u32 effective_address, Memory::XCheckTLBFlag flag)
{
- /* Debugging: CheckForBadAddresses##_type(em_address, data, false);*/
+ // Debugging: CheckForBadAddresses##_type(em_address, data, false);
+ // First, let's check for FIFO writes, since they are probably the most common
+ // reason we end up in this function:
+ if (em_address == 0xCC008000) {
+ switch (sizeof(T)) {
+ case 1: GPFifo::Write8(data, em_address); return;
+ case 2: GPFifo::Write16(data, em_address); return;
+ case 4: GPFifo::Write32(data, em_address); return;
+ }
+ }
if ((em_address & 0xC8000000) == 0xC8000000)
{
if (em_address < 0xcc000000)