diff options
| author | 2010-06-14 08:06:11 +0000 | |
|---|---|---|
| committer | 2010-06-14 08:06:11 +0000 | |
| commit | 55aa633c993bcac6dba944d64e7771b34ad69c64 (patch) | |
| tree | 6a3f9b325b0716b1afb3b39d55e7a960dfb5851e /src | |
| parent | 8c2c643a7ec0e0f3acc3657abc2a1103fa847c0e (diff) | |
Pre-cache maincpu so we can efficiently query the PC in the speedup loop.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mame/drivers/gstream.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c index d988d3351b2..ed2e76a5e8d 100644 --- a/src/mame/drivers/gstream.c +++ b/src/mame/drivers/gstream.c @@ -132,7 +132,8 @@ public: static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, gstream_state(machine)); } gstream_state(running_machine &machine) - : oki_1(machine.device<okim6295_device>("oki1")), + : maincpu(machine.device<cpu_device>("maincpu")), + oki_1(machine.device<okim6295_device>("oki1")), oki_2(machine.device<okim6295_device>("oki2")) { } /* memory pointers */ @@ -150,6 +151,7 @@ public: int oki_bank_0, oki_bank_1; /* devices */ + cpu_device *maincpu; okim6295_device *oki_1; okim6295_device *oki_2; }; @@ -624,9 +626,9 @@ ROM_END static READ32_HANDLER( gstream_speedup_r ) { gstream_state *state = (gstream_state *)space->machine->driver_data; - if (cpu_get_pc(space->cpu) == 0xc0001592) + if (state->maincpu->state_value(STATE_GENPC) == 0xc0001592) { - cpu_eat_cycles(space->cpu, 50); + state->maincpu->eat_cycles(50); } return state->workram[0xd1ee0 / 4]; |
