summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/mips/r3000.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-09-17 08:22:16 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-09-17 08:22:16 +0000
commit3cce7e019e095296b5ce2bb45d19b1209bed961d (patch)
tree4fa76260ac2dee5878fbba70d759ba6a1d4d76bf /src/emu/cpu/mips/r3000.c
parent22b4739aded17790b3f1bf31b9da8ff9e6a0860c (diff)
Memory handler normalization, part 2. Change legacy
read/write handlers to take an address_space & instead of an address_space *. Also update pretty much all other functions to take a reference where appropriate. [Aaron Giles]
Diffstat (limited to 'src/emu/cpu/mips/r3000.c')
-rw-r--r--src/emu/cpu/mips/r3000.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index e8c93795d44..5c210db49cb 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -98,13 +98,13 @@ CPU_DISASSEMBLE( r3000le );
#define SETPC(R,x) do { (R)->nextpc = (x); } while (0)
#define SETPCL(R,x,l) do { (R)->nextpc = (x); (R)->r[l] = (R)->pc + 4; } while (0)
-#define RBYTE(R,x) (*(R)->cur.read_byte)((R)->program, x)
-#define RWORD(R,x) (*(R)->cur.read_word)((R)->program, x)
-#define RLONG(R,x) (*(R)->cur.read_dword)((R)->program, x)
+#define RBYTE(R,x) (*(R)->cur.read_byte)(*(R)->program, x)
+#define RWORD(R,x) (*(R)->cur.read_word)(*(R)->program, x)
+#define RLONG(R,x) (*(R)->cur.read_dword)(*(R)->program, x)
-#define WBYTE(R,x,v) (*(R)->cur.write_byte)((R)->program, x, v)
-#define WWORD(R,x,v) (*(R)->cur.write_word)((R)->program, x, v)
-#define WLONG(R,x,v) (*(R)->cur.write_dword)((R)->program, x, v)
+#define WBYTE(R,x,v) (*(R)->cur.write_byte)(*(R)->program, x, v)
+#define WWORD(R,x,v) (*(R)->cur.write_word)(*(R)->program, x, v)
+#define WLONG(R,x,v) (*(R)->cur.write_dword)(*(R)->program, x, v)
#define SR cpr[0][COP0_Status]
#define CAUSE cpr[0][COP0_Cause]
@@ -187,19 +187,19 @@ static void lwr_le(r3000_state *r3000, UINT32 op);
static void swl_le(r3000_state *r3000, UINT32 op);
static void swr_le(r3000_state *r3000, UINT32 op);
-static UINT8 readcache_be(address_space *space, offs_t offset);
-static UINT16 readcache_be_word(address_space *space, offs_t offset);
-static UINT32 readcache_be_dword(address_space *space, offs_t offset);
-static void writecache_be(address_space *space, offs_t offset, UINT8 data);
-static void writecache_be_word(address_space *space, offs_t offset, UINT16 data);
-static void writecache_be_dword(address_space *space, offs_t offset, UINT32 data);
+static UINT8 readcache_be(address_space &space, offs_t offset);
+static UINT16 readcache_be_word(address_space &space, offs_t offset);
+static UINT32 readcache_be_dword(address_space &space, offs_t offset);
+static void writecache_be(address_space &space, offs_t offset, UINT8 data);
+static void writecache_be_word(address_space &space, offs_t offset, UINT16 data);
+static void writecache_be_dword(address_space &space, offs_t offset, UINT32 data);
-static UINT8 readcache_le(address_space *space, offs_t offset);
-static UINT16 readcache_le_word(address_space *space, offs_t offset);
-static UINT32 readcache_le_dword(address_space *space, offs_t offset);
-static void writecache_le(address_space *space, offs_t offset, UINT8 data);
-static void writecache_le_word(address_space *space, offs_t offset, UINT16 data);
-static void writecache_le_dword(address_space *space, offs_t offset, UINT32 data);
+static UINT8 readcache_le(address_space &space, offs_t offset);
+static UINT16 readcache_le_word(address_space &space, offs_t offset);
+static UINT32 readcache_le_dword(address_space &space, offs_t offset);
+static void writecache_le(address_space &space, offs_t offset, UINT8 data);
+static void writecache_le_word(address_space &space, offs_t offset, UINT16 data);
+static void writecache_le_dword(address_space &space, offs_t offset, UINT32 data);
@@ -892,86 +892,86 @@ static CPU_EXECUTE( r3000 )
CACHE I/O
***************************************************************************/
-static UINT8 readcache_be(address_space *space, offs_t offset)
+static UINT8 readcache_be(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? r3000->cache[BYTE4_XOR_BE(offset)] : 0xff;
}
-static UINT16 readcache_be_word(address_space *space, offs_t offset)
+static UINT16 readcache_be_word(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? *(UINT16 *)&r3000->cache[WORD_XOR_BE(offset)] : 0xffff;
}
-static UINT32 readcache_be_dword(address_space *space, offs_t offset)
+static UINT32 readcache_be_dword(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? *(UINT32 *)&r3000->cache[offset] : 0xffffffff;
}
-static void writecache_be(address_space *space, offs_t offset, UINT8 data)
+static void writecache_be(address_space &space, offs_t offset, UINT8 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) r3000->cache[BYTE4_XOR_BE(offset)] = data;
}
-static void writecache_be_word(address_space *space, offs_t offset, UINT16 data)
+static void writecache_be_word(address_space &space, offs_t offset, UINT16 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) *(UINT16 *)&r3000->cache[WORD_XOR_BE(offset)] = data;
}
-static void writecache_be_dword(address_space *space, offs_t offset, UINT32 data)
+static void writecache_be_dword(address_space &space, offs_t offset, UINT32 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) *(UINT32 *)&r3000->cache[offset] = data;
}
-static UINT8 readcache_le(address_space *space, offs_t offset)
+static UINT8 readcache_le(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? r3000->cache[BYTE4_XOR_LE(offset)] : 0xff;
}
-static UINT16 readcache_le_word(address_space *space, offs_t offset)
+static UINT16 readcache_le_word(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? *(UINT16 *)&r3000->cache[WORD_XOR_LE(offset)] : 0xffff;
}
-static UINT32 readcache_le_dword(address_space *space, offs_t offset)
+static UINT32 readcache_le_dword(address_space &space, offs_t offset)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
return (offset * 4 < r3000->cache_size) ? *(UINT32 *)&r3000->cache[offset] : 0xffffffff;
}
-static void writecache_le(address_space *space, offs_t offset, UINT8 data)
+static void writecache_le(address_space &space, offs_t offset, UINT8 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) r3000->cache[BYTE4_XOR_LE(offset)] = data;
}
-static void writecache_le_word(address_space *space, offs_t offset, UINT16 data)
+static void writecache_le_word(address_space &space, offs_t offset, UINT16 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) *(UINT16 *)&r3000->cache[WORD_XOR_LE(offset)] = data;
}
-static void writecache_le_dword(address_space *space, offs_t offset, UINT32 data)
+static void writecache_le_dword(address_space &space, offs_t offset, UINT32 data)
{
- r3000_state *r3000 = get_safe_token(&space->device());
+ r3000_state *r3000 = get_safe_token(&space.device());
offset &= 0x1fffffff;
if (offset * 4 < r3000->cache_size) *(UINT32 *)&r3000->cache[offset] = data;
}