summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/rsp
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-03-29 15:50:04 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-03-29 15:50:04 +0000
commit2ad50720237fdd19cf5ab45b8cb6bb21119c00b8 (patch)
treedb21eee69668a06abc3f310ebbd51f5dbadf2de7 /src/emu/cpu/rsp
parentb72cf3c5702b749c7bf26383ff05a9ab55022d31 (diff)
BIG update.
Remove redundant machine items from address_space and device_t. Neither machine nor m_machine are directly accessible anymore. Instead a new getter machine() is available which returns a machine reference. So: space->machine->xxx ==> space->machine().xxx device->machine->yyy ==> device->machine().yyy Globally changed all running_machine pointers to running_machine references. Any function/method that takes a running_machine takes it as a required parameter (1 or 2 exceptions). Being consistent here gets rid of a lot of odd &machine or *machine, but it does mean a very large bulk change across the project. Structs which have a running_machine * now have that variable renamed to m_machine, and now have a shiny new machine() method that works like the space and device methods above. Since most of these are things that should eventually be devices anyway, consider this a step in that direction. 98% of the update was done with regex searches. The changes are architected such that the compiler will catch the remaining errors: // find things that use an embedded machine directly and replace // with a machine() getter call S: ->machine-> R: ->machine\(\)\. // do the same if via a reference S: \.machine-> R: \.machine\(\)\. // convert function parameters to running_machine & S: running_machine \*machine([^;]) R: running_machine \&machine\1 // replace machine-> with machine. S: machine-> R: machine\. // replace &machine() with machine() S: \&([()->a-z0-9_]+machine\(\)) R: \1 // sanity check: look for this used as a cast (running_machine &) // and change to this: *(running_machine *)
Diffstat (limited to 'src/emu/cpu/rsp')
-rw-r--r--src/emu/cpu/rsp/rsp.c4
-rw-r--r--src/emu/cpu/rsp/rspdrc.c18
2 files changed, 11 insertions, 11 deletions
diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c
index a756842f2f8..1a9bd158f6e 100644
--- a/src/emu/cpu/rsp/rsp.c
+++ b/src/emu/cpu/rsp/rsp.c
@@ -207,7 +207,7 @@ static void set_cop0_reg(rsp_state *rsp, int reg, UINT32 data)
static void unimplemented_opcode(rsp_state *rsp, UINT32 op)
{
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -303,7 +303,7 @@ static CPU_INIT( rsp )
#endif
// ...except for the accumulators.
- // We're not calling machine->rand() because initializing something with machine->rand()
+ // We're not calling machine.rand() because initializing something with machine.rand()
// makes me retch uncontrollably.
for(accumIdx = 0; accumIdx < 8; accumIdx++ )
{
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index 9c7b2295355..f41d462b3a5 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -496,7 +496,7 @@ static void cfunc_unimplemented_opcode(void *param)
{
rsp_state *rsp = (rsp_state*)param;
int op = rsp->impstate->arg0;
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -508,7 +508,7 @@ static void cfunc_unimplemented_opcode(void *param)
static void unimplemented_opcode(rsp_state *rsp, UINT32 op)
{
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -612,7 +612,7 @@ static CPU_INIT( rsp )
//int elnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*rsp)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*rsp)));
/* allocate the core memory */
*(rsp_state **)device->token() = rsp = (rsp_state *)cache->alloc_near(sizeof(*rsp));
@@ -638,7 +638,7 @@ static CPU_INIT( rsp )
{
flags |= DRCUML_OPTION_LOG_NATIVE;
}
- rsp->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
+ rsp->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
rsp->impstate->drcuml->symbol_add(&rsp->pc, sizeof(rsp->pc), "pc");
@@ -656,7 +656,7 @@ static CPU_INIT( rsp )
rsp->impstate->drcuml->symbol_add(&rsp->impstate->numcycles, sizeof(rsp->impstate->numcycles), "numcycles");
/* initialize the front-end helper */
- rsp->impstate->drcfe = auto_alloc(device->machine, rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ rsp->impstate->drcfe = auto_alloc(device->machine(), rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* compute the register parameters */
for (regnum = 0; regnum < 32; regnum++)
@@ -696,9 +696,9 @@ static CPU_EXIT( rsp )
rsp_state *rsp = get_safe_token(device);
/* clean up the DRC */
- auto_free(device->machine, rsp->impstate->drcfe);
- auto_free(device->machine, rsp->impstate->drcuml);
- auto_free(device->machine, rsp->impstate->cache);
+ auto_free(device->machine(), rsp->impstate->drcfe);
+ auto_free(device->machine(), rsp->impstate->drcuml);
+ auto_free(device->machine(), rsp->impstate->cache);
}
@@ -3817,7 +3817,7 @@ static void generate_sequence_instruction(rsp_state *rsp, drcuml_block *block, c
UML_MAPVAR(block, MAPVAR_CYCLES, compiler->cycles); // mapvar CYCLES,compiler->cycles
/* if we are debugging, call the debugger */
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&rsp->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(rsp, block);