diff options
author | 2008-11-10 07:42:09 +0000 | |
---|---|---|
committer | 2008-11-10 07:42:09 +0000 | |
commit | 92f305310513e310dcca7f5b1c3fe7ec2b197775 (patch) | |
tree | 26a4873c3e46ad13db9d1a92de2be5179754d95b | |
parent | 7c2bd582be58669e84d3bfd2c927401641a7fa80 (diff) |
Major cpuintrf changes:
* added a set of cpu_* calls which accept a CPU device object;
these are now the preferred means of manipulating a CPU
* removed the cpunum_* calls; added an array of cpu[] to the
running_machine object; converted all existing cpunum_* calls
to cpu_* calls, pulling the CPU device object from the new
array in the running_machine
* removed the activecpu_* calls; added an activecpu member to
the running_machine object; converted all existing activecpu_*
calls to cpu_* calls, pulling the active CPU device object
from the running_machine
* changed cpuintrf_push_context() to cpu_push_context(), taking
a CPU object pointer; changed cpuintrf_pop_context() to
cpu_pop_context(); eventually these will go away
* many other similar changes moving toward a model where all CPU
references are done by the CPU object and not by index
651 files changed, 5423 insertions, 5594 deletions
diff --git a/src/emu/cpu/ccpu/ccpu.c b/src/emu/cpu/ccpu/ccpu.c index b4f54817648..395470ef494 100644 --- a/src/emu/cpu/ccpu/ccpu.c +++ b/src/emu/cpu/ccpu/ccpu.c @@ -704,7 +704,7 @@ static CPU_SET_INFO( ccpu ) /* --- the following bits of info are set as 64-bit signed integers --- */ case CPUINFO_INT_PC: case CPUINFO_INT_REGISTER + CCPU_PC: ccpu.PC = info->i; break; - case CPUINFO_INT_REGISTER + CCPU_FLAGS: + case CPUINFO_INT_REGISTER + Ccpu_get_flags: ccpu.a0flag = (info->i & 0x01) ? 1 : 0; ccpu.ncflag = (info->i & 0x02) ? 0x0000 : 0x1000; ccpu.cmpacc = 1; @@ -760,7 +760,7 @@ CPU_GET_INFO( ccpu ) case CPUINFO_INT_PC: case CPUINFO_INT_REGISTER + CCPU_PC: info->i = ccpu.PC; break; - case CPUINFO_INT_REGISTER + CCPU_FLAGS: info->i = 0; + case CPUINFO_INT_REGISTER + Ccpu_get_flags: info->i = 0; if (TEST_A0()) info->i |= 0x01; if (TEST_NC()) info->i |= 0x02; if (TEST_LT()) info->i |= 0x04; @@ -807,7 +807,7 @@ CPU_GET_INFO( ccpu ) TEST_DR() ? 'D' : 'd'); break; - case CPUINFO_STR_REGISTER + CCPU_FLAGS: + case CPUINFO_STR_REGISTER + Ccpu_get_flags: sprintf(info->s, "FL:%c%c%c%c%c%c", TEST_A0() ? '0' : 'o', TEST_NC() ? 'N' : 'n', diff --git a/src/emu/cpu/ccpu/ccpu.h b/src/emu/cpu/ccpu/ccpu.h index a0efd899f6d..1af68352dcf 100644 --- a/src/emu/cpu/ccpu/ccpu.h +++ b/src/emu/cpu/ccpu/ccpu.h @@ -23,7 +23,7 @@ enum { CCPU_PC=1, - CCPU_FLAGS, + Ccpu_get_flags, CCPU_A, CCPU_B, CCPU_I, diff --git a/src/emu/cpu/cop400/410ops.c b/src/emu/cpu/cop400/410ops.c index 14ddd92b910..f8a900db71c 100644 --- a/src/emu/cpu/cop400/410ops.c +++ b/src/emu/cpu/cop400/410ops.c @@ -54,7 +54,7 @@ static TIMER_CALLBACK(cop410_serial_tick) { int cpunum = param; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); if (BIT(EN, 0)) { @@ -126,7 +126,7 @@ static TIMER_CALLBACK(cop410_serial_tick) SIO = ((SIO << 1) | IN_SI()) & 0x0f; } - cpuintrf_pop_context(); + cpu_pop_context(); } INLINE void WRITE_Q(UINT8 data) diff --git a/src/emu/cpu/cop400/cop410.c b/src/emu/cpu/cop400/cop410.c index 6560031a538..e3b1e6395cf 100644 --- a/src/emu/cpu/cop400/cop410.c +++ b/src/emu/cpu/cop400/cop410.c @@ -233,7 +233,7 @@ static CPU_INIT( cop410 ) /* set clock divider */ - cpunum_set_info_int(index, CPUINFO_INT_CLOCK_DIVIDER, R.intf->cki); + cpu_set_info_int(device, CPUINFO_INT_CLOCK_DIVIDER, R.intf->cki); /* allocate serial timer */ diff --git a/src/emu/cpu/cop400/cop420.c b/src/emu/cpu/cop400/cop420.c index 2d9d2b7efd9..15c9f98f7ba 100644 --- a/src/emu/cpu/cop400/cop420.c +++ b/src/emu/cpu/cop400/cop420.c @@ -230,7 +230,7 @@ ADDRESS_MAP_END static TIMER_CALLBACK(cop420_counter_tick) { - cpuintrf_push_context(param); + cpu_push_context(machine->cpu[param]); R.counter++; @@ -240,7 +240,7 @@ static TIMER_CALLBACK(cop420_counter_tick) R.timerlatch = 1; } - cpuintrf_pop_context(); + cpu_pop_context(); } /* IN Latches */ @@ -250,7 +250,7 @@ static TIMER_CALLBACK(cop420_inil_tick) UINT8 in; int i; - cpuintrf_push_context(param); + cpu_push_context(machine->cpu[param]); in = IN_IN(); for (i = 0; i < 4; i++) @@ -263,7 +263,7 @@ static TIMER_CALLBACK(cop420_inil_tick) } } - cpuintrf_pop_context(); + cpu_pop_context(); } /* Microbus */ @@ -272,7 +272,7 @@ static TIMER_CALLBACK(cop420_microbus_tick) { UINT8 in; - cpuintrf_push_context(param); + cpu_push_context(machine->cpu[param]); in = IN_IN(); @@ -298,7 +298,7 @@ static TIMER_CALLBACK(cop420_microbus_tick) } } - cpuintrf_pop_context(); + cpu_pop_context(); } /**************************************************************************** @@ -322,7 +322,7 @@ static CPU_INIT( cop420 ) /* set clock divider */ - cpunum_set_info_int(index, CPUINFO_INT_CLOCK_DIVIDER, R.intf->cki); + cpu_set_info_int(device, CPUINFO_INT_CLOCK_DIVIDER, R.intf->cki); /* allocate serial timer */ diff --git a/src/emu/cpu/cp1610/cp1610.c b/src/emu/cpu/cp1610/cp1610.c index d66196f76cd..43a669168d0 100644 --- a/src/emu/cpu/cp1610/cp1610.c +++ b/src/emu/cpu/cp1610/cp1610.c @@ -1551,7 +1551,7 @@ static void cp1610_xori(int d) static CPU_RESET( cp1610 ) { /* This is how we set the reset vector */ - cpunum_set_input_line(Machine, cpu_getactivecpu(), CP1610_RESET, PULSE_LINE); + cpunum_set_input_line(Machine, cpunum_get_active(), CP1610_RESET, PULSE_LINE); } /*************************************************** diff --git a/src/emu/cpu/drcfe.c b/src/emu/cpu/drcfe.c index 18b05d20b91..a727668b5fc 100644 --- a/src/emu/cpu/drcfe.c +++ b/src/emu/cpu/drcfe.c @@ -122,7 +122,7 @@ INLINE void desc_free(drcfe_state *drcfe, opcode_desc *desc) drcfe_init - initializate the drcfe state -------------------------------------------------*/ -drcfe_state *drcfe_init(const drcfe_config *config, void *param) +drcfe_state *drcfe_init(const device_config *cpu, const drcfe_config *config, void *param) { drcfe_state *drcfe; @@ -142,14 +142,14 @@ drcfe_state *drcfe_init(const drcfe_config *config, void *param) drcfe->param = param; /* initialize the state */ - drcfe->pageshift = activecpu_page_shift(ADDRESS_SPACE_PROGRAM); - drcfe->translate = (cpu_translate_func)activecpu_get_info_fct(CPUINFO_PTR_TRANSLATE); + drcfe->pageshift = cpu_get_page_shift(cpu, ADDRESS_SPACE_PROGRAM); + drcfe->translate = (cpu_translate_func)cpu_get_info_fct(cpu, CPUINFO_PTR_TRANSLATE); #ifdef LSB_FIRST - if (activecpu_endianness() == CPU_IS_BE) + if (cpu_get_endianness(cpu) == CPU_IS_BE) #else - if (activecpu_endianness() == CPU_IS_LE) + if (cpu_get_endianness(cpu) == CPU_IS_LE) #endif - drcfe->codexor = (activecpu_databus_width(ADDRESS_SPACE_PROGRAM) / 8 / activecpu_min_instruction_bytes() - 1) * activecpu_min_instruction_bytes(); + drcfe->codexor = (cpu_get_databus_width(cpu, ADDRESS_SPACE_PROGRAM) / 8 / cpu_get_min_opcode_bytes(cpu) - 1) * cpu_get_min_opcode_bytes(cpu); return drcfe; } diff --git a/src/emu/cpu/drcfe.h b/src/emu/cpu/drcfe.h index 127f6596193..a4cd7a33559 100644 --- a/src/emu/cpu/drcfe.h +++ b/src/emu/cpu/drcfe.h @@ -150,7 +150,7 @@ struct _drcfe_config ***************************************************************************/ /* initializate the drcfe state */ -drcfe_state *drcfe_init(const drcfe_config *config, void *param); +drcfe_state *drcfe_init(const device_config *cpu, const drcfe_config *config, void *param); /* clean up after ourselves */ void drcfe_exit(drcfe_state *drcfe); diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c index d7612293f54..0a342e26229 100644 --- a/src/emu/cpu/dsp32/dsp32.c +++ b/src/emu/cpu/dsp32/dsp32.c @@ -452,17 +452,6 @@ static CPU_DISASSEMBLE( dsp32c ) PARALLEL INTERFACE WRITES ***************************************************************************/ -/* context finder */ -#ifdef UNUSED_FUNCTION -INLINE dsp32_regs *FINDCONTEXT(int cpu) -{ - dsp32_regs *context = cpunum_get_context_ptr(cpu); - if (!context) - context = &dsp32; - return context; -} -#endif - static const UINT32 regmap[4][16] = { { /* DSP32 compatible mode */ @@ -560,7 +549,7 @@ void dsp32c_pio_w(int cpunum, int reg, int data) UINT16 mask; UINT8 mode; - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); /* look up register and mask */ mode = ((dsp32.pcr >> 8) & 2) | ((dsp32.pcr >> 1) & 1); @@ -628,7 +617,7 @@ void dsp32c_pio_w(int cpunum, int reg, int data) break; } - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -642,7 +631,7 @@ int dsp32c_pio_r(int cpunum, int reg) UINT16 mask, result = 0xffff; UINT8 mode, shift = 0; - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); /* look up register and mask */ mode = ((dsp32.pcr >> 8) & 2) | ((dsp32.pcr >> 1) & 1); @@ -702,7 +691,7 @@ int dsp32c_pio_r(int cpunum, int reg) break; } - cpuintrf_pop_context(); + cpu_pop_context(); return (result >> shift) & ~mask; } diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c index cc3e2c11fdf..3f14b5e4aa6 100644 --- a/src/emu/cpu/e132xs/e132xs.c +++ b/src/emu/cpu/e132xs/e132xs.c @@ -628,7 +628,7 @@ static void adjust_timer_interrupt(void) UINT64 cycles_since_base = activecpu_gettotalcycles() - hyperstone.tr_base_cycles; UINT64 clocks_since_base = cycles_since_base >> hyperstone.clock_scale; UINT64 cycles_until_next_clock = cycles_since_base - (clocks_since_base << hyperstone.clock_scale); - int cpunum = cpu_getactivecpu(); + int cpunum = cpunum_get_active(); if (cycles_until_next_clock == 0) cycles_until_next_clock = (UINT64)(1 << hyperstone.clock_scale); @@ -669,7 +669,7 @@ static TIMER_CALLBACK( e132xs_timer_callback ) int update = param & 1; int cpunum = param >> 1; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); /* update the values if necessary */ if (update) @@ -683,7 +683,7 @@ static TIMER_CALLBACK( e132xs_timer_callback ) else adjust_timer_interrupt(); - cpuintrf_pop_context(); + cpu_pop_context(); } diff --git a/src/emu/cpu/h6280/h6280ops.h b/src/emu/cpu/h6280/h6280ops.h index 3e3e338f43b..de34b46bf03 100644 --- a/src/emu/cpu/h6280/h6280ops.h +++ b/src/emu/cpu/h6280/h6280ops.h @@ -558,7 +558,7 @@ INLINE void WRMEM(offs_t addr, UINT8 data) { * set I flag, reset D flag and jump via IRQ vector ***************************************************************/ #define BRK \ - logerror("BRK %04x\n",activecpu_get_pc()); \ + logerror("BRK %04x\n",cpu_get_pc(Machine->activecpu)); \ CLEAR_T; \ PCW++; \ PUSH(PCH); \ @@ -1106,7 +1106,7 @@ INLINE void WRMEM(offs_t addr, UINT8 data) { ***************************************************************/ #define SET \ P |= _fT; \ - logerror("%04x: WARNING H6280 SET\n",activecpu_get_pc()) + logerror("%04x: WARNING H6280 SET\n",cpu_get_pc(Machine->activecpu)) /* 6280 ******************************************************** * SMB Set memory bit diff --git a/src/emu/cpu/h83002/h8periph.c b/src/emu/cpu/h83002/h8periph.c index 486f89b26be..15f85219f45 100644 --- a/src/emu/cpu/h83002/h8periph.c +++ b/src/emu/cpu/h83002/h8periph.c @@ -9,6 +9,7 @@ ****************************************************************************/ #include "debugger.h" +#include "deprecat.h" #include "h83002.h" #include "h8priv.h" @@ -515,7 +516,7 @@ UINT8 h8_3007_itu_read8(UINT8 reg) void h8_3007_itu_write8(UINT8 reg, UINT8 val) { - //logerror("%06x: h8/3007 reg %02x = %02x\n",activecpu_get_pc(),reg,val); + //logerror("%06x: h8/3007 reg %02x = %02x\n",cpu_get_pc(machine->activecpu),reg,val); h8.per_regs[reg] = val; switch(reg) { @@ -687,7 +688,7 @@ UINT8 h8_3007_register1_read8(UINT32 address) case 0xfee018: return h8.per_regs[0xF8]; // IPRA } - logerror("cpu #%d (PC=%08X): unmapped I/O(1) byte read from %08X\n",cpu_getactivecpu(),activecpu_get_pc(),address); + logerror("cpu #%d (PC=%08X): unmapped I/O(1) byte read from %08X\n",cpunum_get_active(),cpu_get_pc(Machine->activecpu),address); return 0; } @@ -699,7 +700,7 @@ void h8_3007_register1_write8(UINT32 address, UINT8 val) case 0xfee016: h8_ISR_w(val); return; // ISR case 0xfee018: h8.per_regs[0xF8] = val; return; // IPRA } - logerror("cpu #%d (PC=%08X): unmapped I/O(1) byte write to %08X = %02X\n",cpu_getactivecpu(),activecpu_get_pc(),address,val); + logerror("cpu #%d (PC=%08X): unmapped I/O(1) byte write to %08X = %02X\n",cpunum_get_active(),cpu_get_pc(Machine->activecpu),address,val); } void h8_3007_itu_init(void) @@ -721,7 +722,7 @@ void h8_itu_init(void) h8_itu_reset(); - h8.cpu_number = cpu_getactivecpu(); + h8.cpu_number = cpunum_get_active(); } void h8_itu_reset(void) diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c index 48e118a36dd..ff0017c7577 100644 --- a/src/emu/cpu/hd6309/hd6309.c +++ b/src/emu/cpu/hd6309/hd6309.c @@ -575,7 +575,7 @@ static void set_irq_line(int irqline, int state) { if (hd6309.nmi_state == state) return; hd6309.nmi_state = state; - LOG(("HD6309#%d set_irq_line (NMI) %d (PC=%4.4X)\n", cpu_getactivecpu(), state, pPC.d)); + LOG(("HD6309#%d set_irq_line (NMI) %d (PC=%4.4X)\n", cpunum_get_active(), state, pPC.d)); if( state == CLEAR_LINE ) return; /* if the stack was not yet initialized */ @@ -614,7 +614,7 @@ static void set_irq_line(int irqline, int state) } else if (irqline < 2) { - LOG(("HD6309#%d set_irq_line %d, %d (PC=%4.4X)\n", cpu_getactivecpu(), irqline, state, pPC.d)); + LOG(("HD6309#%d set_irq_line %d, %d (PC=%4.4X)\n", cpunum_get_active(), irqline, state, pPC.d)); hd6309.irq_state[irqline] = state; if (state == CLEAR_LINE) return; CHECK_IRQ_LINES(); diff --git a/src/emu/cpu/i86/instrv30.c b/src/emu/cpu/i86/instrv30.c index 39272760f8f..ca66207abf3 100644 --- a/src/emu/cpu/i86/instrv30.c +++ b/src/emu/cpu/i86/instrv30.c @@ -301,7 +301,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ break; case 0x1D: /* 0F 1D C6 - SET1 si,cl */ - /* logerror("PC=%06x : Set1 ",activecpu_get_pc()-2); */ + /* logerror("PC=%06x : Set1 ",cpu_get_pc(machine->activecpu)-2); */ ModRM = FETCH; if (ModRM >= 0xc0) { @@ -477,7 +477,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ * * Clocks: 16 */ - logerror("PC=%06x : MOVSPA\n", activecpu_get_pc() - 2); + logerror("PC=%06x : MOVSPA\n", cpu_get_pc(machine->activecpu) - 2); nec_ICount -= 16; break; case 0x26: /* 0F 22 59 - cmp4s */ @@ -567,7 +567,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ * tmp &= 0xffff; * PutbackRMWord(ModRM,tmp); */ - logerror("PC=%06x : ROL4 %02x\n", activecpu_get_pc() - 3, ModRM); + logerror("PC=%06x : ROL4 %02x\n", cpu_get_pc(machine->activecpu) - 3, ModRM); break; case 0x2A: /* 0F 2a c2 - ROR4 bh */ @@ -612,7 +612,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ * tmp = tmp2 | (tmp>>4); * PutbackRMWord(ModRM,tmp); */ - logerror("PC=%06x : ROR4 %02x\n", activecpu_get_pc() - 3, ModRM); + logerror("PC=%06x : ROR4 %02x\n", cpu_get_pc(machine->activecpu) - 3, ModRM); break; case 0x2D: /* 0Fh 2Dh <1111 1RRR> */ @@ -677,13 +677,13 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ * Flags Affected: None */ ModRM = FETCH; - logerror("PC=%06x : BRKCS %02x\n", activecpu_get_pc() - 3, ModRM); + logerror("PC=%06x : BRKCS %02x\n", cpu_get_pc(machine->activecpu) - 3, ModRM); nec_ICount -= 15; /* checked ! */ break; case 0x31: /* 0F 31 [mod:reg:r/m] - INS reg8,reg8 or INS reg8,imm4 */ ModRM = FETCH; - logerror("PC=%06x : INS ", activecpu_get_pc() - 2); + logerror("PC=%06x : INS ", cpu_get_pc(machine->activecpu) - 2); if (ModRM >= 0xc0) { tmp = I.regs.b[Mod_RM.RM.b[ModRM]]; @@ -739,7 +739,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ case 0x33: /* 0F 33 [mod:reg:r/m] - EXT reg8,reg8 or EXT reg8,imm4 */ ModRM = FETCH; - logerror("PC=%06x : EXT ", activecpu_get_pc() - 2); + logerror("PC=%06x : EXT ", cpu_get_pc(machine->activecpu) - 2); if (ModRM >= 0xc0) { tmp = I.regs.b[Mod_RM.RM.b[ModRM]]; @@ -823,7 +823,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ * * Clocks: 12 */ - logerror("PC=%06x : RETRBI\n", activecpu_get_pc() - 2); + logerror("PC=%06x : RETRBI\n", cpu_get_pc(machine->activecpu) - 2); nec_ICount -= 12; break; @@ -856,7 +856,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ */ ModRM = FETCH; - logerror("PC=%06x : TSCSW %02x\n", activecpu_get_pc() - 3, ModRM); + logerror("PC=%06x : TSCSW %02x\n", cpu_get_pc(machine->activecpu) - 3, ModRM); nec_ICount -= 11; break; @@ -889,7 +889,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ * Clocks: 11 */ ModRM = FETCH; - logerror("PC=%06x : MOVSPB %02x\n", activecpu_get_pc() - 3, ModRM); + logerror("PC=%06x : MOVSPB %02x\n", cpu_get_pc(machine->activecpu) - 3, ModRM); nec_ICount -= 11; break; @@ -917,7 +917,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ * * Clocks: N/A */ - logerror("PC=%06x : STOP\n", activecpu_get_pc() - 2); + logerror("PC=%06x : STOP\n", cpu_get_pc(machine->activecpu) - 2); nec_ICount -= 2; /* of course this is crap */ break; @@ -990,7 +990,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ */ ModRM = FETCH; - logerror("PC=%06x : BRKXA %02x\n", activecpu_get_pc() - 3, ModRM); + logerror("PC=%06x : BRKXA %02x\n", cpu_get_pc(machine->activecpu) - 3, ModRM); nec_ICount -= 12; break; @@ -1027,7 +1027,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ * Clocks: 12 */ ModRM = FETCH; - logerror("PC=%06x : RETXA %02x\n", activecpu_get_pc() - 3, ModRM); + logerror("PC=%06x : RETXA %02x\n", cpu_get_pc(machine->activecpu) - 3, ModRM); nec_ICount -= 12; break; @@ -1058,7 +1058,7 @@ static void PREFIXV30(_0fpre) (void) /* Opcode 0x0f */ */ ModRM = FETCH; nec_ICount -= 38; - logerror("PC=%06x : BRKEM %02x\n", activecpu_get_pc() - 3, ModRM); + logerror("PC=%06x : BRKEM %02x\n", cpu_get_pc(machine->activecpu) - 3, ModRM); PREFIXV30(_interrupt) (ModRM, 1); break; } @@ -1099,7 +1099,7 @@ static void PREFIXV30(_brkn) (void) /* Opcode 0x63 BRKN - Break to Native Mode unsigned int_vector; int_vector = FETCH; - logerror("PC=%06x : BRKN %02x\n", activecpu_get_pc() - 2, int_vector); + logerror("PC=%06x : BRKN %02x\n", cpu_get_pc(machine->activecpu) - 2, int_vector); } static void PREFIXV30(repc) (int flagval) @@ -1269,7 +1269,7 @@ static void PREFIXV30(_setalc) (void) /* Opcode 0xd6 */ */ I.regs.b[AL] = (CF) ? 0xff : 0x00; nec_ICount -= 3; // V30 - logerror("PC=%06x : SETALC\n", activecpu_get_pc() - 1); + logerror("PC=%06x : SETALC\n", cpu_get_pc(machine->activecpu) - 1); } #if 0 @@ -1306,6 +1306,6 @@ static void PREFIXV30(_brks) (void) /* Opcode 0xf1 - Break to Security Mode */ unsigned int_vector; int_vector = FETCH; - logerror("PC=%06x : BRKS %02x\n", activecpu_get_pc() - 2, int_vector); + logerror("PC=%06x : BRKS %02x\n", cpu_get_pc(machine->activecpu) - 2, int_vector); } #endif diff --git a/src/emu/cpu/i8x41/i8x41.c b/src/emu/cpu/i8x41/i8x41.c index 823c7a852ca..27c51e48c03 100644 --- a/src/emu/cpu/i8x41/i8x41.c +++ b/src/emu/cpu/i8x41/i8x41.c @@ -1180,7 +1180,7 @@ static CPU_SET_INFO( i8x41 ) break; case CPUINFO_INT_REGISTER + I8X41_STAT: - logerror("i8x41 #%d:%03x Setting STAT DBBI to %02x\n", cpu_getactivecpu(), PC, (UINT8)info->i); + logerror("i8x41 #%d:%03x Setting STAT DBBI to %02x\n", cpunum_get_active(), PC, (UINT8)info->i); /* writing status.. hmm, should we issue interrupts here too? */ STATE = info->i; break; @@ -1266,7 +1266,7 @@ CPU_GET_INFO( i8041 ) break; case CPUINFO_INT_REGISTER + I8X41_STAT: - logerror("i8x41 #%d:%03x Reading STAT %02x\n", cpu_getactivecpu(), PC, STATE); + logerror("i8x41 #%d:%03x Reading STAT %02x\n", cpunum_get_active(), PC, STATE); info->i = STATE; break; diff --git a/src/emu/cpu/i8x41/i8x41ops.c b/src/emu/cpu/i8x41/i8x41ops.c index ee93f203502..53086936542 100644 --- a/src/emu/cpu/i8x41/i8x41ops.c +++ b/src/emu/cpu/i8x41/i8x41ops.c @@ -10,7 +10,7 @@ ***********************************/ OP_HANDLER( illegal ) { - logerror("i8x41 #%d: illegal opcode at 0x%03x: %02x\n", cpu_getactivecpu(), PC, ROP(PC)); + logerror("i8x41 #%d: illegal opcode at 0x%03x: %02x\n", cpunum_get_active(), PC, ROP(PC)); } /*********************************** diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c index 276cf3e7dd1..7cf6d223e18 100644 --- a/src/emu/cpu/jaguar/jaguar.c +++ b/src/emu/cpu/jaguar/jaguar.c @@ -506,7 +506,7 @@ static CPU_EXECUTE( jaguargpu ) /* if we're halted, we shouldn't be here */ if (!(jaguar.ctrl[G_CTRL] & 1)) { - cpunum_set_input_line(Machine, cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); + cpunum_set_input_line(Machine, cpunum_get_active(), INPUT_LINE_HALT, ASSERT_LINE); return cycles; } @@ -518,7 +518,7 @@ static CPU_EXECUTE( jaguargpu ) change_pc(jaguar.PC); /* remember that we're executing */ - executing_cpu = cpu_getactivecpu(); + executing_cpu = cpunum_get_active(); /* core execution loop */ do @@ -552,7 +552,7 @@ static CPU_EXECUTE( jaguardsp ) /* if we're halted, we shouldn't be here */ if (!(jaguar.ctrl[G_CTRL] & 1)) { - cpunum_set_input_line(Machine, cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); + cpunum_set_input_line(Machine, cpunum_get_active(), INPUT_LINE_HALT, ASSERT_LINE); return cycles; } @@ -564,7 +564,7 @@ static CPU_EXECUTE( jaguardsp ) change_pc(jaguar.PC); /* remember that we're executing */ - executing_cpu = cpu_getactivecpu(); + executing_cpu = cpunum_get_active(); /* core execution loop */ do @@ -1299,12 +1299,12 @@ UINT32 jaguargpu_ctrl_r(int cpunum, offs_t offset) { UINT32 result; - if (LOG_GPU_IO) logerror("%08X/%d:GPU read register @ F021%02X\n", activecpu_get_previouspc(), cpu_getactivecpu(), offset * 4); + if (LOG_GPU_IO) logerror("%08X/%d:GPU read register @ F021%02X\n", cpu_get_previouspc(Machine->activecpu), cpunum_get_active(), offset * 4); /* switch to the target context */ - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); result = jaguar.ctrl[offset]; - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -1315,10 +1315,10 @@ void jaguargpu_ctrl_w(int cpunum, offs_t offset, UINT32 data, UINT32 mem_mask) UINT32 oldval, newval; if (LOG_GPU_IO && offset != G_HIDATA) - logerror("%08X/%d:GPU write register @ F021%02X = %08X\n", activecpu_get_previouspc(), cpu_getactivecpu(), offset * 4, data); + logerror("%08X/%d:GPU write register @ F021%02X = %08X\n", cpu_get_previouspc(Machine->activecpu), cpunum_get_active(), offset * 4, data); /* switch to the target context */ - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); /* remember the old and set the new */ oldval = jaguar.ctrl[offset]; @@ -1367,7 +1367,7 @@ void jaguargpu_ctrl_w(int cpunum, offs_t offset, UINT32 data, UINT32 mem_mask) if ((oldval ^ newval) & 0x01) { cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE); - if (cpu_getexecutingcpu() >= 0) + if (cpunum_get_executing() >= 0) cpu_yield(); } if (newval & 0x02) @@ -1395,7 +1395,7 @@ void jaguargpu_ctrl_w(int cpunum, offs_t offset, UINT32 data, UINT32 mem_mask) } /* restore old context */ - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -1409,12 +1409,12 @@ UINT32 jaguardsp_ctrl_r(int cpunum, offs_t offset) UINT32 result; if (LOG_DSP_IO && offset != D_FLAGS) - logerror("%08X/%d:DSP read register @ F1A1%02X\n", activecpu_get_previouspc(), cpu_getactivecpu(), offset * 4); + logerror("%08X/%d:DSP read register @ F1A1%02X\n", cpu_get_previouspc(Machine->activecpu), cpunum_get_active(), offset * 4); /* switch to the target context */ - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); result = jaguar.ctrl[offset]; - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -1425,10 +1425,10 @@ void jaguardsp_ctrl_w(int cpunum, offs_t offset, UINT32 data, UINT32 mem_mask) UINT32 oldval, newval; if (LOG_DSP_IO && offset != D_FLAGS) - logerror("%08X/%d:DSP write register @ F1A1%02X = %08X\n", activecpu_get_previouspc(), cpu_getactivecpu(), offset * 4, data); + logerror("%08X/%d:DSP write register @ F1A1%02X = %08X\n", cpu_get_previouspc(Machine->activecpu), cpunum_get_active(), offset * 4, data); /* switch to the target context */ - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); /* remember the old and set the new */ oldval = jaguar.ctrl[offset]; @@ -1478,7 +1478,7 @@ void jaguardsp_ctrl_w(int cpunum, offs_t offset, UINT32 data, UINT32 mem_mask) if ((oldval ^ newval) & 0x01) { cpunum_set_input_line(Machine, cpunum, INPUT_LINE_HALT, (newval & 1) ? CLEAR_LINE : ASSERT_LINE); - if (cpu_getexecutingcpu() >= 0) + if (cpunum_get_executing() >= 0) cpu_yield(); } if (newval & 0x02) @@ -1506,7 +1506,7 @@ void jaguardsp_ctrl_w(int cpunum, offs_t offset, UINT32 data, UINT32 mem_mask) } /* restore old context */ - cpuintrf_pop_context(); + cpu_pop_context(); } diff --git a/src/emu/cpu/konami/konami.c b/src/emu/cpu/konami/konami.c index c2683ad9a4f..12a704a3072 100644 --- a/src/emu/cpu/konami/konami.c +++ b/src/emu/cpu/konami/konami.c @@ -438,7 +438,7 @@ static void set_irq_line(int irqline, int state) { if (konami.nmi_state == state) return; konami.nmi_state = state; - LOG(("KONAMI#%d set_nmi_line %d\n", cpu_getactivecpu(), state)); + LOG(("KONAMI#%d set_nmi_line %d\n", cpunum_get_active(), state)); if( state == CLEAR_LINE ) return; /* if the stack was not yet initialized */ @@ -470,7 +470,7 @@ static void set_irq_line(int irqline, int state) } else if (irqline < 2) { - LOG(("KONAMI#%d set_irq_line %d, %d\n", cpu_getactivecpu(), irqline, state)); + LOG(("KONAMI#%d set_irq_line %d, %d\n", cpunum_get_active(), irqline, state)); konami.irq_state[irqline] = state; if (state == CLEAR_LINE) return; CHECK_IRQ_LINES; diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c index 86549bfb6fd..9801fe00ded 100644 --- a/src/emu/cpu/m37710/m37710.c +++ b/src/emu/cpu/m37710/m37710.c @@ -274,13 +274,13 @@ static TIMER_CALLBACK( m37710_timer_cb ) int curirq = M37710_LINE_TIMERA0 - which; int cpunum = param; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); timer_adjust_oneshot(m37710i_cpu.timers[which], m37710i_cpu.reload[which], cpunum); m37710i_cpu.m37710_regs[m37710_irq_levels[curirq]] |= 0x04; m37710_set_irq_line(curirq, PULSE_LINE); cpu_triggerint(machine, cpunum); - cpuintrf_pop_context(); + cpu_pop_context(); } static void m37710_external_tick(int timer, int state) @@ -315,7 +315,7 @@ static void m37710_external_tick(int timer, int state) static void m37710_recalc_timer(int timer) { - int cpunum = cpu_getactivecpu(); + int cpunum = cpunum_get_active(); int tval; static const int tcr[8] = { 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d }; attotime time; @@ -338,7 +338,7 @@ static void m37710_recalc_timer(int timer) switch (m37710i_cpu.m37710_regs[0x56+timer] & 0x3) { case 0: // timer mode - time = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(cpu_getactivecpu())), tscales[m37710i_cpu.m37710_regs[tcr[timer]]>>6]); + time = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(cpunum_get_active())), tscales[m37710i_cpu.m37710_regs[tcr[timer]]>>6]); time = attotime_mul(time, tval + 1); #if M37710_DEBUG @@ -373,7 +373,7 @@ static void m37710_recalc_timer(int timer) switch (m37710i_cpu.m37710_regs[0x56+timer] & 0x3) { case 0: // timer mode - time = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(cpu_getactivecpu())), tscales[m37710i_cpu.m37710_regs[tcr[timer]]>>6]); + time = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(cpunum_get_active())), tscales[m37710i_cpu.m37710_regs[tcr[timer]]>>6]); time = attotime_mul(time, tval + 1); #if M37710_DEBUG diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c index e27a8240fce..2e6249387b3 100644 --- a/src/emu/cpu/m6502/m4510.c +++ b/src/emu/cpu/m6502/m4510.c @@ -265,7 +265,7 @@ INLINE void m4510_take_irq(m4510_Regs *m4510) P = (P & ~F_D) | F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M4510#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M4510#%d takes IRQ ($%04x)\n", cpunum_get_active(), PCD)); /* call back the cpuintrf to let it clear the line */ if (m4510->irq_callback) (*m4510->irq_callback)(m4510->device, 0); CHANGE_PC; @@ -298,7 +298,7 @@ static CPU_EXECUTE( m4510 ) /* check if the I flag was just reset (interrupts enabled) */ if( m4510->after_cli ) { - LOG(("M4510#%d after_cli was >0", cpu_getactivecpu())); + LOG(("M4510#%d after_cli was >0", cpunum_get_active())); m4510->after_cli = 0; if (m4510->irq_state != CLEAR_LINE) { @@ -327,7 +327,7 @@ static void m4510_set_irq_line(m4510_Regs *m4510, int irqline, int state) m4510->nmi_state = state; if( state != CLEAR_LINE ) { - LOG(("M4510#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); + LOG(("M4510#%d set_nmi_line(ASSERT)\n", cpunum_get_active())); EAD = M4510_NMI_VEC; m4510->icount -= 7; PUSH(PCH); @@ -336,7 +336,7 @@ static void m4510_set_irq_line(m4510_Regs *m4510, int irqline, int state) P = (P & ~F_D) | F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M4510#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M4510#%d takes NMI ($%04x)\n", cpunum_get_active(), PCD)); CHANGE_PC; } } @@ -345,7 +345,7 @@ static void m4510_set_irq_line(m4510_Regs *m4510, int irqline, int state) m4510->irq_state = state; if( state != CLEAR_LINE ) { - LOG(("M4510#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); + LOG(("M4510#%d set_irq_line(ASSERT)\n", cpunum_get_active())); m4510->pending_irq = 1; } } diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c index be226c23a0b..964d4eef968 100644 --- a/src/emu/cpu/m6502/m6502.c +++ b/src/emu/cpu/m6502/m6502.c @@ -222,7 +222,7 @@ INLINE void m6502_take_irq(m6502_Regs *m6502) P |= F_I; /* set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M6502#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M6502#%d takes IRQ ($%04x)\n", cpunum_get_active(), PCD)); /* call back the cpuintrf to let it clear the line */ if (m6502->irq_callback) (*m6502->irq_callback)(m6502->device, 0); change_pc(PCD); @@ -255,7 +255,7 @@ static CPU_EXECUTE( m6502 ) /* check if the I flag was just reset (interrupts enabled) */ if( m6502->after_cli ) { - LOG(("M6502#%d after_cli was >0", cpu_getactivecpu())); + LOG(("M6502#%d after_cli was >0", cpunum_get_active())); m6502->after_cli = 0; if (m6502->irq_state != CLEAR_LINE) { @@ -293,7 +293,7 @@ static void m6502_set_irq_line(m6502_Regs *m6502, int irqline, int state) m6502->nmi_state = state; if( state != CLEAR_LINE ) { - LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpunum_get_active())); EAD = M6502_NMI_VEC; m6502->icount -= 2; PUSH(PCH); @@ -302,7 +302,7 @@ static void m6502_set_irq_line(m6502_Regs *m6502, int irqline, int state) P |= F_I; /* set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M6502#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M6502#%d takes NMI ($%04x)\n", cpunum_get_active(), PCD)); change_pc(PCD); } } @@ -312,7 +312,7 @@ static void m6502_set_irq_line(m6502_Regs *m6502, int irqline, int state) { if( m6502->so_state && !state ) { - LOG(( "M6502#%d set overflow\n", cpu_getactivecpu())); + LOG(( "M6502#%d set overflow\n", cpunum_get_active())); P|=F_V; } m6502->so_state=state; @@ -321,7 +321,7 @@ static void m6502_set_irq_line(m6502_Regs *m6502, int irqline, int state) m6502->irq_state = state; if( state != CLEAR_LINE ) { - LOG(( "M6502#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "M6502#%d set_irq_line(ASSERT)\n", cpunum_get_active())); m6502->pending_irq = 1; // m6502->pending_irq = 2; m6502->int_occured = m6502->icount; @@ -452,7 +452,7 @@ INLINE void m65c02_take_irq(m6502_Regs *m6502) P = (P & ~F_D) | F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M65c02#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M65c02#%d takes IRQ ($%04x)\n", cpunum_get_active(), PCD)); /* call back the cpuintrf to let it clear the line */ if (m6502->irq_callback) (*m6502->irq_callback)(m6502->device, 0); change_pc(PCD); @@ -486,7 +486,7 @@ static CPU_EXECUTE( m65c02 ) /* check if the I flag was just reset (interrupts enabled) */ if( m6502->after_cli ) { - LOG(("M6502#%d after_cli was >0", cpu_getactivecpu())); + LOG(("M6502#%d after_cli was >0", cpunum_get_active())); m6502->after_cli = 0; if (m6502->irq_state != CLEAR_LINE) { @@ -515,7 +515,7 @@ static void m65c02_set_irq_line(m6502_Regs *m6502, int irqline, int state) m6502->nmi_state = state; if( state != CLEAR_LINE ) { - LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpunum_get_active())); EAD = M6502_NMI_VEC; m6502->icount -= 2; PUSH(PCH); @@ -524,7 +524,7 @@ static void m65c02_set_irq_line(m6502_Regs *m6502, int irqline, int state) P = (P & ~F_D) | F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M6502#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M6502#%d takes NMI ($%04x)\n", cpunum_get_active(), PCD)); change_pc(PCD); } } @@ -585,7 +585,7 @@ INLINE void deco16_take_irq(m6502_Regs *m6502) P |= F_I; /* set I flag */ PCL = RDMEM(EAD+1); PCH = RDMEM(EAD); - LOG(("M6502#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M6502#%d takes IRQ ($%04x)\n", cpunum_get_active(), PCD)); /* call back the cpuintrf to let it clear the line */ if (m6502->irq_callback) (*m6502->irq_callback)(m6502->device, 0); change_pc(PCD); @@ -601,7 +601,7 @@ static void deco16_set_irq_line(m6502_Regs *m6502, int irqline, int state) m6502->nmi_state = state; if( state != CLEAR_LINE ) { - LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "M6502#%d set_nmi_line(ASSERT)\n", cpunum_get_active())); EAD = DECO16_NMI_VEC; m6502->icount -= 7; PUSH(PCH); @@ -610,7 +610,7 @@ static void deco16_set_irq_line(m6502_Regs *m6502, int irqline, int state) P |= F_I; /* set I flag */ PCL = RDMEM(EAD+1); PCH = RDMEM(EAD); - LOG(("M6502#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M6502#%d takes NMI ($%04x)\n", cpunum_get_active(), PCD)); change_pc(PCD); } } @@ -620,7 +620,7 @@ static void deco16_set_irq_line(m6502_Regs *m6502, int irqline, int state) { if( m6502->so_state && !state ) { - LOG(( "M6502#%d set overflow\n", cpu_getactivecpu())); + LOG(( "M6502#%d set overflow\n", cpunum_get_active())); P|=F_V; } m6502->so_state=state; @@ -629,7 +629,7 @@ static void deco16_set_irq_line(m6502_Regs *m6502, int irqline, int state) m6502->irq_state = state; if( state != CLEAR_LINE ) { - LOG(( "M6502#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "M6502#%d set_irq_line(ASSERT)\n", cpunum_get_active())); m6502->pending_irq = 1; } } @@ -661,7 +661,7 @@ static CPU_EXECUTE( deco16 ) /* check if the I flag was just reset (interrupts enabled) */ if( m6502->after_cli ) { - LOG(("M6502#%d after_cli was >0", cpu_getactivecpu())); + LOG(("M6502#%d after_cli was >0", cpunum_get_active())); m6502->after_cli = 0; if (m6502->irq_state != CLEAR_LINE) { diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c index 6a63a2b0eff..894ee943c1c 100644 --- a/src/emu/cpu/m6502/m6509.c +++ b/src/emu/cpu/m6502/m6509.c @@ -207,7 +207,7 @@ INLINE void m6509_take_irq( m6509_Regs *m6502) P |= F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M6509#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M6509#%d takes IRQ ($%04x)\n", cpunum_get_active(), PCD)); /* call back the cpuintrf to let it clear the line */ if (m6502->irq_callback) (*m6502->irq_callback)(m6502->device, 0); change_pc(PCD); @@ -241,7 +241,7 @@ static CPU_EXECUTE( m6509 ) /* check if the I flag was just reset (interrupts enabled) */ if( m6509->after_cli ) { - LOG(("M6509#%d after_cli was >0", cpu_getactivecpu())); + LOG(("M6509#%d after_cli was >0", cpunum_get_active())); m6509->after_cli = 0; if (m6509->irq_state != CLEAR_LINE) { @@ -272,7 +272,7 @@ static void m6509_set_irq_line(m6509_Regs *m6509, int irqline, int state) m6509->nmi_state = state; if( state != CLEAR_LINE ) { - LOG(( "M6509#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "M6509#%d set_nmi_line(ASSERT)\n", cpunum_get_active())); EAD = M6509_NMI_VEC; EAWH = PBWH; m6502->icount -= 2; @@ -282,7 +282,7 @@ static void m6509_set_irq_line(m6509_Regs *m6509, int irqline, int state) P |= F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M6509#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M6509#%d takes NMI ($%04x)\n", cpunum_get_active(), PCD)); change_pc(PCD); } } @@ -292,7 +292,7 @@ static void m6509_set_irq_line(m6509_Regs *m6509, int irqline, int state) { if( m6509->so_state && !state ) { - LOG(( "M6509#%d set overflow\n", cpu_getactivecpu())); + LOG(( "M6509#%d set overflow\n", cpunum_get_active())); P|=F_V; } m6509->so_state=state; @@ -301,7 +301,7 @@ static void m6509_set_irq_line(m6509_Regs *m6509, int irqline, int state) m6509->irq_state = state; if( state != CLEAR_LINE ) { - LOG(( "M6509#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "M6509#%d set_irq_line(ASSERT)\n", cpunum_get_active())); m6509->pending_irq = 1; } } diff --git a/src/emu/cpu/m6502/m65ce02.c b/src/emu/cpu/m6502/m65ce02.c index be9641d197c..4dd0b892bdc 100644 --- a/src/emu/cpu/m6502/m65ce02.c +++ b/src/emu/cpu/m6502/m65ce02.c @@ -151,7 +151,7 @@ INLINE void m65ce02_take_irq(void) P = (P & ~F_D) | F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M65ce02#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M65ce02#%d takes IRQ ($%04x)\n", cpunum_get_active(), PCD)); /* call back the cpuintrf to let it clear the line */ if (m65ce02.irq_callback) (*m65ce02.irq_callback)(m65ce02.device, 0); change_pc(PCD); @@ -182,7 +182,7 @@ static CPU_EXECUTE( m65ce02 ) /* check if the I flag was just reset (interrupts enabled) */ if( m65ce02.after_cli ) { - LOG(("M65ce02#%d after_cli was >0", cpu_getactivecpu())); + LOG(("M65ce02#%d after_cli was >0", cpunum_get_active())); m65ce02.after_cli = 0; if (m65ce02.irq_state != CLEAR_LINE) { @@ -211,7 +211,7 @@ static void m65ce02_set_irq_line(int irqline, int state) m65ce02.nmi_state = state; if( state != CLEAR_LINE ) { - LOG(("M65ce02#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); + LOG(("M65ce02#%d set_nmi_line(ASSERT)\n", cpunum_get_active())); EAD = M65CE02_NMI_VEC; m65ce02->icount -= 7; PUSH(PCH); @@ -220,7 +220,7 @@ static void m65ce02_set_irq_line(int irqline, int state) P = (P & ~F_D) | F_I; /* knock out D and set I flag */ PCL = RDMEM(EAD); PCH = RDMEM(EAD+1); - LOG(("M65ce02#%d takes NMI ($%04x)\n", cpu_getactivecpu(), PCD)); + LOG(("M65ce02#%d takes NMI ($%04x)\n", cpunum_get_active(), PCD)); change_pc(PCD); } } @@ -229,7 +229,7 @@ static void m65ce02_set_irq_line(int irqline, int state) m65ce02.irq_state = state; if( state != CLEAR_LINE ) { - LOG(("M65ce02#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); + LOG(("M65ce02#%d set_irq_line(ASSERT)\n", cpunum_get_active())); m65ce02.pending_irq = 1; } } diff --git a/src/emu/cpu/m6502/ops02.h b/src/emu/cpu/m6502/ops02.h index a5aac18fd9d..8fce6336366 100644 --- a/src/emu/cpu/m6502/ops02.h +++ b/src/emu/cpu/m6502/ops02.h @@ -626,7 +626,7 @@ if ( P & F_I ) { \ PULL(P); \ if ((m6502->irq_state != CLEAR_LINE) && !(P & F_I)) { \ - LOG(("M6502#%d PLP sets after_cli\n",cpu_getactivecpu())); \ + LOG(("M6502#%d PLP sets after_cli\n",cpunum_get_active())); \ m6502->after_cli = 1; \ } \ } else { \ @@ -668,7 +668,7 @@ P |= F_T | F_B; \ if( (m6502->irq_state != CLEAR_LINE) && !(P & F_I) ) \ { \ - LOG(("M6502#%d RTI sets after_cli\n",cpu_getactivecpu())); \ + LOG(("M6502#%d RTI sets after_cli\n",cpunum_get_active())); \ m6502->after_cli = 1; \ } \ CHANGE_PC diff --git a/src/emu/cpu/m6502/opsce02.h b/src/emu/cpu/m6502/opsce02.h index acf8ffe3016..f7280ef9c7a 100644 --- a/src/emu/cpu/m6502/opsce02.h +++ b/src/emu/cpu/m6502/opsce02.h @@ -289,7 +289,7 @@ t1=RDOPARG(); \ t2=RDOPARG(); \ t3=RDOPARG(); \ - logerror("m65ce02 at pc:%.4x reserved op aug %.2x %.2x %.2x\n", activecpu_get_pc(),t1,t2,t3); + logerror("m65ce02 at pc:%.4x reserved op aug %.2x %.2x %.2x\n", cpu_get_pc(machine->activecpu),t1,t2,t3); /* 65ce02 ****************************************************** * BBR Branch if bit is reset @@ -684,7 +684,7 @@ PULL(temp); \ P=(P&F_E)|F_B|(temp&~F_E); \ if( IRQ_STATE != CLEAR_LINE && !(P & F_I) ) { \ - LOG(("M65ce02#%d PLP sets after_cli\n", cpu_getactivecpu())); \ + LOG(("M65ce02#%d PLP sets after_cli\n", cpunum_get_active())); \ AFTER_CLI = 1; \ } \ } else { \ @@ -764,7 +764,7 @@ PULL(PCH); \ if( IRQ_STATE != CLEAR_LINE && !(P & F_I) ) \ { \ - LOG(("M65ce02#%d RTI sets after_cli\n", cpu_getactivecpu())); \ + LOG(("M65ce02#%d RTI sets after_cli\n", cpunum_get_active())); \ AFTER_CLI = 1; \ } \ CHANGE_PC @@ -797,7 +797,7 @@ PULL(PCL); \ PULL(PCH); \ if( IRQ_STATE != CLEAR_LINE && !(P & F_I) ) { \ - LOG(("M65ce02#%d RTI sets after_cli\n", cpu_getactivecpu())); \ + LOG(("M65ce02#%d RTI sets after_cli\n", cpunum_get_active())); \ AFTER_CLI = 1; \ } \ CHANGE_PC diff --git a/src/emu/cpu/m6502/tdeco16.c b/src/emu/cpu/m6502/tdeco16.c index fb78dc2d851..603387b340c 100644 --- a/src/emu/cpu/m6502/tdeco16.c +++ b/src/emu/cpu/m6502/tdeco16.c @@ -9,7 +9,7 @@ #define OP(nn) INLINE void deco16_##nn(m6502_Regs *m6502) #define DECO16_BRK \ - logerror("%04x: BRK\n",activecpu_get_pc()); \ + logerror("%04x: BRK\n",cpu_get_pc(Machine->activecpu)); \ RDOPARG(); \ PUSH(PCH); \ PUSH(PCL); \ @@ -89,7 +89,7 @@ OP(23) { RD_IMM; if (DECO16_VERBOSE) - logerror("%04x: OP23 %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OP23 %02x\n",cpu_get_pc(Machine->activecpu),tmp); } OP(43) { RD_DUM; ILL; } /* 2 ILL */ OP(63) { @@ -99,7 +99,7 @@ OP(63) { RD_IMM; if (DECO16_VERBOSE) - logerror("%04x: OP63 %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OP63 %02x\n",cpu_get_pc(Machine->activecpu),tmp); } OP(83) { RD_DUM; ILL; } /* 2 ILL */ OP(a3) { @@ -109,7 +109,7 @@ OP(a3) { RD_IMM; if (DECO16_VERBOSE) - logerror("%04x: OPA3 %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OPA3 %02x\n",cpu_get_pc(Machine->activecpu),tmp); } OP(c3) { RD_DUM; ILL; } /* 2 ILL */ OP(e3) { RD_DUM; ILL; } /* 2 ILL */ @@ -117,7 +117,7 @@ OP(e3) { RD_DUM; ILL; } /* 2 ILL */ OP(13) { int tmp; m6502->icount -= 1; RD_IMM; if (DECO16_VERBOSE) - logerror("%04x: OP13 %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OP13 %02x\n",cpu_get_pc(Machine->activecpu),tmp); //bank select control? @@ -191,13 +191,13 @@ OP(67) { int tmp; RD_IMM; m6502->a=io_read_byte_8le(0); -// logerror("%04x: VBL (0x67)\n",activecpu_get_pc()); +// logerror("%04x: VBL (0x67)\n",cpu_get_pc(Machine->activecpu)); // really - wait for status? } /* */ OP(87) { int tmp; m6502->icount -= 1; RD_IMM; - logerror("%04x: OP87 %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OP87 %02x\n",cpu_get_pc(Machine->activecpu),tmp); } /* */ OP(a7) { RD_DUM; ILL; } /* 2 ILL / 5 SMB2 ZPG ?? */ @@ -268,12 +268,12 @@ OP(f7) { RD_DUM; ILL; } /* 2 ILL / 5 SMB7 ZPG ?? */ #define deco16_fa m65c02_fa /* 4 PLX */ OP(0b) { int tmp; m6502->icount -= 1; RD_IMM; - logerror("%04x: OP0B %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OP0B %02x\n",cpu_get_pc(Machine->activecpu),tmp); } OP(2b) { RD_DUM; ILL; } /* 2 ILL */ OP(4b) { int tmp; m6502->icount -= 1; RD_IMM; - logerror("%04x: OP4B %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OP4B %02x\n",cpu_get_pc(Machine->activecpu),tmp); // m6502->a=io_read_byte_8le(0); @@ -301,7 +301,7 @@ OP(bb) { RD_IMM; if (DECO16_VERBOSE) - logerror("%04x: OPBB %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OPBB %02x\n",cpu_get_pc(Machine->activecpu),tmp); } OP(db) { RD_DUM; ILL; } /* 2 ILL */ OP(fb) { RD_DUM; ILL; } /* 2 ILL */ @@ -365,7 +365,7 @@ OP(2f) { RD_DUM; ILL; } /* 2 ILL / 5 BBR2 ZPG ?? */ OP(4f) { RD_DUM; ILL; } /* 2 ILL / 5 BBR4 ZPG ?? */ OP(6f) { RD_DUM; ILL; } /* 2 ILL / 5 BBR6 ZPG ?? */ OP(8f) { int tmp; m6502->icount -= 1; RD_IMM; - logerror("%04x: BANK (8F) %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: BANK (8F) %02x\n",cpu_get_pc(Machine->activecpu),tmp); io_write_byte_8le(0,tmp); @@ -384,7 +384,7 @@ OP(3f) { RD_IMM; if (DECO16_VERBOSE) - logerror("%04x: OP3F %02x\n",activecpu_get_pc(),tmp); + logerror("%04x: OP3F %02x\n",cpu_get_pc(Machine->activecpu),tmp); } OP(5f) { RD_DUM; ILL; } /* 2 ILL / 5 BBR5 ZPG ?? */ OP(7f) { RD_DUM; ILL; } /* 2 ILL / 5 BBR7 ZPG ?? */ diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c index 7116e2ffe2e..24b02f25562 100644 --- a/src/emu/cpu/m6800/m6800.c +++ b/src/emu/cpu/m6800/m6800.c @@ -524,7 +524,7 @@ INLINE void WM16( UINT32 Addr, PAIR *p ) /* IRQ enter */ static void ENTER_INTERRUPT(const char *message,UINT16 irq_vector) { - LOG((message, cpu_getactivecpu())); + LOG((message, cpunum_get_active())); if( m68xx.wai_state & (M6800_WAI|M6800_SLP) ) { if( m68xx.wai_state & M6800_WAI ) @@ -674,9 +674,9 @@ static TIMER_CALLBACK(m6800_tx_tick) // send stop bit '1' m68xx.tx = 1; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); CHECK_IRQ_LINES(); - cpuintrf_pop_context(); + cpu_pop_context(); m68xx.txbits = M6800_SERIAL_START; break; @@ -746,9 +746,9 @@ static TIMER_CALLBACK(m6800_rx_tick) m68xx.trcsr |= M6800_TRCSR_ORFE; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); CHECK_IRQ_LINES(); - cpuintrf_pop_context(); + cpu_pop_context(); } else { @@ -760,9 +760,9 @@ static TIMER_CALLBACK(m6800_rx_tick) // set RDRF flag m68xx.trcsr |= M6800_TRCSR_RDRF; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); CHECK_IRQ_LINES(); - cpuintrf_pop_context(); + cpu_pop_context(); } } } @@ -779,9 +779,9 @@ static TIMER_CALLBACK(m6800_rx_tick) m68xx.trcsr |= M6800_TRCSR_ORFE; m68xx.trcsr &= ~M6800_TRCSR_RDRF; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); CHECK_IRQ_LINES(); - cpuintrf_pop_context(); + cpu_pop_context(); } m68xx.rxbits = M6800_SERIAL_START; @@ -927,7 +927,7 @@ static void set_irq_line(int irqline, int state) if (irqline == INPUT_LINE_NMI) { if (m68xx.nmi_state == state) return; - LOG(("M6800#%d set_nmi_line %d \n", cpu_getactivecpu(), state)); + LOG(("M6800#%d set_nmi_line %d \n", cpunum_get_active(), state)); m68xx.nmi_state = state; if (state == CLEAR_LINE) return; @@ -939,7 +939,7 @@ static void set_irq_line(int irqline, int state) int eddge; if (m68xx.irq_state[irqline] == state) return; - LOG(("M6800#%d set_irq_line %d,%d\n", cpu_getactivecpu(), irqline, state)); + LOG(("M6800#%d set_irq_line %d,%d\n", cpunum_get_active(), irqline, state)); m68xx.irq_state[irqline] = state; switch(irqline) @@ -2348,7 +2348,7 @@ static READ8_HANDLER( m6803_internal_registers_r ) case 0x0e: return (m68xx.input_capture >> 8) & 0xff; case 0x0f: - logerror("CPU #%d PC %04x: warning - read from unsupported register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); + logerror("CPU #%d PC %04x: warning - read from unsupported register %02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset); return 0; case 0x10: return m68xx.rmcr; @@ -2365,7 +2365,7 @@ static READ8_HANDLER( m6803_internal_registers_r ) case 0x13: return m68xx.tdr; case 0x14: - logerror("CPU #%d PC %04x: read RAM control register\n",cpu_getactivecpu(),activecpu_get_pc()); + logerror("CPU #%d PC %04x: read RAM control register\n",cpunum_get_active(),cpu_get_pc(machine->activecpu)); return m68xx.ram_ctrl; case 0x15: case 0x16: @@ -2379,7 +2379,7 @@ static READ8_HANDLER( m6803_internal_registers_r ) case 0x1e: case 0x1f: default: - logerror("CPU #%d PC %04x: warning - read from reserved internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); + logerror("CPU #%d PC %04x: warning - read from reserved internal register %02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset); return 0; } } @@ -2412,7 +2412,7 @@ static WRITE8_HANDLER( m6803_internal_registers_w ) | (io_read_byte_8be(M6803_PORT2) & (m68xx.port2_ddr ^ 0xff))); if (m68xx.port2_ddr & 2) - logerror("CPU #%d PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",cpu_getactivecpu(),activecpu_get_pc()); + logerror("CPU #%d PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",cpunum_get_active(),cpu_get_pc(machine->activecpu)); } break; case 0x02: @@ -2511,10 +2511,10 @@ static WRITE8_HANDLER( m6803_internal_registers_w ) case 0x0d: case 0x0e: case 0x12: - logerror("CPU #%d PC %04x: warning - write %02x to read only internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + logerror("CPU #%d PC %04x: warning - write %02x to read only internal register %02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); break; case 0x0f: - logerror("CPU #%d PC %04x: warning - write %02x to unsupported internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + logerror("CPU #%d PC %04x: warning - write %02x to unsupported internal register %02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); break; case 0x10: m68xx.rmcr = data & 0x0f; @@ -2532,8 +2532,8 @@ static WRITE8_HANDLER( m6803_internal_registers_w ) { int divisor = M6800_RMCR_SS[m68xx.rmcr & M6800_RMCR_SS_MASK]; - timer_adjust_periodic(m6800_rx_timer, attotime_zero, cpu_getactivecpu(), ATTOTIME_IN_HZ(m68xx.clock / divisor)); - timer_adjust_periodic(m6800_tx_timer, attotime_zero, cpu_getactivecpu(), ATTOTIME_IN_HZ(m68xx.clock / divisor)); + timer_adjust_periodic(m6800_rx_timer, attotime_zero, cpunum_get_active(), ATTOTIME_IN_HZ(m68xx.clock / divisor)); + timer_adjust_periodic(m6800_tx_timer, attotime_zero, cpunum_get_active(), ATTOTIME_IN_HZ(m68xx.clock / divisor)); } break; } @@ -2554,7 +2554,7 @@ static WRITE8_HANDLER( m6803_internal_registers_w ) m68xx.tdr = data; break; case 0x14: - logerror("CPU #%d PC %04x: write %02x to RAM control register\n",cpu_getactivecpu(),activecpu_get_pc(),data); + logerror("CPU #%d PC %04x: write %02x to RAM control register\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data); m68xx.ram_ctrl = data; break; case 0x15: @@ -2569,7 +2569,7 @@ static WRITE8_HANDLER( m6803_internal_registers_w ) case 0x1e: case 0x1f: default: - logerror("CPU #%d PC %04x: warning - write %02x to reserved internal register %02x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + logerror("CPU #%d PC %04x: warning - write %02x to reserved internal register %02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); break; } } diff --git a/src/emu/cpu/m68000/m68k_in.c b/src/emu/cpu/m68000/m68k_in.c index c67eb07c972..252ec1e6b47 100644 --- a/src/emu/cpu/m68000/m68k_in.c +++ b/src/emu/cpu/m68000/m68k_in.c @@ -3284,7 +3284,7 @@ M68KMAKE_OP(callm, 32, ., .) REG_PC += 2; (void)ea; /* just to avoid an 'unused variable' warning */ M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, m68k_disassemble_quick(ADDRESS_68K(m68k, REG_PC - 2)))); return; } @@ -4362,7 +4362,7 @@ M68KMAKE_OP(cpbcc, 32, ., .) if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type)) { M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, m68k_disassemble_quick(ADDRESS_68K(m68k, REG_PC - 2)))); return; } @@ -4375,7 +4375,7 @@ M68KMAKE_OP(cpdbcc, 32, ., .) if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type)) { M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, m68k_disassemble_quick(ADDRESS_68K(m68k, REG_PC - 2)))); return; } @@ -4388,7 +4388,7 @@ M68KMAKE_OP(cpgen, 32, ., .) if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type)) { M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, m68k_disassemble_quick(ADDRESS_68K(m68k, REG_PC - 2)))); return; } @@ -4401,7 +4401,7 @@ M68KMAKE_OP(cpscc, 32, ., .) if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type)) { M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, m68k_disassemble_quick(ADDRESS_68K(m68k, REG_PC - 2)))); return; } @@ -4414,7 +4414,7 @@ M68KMAKE_OP(cptrapcc, 32, ., .) if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type)) { M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, m68k_disassemble_quick(ADDRESS_68K(m68k, REG_PC - 2)))); return; } @@ -9326,7 +9326,7 @@ M68KMAKE_OP(rtm, 32, ., .) { m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */ M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC - 2), m68k->ir, m68k_disassemble_quick(ADDRESS_68K(m68k, REG_PC - 2)))); return; } diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c index 7201d911fd0..c279a68a574 100644 --- a/src/emu/cpu/m68000/m68kcpu.c +++ b/src/emu/cpu/m68000/m68kcpu.c @@ -45,7 +45,7 @@ extern void m68040_fpu_op1(m68ki_cpu_core *m68k); /* ======================================================================== */ #ifdef M68K_LOG_ENABLE -const char *const m68ki_cpu_names[] = +const char *const m68ki_cpu_get_names[] = { "Invalid CPU", "M68000", diff --git a/src/emu/cpu/m68000/m68kcpu.h b/src/emu/cpu/m68000/m68kcpu.h index ea0fa72f06f..9e8ed325cb9 100644 --- a/src/emu/cpu/m68000/m68kcpu.h +++ b/src/emu/cpu/m68000/m68kcpu.h @@ -355,7 +355,7 @@ typedef struct _m68ki_cpu_core m68ki_cpu_core; #if M68K_LOG_ENABLE #include <stdio.h> extern FILE* M68K_LOG_FILEHANDLE - extern const char *const m68ki_cpu_names[]; + extern const char *const m68ki_cpu_get_names[]; #define M68K_DO_LOG(A) if(M68K_LOG_FILEHANDLE) fprintf A #if M68K_LOG_1010_1111 @@ -1625,7 +1625,7 @@ INLINE void m68ki_exception_1010(m68ki_cpu_core *m68k) UINT32 sr; #if M68K_LOG_1010_1111 == OPT_ON M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: called 1010 instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PPC), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PPC), m68k->ir, m68ki_disassemble_quick(ADDRESS_68K(m68k, REG_PPC)))); #endif @@ -1644,7 +1644,7 @@ INLINE void m68ki_exception_1111(m68ki_cpu_core *m68k) #if M68K_LOG_1010_1111 == OPT_ON M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: called 1111 instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PPC), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PPC), m68k->ir, m68ki_disassemble_quick(ADDRESS_68K(m68k, REG_PPC)))); #endif @@ -1662,7 +1662,7 @@ INLINE void m68ki_exception_illegal(m68ki_cpu_core *m68k) UINT32 sr; M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: illegal instruction %04x (%s)\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PPC), m68k->ir, + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PPC), m68k->ir, m68ki_disassemble_quick(ADDRESS_68K(m68k, REG_PPC)))); sr = m68ki_init_exception(m68k); @@ -1749,7 +1749,7 @@ void m68ki_exception_interrupt(m68ki_cpu_core *m68k, UINT32 int_level) else if(vector > 255) { M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: Interrupt acknowledge returned invalid vector $%x\n", - m68ki_cpu_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC), vector)); + m68ki_cpu_get_names[m68k->cpu_type], ADDRESS_68K(m68k, REG_PC), vector)); return; } diff --git a/src/emu/cpu/m68000/m68kmame.h b/src/emu/cpu/m68000/m68kmame.h index 12cce886481..dc926f41e95 100644 --- a/src/emu/cpu/m68000/m68kmame.h +++ b/src/emu/cpu/m68000/m68kmame.h @@ -70,8 +70,8 @@ INLINE unsigned int m68kx_read_immediate_32(m68ki_cpu_core *m68k, unsigned int a INLINE unsigned int m68kx_read_pcrelative_8(m68ki_cpu_core *m68k, unsigned int address) { - if (address >= m68k_encrypted_opcode_start[cpu_getactivecpu()] && - address < m68k_encrypted_opcode_end[cpu_getactivecpu()]) + if (address >= m68k_encrypted_opcode_start[cpunum_get_active()] && + address < m68k_encrypted_opcode_end[cpunum_get_active()]) return ((m68k_read_immediate_16(m68k, address&~1)>>(8*(1-(address & 1))))&0xff); else return m68k_read_memory_8(m68k, address); @@ -79,8 +79,8 @@ INLINE unsigned int m68kx_read_pcrelative_8(m68ki_cpu_core *m68k, unsigned int a INLINE unsigned int m68kx_read_pcrelative_16(m68ki_cpu_core *m68k, unsigned int address) { - if (address >= m68k_encrypted_opcode_start[cpu_getactivecpu()] && - address < m68k_encrypted_opcode_end[cpu_getactivecpu()]) + if (address >= m68k_encrypted_opcode_start[cpunum_get_active()] && + address < m68k_encrypted_opcode_end[cpunum_get_active()]) return m68k_read_immediate_16(m68k, address); else return m68k_read_memory_16(m68k, address); @@ -88,8 +88,8 @@ INLINE unsigned int m68kx_read_pcrelative_16(m68ki_cpu_core *m68k, unsigned int INLINE unsigned int m68kx_read_pcrelative_32(m68ki_cpu_core *m68k, unsigned int address) { - if (address >= m68k_encrypted_opcode_start[cpu_getactivecpu()] && - address < m68k_encrypted_opcode_end[cpu_getactivecpu()]) + if (address >= m68k_encrypted_opcode_start[cpunum_get_active()] && + address < m68k_encrypted_opcode_end[cpunum_get_active()]) return m68k_read_immediate_32(m68k, address); else return m68k_read_memory_32(m68k, address); diff --git a/src/emu/cpu/m6809/m6809.c b/src/emu/cpu/m6809/m6809.c index f62e20001fc..947ba43b2e4 100644 --- a/src/emu/cpu/m6809/m6809.c +++ b/src/emu/cpu/m6809/m6809.c @@ -468,7 +468,7 @@ static void set_irq_line(int irqline, int state) { if (m6809.nmi_state == state) return; m6809.nmi_state = state; - LOG(("M6809#%d set_irq_line (NMI) %d\n", cpu_getactivecpu(), state)); + LOG(("M6809#%d set_irq_line (NMI) %d\n", cpunum_get_active(), state)); if( state == CLEAR_LINE ) return; /* if the stack was not yet initialized */ @@ -500,7 +500,7 @@ static void set_irq_line(int irqline, int state) } else if (irqline < 2) { - LOG(("M6809#%d set_irq_line %d, %d\n", cpu_getactivecpu(), irqline, state)); + LOG(("M6809#%d set_irq_line %d, %d\n", cpunum_get_active(), irqline, state)); m6809.irq_state[irqline] = state; if (state == CLEAR_LINE) return; CHECK_IRQ_LINES(); diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c index 9a251c70456..ab31ace179a 100644 --- a/src/emu/cpu/mcs48/mcs48.c +++ b/src/emu/cpu/mcs48/mcs48.c @@ -216,7 +216,7 @@ INLINE UINT8 argument_fetch(offs_t address) INLINE void update_regptr(mcs48_state *mcs48) { - mcs48->regptr = memory_get_write_ptr(cpu_getactivecpu(), ADDRESS_SPACE_DATA, (PSW & B_FLAG) ? 24 : 0); + mcs48->regptr = memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_DATA, (PSW & B_FLAG) ? 24 : 0); } diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c index f889cf7fc1b..a4ff5013fc2 100644 --- a/src/emu/cpu/mcs51/mcs51.c +++ b/src/emu/cpu/mcs51/mcs51.c @@ -675,8 +675,8 @@ INLINE UINT8 r_psw(mcs51_state_t *mcs51_state) { return SFR_A(ADDR_PSW); } INLINE void update_ptrs(mcs51_state_t *mcs51_state) { - mcs51_state->internal_ram = memory_get_write_ptr(cpu_getactivecpu(), ADDRESS_SPACE_DATA, 0x00); - mcs51_state->sfr_ram = memory_get_write_ptr(cpu_getactivecpu(), ADDRESS_SPACE_DATA, 0x100); + mcs51_state->internal_ram = memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_DATA, 0x00); + mcs51_state->sfr_ram = memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_DATA, 0x100); } @@ -2006,7 +2006,7 @@ static void mcs51_sfr_write(mcs51_state_t *mcs51_state, size_t offset, UINT8 dat case ADDR_SCON: break; default: - LOG(("mcs51 #%d: attemping to write to an invalid/non-implemented SFR address: %zx at 0x%04x, data=%x\n", cpu_getactivecpu(), offset,PC,data)); + LOG(("mcs51 #%d: attemping to write to an invalid/non-implemented SFR address: %zx at 0x%04x, data=%x\n", cpunum_get_active(), offset,PC,data)); /* no write in this case according to manual */ return; } @@ -2046,7 +2046,7 @@ static UINT8 mcs51_sfr_read(mcs51_state_t *mcs51_state, size_t offset) return data_read_byte_8le((size_t) offset | 0x100); /* Illegal or non-implemented sfr */ default: - LOG(("mcs51 #%d: attemping to read an invalid/non-implemented SFR address: %zx at 0x%04x\n", cpu_getactivecpu(), offset,PC)); + LOG(("mcs51 #%d: attemping to read an invalid/non-implemented SFR address: %zx at 0x%04x\n", cpunum_get_active(), offset,PC)); /* according to the manual, the read may return random bits */ return 0xff; } @@ -2298,8 +2298,8 @@ static CPU_INIT( i80c31 ) #if 1 //#ifdef MCS51_TO_BE_ENABLED_LATER -#define DS5_LOGW(a, d) LOG(("ds5002fp #%d: write to " # a " register at 0x%04x, data=%x\n", cpu_getactivecpu(), PC, d)) -#define DS5_LOGR(a, d) LOG(("ds5002fp #%d: read from " # a " register at 0x%04x\n", cpu_getactivecpu(), PC)) +#define DS5_LOGW(a, d) LOG(("ds5002fp #%d: write to " # a " register at 0x%04x, data=%x\n", cpunum_get_active(), PC, d)) +#define DS5_LOGR(a, d) LOG(("ds5002fp #%d: read from " # a " register at 0x%04x\n", cpunum_get_active(), PC)) INLINE UINT8 ds5002fp_protected(mcs51_state_t *mcs51_state, size_t offset, UINT8 data, UINT8 ta_mask, UINT8 mask) { @@ -2325,7 +2325,7 @@ static void ds5002fp_sfr_write(mcs51_state_t *mcs51_state, size_t offset, UINT8 if ((data == 0xaa) && (mcs51_state->ds5002fp.ta_window == 0)) { mcs51_state->ds5002fp.ta_window = 6; /* 4*12 + 2*12 */ - LOG(("ds5002fp #%d: TA window initiated at 0x%04x\n", cpu_getactivecpu(), PC)); + LOG(("ds5002fp #%d: TA window initiated at 0x%04x\n", cpunum_get_active(), PC)); } break; case ADDR_MCON: data = ds5002fp_protected(mcs51_state, ADDR_MCON, data, 0x0f, 0xf7); DS5_LOGW(MCON, data); break; diff --git a/src/emu/cpu/mcs51/mcs51ops.c b/src/emu/cpu/mcs51/mcs51ops.c index c935a12e554..badf92e3011 100644 --- a/src/emu/cpu/mcs51/mcs51ops.c +++ b/src/emu/cpu/mcs51/mcs51ops.c @@ -995,5 +995,5 @@ OPHANDLER( xrl_a_r ) //illegal opcodes OPHANDLER( illegal ) { - LOG(("i8051 #%d: illegal opcode at 0x%03x: %02x\n", cpu_getactivecpu(), PC-1, r)); + LOG(("i8051 #%d: illegal opcode at 0x%03x: %02x\n", cpunum_get_active(), PC-1, r)); } diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c index ade6d3aea5c..a229c582203 100644 --- a/src/emu/cpu/mips/mips3com.c +++ b/src/emu/cpu/mips/mips3com.c @@ -89,7 +89,7 @@ void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, const mips->memory = *memory_get_accessors(ADDRESS_SPACE_PROGRAM, 32, mips->bigendian ? CPU_IS_BE : CPU_IS_LE); /* allocate the virtual TLB */ - mips->vtlb = vtlb_alloc(cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, 2 * MIPS3_TLB_ENTRIES + 2, 0); + mips->vtlb = vtlb_alloc(device, ADDRESS_SPACE_PROGRAM, 2 * MIPS3_TLB_ENTRIES + 2, 0); /* allocate a timer for the compare interrupt */ mips->compare_int_timer = timer_alloc(compare_int_callback, NULL); @@ -191,11 +191,11 @@ void mips3com_update_cycle_counting(mips3_state *mips) UINT32 count = (activecpu_gettotalcycles() - mips->count_zero_time) / 2; UINT32 compare = mips->cpr[0][COP0_Compare]; UINT32 delta = compare - count; - attotime newtime = ATTOTIME_IN_CYCLES(((UINT64)delta * 2), cpu_getactivecpu()); - timer_adjust_oneshot(mips->compare_int_timer, newtime, cpu_getactivecpu()); + attotime newtime = ATTOTIME_IN_CYCLES(((UINT64)delta * 2), cpunum_get_active()); + timer_adjust_oneshot(mips->compare_int_timer, newtime, cpunum_get_active()); return; } - timer_adjust_oneshot(mips->compare_int_timer, attotime_never, cpu_getactivecpu()); + timer_adjust_oneshot(mips->compare_int_timer, attotime_never, cpunum_get_active()); } diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c index 075c0552cee..34e25590092 100644 --- a/src/emu/cpu/mips/mips3drc.c +++ b/src/emu/cpu/mips/mips3drc.c @@ -430,7 +430,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, const device_config * /* initialize the front-end helper */ if (SINGLE_INSTRUCTION_MODE) feconfig.max_sequence = 1; - mips3->impstate->drcfe = drcfe_init(&feconfig, mips3); + mips3->impstate->drcfe = drcfe_init(device, &feconfig, mips3); /* allocate memory for cache-local state and initialize it */ memcpy(mips3->impstate->fpmode, fpmode_source, sizeof(fpmode_source)); @@ -767,7 +767,7 @@ static void code_compile_block(drcuml_state *drcuml, UINT8 mode, offs_t pc) } /* validate this code block if we're not pointing into ROM */ - if (memory_get_write_ptr(cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL) + if (memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL) generate_checksum_block(block, &compiler, seqhead, seqlast); /* label this instruction, if it may be jumped to locally */ diff --git a/src/emu/cpu/mips/mipsdasm.c b/src/emu/cpu/mips/mipsdasm.c index 94ac799d272..437e585c10b 100644 --- a/src/emu/cpu/mips/mipsdasm.c +++ b/src/emu/cpu/mips/mipsdasm.c @@ -4,6 +4,8 @@ */ #include "psx.h" +#include "driver.h" +#include "deprecat.h" static char *make_signed_hex_str_16( UINT32 value ) { @@ -122,10 +124,10 @@ static char *effective_address( UINT32 pc, UINT32 op ) { static char s_address[ 20 ]; #ifndef STANDALONE - if( pc == activecpu_get_pc() ) + if( pc == cpu_get_pc(Machine->activecpu) ) { sprintf( s_address, "%s(%s) ; 0x%08x", make_signed_hex_str_16( INS_IMMEDIATE( op ) ), s_cpugenreg[ INS_RS( op ) ], - (UINT32)( activecpu_get_reg( MIPS_R0 + INS_RS( op ) ) + (INT16)INS_IMMEDIATE( op ) ) ); + (UINT32)( cpu_get_reg( Machine->activecpu, MIPS_R0 + INS_RS( op ) ) + (INT16)INS_IMMEDIATE( op ) ) ); return s_address; } #endif @@ -137,9 +139,9 @@ static UINT32 relative_address( UINT32 pc, UINT32 op ) { UINT32 nextpc = pc + 4; #ifndef STANDALONE - if( pc == activecpu_get_pc() && activecpu_get_reg( MIPS_DELAYR ) == 32 ) + if( pc == cpu_get_pc(Machine->activecpu) && cpu_get_reg( Machine->activecpu, MIPS_DELAYR ) == 32 ) { - nextpc = activecpu_get_reg( MIPS_DELAYV ); + nextpc = cpu_get_reg( Machine->activecpu, MIPS_DELAYV ); } #endif return nextpc + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( op ) ) << 2 ); @@ -149,9 +151,9 @@ static UINT32 jump_address( UINT32 pc, UINT32 op ) { UINT32 nextpc = pc + 4; #ifndef STANDALONE - if( pc == activecpu_get_pc() && activecpu_get_reg( MIPS_DELAYR ) == 32 ) + if( pc == cpu_get_pc(Machine->activecpu) && cpu_get_reg( Machine->activecpu, MIPS_DELAYR ) == 32 ) { - nextpc = activecpu_get_reg( MIPS_DELAYV ); + nextpc = cpu_get_reg( Machine->activecpu, MIPS_DELAYV ); } #endif return ( nextpc & 0xf0000000 ) + ( INS_TARGET( op ) << 2 ); diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c index 659737b83cb..c059ef27025 100644 --- a/src/emu/cpu/mips/psx.c +++ b/src/emu/cpu/mips/psx.c @@ -581,11 +581,11 @@ static UINT32 log_bioscall_parameter( int parm ) { if( parm < 4 ) { - return activecpu_get_reg( MIPS_R4 + parm ); + return cpu_get_reg( Machine->activecpu, MIPS_R4 + parm ); } else { - return mipscpu.readword( activecpu_get_reg( MIPS_R29 ) + ( parm * 4 ) ); + return mipscpu.readword( cpu_get_reg( Machine->activecpu, MIPS_R29 ) + ( parm * 4 ) ); } } @@ -675,13 +675,13 @@ static const char *log_bioscall_char( int parm ) static void log_bioscall( void ) { - int address = activecpu_get_reg( MIPS_PC ) - 0x04; + int address = cpu_get_reg( Machine->activecpu, MIPS_PC ) - 0x04; if( address == 0xa0 || address == 0xb0 || address == 0xc0 ) { char buf[ 1024 ]; - int operation = activecpu_get_reg( MIPS_R9 ) & 0xff; + int operation = cpu_get_reg( Machine->activecpu, MIPS_R9 ) & 0xff; int bioscall = 0; if( ( address == 0xa0 && operation == 0x3c ) || @@ -907,14 +907,14 @@ static void log_bioscall( void ) { sprintf( buf, "unknown_%02x_%02x", address, operation ); } - logerror( "%08x: bioscall %s\n", (unsigned int)activecpu_get_reg( MIPS_R31 ) - 8, buf ); + logerror( "%08x: bioscall %s\n", (unsigned int)cpu_get_reg( Machine->activecpu, MIPS_R31 ) - 8, buf ); } } static void log_syscall( void ) { char buf[ 1024 ]; - int operation = activecpu_get_reg( MIPS_R4 ); + int operation = cpu_get_reg( Machine->activecpu, MIPS_R4 ); switch( operation ) { @@ -934,7 +934,7 @@ static void log_syscall( void ) sprintf( buf, "unknown_%02x", operation ); break; } - logerror( "%08x: syscall %s\n", (unsigned int)activecpu_get_reg( MIPS_R31 ) - 8, buf ); + logerror( "%08x: syscall %s\n", (unsigned int)cpu_get_reg( Machine->activecpu, MIPS_R31 ) - 8, buf ); } static UINT32 mips_cache_readword( UINT32 offset ) @@ -1251,7 +1251,7 @@ static WRITE32_HANDLER( psx_berr_w ) static void mips_update_scratchpad( running_machine *machine ) { - int cpu = cpu_getactivecpu(); + int cpu = cpunum_get_active(); if( ( mipscpu.biu & BIU_RAM ) == 0 ) { diff --git a/src/emu/cpu/nec/nec.c b/src/emu/cpu/nec/nec.c index 5658b33c34e..86a741d189b 100644 --- a/src/emu/cpu/nec/nec.c +++ b/src/emu/cpu/nec/nec.c @@ -431,13 +431,13 @@ OP( 0x0f, i_pre_nec ) { UINT32 ModRM, tmp, tmp2; case 0x26 : CMP4S; CLKS(7,7,2); break; case 0x28 : ModRM = FETCH(); tmp = GetRMByte(ModRM); tmp <<= 4; tmp |= I.regs.b[AL] & 0xf; I.regs.b[AL] = (I.regs.b[AL] & 0xf0) | ((tmp>>8)&0xf); tmp &= 0xff; PutbackRMByte(ModRM,tmp); CLKM(13,13,9,28,28,15); break; case 0x2a : ModRM = FETCH(); tmp = GetRMByte(ModRM); tmp2 = (I.regs.b[AL] & 0xf)<<4; I.regs.b[AL] = (I.regs.b[AL] & 0xf0) | (tmp&0xf); tmp = tmp2 | (tmp>>4); PutbackRMByte(ModRM,tmp); CLKM(17,17,13,32,32,19); break; - case 0x31 : ModRM = FETCH(); ModRM=0; logerror("%06x: Unimplemented bitfield INS\n",activecpu_get_pc()); break; - case 0x33 : ModRM = FETCH(); ModRM=0; logerror("%06x: Unimplemented bitfield EXT\n",activecpu_get_pc()); break; + case 0x31 : ModRM = FETCH(); ModRM=0; logerror("%06x: Unimplemented bitfield INS\n",cpu_get_pc(Machine->activecpu)); break; + case 0x33 : ModRM = FETCH(); ModRM=0; logerror("%06x: Unimplemented bitfield EXT\n",cpu_get_pc(Machine->activecpu)); break; case 0x92 : CLK(2); break; /* V25/35 FINT */ - case 0xe0 : ModRM = FETCH(); ModRM=0; logerror("%06x: V33 unimplemented BRKXA (break to expansion address)\n",activecpu_get_pc()); break; - case 0xf0 : ModRM = FETCH(); ModRM=0; logerror("%06x: V33 unimplemented RETXA (return from expansion address)\n",activecpu_get_pc()); break; - case 0xff : ModRM = FETCH(); ModRM=0; logerror("%06x: unimplemented BRKEM (break to 8080 emulation mode)\n",activecpu_get_pc()); break; - default: logerror("%06x: Unknown V20 instruction\n",activecpu_get_pc()); break; + case 0xe0 : ModRM = FETCH(); ModRM=0; logerror("%06x: V33 unimplemented BRKXA (break to expansion address)\n",cpu_get_pc(Machine->activecpu)); break; + case 0xf0 : ModRM = FETCH(); ModRM=0; logerror("%06x: V33 unimplemented RETXA (return from expansion address)\n",cpu_get_pc(Machine->activecpu)); break; + case 0xff : ModRM = FETCH(); ModRM=0; logerror("%06x: unimplemented BRKEM (break to 8080 emulation mode)\n",cpu_get_pc(Machine->activecpu)); break; + default: logerror("%06x: Unknown V20 instruction\n",cpu_get_pc(Machine->activecpu)); break; } } @@ -565,7 +565,7 @@ OP( 0x62, i_chkind ) { nec_interrupt(5,0); } nec_ICount-=20; - logerror("%06x: bound %04x high %04x low %04x tmp\n",activecpu_get_pc(),high,low,tmp); + logerror("%06x: bound %04x high %04x low %04x tmp\n",cpu_get_pc(Machine->activecpu),high,low,tmp); } OP( 0x63, i_brkn ) { nec_interrupt(FETCH(),1); CLKS(50,50,24); } // timing not verified, used by riskchal / gussun OP( 0x64, i_repnc ) { UINT32 next = fetchop(); UINT16 c = I.regs.w[CW]; @@ -591,7 +591,7 @@ OP( 0x64, i_repnc ) { UINT32 next = fetchop(); UINT16 c = I.regs.w[CW]; case 0xad: CLK(2); if (c) do { i_lodsw(); c--; } while (c>0 && !CF); I.regs.w[CW]=c; break; case 0xae: CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && !CF); I.regs.w[CW]=c; break; case 0xaf: CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && !CF); I.regs.w[CW]=c; break; - default: logerror("%06x: REPNC invalid\n",activecpu_get_pc()); nec_instruction[next](); + default: logerror("%06x: REPNC invalid\n",cpu_get_pc(Machine->activecpu)); nec_instruction[next](); } I.seg_prefix=FALSE; } @@ -619,7 +619,7 @@ OP( 0x65, i_repc ) { UINT32 next = fetchop(); UINT16 c = I.regs.w[CW]; case 0xad: CLK(2); if (c) do { i_lodsw(); c--; } while (c>0 && CF); I.regs.w[CW]=c; break; case 0xae: CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && CF); I.regs.w[CW]=c; break; case 0xaf: CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && CF); I.regs.w[CW]=c; break; - default: logerror("%06x: REPC invalid\n",activecpu_get_pc()); nec_instruction[next](); + default: logerror("%06x: REPC invalid\n",cpu_get_pc(Machine->activecpu)); nec_instruction[next](); } I.seg_prefix=FALSE; } @@ -723,7 +723,7 @@ OP( 0x8e, i_mov_sregw ) { UINT16 src; GetModRM; src = GetRMWord(ModRM); CLKR(15, case 0x08: I.sregs[PS] = src; break; /* mov cs,ew */ case 0x10: I.sregs[SS] = src; break; /* mov ss,ew */ case 0x18: I.sregs[DS0] = src; break; /* mov ds,ew */ - default: logerror("%06x: Mov Sreg - Invalid register\n",activecpu_get_pc()); + default: logerror("%06x: Mov Sreg - Invalid register\n",cpu_get_pc(Machine->activecpu)); } I.no_interrupt=1; } @@ -794,7 +794,7 @@ OP( 0xc0, i_rotshft_bd8 ) { case 0x18: do { RORC_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; case 0x20: SHL_BYTE(c); break; case 0x28: SHR_BYTE(c); break; - case 0x30: logerror("%06x: Undefined opcode 0xc0 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xc0 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_BYTE(c); break; } } @@ -811,7 +811,7 @@ OP( 0xc1, i_rotshft_wd8 ) { case 0x18: do { RORC_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; case 0x20: SHL_WORD(c); break; case 0x28: SHR_WORD(c); break; - case 0x30: logerror("%06x: Undefined opcode 0xc1 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xc1 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_WORD(c); break; } } @@ -861,7 +861,7 @@ OP( 0xd0, i_rotshft_b ) { case 0x18: RORC_BYTE; PutbackRMByte(ModRM,(BYTE)dst); I.OverVal = (src^dst)&0x80; break; case 0x20: SHL_BYTE(1); I.OverVal = (src^dst)&0x80; break; case 0x28: SHR_BYTE(1); I.OverVal = (src^dst)&0x80; break; - case 0x30: logerror("%06x: Undefined opcode 0xd0 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xd0 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_BYTE(1); I.OverVal = 0; break; } } @@ -876,7 +876,7 @@ OP( 0xd1, i_rotshft_w ) { case 0x18: RORC_WORD; PutbackRMWord(ModRM,(WORD)dst); I.OverVal = (src^dst)&0x8000; break; case 0x20: SHL_WORD(1); I.OverVal = (src^dst)&0x8000; break; case 0x28: SHR_WORD(1); I.OverVal = (src^dst)&0x8000; break; - case 0x30: logerror("%06x: Undefined opcode 0xd1 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xd1 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_WORD(1); I.OverVal = 0; break; } } @@ -892,7 +892,7 @@ OP( 0xd2, i_rotshft_bcl ) { case 0x18: do { RORC_BYTE; c--; CLK(1); } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; case 0x20: SHL_BYTE(c); break; case 0x28: SHR_BYTE(c); break; - case 0x30: logerror("%06x: Undefined opcode 0xd2 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xd2 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_BYTE(c); break; } } @@ -908,16 +908,16 @@ OP( 0xd3, i_rotshft_wcl ) { case 0x18: do { RORC_WORD; c--; CLK(1); } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; case 0x20: SHL_WORD(c); break; case 0x28: SHR_WORD(c); break; - case 0x30: logerror("%06x: Undefined opcode 0xd3 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xd3 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_WORD(c); break; } } OP( 0xd4, i_aam ) { UINT32 mult=FETCH(); mult=0; I.regs.b[AH] = I.regs.b[AL] / 10; I.regs.b[AL] %= 10; SetSZPF_Word(I.regs.w[AW]); CLKS(15,15,12); } OP( 0xd5, i_aad ) { UINT32 mult=FETCH(); mult=0; I.regs.b[AL] = I.regs.b[AH] * 10 + I.regs.b[AL]; I.regs.b[AH] = 0; SetSZPF_Byte(I.regs.b[AL]); CLKS(7,7,8); } -OP( 0xd6, i_setalc ) { I.regs.b[AL] = (CF)?0xff:0x00; nec_ICount-=3; logerror("%06x: Undefined opcode (SETALC)\n",activecpu_get_pc()); } +OP( 0xd6, i_setalc ) { I.regs.b[AL] = (CF)?0xff:0x00; nec_ICount-=3; logerror("%06x: Undefined opcode (SETALC)\n",cpu_get_pc(Machine->activecpu)); } OP( 0xd7, i_trans ) { UINT32 dest = (I.regs.w[BW]+I.regs.b[AL])&0xffff; I.regs.b[AL] = GetMemB(DS0, dest); CLKS(9,9,5); } -OP( 0xd8, i_fpo ) { GetModRM; nec_ICount-=2; logerror("%06x: Unimplemented floating point control %04x\n",activecpu_get_pc(),ModRM); } +OP( 0xd8, i_fpo ) { GetModRM; nec_ICount-=2; logerror("%06x: Unimplemented floating point control %04x\n",cpu_get_pc(Machine->activecpu),ModRM); } OP( 0xe0, i_loopne ) { INT8 disp = (INT8)FETCH(); I.regs.w[CW]--; if (!ZF && I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } OP( 0xe1, i_loope ) { INT8 disp = (INT8)FETCH(); I.regs.w[CW]--; if ( ZF && I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); /*CHANGE_PC;*/ CLKS(14,14,6); } else CLKS(5,5,3); } @@ -937,7 +937,7 @@ OP( 0xed, i_inaxdx ) { I.regs.w[AW] = read_port_word(I.regs.w[DW]); CLKW(12,12 OP( 0xee, i_outdxal ) { write_port_byte(I.regs.w[DW], I.regs.b[AL]); CLKS(8,8,3); } OP( 0xef, i_outdxax ) { write_port_word(I.regs.w[DW], I.regs.w[AW]); CLKW(12,12,5,12,8,3,I.regs.w[DW]); } -OP( 0xf0, i_lock ) { logerror("%06x: Warning - BUSLOCK\n",activecpu_get_pc()); I.no_interrupt=1; CLK(2); } +OP( 0xf0, i_lock ) { logerror("%06x: Warning - BUSLOCK\n",cpu_get_pc(Machine->activecpu)); I.no_interrupt=1; CLK(2); } OP( 0xf2, i_repne ) { UINT32 next = fetchop(); UINT16 c = I.regs.w[CW]; switch(next) { /* Segments */ case 0x26: I.seg_prefix=TRUE; I.prefix_base=I.sregs[DS1]<<4; next = fetchop(); CLK(2); break; @@ -961,7 +961,7 @@ OP( 0xf2, i_repne ) { UINT32 next = fetchop(); UINT16 c = I.regs.w[CW]; case 0xad: CLK(2); if (c) do { i_lodsw(); c--; } while (c>0); I.regs.w[CW]=c; break; case 0xae: CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && ZF==0); I.regs.w[CW]=c; break; case 0xaf: CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && ZF==0); I.regs.w[CW]=c; break; - default: logerror("%06x: REPNE invalid\n",activecpu_get_pc()); nec_instruction[next](); + default: logerror("%06x: REPNE invalid\n",cpu_get_pc(Machine->activecpu)); nec_instruction[next](); } I.seg_prefix=FALSE; } @@ -988,17 +988,17 @@ OP( 0xf3, i_repe ) { UINT32 next = fetchop(); UINT16 c = I.regs.w[CW]; case 0xad: CLK(2); if (c) do { i_lodsw(); c--; } while (c>0); I.regs.w[CW]=c; break; case 0xae: CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && ZF==1); I.regs.w[CW]=c; break; case 0xaf: CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && ZF==1); I.regs.w[CW]=c; break; - default: logerror("%06x: REPE invalid\n",activecpu_get_pc()); nec_instruction[next](); + default: logerror("%06x: REPE invalid\n",cpu_get_pc(Machine->activecpu)); nec_instruction[next](); } I.seg_prefix=FALSE; } -OP( 0xf4, i_hlt ) { logerror("%06x: HALT\n",activecpu_get_pc()); nec_ICount=0; } +OP( 0xf4, i_hlt ) { logerror("%06x: HALT\n",cpu_get_pc(Machine->activecpu)); nec_ICount=0; } OP( 0xf5, i_cmc ) { I.CarryVal = !CF; CLK(2); } OP( 0xf6, i_f6pre ) { UINT32 tmp; UINT32 uresult,uresult2; INT32 result,result2; GetModRM; tmp = GetRMByte(ModRM); switch (ModRM & 0x38) { case 0x00: tmp &= FETCH(); I.CarryVal = I.OverVal = 0; SetSZPF_Byte(tmp); nec_ICount-=(ModRM >=0xc0 )?4:11; break; /* TEST */ - case 0x08: logerror("%06x: Undefined opcode 0xf6 0x08\n",activecpu_get_pc()); break; + case 0x08: logerror("%06x: Undefined opcode 0xf6 0x08\n",cpu_get_pc(Machine->activecpu)); break; case 0x10: PutbackRMByte(ModRM,~tmp); nec_ICount-=(ModRM >=0xc0 )?2:16; break; /* NOT */ case 0x18: I.CarryVal=(tmp!=0); tmp=(~tmp)+1; SetSZPF_Byte(tmp); PutbackRMByte(ModRM,tmp&0xff); nec_ICount-=(ModRM >=0xc0 )?2:16; break; /* NEG */ case 0x20: uresult = I.regs.b[AL]*tmp; I.regs.w[AW]=(WORD)uresult; I.CarryVal=I.OverVal=(I.regs.b[AH]!=0); nec_ICount-=(ModRM >=0xc0 )?30:36; break; /* MULU */ @@ -1012,7 +1012,7 @@ OP( 0xf7, i_f7pre ) { UINT32 tmp,tmp2; UINT32 uresult,uresult2; INT32 result,r GetModRM; tmp = GetRMWord(ModRM); switch (ModRM & 0x38) { case 0x00: tmp2 = FETCHWORD(); tmp &= tmp2; I.CarryVal = I.OverVal = 0; SetSZPF_Word(tmp); nec_ICount-=(ModRM >=0xc0 )?4:11; break; /* TEST */ - case 0x08: logerror("%06x: Undefined opcode 0xf7 0x08\n",activecpu_get_pc()); break; + case 0x08: logerror("%06x: Undefined opcode 0xf7 0x08\n",cpu_get_pc(Machine->activecpu)); break; case 0x10: PutbackRMWord(ModRM,~tmp); nec_ICount-=(ModRM >=0xc0 )?2:16; break; /* NOT */ case 0x18: I.CarryVal=(tmp!=0); tmp=(~tmp)+1; SetSZPF_Word(tmp); PutbackRMWord(ModRM,tmp&0xffff); nec_ICount-=(ModRM >=0xc0 )?2:16; break; /* NEG */ case 0x20: uresult = I.regs.w[AW]*tmp; I.regs.w[AW]=uresult&0xffff; I.regs.w[DW]=((UINT32)uresult)>>16; I.CarryVal=I.OverVal=(I.regs.w[DW]!=0); nec_ICount-=(ModRM >=0xc0 )?30:36; break; /* MULU */ @@ -1032,7 +1032,7 @@ OP( 0xfe, i_fepre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMByte(ModRM); switch(ModRM & 0x38) { case 0x00: tmp1 = tmp+1; I.OverVal = (tmp==0x7f); SetAF(tmp1,tmp,1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM,(BYTE)tmp1); CLKM(2,2,2,16,16,7); break; /* INC */ case 0x08: tmp1 = tmp-1; I.OverVal = (tmp==0x80); SetAF(tmp1,tmp,1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM,(BYTE)tmp1); CLKM(2,2,2,16,16,7); break; /* DEC */ - default: logerror("%06x: FE Pre with unimplemented mod\n",activecpu_get_pc()); + default: logerror("%06x: FE Pre with unimplemented mod\n",cpu_get_pc(Machine->activecpu)); } } OP( 0xff, i_ffpre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMWord(ModRM); @@ -1044,14 +1044,14 @@ OP( 0xff, i_ffpre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMWord(ModRM); case 0x20: I.ip = tmp; CHANGE_PC; nec_ICount-=13; break; /* JMP */ case 0x28: I.ip = tmp; I.sregs[PS] = GetnextRMWord; CHANGE_PC; nec_ICount-=15; break; /* JMP FAR */ case 0x30: PUSH(tmp); nec_ICount-=4; break; - default: logerror("%06x: FF Pre with unimplemented mod\n",activecpu_get_pc()); + default: logerror("%06x: FF Pre with unimplemented mod\n",cpu_get_pc(Machine->activecpu)); } } static void i_invalid(void) { nec_ICount-=10; - logerror("%06x: Invalid Opcode\n",activecpu_get_pc()); + logerror("%06x: Invalid Opcode\n",cpu_get_pc(Machine->activecpu)); } /*****************************************************************************/ diff --git a/src/emu/cpu/nec/nec.h b/src/emu/cpu/nec/nec.h index a4d5ddb5597..1e685cda93d 100644 --- a/src/emu/cpu/nec/nec.h +++ b/src/emu/cpu/nec/nec.h @@ -303,7 +303,7 @@ typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,IXH,IXL,IYH,IYL } BREGS; unsigned di = I.regs.w[IY]; \ unsigned si = I.regs.w[IX]; \ static const UINT8 table[3]={18,19,19}; \ - if (I.seg_prefix) logerror("%06x: Warning: seg_prefix defined for add4s\n",activecpu_get_pc()); \ + if (I.seg_prefix) logerror("%06x: Warning: seg_prefix defined for add4s\n",cpu_get_pc(Machine->activecpu)); \ I.ZeroVal = I.CarryVal = 0; \ for (i=0;i<count;i++) { \ nec_ICount-=table[I.chip_type/8]; \ @@ -328,7 +328,7 @@ typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,IXH,IXL,IYH,IYL } BREGS; unsigned di = I.regs.w[IY]; \ unsigned si = I.regs.w[IX]; \ static const UINT8 table[3]={18,19,19}; \ - if (I.seg_prefix) logerror("%06x: Warning: seg_prefix defined for sub4s\n",activecpu_get_pc()); \ + if (I.seg_prefix) logerror("%06x: Warning: seg_prefix defined for sub4s\n",cpu_get_pc(Machine->activecpu)); \ I.ZeroVal = I.CarryVal = 0; \ for (i=0;i<count;i++) { \ nec_ICount-=table[I.chip_type/8]; \ @@ -358,7 +358,7 @@ typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,IXH,IXL,IYH,IYL } BREGS; unsigned di = I.regs.w[IY]; \ unsigned si = I.regs.w[IX]; \ static const UINT8 table[3]={14,19,19}; \ - if (I.seg_prefix) logerror("%06x: Warning: seg_prefix defined for cmp4s\n",activecpu_get_pc()); \ + if (I.seg_prefix) logerror("%06x: Warning: seg_prefix defined for cmp4s\n",cpu_get_pc(Machine->activecpu)); \ I.ZeroVal = I.CarryVal = 0; \ for (i=0;i<count;i++) { \ nec_ICount-=table[I.chip_type/8]; \ diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c index 3c591d36825..8650e681567 100644 --- a/src/emu/cpu/pdp1/pdp1.c +++ b/src/emu/cpu/pdp1/pdp1.c @@ -1706,7 +1706,7 @@ static void null_iot(int op2, int nac, int mb, int *io, int ac) if (LOG_IOT_EXTRA) { if (op2 == 000) - logerror("IOT sync instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); + logerror("IOT sync instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpu_get_reg(Machine->cpu[0], PDP1_PC)); } if (LOG) { diff --git a/src/emu/cpu/pdp1/pdp1.h b/src/emu/cpu/pdp1/pdp1.h index bd441a5bc43..0e42c7700f8 100644 --- a/src/emu/cpu/pdp1/pdp1.h +++ b/src/emu/cpu/pdp1/pdp1.h @@ -20,8 +20,8 @@ enum PDP1_IO_COMPLETE /* hack, do not use directly, use pdp1_pulse_iot_done instead */ }; -#define pdp1_pulse_start_clear() cpunum_set_reg(0, PDP1_START_CLEAR, 0) -#define pdp1_pulse_iot_done() cpunum_set_reg(0, PDP1_IO_COMPLETE, 0) +#define pdp1_pulse_start_clear() cpu_set_reg(machine->cpu[0], PDP1_START_CLEAR, 0) +#define pdp1_pulse_iot_done() cpu_set_reg(machine->cpu[0], PDP1_IO_COMPLETE, 0) typedef struct _pdp1_reset_param_t pdp1_reset_param_t; struct _pdp1_reset_param_t diff --git a/src/emu/cpu/pdp1/tx0.h b/src/emu/cpu/pdp1/tx0.h index 109c71720cc..dd90fd6690b 100644 --- a/src/emu/cpu/pdp1/tx0.h +++ b/src/emu/cpu/pdp1/tx0.h @@ -21,8 +21,8 @@ enum TX0_IO_COMPLETE /* hack, do not use directly, use tx0_pulse_io_complete instead */ }; -#define tx0_pulse_reset() cpunum_set_reg(0, TX0_RESET, 0) -#define tx0_pulse_io_complete() cpunum_set_reg(0, TX0_IO_COMPLETE, 0) +#define tx0_pulse_reset() cpu_set_reg(machine->cpu[0], TX0_RESET, 0) +#define tx0_pulse_io_complete() cpu_set_reg(machine->cpu[0], TX0_IO_COMPLETE, 0) typedef struct _tx0_reset_param_t tx0_reset_param_t; struct _tx0_reset_param_t diff --git a/src/emu/cpu/powerpc/drc_ops.c b/src/emu/cpu/powerpc/drc_ops.c index 481bfde74b6..0042a7e7f43 100644 --- a/src/emu/cpu/powerpc/drc_ops.c +++ b/src/emu/cpu/powerpc/drc_ops.c @@ -56,7 +56,7 @@ static void ppcdrc_init(void) drconfig.cb_entrygen = ppcdrc_entrygen; /* initialize the compiler */ - ppc.drc = drc_init(cpu_getactivecpu(), &drconfig); + ppc.drc = drc_init(cpunum_get_active(), &drconfig); ppc.drcoptions = 0; } @@ -132,7 +132,7 @@ static UINT32 *ppcdrc_getopptr(UINT32 address) address &= ~0x07; } - result = (UINT32 *) memory_get_op_ptr(Machine, cpu_getactivecpu(), address, 0); + result = (UINT32 *) memory_get_op_ptr(Machine, cpunum_get_active(), address, 0); if (result) result += offset; return result; diff --git a/src/emu/cpu/powerpc/ppc.h b/src/emu/cpu/powerpc/ppc.h index 6aa5c44c964..4beb637927e 100644 --- a/src/emu/cpu/powerpc/ppc.h +++ b/src/emu/cpu/powerpc/ppc.h @@ -192,15 +192,15 @@ CPU_GET_INFO( mpc8240 ); INLINE FUNCTIONS ***************************************************************************/ -INLINE void ppc4xx_spu_set_tx_handler(int cpunum, ppc4xx_spu_tx_handler handler) +INLINE void ppc4xx_spu_set_tx_handler(const device_config *cpu, ppc4xx_spu_tx_handler handler) { - cpunum_set_info_fct(cpunum, CPUINFO_PTR_SPU_TX_HANDLER, (genf *)handler); + cpu_set_info_fct(cpu, CPUINFO_PTR_SPU_TX_HANDLER, (genf *)handler); } -INLINE void ppc4xx_spu_receive_byte(int cpunum, UINT8 byteval) +INLINE void ppc4xx_spu_receive_byte(const device_config *cpu, UINT8 byteval) { - cpunum_set_info_int(cpunum, CPUINFO_INT_PPC_RX_DATA, byteval); + cpu_set_info_int(cpu, CPUINFO_INT_PPC_RX_DATA, byteval); } diff --git a/src/emu/cpu/powerpc/ppc403.c b/src/emu/cpu/powerpc/ppc403.c index 499a1e233b3..e4d00a90cbf 100644 --- a/src/emu/cpu/powerpc/ppc403.c +++ b/src/emu/cpu/powerpc/ppc403.c @@ -678,7 +678,7 @@ static void ppc403_spu_w(UINT32 a, UINT8 d) case 0x9: ppc.spu.sptb = d; - ppc403_spu_tx_callback(NULL/* Machine */, NULL, cpu_getactivecpu()); + ppc403_spu_tx_callback(NULL/* Machine */, NULL, cpunum_get_active()); break; default: diff --git a/src/emu/cpu/powerpc/ppc_mem.c b/src/emu/cpu/powerpc/ppc_mem.c index ebbb1ac76dd..39bc526dc7b 100644 --- a/src/emu/cpu/powerpc/ppc_mem.c +++ b/src/emu/cpu/powerpc/ppc_mem.c @@ -209,7 +209,7 @@ static int ppc_translate_address(offs_t *addr_ptr, int flags) | (((ppc.sdr1 & 0x01FF) & (hash >> 10)) << 16) | ((hash & 0x03FF) << 6); - pteg_ptr[hash_type] = memory_get_read_ptr(cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, pteg_address); + pteg_ptr[hash_type] = memory_get_read_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, pteg_address); if (pteg_ptr[hash_type]) { for (i = 0; i < 8; i++) diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c index 6b578489696..212305ddbb2 100644 --- a/src/emu/cpu/powerpc/ppccom.c +++ b/src/emu/cpu/powerpc/ppccom.c @@ -190,7 +190,7 @@ void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_di /* initialize based on the config */ memset(ppc, 0, sizeof(*ppc)); - ppc->cpunum = cpu_getactivecpu(); + ppc->cpunum = cpunum_get_active(); ppc->flavor = flavor; ppc->cap = cap; ppc->cache_line_size = 32; @@ -202,7 +202,7 @@ void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_di ppc->tb_divisor = (ppc->tb_divisor * clock + ppc->system_clock / 2 - 1) / ppc->system_clock; /* allocate the virtual TLB */ - ppc->vtlb = vtlb_alloc(cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, (cap & PPCCAP_603_MMU) ? PPC603_FIXED_TLB_ENTRIES : 0, POWERPC_TLB_ENTRIES); + ppc->vtlb = vtlb_alloc(device, ADDRESS_SPACE_PROGRAM, (cap & PPCCAP_603_MMU) ? PPC603_FIXED_TLB_ENTRIES : 0, POWERPC_TLB_ENTRIES); /* allocate a timer for the compare interrupt */ if (cap & PPCCAP_OEA) @@ -429,7 +429,7 @@ static UINT32 ppccom_translate_address_internal(powerpc_state *ppc, int intentio for (hashnum = 0; hashnum < 2; hashnum++) { offs_t ptegaddr = hashbase | ((hash << 6) & hashmask); - UINT32 *ptegptr = memory_get_read_ptr(cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, ptegaddr); + UINT32 *ptegptr = memory_get_read_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, ptegaddr); /* should only have valid memory here, but make sure */ if (ptegptr != NULL) @@ -1378,10 +1378,10 @@ static int ppc4xx_dma_fetch_transmit_byte(powerpc_state *ppc, int dmachan, UINT8 return FALSE; /* fetch the data */ - cpuintrf_push_context(ppc->cpunum); + cpu_push_context(Machine->cpu[ppc->cpunum]); *byte = program_read_byte(dmaregs[DCR4XX_DMADA0]++); ppc4xx_dma_decrement_count(ppc, dmachan); - cpuintrf_pop_context(); + cpu_pop_context(); return TRUE; } @@ -1404,10 +1404,10 @@ static int ppc4xx_dma_handle_receive_byte(powerpc_state *ppc, int dmachan, UINT8 return FALSE; /* store the data */ - cpuintrf_push_context(ppc->cpunum); + cpu_push_context(Machine->cpu[ppc->cpunum]); program_write_byte(dmaregs[DCR4XX_DMADA0]++, byte); ppc4xx_dma_decrement_count(ppc, dmachan); - cpuintrf_pop_context(); + cpu_pop_context(); return TRUE; } @@ -1723,7 +1723,7 @@ updateirq: static READ8_HANDLER( ppc4xx_spu_r ) { - powerpc_state *ppc = activecpu_get_info_ptr(CPUINFO_PTR_CONTEXT); + powerpc_state *ppc = cpu_get_info_ptr(machine->activecpu, CPUINFO_PTR_CONTEXT); UINT8 result = 0xff; switch (offset) @@ -1750,7 +1750,7 @@ static READ8_HANDLER( ppc4xx_spu_r ) static WRITE8_HANDLER( ppc4xx_spu_w ) { - powerpc_state *ppc = activecpu_get_info_ptr(CPUINFO_PTR_CONTEXT); + powerpc_state *ppc = cpu_get_info_ptr(machine->activecpu, CPUINFO_PTR_CONTEXT); UINT8 oldstate, newstate; if (PRINTF_SPU) diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c index 5bda5a0f537..e92427415df 100644 --- a/src/emu/cpu/powerpc/ppcdrc.c +++ b/src/emu/cpu/powerpc/ppcdrc.c @@ -622,7 +622,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, const /* initialize the front-end helper */ if (SINGLE_INSTRUCTION_MODE) feconfig.max_sequence = 1; - ppc->impstate->drcfe = drcfe_init(&feconfig, ppc); + ppc->impstate->drcfe = drcfe_init(device, &feconfig, ppc); /* initialize the implementation state tables */ memcpy(ppc->impstate->fpmode, fpmode_source, sizeof(fpmode_source)); @@ -976,7 +976,7 @@ static void code_compile_block(drcuml_state *drcuml, UINT8 mode, offs_t pc) } /* validate this code block if we're not pointing into ROM */ - if (memory_get_write_ptr(cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL) + if (memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL) generate_checksum_block(block, &compiler, seqhead, seqlast); // <checksum> /* label this instruction, if it may be jumped to locally */ @@ -1437,7 +1437,7 @@ static void static_generate_memory_accessor(drcuml_state *drcuml, int mode, int /* on entry, address is in I0; data for writes is in I1; masks are in I2 */ /* on exit, read result is in I0 */ /* routine trashes I0-I3 */ - int fastxor = BYTE8_XOR_BE(0) >> (activecpu_databus_width(ADDRESS_SPACE_PROGRAM) < 64); + int fastxor = BYTE8_XOR_BE(0) >> (cpu_get_databus_width(Machine->activecpu, ADDRESS_SPACE_PROGRAM) < 64); drcuml_block *block; jmp_buf errorbuf; int translate_type; diff --git a/src/emu/cpu/saturn/satops.c b/src/emu/cpu/saturn/satops.c index dd95f5cb600..7032f7f4ce5 100644 --- a/src/emu/cpu/saturn/satops.c +++ b/src/emu/cpu/saturn/satops.c @@ -1,7 +1,7 @@ #define IRQ_ADDRESS 0xf #define saturn_assert(x) \ - do { if (!(x)) logerror("SATURN%d assertion failed: %s at %s:%i, pc=%05x\n", cpu_getactivecpu(), #x, __FILE__, __LINE__, saturn.pc); } while (0) + do { if (!(x)) logerror("SATURN%d assertion failed: %s at %s:%i, pc=%05x\n", cpunum_get_active(), #x, __FILE__, __LINE__, saturn.pc); } while (0) INLINE int READ_OP(void) { @@ -186,24 +186,24 @@ INLINE void saturn_push(SaturnAdr adr) INLINE void saturn_interrupt_on(void) { - LOG(( "SATURN#%d at %05x: INTON\n", cpu_getactivecpu(), saturn.pc-4 )); + LOG(( "SATURN#%d at %05x: INTON\n", cpunum_get_active(), saturn.pc-4 )); saturn.irq_enable=1; if (saturn.irq_state) { - LOG(( "SATURN#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "SATURN#%d set_irq_line(ASSERT)\n", cpunum_get_active())); saturn.pending_irq=1; } } INLINE void saturn_interrupt_off(void) { - LOG(( "SATURN#%d at %05x: INTOFF\n", cpu_getactivecpu(), saturn.pc-4 )); + LOG(( "SATURN#%d at %05x: INTOFF\n", cpunum_get_active(), saturn.pc-4 )); saturn.irq_enable=0; } INLINE void saturn_reset_interrupt(void) { - LOG(( "SATURN#%d at %05x: RSI\n", cpu_getactivecpu(), saturn.pc-5 )); + LOG(( "SATURN#%d at %05x: RSI\n", cpunum_get_active(), saturn.pc-5 )); if (saturn.config&&saturn.config->rsi) saturn.config->rsi(Machine); } @@ -236,27 +236,27 @@ INLINE void saturn_shutdown(void) { saturn.sleeping=1; saturn.irq_enable=1; - LOG(( "SATURN#%d at %05x: SHUTDN\n", cpu_getactivecpu(), saturn.pc-3 )); + LOG(( "SATURN#%d at %05x: SHUTDN\n", cpunum_get_active(), saturn.pc-3 )); } INLINE void saturn_bus_command_b(void) { - logerror( "SATURN#%d at %05x: BUSCB opcode not handled\n", cpu_getactivecpu(), saturn.pc-4 ); + logerror( "SATURN#%d at %05x: BUSCB opcode not handled\n", cpunum_get_active(), saturn.pc-4 ); } INLINE void saturn_bus_command_c(void) { - logerror( "SATURN#%d at %05x: BUSCC opcode not handled\n", cpu_getactivecpu(), saturn.pc-3 ); + logerror( "SATURN#%d at %05x: BUSCC opcode not handled\n", cpunum_get_active(), saturn.pc-3 ); } INLINE void saturn_bus_command_d(void) { - logerror( "SATURN#%d at %05x: BUSCD opcode not handled\n", cpu_getactivecpu(), saturn.pc-4 ); + logerror( "SATURN#%d at %05x: BUSCD opcode not handled\n", cpunum_get_active(), saturn.pc-4 ); } INLINE void saturn_serial_request(void) { - logerror( "SATURN#%d at %05x: SREQ? opcode not handled\n", cpu_getactivecpu(), saturn.pc-3 ); + logerror( "SATURN#%d at %05x: SREQ? opcode not handled\n", cpunum_get_active(), saturn.pc-3 ); } INLINE void saturn_out_c(void) @@ -279,7 +279,7 @@ INLINE void saturn_in(int reg) saturn_assert(reg>=0 && reg<9); if (!(saturn.pc&1)) logerror( "SATURN#%d at %05x: reg=IN opcode at odd addresse\n", - cpu_getactivecpu(), saturn.pc-3 ); + cpunum_get_active(), saturn.pc-3 ); if (saturn.config&&saturn.config->in) in = saturn.config->in(Machine); S64_WRITE_WORD(reg,in); monitor_in = in; @@ -469,7 +469,7 @@ INLINE void saturn_return_carry_clear(void) INLINE void saturn_return_interrupt(void) { - LOG(( "SATURN#%d at %05x: RTI\n", cpu_getactivecpu(), saturn.pc-2 )); + LOG(( "SATURN#%d at %05x: RTI\n", cpunum_get_active(), saturn.pc-2 )); saturn.in_irq=0; /* set to 1 when an IRQ is taken */ saturn.pc=saturn_pop(); // saturn_ICount-=10; diff --git a/src/emu/cpu/saturn/sattable.c b/src/emu/cpu/saturn/sattable.c index 54f59792c4e..75485d0db99 100644 --- a/src/emu/cpu/saturn/sattable.c +++ b/src/emu/cpu/saturn/sattable.c @@ -38,25 +38,25 @@ static const int sub_right[]={B,C,A,C, I,I,I,I, A,B,C,D, B,C,A,C}; static void saturn_invalid3( int op1, int op2, int op3 ) { logerror( "SATURN#%d invalid opcode %x%x%x at %05x\n", - cpu_getactivecpu(), op1, op2, op3, saturn.pc-3 ); + cpunum_get_active(), op1, op2, op3, saturn.pc-3 ); } static void saturn_invalid4( int op1, int op2, int op3, int op4 ) { logerror( "SATURN#%d invalid opcode %x%x%x%x at %05x\n", - cpu_getactivecpu(), op1, op2, op3, op4, saturn.pc-4 ); + cpunum_get_active(), op1, op2, op3, op4, saturn.pc-4 ); } static void saturn_invalid5( int op1, int op2, int op3, int op4, int op5 ) { logerror( "SATURN#%d invalid opcode %x%x%x%x%x at %05x\n", - cpu_getactivecpu(), op1, op2, op3, op4, op5, saturn.pc-5 ); + cpunum_get_active(), op1, op2, op3, op4, op5, saturn.pc-5 ); } static void saturn_invalid6( int op1, int op2, int op3, int op4, int op5, int op6 ) { logerror( "SATURN#%d invalid opcode %x%x%x%x%x%x at %05x\n", - cpu_getactivecpu(), op1, op2, op3, op4, op5, op6, saturn.pc-6 ); + cpunum_get_active(), op1, op2, op3, op4, op5, op6, saturn.pc-6 ); } diff --git a/src/emu/cpu/saturn/saturn.c b/src/emu/cpu/saturn/saturn.c index 4de40231e54..9c4ac5bcd77 100644 --- a/src/emu/cpu/saturn/saturn.c +++ b/src/emu/cpu/saturn/saturn.c @@ -163,7 +163,7 @@ INLINE void saturn_take_irq(void) saturn_push(saturn.pc); saturn.pc=IRQ_ADDRESS; - LOG(("Saturn#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), saturn.pc)); + LOG(("Saturn#%d takes IRQ ($%04x)\n", cpunum_get_active(), saturn.pc)); if (saturn.irq_callback) (*saturn.irq_callback)(saturn.device, SATURN_IRQ_LINE); change_pc(saturn.pc); @@ -208,7 +208,7 @@ static void saturn_set_nmi_line(int state) saturn.nmi_state = state; if ( state != CLEAR_LINE ) { - LOG(( "SATURN#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "SATURN#%d set_nmi_line(ASSERT)\n", cpunum_get_active())); saturn.pending_irq = 1; } } @@ -219,7 +219,7 @@ static void saturn_set_irq_line(int state) saturn.irq_state = state; if ( state != CLEAR_LINE && saturn.irq_enable ) { - LOG(( "SATURN#%d set_irq_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "SATURN#%d set_irq_line(ASSERT)\n", cpunum_get_active())); saturn.pending_irq = 1; } } @@ -228,7 +228,7 @@ static void saturn_set_wakeup_line(int state) { if (saturn.sleeping && state==1) { - LOG(( "SATURN#%d set_wakeup_line(ASSERT)\n", cpu_getactivecpu())); + LOG(( "SATURN#%d set_wakeup_line(ASSERT)\n", cpunum_get_active())); if (saturn.irq_callback) (*saturn.irq_callback)(saturn.device, SATURN_WAKEUP_LINE); saturn.sleeping = 0; } diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c index d4111223f6c..e35123fdf46 100644 --- a/src/emu/cpu/sh2/sh2.c +++ b/src/emu/cpu/sh2/sh2.c @@ -2335,7 +2335,7 @@ static CPU_SET_INFO( sh2 ) case CPUINFO_INT_REGISTER + SH2_R15: sh2->r[15] = info->i; break; case CPUINFO_INT_REGISTER + SH2_EA: sh2->ea = info->i; break; - case CPUINFO_INT_SH2_FRT_INPUT: sh2_set_frt_input(cpu_getactivecpu(), info->i); break; + case CPUINFO_INT_SH2_FRT_INPUT: sh2_set_frt_input(cpunum_get_active(), info->i); break; /* --- the following bits of info are set as pointers to data or functions --- */ case CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK: sh2->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break; diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c index 8cd0af5e8ad..db726069cc4 100644 --- a/src/emu/cpu/sh2/sh2comn.c +++ b/src/emu/cpu/sh2/sh2comn.c @@ -109,7 +109,7 @@ TIMER_CALLBACK( sh2_timer_callback ) UINT16 frc; int cpunum = param; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); sh2_timer_resync(); frc = sh2->frc; @@ -131,7 +131,7 @@ TIMER_CALLBACK( sh2_timer_callback ) sh2_recalc_irq(); sh2_timer_activate(); - cpuintrf_pop_context(); + cpu_pop_context(); } TIMER_CALLBACK( sh2_dmac_callback ) @@ -139,12 +139,12 @@ TIMER_CALLBACK( sh2_dmac_callback ) int cpunum = param >> 1; int dma = param & 1; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); LOG(("SH2.%d: DMA %d complete\n", cpunum, dma)); sh2->m[0x63+4*dma] |= 2; sh2->dma_timer_active[dma] = 0; sh2_recalc_irq(); - cpuintrf_pop_context(); + cpu_pop_context(); } static void sh2_dmac_check(int dma) @@ -300,7 +300,7 @@ WRITE32_HANDLER( sh2_internal_w ) // logerror("sh2_internal_w: Write %08x (%x), %08x @ %08x\n", 0xfffffe00+offset*4, offset, data, mem_mask); // if(offset != 0x20) -// printf("sh2_internal_w: Write %08x (%x), %08x @ %08x (PC %x)\n", 0xfffffe00+offset*4, offset, data, mem_mask, activecpu_get_pc()); +// printf("sh2_internal_w: Write %08x (%x), %08x @ %08x (PC %x)\n", 0xfffffe00+offset*4, offset, data, mem_mask, cpu_get_pc(machine->activecpu)); switch( offset ) { @@ -360,7 +360,7 @@ WRITE32_HANDLER( sh2_internal_w ) { INT32 a = sh2->m[0x41]; INT32 b = sh2->m[0x40]; - LOG(("SH2 #%d div+mod %d/%d\n", cpu_getactivecpu(), a, b)); + LOG(("SH2 #%d div+mod %d/%d\n", cpunum_get_active(), a, b)); if (b) { sh2->m[0x45] = a / b; @@ -388,7 +388,7 @@ WRITE32_HANDLER( sh2_internal_w ) { INT64 a = sh2->m[0x45] | ((UINT64)(sh2->m[0x44]) << 32); INT64 b = (INT32)sh2->m[0x40]; - LOG(("SH2 #%d div+mod %lld/%lld\n", cpu_getactivecpu(), a, b)); + LOG(("SH2 #%d div+mod %lld/%lld\n", cpunum_get_active(), a, b)); if (b) { INT64 q = a / b; @@ -509,10 +509,10 @@ void sh2_set_frt_input(int cpunum, int state) return; } - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); if(sh2->frt_input == state) { - cpuintrf_pop_context(); + cpu_pop_context(); return; } @@ -520,12 +520,12 @@ void sh2_set_frt_input(int cpunum, int state) if(sh2->m[5] & 0x8000) { if(state == CLEAR_LINE) { - cpuintrf_pop_context(); + cpu_pop_context(); return; } } else { if(state == ASSERT_LINE) { - cpuintrf_pop_context(); + cpu_pop_context(); return; } } @@ -535,7 +535,7 @@ void sh2_set_frt_input(int cpunum, int state) sh2->m[4] |= ICF; logerror("SH2.%d: ICF activated (%x)\n", sh2->cpu_number, sh2->pc & AM); sh2_recalc_irq(); - cpuintrf_pop_context(); + cpu_pop_context(); } void sh2_set_irq_line(int irqline, int state) @@ -548,11 +548,11 @@ void sh2_set_irq_line(int irqline, int state) if( state == CLEAR_LINE ) { - LOG(("SH-2 #%d cleared nmi\n", cpu_getactivecpu())); + LOG(("SH-2 #%d cleared nmi\n", cpunum_get_active())); } else { - LOG(("SH-2 #%d assert nmi\n", cpu_getactivecpu())); + LOG(("SH-2 #%d assert nmi\n", cpunum_get_active())); sh2_exception("Set IRQ line", 16); @@ -569,12 +569,12 @@ void sh2_set_irq_line(int irqline, int state) if( state == CLEAR_LINE ) { - LOG(("SH-2 #%d cleared irq #%d\n", cpu_getactivecpu(), irqline)); + LOG(("SH-2 #%d cleared irq #%d\n", cpunum_get_active(), irqline)); sh2->pending_irq &= ~(1 << irqline); } else { - LOG(("SH-2 #%d assert irq #%d\n", cpu_getactivecpu(), irqline)); + LOG(("SH-2 #%d assert irq #%d\n", cpunum_get_active(), irqline)); sh2->pending_irq |= 1 << irqline; #ifdef USE_SH2DRC sh2->test_irq = 1; @@ -645,27 +645,27 @@ void sh2_exception(const char *message, int irqline) if (sh2->internal_irq_level == irqline) { vector = sh2->internal_irq_vector; - LOG(("SH-2 #%d exception #%d (internal vector: $%x) after [%s]\n", cpu_getactivecpu(), irqline, vector, message)); + LOG(("SH-2 #%d exception #%d (internal vector: $%x) after [%s]\n", cpunum_get_active(), irqline, vector, message)); } else { if(sh2->m[0x38] & 0x00010000) { vector = sh2->irq_callback(sh2->device, irqline); - LOG(("SH-2 #%d exception #%d (external vector: $%x) after [%s]\n", cpu_getactivecpu(), irqline, vector, message)); + LOG(("SH-2 #%d exception #%d (external vector: $%x) after [%s]\n", cpunum_get_active(), irqline, vector, message)); } else { sh2->irq_callback(sh2->device, irqline); vector = 64 + irqline/2; - LOG(("SH-2 #%d exception #%d (autovector: $%x) after [%s]\n", cpu_getactivecpu(), irqline, vector, message)); + LOG(("SH-2 #%d exception #%d (autovector: $%x) after [%s]\n", cpunum_get_active(), irqline, vector, message)); } } } else { vector = 11; - LOG(("SH-2 #%d nmi exception (autovector: $%x) after [%s]\n", cpu_getactivecpu(), vector, message)); + LOG(("SH-2 #%d nmi exception (autovector: $%x) after [%s]\n", cpunum_get_active(), vector, message)); } #ifdef USE_SH2DRC diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c index 80ab97baf17..3ab8d44d766 100644 --- a/src/emu/cpu/sh2/sh2drc.c +++ b/src/emu/cpu/sh2/sh2drc.c @@ -725,7 +725,7 @@ static CPU_INIT( sh2 ) /* initialize the front-end helper */ if (SINGLE_INSTRUCTION_MODE) feconfig.max_sequence = 1; - sh2->drcfe = drcfe_init(&feconfig, sh2); + sh2->drcfe = drcfe_init(device, &feconfig, sh2); /* compute the register parameters */ for (regnum = 0; regnum < 16; regnum++) @@ -968,7 +968,7 @@ static void code_compile_block(drcuml_state *drcuml, UINT8 mode, offs_t pc) } /* validate this code block if we're not pointing into ROM */ - if (memory_get_write_ptr(cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL) + if (memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL) generate_checksum_block(block, &compiler, seqhead, seqlast); /* label this instruction, if it may be jumped to locally */ @@ -3395,7 +3395,7 @@ static CPU_SET_INFO( sh2 ) case CPUINFO_INT_REGISTER + SH2_R15: sh2->r[15] = info->i; break; case CPUINFO_INT_REGISTER + SH2_EA: sh2->ea = info->i; break; - case CPUINFO_INT_SH2_FRT_INPUT: sh2_set_frt_input(cpu_getactivecpu(), info->i); break; + case CPUINFO_INT_SH2_FRT_INPUT: sh2_set_frt_input(cpunum_get_active(), info->i); break; /* --- the following bits of info are set as pointers to data or functions --- */ case CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK: sh2->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break; diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c index c6dc73e6782..72a08d9eb0c 100644 --- a/src/emu/cpu/sh4/sh4.c +++ b/src/emu/cpu/sh4/sh4.c @@ -3610,8 +3610,8 @@ static CPU_SET_INFO( sh4 ) case CPUINFO_STR_REGISTER + SH4_XF15: sh4.xf[15] = info->i; break; #endif - case CPUINFO_INT_SH4_IRLn_INPUT: sh4_set_irln_input(cpu_getactivecpu(), info->i); break; - case CPUINFO_INT_SH4_FRT_INPUT: sh4_set_frt_input(cpu_getactivecpu(), info->i); break; + case CPUINFO_INT_SH4_IRLn_INPUT: sh4_set_irln_input(cpunum_get_active(), info->i); break; + case CPUINFO_INT_SH4_FRT_INPUT: sh4_set_frt_input(cpunum_get_active(), info->i); break; /* --- the following bits of info are set as pointers to data or functions --- */ case CPUINFO_PTR_SH4_FTCSR_READ_CALLBACK: sh4.ftcsr_read_callback = (void (*) (UINT32 ))info->f; break; diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c index 6d03bbdd5f2..a173a8f4f6e 100644 --- a/src/emu/cpu/sh4/sh4comn.c +++ b/src/emu/cpu/sh4/sh4comn.c @@ -172,7 +172,7 @@ void sh4_exception(const char *message, int exception) // handle exception sh4.m[INTEVT] = 0x1c0; vector = 0x600; sh4.irq_callback(sh4.device, INPUT_LINE_NMI); - LOG(("SH-4 #%d nmi exception after [%s]\n", cpu_getactivecpu(), message)); + LOG(("SH-4 #%d nmi exception after [%s]\n", cpunum_get_active(), message)); } else { // if ((sh4.m[ICR] & 0x4000) && (sh4.nmi_line_state == ASSERT_LINE)) // return; @@ -186,7 +186,7 @@ void sh4_exception(const char *message, int exception) // handle exception sh4.irq_callback(sh4.device, SH4_INTC_IRL0-exception+SH4_IRL0); else sh4.irq_callback(sh4.device, SH4_IRL3+1); - LOG(("SH-4 #%d interrupt exception #%d after [%s]\n", cpu_getactivecpu(), exception, message)); + LOG(("SH-4 #%d interrupt exception #%d after [%s]\n", cpunum_get_active(), exception, message)); } sh4_exception_checkunrequest(exception); @@ -259,7 +259,7 @@ static TIMER_CALLBACK( sh4_refresh_timer_callback ) { int cpunum = param; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); sh4.m[RTCNT] = 0; sh4_refresh_timer_recompute(); sh4.m[RTCSR] |= 128; @@ -272,7 +272,7 @@ static TIMER_CALLBACK( sh4_refresh_timer_callback ) sh4.m[RTCSR] |= 4; } } - cpuintrf_pop_context(); + cpu_pop_context(); } static void increment_rtc_time(int mode) @@ -372,7 +372,7 @@ static TIMER_CALLBACK( sh4_rtc_timer_callback ) { int cpunum = param; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); timer_adjust_oneshot(sh4.rtc_timer, ATTOTIME_IN_HZ(128), cpunum); sh4.m[R64CNT] = (sh4.m[R64CNT]+1) & 0x7f; if (sh4.m[R64CNT] == 64) @@ -381,7 +381,7 @@ static TIMER_CALLBACK( sh4_rtc_timer_callback ) increment_rtc_time(0); //sh4_exception_request(SH4_INTC_NMI); // TEST } - cpuintrf_pop_context(); + cpu_pop_context(); } static TIMER_CALLBACK( sh4_timer_callback ) @@ -391,13 +391,13 @@ static TIMER_CALLBACK( sh4_timer_callback ) int cpunum = param; int idx = tcr[which]; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); sh4.m[tcnt[which]] = sh4.m[tcor[which]]; sh4_timer_recompute(which); sh4.m[idx] = sh4.m[idx] | 0x100; if (sh4.m[idx] & 0x20) sh4_exception_request(tuni[which]); - cpuintrf_pop_context(); + cpu_pop_context(); } static TIMER_CALLBACK( sh4_dmac_callback ) @@ -405,7 +405,7 @@ static TIMER_CALLBACK( sh4_dmac_callback ) int cpunum = param >> 8; int channel = param & 255; - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); LOG(("SH4.%d: DMA %d complete\n", cpunum, channel)); sh4.dma_timer_active[channel] = 0; switch (channel) @@ -435,7 +435,7 @@ static TIMER_CALLBACK( sh4_dmac_callback ) sh4_exception_request(SH4_INTC_DMTE3); break; } - cpuintrf_pop_context(); + cpu_pop_context(); } static int sh4_dma_transfer(int channel, int timermode, UINT32 chcr, UINT32 *sar, UINT32 *dar, UINT32 *dmatcr) @@ -974,10 +974,10 @@ void sh4_set_frt_input(int cpunum, int state) return; } - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); if(sh4.frt_input == state) { - cpuintrf_pop_context(); + cpu_pop_context(); return; } @@ -985,12 +985,12 @@ void sh4_set_frt_input(int cpunum, int state) if(sh4.m[5] & 0x8000) { if(state == CLEAR_LINE) { - cpuintrf_pop_context(); + cpu_pop_context(); return; } } else { if(state == ASSERT_LINE) { - cpuintrf_pop_context(); + cpu_pop_context(); return; } } @@ -1002,7 +1002,7 @@ void sh4_set_frt_input(int cpunum, int state) logerror("SH4.%d: ICF activated (%x)\n", sh4.cpu_number, sh4.pc & AM); sh4_recalc_irq(); #endif - cpuintrf_pop_context(); + cpu_pop_context(); } void sh4_set_irln_input(int cpunum, int value) @@ -1025,7 +1025,7 @@ int s; { if ((state == CLEAR_LINE) && (sh4.nmi_line_state == ASSERT_LINE)) // rising { - LOG(("SH-4 #%d assert nmi\n", cpu_getactivecpu())); + LOG(("SH-4 #%d assert nmi\n", cpunum_get_active())); sh4_exception_request(SH4_INTC_NMI); sh4_dmac_nmi(); } @@ -1034,7 +1034,7 @@ int s; { if ((state == ASSERT_LINE) && (sh4.nmi_line_state == CLEAR_LINE)) // falling { - LOG(("SH-4 #%d assert nmi\n", cpu_getactivecpu())); + LOG(("SH-4 #%d assert nmi\n", cpunum_get_active())); sh4_exception_request(SH4_INTC_NMI); sh4_dmac_nmi(); } @@ -1057,12 +1057,12 @@ int s; if( state == CLEAR_LINE ) { - LOG(("SH-4 #%d cleared external irq IRL%d\n", cpu_getactivecpu(), irqline)); + LOG(("SH-4 #%d cleared external irq IRL%d\n", cpunum_get_active(), irqline)); sh4_exception_unrequest(SH4_INTC_IRL0+irqline-SH4_IRL0); } else { - LOG(("SH-4 #%d assert external irq IRL%d\n", cpu_getactivecpu(), irqline)); + LOG(("SH-4 #%d assert external irq IRL%d\n", cpunum_get_active(), irqline)); sh4_exception_request(SH4_INTC_IRL0+irqline-SH4_IRL0); } } @@ -1076,7 +1076,7 @@ int s; sh4_exception_unrequest(SH4_INTC_IRLn0+s); if (sh4.irln < 15) sh4_exception_request(SH4_INTC_IRLn0+sh4.irln); - LOG(("SH-4 #%d IRLn0-IRLn3 level #%d\n", cpu_getactivecpu(), sh4.irln)); + LOG(("SH-4 #%d IRLn0-IRLn3 level #%d\n", cpunum_get_active(), sh4.irln)); } } if (sh4.test_irq && (!sh4.delay)) diff --git a/src/emu/cpu/spc700/spc700.c b/src/emu/cpu/spc700/spc700.c index e7eade3d743..142e83e2bf0 100644 --- a/src/emu/cpu/spc700/spc700.c +++ b/src/emu/cpu/spc700/spc700.c @@ -1366,7 +1366,7 @@ void spc700_set_irq_callback(cpu_irq_callback callback) void spc700_state_save(void *file) { #if 0 - int cpu = cpu_getactivecpu(); + int cpu = cpunum_get_active(); uint p = GET_REG_P(); state_save_UINT16(file,"spc700",cpu,"PC",®_PC,2); state_save_UINT16(file,"spc700",cpu,"PPC",®_PPC,2); @@ -1384,7 +1384,7 @@ void spc700_state_save(void *file) void spc700_state_load(void *file) { #if 0 - int cpu = cpu_getactivecpu(); + int cpu = cpunum_get_active(); uint p; state_load_UINT16(file,"spc700",cpu,"PC",®_PC,2); state_load_UINT16(file,"spc700",cpu,"PPC",®_PPC,2); diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c index b53618dfcba..5e89b4c5acf 100644 --- a/src/emu/cpu/tlcs90/tlcs90.c +++ b/src/emu/cpu/tlcs90/tlcs90.c @@ -983,7 +983,7 @@ static int sprint_arg(char *buffer, UINT32 pc, const char *pre, const e_mode mod case MODE_R16D8: return sprintf( buffer, "%s%s%c$%02X", pre, r16_names[r], (rb&0x80)?'-':'+', (rb&0x80)?((rb^0xff)+1):rb ); default: - fatalerror("%04x: unimplemented addr mode = %d\n",activecpu_get_pc(),mode); + fatalerror("%04x: unimplemented addr mode = %d\n",cpu_get_pc(Machine->activecpu),mode); } return 0; @@ -1020,7 +1020,7 @@ INLINE UINT16 r8( const e_r r ) case L: return T90.hl.b.l; default: - fatalerror("%04x: unimplemented r8 register index = %d\n",activecpu_get_pc(),r); + fatalerror("%04x: unimplemented r8 register index = %d\n",cpu_get_pc(Machine->activecpu),r); } } @@ -1037,7 +1037,7 @@ INLINE void w8( const e_r r, UINT16 value ) case L: T90.hl.b.l = value; return; default: - fatalerror("%04x: unimplemented w8 register index = %d\n",activecpu_get_pc(),r); + fatalerror("%04x: unimplemented w8 register index = %d\n",cpu_get_pc(Machine->activecpu),r); } } @@ -1058,7 +1058,7 @@ case AF2: return (T90.af2.w.l & (~IF)) | (T90.af.w.l & IF); case PC: return T90.pc.w.l; default: - fatalerror("%04x: unimplemented r16 register index = %d\n",activecpu_get_pc(),r); + fatalerror("%04x: unimplemented r16 register index = %d\n",cpu_get_pc(Machine->activecpu),r); } } @@ -1077,7 +1077,7 @@ INLINE void w16( const e_r r, UINT16 value ) case PC: change_pc( T90.pc.d = value ); return; default: - fatalerror("%04x: unimplemented w16 register index = %d\n",activecpu_get_pc(),r); + fatalerror("%04x: unimplemented w16 register index = %d\n",cpu_get_pc(Machine->activecpu),r); } } @@ -1105,7 +1105,7 @@ INLINE UINT8 Read##N##_8(void) { \ } \ return RM8((UINT16)(r16(r##N) + (INT8)r##N##b)); \ default: \ - fatalerror("%04x: unimplemented Read%d_8 mode = %d\n",activecpu_get_pc(),N,mode##N); \ + fatalerror("%04x: unimplemented Read%d_8 mode = %d\n",cpu_get_pc(Machine->activecpu),N,mode##N); \ } \ return 0; \ } \ @@ -1130,7 +1130,7 @@ INLINE UINT16 Read##N##_16(void) { \ } \ return RM16((UINT16)(r16(r##N) + (INT8)r##N##b)); \ default: \ - fatalerror("%04x: unimplemented Read%d_16 modes = %d\n",activecpu_get_pc(),N,mode##N); \ + fatalerror("%04x: unimplemented Read%d_16 modes = %d\n",cpu_get_pc(Machine->activecpu),N,mode##N); \ } \ return 0; \ } @@ -1156,7 +1156,7 @@ INLINE void Write##N##_8( UINT8 value ) { \ } \ WM8((UINT16)(r16(r##N) + (INT8)r##N##b), value); return; \ default: \ - fatalerror("%04x: unimplemented Write%d_8 mode = %d\n",activecpu_get_pc(),N,mode##N); \ + fatalerror("%04x: unimplemented Write%d_8 mode = %d\n",cpu_get_pc(Machine->activecpu),N,mode##N); \ } \ } \ INLINE void Write##N##_16( UINT16 value ) \ @@ -1178,7 +1178,7 @@ INLINE void Write##N##_16( UINT16 value ) \ } \ WM16((UINT16)(r16(r##N) + (INT8)r##N##b), value); return; \ default: \ - fatalerror("%04x: unimplemented Write%d_16 mode = %d\n",activecpu_get_pc(),N,mode##N); \ + fatalerror("%04x: unimplemented Write%d_16 mode = %d\n",cpu_get_pc(Machine->activecpu),N,mode##N); \ } \ } @@ -1209,7 +1209,7 @@ INLINE int Test( UINT8 cond ) case NZ: return !(F & ZF); case NC: return !(F & CF); default: - fatalerror("%04x: unimplemented condition = %d\n",activecpu_get_pc(),cond); + fatalerror("%04x: unimplemented condition = %d\n",cpu_get_pc(Machine->activecpu),cond); } return 0; } @@ -1331,7 +1331,7 @@ static CPU_EXECUTE( t90 ) do { T90.prvpc.d = T90.pc.d; - debugger_instruction_hook(Machine, T90.pc.d); + debugger_instruction_hook(device->machine, T90.pc.d); check_interrupts(); @@ -1948,7 +1948,7 @@ static CPU_EXECUTE( t90 ) break; default: - fatalerror("%04x: unimplemented opcode, op=%02x\n",activecpu_get_pc(),op); + fatalerror("%04x: unimplemented opcode, op=%02x\n",cpu_get_pc(device),op); } if ( op != EI ) @@ -2320,22 +2320,22 @@ static void t90_start_timer(int i) // 16-bit mode if (i & 1) { - logerror("%04X: CPU Timer %d clocked by Timer %d overflow signal\n", activecpu_get_pc(), i,i-1); + logerror("%04X: CPU Timer %d clocked by Timer %d overflow signal\n", cpu_get_pc(Machine->activecpu), i,i-1); return; } break; case 2: - logerror("%04X: CPU Timer %d, unsupported PPG mode\n", activecpu_get_pc(), i); + logerror("%04X: CPU Timer %d, unsupported PPG mode\n", cpu_get_pc(Machine->activecpu), i); return; case 3: - logerror("%04X: CPU Timer %d, unsupported PWM mode\n", activecpu_get_pc(), i); + logerror("%04X: CPU Timer %d, unsupported PWM mode\n", cpu_get_pc(Machine->activecpu), i); return; } switch((T90.internal_registers[ T90_TCLK - T90_IOBASE ] >> (i * 2)) & 0x03) { - case 0: if (i & 1) logerror("%04X: CPU Timer %d clocked by Timer %d match signal\n", activecpu_get_pc(), i,i-1); - else logerror("%04X: CPU Timer %d, unsupported TCLK = 0\n", activecpu_get_pc(), i); + case 0: if (i & 1) logerror("%04X: CPU Timer %d clocked by Timer %d match signal\n", cpu_get_pc(Machine->activecpu), i,i-1); + else logerror("%04X: CPU Timer %d, unsupported TCLK = 0\n", cpu_get_pc(Machine->activecpu), i); return; case 2: prescaler = 16; break; case 3: prescaler = 256; break; @@ -2348,7 +2348,7 @@ static void t90_start_timer(int i) timer_adjust_periodic(T90.timer[i], period, i, period); - logerror("%04X: CPU Timer %d started at %lf Hz\n", activecpu_get_pc(), i, 1.0 / attotime_to_double(period)); + logerror("%04X: CPU Timer %d started at %lf Hz\n", cpu_get_pc(Machine->activecpu), i, 1.0 / attotime_to_double(period)); } static void t90_start_timer4(void) @@ -2362,7 +2362,7 @@ static void t90_start_timer4(void) { case 1: prescaler = 1; break; case 2: prescaler = 16; break; - default: logerror("%04X: CPU Timer 4, unsupported T4MOD = %d\n", activecpu_get_pc(),T90.internal_registers[ T90_T4MOD - T90_IOBASE ] & 0x03); + default: logerror("%04X: CPU Timer 4, unsupported T4MOD = %d\n", cpu_get_pc(Machine->activecpu),T90.internal_registers[ T90_T4MOD - T90_IOBASE ] & 0x03); return; } @@ -2370,14 +2370,14 @@ static void t90_start_timer4(void) timer_adjust_periodic(T90.timer[4], period, 4, period); - logerror("%04X: CPU Timer 4 started at %lf Hz\n", activecpu_get_pc(), 1.0 / attotime_to_double(period)); + logerror("%04X: CPU Timer 4 started at %lf Hz\n", cpu_get_pc(Machine->activecpu), 1.0 / attotime_to_double(period)); } static void t90_stop_timer(int i) { timer_adjust_oneshot(T90.timer[i], attotime_never, i); - logerror("%04X: CPU Timer %d stopped\n", activecpu_get_pc(), i); + logerror("%04X: CPU Timer %d stopped\n", cpu_get_pc(Machine->activecpu), i); } static void t90_stop_timer4(void) @@ -2655,7 +2655,7 @@ static CPU_INIT( t90 ) T90.irq_callback = irqcallback; T90.device = device; - T90.timer_period = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(cpu_getactivecpu())), 8); + T90.timer_period = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(cpunum_get_active())), 8); // Reset registers to their initial values diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c index 7e6c51f84b8..6b42f34c860 100644 --- a/src/emu/cpu/tms34010/34010gfx.c +++ b/src/emu/cpu/tms34010/34010gfx.c @@ -83,7 +83,7 @@ static int apply_window(const char *inst_name,int srcbpp, UINT32 *srcaddr, XY *d int diff, cycles = 3; if (WINDOW_CHECKING == 2) - logerror("%08x: %s apply_window window mode %d not supported!\n", activecpu_get_pc(), inst_name, WINDOW_CHECKING); + logerror("%08x: %s apply_window window mode %d not supported!\n", cpu_get_pc(Machine->activecpu), inst_name, WINDOW_CHECKING); CLR_V; if (WINDOW_CHECKING == 1) diff --git a/src/emu/cpu/tms34010/34010ops.c b/src/emu/cpu/tms34010/34010ops.c index 6022c1a72cd..dc48819a6fb 100644 --- a/src/emu/cpu/tms34010/34010ops.c +++ b/src/emu/cpu/tms34010/34010ops.c @@ -97,7 +97,7 @@ static void unimpl(void) /* extra check to prevent bad things */ if (PC == 0 || opcode_table[cpu_readop16(TOBYTE(PC)) >> 4] == unimpl) { - cpunum_set_input_line(tms.screen->machine, cpu_getactivecpu(), INPUT_LINE_HALT, ASSERT_LINE); + cpunum_set_input_line(tms.screen->machine, cpunum_get_active(), INPUT_LINE_HALT, ASSERT_LINE); debugger_break(tms.screen->machine); } } diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 8432fd31444..48cbe124fa0 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -541,13 +541,13 @@ static void check_interrupt(void) int irq; /* if we're not actively executing, skip it */ - if (executing_cpu != 0xff && executing_cpu != cpu_getactivecpu()) + if (executing_cpu != 0xff && executing_cpu != cpunum_get_active()) return; /* check for NMI first */ if (IOREG(REG_HSTCTLH) & 0x0100) { - LOG(("TMS34010#%d takes NMI\n", cpu_getactivecpu())); + LOG(("TMS34010#%d takes NMI\n", cpunum_get_active())); /* ack the NMI */ IOREG(REG_HSTCTLH) &= ~0x0100; @@ -575,28 +575,28 @@ static void check_interrupt(void) /* host interrupt */ if (irq & TMS34010_HI) { - LOG(("TMS34010#%d takes HI\n", cpu_getactivecpu())); + LOG(("TMS34010#%d takes HI\n", cpunum_get_active())); vector = 0xfffffec0; } /* display interrupt */ else if (irq & TMS34010_DI) { - LOG(("TMS34010#%d takes DI\n", cpu_getactivecpu())); + LOG(("TMS34010#%d takes DI\n", cpunum_get_active())); vector = 0xfffffea0; } /* window violation interrupt */ else if (irq & TMS34010_WV) { - LOG(("TMS34010#%d takes WV\n", cpu_getactivecpu())); + LOG(("TMS34010#%d takes WV\n", cpunum_get_active())); vector = 0xfffffe80; } /* external 1 interrupt */ else if (irq & TMS34010_INT1) { - LOG(("TMS34010#%d takes INT1\n", cpu_getactivecpu())); + LOG(("TMS34010#%d takes INT1\n", cpunum_get_active())); vector = 0xffffffc0; irqline = 0; } @@ -604,7 +604,7 @@ static void check_interrupt(void) /* external 2 interrupt */ else if (irq & TMS34010_INT2) { - LOG(("TMS34010#%d takes INT2\n", cpu_getactivecpu())); + LOG(("TMS34010#%d takes INT2\n", cpunum_get_active())); vector = 0xffffffa0; irqline = 1; } @@ -777,7 +777,7 @@ static CPU_SET_CONTEXT( tms34020 ) static void set_irq_line(int irqline, int linestate) { - LOG(("TMS34010#%d set irq line %d state %d\n", cpu_getactivecpu(), irqline, linestate)); + LOG(("TMS34010#%d set irq line %d state %d\n", cpunum_get_active(), irqline, linestate)); /* set the pending interrupt */ switch (irqline) @@ -810,10 +810,10 @@ static TIMER_CALLBACK( internal_interrupt_callback ) int type = param >> 8; /* call through to the CPU to generate the int */ - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); IOREG(REG_INTPEND) |= type; - LOG(("TMS34010#%d set internal interrupt $%04x\n", cpu_getactivecpu(), type)); - cpuintrf_pop_context(); + LOG(("TMS34010#%d set internal interrupt $%04x\n", cpunum_get_active(), type)); + cpu_pop_context(); /* generate triggers so that spin loops can key off them */ cpu_triggerint(machine, cpunum); @@ -843,7 +843,7 @@ static CPU_EXECUTE( tms34010 ) change_pc(TOBYTE(PC)); /* check interrupts first */ - executing_cpu = cpu_getactivecpu(); + executing_cpu = cpunum_get_active(); check_interrupt(); if ((tms.screen->machine->debug_flags & DEBUG_FLAG_ENABLED) == 0) { @@ -963,7 +963,7 @@ static TIMER_CALLBACK( scanline_callback ) int master; /* set the CPU context */ - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); /* fetch the core timing parameters */ current_visarea = video_screen_get_visible_area(tms.screen); @@ -1095,13 +1095,13 @@ static TIMER_CALLBACK( scanline_callback ) timer_adjust_oneshot(tms.scantimer, attotime_add_attoseconds(video_screen_get_time_until_pos(tms.screen, vcount, 0), !master), cpunum | (vcount << 8)); /* restore the context */ - cpuintrf_pop_context(); + cpu_pop_context(); } void tms34010_get_display_params(int cpunum, tms34010_display_params *params) { - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); params->enabled = ((SMART_IOREG(DPYCTL) & 0x8000) != 0); params->vcount = SMART_IOREG(VCOUNT); @@ -1131,7 +1131,7 @@ void tms34010_get_display_params(int cpunum, tms34010_display_params *params) params->yoffset = (IOREG(REG020_DPYNXL) & 0x1f) / (IOREG(REG020_DINCL) & 0x1f); } - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -1204,7 +1204,7 @@ static const char *const ioreg_name[] = WRITE16_HANDLER( tms34010_io_register_w ) { - int cpunum = cpu_getactivecpu(); + int cpunum = cpunum_get_active(); int oldreg, newreg; /* Set register */ @@ -1233,7 +1233,7 @@ WRITE16_HANDLER( tms34010_io_register_w ) break; case REG_PMASK: - if (data) logerror("Plane masking not supported. PC=%08X\n", activecpu_get_pc()); + if (data) logerror("Plane masking not supported. PC=%08X\n", cpu_get_pc(machine->activecpu)); break; case REG_DPYCTL: @@ -1318,7 +1318,7 @@ WRITE16_HANDLER( tms34010_io_register_w ) } if (LOG_CONTROL_REGS) - logerror("CPU#%d@%08X: %s = %04X (%d)\n", cpunum, activecpu_get_pc(), ioreg_name[offset], IOREG(offset), video_screen_get_vpos(tms.screen)); + logerror("CPU#%d@%08X: %s = %04X (%d)\n", cpunum, cpu_get_pc(machine->activecpu), ioreg_name[offset], IOREG(offset), video_screen_get_vpos(tms.screen)); } @@ -1347,7 +1347,7 @@ static const char *const ioreg020_name[] = WRITE16_HANDLER( tms34020_io_register_w ) { - int cpunum = cpu_getactivecpu(); + int cpunum = cpunum_get_active(); int oldreg, newreg; /* Set register */ @@ -1355,7 +1355,7 @@ WRITE16_HANDLER( tms34020_io_register_w ) IOREG(offset) = data; if (LOG_CONTROL_REGS) - logerror("CPU#%d@%08X: %s = %04X (%d)\n", cpunum, activecpu_get_pc(), ioreg020_name[offset], IOREG(offset), video_screen_get_vpos(tms.screen)); + logerror("CPU#%d@%08X: %s = %04X (%d)\n", cpunum, cpu_get_pc(machine->activecpu), ioreg020_name[offset], IOREG(offset), video_screen_get_vpos(tms.screen)); switch (offset) { @@ -1384,7 +1384,7 @@ WRITE16_HANDLER( tms34020_io_register_w ) case REG020_PMASKL: case REG020_PMASKH: - if (data) logerror("Plane masking not supported. PC=%08X\n", activecpu_get_pc()); + if (data) logerror("Plane masking not supported. PC=%08X\n", cpu_get_pc(machine->activecpu)); break; case REG020_DPYCTL: @@ -1510,11 +1510,11 @@ WRITE16_HANDLER( tms34020_io_register_w ) READ16_HANDLER( tms34010_io_register_r ) { - int cpunum = cpu_getactivecpu(); + int cpunum = cpunum_get_active(); int result, total; if (LOG_CONTROL_REGS) - logerror("CPU#%d@%08X: read %s\n", cpunum, activecpu_get_pc(), ioreg_name[offset]); + logerror("CPU#%d@%08X: read %s\n", cpunum, cpu_get_pc(machine->activecpu), ioreg_name[offset]); switch (offset) { @@ -1553,11 +1553,11 @@ READ16_HANDLER( tms34010_io_register_r ) READ16_HANDLER( tms34020_io_register_r ) { - int cpunum = cpu_getactivecpu(); + int cpunum = cpunum_get_active(); int result, total; if (LOG_CONTROL_REGS) - logerror("CPU#%d@%08X: read %s\n", cpunum, activecpu_get_pc(), ioreg_name[offset]); + logerror("CPU#%d@%08X: read %s\n", cpunum, cpu_get_pc(machine->activecpu), ioreg_name[offset]); switch (offset) { @@ -1596,9 +1596,9 @@ READ16_HANDLER( tms34020_io_register_r ) int tms34010_io_display_blanked(int cpu) { int result; - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); result = !(IOREG(REG_DPYCTL) & 0x8000); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -1606,9 +1606,9 @@ int tms34010_io_display_blanked(int cpu) int tms34020_io_display_blanked(int cpu) { int result; - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); result = !(IOREG(REG020_DPYCTL) & 0x8000); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -1616,9 +1616,9 @@ int tms34020_io_display_blanked(int cpu) int tms34010_get_DPYSTRT(int cpu) { int result; - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); result = IOREG(REG_DPYSTRT); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -1626,9 +1626,9 @@ int tms34010_get_DPYSTRT(int cpu) int tms34020_get_DPYSTRT(int cpu) { int result; - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); result = (IOREG(REG020_DPYSTH) << 16) | (IOREG(REG020_DPYSTL) & ~0x1f); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -1655,7 +1655,7 @@ void tms34010_host_w(int cpunum, int reg, int data) unsigned int addr; /* swap to the target cpu */ - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); switch (reg) { @@ -1700,7 +1700,7 @@ void tms34010_host_w(int cpunum, int reg, int data) } /* swap back */ - cpuintrf_pop_context(); + cpu_pop_context(); activecpu_reset_banking(); } @@ -1716,7 +1716,7 @@ int tms34010_host_r(int cpunum, int reg) int result = 0; /* swap to the target cpu */ - cpuintrf_push_context(cpunum); + cpu_push_context(Machine->cpu[cpunum]); switch (reg) { @@ -1759,7 +1759,7 @@ int tms34010_host_r(int cpunum, int reg) } /* swap back */ - cpuintrf_pop_context(); + cpu_pop_context(); activecpu_reset_banking(); return result; diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c index a35e7ade7f7..8557ba6ac89 100644 --- a/src/emu/cpu/tms7000/tms7000.c +++ b/src/emu/cpu/tms7000/tms7000.c @@ -186,7 +186,7 @@ static CPU_SET_CONTEXT( tms7000 ) static CPU_INIT( tms7000 ) { - int cpu = cpu_getactivecpu(); + int cpu = cpunum_get_active(); tms7000.irq_callback = irqcallback; tms7000.device = device; @@ -386,7 +386,7 @@ void tms7000_set_irq_line(int irqline, int state) { /* check for transition */ tms7000.irq_state[irqline] = state; - LOG(("tms7000: (cpu #%d) set_irq_line (INT%d, state %d)\n", cpu_getactivecpu(), irqline+1, state)); + LOG(("tms7000: (cpu #%d) set_irq_line (INT%d, state %d)\n", cpunum_get_active(), irqline+1, state)); if (state == CLEAR_LINE) { @@ -562,7 +562,7 @@ static void tms7000_service_timer1( void ) if( --tms7000.t1_decrementer < 0 ) /* Decrement timer1 register and check for underflow */ { tms7000.t1_decrementer = tms7000.pf[2]; /* Reload decrementer (8 bit) */ - cpunum_set_input_line(Machine, cpu_getactivecpu(), TMS7000_IRQ2_LINE, HOLD_LINE); + cpunum_set_input_line(Machine, cpunum_get_active(), TMS7000_IRQ2_LINE, HOLD_LINE); //LOG( ("tms7000: trigger int2 (cycles: %d)\t%d\tdelta %d\n", activecpu_gettotalcycles(), activecpu_gettotalcycles() - tick, tms7000_cycles_per_INT2-(activecpu_gettotalcycles() - tick) ); //tick = activecpu_gettotalcycles() ); /* Also, cascade out to timer 2 - timer 2 unimplemented */ diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h index 1d96f88ebe6..f3790aff75c 100644 --- a/src/emu/cpu/tms9900/99xxcore.h +++ b/src/emu/cpu/tms9900/99xxcore.h @@ -95,19 +95,19 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX ti990_10 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( ti990_10 ) - #define TMS99XX_CPU_NAME "TI990/10" + #define TMS99XX_cpu_get_name "TI990/10" #elif (TMS99XX_MODEL == TMS9900_ID) #define TMS99XX_PREFIX tms9900 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9900 ) - #define TMS99XX_CPU_NAME "TMS9900" + #define TMS99XX_cpu_get_name "TMS9900" #elif (TMS99XX_MODEL == TMS9940_ID) #define TMS99XX_PREFIX tms9940 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9940 ) - #define TMS99XX_CPU_NAME "TMS9940" + #define TMS99XX_cpu_get_name "TMS9940" #error "tms9940 is not yet supported" @@ -115,13 +115,13 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms9980a #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9980a ) - #define TMS99XX_CPU_NAME "TMS9980A/TMS9981" + #define TMS99XX_cpu_get_name "TMS9980A/TMS9981" #elif (TMS99XX_MODEL == TMS9985_ID) #define TMS99XX_PREFIX tms9985 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9985 ) - #define TMS99XX_CPU_NAME "TMS9985" + #define TMS99XX_cpu_get_name "TMS9985" #error "tms9985 is not yet supported" @@ -129,7 +129,7 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms9989 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9989 ) - #define TMS99XX_CPU_NAME "TMS9989" + #define TMS99XX_cpu_get_name "TMS9989" #error "tms9989 is not yet supported" @@ -137,13 +137,13 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms9995 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9995 ) - #define TMS99XX_CPU_NAME "TMS9995" + #define TMS99XX_cpu_get_name "TMS9995" #elif (TMS99XX_MODEL == TMS99000_ID) #define TMS99XX_PREFIX tms99000 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms99000 ) - #define TMS99XX_CPU_NAME "TMS99000" + #define TMS99XX_cpu_get_name "TMS99000" #error "tms99000 is not yet supported" @@ -151,7 +151,7 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms99105a #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms99105a ) - #define TMS99XX_CPU_NAME "TMS99105A" + #define TMS99XX_cpu_get_name "TMS99105A" #error "tms99105a is not yet supported" @@ -159,7 +159,7 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms99110a #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms99110a ) - #define TMS99XX_CPU_NAME "TMS99110A" + #define TMS99XX_cpu_get_name "TMS99110A" #error "tms99110a is not yet supported" @@ -932,7 +932,7 @@ WRITE8_HANDLER(tms9995_internal2_w) /* read decrementer */ if (I.decrementer_enabled && !(I.flag & 1)) /* timer mode, timer enabled */ - return ceil(ATTOTIME_TO_CYCLES(cpu_getactivecpu(), attotime_div(timer_timeleft(I.timer), 16))); + return ceil(ATTOTIME_TO_CYCLES(cpunum_get_active(), attotime_div(timer_timeleft(I.timer), 16))); else /* event counter mode or timer mode, timer disabled */ return I.decrementer_count; @@ -996,7 +996,7 @@ WRITE8_HANDLER(tms9995_internal2_w) if (I.decrementer_enabled && !(I.flag & 1)) /* timer mode, timer enabled */ - value = ceil(ATTOTIME_TO_CYCLES(cpu_getactivecpu(), attotime_div(timer_timeleft(I.timer), 16))); + value = ceil(ATTOTIME_TO_CYCLES(cpunum_get_active(), attotime_div(timer_timeleft(I.timer), 16))); else /* event counter mode or timer mode, timer disabled */ value = I.decrementer_count; @@ -1827,7 +1827,7 @@ static void reset_decrementer(void) if (I.decrementer_enabled && ! (I.flag & 1)) { /* timer */ - attotime period = ATTOTIME_IN_CYCLES(I.decrementer_interval * 16L, cpu_getactivecpu()); + attotime period = ATTOTIME_IN_CYCLES(I.decrementer_interval * 16L, cpunum_get_active()); timer_adjust_periodic(I.timer, period, 0, period); } } @@ -4815,7 +4815,7 @@ void TMS99XX_GET_INFO(UINT32 state, cpuinfo *info) case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &TMS99XX_ICOUNT; break; /* --- the following bits of info are returned as NULL-terminated strings --- */ - case CPUINFO_STR_NAME: strcpy(info->s, TMS99XX_CPU_NAME); break; + case CPUINFO_STR_NAME: strcpy(info->s, TMS99XX_cpu_get_name); break; case CPUINFO_STR_CORE_FAMILY: strcpy(info->s, "Texas Instruments 9900"); break; case CPUINFO_STR_CORE_VERSION: strcpy(info->s, "2.0"); break; case CPUINFO_STR_CORE_FILE: strcpy(info->s, __FILE__); break; diff --git a/src/emu/cpu/upd7810/7810ops.c b/src/emu/cpu/upd7810/7810ops.c index 38a05613d1e..866563a1ab7 100644 --- a/src/emu/cpu/upd7810/7810ops.c +++ b/src/emu/cpu/upd7810/7810ops.c @@ -9,12 +9,12 @@ static void illegal(void) { - logerror("uPD7810 #%d: illegal opcode %02x at PC:%04x\n", cpu_getactivecpu(), OP, PC); + logerror("uPD7810 #%d: illegal opcode %02x at PC:%04x\n", cpunum_get_active(), OP, PC); } static void illegal2(void) { - logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, OP2, PC); + logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpunum_get_active(), OP, OP2, PC); } /* prefix 48 */ @@ -8654,7 +8654,7 @@ static void SKN_bit(void) val = RP( UPD7807_PORTT ); break; default: - logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, imm, PC); + logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpunum_get_active(), OP, imm, PC); val = 0; break; } @@ -8708,7 +8708,7 @@ static void SETB(void) // PT is input only // break; default: - logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, imm, PC); + logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpunum_get_active(), OP, imm, PC); break; } } @@ -8758,7 +8758,7 @@ static void CLR(void) // PT is input only // break; default: - logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, imm, PC); + logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpunum_get_active(), OP, imm, PC); break; } } @@ -8807,7 +8807,7 @@ static void SK_bit(void) val = RP( UPD7807_PORTT ); break; default: - logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpu_getactivecpu(), OP, imm, PC); + logerror("uPD7810 #%d: illegal opcode %02x %02x at PC:%04x\n", cpunum_get_active(), OP, imm, PC); val = 0; break; } diff --git a/src/emu/cpu/v30mz/v30mz.c b/src/emu/cpu/v30mz/v30mz.c index 1e8d74d6d7e..84ee75a1808 100644 --- a/src/emu/cpu/v30mz/v30mz.c +++ b/src/emu/cpu/v30mz/v30mz.c @@ -246,13 +246,13 @@ OP( 0x0f, i_pre_nec ) { UINT32 ModRM, tmp, tmp2; case 0x26 : CMP4S; break; case 0x28 : ModRM = FETCH; tmp = GetRMByte(ModRM); tmp <<= 4; tmp |= I.regs.b[AL] & 0xf; I.regs.b[AL] = (I.regs.b[AL] & 0xf0) | ((tmp>>8)&0xf); tmp &= 0xff; PutbackRMByte(ModRM,tmp); CLKM(9,15); break; case 0x2a : ModRM = FETCH; tmp = GetRMByte(ModRM); tmp2 = (I.regs.b[AL] & 0xf)<<4; I.regs.b[AL] = (I.regs.b[AL] & 0xf0) | (tmp&0xf); tmp = tmp2 | (tmp>>4); PutbackRMByte(ModRM,tmp); CLKM(13,19); break; - case 0x31 : ModRM = FETCH; ModRM=0; logerror("%06x: Unimplemented bitfield INS\n",activecpu_get_pc()); break; - case 0x33 : ModRM = FETCH; ModRM=0; logerror("%06x: Unimplemented bitfield EXT\n",activecpu_get_pc()); break; + case 0x31 : ModRM = FETCH; ModRM=0; logerror("%06x: Unimplemented bitfield INS\n",cpu_get_pc(Machine->activecpu)); break; + case 0x33 : ModRM = FETCH; ModRM=0; logerror("%06x: Unimplemented bitfield EXT\n",cpu_get_pc(Machine->activecpu)); break; case 0x92 : CLK(2); break; /* V25/35 FINT */ - case 0xe0 : ModRM = FETCH; ModRM=0; logerror("%06x: V33 unimplemented BRKXA (break to expansion address)\n",activecpu_get_pc()); break; - case 0xf0 : ModRM = FETCH; ModRM=0; logerror("%06x: V33 unimplemented RETXA (return from expansion address)\n",activecpu_get_pc()); break; - case 0xff : ModRM = FETCH; ModRM=0; logerror("%06x: unimplemented BRKEM (break to 8080 emulation mode)\n",activecpu_get_pc()); break; - default: logerror("%06x: Unknown V20 instruction\n",activecpu_get_pc()); break; + case 0xe0 : ModRM = FETCH; ModRM=0; logerror("%06x: V33 unimplemented BRKXA (break to expansion address)\n",cpu_get_pc(Machine->activecpu)); break; + case 0xf0 : ModRM = FETCH; ModRM=0; logerror("%06x: V33 unimplemented RETXA (return from expansion address)\n",cpu_get_pc(Machine->activecpu)); break; + case 0xff : ModRM = FETCH; ModRM=0; logerror("%06x: unimplemented BRKEM (break to 8080 emulation mode)\n",cpu_get_pc(Machine->activecpu)); break; + default: logerror("%06x: Unknown V20 instruction\n",cpu_get_pc(Machine->activecpu)); break; } } @@ -382,7 +382,7 @@ OP( 0x62, i_chkind ) { } else { CLK(13); } - logerror("%06x: bound %04x high %04x low %04x tmp\n",activecpu_get_pc(),high,low,tmp); + logerror("%06x: bound %04x high %04x low %04x tmp\n",cpu_get_pc(Machine->activecpu),high,low,tmp); } OP( 0x64, i_repnc ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; switch(next) { /* Segments */ @@ -407,7 +407,7 @@ OP( 0x64, i_repnc ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; case 0xad: CLK(2); if (c) do { i_lodsw(); c--; } while (c>0 && !CF); I.regs.w[CW]=c; break; case 0xae: CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && !CF); I.regs.w[CW]=c; break; case 0xaf: CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && !CF); I.regs.w[CW]=c; break; - default: logerror("%06x: REPNC invalid\n",activecpu_get_pc()); nec_instruction[next](); + default: logerror("%06x: REPNC invalid\n",cpu_get_pc(Machine->activecpu)); nec_instruction[next](); } seg_prefix=FALSE; } @@ -435,7 +435,7 @@ OP( 0x65, i_repc ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; case 0xad: CLK(2); if (c) do { i_lodsw(); c--; } while (c>0 && CF); I.regs.w[CW]=c; break; case 0xae: CLK(2); if (c) do { i_scasb(); c--; } while (c>0 && CF); I.regs.w[CW]=c; break; case 0xaf: CLK(2); if (c) do { i_scasw(); c--; } while (c>0 && CF); I.regs.w[CW]=c; break; - default: logerror("%06x: REPC invalid\n",activecpu_get_pc()); nec_instruction[next](); + default: logerror("%06x: REPC invalid\n",cpu_get_pc(Machine->activecpu)); nec_instruction[next](); } seg_prefix=FALSE; } @@ -539,7 +539,7 @@ OP( 0x8e, i_mov_sregw ) { UINT16 src; GetModRM; src = GetRMWord(ModRM); CLKM(2,3 case 0x08: I.sregs[CS] = src; break; /* mov cs,ew */ case 0x10: I.sregs[SS] = src; break; /* mov ss,ew */ case 0x18: I.sregs[DS] = src; break; /* mov ds,ew */ - default: logerror("%06x: Mov Sreg - Invalid register\n",activecpu_get_pc()); + default: logerror("%06x: Mov Sreg - Invalid register\n",cpu_get_pc(Machine->activecpu)); } I.no_interrupt=1; } @@ -560,7 +560,7 @@ OP( 0x97, i_xchg_axdi ) { XchgAWReg(IY); CLK(3); } OP( 0x98, i_cbw ) { I.regs.b[AH] = (I.regs.b[AL] & 0x80) ? 0xff : 0; CLK(1); } OP( 0x99, i_cwd ) { I.regs.w[DW] = (I.regs.b[AH] & 0x80) ? 0xffff : 0; CLK(1); } OP( 0x9a, i_call_far ) { UINT32 tmp, tmp2; FETCHWORD(tmp); FETCHWORD(tmp2); PUSH(I.sregs[CS]); PUSH(I.ip); I.ip = (WORD)tmp; I.sregs[CS] = (WORD)tmp2; CHANGE_PC; CLK(10); } -OP( 0x9b, i_wait ) { logerror("%06x: Hardware POLL\n",activecpu_get_pc()); } +OP( 0x9b, i_wait ) { logerror("%06x: Hardware POLL\n",cpu_get_pc(Machine->activecpu)); } OP( 0x9c, i_pushf ) { PUSH( CompressFlags() ); CLK(2); } OP( 0x9d, i_popf ) { UINT32 tmp; POP(tmp); ExpandFlags(tmp); CLK(3); if (I.TF) nec_trap(); } OP( 0x9e, i_sahf ) { UINT32 tmp = (CompressFlags() & 0xff00) | (I.regs.b[AH] & 0xd5); ExpandFlags(tmp); CLK(4); } @@ -614,7 +614,7 @@ OP( 0xc0, i_rotshft_bd8 ) { case 0x18: do { RORC_BYTE; c--; } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; case 0x20: SHL_BYTE(c); break; case 0x28: SHR_BYTE(c); break; - case 0x30: logerror("%06x: Undefined opcode 0xc0 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xc0 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_BYTE(c); break; } } @@ -631,7 +631,7 @@ OP( 0xc1, i_rotshft_wd8 ) { case 0x18: do { RORC_WORD; c--; } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; case 0x20: SHL_WORD(c); break; case 0x28: SHR_WORD(c); break; - case 0x30: logerror("%06x: Undefined opcode 0xc1 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xc1 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_WORD(c); break; } } @@ -681,7 +681,7 @@ OP( 0xd0, i_rotshft_b ) { case 0x18: RORC_BYTE; PutbackRMByte(ModRM,(BYTE)dst); I.OverVal = (src^dst)&0x80; break; case 0x20: SHL_BYTE(1); I.OverVal = (src^dst)&0x80; break; case 0x28: SHR_BYTE(1); I.OverVal = (src^dst)&0x80; break; - case 0x30: logerror("%06x: Undefined opcode 0xd0 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xd0 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_BYTE(1); I.OverVal = 0; break; } } @@ -696,7 +696,7 @@ OP( 0xd1, i_rotshft_w ) { case 0x18: RORC_WORD; PutbackRMWord(ModRM,(WORD)dst); I.OverVal = (src^dst)&0x8000; break; case 0x20: SHL_WORD(1); I.OverVal = (src^dst)&0x8000; break; case 0x28: SHR_WORD(1); I.OverVal = (src^dst)&0x8000; break; - case 0x30: logerror("%06x: Undefined opcode 0xd1 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xd1 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_WORD(1); I.OverVal = 0; break; } } @@ -712,7 +712,7 @@ OP( 0xd2, i_rotshft_bcl ) { case 0x18: do { RORC_BYTE; c--; } while (c>0); PutbackRMByte(ModRM,(BYTE)dst); break; case 0x20: SHL_BYTE(c); break; case 0x28: SHR_BYTE(c); break; - case 0x30: logerror("%06x: Undefined opcode 0xd2 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xd2 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_BYTE(c); break; } } @@ -728,16 +728,16 @@ OP( 0xd3, i_rotshft_wcl ) { case 0x18: do { RORC_WORD; c--; } while (c>0); PutbackRMWord(ModRM,(WORD)dst); break; case 0x20: SHL_WORD(c); break; case 0x28: SHR_WORD(c); break; - case 0x30: logerror("%06x: Undefined opcode 0xd3 0x30 (SHLA)\n",activecpu_get_pc()); break; + case 0x30: logerror("%06x: Undefined opcode 0xd3 0x30 (SHLA)\n",cpu_get_pc(Machine->activecpu)); break; case 0x38: SHRA_WORD(c); break; } } OP( 0xd4, i_aam ) { UINT32 mult=FETCH; mult=0; I.regs.b[AH] = I.regs.b[AL] / 10; I.regs.b[AL] %= 10; SetSZPF_Word(I.regs.w[AW]); CLK(17); } OP( 0xd5, i_aad ) { UINT32 mult=FETCH; mult=0; I.regs.b[AL] = I.regs.b[AH] * 10 + I.regs.b[AL]; I.regs.b[AH] = 0; SetSZPF_Byte(I.regs.b[AL]); CLK(5); } -OP( 0xd6, i_setalc ) { I.regs.b[AL] = (CF)?0xff:0x00; CLK(3); logerror("%06x: Undefined opcode (SETALC)\n",activecpu_get_pc()); } +OP( 0xd6, i_setalc ) { I.regs.b[AL] = (CF)?0xff:0x00; CLK(3); logerror("%06x: Undefined opcode (SETALC)\n",cpu_get_pc(Machine->activecpu)); } OP( 0xd7, i_trans ) { UINT32 dest = (I.regs.w[BW]+I.regs.b[AL])&0xffff; I.regs.b[AL] = GetMemB(DS, dest); CLK(5); } -OP( 0xd8, i_fpo ) { GetModRM; CLK(1); logerror("%06x: Unimplemented floating point control %04x\n",activecpu_get_pc(),ModRM); } +OP( 0xd8, i_fpo ) { GetModRM; CLK(1); logerror("%06x: Unimplemented floating point control %04x\n",cpu_get_pc(Machine->activecpu),ModRM); } OP( 0xe0, i_loopne ) { INT8 disp = (INT8)FETCH; I.regs.w[CW]--; if (!ZF && I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); /*CHANGE_PC;*/ CLK(6); } else CLK(3); } OP( 0xe1, i_loope ) { INT8 disp = (INT8)FETCH; I.regs.w[CW]--; if ( ZF && I.regs.w[CW]) { I.ip = (WORD)(I.ip+disp); /*CHANGE_PC;*/ CLK(6); } else CLK(3); } @@ -760,7 +760,7 @@ OP( 0xed, i_inaxdx ) { UINT32 port = I.regs.w[DW]; I.regs.b[AL] = read_port(po OP( 0xee, i_outdxal ) { write_port(I.regs.w[DW], I.regs.b[AL]); CLK(6); } OP( 0xef, i_outdxax ) { UINT32 port = I.regs.w[DW]; write_port(port, I.regs.b[AL]); write_port(port+1, I.regs.b[AH]); CLK(6); } -OP( 0xf0, i_lock ) { logerror("%06x: Warning - BUSLOCK\n",activecpu_get_pc()); I.no_interrupt=1; CLK(1); } +OP( 0xf0, i_lock ) { logerror("%06x: Warning - BUSLOCK\n",cpu_get_pc(Machine->activecpu)); I.no_interrupt=1; CLK(1); } OP( 0xf2, i_repne ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; switch(next) { /* Segments */ case 0x26: seg_prefix=TRUE; prefix_base=I.sregs[ES]<<4; next = FETCHOP; CLK(2); break; @@ -784,7 +784,7 @@ OP( 0xf2, i_repne ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; case 0xad: CLK(3); if (c) do { i_lodsw(); c--; } while (c>0); I.regs.w[CW]=c; break; case 0xae: CLK(3); if (c) do { i_scasb(); c--; } while (c>0 && ZF==0); I.regs.w[CW]=c; break; case 0xaf: CLK(3); if (c) do { i_scasw(); c--; } while (c>0 && ZF==0); I.regs.w[CW]=c; break; - default: logerror("%06x: REPNE invalid\n",activecpu_get_pc()); nec_instruction[next](); + default: logerror("%06x: REPNE invalid\n",cpu_get_pc(Machine->activecpu)); nec_instruction[next](); } seg_prefix=FALSE; } @@ -811,17 +811,17 @@ OP( 0xf3, i_repe ) { UINT32 next = FETCHOP; UINT16 c = I.regs.w[CW]; case 0xad: CLK(3); if (c) do { i_lodsw(); c--; } while (c>0); I.regs.w[CW]=c; break; case 0xae: CLK(3); if (c) do { i_scasb(); c--; } while (c>0 && ZF==1); I.regs.w[CW]=c; break; case 0xaf: CLK(3); if (c) do { i_scasw(); c--; } while (c>0 && ZF==1); I.regs.w[CW]=c; break; - default: logerror("%06x: REPE invalid\n",activecpu_get_pc()); nec_instruction[next](); + default: logerror("%06x: REPE invalid\n",cpu_get_pc(Machine->activecpu)); nec_instruction[next](); } seg_prefix=FALSE; } -OP( 0xf4, i_hlt ) { logerror("%06x: HALT\n",activecpu_get_pc()); nec_ICount=0; } +OP( 0xf4, i_hlt ) { logerror("%06x: HALT\n",cpu_get_pc(Machine->activecpu)); nec_ICount=0; } OP( 0xf5, i_cmc ) { I.CarryVal = !CF; CLK(4); } OP( 0xf6, i_f6pre ) { UINT32 tmp; UINT32 uresult,uresult2; INT32 result,result2; GetModRM; tmp = GetRMByte(ModRM); switch (ModRM & 0x38) { case 0x00: tmp &= FETCH; I.CarryVal = I.OverVal = 0; SetSZPF_Byte(tmp); CLKM(1,2); break; /* TEST */ - case 0x08: logerror("%06x: Undefined opcode 0xf6 0x08\n",activecpu_get_pc()); break; + case 0x08: logerror("%06x: Undefined opcode 0xf6 0x08\n",cpu_get_pc(Machine->activecpu)); break; case 0x10: PutbackRMByte(ModRM,~tmp); CLKM(1,3); break; /* NOT */ case 0x18: I.CarryVal=(tmp!=0); tmp=(~tmp)+1; SetSZPF_Byte(tmp); PutbackRMByte(ModRM,tmp&0xff); CLKM(1,3); break; /* NEG */ case 0x20: uresult = I.regs.b[AL]*tmp; I.regs.w[AW]=(WORD)uresult; I.CarryVal=I.OverVal=(I.regs.b[AH]!=0); CLKM(3,4); break; /* MULU */ @@ -835,7 +835,7 @@ OP( 0xf7, i_f7pre ) { UINT32 tmp,tmp2; UINT32 uresult,uresult2; INT32 result,r GetModRM; tmp = GetRMWord(ModRM); switch (ModRM & 0x38) { case 0x00: FETCHWORD(tmp2); tmp &= tmp2; I.CarryVal = I.OverVal = 0; SetSZPF_Word(tmp); CLKM(1,2); break; /* TEST */ - case 0x08: logerror("%06x: Undefined opcode 0xf7 0x08\n",activecpu_get_pc()); break; + case 0x08: logerror("%06x: Undefined opcode 0xf7 0x08\n",cpu_get_pc(Machine->activecpu)); break; case 0x10: PutbackRMWord(ModRM,~tmp); CLKM(1,3); break; /* NOT */ case 0x18: I.CarryVal=(tmp!=0); tmp=(~tmp)+1; SetSZPF_Word(tmp); PutbackRMWord(ModRM,tmp&0xffff); CLKM(1,3); break; /* NEG */ case 0x20: uresult = I.regs.w[AW]*tmp; I.regs.w[AW]=uresult&0xffff; I.regs.w[DW]=((UINT32)uresult)>>16; I.CarryVal=I.OverVal=(I.regs.w[DW]!=0); CLKM(3,4); break; /* MULU */ @@ -855,7 +855,7 @@ OP( 0xfe, i_fepre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMByte(ModRM); switch(ModRM & 0x38) { case 0x00: tmp1 = tmp+1; I.OverVal = (tmp==0x7f); SetAF(tmp1,tmp,1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM,(BYTE)tmp1); CLKM(1,3); break; /* INC */ case 0x08: tmp1 = tmp-1; I.OverVal = (tmp==0x80); SetAF(tmp1,tmp,1); SetSZPF_Byte(tmp1); PutbackRMByte(ModRM,(BYTE)tmp1); CLKM(1,3); break; /* DEC */ - default: logerror("%06x: FE Pre with unimplemented mod\n",activecpu_get_pc()); + default: logerror("%06x: FE Pre with unimplemented mod\n",cpu_get_pc(Machine->activecpu)); } } OP( 0xff, i_ffpre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMWord(ModRM); @@ -867,14 +867,14 @@ OP( 0xff, i_ffpre ) { UINT32 tmp, tmp1; GetModRM; tmp=GetRMWord(ModRM); case 0x20: I.ip = tmp; CHANGE_PC; CLKM(4,5); break; /* JMP */ case 0x28: I.ip = tmp; I.sregs[CS] = GetnextRMWord; CHANGE_PC; CLK(10); break; /* JMP FAR */ case 0x30: PUSH(tmp); CLK(1); break; - default: logerror("%06x: FF Pre with unimplemented mod\n",activecpu_get_pc()); + default: logerror("%06x: FF Pre with unimplemented mod\n",cpu_get_pc(Machine->activecpu)); } } static void i_invalid(void) { nec_ICount-=10; - logerror("%06x: Invalid Opcode\n",activecpu_get_pc()); + logerror("%06x: Invalid Opcode\n",cpu_get_pc(Machine->activecpu)); } /*****************************************************************************/ diff --git a/src/emu/cpu/v30mz/v30mz.h b/src/emu/cpu/v30mz/v30mz.h index 6434d12620c..c9dbb2ac04c 100644 --- a/src/emu/cpu/v30mz/v30mz.h +++ b/src/emu/cpu/v30mz/v30mz.h @@ -280,7 +280,7 @@ typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,IXH,IXL,IYH,IYL } BREGS; unsigned di = I.regs.w[IY]; \ unsigned si = I.regs.w[IX]; \ static const UINT8 table[3]={18,19,19}; \ - if (seg_prefix) logerror("%06x: Warning: seg_prefix defined for add4s\n",activecpu_get_pc()); \ + if (seg_prefix) logerror("%06x: Warning: seg_prefix defined for add4s\n",cpu_get_pc(Machine->activecpu)); \ I.ZeroVal = I.CarryVal = 0; \ for (i=0;i<count;i++) { \ nec_ICount-=table[chip_type/8]; \ @@ -305,7 +305,7 @@ typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,IXH,IXL,IYH,IYL } BREGS; unsigned di = I.regs.w[IY]; \ unsigned si = I.regs.w[IX]; \ static const UINT8 table[3]={18,19,19}; \ - if (seg_prefix) logerror("%06x: Warning: seg_prefix defined for sub4s\n",activecpu_get_pc()); \ + if (seg_prefix) logerror("%06x: Warning: seg_prefix defined for sub4s\n",cpu_get_pc(Machine->activecpu)); \ I.ZeroVal = I.CarryVal = 0; \ for (i=0;i<count;i++) { \ nec_ICount-=table[chip_type/8]; \ @@ -335,7 +335,7 @@ typedef enum { AH,AL,CH,CL,DH,DL,BH,BL,SPH,SPL,BPH,BPL,IXH,IXL,IYH,IYL } BREGS; unsigned di = I.regs.w[IY]; \ unsigned si = I.regs.w[IX]; \ static const UINT8 table[3]={14,19,19}; \ - if (seg_prefix) logerror("%06x: Warning: seg_prefix defined for cmp4s\n",activecpu_get_pc()); \ + if (seg_prefix) logerror("%06x: Warning: seg_prefix defined for cmp4s\n",cpu_get_pc(Machine->activecpu)); \ I.ZeroVal = I.CarryVal = 0; \ for (i=0;i<count;i++) { \ nec_ICount-=table[chip_type/8]; \ diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c index a4baf8a09fb..f966046be25 100644 --- a/src/emu/cpu/vtlb.c +++ b/src/emu/cpu/vtlb.c @@ -54,8 +54,9 @@ struct _vtlb_state given CPU -------------------------------------------------*/ -vtlb_state *vtlb_alloc(int cpunum, int space, int fixed_entries, int dynamic_entries) +vtlb_state *vtlb_alloc(const device_config *cpu, int space, int fixed_entries, int dynamic_entries) { + char tempname[100]; vtlb_state *vtlb; /* allocate memory for the core structure */ @@ -66,31 +67,33 @@ vtlb_state *vtlb_alloc(int cpunum, int space, int fixed_entries, int dynamic_ent vtlb->space = space; vtlb->dynamic = dynamic_entries; vtlb->fixed = fixed_entries; - vtlb->pageshift = cpunum_page_shift(cpunum, space); - vtlb->addrwidth = cpunum_logaddr_width(cpunum, space); - vtlb->translate = (cpu_translate_func)cpunum_get_info_fct(cpunum, CPUINFO_PTR_TRANSLATE); + vtlb->pageshift = cpu_get_page_shift(cpu, space); + vtlb->addrwidth = cpu_get_logaddr_width(cpu, space); + vtlb->translate = (cpu_translate_func)cpu_get_info_fct(cpu, CPUINFO_PTR_TRANSLATE); /* validate CPU information */ assert((1 << vtlb->pageshift) > VTLB_FLAGS_MASK); assert(vtlb->translate != NULL); assert(vtlb->addrwidth > vtlb->pageshift); + state_save_combine_module_and_tag(tempname, "vtlb", cpu->tag); + /* allocate the entry array */ vtlb->live = malloc_or_die(sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries)); memset(vtlb->live, 0, sizeof(vtlb->live[0]) * (fixed_entries + dynamic_entries)); - state_save_register_item_pointer("vtlb", cpunum * ADDRESS_SPACES + space, vtlb->live, fixed_entries + dynamic_entries); + state_save_register_item_pointer(tempname, space, vtlb->live, fixed_entries + dynamic_entries); /* allocate the lookup table */ vtlb->table = malloc_or_die(sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift)); memset(vtlb->table, 0, sizeof(vtlb->table[0]) << (vtlb->addrwidth - vtlb->pageshift)); - state_save_register_item_pointer("vtlb", cpunum * ADDRESS_SPACES + space, vtlb->table, 1 << (vtlb->addrwidth - vtlb->pageshift)); + state_save_register_item_pointer(tempname, space, vtlb->table, 1 << (vtlb->addrwidth - vtlb->pageshift)); /* allocate the fixed page count array */ if (fixed_entries > 0) { vtlb->fixedpages = malloc_or_die(sizeof(vtlb->fixedpages[0]) * fixed_entries); memset(vtlb->fixedpages, 0, sizeof(vtlb->fixedpages[0]) * fixed_entries); - state_save_register_item_pointer("vtlb", cpunum * ADDRESS_SPACES + space, vtlb->fixedpages, fixed_entries); + state_save_register_item_pointer(tempname, space, vtlb->fixedpages, fixed_entries); } return vtlb; } diff --git a/src/emu/cpu/vtlb.h b/src/emu/cpu/vtlb.h index 8b51cfe2775..b539042fa15 100644 --- a/src/emu/cpu/vtlb.h +++ b/src/emu/cpu/vtlb.h @@ -56,7 +56,7 @@ typedef struct _vtlb_state vtlb_state; /* ----- initialization/teardown ----- */ /* allocate a new VTLB for the given CPU */ -vtlb_state *vtlb_alloc(int cpunum, int space, int fixed_entries, int dynamic_entries); +vtlb_state *vtlb_alloc(const device_config *cpu, int space, int fixed_entries, int dynamic_entries); /* free an allocated VTLB */ void vtlb_free(vtlb_state *vtlb); diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c index 0e99d28451f..0962153ab59 100644 --- a/src/emu/cpu/z180/z180.c +++ b/src/emu/cpu/z180/z180.c @@ -824,68 +824,68 @@ static UINT8 z180_readcontrol(offs_t port) { case Z180_CNTLA0: data = IO_CNTLA0 & Z180_CNTLA0_RMASK; - LOG(("Z180 #%d CNTLA0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CNTLA0 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_CNTLA1: data = IO_CNTLA1 & Z180_CNTLA1_RMASK; - LOG(("Z180 #%d CNTLA1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CNTLA1 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_CNTLB0: data = IO_CNTLB0 & Z180_CNTLB0_RMASK; - LOG(("Z180 #%d CNTLB0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CNTLB0 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_CNTLB1: data = IO_CNTLB1 & Z180_CNTLB1_RMASK; - LOG(("Z180 #%d CNTLB1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CNTLB1 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_STAT0: data = IO_STAT0 & Z180_STAT0_RMASK; data |= 0x02; // kludge for 20pacgal - LOG(("Z180 #%d STAT0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d STAT0 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_STAT1: data = IO_STAT1 & Z180_STAT1_RMASK; - LOG(("Z180 #%d STAT1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d STAT1 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_TDR0: data = IO_TDR0 & Z180_TDR0_RMASK; - LOG(("Z180 #%d TDR0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d TDR0 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_TDR1: data = IO_TDR1 & Z180_TDR1_RMASK; - LOG(("Z180 #%d TDR1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d TDR1 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_RDR0: data = IO_RDR0 & Z180_RDR0_RMASK; - LOG(("Z180 #%d RDR0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d RDR0 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_RDR1: data = IO_RDR1 & Z180_RDR1_RMASK; - LOG(("Z180 #%d RDR1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d RDR1 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_CNTR: data = IO_CNTR & Z180_CNTR_RMASK; - LOG(("Z180 #%d CNTR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CNTR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_TRDR: data = IO_TRDR & Z180_TRDR_RMASK; - LOG(("Z180 #%d TRDR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d TRDR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_TMDR0L: data = Z180.tmdr_value[0] & Z180_TMDR0L_RMASK; - LOG(("Z180 #%d TMDR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d TMDR0L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); /* if timer is counting, latch the MSB and set the latch flag */ if ((IO_TCR & Z180_TCR_TDE0) == 0) { @@ -925,17 +925,17 @@ data |= 0x02; // kludge for 20pacgal { Z180.read_tcr_tmdr[0] = 1; } - LOG(("Z180 #%d TMDR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d TMDR0H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_RLDR0L: data = IO_RLDR0L & Z180_RLDR0L_RMASK; - LOG(("Z180 #%d RLDR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d RLDR0L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_RLDR0H: data = IO_RLDR0H & Z180_RLDR0H_RMASK; - LOG(("Z180 #%d RLDR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d RLDR0H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_TCR: @@ -961,27 +961,27 @@ data |= 0x02; // kludge for 20pacgal Z180.read_tcr_tmdr[1] = 1; } - LOG(("Z180 #%d TCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d TCR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IO11: data = IO_IO11 & Z180_IO11_RMASK; - LOG(("Z180 #%d IO11 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IO11 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_ASEXT0: data = IO_ASEXT0 & Z180_ASEXT0_RMASK; - LOG(("Z180 #%d ASEXT0 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d ASEXT0 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_ASEXT1: data = IO_ASEXT1 & Z180_ASEXT1_RMASK; - LOG(("Z180 #%d ASEXT1 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d ASEXT1 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_TMDR1L: data = Z180.tmdr_value[1] & Z180_TMDR1L_RMASK; - LOG(("Z180 #%d TMDR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d TMDR1L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); /* if timer is counting, latch the MSB and set the latch flag */ if ((IO_TCR & Z180_TCR_TDE1) == 0) { @@ -1021,217 +1021,217 @@ data |= 0x02; // kludge for 20pacgal { Z180.read_tcr_tmdr[1] = 1; } - LOG(("Z180 #%d TMDR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d TMDR1H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_RLDR1L: data = IO_RLDR1L & Z180_RLDR1L_RMASK; - LOG(("Z180 #%d RLDR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d RLDR1L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_RLDR1H: data = IO_RLDR1H & Z180_RLDR1H_RMASK; - LOG(("Z180 #%d RLDR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d RLDR1H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_FRC: data = IO_FRC & Z180_FRC_RMASK; - LOG(("Z180 #%d FRC rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d FRC rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IO19: data = IO_IO19 & Z180_IO19_RMASK; - LOG(("Z180 #%d IO19 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IO19 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_ASTC0L: data = IO_ASTC0L & Z180_ASTC0L_RMASK; - LOG(("Z180 #%d ASTC0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d ASTC0L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_ASTC0H: data = IO_ASTC0H & Z180_ASTC0H_RMASK; - LOG(("Z180 #%d ASTC0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d ASTC0H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_ASTC1L: data = IO_ASTC1L & Z180_ASTC1L_RMASK; - LOG(("Z180 #%d ASTC1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d ASTC1L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_ASTC1H: data = IO_ASTC1H & Z180_ASTC1H_RMASK; - LOG(("Z180 #%d ASTC1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d ASTC1H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_CMR: data = IO_CMR & Z180_CMR_RMASK; - LOG(("Z180 #%d CMR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CMR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_CCR: data = IO_CCR & Z180_CCR_RMASK; - LOG(("Z180 #%d CCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CCR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_SAR0L: data = IO_SAR0L & Z180_SAR0L_RMASK; - LOG(("Z180 #%d SAR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d SAR0L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_SAR0H: data = IO_SAR0H & Z180_SAR0H_RMASK; - LOG(("Z180 #%d SAR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d SAR0H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_SAR0B: data = IO_SAR0B & Z180_SAR0B_RMASK; - LOG(("Z180 #%d SAR0B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d SAR0B rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_DAR0L: data = IO_DAR0L & Z180_DAR0L_RMASK; - LOG(("Z180 #%d DAR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d DAR0L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_DAR0H: data = IO_DAR0H & Z180_DAR0H_RMASK; - LOG(("Z180 #%d DAR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d DAR0H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_DAR0B: data = IO_DAR0B & Z180_DAR0B_RMASK; - LOG(("Z180 #%d DAR0B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d DAR0B rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_BCR0L: data = IO_BCR0L & Z180_BCR0L_RMASK; - LOG(("Z180 #%d BCR0L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d BCR0L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_BCR0H: data = IO_BCR0H & Z180_BCR0H_RMASK; - LOG(("Z180 #%d BCR0H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d BCR0H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_MAR1L: data = IO_MAR1L & Z180_MAR1L_RMASK; - LOG(("Z180 #%d MAR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d MAR1L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_MAR1H: data = IO_MAR1H & Z180_MAR1H_RMASK; - LOG(("Z180 #%d MAR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d MAR1H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_MAR1B: data = IO_MAR1B & Z180_MAR1B_RMASK; - LOG(("Z180 #%d MAR1B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d MAR1B rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IAR1L: data = IO_IAR1L & Z180_IAR1L_RMASK; - LOG(("Z180 #%d IAR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IAR1L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IAR1H: data = IO_IAR1H & Z180_IAR1H_RMASK; - LOG(("Z180 #%d IAR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IAR1H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IAR1B: data = IO_IAR1B & Z180_IAR1B_RMASK; - LOG(("Z180 #%d IAR1B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IAR1B rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_BCR1L: data = IO_BCR1L & Z180_BCR1L_RMASK; - LOG(("Z180 #%d BCR1L rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d BCR1L rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_BCR1H: data = IO_BCR1H & Z180_BCR1H_RMASK; - LOG(("Z180 #%d BCR1H rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d BCR1H rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_DSTAT: data = IO_DSTAT & Z180_DSTAT_RMASK; - LOG(("Z180 #%d DSTAT rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d DSTAT rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_DMODE: data = IO_DMODE & Z180_DMODE_RMASK; - LOG(("Z180 #%d DMODE rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d DMODE rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_DCNTL: data = IO_DCNTL & Z180_DCNTL_RMASK; - LOG(("Z180 #%d DCNTL rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d DCNTL rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IL: data = IO_IL & Z180_IL_RMASK; - LOG(("Z180 #%d IL rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IL rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_ITC: data = IO_ITC & Z180_ITC_RMASK; - LOG(("Z180 #%d ITC rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d ITC rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IO35: data = IO_IO35 & Z180_IO35_RMASK; - LOG(("Z180 #%d IO35 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IO35 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_RCR: data = IO_RCR & Z180_RCR_RMASK; - LOG(("Z180 #%d RCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d RCR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IO37: data = IO_IO37 & Z180_IO37_RMASK; - LOG(("Z180 #%d IO37 rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IO37 rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_CBR: data = IO_CBR & Z180_CBR_RMASK; - LOG(("Z180 #%d CBR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CBR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_BBR: data = IO_BBR & Z180_BBR_RMASK; - LOG(("Z180 #%d BBR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d BBR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_CBAR: data = IO_CBAR & Z180_CBAR_RMASK; - LOG(("Z180 #%d CBAR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d CBAR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IO3B: data = IO_IO3B & Z180_IO3B_RMASK; - LOG(("Z180 #%d IO3B rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IO3B rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IO3C: data = IO_IO3C & Z180_IO3C_RMASK; - LOG(("Z180 #%d IO3C rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IO3C rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IO3D: data = IO_IO3D & Z180_IO3D_RMASK; - LOG(("Z180 #%d IO3D rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IO3D rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_OMCR: data = IO_OMCR & Z180_OMCR_RMASK; - LOG(("Z180 #%d OMCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d OMCR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; case Z180_IOCR: data = IO_IOCR & Z180_IOCR_RMASK; - LOG(("Z180 #%d IOCR rd $%02x ($%02x)\n", cpu_getactivecpu(), data, Z180.io[port & 0x3f])); + LOG(("Z180 #%d IOCR rd $%02x ($%02x)\n", cpunum_get_active(), data, Z180.io[port & 0x3f])); break; } @@ -1251,251 +1251,251 @@ static void z180_writecontrol(offs_t port, UINT8 data) switch (port + Z180_CNTLA0) { case Z180_CNTLA0: - LOG(("Z180 #%d CNTLA0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTLA0_WMASK)); + LOG(("Z180 #%d CNTLA0 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CNTLA0_WMASK)); IO_CNTLA0 = (IO_CNTLA0 & ~Z180_CNTLA0_WMASK) | (data & Z180_CNTLA0_WMASK); break; case Z180_CNTLA1: - LOG(("Z180 #%d CNTLA1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTLA1_WMASK)); + LOG(("Z180 #%d CNTLA1 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CNTLA1_WMASK)); IO_CNTLA1 = (IO_CNTLA1 & ~Z180_CNTLA1_WMASK) | (data & Z180_CNTLA1_WMASK); break; case Z180_CNTLB0: - LOG(("Z180 #%d CNTLB0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTLB0_WMASK)); + LOG(("Z180 #%d CNTLB0 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CNTLB0_WMASK)); IO_CNTLB0 = (IO_CNTLB0 & ~Z180_CNTLB0_WMASK) | (data & Z180_CNTLB0_WMASK); break; case Z180_CNTLB1: - LOG(("Z180 #%d CNTLB1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTLB1_WMASK)); + LOG(("Z180 #%d CNTLB1 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CNTLB1_WMASK)); IO_CNTLB1 = (IO_CNTLB1 & ~Z180_CNTLB1_WMASK) | (data & Z180_CNTLB1_WMASK); break; case Z180_STAT0: - LOG(("Z180 #%d STAT0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_STAT0_WMASK)); + LOG(("Z180 #%d STAT0 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_STAT0_WMASK)); IO_STAT0 = (IO_STAT0 & ~Z180_STAT0_WMASK) | (data & Z180_STAT0_WMASK); break; case Z180_STAT1: - LOG(("Z180 #%d STAT1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_STAT1_WMASK)); + LOG(("Z180 #%d STAT1 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_STAT1_WMASK)); IO_STAT1 = (IO_STAT1 & ~Z180_STAT1_WMASK) | (data & Z180_STAT1_WMASK); break; case Z180_TDR0: - LOG(("Z180 #%d TDR0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TDR0_WMASK)); + LOG(("Z180 #%d TDR0 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_TDR0_WMASK)); IO_TDR0 = (IO_TDR0 & ~Z180_TDR0_WMASK) | (data & Z180_TDR0_WMASK); break; case Z180_TDR1: - LOG(("Z180 #%d TDR1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TDR1_WMASK)); + LOG(("Z180 #%d TDR1 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_TDR1_WMASK)); IO_TDR1 = (IO_TDR1 & ~Z180_TDR1_WMASK) | (data & Z180_TDR1_WMASK); break; case Z180_RDR0: - LOG(("Z180 #%d RDR0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RDR0_WMASK)); + LOG(("Z180 #%d RDR0 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_RDR0_WMASK)); IO_RDR0 = (IO_RDR0 & ~Z180_RDR0_WMASK) | (data & Z180_RDR0_WMASK); break; case Z180_RDR1: - LOG(("Z180 #%d RDR1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RDR1_WMASK)); + LOG(("Z180 #%d RDR1 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_RDR1_WMASK)); IO_RDR1 = (IO_RDR1 & ~Z180_RDR1_WMASK) | (data & Z180_RDR1_WMASK); break; case Z180_CNTR: - LOG(("Z180 #%d CNTR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CNTR_WMASK)); + LOG(("Z180 #%d CNTR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CNTR_WMASK)); IO_CNTR = (IO_CNTR & ~Z180_CNTR_WMASK) | (data & Z180_CNTR_WMASK); break; case Z180_TRDR: - LOG(("Z180 #%d TRDR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TRDR_WMASK)); + LOG(("Z180 #%d TRDR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_TRDR_WMASK)); IO_TRDR = (IO_TRDR & ~Z180_TRDR_WMASK) | (data & Z180_TRDR_WMASK); break; case Z180_TMDR0L: - LOG(("Z180 #%d TMDR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TMDR0L_WMASK)); + LOG(("Z180 #%d TMDR0L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_TMDR0L_WMASK)); IO_TMDR0L = data & Z180_TMDR0L_WMASK; Z180.tmdr_value[0] = (Z180.tmdr_value[0] & 0xff00) | IO_TMDR0L; break; case Z180_TMDR0H: - LOG(("Z180 #%d TMDR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TMDR0H_WMASK)); + LOG(("Z180 #%d TMDR0H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_TMDR0H_WMASK)); IO_TMDR0H = data & Z180_TMDR0H_WMASK; Z180.tmdr_value[0] = (Z180.tmdr_value[0] & 0x00ff) | (IO_TMDR0H << 8); break; case Z180_RLDR0L: - LOG(("Z180 #%d RLDR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RLDR0L_WMASK)); + LOG(("Z180 #%d RLDR0L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_RLDR0L_WMASK)); IO_RLDR0L = (IO_RLDR0L & ~Z180_RLDR0L_WMASK) | (data & Z180_RLDR0L_WMASK); break; case Z180_RLDR0H: - LOG(("Z180 #%d RLDR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RLDR0H_WMASK)); + LOG(("Z180 #%d RLDR0H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_RLDR0H_WMASK)); IO_RLDR0H = (IO_RLDR0H & ~Z180_RLDR0H_WMASK) | (data & Z180_RLDR0H_WMASK); break; case Z180_TCR: - LOG(("Z180 #%d TCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TCR_WMASK)); + LOG(("Z180 #%d TCR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_TCR_WMASK)); IO_TCR = (IO_TCR & ~Z180_TCR_WMASK) | (data & Z180_TCR_WMASK); break; case Z180_IO11: - LOG(("Z180 #%d IO11 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO11_WMASK)); + LOG(("Z180 #%d IO11 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IO11_WMASK)); IO_IO11 = (IO_IO11 & ~Z180_IO11_WMASK) | (data & Z180_IO11_WMASK); break; case Z180_ASEXT0: - LOG(("Z180 #%d ASEXT0 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASEXT0_WMASK)); + LOG(("Z180 #%d ASEXT0 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_ASEXT0_WMASK)); IO_ASEXT0 = (IO_ASEXT0 & ~Z180_ASEXT0_WMASK) | (data & Z180_ASEXT0_WMASK); break; case Z180_ASEXT1: - LOG(("Z180 #%d ASEXT1 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASEXT1_WMASK)); + LOG(("Z180 #%d ASEXT1 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_ASEXT1_WMASK)); IO_ASEXT1 = (IO_ASEXT1 & ~Z180_ASEXT1_WMASK) | (data & Z180_ASEXT1_WMASK); break; case Z180_TMDR1L: - LOG(("Z180 #%d TMDR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TMDR1L_WMASK)); + LOG(("Z180 #%d TMDR1L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_TMDR1L_WMASK)); IO_TMDR1L = data & Z180_TMDR1L_WMASK; Z180.tmdr_value[1] = (Z180.tmdr_value[1] & 0xff00) | IO_TMDR1L; break; case Z180_TMDR1H: - LOG(("Z180 #%d TMDR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_TMDR1H_WMASK)); + LOG(("Z180 #%d TMDR1H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_TMDR1H_WMASK)); IO_TMDR1H = data & Z180_TMDR1H_WMASK; Z180.tmdr_value[1] = (Z180.tmdr_value[1] & 0x00ff) | IO_TMDR1H; break; case Z180_RLDR1L: - LOG(("Z180 #%d RLDR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RLDR1L_WMASK)); + LOG(("Z180 #%d RLDR1L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_RLDR1L_WMASK)); IO_RLDR1L = (IO_RLDR1L & ~Z180_RLDR1L_WMASK) | (data & Z180_RLDR1L_WMASK); break; case Z180_RLDR1H: - LOG(("Z180 #%d RLDR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RLDR1H_WMASK)); + LOG(("Z180 #%d RLDR1H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_RLDR1H_WMASK)); IO_RLDR1H = (IO_RLDR1H & ~Z180_RLDR1H_WMASK) | (data & Z180_RLDR1H_WMASK); break; case Z180_FRC: - LOG(("Z180 #%d FRC wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_FRC_WMASK)); + LOG(("Z180 #%d FRC wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_FRC_WMASK)); IO_FRC = (IO_FRC & ~Z180_FRC_WMASK) | (data & Z180_FRC_WMASK); break; case Z180_IO19: - LOG(("Z180 #%d IO19 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO19_WMASK)); + LOG(("Z180 #%d IO19 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IO19_WMASK)); IO_IO19 = (IO_IO19 & ~Z180_IO19_WMASK) | (data & Z180_IO19_WMASK); break; case Z180_ASTC0L: - LOG(("Z180 #%d ASTC0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASTC0L_WMASK)); + LOG(("Z180 #%d ASTC0L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_ASTC0L_WMASK)); IO_ASTC0L = (IO_ASTC0L & ~Z180_ASTC0L_WMASK) | (data & Z180_ASTC0L_WMASK); break; case Z180_ASTC0H: - LOG(("Z180 #%d ASTC0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASTC0H_WMASK)); + LOG(("Z180 #%d ASTC0H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_ASTC0H_WMASK)); IO_ASTC0H = (IO_ASTC0H & ~Z180_ASTC0H_WMASK) | (data & Z180_ASTC0H_WMASK); break; case Z180_ASTC1L: - LOG(("Z180 #%d ASTC1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASTC1L_WMASK)); + LOG(("Z180 #%d ASTC1L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_ASTC1L_WMASK)); IO_ASTC1L = (IO_ASTC1L & ~Z180_ASTC1L_WMASK) | (data & Z180_ASTC1L_WMASK); break; case Z180_ASTC1H: - LOG(("Z180 #%d ASTC1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ASTC1H_WMASK)); + LOG(("Z180 #%d ASTC1H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_ASTC1H_WMASK)); IO_ASTC1H = (IO_ASTC1H & ~Z180_ASTC1H_WMASK) | (data & Z180_ASTC1H_WMASK); break; case Z180_CMR: - LOG(("Z180 #%d CMR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CMR_WMASK)); + LOG(("Z180 #%d CMR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CMR_WMASK)); IO_CMR = (IO_CMR & ~Z180_CMR_WMASK) | (data & Z180_CMR_WMASK); break; case Z180_CCR: - LOG(("Z180 #%d CCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CCR_WMASK)); + LOG(("Z180 #%d CCR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CCR_WMASK)); IO_CCR = (IO_CCR & ~Z180_CCR_WMASK) | (data & Z180_CCR_WMASK); break; case Z180_SAR0L: - LOG(("Z180 #%d SAR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_SAR0L_WMASK)); + LOG(("Z180 #%d SAR0L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_SAR0L_WMASK)); IO_SAR0L = (IO_SAR0L & ~Z180_SAR0L_WMASK) | (data & Z180_SAR0L_WMASK); break; case Z180_SAR0H: - LOG(("Z180 #%d SAR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_SAR0H_WMASK)); + LOG(("Z180 #%d SAR0H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_SAR0H_WMASK)); IO_SAR0H = (IO_SAR0H & ~Z180_SAR0H_WMASK) | (data & Z180_SAR0H_WMASK); break; case Z180_SAR0B: - LOG(("Z180 #%d SAR0B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_SAR0B_WMASK)); + LOG(("Z180 #%d SAR0B wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_SAR0B_WMASK)); IO_SAR0B = (IO_SAR0B & ~Z180_SAR0B_WMASK) | (data & Z180_SAR0B_WMASK); break; case Z180_DAR0L: - LOG(("Z180 #%d DAR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DAR0L_WMASK)); + LOG(("Z180 #%d DAR0L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_DAR0L_WMASK)); IO_DAR0L = (IO_DAR0L & ~Z180_DAR0L_WMASK) | (data & Z180_DAR0L_WMASK); break; case Z180_DAR0H: - LOG(("Z180 #%d DAR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DAR0H_WMASK)); + LOG(("Z180 #%d DAR0H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_DAR0H_WMASK)); IO_DAR0H = (IO_DAR0H & ~Z180_DAR0H_WMASK) | (data & Z180_DAR0H_WMASK); break; case Z180_DAR0B: - LOG(("Z180 #%d DAR0B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DAR0B_WMASK)); + LOG(("Z180 #%d DAR0B wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_DAR0B_WMASK)); IO_DAR0B = (IO_DAR0B & ~Z180_DAR0B_WMASK) | (data & Z180_DAR0B_WMASK); break; case Z180_BCR0L: - LOG(("Z180 #%d BCR0L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BCR0L_WMASK)); + LOG(("Z180 #%d BCR0L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_BCR0L_WMASK)); IO_BCR0L = (IO_BCR0L & ~Z180_BCR0L_WMASK) | (data & Z180_BCR0L_WMASK); break; case Z180_BCR0H: - LOG(("Z180 #%d BCR0H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BCR0H_WMASK)); + LOG(("Z180 #%d BCR0H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_BCR0H_WMASK)); IO_BCR0H = (IO_BCR0H & ~Z180_BCR0H_WMASK) | (data & Z180_BCR0H_WMASK); break; case Z180_MAR1L: - LOG(("Z180 #%d MAR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_MAR1L_WMASK)); + LOG(("Z180 #%d MAR1L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_MAR1L_WMASK)); IO_MAR1L = (IO_MAR1L & ~Z180_MAR1L_WMASK) | (data & Z180_MAR1L_WMASK); break; case Z180_MAR1H: - LOG(("Z180 #%d MAR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_MAR1H_WMASK)); + LOG(("Z180 #%d MAR1H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_MAR1H_WMASK)); IO_MAR1H = (IO_MAR1H & ~Z180_MAR1H_WMASK) | (data & Z180_MAR1H_WMASK); break; case Z180_MAR1B: - LOG(("Z180 #%d MAR1B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_MAR1B_WMASK)); + LOG(("Z180 #%d MAR1B wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_MAR1B_WMASK)); IO_MAR1B = (IO_MAR1B & ~Z180_MAR1B_WMASK) | (data & Z180_MAR1B_WMASK); break; case Z180_IAR1L: - LOG(("Z180 #%d IAR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IAR1L_WMASK)); + LOG(("Z180 #%d IAR1L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IAR1L_WMASK)); IO_IAR1L = (IO_IAR1L & ~Z180_IAR1L_WMASK) | (data & Z180_IAR1L_WMASK); break; case Z180_IAR1H: - LOG(("Z180 #%d IAR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IAR1H_WMASK)); + LOG(("Z180 #%d IAR1H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IAR1H_WMASK)); IO_IAR1H = (IO_IAR1H & ~Z180_IAR1H_WMASK) | (data & Z180_IAR1H_WMASK); break; case Z180_IAR1B: - LOG(("Z180 #%d IAR1B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IAR1B_WMASK)); + LOG(("Z180 #%d IAR1B wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IAR1B_WMASK)); IO_IAR1B = (IO_IAR1B & ~Z180_IAR1B_WMASK) | (data & Z180_IAR1B_WMASK); break; case Z180_BCR1L: - LOG(("Z180 #%d BCR1L wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BCR1L_WMASK)); + LOG(("Z180 #%d BCR1L wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_BCR1L_WMASK)); IO_BCR1L = (IO_BCR1L & ~Z180_BCR1L_WMASK) | (data & Z180_BCR1L_WMASK); break; case Z180_BCR1H: - LOG(("Z180 #%d BCR1H wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BCR1H_WMASK)); + LOG(("Z180 #%d BCR1H wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_BCR1H_WMASK)); IO_BCR1H = (IO_BCR1H & ~Z180_BCR1H_WMASK) | (data & Z180_BCR1H_WMASK); break; case Z180_DSTAT: - LOG(("Z180 #%d DSTAT wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DSTAT_WMASK)); + LOG(("Z180 #%d DSTAT wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_DSTAT_WMASK)); IO_DSTAT = (IO_DSTAT & ~Z180_DSTAT_WMASK) | (data & Z180_DSTAT_WMASK); if ((data & (Z180_DSTAT_DE1 | Z180_DSTAT_DWE1)) == Z180_DSTAT_DE1) IO_DSTAT |= Z180_DSTAT_DME; /* DMA enable */ @@ -1504,80 +1504,80 @@ static void z180_writecontrol(offs_t port, UINT8 data) break; case Z180_DMODE: - LOG(("Z180 #%d DMODE wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DMODE_WMASK)); + LOG(("Z180 #%d DMODE wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_DMODE_WMASK)); IO_DMODE = (IO_DMODE & ~Z180_DMODE_WMASK) | (data & Z180_DMODE_WMASK); break; case Z180_DCNTL: - LOG(("Z180 #%d DCNTL wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_DCNTL_WMASK)); + LOG(("Z180 #%d DCNTL wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_DCNTL_WMASK)); IO_DCNTL = (IO_DCNTL & ~Z180_DCNTL_WMASK) | (data & Z180_DCNTL_WMASK); break; case Z180_IL: - LOG(("Z180 #%d IL wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IL_WMASK)); + LOG(("Z180 #%d IL wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IL_WMASK)); IO_IL = (IO_IL & ~Z180_IL_WMASK) | (data & Z180_IL_WMASK); break; case Z180_ITC: - LOG(("Z180 #%d ITC wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_ITC_WMASK)); + LOG(("Z180 #%d ITC wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_ITC_WMASK)); IO_ITC = (IO_ITC & ~Z180_ITC_WMASK) | (data & Z180_ITC_WMASK); break; case Z180_IO35: - LOG(("Z180 #%d IO35 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO35_WMASK)); + LOG(("Z180 #%d IO35 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IO35_WMASK)); IO_IO35 = (IO_IO35 & ~Z180_IO35_WMASK) | (data & Z180_IO35_WMASK); break; case Z180_RCR: - LOG(("Z180 #%d RCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_RCR_WMASK)); + LOG(("Z180 #%d RCR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_RCR_WMASK)); IO_RCR = (IO_RCR & ~Z180_RCR_WMASK) | (data & Z180_RCR_WMASK); break; case Z180_IO37: - LOG(("Z180 #%d IO37 wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO37_WMASK)); + LOG(("Z180 #%d IO37 wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IO37_WMASK)); IO_IO37 = (IO_IO37 & ~Z180_IO37_WMASK) | (data & Z180_IO37_WMASK); break; case Z180_CBR: - LOG(("Z180 #%d CBR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CBR_WMASK)); + LOG(("Z180 #%d CBR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CBR_WMASK)); IO_CBR = (IO_CBR & ~Z180_CBR_WMASK) | (data & Z180_CBR_WMASK); z180_mmu(); break; case Z180_BBR: - LOG(("Z180 #%d BBR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_BBR_WMASK)); + LOG(("Z180 #%d BBR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_BBR_WMASK)); IO_BBR = (IO_BBR & ~Z180_BBR_WMASK) | (data & Z180_BBR_WMASK); z180_mmu(); break; case Z180_CBAR: - LOG(("Z180 #%d CBAR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_CBAR_WMASK)); + LOG(("Z180 #%d CBAR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_CBAR_WMASK)); IO_CBAR = (IO_CBAR & ~Z180_CBAR_WMASK) | (data & Z180_CBAR_WMASK); z180_mmu(); break; case Z180_IO3B: - LOG(("Z180 #%d IO3B wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO3B_WMASK)); + LOG(("Z180 #%d IO3B wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IO3B_WMASK)); IO_IO3B = (IO_IO3B & ~Z180_IO3B_WMASK) | (data & Z180_IO3B_WMASK); break; case Z180_IO3C: - LOG(("Z180 #%d IO3C wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO3C_WMASK)); + LOG(("Z180 #%d IO3C wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IO3C_WMASK)); IO_IO3C = (IO_IO3C & ~Z180_IO3C_WMASK) | (data & Z180_IO3C_WMASK); break; case Z180_IO3D: - LOG(("Z180 #%d IO3D wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IO3D_WMASK)); + LOG(("Z180 #%d IO3D wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IO3D_WMASK)); IO_IO3D = (IO_IO3D & ~Z180_IO3D_WMASK) | (data & Z180_IO3D_WMASK); break; case Z180_OMCR: - LOG(("Z180 #%d OMCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_OMCR_WMASK)); + LOG(("Z180 #%d OMCR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_OMCR_WMASK)); IO_OMCR = (IO_OMCR & ~Z180_OMCR_WMASK) | (data & Z180_OMCR_WMASK); break; case Z180_IOCR: - LOG(("Z180 #%d IOCR wr $%02x ($%02x)\n", cpu_getactivecpu(), data, data & Z180_IOCR_WMASK)); + LOG(("Z180 #%d IOCR wr $%02x ($%02x)\n", cpunum_get_active(), data, data & Z180_IOCR_WMASK)); IO_IOCR = (IO_IOCR & ~Z180_IOCR_WMASK) | (data & Z180_IOCR_WMASK); break; } @@ -1780,120 +1780,120 @@ static void z180_write_iolines(UINT32 data) /* I/O asynchronous clock 0 (active high) or DREQ0 (mux) */ if (changes & Z180_CKA0) { - LOG(("Z180 #%d CKA0 %d\n", cpu_getactivecpu(), data & Z180_CKA0 ? 1 : 0)); + LOG(("Z180 #%d CKA0 %d\n", cpunum_get_active(), data & Z180_CKA0 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_CKA0) | (data & Z180_CKA0); } /* I/O asynchronous clock 1 (active high) or TEND1 (mux) */ if (changes & Z180_CKA1) { - LOG(("Z180 #%d CKA1 %d\n", cpu_getactivecpu(), data & Z180_CKA1 ? 1 : 0)); + LOG(("Z180 #%d CKA1 %d\n", cpunum_get_active(), data & Z180_CKA1 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_CKA1) | (data & Z180_CKA1); } /* I/O serial clock (active high) */ if (changes & Z180_CKS) { - LOG(("Z180 #%d CKS %d\n", cpu_getactivecpu(), data & Z180_CKS ? 1 : 0)); + LOG(("Z180 #%d CKS %d\n", cpunum_get_active(), data & Z180_CKS ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_CKS) | (data & Z180_CKS); } /* I clear to send 0 (active low) */ if (changes & Z180_CTS0) { - LOG(("Z180 #%d CTS0 %d\n", cpu_getactivecpu(), data & Z180_CTS0 ? 1 : 0)); + LOG(("Z180 #%d CTS0 %d\n", cpunum_get_active(), data & Z180_CTS0 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_CTS0) | (data & Z180_CTS0); } /* I clear to send 1 (active low) or RXS (mux) */ if (changes & Z180_CTS1) { - LOG(("Z180 #%d CTS1 %d\n", cpu_getactivecpu(), data & Z180_CTS1 ? 1 : 0)); + LOG(("Z180 #%d CTS1 %d\n", cpunum_get_active(), data & Z180_CTS1 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_CTS1) | (data & Z180_CTS1); } /* I data carrier detect (active low) */ if (changes & Z180_DCD0) { - LOG(("Z180 #%d DCD0 %d\n", cpu_getactivecpu(), data & Z180_DCD0 ? 1 : 0)); + LOG(("Z180 #%d DCD0 %d\n", cpunum_get_active(), data & Z180_DCD0 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_DCD0) | (data & Z180_DCD0); } /* I data request DMA ch 0 (active low) or CKA0 (mux) */ if (changes & Z180_DREQ0) { - LOG(("Z180 #%d DREQ0 %d\n", cpu_getactivecpu(), data & Z180_DREQ0 ? 1 : 0)); + LOG(("Z180 #%d DREQ0 %d\n", cpunum_get_active(), data & Z180_DREQ0 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_DREQ0) | (data & Z180_DREQ0); } /* I data request DMA ch 1 (active low) */ if (changes & Z180_DREQ1) { - LOG(("Z180 #%d DREQ1 %d\n", cpu_getactivecpu(), data & Z180_DREQ1 ? 1 : 0)); + LOG(("Z180 #%d DREQ1 %d\n", cpunum_get_active(), data & Z180_DREQ1 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_DREQ1) | (data & Z180_DREQ1); } /* I asynchronous receive data 0 (active high) */ if (changes & Z180_RXA0) { - LOG(("Z180 #%d RXA0 %d\n", cpu_getactivecpu(), data & Z180_RXA0 ? 1 : 0)); + LOG(("Z180 #%d RXA0 %d\n", cpunum_get_active(), data & Z180_RXA0 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_RXA0) | (data & Z180_RXA0); } /* I asynchronous receive data 1 (active high) */ if (changes & Z180_RXA1) { - LOG(("Z180 #%d RXA1 %d\n", cpu_getactivecpu(), data & Z180_RXA1 ? 1 : 0)); + LOG(("Z180 #%d RXA1 %d\n", cpunum_get_active(), data & Z180_RXA1 ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_RXA1) | (data & Z180_RXA1); } /* I clocked serial receive data (active high) or CTS1 (mux) */ if (changes & Z180_RXS) { - LOG(("Z180 #%d RXS %d\n", cpu_getactivecpu(), data & Z180_RXS ? 1 : 0)); + LOG(("Z180 #%d RXS %d\n", cpunum_get_active(), data & Z180_RXS ? 1 : 0)); Z180.iol = (Z180.iol & ~Z180_RXS) | (data & Z180_RXS); } /* O request to send (active low) */ if (changes & Z180_RTS0) { - LOG(("Z180 #%d RTS0 won't change output\n", cpu_getactivecpu())); + LOG(("Z180 #%d RTS0 won't change output\n", cpunum_get_active())); } /* O transfer end 0 (active low) or CKA1 (mux) */ if (changes & Z180_TEND0) { - LOG(("Z180 #%d TEND0 won't change output\n", cpu_getactivecpu())); + LOG(("Z180 #%d TEND0 won't change output\n", cpunum_get_active())); } /* O transfer end 1 (active low) */ if (changes & Z180_TEND1) { - LOG(("Z180 #%d TEND1 won't change output\n", cpu_getactivecpu())); + LOG(("Z180 #%d TEND1 won't change output\n", cpunum_get_active())); } /* O transfer out (PRT channel, active low) or A18 (mux) */ if (changes & Z180_A18_TOUT) { - LOG(("Z180 #%d TOUT won't change output\n", cpu_getactivecpu())); + LOG(("Z180 #%d TOUT won't change output\n", cpunum_get_active())); } /* O asynchronous transmit data 0 (active high) */ if (changes & Z180_TXA0) { - LOG(("Z180 #%d TXA0 won't change output\n", cpu_getactivecpu())); + LOG(("Z180 #%d TXA0 won't change output\n", cpunum_get_active())); } /* O asynchronous transmit data 1 (active high) */ if (changes & Z180_TXA1) { - LOG(("Z180 #%d TXA1 won't change output\n", cpu_getactivecpu())); + LOG(("Z180 #%d TXA1 won't change output\n", cpunum_get_active())); } /* O clocked serial transmit data (active high) */ if (changes & Z180_TXS) { - LOG(("Z180 #%d TXS won't change output\n", cpu_getactivecpu())); + LOG(("Z180 #%d TXS won't change output\n", cpunum_get_active())); } } @@ -1902,7 +1902,7 @@ static CPU_INIT( z180 ) { Z180.daisy = NULL; if (device->static_config) - Z180.daisy = z80daisy_init(Machine, Machine->config->cpu[cpu_getactivecpu()].tag, device->static_config); + Z180.daisy = z80daisy_init(Machine, Machine->config->cpu[cpunum_get_active()].tag, device->static_config); Z180.irq_callback = irqcallback; Z180.device = device; @@ -2197,7 +2197,7 @@ static CPU_EXECUTE( z180 ) /* to just check here */ if (Z180.nmi_pending) { - LOG(("Z180 #%d take NMI\n", cpu_getactivecpu())); + LOG(("Z180 #%d take NMI\n", cpunum_get_active())); _PPC = -1; /* there isn't a valid previous program counter */ LEAVE_HALT; /* Check if processor was halted */ @@ -2335,7 +2335,7 @@ static void set_irq_line(int irqline, int state) } else { - LOG(("Z180 #%d set_irq_line %d = %d\n",cpu_getactivecpu() , irqline,state)); + LOG(("Z180 #%d set_irq_line %d = %d\n",cpunum_get_active() , irqline,state)); /* update the IRQ state */ Z180.irq_state[irqline] = state; diff --git a/src/emu/cpu/z180/z180dd.c b/src/emu/cpu/z180/z180dd.c index 92fba05943d..a1195b02883 100644 --- a/src/emu/cpu/z180/z180dd.c +++ b/src/emu/cpu/z180/z180dd.c @@ -1,6 +1,6 @@ OP(illegal,1) { logerror("Z180 #%d ill. opcode $%02x $%02x\n", - cpu_getactivecpu(), cpu_readop((_PCD-1)&0xffff), cpu_readop(_PCD)); + cpunum_get_active(), cpu_readop((_PCD-1)&0xffff), cpu_readop(_PCD)); } /********************************************************** diff --git a/src/emu/cpu/z180/z180ed.c b/src/emu/cpu/z180/z180ed.c index 7bfd500c991..86e8b2b220f 100644 --- a/src/emu/cpu/z180/z180ed.c +++ b/src/emu/cpu/z180/z180ed.c @@ -1,7 +1,7 @@ OP(illegal,2) { logerror("Z180 #%d ill. opcode $ed $%02x\n", - cpu_getactivecpu(), cpu_readop((_PCD-1)&0xffff)); + cpunum_get_active(), cpu_readop((_PCD-1)&0xffff)); } /********************************************************** diff --git a/src/emu/cpu/z180/z180op.c b/src/emu/cpu/z180/z180op.c index 68ea48b4bac..164db10a59c 100644 --- a/src/emu/cpu/z180/z180op.c +++ b/src/emu/cpu/z180/z180op.c @@ -315,7 +315,7 @@ static void take_interrupt(int irq) else irq_vector = (*Z180.irq_callback)(Z180.device, 0); - LOG(("Z180 #%d single int. irq_vector $%02x\n", cpu_getactivecpu(), irq_vector)); + LOG(("Z180 #%d single int. irq_vector $%02x\n", cpunum_get_active(), irq_vector)); /* Interrupt mode 2. Call [Z180.I:databyte] */ if( _IM == 2 ) @@ -323,7 +323,7 @@ static void take_interrupt(int irq) irq_vector = (irq_vector & 0xff) + (_I << 8); PUSH( PC ); RM16( irq_vector, &Z180.PC ); - LOG(("Z180 #%d IM2 [$%04x] = $%04x\n",cpu_getactivecpu() , irq_vector, _PCD)); + LOG(("Z180 #%d IM2 [$%04x] = $%04x\n",cpunum_get_active() , irq_vector, _PCD)); /* CALL opcode timing */ z180_icount -= cc[Z180_TABLE_op][0xcd]; } @@ -331,7 +331,7 @@ static void take_interrupt(int irq) /* Interrupt mode 1. RST 38h */ if( _IM == 1 ) { - LOG(("Z180 #%d IM1 $0038\n",cpu_getactivecpu() )); + LOG(("Z180 #%d IM1 $0038\n",cpunum_get_active() )); PUSH( PC ); _PCD = 0x0038; /* RST $38 + 'interrupt latency' cycles */ @@ -342,7 +342,7 @@ static void take_interrupt(int irq) /* Interrupt mode 0. We check for CALL and JP instructions, */ /* if neither of these were found we assume a 1 byte opcode */ /* was placed on the databus */ - LOG(("Z180 #%d IM0 $%04x\n",cpu_getactivecpu() , irq_vector)); + LOG(("Z180 #%d IM0 $%04x\n",cpunum_get_active() , irq_vector)); switch (irq_vector & 0xff0000) { case 0xcd0000: /* call */ @@ -371,7 +371,7 @@ static void take_interrupt(int irq) irq_vector = (_I << 8) + (irq_vector & 0xff); PUSH( PC ); RM16( irq_vector, &Z180.PC ); - LOG(("Z180 #%d INT%d [$%04x] = $%04x\n", cpu_getactivecpu(), irq, irq_vector, _PCD)); + LOG(("Z180 #%d INT%d [$%04x] = $%04x\n", cpunum_get_active(), irq, irq_vector, _PCD)); /* CALL opcode timing */ z180_icount -= cc[Z180_TABLE_op][0xcd]; } diff --git a/src/emu/cpu/z180/z180ops.h b/src/emu/cpu/z180/z180ops.h index 53a537a91ab..de4aa5220ff 100644 --- a/src/emu/cpu/z180/z180ops.h +++ b/src/emu/cpu/z180/z180ops.h @@ -276,7 +276,7 @@ void z180_setOPbase(int pc) * RETN ***************************************************************/ #define RETN { \ - LOG(("Z180 #%d RETN IFF1:%d IFF2:%d\n", cpu_getactivecpu(), _IFF1, _IFF2)); \ + LOG(("Z180 #%d RETN IFF1:%d IFF2:%d\n", cpunum_get_active(), _IFF1, _IFF2)); \ POP(PC); \ z180_change_pc(_PCD); \ _IFF1 = _IFF2; \ diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c index 8448242aa58..b1896707412 100644 --- a/src/emu/cpu/z80/z80.c +++ b/src/emu/cpu/z80/z80.c @@ -824,7 +824,7 @@ INLINE UINT32 ARG16(z80_state *z80) * RETN ***************************************************************/ #define RETN { \ - LOG(("Z80 #%d RETN IFF1:%d IFF2:%d\n", cpu_getactivecpu(), IFF1, IFF2)); \ + LOG(("Z80 #%d RETN IFF1:%d IFF2:%d\n", cpunum_get_active(), IFF1, IFF2)); \ POP( pc ); \ MEMPTR = PC; \ change_pc(PCD); \ @@ -2173,7 +2173,7 @@ OP(xycb,ff) { A = SET(7, RM(EA) ); WM( EA,A ); } /* SET 7,A=(XY+o) */ OP(illegal,1) { logerror("Z80 #%d ill. opcode $%02x $%02x\n", - cpu_getactivecpu(), cpu_readop((PCD-1)&0xffff), cpu_readop(PCD)); + cpunum_get_active(), cpu_readop((PCD-1)&0xffff), cpu_readop(PCD)); } /********************************************************** @@ -2761,7 +2761,7 @@ OP(fd,ff) { illegal_1(z80); op_ff(z80); } /* DB FD */ OP(illegal,2) { logerror("Z80 #%d ill. opcode $ed $%02x\n", - cpu_getactivecpu(), cpu_readop((PCD-1)&0xffff)); + cpunum_get_active(), cpu_readop((PCD-1)&0xffff)); } /********************************************************** @@ -3369,7 +3369,7 @@ static void take_interrupt(z80_state *z80) else irq_vector = (*z80->irq_callback)(z80->device, 0); - LOG(("Z80 #%d single int. irq_vector $%02x\n", cpu_getactivecpu(), irq_vector)); + LOG(("Z80 #%d single int. irq_vector $%02x\n", cpunum_get_active(), irq_vector)); /* Interrupt mode 2. Call [z80->i:databyte] */ if( IM == 2 ) @@ -3377,7 +3377,7 @@ static void take_interrupt(z80_state *z80) irq_vector = (irq_vector & 0xff) | (I << 8); PUSH( pc ); RM16( irq_vector, &z80->pc ); - LOG(("Z80 #%d IM2 [$%04x] = $%04x\n",cpu_getactivecpu() , irq_vector, PCD)); + LOG(("Z80 #%d IM2 [$%04x] = $%04x\n",cpunum_get_active() , irq_vector, PCD)); /* CALL opcode timing */ z80->icount -= cc[Z80_TABLE_op][0xcd]; } @@ -3385,7 +3385,7 @@ static void take_interrupt(z80_state *z80) /* Interrupt mode 1. RST 38h */ if( IM == 1 ) { - LOG(("Z80 #%d IM1 $0038\n",cpu_getactivecpu() )); + LOG(("Z80 #%d IM1 $0038\n",cpunum_get_active() )); PUSH( pc ); PCD = 0x0038; /* RST $38 + 'interrupt latency' cycles */ @@ -3396,7 +3396,7 @@ static void take_interrupt(z80_state *z80) /* Interrupt mode 0. We check for CALL and JP instructions, */ /* if neither of these were found we assume a 1 byte opcode */ /* was placed on the databus */ - LOG(("Z80 #%d IM0 $%04x\n",cpu_getactivecpu() , irq_vector)); + LOG(("Z80 #%d IM0 $%04x\n",cpunum_get_active() , irq_vector)); switch (irq_vector & 0xff0000) { case 0xcd0000: /* call */ @@ -3552,7 +3552,7 @@ static CPU_INIT( z80 ) /* Reset registers to their initial values */ memset(z80, 0, sizeof(*z80)); if (device->static_config != NULL) - z80->daisy = z80daisy_init(Machine, Machine->config->cpu[cpu_getactivecpu()].tag, device->static_config); + z80->daisy = z80daisy_init(Machine, Machine->config->cpu[cpunum_get_active()].tag, device->static_config); z80->irq_callback = irqcallback; z80->device = device; IX = IY = 0xffff; /* IX and IY are FFFF after a reset! */ @@ -3606,7 +3606,7 @@ static CPU_EXECUTE( z80 ) /* to just check here */ if (z80->nmi_pending) { - LOG(("Z80 #%d take NMI\n", cpu_getactivecpu())); + LOG(("Z80 #%d take NMI\n", cpunum_get_active())); PRVPC = -1; /* there isn't a valid previous program counter */ LEAVE_HALT; /* Check if processor was halted */ diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c index 1bf52075871..2cfb0f0ab49 100644 --- a/src/emu/cpu/z8000/z8000.c +++ b/src/emu/cpu/z8000/z8000.c @@ -350,7 +350,7 @@ INLINE void set_irq(int type) IRQ_REQ = type; break; case Z8000_SYSCALL >> 8: - LOG(("Z8K#%d SYSCALL $%02x\n", cpu_getactivecpu(), type & 0xff)); + LOG(("Z8K#%d SYSCALL $%02x\n", cpunum_get_active(), type & 0xff)); IRQ_REQ = type; break; default: @@ -388,7 +388,7 @@ INLINE void Interrupt(void) IRQ_SRV = IRQ_REQ; IRQ_REQ &= ~Z8000_TRAP; PC = TRAP; - LOG(("Z8K#%d trap $%04x\n", cpu_getactivecpu(), PC )); + LOG(("Z8K#%d trap $%04x\n", cpunum_get_active(), PC )); } else if ( IRQ_REQ & Z8000_SYSCALL ) @@ -400,7 +400,7 @@ INLINE void Interrupt(void) IRQ_SRV = IRQ_REQ; IRQ_REQ &= ~Z8000_SYSCALL; PC = SYSCALL; - LOG(("Z8K#%d syscall $%04x\n", cpu_getactivecpu(), PC )); + LOG(("Z8K#%d syscall $%04x\n", cpunum_get_active(), PC )); } else if ( IRQ_REQ & Z8000_SEGTRAP ) @@ -412,7 +412,7 @@ INLINE void Interrupt(void) IRQ_SRV = IRQ_REQ; IRQ_REQ &= ~Z8000_SEGTRAP; PC = SEGTRAP; - LOG(("Z8K#%d segtrap $%04x\n", cpu_getactivecpu(), PC )); + LOG(("Z8K#%d segtrap $%04x\n", cpunum_get_active(), PC )); } else if ( IRQ_REQ & Z8000_NMI ) @@ -427,7 +427,7 @@ INLINE void Interrupt(void) IRQ_REQ &= ~Z8000_NMI; CHANGE_FCW(fcw); PC = NMI; - LOG(("Z8K#%d NMI $%04x\n", cpu_getactivecpu(), PC )); + LOG(("Z8K#%d NMI $%04x\n", cpunum_get_active(), PC )); } else if ( (IRQ_REQ & Z8000_NVI) && (FCW & F_NVIE) ) @@ -441,7 +441,7 @@ INLINE void Interrupt(void) PC = RDMEM_W( NVI + 2 ); IRQ_REQ &= ~Z8000_NVI; CHANGE_FCW(fcw); - LOG(("Z8K#%d NVI $%04x\n", cpu_getactivecpu(), PC )); + LOG(("Z8K#%d NVI $%04x\n", cpunum_get_active(), PC )); } else if ( (IRQ_REQ & Z8000_VI) && (FCW & F_VIE) ) @@ -455,7 +455,7 @@ INLINE void Interrupt(void) PC = RDMEM_W( VEC00 + 2 * (IRQ_REQ & 0xff) ); IRQ_REQ &= ~Z8000_VI; CHANGE_FCW(fcw); - LOG(("Z8K#%d VI [$%04x/$%04x] fcw $%04x, pc $%04x\n", cpu_getactivecpu(), IRQ_VEC, VEC00 + VEC00 + 2 * (IRQ_REQ & 0xff), FCW, PC )); + LOG(("Z8K#%d VI [$%04x/$%04x] fcw $%04x, pc $%04x\n", cpunum_get_active(), IRQ_VEC, VEC00 + VEC00 + 2 * (IRQ_REQ & 0xff), FCW, PC )); } } diff --git a/src/emu/cpu/z8000/z8000ops.c b/src/emu/cpu/z8000/z8000ops.c index 221ef778c8e..4dce057785c 100644 --- a/src/emu/cpu/z8000/z8000ops.c +++ b/src/emu/cpu/z8000/z8000ops.c @@ -1530,7 +1530,7 @@ static void Z0D_ddN0_1001_imm16(void) static void Z0E_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: ext0e $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: ext0e $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -1544,7 +1544,7 @@ static void Z0E_imm8(void) static void Z0F_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: ext0f $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: ext0f $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -2274,7 +2274,7 @@ static void Z36_0000_0000(void) static void Z36_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: rsvd36 $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: rsvd36 $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -2312,7 +2312,7 @@ static void Z37_ddN0_ssss_imm16(void) static void Z38_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: rsvd38 $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: rsvd38 $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -4354,7 +4354,7 @@ static void Z77_ddN0_ssss_0000_xxxx_0000_0000(void) static void Z78_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: rsvd78 $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: rsvd78 $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -4414,7 +4414,7 @@ static void Z7B_0000_0000(void) IRQ_SRV &= ~tag; /* remove IRQ serviced flag */ CHANGE_FCW(fcw); /* check for user/system mode change */ change_pc(PC); - LOG(("Z8K#%d IRET tag $%04x, fcw $%04x, pc $%04x\n", cpu_getactivecpu(), tag, fcw, PC)); + LOG(("Z8K#%d IRET tag $%04x, fcw $%04x, pc $%04x\n", cpunum_get_active(), tag, fcw, PC)); } /****************************************** @@ -4499,7 +4499,7 @@ static void Z7D_dddd_0ccc(void) RW(dst) = NSP; break; default: - LOG(("Z8K#%d LDCTL R%d,%d\n", cpu_getactivecpu(), dst, imm3)); + LOG(("Z8K#%d LDCTL R%d,%d\n", cpunum_get_active(), dst, imm3)); } } @@ -4529,7 +4529,7 @@ static void Z7D_ssss_1ccc(void) NSP = RW(src); break; default: - LOG(("Z8K#%d LDCTL %d,R%d\n", cpu_getactivecpu(), imm3, src)); + LOG(("Z8K#%d LDCTL %d,R%d\n", cpunum_get_active(), imm3, src)); } } @@ -4540,7 +4540,7 @@ static void Z7D_ssss_1ccc(void) static void Z7E_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: rsvd7e $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: rsvd7e $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -4836,7 +4836,7 @@ static void Z8D_imm4_0101(void) static void Z8E_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: ext8e $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: ext8e $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -4850,7 +4850,7 @@ static void Z8E_imm8(void) static void Z8F_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: ext8f $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: ext8f $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -5008,7 +5008,7 @@ static void Z9C_dddd_1000(void) static void Z9D_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: rsvd9d $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: rsvd9d $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -5050,7 +5050,7 @@ static void Z9E_0000_cccc(void) static void Z9F_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: rsvd9f $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: rsvd9f $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -5751,7 +5751,7 @@ static void ZB8_ddN0_1100_0000_rrrr_ssN0_0000(void) static void ZB9_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: rsvdb9 $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: rsvdb9 $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; @@ -6409,7 +6409,7 @@ static void ZBE_aaaa_bbbb(void) static void ZBF_imm8(void) { GET_IMM8(0); - LOG(("Z8K#%d %04x: rsvdbf $%02x\n", cpu_getactivecpu(), PC, imm8)); + LOG(("Z8K#%d %04x: rsvdbf $%02x\n", cpunum_get_active(), PC, imm8)); if (FCW & F_EPU) { /* Z8001 EPU code goes here */ (void)imm8; diff --git a/src/emu/cpuexec.c b/src/emu/cpuexec.c index ec9282c7202..47239af2a87 100644 --- a/src/emu/cpuexec.c +++ b/src/emu/cpuexec.c @@ -34,11 +34,11 @@ extern const cpu_irq_callback cpu_irq_callbacks[]; ***************************************************************************/ #define VERIFY_ACTIVECPU(name) \ - int activecpu = cpu_getactivecpu(); \ + int activecpu = cpunum_get_active(); \ assert_always(activecpu >= 0, #name "() called with no active cpu!") #define VERIFY_EXECUTINGCPU(name) \ - int activecpu = cpu_getexecutingcpu(); \ + int activecpu = cpunum_get_executing(); \ assert_always(activecpu >= 0, #name "() called with no executing cpu!") #define VERIFY_CPUNUM(name) \ @@ -210,7 +210,7 @@ static void cpuexec_reset(running_machine *machine) cpu[cpunum].totalcycles = 0; /* then reset the CPU directly */ - cpunum_reset(cpunum); + cpu_reset(machine->cpu[cpunum]); } } @@ -272,11 +272,11 @@ void cpuexec_timeslice(running_machine *machine) /* via the call to the cpunum_execute */ cycles_stolen = 0; if (!call_debugger) - ran = cpunum_execute(cpunum, cycles_running); + ran = cpu_execute(machine->cpu[cpunum], cycles_running); else { debugger_start_cpu_hook(machine, cpunum, target); - ran = cpunum_execute(cpunum, cycles_running); + ran = cpu_execute(machine->cpu[cpunum], cycles_running); debugger_stop_cpu_hook(machine, cpunum); } @@ -362,7 +362,7 @@ void activecpu_abort_timeslice(void) int current_icount; VERIFY_EXECUTINGCPU(activecpu_abort_timeslice); - LOG(("activecpu_abort_timeslice (CPU=%d, cycles_left=%d)\n", cpu_getexecutingcpu(), activecpu_get_icount() + 1)); + LOG(("activecpu_abort_timeslice (CPU=%d, cycles_left=%d)\n", cpunum_get_executing(), activecpu_get_icount() + 1)); /* swallow the remaining cycles */ current_icount = activecpu_get_icount() + 1; @@ -383,7 +383,7 @@ void cpunum_suspend(int cpunum, int reason, int eatcycles) LOG(("cpunum_suspend (CPU=%d, r=%X, eat=%d)\n", cpunum, reason, eatcycles)); cpu[cpunum].nextsuspend |= reason; cpu[cpunum].nexteatcycles = eatcycles; - if (cpu_getexecutingcpu() >= 0) + if (cpunum_get_executing() >= 0) activecpu_abort_timeslice(); } @@ -398,7 +398,7 @@ void cpunum_resume(int cpunum, int reason) VERIFY_CPUNUM(cpunum_resume); LOG(("cpunum_resume (CPU=%d, r=%X)\n", cpunum, reason)); cpu[cpunum].nextsuspend &= ~reason; - if (cpu_getexecutingcpu() >= 0) + if (cpunum_get_executing() >= 0) activecpu_abort_timeslice(); } @@ -519,7 +519,7 @@ attotime cpunum_get_localtime(int cpunum) /* if we're active, add in the time from the current slice */ result = cpu[cpunum].localtime; - if (cpunum == cpu_getexecutingcpu()) + if (cpunum == cpunum_get_executing()) { int cycles = cycles_running - activecpu_get_icount(); result = attotime_add(result, ATTOTIME_IN_CYCLES(cycles, cpunum)); @@ -537,7 +537,7 @@ attotime cpunum_get_localtime(int cpunum) UINT64 activecpu_gettotalcycles(void) { VERIFY_ACTIVECPU(activecpu_gettotalcycles); - if (activecpu == cpu_getexecutingcpu()) + if (activecpu == cpunum_get_executing()) return cpu[activecpu].totalcycles + cycles_running - activecpu_get_icount(); else return cpu[activecpu].totalcycles; @@ -553,7 +553,7 @@ UINT64 activecpu_gettotalcycles(void) UINT64 cpunum_gettotalcycles(int cpunum) { VERIFY_CPUNUM(cpunum_gettotalcycles); - if (cpunum == cpu_getexecutingcpu()) + if (cpunum == cpunum_get_executing()) return cpu[cpunum].totalcycles + cycles_running - activecpu_get_icount(); else return cpu[cpunum].totalcycles; @@ -600,7 +600,7 @@ static void cpunum_suspend_until_trigger(int cpunum, int trigger, int eatcycles) void cpu_yield(void) { - int cpunum = cpu_getexecutingcpu(); + int cpunum = cpunum_get_executing(); VERIFY_EXECUTINGCPU(cpu_yield); cpunum_suspend(cpunum, SUSPEND_REASON_TIMESLICE, FALSE); } @@ -613,7 +613,7 @@ void cpu_yield(void) void cpu_spin(void) { - int cpunum = cpu_getexecutingcpu(); + int cpunum = cpunum_get_executing(); VERIFY_EXECUTINGCPU(cpu_spin); cpunum_suspend(cpunum, SUSPEND_REASON_TIMESLICE, TRUE); } @@ -626,7 +626,7 @@ void cpu_spin(void) void cpu_spinuntil_trigger(int trigger) { - int cpunum = cpu_getexecutingcpu(); + int cpunum = cpunum_get_executing(); VERIFY_EXECUTINGCPU(cpu_yielduntil_trigger); cpunum_suspend_until_trigger(cpunum, trigger, TRUE); } @@ -651,7 +651,7 @@ void cpunum_spinuntil_trigger(int cpunum, int trigger) void cpu_spinuntil_int(void) { - int cpunum = cpu_getexecutingcpu(); + int cpunum = cpunum_get_executing(); VERIFY_EXECUTINGCPU(cpu_spinuntil_int); cpunum_suspend_until_trigger(cpunum, TRIGGER_INT + cpunum, TRUE); } @@ -665,7 +665,7 @@ void cpu_spinuntil_int(void) void cpu_spinuntil_time(attotime duration) { static int timetrig = 0; - int cpunum = cpu_getexecutingcpu(); + int cpunum = cpunum_get_executing(); VERIFY_EXECUTINGCPU(cpu_spinuntil_time); cpunum_suspend_until_trigger(cpunum, TRIGGER_SUSPENDTIME + timetrig, TRUE); cpu_triggertime(duration, TRIGGER_SUSPENDTIME + timetrig); @@ -687,7 +687,7 @@ void cpu_trigger(running_machine *machine, int trigger) int cpunum; /* cause an immediate resynchronization */ - if (cpu_getexecutingcpu() >= 0) + if (cpunum_get_executing() >= 0) activecpu_abort_timeslice(); /* look for suspended CPUs waiting for this trigger and unsuspend them */ @@ -797,9 +797,9 @@ static void on_vblank(const device_config *device, void *param, int vblank_state { if (!cpunum_is_suspended(cpunum, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) { - cpuintrf_push_context(cpunum); + cpu_push_context(device->machine->cpu[cpunum]); (*config->vblank_interrupt)(device->machine, cpunum); - cpuintrf_pop_context(); + cpu_pop_context(); } /* if we have more than one interrupt per frame, start the timer now to trigger the rest of them */ @@ -833,9 +833,9 @@ static TIMER_CALLBACK( trigger_partial_frame_interrupt ) /* call the interrupt handler */ if (!cpunum_is_suspended(cpunum, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) { - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); (*config->vblank_interrupt)(machine, cpunum); - cpuintrf_pop_context(); + cpu_pop_context(); } /* more? */ @@ -854,9 +854,9 @@ static TIMER_CALLBACK( cpu_timedintcallback ) /* bail if there is no routine */ if (machine->config->cpu[param].timed_interrupt != NULL && !cpunum_is_suspended(param, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) { - cpuintrf_push_context(param); + cpu_push_context(machine->cpu[param]); (*machine->config->cpu[param].timed_interrupt)(machine, param); - cpuintrf_pop_context(); + cpu_pop_context(); } } diff --git a/src/emu/cpuint.c b/src/emu/cpuint.c index 754e3e305ef..93364dfe4f4 100644 --- a/src/emu/cpuint.c +++ b/src/emu/cpuint.c @@ -126,7 +126,7 @@ void cpuint_init(running_machine *machine) * *************************************/ -void cpuint_reset(void) +void cpuint_reset(running_machine *machine) { int cpunum, line; @@ -134,7 +134,7 @@ void cpuint_reset(void) for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) for (line = 0; line < MAX_INPUT_LINES; line++) { - interrupt_vector[cpunum][line] = cpunum_default_irq_vector(cpunum); + interrupt_vector[cpunum][line] = cpu_get_default_irq_vector(machine->cpu[cpunum]); input_event_index[cpunum][line] = 0; } } @@ -161,7 +161,7 @@ static TIMER_CALLBACK( cpunum_empty_event_queue ) int i; /* swap to the CPU's context */ - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); /* loop over all events */ for (i = 0; i < input_event_index[cpunum][line]; i++) @@ -187,7 +187,7 @@ static TIMER_CALLBACK( cpunum_empty_event_queue ) /* if we're clearing the line that was previously asserted, or if we're just */ /* pulsing the line, reset the CPU */ if ((state == CLEAR_LINE && cpunum_is_suspended(cpunum, SUSPEND_REASON_RESET)) || state == PULSE_LINE) - cpunum_reset(cpunum); + cpu_reset(machine->cpu[cpunum]); /* if we're clearing the line, make sure the CPU is not halted */ cpunum_resume(cpunum, SUSPEND_REASON_RESET); @@ -215,17 +215,17 @@ static TIMER_CALLBACK( cpunum_empty_event_queue ) case PULSE_LINE: /* temporary: PULSE_LINE only makes sense for NMI lines on Z80 */ assert(machine->config->cpu[cpunum].type != CPU_Z80 || line == INPUT_LINE_NMI); - activecpu_set_input_line(line, INTERNAL_ASSERT_LINE); - activecpu_set_input_line(line, INTERNAL_CLEAR_LINE); + cpu_set_info_int(machine->activecpu, CPUINFO_INT_INPUT_STATE + line, ASSERT_LINE); + cpu_set_info_int(machine->activecpu, CPUINFO_INT_INPUT_STATE + line, CLEAR_LINE); break; case HOLD_LINE: case ASSERT_LINE: - activecpu_set_input_line(line, INTERNAL_ASSERT_LINE); + cpu_set_info_int(machine->activecpu, CPUINFO_INT_INPUT_STATE + line, ASSERT_LINE); break; case CLEAR_LINE: - activecpu_set_input_line(line, INTERNAL_CLEAR_LINE); + cpu_set_info_int(machine->activecpu, CPUINFO_INT_INPUT_STATE + line, CLEAR_LINE); break; default: @@ -239,7 +239,7 @@ static TIMER_CALLBACK( cpunum_empty_event_queue ) } /* swap back */ - cpuintrf_pop_context(); + cpu_pop_context(); /* reset counter */ input_event_index[cpunum][line] = 0; @@ -409,7 +409,7 @@ INLINE int generic_irq_callback(running_machine *machine, int cpunum, int line) if (input_line_state[cpunum][line] == HOLD_LINE) { LOG(("->set_irq_line(%d,%d,%d)\n", cpunum, line, CLEAR_LINE)); - activecpu_set_input_line(line, INTERNAL_CLEAR_LINE); + cpu_set_info_int(machine->activecpu, CPUINFO_INT_INPUT_STATE + line, CLEAR_LINE); input_line_state[cpunum][line] = CLEAR_LINE; } diff --git a/src/emu/cpuint.h b/src/emu/cpuint.h index c89e9e70b3b..2b58e1be58e 100644 --- a/src/emu/cpuint.h +++ b/src/emu/cpuint.h @@ -29,7 +29,7 @@ void cpuint_init(running_machine *machine); -void cpuint_reset(void); +void cpuint_reset(running_machine *machine); diff --git a/src/emu/cpuintrf.c b/src/emu/cpuintrf.c index c4e49531ea9..3896714ec3c 100644 --- a/src/emu/cpuintrf.c +++ b/src/emu/cpuintrf.c @@ -263,11 +263,11 @@ CPU_GET_INFO( cxd8661r ); * *************************************/ -#define VERIFY_ACTIVECPU(name) \ - assert_always(activecpu >= 0, #name "() called with no active cpu!") +#define VERIFY_CPU(name) \ + assert_always(cpu != NULL, #name "() called with invalid cpu!") -#define VERIFY_CPUNUM(name) \ - assert_always(cpunum >= 0 && cpunum < totalcpu, #name "() called for invalid cpu num!") +#define VERIFY_ACTIVECPU(name) \ + assert_always(activecpunum >= 0, #name "() called with no active cpu!") #define VERIFY_CPUTYPE(name) \ assert_always(cputype >= 0 && cputype < CPU_COUNT, #name "() called for invalid cpu type!") @@ -283,11 +283,13 @@ CPU_GET_INFO( cxd8661r ); typedef struct _cpuintrf_data cpuintrf_data; struct _cpuintrf_data { + int index; /* index of this CPU */ + int family; /* family index of this CPU */ cpu_interface intf; /* copy of the interface data */ cpu_type cputype; /* type index of this CPU */ - int family; /* family index of this CPU */ device_config *device; /* dummy device for now */ int *icount; + cpu_disassemble_func dasm_override; }; @@ -941,18 +943,16 @@ static const struct * *************************************/ -int activecpu; /* index of active CPU (or -1) */ -int executingcpu; /* index of executing CPU (or -1) */ +const device_config *executingcpu; +int activecpunum; /* index of active CPU (or -1) */ +int executingcpunum; /* index of executing CPU (or -1) */ int totalcpu; /* total number of CPUs */ static cpuintrf_data cpu[MAX_CPU]; -static int cpu_active_context[CPU_COUNT]; -static int cpu_context_stack[4]; +static const device_config *cpu_context_stack[4]; static int cpu_context_stack_ptr; -static offs_t (*cpu_dasm_override[CPU_COUNT])(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - #define TEMP_STRING_POOL_ENTRIES 16 static char temp_string_pool[TEMP_STRING_POOL_ENTRIES][256]; static int temp_string_pool_index; @@ -965,25 +965,28 @@ static int temp_string_pool_index; * *************************************/ -INLINE void set_cpu_context(running_machine *machine, int cpunum) +INLINE void set_cpu_context(const device_config *oldcpu, const device_config *newcpu) { - int newfamily = cpu[cpunum].family; - int oldcontext = cpu_active_context[newfamily]; + cpuintrf_data *cpudata = NULL; + + /* if nothing is changing, quick exit */ + if (newcpu == NULL || oldcpu == newcpu) + return; - /* if we need to change contexts, save the one that was there */ - if (oldcontext != cpunum && oldcontext != -1) - (*cpu[oldcontext].intf.get_context)(cpu[oldcontext].device->token); + /* save the old context if we have one */ + if (oldcpu != NULL) + { + cpudata = oldcpu->classtoken; + (*cpudata->intf.get_context)(oldcpu->token); + } /* swap memory spaces */ - activecpu = cpunum; - memory_set_context(machine, cpunum); + newcpu->machine->activecpu = newcpu; - /* if the new CPU's context is not swapped in, do it now */ - if (oldcontext != cpunum) - { - (*cpu[cpunum].intf.set_context)(cpu[cpunum].device->token); - cpu_active_context[newfamily] = cpunum; - } + cpudata = newcpu->classtoken; + activecpunum = cpudata->index; + memory_set_context(newcpu->machine, activecpunum); + (*cpudata->intf.set_context)(newcpu->token); } @@ -994,31 +997,27 @@ INLINE void set_cpu_context(running_machine *machine, int cpunum) * *************************************/ -void cpuintrf_push_context(int cpunum) +void cpu_push_context(const device_config *cpu) { - /* push the old context onto the stack */ - cpu_context_stack[cpu_context_stack_ptr++] = activecpu; - - /* do the rest only if this isn't the activecpu */ - if (cpunum != activecpu && cpunum != -1) - set_cpu_context(Machine, cpunum); - - /* this is now the active CPU */ - activecpu = cpunum; + const device_config *oldcpu = cpu->machine->activecpu; + cpu_context_stack[cpu_context_stack_ptr++] = oldcpu; + set_cpu_context(oldcpu, cpu); } -void cpuintrf_pop_context(void) +void cpu_pop_context(void) { - /* push the old context onto the stack */ - int cpunum = cpu_context_stack[--cpu_context_stack_ptr]; - - /* do the rest only if this isn't the activecpu */ - if (cpunum != activecpu && cpunum != -1) - set_cpu_context(Machine, cpunum); - - /* this is now the active CPU */ - activecpu = cpunum; + const device_config *cpu = cpu_context_stack[--cpu_context_stack_ptr]; + if (cpu != NULL) + { + const device_config *oldcpu = cpu->machine->activecpu; + set_cpu_context(oldcpu, cpu); + } + else + { + Machine->activecpu = NULL; + activecpunum = -1; + } } @@ -1105,9 +1104,6 @@ void cpuintrf_init(running_machine *machine) /* get other miscellaneous stuff */ intf->context_size = cputype_context_size(cputype); intf->address_shift = cputype_addrbus_shift(cputype, ADDRESS_SPACE_PROGRAM); - - /* also reset the active CPU context info */ - cpu_active_context[cputype] = -1; } /* fill in any empty entries with the dummy CPU */ @@ -1118,15 +1114,15 @@ void cpuintrf_init(running_machine *machine) /* zap the CPU data structure */ memset(cpu, 0, sizeof(cpu)); totalcpu = 0; - memset(cpu_dasm_override, 0, sizeof(cpu_dasm_override)); /* reset the context stack */ - memset(cpu_context_stack, -1, sizeof(cpu_context_stack)); + memset(&cpu_context_stack[0], 0, sizeof(cpu_context_stack)); cpu_context_stack_ptr = 0; /* nothing active, nothing executing */ - activecpu = -1; - executingcpu = -1; + activecpunum = -1; + executingcpu = NULL; + executingcpunum = -1; totalcpu = 0; /* compute information about the CPUs now if we have a machine */ @@ -1144,6 +1140,7 @@ void cpuintrf_init(running_machine *machine) break; /* fill in the type and interface */ + cpu[totalcpu].index = totalcpu; cpu[totalcpu].intf = cpuintrf[cputype]; cpu[totalcpu].cputype = cputype; @@ -1167,9 +1164,10 @@ void cpuintrf_init(running_machine *machine) * *************************************/ -void cpuintrf_set_dasm_override(int cpunum, offs_t (*dasm_override)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)) +void cpu_set_dasm_override(const device_config *cpu, cpu_disassemble_func dasm_override) { - cpu_dasm_override[cpunum] = dasm_override; + cpuintrf_data *cpudata = cpu->classtoken; + cpudata->dasm_override = dasm_override; } @@ -1182,33 +1180,43 @@ void cpuintrf_set_dasm_override(int cpunum, offs_t (*dasm_override)(char *buffer int cpuintrf_init_cpu(int cpunum, cpu_type cputype, int clock, const void *config, cpu_irq_callback irqcallback) { + cpuintrf_data *cpudata = &cpu[cpunum]; cpuinfo info; /* create a fake device for the CPU */ - cpu[cpunum].device = auto_malloc(sizeof(*cpu[cpunum].device) + strlen(Machine->config->cpu[cpunum].tag)); - memset(cpu[cpunum].device, 0, sizeof(*cpu[cpunum].device)); - strcpy(cpu[cpunum].device->tag, Machine->config->cpu[cpunum].tag); - cpu[cpunum].device->static_config = config; - cpu[cpunum].device->machine = Machine; - cpu[cpunum].device->token = auto_malloc(cpu[cpunum].intf.context_size); - memset(cpu[cpunum].device->token, 0, cpu[cpunum].intf.context_size); + cpudata->device = auto_malloc(sizeof(*cpudata->device) + strlen(Machine->config->cpu[cpunum].tag)); + memset(cpudata->device, 0, sizeof(*cpudata->device)); + strcpy(cpudata->device->tag, Machine->config->cpu[cpunum].tag); + cpudata->device->type = (device_type)cputype; + cpudata->device->class = DEVICE_CLASS_CPU_CHIP; + cpudata->device->static_config = config; + cpudata->device->started = TRUE; + cpudata->device->machine = Machine; + cpudata->device->region = memory_region(Machine, cpudata->device->tag); + cpudata->device->regionbytes = memory_region_length(Machine, cpudata->device->tag); + + /* allocate a context token */ + cpudata->device->token = auto_malloc(cpudata->intf.context_size); + memset(cpudata->device->token, 0, cpudata->intf.context_size); + + /* set up the class token */ + cpudata->device->classtoken = &cpu[cpunum]; /* put a pointer to the device in the machine */ - Machine->cpu[cpunum] = cpu[cpunum].device; + Machine->cpu[cpunum] = cpudata->device; /* initialize the CPU and stash the context */ - activecpu = cpunum; - (*cpu[cpunum].intf.init)(cpu[cpunum].device, cpunum, clock, irqcallback); - (*cpu[cpunum].intf.get_context)(cpu[cpunum].device->token); - activecpu = -1; + Machine->activecpu = Machine->cpu[cpunum]; + activecpunum = cpunum; + (*cpudata->intf.init)(cpudata->device, cpunum, clock, irqcallback); + (*cpudata->intf.get_context)(cpudata->device->token); + Machine->activecpu = NULL; + activecpunum = -1; /* get the instruction count pointer */ info.icount = NULL; - (*cpu[cpunum].intf.get_info)(CPUINFO_PTR_INSTRUCTION_COUNTER, &info); - cpu[cpunum].icount = info.icount; - - /* clear out the registered CPU for this family */ - cpu_active_context[cpu[cpunum].family] = -1; + (*cpudata->intf.get_info)(CPUINFO_PTR_INSTRUCTION_COUNTER, &info); + cpudata->icount = info.icount; return 0; } @@ -1222,13 +1230,15 @@ int cpuintrf_init_cpu(int cpunum, cpu_type cputype, int clock, const void *confi void cpuintrf_exit_cpu(int cpunum) { + cpuintrf_data *cpudata = &cpu[cpunum]; + /* if the CPU core defines an exit function, call it now */ - if (cpu[cpunum].intf.exit) + if (cpudata->intf.exit) { /* switch contexts to the CPU during the exit */ - cpuintrf_push_context(cpunum); - (*cpu[cpunum].intf.exit)(cpu[cpunum].device); - cpuintrf_pop_context(); + cpu_push_context(cpu->device); + (*cpudata->intf.exit)(cpu->device); + cpu_pop_context(); } } @@ -1241,94 +1251,20 @@ void cpuintrf_exit_cpu(int cpunum) *************************************/ /*-------------------------- - Get info accessors ---------------------------*/ - -INT64 activecpu_get_info_int(UINT32 state) -{ - cpuinfo info; - - VERIFY_ACTIVECPU(activecpu_get_info_int); - info.i = 0; - (*cpu[activecpu].intf.get_info)(state, &info); - return info.i; -} - -void *activecpu_get_info_ptr(UINT32 state) -{ - cpuinfo info; - - VERIFY_ACTIVECPU(activecpu_get_info_ptr); - info.p = NULL; - (*cpu[activecpu].intf.get_info)(state, &info); - return info.p; -} - -genf *activecpu_get_info_fct(UINT32 state) -{ - cpuinfo info; - - VERIFY_ACTIVECPU(activecpu_get_info_fct); - info.f = NULL; - (*cpu[activecpu].intf.get_info)(state, &info); - return info.f; -} - -const char *activecpu_get_info_string(UINT32 state) -{ - cpuinfo info; - - VERIFY_ACTIVECPU(activecpu_get_info_string); - info.s = cpuintrf_temp_str(); - (*cpu[activecpu].intf.get_info)(state, &info); - return info.s; -} - - -/*-------------------------- - Set info accessors ---------------------------*/ - -void activecpu_set_info_int(UINT32 state, INT64 data) -{ - cpuinfo info; - VERIFY_ACTIVECPU(activecpu_set_info_int); - info.i = data; - (*cpu[activecpu].intf.set_info)(state, &info); -} - -void activecpu_set_info_ptr(UINT32 state, void *data) -{ - cpuinfo info; - VERIFY_ACTIVECPU(activecpu_set_info_ptr); - info.p = data; - (*cpu[activecpu].intf.set_info)(state, &info); -} - -void activecpu_set_info_fct(UINT32 state, genf *data) -{ - cpuinfo info; - VERIFY_ACTIVECPU(activecpu_set_info_fct); - info.f = data; - (*cpu[activecpu].intf.set_info)(state, &info); -} - - -/*-------------------------- Adjust/get icount --------------------------*/ void activecpu_adjust_icount(int delta) { VERIFY_ACTIVECPU(activecpu_adjust_icount); - *cpu[activecpu].icount += delta; + *cpu[activecpunum].icount += delta; } int activecpu_get_icount(void) { VERIFY_ACTIVECPU(activecpu_get_icount); - return *cpu[activecpu].icount; + return *cpu[activecpunum].icount; } @@ -1339,117 +1275,10 @@ int activecpu_get_icount(void) void activecpu_reset_banking(void) { VERIFY_ACTIVECPU(activecpu_reset_banking); - memory_set_opbase(activecpu_get_physical_pc_byte()); -} - - -/*-------------------------- - Input line setting ---------------------------*/ - -void activecpu_set_input_line(int irqline, int state) -{ - VERIFY_ACTIVECPU(activecpu_set_input_line); - if (state != INTERNAL_CLEAR_LINE && state != INTERNAL_ASSERT_LINE) - { - logerror("activecpu_set_input_line called when cpu_set_input_line should have been used!\n"); - return; - } - activecpu_set_info_int(CPUINFO_INT_INPUT_STATE + irqline, state - INTERNAL_CLEAR_LINE); + memory_set_opbase(cpu_get_physical_pc_byte(Machine->activecpu)); } -/*-------------------------- - Get/set PC ---------------------------*/ - -offs_t activecpu_get_physical_pc_byte(void) -{ - offs_t pc; - int shift; - - VERIFY_ACTIVECPU(activecpu_get_physical_pc_byte); - shift = cpu[activecpu].intf.address_shift; - pc = activecpu_get_reg(REG_PC); - if (shift < 0) - pc <<= -shift; - else - pc >>= shift; - if (cpu[activecpu].intf.translate) - (*cpu[activecpu].intf.translate)(ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &pc); - return pc; -} - - -void activecpu_set_opbase(unsigned val) -{ - VERIFY_ACTIVECPU(activecpu_set_opbase); - memory_set_opbase(val); -} - - -/*-------------------------- - Disassembly ---------------------------*/ - -offs_t activecpu_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) -{ - unsigned result; - - VERIFY_ACTIVECPU(activecpu_dasm); - - /* check for disassembler override */ - if (cpu_dasm_override[activecpu]) - { - result = (*cpu_dasm_override[activecpu])(buffer, pc, oprom, opram); - if (result != 0) - return result; - } - - if (cpu[activecpu].intf.disassemble != NULL) - { - result = (*cpu[activecpu].intf.disassemble)(buffer, pc, oprom, opram); - } - else - { - /* if no disassembler present, dump vanilla bytes */ - switch (activecpu_min_instruction_bytes()) - { - case 1: - default: - sprintf(buffer, "$%02X", (unsigned) *((UINT8 *) oprom)); - result = 1; - break; - - case 2: - sprintf(buffer, "$%04X", (unsigned) *((UINT16 *) oprom)); - result = 2; - break; - - case 4: - sprintf(buffer, "$%08X", (unsigned) *((UINT32 *) oprom)); - result = 4; - break; - } - } - - /* make sure we get good results */ - assert((result & DASMFLAG_LENGTHMASK) != 0); -#ifdef MAME_DEBUG -{ - int shift = activecpu_addrbus_shift(ADDRESS_SPACE_PROGRAM); - int bytes = (shift < 0) ? ((result & DASMFLAG_LENGTHMASK) << -shift) : ((result & DASMFLAG_LENGTHMASK) >> shift); - assert(bytes >= activecpu_min_instruction_bytes()); - assert(bytes <= activecpu_max_instruction_bytes()); - (void) bytes; /* appease compiler */ -} -#endif - - return result; -} - - - /************************************* * * Interfaces to a specific CPU @@ -1460,51 +1289,55 @@ offs_t activecpu_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 * Get info accessors --------------------------*/ -INT64 cpunum_get_info_int(int cpunum, UINT32 state) +INT64 cpu_get_info_int(const device_config *cpu, UINT32 state) { + cpuintrf_data *cpudata = cpu->classtoken; cpuinfo info; - VERIFY_CPUNUM(cpunum_get_info_int); - cpuintrf_push_context(cpunum); + VERIFY_CPU(cpu_get_info_int); + cpu_push_context(cpu); info.i = 0; - (*cpu[cpunum].intf.get_info)(state, &info); - cpuintrf_pop_context(); + (*cpudata->intf.get_info)(state, &info); + cpu_pop_context(); return info.i; } -void *cpunum_get_info_ptr(int cpunum, UINT32 state) +void *cpu_get_info_ptr(const device_config *cpu, UINT32 state) { + cpuintrf_data *cpudata = cpu->classtoken; cpuinfo info; - VERIFY_CPUNUM(cpunum_get_info_ptr); - cpuintrf_push_context(cpunum); + VERIFY_CPU(cpu_get_info_ptr); + cpu_push_context(cpu); info.p = NULL; - (*cpu[cpunum].intf.get_info)(state, &info); - cpuintrf_pop_context(); + (*cpudata->intf.get_info)(state, &info); + cpu_pop_context(); return info.p; } -genf *cpunum_get_info_fct(int cpunum, UINT32 state) +genf *cpu_get_info_fct(const device_config *cpu, UINT32 state) { + cpuintrf_data *cpudata = cpu->classtoken; cpuinfo info; - VERIFY_CPUNUM(cpunum_get_info_fct); - cpuintrf_push_context(cpunum); + VERIFY_CPU(cpu_get_info_fct); + cpu_push_context(cpu); info.f = NULL; - (*cpu[cpunum].intf.get_info)(state, &info); - cpuintrf_pop_context(); + (*cpudata->intf.get_info)(state, &info); + cpu_pop_context(); return info.f; } -const char *cpunum_get_info_string(int cpunum, UINT32 state) +const char *cpu_get_info_string(const device_config *cpu, UINT32 state) { + cpuintrf_data *cpudata = cpu->classtoken; cpuinfo info; - VERIFY_CPUNUM(cpunum_get_info_string); - cpuintrf_push_context(cpunum); + VERIFY_CPU(cpu_get_info_string); + cpu_push_context(cpu); info.s = cpuintrf_temp_str(); - (*cpu[cpunum].intf.get_info)(state, &info); - cpuintrf_pop_context(); + (*cpudata->intf.get_info)(state, &info); + cpu_pop_context(); return info.s; } @@ -1513,34 +1346,40 @@ const char *cpunum_get_info_string(int cpunum, UINT32 state) Set info accessors --------------------------*/ -void cpunum_set_info_int(int cpunum, UINT32 state, INT64 data) +void cpu_set_info_int(const device_config *cpu, UINT32 state, INT64 data) { + cpuintrf_data *cpudata = cpu->classtoken; cpuinfo info; - VERIFY_CPUNUM(cpunum_set_info_int); + + VERIFY_CPU(cpu_set_info_int); info.i = data; - cpuintrf_push_context(cpunum); - (*cpu[cpunum].intf.set_info)(state, &info); - cpuintrf_pop_context(); + cpu_push_context(cpu); + (*cpudata->intf.set_info)(state, &info); + cpu_pop_context(); } -void cpunum_set_info_ptr(int cpunum, UINT32 state, void *data) +void cpu_set_info_ptr(const device_config *cpu, UINT32 state, void *data) { + cpuintrf_data *cpudata = cpu->classtoken; cpuinfo info; - VERIFY_CPUNUM(cpunum_set_info_ptr); + + VERIFY_CPU(cpu_set_info_ptr); info.p = data; - cpuintrf_push_context(cpunum); - (*cpu[cpunum].intf.set_info)(state, &info); - cpuintrf_pop_context(); + cpu_push_context(cpu); + (*cpudata->intf.set_info)(state, &info); + cpu_pop_context(); } -void cpunum_set_info_fct(int cpunum, UINT32 state, genf *data) +void cpu_set_info_fct(const device_config *cpu, UINT32 state, genf *data) { + cpuintrf_data *cpudata = cpu->classtoken; cpuinfo info; - VERIFY_CPUNUM(cpunum_set_info_ptr); + + VERIFY_CPU(cpu_set_info_ptr); info.f = data; - cpuintrf_push_context(cpunum); - (*cpu[cpunum].intf.set_info)(state, &info); - cpuintrf_pop_context(); + cpu_push_context(cpu); + (*cpudata->intf.set_info)(state, &info); + cpu_pop_context(); } @@ -1548,16 +1387,20 @@ void cpunum_set_info_fct(int cpunum, UINT32 state, genf *data) Execute --------------------------*/ -int cpunum_execute(int cpunum, int cycles) +int cpu_execute(const device_config *cpu, int cycles) { + cpuintrf_data *cpudata = cpu->classtoken; int ran; - VERIFY_CPUNUM(cpunum_execute); - cpuintrf_push_context(cpunum); - executingcpu = cpunum; - memory_set_opbase(activecpu_get_physical_pc_byte()); - ran = (*cpu[cpunum].intf.execute)(cpu[cpunum].device, cycles); - executingcpu = -1; - cpuintrf_pop_context(); + + VERIFY_CPU(cpu_execute); + cpu_push_context(cpu); + executingcpu = cpu; + executingcpunum = cpudata->index; + memory_set_opbase(cpu_get_physical_pc_byte(cpu)); + ran = (*cpudata->intf.execute)(cpu, cycles); + executingcpu = NULL; + executingcpunum = -1; + cpu_pop_context(); return ran; } @@ -1566,13 +1409,15 @@ int cpunum_execute(int cpunum, int cycles) Reset and set IRQ ack --------------------------*/ -void cpunum_reset(int cpunum) +void cpu_reset(const device_config *cpu) { - VERIFY_CPUNUM(cpunum_reset); - cpuintrf_push_context(cpunum); + cpuintrf_data *cpudata = cpu->classtoken; + + VERIFY_CPU(cpu_reset); + cpu_push_context(cpu); memory_set_opbase(0); - (*cpu[cpunum].intf.reset)(cpu[cpunum].device); - cpuintrf_pop_context(); + (*cpudata->intf.reset)(cpu); + cpu_pop_context(); } @@ -1580,13 +1425,14 @@ void cpunum_reset(int cpunum) Read a byte --------------------------*/ -UINT8 cpunum_read_byte(int cpunum, offs_t address) +UINT8 cpu_read_byte(const device_config *cpu, offs_t address) { int result; - VERIFY_CPUNUM(cpunum_read_byte); - cpuintrf_push_context(cpunum); + + VERIFY_CPU(cpu_read_byte); + cpu_push_context(cpu); result = program_read_byte(address); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -1595,23 +1441,13 @@ UINT8 cpunum_read_byte(int cpunum, offs_t address) Write a byte --------------------------*/ -void cpunum_write_byte(int cpunum, offs_t address, UINT8 data) +void cpu_write_byte(const device_config *cpu, offs_t address, UINT8 data) { - VERIFY_CPUNUM(cpunum_write_byte); - cpuintrf_push_context(cpunum); + VERIFY_CPU(cpu_write_byte); + + cpu_push_context(cpu); program_write_byte(address, data); - cpuintrf_pop_context(); -} - - -/*-------------------------- - Get context pointer ---------------------------*/ - -void *cpunum_get_context_ptr(int cpunum) -{ - VERIFY_CPUNUM(cpunum_get_context_ptr); - return (cpu_active_context[cpu[cpunum].family] == cpunum) ? NULL : cpu[cpunum].device->token; + cpu_pop_context(); } @@ -1619,32 +1455,34 @@ void *cpunum_get_context_ptr(int cpunum) Get/set PC --------------------------*/ -offs_t cpunum_get_physical_pc_byte(int cpunum) +offs_t cpu_get_physical_pc_byte(const device_config *cpu) { + cpuintrf_data *cpudata = cpu->classtoken; offs_t pc; int shift; - VERIFY_CPUNUM(cpunum_get_physical_pc_byte); - shift = cpu[cpunum].intf.address_shift; - cpuintrf_push_context(cpunum); - pc = activecpu_get_info_int(CPUINFO_INT_PC); + VERIFY_CPU(cpu_get_physical_pc_byte); + shift = cpudata->intf.address_shift; + cpu_push_context(cpu); + pc = cpu_get_info_int(cpu, CPUINFO_INT_PC); if (shift < 0) pc <<= -shift; else pc >>= shift; - if (cpu[activecpu].intf.translate) - (*cpu[activecpu].intf.translate)(ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &pc); - cpuintrf_pop_context(); + if (cpudata->intf.translate != NULL) + (cpudata->intf.translate)(ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &pc); + cpu_pop_context(); return pc; } -void cpunum_set_opbase(int cpunum, unsigned val) +void cpu_set_opbase(const device_config *cpu, unsigned val) { - VERIFY_CPUNUM(cpunum_set_opbase); - cpuintrf_push_context(cpunum); + VERIFY_CPU(cpu_set_opbase); + + cpu_push_context(cpu); memory_set_opbase(val); - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -1652,13 +1490,61 @@ void cpunum_set_opbase(int cpunum, unsigned val) Disassembly --------------------------*/ -offs_t cpunum_dasm(int cpunum, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) +offs_t cpu_dasm(const device_config *cpu, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) { - unsigned result; - VERIFY_CPUNUM(cpunum_dasm); - cpuintrf_push_context(cpunum); - result = activecpu_dasm(buffer, pc, oprom, opram); - cpuintrf_pop_context(); + cpuintrf_data *cpudata = cpu->classtoken; + offs_t result; + + VERIFY_CPU(cpu_dasm); + cpu_push_context(cpu); + + /* check for disassembler override */ + if (cpudata->dasm_override != NULL) + { + result = (*cpudata->dasm_override)(buffer, pc, oprom, opram); + if (result != 0) + return result; + } + + if (cpudata->intf.disassemble != NULL) + result = (*cpudata->intf.disassemble)(buffer, pc, oprom, opram); + + else + { + /* if no disassembler present, dump vanilla bytes */ + switch (cpu_get_min_opcode_bytes(cpu)) + { + case 1: + default: + sprintf(buffer, "$%02X", (unsigned) *((UINT8 *) oprom)); + result = 1; + break; + + case 2: + sprintf(buffer, "$%04X", (unsigned) *((UINT16 *) oprom)); + result = 2; + break; + + case 4: + sprintf(buffer, "$%08X", (unsigned) *((UINT32 *) oprom)); + result = 4; + break; + } + } + + /* make sure we get good results */ + assert((result & DASMFLAG_LENGTHMASK) != 0); +#ifdef MAME_DEBUG +{ + int shift = cpu_get_addrbus_shift(cpu, ADDRESS_SPACE_PROGRAM); + int bytes = (shift < 0) ? ((result & DASMFLAG_LENGTHMASK) << -shift) : ((result & DASMFLAG_LENGTHMASK) >> shift); + assert(bytes >= cpu_get_min_opcode_bytes(cpu)); + assert(bytes <= cpu_get_max_opcode_bytes(cpu)); + (void) bytes; /* appease compiler */ +} +#endif + + cpu_pop_context(); return result; } diff --git a/src/emu/cpuintrf.h b/src/emu/cpuintrf.h index bfbdc252010..b7f4a56e4fa 100644 --- a/src/emu/cpuintrf.h +++ b/src/emu/cpuintrf.h @@ -37,10 +37,6 @@ enum HOLD_LINE, /* hold interrupt line until acknowledged */ PULSE_LINE, /* pulse interrupt line for one instruction */ - /* internal flags (not for use by drivers!) */ - INTERNAL_CLEAR_LINE = 100 + CLEAR_LINE, - INTERNAL_ASSERT_LINE = 100 + ASSERT_LINE, - /* input lines */ MAX_INPUT_LINES = 32+3, INPUT_LINE_IRQ0 = 0, @@ -373,33 +369,16 @@ int cpuintrf_init_cpu(int cpunum, cpu_type cputype, int clock, const void *confi void cpuintrf_exit_cpu(int cpunum); /* remember the previous context and set a new one */ -void cpuintrf_push_context(int cpunum); +void cpu_push_context(const device_config *cpu); /* restore the previous context */ -void cpuintrf_pop_context(void); +void cpu_pop_context(void); /* circular string buffer */ char *cpuintrf_temp_str(void); /* set the dasm override handler */ -void cpuintrf_set_dasm_override(int cpunum, offs_t (*dasm_override)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)); - - - -/*************************************************************************** - ACTIVE CPU ACCCESSORS -***************************************************************************/ - -/* get info accessors */ -INT64 activecpu_get_info_int(UINT32 state); -void *activecpu_get_info_ptr(UINT32 state); -genf *activecpu_get_info_fct(UINT32 state); -const char *activecpu_get_info_string(UINT32 state); - -/* set info accessors */ -void activecpu_set_info_int(UINT32 state, INT64 data); -void activecpu_set_info_ptr(UINT32 state, void *data); -void activecpu_set_info_fct(UINT32 state, genf *data); +void cpu_set_dasm_override(const device_config *cpu, cpu_disassemble_func dasm_override); /* apply a +/- to the current icount */ void activecpu_adjust_icount(int delta); @@ -410,117 +389,75 @@ int activecpu_get_icount(void); /* ensure banking is reset properly */ void activecpu_reset_banking(void); -/* set the input line on a CPU -- drivers use cpu_set_input_line() */ -void activecpu_set_input_line(int irqline, int state); - -/* return the PC, corrected to a byte offset, on the active CPU */ -offs_t activecpu_get_physical_pc_byte(void); - -/* update the banking on the active CPU */ -void activecpu_set_opbase(offs_t val); - -/* disassemble a line at a given PC on the active CPU */ -offs_t activecpu_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -#define activecpu_context_size() activecpu_get_info_int(CPUINFO_INT_CONTEXT_SIZE) -#define activecpu_input_lines() activecpu_get_info_int(CPUINFO_INT_INPUT_LINES) -#define activecpu_output_lines() activecpu_get_info_int(CPUINFO_INT_OUTPUT_LINES) -#define activecpu_default_irq_vector() activecpu_get_info_int(CPUINFO_INT_DEFAULT_IRQ_VECTOR) -#define activecpu_endianness() activecpu_get_info_int(CPUINFO_INT_ENDIANNESS) -#define activecpu_clock_multiplier() activecpu_get_info_int(CPUINFO_INT_CLOCK_MULTIPLIER) -#define activecpu_clock_divider() activecpu_get_info_int(CPUINFO_INT_CLOCK_DIVIDER) -#define activecpu_min_instruction_bytes() activecpu_get_info_int(CPUINFO_INT_MIN_INSTRUCTION_BYTES) -#define activecpu_max_instruction_bytes() activecpu_get_info_int(CPUINFO_INT_MAX_INSTRUCTION_BYTES) -#define activecpu_min_cycles() activecpu_get_info_int(CPUINFO_INT_MIN_CYCLES) -#define activecpu_max_cycles() activecpu_get_info_int(CPUINFO_INT_MAX_CYCLES) -#define activecpu_databus_width(space) activecpu_get_info_int(CPUINFO_INT_DATABUS_WIDTH + (space)) -#define activecpu_addrbus_width(space) activecpu_get_info_int(CPUINFO_INT_ADDRBUS_WIDTH + (space)) -#define activecpu_addrbus_shift(space) activecpu_get_info_int(CPUINFO_INT_ADDRBUS_SHIFT + (space)) -#define activecpu_logaddr_width(space) activecpu_get_info_int(CPUINFO_INT_LOGADDR_WIDTH + (space)) -#define activecpu_page_shift(space) activecpu_get_info_int(CPUINFO_INT_PAGE_SHIFT + (space)) -#define activecpu_get_reg(reg) activecpu_get_info_int(CPUINFO_INT_REGISTER + (reg)) -#define activecpu_debug_register_list() activecpu_get_info_ptr(CPUINFO_PTR_DEBUG_REGISTER_LIST) -#define activecpu_name() activecpu_get_info_string(CPUINFO_STR_NAME) -#define activecpu_core_family() activecpu_get_info_string(CPUINFO_STR_CORE_FAMILY) -#define activecpu_core_version() activecpu_get_info_string(CPUINFO_STR_CORE_VERSION) -#define activecpu_core_file() activecpu_get_info_string(CPUINFO_STR_CORE_FILE) -#define activecpu_core_credits() activecpu_get_info_string(CPUINFO_STR_CORE_CREDITS) -#define activecpu_flags() activecpu_get_info_string(CPUINFO_STR_FLAGS) -#define activecpu_irq_string(irq) activecpu_get_info_string(CPUINFO_STR_IRQ_STATE + (irq)) -#define activecpu_reg_string(reg) activecpu_get_info_string(CPUINFO_STR_REGISTER + (reg)) - -#define activecpu_set_reg(reg, val) activecpu_set_info_int(CPUINFO_INT_REGISTER + (reg), (val)) - /*************************************************************************** - SPECIFIC CPU ACCCESSORS + CORE CPU ACCCESSORS ***************************************************************************/ /* get info accessors */ -INT64 cpunum_get_info_int(int cpunum, UINT32 state); -void *cpunum_get_info_ptr(int cpunum, UINT32 state); -genf *cpunum_get_info_fct(int cpunum, UINT32 state); -const char *cpunum_get_info_string(int cpunum, UINT32 state); +INT64 cpu_get_info_int(const device_config *cpu, UINT32 state); +void *cpu_get_info_ptr(const device_config *cpu, UINT32 state); +genf *cpu_get_info_fct(const device_config *cpu, UINT32 state); +const char *cpu_get_info_string(const device_config *cpu, UINT32 state); /* set info accessors */ -void cpunum_set_info_int(int cpunum, UINT32 state, INT64 data); -void cpunum_set_info_ptr(int cpunum, UINT32 state, void *data); -void cpunum_set_info_fct(int cpunum, UINT32 state, genf *data); +void cpu_set_info_int(const device_config *cpu, UINT32 state, INT64 data); +void cpu_set_info_ptr(const device_config *cpu, UINT32 state, void *data); +void cpu_set_info_fct(const device_config *cpu, UINT32 state, genf *data); /* execute the requested cycles on a given CPU */ -int cpunum_execute(int cpunum, int cycles); +int cpu_execute(const device_config *cpu, int cycles); /* signal a reset for a given CPU */ -void cpunum_reset(int cpunum); +void cpu_reset(const device_config *cpu); /* read a byte from another CPU's memory space */ -UINT8 cpunum_read_byte(int cpunum, offs_t address); +UINT8 cpu_read_byte(const device_config *cpu, offs_t address); /* write a byte from another CPU's memory space */ -void cpunum_write_byte(int cpunum, offs_t address, UINT8 data); - -/* return a pointer to the saved context of a given CPU, or NULL if the - context is active (and contained within the CPU core */ -void *cpunum_get_context_ptr(int cpunum); +void cpu_write_byte(const device_config *cpu, offs_t address, UINT8 data); /* return the PC, corrected to a byte offset, on a given CPU */ -offs_t cpunum_get_physical_pc_byte(int cpunum); +offs_t cpu_get_physical_pc_byte(const device_config *cpu); /* update the banking on a given CPU */ -void cpunum_set_opbase(int cpunum, offs_t val); +void cpu_set_opbase(const device_config *cpu, offs_t val); /* disassemble a line at a given PC on a given CPU */ -offs_t cpunum_dasm(int cpunum, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); - -#define cpunum_context_size(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_CONTEXT_SIZE) -#define cpunum_input_lines(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_INPUT_LINES) -#define cpunum_output_lines(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_OUTPUT_LINES) -#define cpunum_default_irq_vector(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_DEFAULT_IRQ_VECTOR) -#define cpunum_endianness(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_ENDIANNESS) -#define cpunum_clock_multiplier(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_CLOCK_MULTIPLIER) -#define cpunum_clock_divider(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_CLOCK_DIVIDER) -#define cpunum_min_instruction_bytes(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_MIN_INSTRUCTION_BYTES) -#define cpunum_max_instruction_bytes(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_MAX_INSTRUCTION_BYTES) -#define cpunum_min_cycles(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_MIN_CYCLES) -#define cpunum_max_cycles(cpunum) cpunum_get_info_int(cpunum, CPUINFO_INT_MAX_CYCLES) -#define cpunum_databus_width(cpunum, space) cpunum_get_info_int(cpunum, CPUINFO_INT_DATABUS_WIDTH + (space)) -#define cpunum_addrbus_width(cpunum, space) cpunum_get_info_int(cpunum, CPUINFO_INT_ADDRBUS_WIDTH + (space)) -#define cpunum_addrbus_shift(cpunum, space) cpunum_get_info_int(cpunum, CPUINFO_INT_ADDRBUS_SHIFT + (space)) -#define cpunum_logaddr_width(cpunum, space) cpunum_get_info_int(cpunum, CPUINFO_INT_LOGADDR_WIDTH + (space)) -#define cpunum_page_shift(cpunum, space) cpunum_get_info_int(cpunum, CPUINFO_INT_PAGE_SHIFT + (space)) -#define cpunum_get_reg(cpunum, reg) cpunum_get_info_int(cpunum, CPUINFO_INT_REGISTER + (reg)) -#define cpunum_debug_register_list(cpunum) cpunum_get_info_ptr(cpunum, CPUINFO_PTR_DEBUG_REGISTER_LIST) -#define cpunum_name(cpunum) cpunum_get_info_string(cpunum, CPUINFO_STR_NAME) -#define cpunum_core_family(cpunum) cpunum_get_info_string(cpunum, CPUINFO_STR_CORE_FAMILY) -#define cpunum_core_version(cpunum) cpunum_get_info_string(cpunum, CPUINFO_STR_CORE_VERSION) -#define cpunum_core_file(cpunum) cpunum_get_info_string(cpunum, CPUINFO_STR_CORE_FILE) -#define cpunum_core_credits(cpunum) cpunum_get_info_string(cpunum, CPUINFO_STR_CORE_CREDITS) -#define cpunum_flags(cpunum) cpunum_get_info_string(cpunum, CPUINFO_STR_FLAGS) -#define cpunum_irq_string(cpunum, irq) cpunum_get_info_string(cpunum, CPUINFO_STR_IRQ_STATE + (irq)) -#define cpunum_reg_string(cpunum, reg) cpunum_get_info_string(cpunum, CPUINFO_STR_REGISTER + (reg)) - -#define cpunum_set_reg(cpunum, reg, val) cpunum_set_info_int(cpunum, CPUINFO_INT_REGISTER + (reg), (val)) +offs_t cpu_dasm(const device_config *cpu, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); + +#define cpu_get_context_size(cpu) cpu_get_info_int(cpu, CPUINFO_INT_CONTEXT_SIZE) +#define cpu_get_input_lines(cpu) cpu_get_info_int(cpu, CPUINFO_INT_INPUT_LINES) +#define cpu_get_output_lines(cpu) cpu_get_info_int(cpu, CPUINFO_INT_OUTPUT_LINES) +#define cpu_get_default_irq_vector(cpu) cpu_get_info_int(cpu, CPUINFO_INT_DEFAULT_IRQ_VECTOR) +#define cpu_get_endianness(cpu) cpu_get_info_int(cpu, CPUINFO_INT_ENDIANNESS) +#define cpu_get_clock_multiplier(cpu) cpu_get_info_int(cpu, CPUINFO_INT_CLOCK_MULTIPLIER) +#define cpu_get_clock_divider(cpu) cpu_get_info_int(cpu, CPUINFO_INT_CLOCK_DIVIDER) +#define cpu_get_min_opcode_bytes(cpu) cpu_get_info_int(cpu, CPUINFO_INT_MIN_INSTRUCTION_BYTES) +#define cpu_get_max_opcode_bytes(cpu) cpu_get_info_int(cpu, CPUINFO_INT_MAX_INSTRUCTION_BYTES) +#define cpu_get_min_cycles(cpu) cpu_get_info_int(cpu, CPUINFO_INT_MIN_CYCLES) +#define cpu_get_max_cycles(cpu) cpu_get_info_int(cpu, CPUINFO_INT_MAX_CYCLES) +#define cpu_get_databus_width(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_DATABUS_WIDTH + (space)) +#define cpu_get_addrbus_width(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_ADDRBUS_WIDTH + (space)) +#define cpu_get_addrbus_shift(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_ADDRBUS_SHIFT + (space)) +#define cpu_get_logaddr_width(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_LOGADDR_WIDTH + (space)) +#define cpu_get_page_shift(cpu, space) cpu_get_info_int(cpu, CPUINFO_INT_PAGE_SHIFT + (space)) +#define cpu_get_reg(cpu, reg) cpu_get_info_int(cpu, CPUINFO_INT_REGISTER + (reg)) +#define cpu_get_previouspc(cpu) ((offs_t)cpu_get_info_int(cpu, REG_PREVIOUSPC)) +#define cpu_get_pc(cpu) ((offs_t)cpu_get_reg(cpu, REG_PC)) +#define cpu_get_sp(cpu) cpu_get_reg(cpu, REG_SP) +#define cpu_get_debug_register_list(cpu) cpu_get_info_ptr(cpu, CPUINFO_PTR_DEBUG_REGISTER_LIST) +#define cpu_get_name(cpu) cpu_get_info_string(cpu, CPUINFO_STR_NAME) +#define cpu_get_core_family(cpu) cpu_get_info_string(cpu, CPUINFO_STR_CORE_FAMILY) +#define cpu_get_core_version(cpu) cpu_get_info_string(cpu, CPUINFO_STR_CORE_VERSION) +#define cpu_get_core_file(cpu) cpu_get_info_string(cpu, CPUINFO_STR_CORE_FILE) +#define cpu_get_core_credits(cpu) cpu_get_info_string(cpu, CPUINFO_STR_CORE_CREDITS) +#define cpu_get_flags_string(cpu) cpu_get_info_string(cpu, CPUINFO_STR_FLAGS) +#define cpu_get_irq_string(cpu, irq) cpu_get_info_string(cpu, CPUINFO_STR_IRQ_STATE + (irq)) +#define cpu_get_reg_string(cpu, reg) cpu_get_info_string(cpu, CPUINFO_STR_REGISTER + (reg)) + +#define cpu_set_reg(cpu, reg, val) cpu_set_info_int(cpu, CPUINFO_INT_REGISTER + (reg), (val)) @@ -559,16 +496,6 @@ const char *cputype_get_info_string(cpu_type cputype, UINT32 state); /*************************************************************************** - MACROS -***************************************************************************/ - -#define activecpu_get_previouspc() ((offs_t)activecpu_get_reg(REG_PREVIOUSPC)) -#define activecpu_get_pc() ((offs_t)activecpu_get_reg(REG_PC)) -#define activecpu_get_sp() activecpu_get_reg(REG_SP) - - - -/*************************************************************************** CPU INTERFACE ACCESSORS ***************************************************************************/ @@ -580,22 +507,30 @@ INLINE const cpu_interface *cputype_get_interface(cpu_type cputype) } -/* return a the index of the active CPU */ -INLINE int cpu_getactivecpu(void) +/* return the index of the active CPU */ +INLINE int cpunum_get_active(void) { - extern int activecpu; - return activecpu; + extern int activecpunum; + return activecpunum; } -/* return a the index of the executing CPU */ -INLINE int cpu_getexecutingcpu(void) +/* return a pointer to the executing CPU */ +INLINE const device_config *cpu_get_executing(void) { - extern int executingcpu; + extern const device_config *executingcpu; return executingcpu; } +/* return the index of the executing CPU */ +INLINE int cpunum_get_executing(void) +{ + extern int executingcpunum; + return executingcpunum; +} + + /* return a the total number of registered CPUs */ INLINE int cpu_gettotalcpu(void) { @@ -605,9 +540,9 @@ INLINE int cpu_gettotalcpu(void) /* return the current PC or ~0 if no CPU is active */ -INLINE offs_t safe_activecpu_get_pc(void) +INLINE offs_t safe_cpu_get_pc(const device_config *cpu) { - return (cpu_getactivecpu() >= 0) ? activecpu_get_pc() : ~0; + return (cpu != NULL) ? cpu_get_pc(cpu) : ~0; } diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c index 3e572752c0d..8b338293572 100644 --- a/src/emu/debug/debugcmd.c +++ b/src/emu/debug/debugcmd.c @@ -248,7 +248,7 @@ void debug_command_init(running_machine *machine) for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { cpu_debug_init_func debug_init; - debug_init = cpunum_get_info_fct(cpunum, CPUINFO_PTR_DEBUG_INIT); + debug_init = cpu_get_info_fct(machine->cpu[cpunum], CPUINFO_PTR_DEBUG_INIT); if (debug_init != NULL) (*debug_init)(); } @@ -369,7 +369,7 @@ static void global_set(void *ref, UINT64 value) int debug_command_parameter_number(const char *param, UINT64 *result) { - EXPRERR err = expression_evaluate(param, debug_get_cpu_info(cpu_getactivecpu())->symtable, &debug_expression_callbacks, result); + EXPRERR err = expression_evaluate(param, debug_get_cpu_info(cpunum_get_active())->symtable, &debug_expression_callbacks, result); if (err == EXPRERR_NONE) return 1; debug_console_printf("Error in expression: %s\n", param); @@ -386,7 +386,7 @@ int debug_command_parameter_number(const char *param, UINT64 *result) static int debug_command_parameter_expression(const char *param, parsed_expression **result) { - EXPRERR err = expression_parse(param, debug_get_cpu_info(cpu_getactivecpu())->symtable, &debug_expression_callbacks, result); + EXPRERR err = expression_parse(param, debug_get_cpu_info(cpunum_get_active())->symtable, &debug_expression_callbacks, result); if (err == EXPRERR_NONE) return 1; debug_console_printf("Error in expression: %s\n", param); @@ -601,7 +601,7 @@ static void execute_logerror(running_machine *machine, int ref, int params, cons static void execute_tracelog(running_machine *machine, int ref, int params, const char *param[]) { - FILE *file = debug_get_cpu_info(cpu_getactivecpu())->trace.file; + FILE *file = debug_get_cpu_info(cpunum_get_active())->trace.file; UINT64 values[MAX_COMMAND_PARAMS]; char buffer[1024]; int i; @@ -935,7 +935,7 @@ static void execute_comment(running_machine *machine, int ref, int params, const } /* Now try adding the comment */ - debug_comment_add(cpu_getactivecpu(), address, param[1], 0x00ff0000, debug_comment_get_opcode_crc32(address)); + debug_comment_add(cpunum_get_active(), address, param[1], 0x00ff0000, debug_comment_get_opcode_crc32(address)); debug_view_update_type(DVT_DISASSEMBLY); } @@ -954,7 +954,7 @@ static void execute_comment_del(running_machine *machine, int ref, int params, c /* If it's a number, it must be an address */ /* The bankoff and cbn will be pulled from what's currently active */ - debug_comment_remove(cpu_getactivecpu(), address, debug_comment_get_opcode_crc32(address)); + debug_comment_remove(cpunum_get_active(), address, debug_comment_get_opcode_crc32(address)); debug_view_update_type(DVT_DISASSEMBLY); } @@ -983,7 +983,7 @@ static void execute_bpset(running_machine *machine, int ref, int params, const c int bpnum; /* make sure that there is an active CPU */ - if (cpu_getactivecpu() < 0) + if (cpunum_get_active() < 0) { debug_console_printf("No active CPU!\n"); return; @@ -1002,7 +1002,7 @@ static void execute_bpset(running_machine *machine, int ref, int params, const c return; /* set the breakpoint */ - bpnum = debug_cpu_breakpoint_set(machine, cpu_getactivecpu(), address, condition, action); + bpnum = debug_cpu_breakpoint_set(machine, cpunum_get_active(), address, condition, action); debug_console_printf("Breakpoint %X set\n", bpnum); } @@ -1176,7 +1176,7 @@ static void execute_wpset(running_machine *machine, int ref, int params, const c return; /* set the watchpoint */ - wpnum = debug_cpu_watchpoint_set(machine, cpu_getactivecpu(), ref, type, address, length, condition, action); + wpnum = debug_cpu_watchpoint_set(machine, cpunum_get_active(), ref, type, address, length, condition, action); debug_console_printf("Watchpoint %X set\n", wpnum); } @@ -1362,7 +1362,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const } /* extract parameters */ - cpunum = cpu_getactivecpu(); + cpunum = cpunum_get_active(); count = 64; threshhold = 250; if (params > 0 && !debug_command_parameter_number(param[0], &cpunum)) @@ -1386,7 +1386,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const static void execute_save(running_machine *machine, int ref, int params, const char *param[]) { - UINT64 offset, endoffset, length, cpunum = cpu_getactivecpu(); + UINT64 offset, endoffset, length, cpunum = cpunum_get_active(); const debug_cpu_info *info; int spacenum = ref; FILE *f; @@ -1414,13 +1414,13 @@ static void execute_save(running_machine *machine, int ref, int params, const ch } /* now write the data out */ - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); for (i = offset; i <= endoffset; i++) { UINT8 byte = debug_read_byte(spacenum, i, TRUE); fwrite(&byte, 1, 1, f); } - cpuintrf_pop_context(); + cpu_pop_context(); /* close the file */ fclose(f); @@ -1434,7 +1434,7 @@ static void execute_save(running_machine *machine, int ref, int params, const ch static void execute_dump(running_machine *machine, int ref, int params, const char *param[]) { - UINT64 offset, endoffset, length, width = 0, ascii = 1, cpunum = cpu_getactivecpu(); + UINT64 offset, endoffset, length, width = 0, ascii = 1, cpunum = cpunum_get_active(); const debug_cpu_info *info; int spacenum = ref; FILE *f = NULL; @@ -1480,7 +1480,7 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch } /* now write the data out */ - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); for (i = offset; i <= endoffset; i += 16) { char output[200]; @@ -1589,7 +1589,7 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch /* output the result */ fprintf(f, "%s\n", output); } - cpuintrf_pop_context(); + cpu_pop_context(); /* close the file */ fclose(f); @@ -1603,7 +1603,7 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch static void execute_find(running_machine *machine, int ref, int params, const char *param[]) { - UINT64 offset, endoffset, length, cpunum = cpu_getactivecpu(); + UINT64 offset, endoffset, length, cpunum = cpunum_get_active(); const debug_cpu_info *info; UINT64 data_to_find[256]; UINT8 data_size[256]; @@ -1668,7 +1668,7 @@ static void execute_find(running_machine *machine, int ref, int params, const ch } /* now search */ - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); for (i = offset; i <= endoffset; i += data_size[0]) { int suboffset = 0; @@ -1695,7 +1695,7 @@ static void execute_find(running_machine *machine, int ref, int params, const ch debug_console_printf("Found at %*X\n", info->space[spacenum].logchars, (UINT32)BYTE2ADDR(i, info, spacenum)); } } - cpuintrf_pop_context(); + cpu_pop_context(); /* print something if not found */ if (found == 0) @@ -1709,7 +1709,7 @@ static void execute_find(running_machine *machine, int ref, int params, const ch static void execute_dasm(running_machine *machine, int ref, int params, const char *param[]) { - UINT64 offset, length, bytes = 1, cpunum = cpu_getactivecpu(); + UINT64 offset, length, bytes = 1, cpunum = cpunum_get_active(); const debug_cpu_info *info; int minbytes, maxbytes, byteswidth; FILE *f = NULL; @@ -1734,8 +1734,8 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch info = debug_get_cpu_info(cpunum); /* determine the width of the bytes */ - minbytes = cpunum_min_instruction_bytes(cpunum); - maxbytes = cpunum_max_instruction_bytes(cpunum); + minbytes = cpu_get_min_opcode_bytes(machine->cpu[cpunum]); + maxbytes = cpu_get_max_opcode_bytes(machine->cpu[cpunum]); byteswidth = 0; if (bytes) { @@ -1752,7 +1752,7 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch } /* now write the data out */ - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); for (i = 0; i < length; ) { int pcbyte = ADDR2BYTE_MASKED(offset + i, info, ADDRESS_SPACE_PROGRAM); @@ -1779,7 +1779,7 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch } /* disassemble the result */ - i += numbytes = activecpu_dasm(disasm, offset + i, opbuf, argbuf) & DASMFLAG_LENGTHMASK; + i += numbytes = cpu_dasm(machine->activecpu, disasm, offset + i, opbuf, argbuf) & DASMFLAG_LENGTHMASK; } /* print the bytes */ @@ -1841,7 +1841,7 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch /* output the result */ fprintf(f, "%s\n", output); } - cpuintrf_pop_context(); + cpu_pop_context(); /* close the file */ fclose(f); @@ -1861,7 +1861,7 @@ static void execute_trace_internal(running_machine *machine, int ref, int params const char *mode; UINT64 cpunum; - cpunum = cpu_getactivecpu(); + cpunum = cpunum_get_active(); /* validate parameters */ if (params > 1 && !debug_command_parameter_number(param[1], &cpunum)) @@ -1948,7 +1948,7 @@ static void execute_history(running_machine *machine, int ref, int params, const UINT64 cpunum; int i; - cpunum = cpu_getactivecpu(); + cpunum = cpunum_get_active(); /* validate parameters */ if (params > 0 && !debug_command_parameter_number(param[0], &cpunum)) @@ -1968,11 +1968,11 @@ static void execute_history(running_machine *machine, int ref, int params, const info = debug_get_cpu_info(cpunum); /* loop over lines */ - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); for (i = 0; i < count; i++) { offs_t pc = info->pc_history[(info->pc_history_index + DEBUG_HISTORY_SIZE - count + i) % DEBUG_HISTORY_SIZE]; - int maxbytes = activecpu_max_instruction_bytes(); + int maxbytes = cpu_get_max_opcode_bytes(machine->activecpu); UINT8 opbuf[64], argbuf[64]; char buffer[200]; offs_t pcbyte; @@ -1986,11 +1986,11 @@ static void execute_history(running_machine *machine, int ref, int params, const argbuf[numbytes] = debug_read_opcode(pcbyte + numbytes, 1, TRUE); } - activecpu_dasm(buffer, pc, opbuf, argbuf); + cpu_dasm(machine->activecpu, buffer, pc, opbuf, argbuf); debug_console_printf("%0*X: %s\n", info->space[ADDRESS_SPACE_PROGRAM].logchars, pc, buffer); } - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -2059,7 +2059,7 @@ static void execute_source(running_machine *machine, int ref, int params, const static void execute_map(running_machine *machine, int ref, int params, const char *param[]) { - UINT64 address, cpunum = cpu_getactivecpu(); + UINT64 address, cpunum = cpunum_get_active(); const debug_cpu_info *info; int spacenum = ref; offs_t taddress; diff --git a/src/emu/debug/debugcmt.c b/src/emu/debug/debugcmt.c index e07d8e4df3b..77986a77426 100644 --- a/src/emu/debug/debugcmt.c +++ b/src/emu/debug/debugcmt.c @@ -21,6 +21,7 @@ ***************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "xmlfile.h" #include "debugcmt.h" #include "debugcpu.h" @@ -300,14 +301,14 @@ UINT32 debug_comment_all_change_count(void) UINT32 debug_comment_get_opcode_crc32(offs_t address) { - const debug_cpu_info *info = debug_get_cpu_info(cpu_getactivecpu()); + const debug_cpu_info *info = debug_get_cpu_info(cpunum_get_active()); int i; UINT32 crc; UINT8 opbuf[64], argbuf[64]; char buff[256]; offs_t numbytes; - int maxbytes = activecpu_max_instruction_bytes(); - UINT32 addrmask = (debug_get_cpu_info(cpu_getactivecpu()))->space[ADDRESS_SPACE_PROGRAM].logaddrmask; + int maxbytes = cpu_get_max_opcode_bytes(Machine->activecpu); + UINT32 addrmask = (debug_get_cpu_info(cpunum_get_active()))->space[ADDRESS_SPACE_PROGRAM].logaddrmask; memset(opbuf, 0x00, sizeof(opbuf)); memset(argbuf, 0x00, sizeof(argbuf)); @@ -319,7 +320,7 @@ UINT32 debug_comment_get_opcode_crc32(offs_t address) argbuf[i] = debug_read_opcode(address + i, 1, TRUE); } - numbytes = activecpu_dasm(buff, address & addrmask, opbuf, argbuf) & DASMFLAG_LENGTHMASK; + numbytes = cpu_dasm(Machine->activecpu, buff, address & addrmask, opbuf, argbuf) & DASMFLAG_LENGTHMASK; numbytes = ADDR2BYTE(numbytes, info, ADDRESS_SPACE_PROGRAM); crc = crc32(0, argbuf, numbytes); diff --git a/src/emu/debug/debugcon.c b/src/emu/debug/debugcon.c index 4142167c8ee..74a4b41a1b6 100644 --- a/src/emu/debug/debugcon.c +++ b/src/emu/debug/debugcon.c @@ -328,7 +328,7 @@ static CMDERR internal_parse_command(running_machine *machine, const char *origi if (isexpr && paramcount == 1) { UINT64 expresult; - EXPRERR exprerr = expression_evaluate(command_start, debug_get_cpu_info(cpu_getactivecpu())->symtable, &debug_expression_callbacks, &expresult); + EXPRERR exprerr = expression_evaluate(command_start, debug_get_cpu_info(cpunum_get_active())->symtable, &debug_expression_callbacks, &expresult); if (exprerr != EXPRERR_NONE) return MAKE_CMDERR_EXPRESSION_ERROR(EXPRERR_ERROR_OFFSET(exprerr)); } diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index 54f95a4fa09..9c4bd904ecc 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -93,11 +93,11 @@ static debugger_private global; static void debug_cpu_exit(running_machine *machine); static void perform_trace(running_machine *machine, debug_cpu_info *info); -static void prepare_for_step_overout(debug_cpu_info *info); +static void prepare_for_step_overout(running_machine *machine, debug_cpu_info *info); static void process_source_file(running_machine *machine); static void breakpoint_check(running_machine *machine, debug_cpu_info *info, offs_t pc); static void watchpoint_check(running_machine *machine, int cpunum, int spacenum, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask); -static void check_hotspots(int cpunum, int spacenum, offs_t address); +static void check_hotspots(running_machine *machine, int cpunum, int spacenum, offs_t address); /* expression handlers */ static UINT64 expression_read_memory(const char *name, int space, UINT32 address, int size); @@ -226,25 +226,25 @@ void debug_cpu_init(running_machine *machine) /* reset the PC data */ info->valid = TRUE; info->flags = DEBUG_FLAG_OBSERVING | DEBUG_FLAG_HISTORY; - info->endianness = cpunum_endianness(cpunum); - info->opwidth = cpunum_min_instruction_bytes(cpunum); + info->endianness = cpu_get_endianness(machine->cpu[cpunum]); + info->opwidth = cpu_get_min_opcode_bytes(machine->cpu[cpunum]); /* fetch the memory accessors */ - info->translate = (cpu_translate_func)cpunum_get_info_fct(cpunum, CPUINFO_PTR_TRANSLATE); - info->read = (cpu_read_func)cpunum_get_info_fct(cpunum, CPUINFO_PTR_READ); - info->write = (cpu_write_func)cpunum_get_info_fct(cpunum, CPUINFO_PTR_WRITE); - info->readop = (cpu_readop_func)cpunum_get_info_fct(cpunum, CPUINFO_PTR_READOP); + info->translate = (cpu_translate_func)cpu_get_info_fct(machine->cpu[cpunum], CPUINFO_PTR_TRANSLATE); + info->read = (cpu_read_func)cpu_get_info_fct(machine->cpu[cpunum], CPUINFO_PTR_READ); + info->write = (cpu_write_func)cpu_get_info_fct(machine->cpu[cpunum], CPUINFO_PTR_WRITE); + info->readop = (cpu_readop_func)cpu_get_info_fct(machine->cpu[cpunum], CPUINFO_PTR_READOP); /* allocate a symbol table */ info->symtable = symtable_alloc(global_symtable); /* add a global symbol for the current instruction pointer */ - symtable_add_register(info->symtable, "curpc", NULL, get_current_pc, 0); + symtable_add_register(info->symtable, "curpc", machine, get_current_pc, 0); /* add all registers into it */ for (regnum = 0; regnum < MAX_REGS; regnum++) { - const char *str = cpunum_reg_string(cpunum, regnum); + const char *str = cpu_get_reg_string(machine->cpu[cpunum], regnum); const char *colon; char symname[256]; int charnum; @@ -272,11 +272,11 @@ void debug_cpu_init(running_machine *machine) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) { debug_space_info *spaceinfo = &info->space[spacenum]; - int datawidth = cpunum_databus_width(cpunum, spacenum); - int logwidth = cpunum_logaddr_width(cpunum, spacenum); - int physwidth = cpunum_addrbus_width(cpunum, spacenum); - int addrshift = cpunum_addrbus_shift(cpunum, spacenum); - int pageshift = cpunum_page_shift(cpunum, spacenum); + int datawidth = cpu_get_databus_width(machine->cpu[cpunum], spacenum); + int logwidth = cpu_get_logaddr_width(machine->cpu[cpunum], spacenum); + int physwidth = cpu_get_addrbus_width(machine->cpu[cpunum], spacenum); + int addrshift = cpu_get_addrbus_shift(machine->cpu[cpunum], spacenum); + int pageshift = cpu_get_page_shift(machine->cpu[cpunum], spacenum); if (logwidth == 0) logwidth = physwidth; @@ -639,7 +639,7 @@ void debug_cpu_instruction_hook(running_machine *machine, offs_t curpc) /* handle step out/over on the instruction we are about to execute */ if ((info->flags & (DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT)) != 0 && info->stepaddr == ~0) - prepare_for_step_overout(info); + prepare_for_step_overout(machine, info); /* no longer in debugger code */ global.within_instruction_hook = FALSE; @@ -662,7 +662,7 @@ void debug_cpu_memory_read_hook(running_machine *machine, int cpunum, int spacen /* check hotspots */ if (info->hotspots != NULL) - check_hotspots(cpunum, spacenum, address); + check_hotspots(machine, cpunum, spacenum, address); } @@ -988,10 +988,10 @@ int debug_cpu_is_stopped(running_machine *machine) data for a given instruction -------------------------------------------------*/ -static UINT32 dasm_wrapped(char *buffer, offs_t pc) +static UINT32 dasm_wrapped(running_machine *machine, char *buffer, offs_t pc) { - const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpu_getactivecpu()); - int maxbytes = activecpu_max_instruction_bytes(); + const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpunum_get_active()); + int maxbytes = cpu_get_max_opcode_bytes(machine->activecpu); UINT8 opbuf[64], argbuf[64]; offs_t pcbyte; int numbytes; @@ -1004,13 +1004,13 @@ static UINT32 dasm_wrapped(char *buffer, offs_t pc) argbuf[numbytes] = debug_read_opcode(pcbyte + numbytes, 1, TRUE); } - return activecpu_dasm(buffer, pc, opbuf, argbuf); + return cpu_dasm(machine->activecpu, buffer, pc, opbuf, argbuf); } static void perform_trace(running_machine *machine, debug_cpu_info *info) { - offs_t pc = activecpu_get_pc(); + offs_t pc = cpu_get_pc(machine->activecpu); int offset, count, i; char buffer[100]; offs_t dasmresult; @@ -1044,7 +1044,7 @@ static void perform_trace(running_machine *machine, debug_cpu_info *info) offset = sprintf(buffer, "%0*X: ", info->space[ADDRESS_SPACE_PROGRAM].logchars, pc); /* print the disassembly */ - dasmresult = dasm_wrapped(&buffer[offset], pc); + dasmresult = dasm_wrapped(machine, &buffer[offset], pc); /* output the result */ fprintf(info->trace.file, "%s\n", buffer); @@ -1057,7 +1057,7 @@ static void perform_trace(running_machine *machine, debug_cpu_info *info) /* if we need to skip additional instructions, advance as requested */ while (extraskip-- > 0) - trace_over_target += dasm_wrapped(buffer, trace_over_target) & DASMFLAG_LENGTHMASK; + trace_over_target += dasm_wrapped(machine, buffer, trace_over_target) & DASMFLAG_LENGTHMASK; info->trace.trace_over_target = trace_over_target; } @@ -1078,14 +1078,14 @@ static void perform_trace(running_machine *machine, debug_cpu_info *info) stepping over an instruction -------------------------------------------------*/ -static void prepare_for_step_overout(debug_cpu_info *info) +static void prepare_for_step_overout(running_machine *machine, debug_cpu_info *info) { - offs_t pc = activecpu_get_pc(); + offs_t pc = cpu_get_pc(machine->activecpu); char dasmbuffer[100]; offs_t dasmresult; /* disassemble the current instruction and get the flags */ - dasmresult = dasm_wrapped(dasmbuffer, pc); + dasmresult = dasm_wrapped(machine, dasmbuffer, pc); /* if flags are supported and it's a call-style opcode, set a temp breakpoint after that instruction */ if ((dasmresult & DASMFLAG_SUPPORTED) != 0 && (dasmresult & DASMFLAG_STEP_OVER) != 0) @@ -1095,7 +1095,7 @@ static void prepare_for_step_overout(debug_cpu_info *info) /* if we need to skip additional instructions, advance as requested */ while (extraskip-- > 0) - pc += dasm_wrapped(dasmbuffer, pc) & DASMFLAG_LENGTHMASK; + pc += dasm_wrapped(machine, dasmbuffer, pc) & DASMFLAG_LENGTHMASK; info->stepaddr = pc; } @@ -1454,14 +1454,14 @@ static void watchpoint_check(running_machine *machine, int cpunum, int spacenum, if (type & WATCHPOINT_WRITE) { - sprintf(buffer, "Stopped at watchpoint %X writing %s to %08X (PC=%X)", wp->index, sizes[size], BYTE2ADDR(address, &global.cpuinfo[cpunum], spacenum), activecpu_get_pc()); + sprintf(buffer, "Stopped at watchpoint %X writing %s to %08X (PC=%X)", wp->index, sizes[size], BYTE2ADDR(address, &global.cpuinfo[cpunum], spacenum), cpu_get_pc(machine->activecpu)); if (value_to_write >> 32) sprintf(&buffer[strlen(buffer)], " (data=%X%08X)", (UINT32)(value_to_write >> 32), (UINT32)value_to_write); else sprintf(&buffer[strlen(buffer)], " (data=%X)", (UINT32)value_to_write); } else - sprintf(buffer, "Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->index, sizes[size], BYTE2ADDR(address, &global.cpuinfo[cpunum], spacenum), activecpu_get_pc()); + sprintf(buffer, "Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->index, sizes[size], BYTE2ADDR(address, &global.cpuinfo[cpunum], spacenum), cpu_get_pc(machine->activecpu)); debug_console_printf("%s\n", buffer); compute_debug_flags(machine, info); } @@ -1615,10 +1615,10 @@ int debug_cpu_hotspot_track(running_machine *machine, int cpunum, int numspots, hotspots on a memory read access -------------------------------------------------*/ -static void check_hotspots(int cpunum, int spacenum, offs_t address) +static void check_hotspots(running_machine *machine, int cpunum, int spacenum, offs_t address) { debug_cpu_info *info = &global.cpuinfo[cpunum]; - offs_t pc = activecpu_get_pc(); + offs_t pc = cpu_get_pc(machine->activecpu); int hotindex; /* see if we have a match in our list */ @@ -1667,7 +1667,7 @@ static void check_hotspots(int cpunum, int spacenum, offs_t address) UINT8 debug_read_byte(int spacenum, offs_t address, int apply_translation) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; UINT64 custom; UINT8 result; @@ -1702,7 +1702,7 @@ UINT8 debug_read_byte(int spacenum, offs_t address, int apply_translation) UINT16 debug_read_word(int spacenum, offs_t address, int apply_translation) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; UINT64 custom; UINT16 result; @@ -1716,7 +1716,7 @@ UINT16 debug_read_word(int spacenum, offs_t address, int apply_translation) UINT8 byte1 = debug_read_byte(spacenum, address + 1, apply_translation); /* based on the endianness, the result is assembled differently */ - if (global.cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) + if (global.cpuinfo[cpunum_get_active()].endianness == CPU_IS_LE) result = byte0 | (byte1 << 8); else result = byte1 | (byte0 << 8); @@ -1755,7 +1755,7 @@ UINT16 debug_read_word(int spacenum, offs_t address, int apply_translation) UINT32 debug_read_dword(int spacenum, offs_t address, int apply_translation) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; UINT64 custom; UINT32 result; @@ -1769,7 +1769,7 @@ UINT32 debug_read_dword(int spacenum, offs_t address, int apply_translation) UINT16 word1 = debug_read_word(spacenum, address + 2, apply_translation); /* based on the endianness, the result is assembled differently */ - if (global.cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) + if (global.cpuinfo[cpunum_get_active()].endianness == CPU_IS_LE) result = word0 | (word1 << 16); else result = word1 | (word0 << 16); @@ -1808,7 +1808,7 @@ UINT32 debug_read_dword(int spacenum, offs_t address, int apply_translation) UINT64 debug_read_qword(int spacenum, offs_t address, int apply_translation) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; UINT64 custom; UINT64 result; @@ -1822,7 +1822,7 @@ UINT64 debug_read_qword(int spacenum, offs_t address, int apply_translation) UINT32 dword1 = debug_read_dword(spacenum, address + 4, apply_translation); /* based on the endianness, the result is assembled differently */ - if (global.cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) + if (global.cpuinfo[cpunum_get_active()].endianness == CPU_IS_LE) result = dword0 | ((UINT64)dword1 << 32); else result = dword1 | ((UINT64)dword0 << 32); @@ -1861,7 +1861,7 @@ UINT64 debug_read_qword(int spacenum, offs_t address, int apply_translation) void debug_write_byte(int spacenum, offs_t address, UINT8 data, int apply_translation) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; /* mask against the logical byte mask */ address &= info->space[spacenum].logbytemask; @@ -1894,7 +1894,7 @@ void debug_write_byte(int spacenum, offs_t address, UINT8 data, int apply_transl void debug_write_word(int spacenum, offs_t address, UINT16 data, int apply_translation) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; /* mask against the logical byte mask */ address &= info->space[spacenum].logbytemask; @@ -1902,7 +1902,7 @@ void debug_write_word(int spacenum, offs_t address, UINT16 data, int apply_trans /* if this is a misaligned write, or if there are no word writers, just read two bytes */ if ((address & 1) || !active_address_space[spacenum].accessors->write_word) { - if (global.cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) + if (global.cpuinfo[cpunum_get_active()].endianness == CPU_IS_LE) { debug_write_byte(spacenum, address + 0, data >> 0, apply_translation); debug_write_byte(spacenum, address + 1, data >> 8, apply_translation); @@ -1946,7 +1946,7 @@ void debug_write_word(int spacenum, offs_t address, UINT16 data, int apply_trans void debug_write_dword(int spacenum, offs_t address, UINT32 data, int apply_translation) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; /* mask against the logical byte mask */ address &= info->space[spacenum].logbytemask; @@ -1954,7 +1954,7 @@ void debug_write_dword(int spacenum, offs_t address, UINT32 data, int apply_tran /* if this is a misaligned write, or if there are no dword writers, just read two words */ if ((address & 3) || !active_address_space[spacenum].accessors->write_dword) { - if (global.cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) + if (global.cpuinfo[cpunum_get_active()].endianness == CPU_IS_LE) { debug_write_word(spacenum, address + 0, data >> 0, apply_translation); debug_write_word(spacenum, address + 2, data >> 16, apply_translation); @@ -1998,7 +1998,7 @@ void debug_write_dword(int spacenum, offs_t address, UINT32 data, int apply_tran void debug_write_qword(int spacenum, offs_t address, UINT64 data, int apply_translation) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; /* mask against the logical byte mask */ address &= info->space[spacenum].logbytemask; @@ -2006,7 +2006,7 @@ void debug_write_qword(int spacenum, offs_t address, UINT64 data, int apply_tran /* if this is a misaligned write, or if there are no qword writers, just read two dwords */ if ((address & 7) || !active_address_space[spacenum].accessors->write_qword) { - if (global.cpuinfo[cpu_getactivecpu()].endianness == CPU_IS_LE) + if (global.cpuinfo[cpunum_get_active()].endianness == CPU_IS_LE) { debug_write_dword(spacenum, address + 0, data >> 0, apply_translation); debug_write_dword(spacenum, address + 4, data >> 32, apply_translation); @@ -2049,7 +2049,7 @@ void debug_write_qword(int spacenum, offs_t address, UINT64 data, int apply_tran UINT64 debug_read_opcode(offs_t address, int size, int arg) { - const debug_cpu_info *info = &global.cpuinfo[cpu_getactivecpu()]; + const debug_cpu_info *info = &global.cpuinfo[cpunum_get_active()]; offs_t lowbits_mask; const void *ptr; @@ -2143,14 +2143,14 @@ UINT64 debug_read_opcode(offs_t address, int size, int arg) /* get pointer to data */ /* note that we query aligned to the bus width, and then add back the low bits */ lowbits_mask = info->space[ADDRESS_SPACE_PROGRAM].databytes - 1; - ptr = memory_get_op_ptr(Machine, cpu_getactivecpu(), address & ~lowbits_mask, arg); + ptr = memory_get_op_ptr(Machine, cpunum_get_active(), address & ~lowbits_mask, arg); if (!ptr) return ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)); ptr = (UINT8 *)ptr + (address & lowbits_mask); /* gross! */ // if (osd_is_bad_read_ptr(ptr, size)) -// fatalerror("debug_read_opcode: cpu %d address %x mapped to invalid memory %p", cpu_getactivecpu(), address, ptr); +// fatalerror("debug_read_opcode: cpu %d address %x mapped to invalid memory %p", cpunum_get_active(), address, ptr); /* return based on the size */ switch (size) @@ -2197,18 +2197,18 @@ static UINT64 expression_read_memory(const char *name, int space, UINT32 address case EXPSPACE_PROGRAM: case EXPSPACE_DATA: case EXPSPACE_IO: - cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu(); + cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpunum_get_active(); if (cpuindex < 0) break; return expression_read_address_space(cpuindex, ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM), address, size); case EXPSPACE_OPCODE: case EXPSPACE_RAMWRITE: - cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu(); + cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpunum_get_active(); if (cpuindex < 0) break; if (name == NULL) - name = Machine->config->cpu[cpu_getactivecpu()].tag; + name = Machine->config->cpu[cpunum_get_active()].tag; return expression_read_program_direct(cpuindex, (space == EXPSPACE_OPCODE), address, size); case EXPSPACE_EEPROM: @@ -2240,7 +2240,7 @@ static UINT64 expression_read_address_space(int cpuindex, int space, offs_t addr address = ADDR2BYTE(address, info, space); /* switch contexts and do the read */ - cpuintrf_push_context(cpuindex); + cpu_push_context(Machine->cpu[cpuindex]); switch (size) { case 1: result = debug_read_byte(space, address, TRUE); break; @@ -2248,7 +2248,7 @@ static UINT64 expression_read_address_space(int cpuindex, int space, offs_t addr case 4: result = debug_read_dword(space, address, TRUE); break; case 8: result = debug_read_qword(space, address, TRUE); break; } - cpuintrf_pop_context(); + cpu_pop_context(); } return result; } @@ -2406,7 +2406,7 @@ static void expression_write_memory(const char *name, int space, UINT32 address, case EXPSPACE_PROGRAM: case EXPSPACE_DATA: case EXPSPACE_IO: - cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu(); + cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpunum_get_active(); if (cpuindex < 0) break; expression_write_address_space(cpuindex, ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM), address, size, data); @@ -2414,7 +2414,7 @@ static void expression_write_memory(const char *name, int space, UINT32 address, case EXPSPACE_OPCODE: case EXPSPACE_RAMWRITE: - cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu(); + cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpunum_get_active(); if (cpuindex < 0) break; expression_write_program_direct(cpuindex, (space == EXPSPACE_OPCODE), address, size, data); @@ -2449,7 +2449,7 @@ static void expression_write_address_space(int cpuindex, int space, offs_t addre address = ADDR2BYTE(address, info, space); /* switch contexts and do the write */ - cpuintrf_push_context(cpuindex); + cpu_push_context(Machine->cpu[cpuindex]); switch (size) { case 1: debug_write_byte(space, address, data, TRUE); break; @@ -2457,7 +2457,7 @@ static void expression_write_address_space(int cpuindex, int space, offs_t addre case 4: debug_write_dword(space, address, data, TRUE); break; case 8: debug_write_qword(space, address, data, TRUE); break; } - cpuintrf_pop_context(); + cpu_pop_context(); } } @@ -2639,16 +2639,16 @@ static EXPRERR expression_validate(const char *name, int space) case EXPSPACE_PROGRAM: case EXPSPACE_DATA: case EXPSPACE_IO: - cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu(); + cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpunum_get_active(); if (cpuindex < 0) return (name == NULL) ? EXPRERR_MISSING_MEMORY_NAME : EXPRERR_INVALID_MEMORY_NAME; - if (cpunum_addrbus_width(cpuindex, ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM)) == 0) + if (cpu_get_addrbus_width(Machine->cpu[cpuindex], ADDRESS_SPACE_PROGRAM + (space - EXPSPACE_PROGRAM)) == 0) return EXPRERR_NO_SUCH_MEMORY_SPACE; break; case EXPSPACE_OPCODE: case EXPSPACE_RAMWRITE: - cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpu_getactivecpu(); + cpuindex = (name != NULL) ? expression_cpu_index(Machine, name) : cpunum_get_active(); if (cpuindex < 0) return (name == NULL) ? EXPRERR_MISSING_MEMORY_NAME : EXPRERR_INVALID_MEMORY_NAME; break; @@ -2778,7 +2778,7 @@ static UINT64 get_cycles(void *ref) static UINT64 get_cpunum(void *ref) { - return cpu_getactivecpu(); + return cpunum_get_active(); } @@ -2881,7 +2881,8 @@ static void set_logunmap(void *ref, UINT64 value) static UINT64 get_current_pc(void *ref) { - return activecpu_get_pc(); + running_machine *machine = ref; + return cpu_get_pc(machine->activecpu); } @@ -2892,7 +2893,7 @@ static UINT64 get_current_pc(void *ref) static UINT64 get_cpu_reg(void *ref) { - return activecpu_get_reg((FPTR)ref); + return cpu_get_reg(Machine->activecpu, (FPTR)ref); } @@ -2903,5 +2904,5 @@ static UINT64 get_cpu_reg(void *ref) static void set_cpu_reg(void *ref, UINT64 value) { - activecpu_set_reg((FPTR)ref, value); + cpu_set_reg(Machine->activecpu, (FPTR)ref, value); } diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c index 98939adeaa9..779bea8640b 100644 --- a/src/emu/debug/debugvw.c +++ b/src/emu/debug/debugvw.c @@ -951,7 +951,7 @@ static void add_register(debug_view *view, int regnum, const char *str) /* note the register number and info */ regdata->reg[view->total_rows].lastval = - regdata->reg[view->total_rows].currval = cpunum_get_reg(regdata->cpunum, regnum); + regdata->reg[view->total_rows].currval = cpu_get_reg(Machine->cpu[regdata->cpunum], regnum); regdata->reg[view->total_rows].regnum = regnum; regdata->reg[view->total_rows].tagstart = tagstart; regdata->reg[view->total_rows].taglen = taglen; @@ -973,7 +973,7 @@ static void add_register(debug_view *view, int regnum, const char *str) static void registers_recompute(debug_view *view) { debug_view_registers *regdata = view->extra_data; - const int *list = cpunum_debug_register_list(regdata->cpunum); + const int *list = cpu_get_debug_register_list(Machine->cpu[regdata->cpunum]); int regnum, maxtaglen, maxvallen; /* reset the view parameters */ @@ -1026,7 +1026,7 @@ static void registers_recompute(debug_view *view) regdata->reg[view->total_rows].tagstart = 0; regdata->reg[view->total_rows].taglen = 5; regdata->reg[view->total_rows].valstart = 6; - regdata->reg[view->total_rows].vallen = (UINT32)strlen(cpunum_flags(regdata->cpunum)); + regdata->reg[view->total_rows].vallen = (UINT32)strlen(cpu_get_flags_string(Machine->cpu[regdata->cpunum])); maxtaglen = MAX(maxtaglen, regdata->reg[view->total_rows].taglen); maxvallen = MAX(maxvallen, regdata->reg[view->total_rows].vallen); view->total_rows++; @@ -1053,7 +1053,7 @@ static void registers_recompute(debug_view *view) break; /* retrieve the string for this register */ - str = cpunum_reg_string(regdata->cpunum, regid); + str = cpu_get_reg_string(Machine->cpu[regdata->cpunum], regid); /* did we get a string? */ if (str && str[0] != '\0' && str[0] != '~') @@ -1079,7 +1079,7 @@ static void registers_update(debug_view *view) const device_config *screen = Machine->primary_screen; /* cannot update if no active CPU */ - if (cpu_getactivecpu() < 0) + if (cpunum_get_active() < 0) return; total_cycles = activecpu_gettotalcycles(); @@ -1134,16 +1134,16 @@ static void registers_update(debug_view *view) break; case MAX_REGS + 4: - sprintf(dummy, "flags:%s", activecpu_flags()); + sprintf(dummy, "flags:%s", cpu_get_flags_string(Machine->activecpu)); break; } } else { - data = (char *)cpunum_reg_string(regdata->cpunum, reg->regnum); + data = (char *)cpu_get_reg_string(Machine->cpu[regdata->cpunum], reg->regnum); if (regdata->last_update != total_cycles) reg->lastval = reg->currval; - reg->currval = cpunum_get_reg(regdata->cpunum, reg->regnum); + reg->currval = cpu_get_reg(Machine->cpu[regdata->cpunum], reg->regnum); } /* see if we changed */ @@ -1324,8 +1324,8 @@ static void disasm_free(debug_view *view) static offs_t disasm_back_up(int cpunum, const debug_cpu_info *cpuinfo, offs_t startpc, int numinstrs) { - int minlen = BYTE2ADDR(activecpu_min_instruction_bytes(), cpuinfo, ADDRESS_SPACE_PROGRAM); - int maxlen = BYTE2ADDR(activecpu_max_instruction_bytes(), cpuinfo, ADDRESS_SPACE_PROGRAM); + int minlen = BYTE2ADDR(cpu_get_min_opcode_bytes(Machine->activecpu), cpuinfo, ADDRESS_SPACE_PROGRAM); + int maxlen = BYTE2ADDR(cpu_get_max_opcode_bytes(Machine->activecpu), cpuinfo, ADDRESS_SPACE_PROGRAM); UINT32 addrmask = cpuinfo->space[ADDRESS_SPACE_PROGRAM].logaddrmask; offs_t curpc, lastgoodpc = startpc, temppc; UINT8 opbuf[1024], argbuf[1024]; @@ -1361,7 +1361,7 @@ static offs_t disasm_back_up(int cpunum, const debug_cpu_info *cpuinfo, offs_t s /* get the disassembly, but only if mapped */ instlen = 1; if (cpuinfo->translate == NULL || (*cpuinfo->translate)(ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH_DEBUG, &pcbyte)) - instlen = activecpu_dasm(dasmbuffer, testpc & addrmask, &opbuf[1000 + testpc - startpc], &argbuf[1000 + testpc - startpc]) & DASMFLAG_LENGTHMASK; + instlen = cpu_dasm(Machine->activecpu, dasmbuffer, testpc & addrmask, &opbuf[1000 + testpc - startpc], &argbuf[1000 + testpc - startpc]) & DASMFLAG_LENGTHMASK; /* count this one */ instcount++; @@ -1480,13 +1480,13 @@ static int disasm_recompute(debug_view *view, offs_t pc, int startline, int line dasmdata->divider2 = dasmdata->divider1 + 1 + dasmdata->dasm_width + 1; /* determine how many bytes we might need to display */ - minbytes = activecpu_min_instruction_bytes(); - maxbytes = activecpu_max_instruction_bytes(); + minbytes = cpu_get_min_opcode_bytes(Machine->activecpu); + maxbytes = cpu_get_max_opcode_bytes(Machine->activecpu); /* set the width of the third column according to display mode */ if (dasmdata->right_column == DVP_DASM_RIGHTCOL_RAW || dasmdata->right_column == DVP_DASM_RIGHTCOL_ENCRYPTED) { - chunksize = activecpu_databus_width(ADDRESS_SPACE_PROGRAM) / 8; + chunksize = cpu_get_databus_width(Machine->activecpu, ADDRESS_SPACE_PROGRAM) / 8; maxbytes_clamped = maxbytes; if (maxbytes_clamped > DASM_MAX_BYTES) maxbytes_clamped = DASM_MAX_BYTES; @@ -1550,7 +1550,7 @@ static int disasm_recompute(debug_view *view, offs_t pc, int startline, int line } /* disassemble the result */ - pc += numbytes = activecpu_dasm(buffer, pc & addrmask, opbuf, argbuf) & DASMFLAG_LENGTHMASK; + pc += numbytes = cpu_dasm(Machine->activecpu, buffer, pc & addrmask, opbuf, argbuf) & DASMFLAG_LENGTHMASK; } else sprintf(buffer, "<unmapped>"); @@ -1568,7 +1568,7 @@ static int disasm_recompute(debug_view *view, offs_t pc, int startline, int line offs_t comment_address = BYTE2ADDR(dasmdata->address[instr], cpuinfo, ADDRESS_SPACE_PROGRAM) ; /* get and add the comment */ - if (debug_comment_get_text(cpu_getactivecpu(), comment_address, debug_comment_get_opcode_crc32(comment_address)) != 0x00) + if (debug_comment_get_text(cpunum_get_active(), comment_address, debug_comment_get_opcode_crc32(comment_address)) != 0x00) { int i ; char bob[DEBUG_COMMENT_MAX_LINE_LENGTH] ; @@ -1580,7 +1580,7 @@ static int disasm_recompute(debug_view *view, offs_t pc, int startline, int line destbuf[dasmdata->divider2+i] = pre[i] ; // Stick in the comment itself - strcpy(bob, debug_comment_get_text(cpu_getactivecpu(), comment_address, debug_comment_get_opcode_crc32(comment_address))) ; + strcpy(bob, debug_comment_get_text(cpunum_get_active(), comment_address, debug_comment_get_opcode_crc32(comment_address))) ; for (i = 0; i < (dasmdata->allocated_cols - dasmdata->divider2 - strlen(pre) - 1); i++) destbuf[dasmdata->divider2+i+strlen(pre)] = bob[i] ; } @@ -1595,7 +1595,7 @@ static int disasm_recompute(debug_view *view, offs_t pc, int startline, int line /* reset the opcode base */ if (dasmdata->cpunum == original_cpunum) - memory_set_opbase(activecpu_get_physical_pc_byte()); + memory_set_opbase(cpu_get_physical_pc_byte(Machine->activecpu)); /* update opcode base information */ dasmdata->last_opbase_rom = opbase.rom; @@ -1618,16 +1618,16 @@ static void disasm_update(debug_view *view) extern opbase_data opbase; debug_view_disasm *dasmdata = view->extra_data; const debug_cpu_info *cpuinfo = debug_get_cpu_info(dasmdata->cpunum); - offs_t pc = cpunum_get_reg(dasmdata->cpunum, REG_PC); + offs_t pc = cpu_get_reg(Machine->cpu[dasmdata->cpunum], REG_PC); offs_t pcbyte = ADDR2BYTE_MASKED(pc, cpuinfo, ADDRESS_SPACE_PROGRAM); debug_view_char *dest = view->viewdata; - int original_cpunum = cpu_getactivecpu(); + int original_cpunum = cpunum_get_active(); int recomputed_this_time = FALSE; EXPRERR exprerr; UINT32 row; /* switch to the CPU's context */ - cpuintrf_push_context(dasmdata->cpunum); + cpu_push_context(Machine->cpu[dasmdata->cpunum]); /* if our expression is dirty, fix it */ if (dasmdata->expression_dirty && dasmdata->expression_string) @@ -1803,7 +1803,7 @@ recompute: } /* restore the original CPU context */ - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -1851,7 +1851,7 @@ static void disasm_handle_char(debug_view *view, char chval) case DCH_HOME: /* set the active column to the PC */ { const debug_cpu_info *cpuinfo = debug_get_cpu_info(dasmdata->cpunum); - offs_t pc = cpunum_get_reg(dasmdata->cpunum, REG_PC); + offs_t pc = cpu_get_reg(Machine->cpu[dasmdata->cpunum], REG_PC); int i; pc = ADDR2BYTE_MASKED(pc, cpuinfo, ADDRESS_SPACE_PROGRAM); @@ -2380,7 +2380,7 @@ static void memory_write_byte(debug_view_memory *memdata, offs_t offs, UINT8 dat /* hack for FD1094 editing */ #ifdef FD1094_HACK - if (memdata->raw_base == memory_region(machine, "user2")) + if (memdata->raw_base == memory_region(Machine, "user2")) { extern void fd1094_regenerate_key(void); fd1094_regenerate_key(); @@ -2558,7 +2558,7 @@ static void memory_handle_char(debug_view *view, char chval) } /* switch off of the current chunk size */ - cpuintrf_push_context(memdata->cpunum); + cpu_push_context(Machine->cpu[memdata->cpunum]); switch (memdata->bytes_per_chunk) { default: @@ -2622,7 +2622,7 @@ static void memory_handle_char(debug_view *view, char chval) } break; } - cpuintrf_pop_context(); + cpu_pop_context(); /* set a new position */ memory_set_cursor_pos(view, address, shift); @@ -2650,7 +2650,7 @@ static void memory_update(debug_view *view) /* switch to the CPU's context */ if (memdata->raw_base == NULL) - cpuintrf_push_context(memdata->cpunum); + cpu_push_context(Machine->cpu[memdata->cpunum]); /* determine maximum address and number of characters for that */ if (memdata->raw_base != NULL) @@ -2949,7 +2949,7 @@ static void memory_update(debug_view *view) /* restore the context */ if (memdata->raw_base == NULL) - cpuintrf_pop_context(); + cpu_pop_context(); } diff --git a/src/emu/debugger.h b/src/emu/debugger.h index 08312977dc0..53205067336 100644 --- a/src/emu/debugger.h +++ b/src/emu/debugger.h @@ -82,7 +82,7 @@ INLINE void debugger_stop_cpu_hook(running_machine *machine, int cpunum) INLINE void debugger_break(running_machine *machine) { if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0) - debug_cpu_halt_on_next_instruction(machine, cpu_getactivecpu(), "Internal breakpoint\n"); + debug_cpu_halt_on_next_instruction(machine, cpunum_get_active(), "Internal breakpoint\n"); } diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h index 82a0d52f4c9..3fd26c9ff4a 100644 --- a/src/emu/devintrf.h +++ b/src/emu/devintrf.h @@ -193,6 +193,7 @@ struct _device_config /* these fields are only valid if the device is live */ UINT8 started; /* TRUE if the start function has succeeded */ void * token; /* token if device is live */ + void * classtoken; /* class token if device is live */ running_machine * machine; /* machine if device is live */ UINT8 * region; /* pointer to region with the device's tag, or NULL */ UINT32 regionbytes; /* size of the region, in bytes */ diff --git a/src/emu/machine/53c810.c b/src/emu/machine/53c810.c index 49a4bf8f610..fe1c43fa1b2 100644 --- a/src/emu/machine/53c810.c +++ b/src/emu/machine/53c810.c @@ -446,7 +446,7 @@ static void dma_exec(void) READ8_HANDLER( lsi53c810_reg_r ) { - logerror("53c810: read reg %d:0x%x (PC=%x)\n", offset, offset, activecpu_get_pc()); + logerror("53c810: read reg %d:0x%x (PC=%x)\n", offset, offset, cpu_get_pc(machine->activecpu)); switch(offset) { case 0x00: /* SCNTL0 */ @@ -527,7 +527,7 @@ READ8_HANDLER( lsi53c810_reg_r ) WRITE8_HANDLER( lsi53c810_reg_w ) { - logerror("53c810: %02x to reg %d:0x%x (PC=%x)\n", data, offset, offset, activecpu_get_pc()); + logerror("53c810: %02x to reg %d:0x%x (PC=%x)\n", data, offset, offset, cpu_get_pc(machine->activecpu)); switch(offset) { case 0x00: /* SCNTL0 */ diff --git a/src/emu/machine/6522via.c b/src/emu/machine/6522via.c index b8ec3aba945..3ca4fb62be2 100644 --- a/src/emu/machine/6522via.c +++ b/src/emu/machine/6522via.c @@ -177,7 +177,7 @@ static void via_set_int (running_machine *machine, int which, int data) v->ifr |= data; #ifdef TRACE_VIA -logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_activecpu_get_pc()); +logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_cpu_get_pc(machine->activecpu)); #endif if (v->ier & v->ifr) @@ -186,7 +186,7 @@ logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_activec if (v->intf->irq_func) (*v->intf->irq_func)(machine, ASSERT_LINE); else - logerror("6522VIA chip %d: Interrupt is asserted but there is no callback function. PC: %08X\n", which, safe_activecpu_get_pc()); + logerror("6522VIA chip %d: Interrupt is asserted but there is no callback function. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } } @@ -197,7 +197,7 @@ static void via_clear_int (running_machine *machine, int which, int data) v->ifr = (v->ifr & ~data) & 0x7f; #ifdef TRACE_VIA -logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_activecpu_get_pc()); +logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_cpu_get_pc(machine->activecpu)); #endif if (v->ifr & v->ier) @@ -207,7 +207,7 @@ logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_activec if (v->intf->irq_func) (*v->intf->irq_func)(machine, CLEAR_LINE); // else -// logerror("6522VIA chip %d: Interrupt is cleared but there is no callback function. PC: %08X\n", which, safe_activecpu_get_pc()); +// logerror("6522VIA chip %d: Interrupt is cleared but there is no callback function. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } } @@ -338,7 +338,7 @@ static TIMER_CALLBACK( via_t1_timeout ) if (v->intf->out_b_func) v->intf->out_b_func(machine, 0, write_data); else - logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); + logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data); } if (!(v->ifr & INT_T1)) @@ -404,7 +404,7 @@ int via_read(running_machine *machine, int which, int offset) if (v->intf->in_b_func) v->in_b = v->intf->in_b_func(machine, 0); else - logerror("6522VIA chip %d: Port B is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); + logerror("6522VIA chip %d: Port B is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } CLR_PB_INT(v, which); @@ -423,7 +423,7 @@ int via_read(running_machine *machine, int which, int offset) if (v->intf->in_a_func) v->in_a = v->intf->in_a_func(machine, 0); else - logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); + logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } /* combine input and output values */ @@ -444,7 +444,7 @@ int via_read(running_machine *machine, int which, int offset) if (v->intf->out_ca2_func) v->intf->out_ca2_func(machine, 0, 0); else - logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 0); + logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 0); } } @@ -457,7 +457,7 @@ int via_read(running_machine *machine, int which, int offset) if (v->intf->in_a_func) v->in_a = v->intf->in_a_func(machine, 0); else - logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); + logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } /* combine input and output values */ @@ -567,7 +567,7 @@ void via_write(running_machine *machine, int which, int offset, int data) if (v->intf->out_b_func) v->intf->out_b_func(machine, 0, write_data); else - logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); + logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data); } CLR_PB_INT(v, which); @@ -585,7 +585,7 @@ void via_write(running_machine *machine, int which, int offset, int data) if (v->intf->out_cb2_func) v->intf->out_cb2_func(machine, 0, 0); else - logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 0); + logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 0); } } break; @@ -600,7 +600,7 @@ void via_write(running_machine *machine, int which, int offset, int data) if (v->intf->out_a_func) v->intf->out_a_func(machine, 0, write_data); else - logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); + logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data); } CLR_PA_INT(v, which); @@ -616,7 +616,7 @@ void via_write(running_machine *machine, int which, int offset, int data) v->intf->out_ca2_func(machine, 0, 1); } else - logerror("6522VIA chip %d: Port CA2 is being pulsed but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); + logerror("6522VIA chip %d: Port CA2 is being pulsed but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); /* set CA2 (shouldn't be needed) */ v->out_ca2 = 1; @@ -632,7 +632,7 @@ void via_write(running_machine *machine, int which, int offset, int data) if (v->intf->out_ca2_func) v->intf->out_ca2_func(machine, 0, 0); else - logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 0); + logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 0); } } @@ -648,7 +648,7 @@ void via_write(running_machine *machine, int which, int offset, int data) if (v->intf->out_a_func) v->intf->out_a_func(machine, 0, write_data); else - logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); + logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data); } break; @@ -666,7 +666,7 @@ void via_write(running_machine *machine, int which, int offset, int data) if (v->intf->out_b_func) v->intf->out_b_func(machine, 0, write_data); else - logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); + logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data); } } break; @@ -684,7 +684,7 @@ void via_write(running_machine *machine, int which, int offset, int data) if (v->intf->out_a_func) v->intf->out_a_func(machine, 0, write_data); else - logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); + logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data); } } break; @@ -716,7 +716,7 @@ void via_write(running_machine *machine, int which, int offset, int data) if (v->intf->out_b_func) v->intf->out_b_func(machine, 0, write_data); else - logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); + logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data); } } timer_adjust_oneshot(v->t1, v_cycles_to_time(v, TIMER1_VALUE(v) + IFR_DELAY), which); @@ -757,7 +757,7 @@ void via_write(running_machine *machine, int which, int offset, int data) case VIA_PCR: v->pcr = data; #ifdef TRACE_VIA -logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_activecpu_get_pc()); +logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_cpu_get_pc(machine->activecpu)); #endif if (CA2_FIX_OUTPUT(data) && CA2_OUTPUT_LEVEL(data) ^ v->out_ca2) @@ -766,7 +766,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_activecpu if (v->intf->out_ca2_func) v->intf->out_ca2_func(machine, 0, v->out_ca2); else - logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), v->out_ca2); + logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), v->out_ca2); } if (CB2_FIX_OUTPUT(data) && CB2_OUTPUT_LEVEL(data) ^ v->out_cb2) @@ -775,7 +775,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_activecpu if (v->intf->out_cb2_func) v->intf->out_cb2_func(machine, 0, v->out_cb2); else - logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), v->out_cb2); + logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), v->out_cb2); } break; @@ -797,7 +797,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_activecpu if (v->intf->out_b_func) v->intf->out_b_func(machine, 0, write_data); else - logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), write_data); + logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data); } } if (T1_CONTINUOUS(data)) @@ -822,7 +822,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_activecpu if (v->intf->irq_func) (*v->intf->irq_func)(machine, CLEAR_LINE); // else -// logerror("6522VIA chip %d: Interrupt is cleared but there is no callback function. PC: %08X\n", which, safe_activecpu_get_pc()); +// logerror("6522VIA chip %d: Interrupt is cleared but there is no callback function. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } } else @@ -833,7 +833,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_activecpu if (v->intf->irq_func) (*v->intf->irq_func)(machine, ASSERT_LINE); else - logerror("6522VIA chip %d: Interrupt is asserted but there is no callback function. PC: %08X\n", which, safe_activecpu_get_pc()); + logerror("6522VIA chip %d: Interrupt is asserted but there is no callback function. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } } break; @@ -869,7 +869,7 @@ void via_set_input_ca1(running_machine *machine, int which, int data) if (data != v->in_ca1) { #ifdef TRACE_VIA -logerror("6522VIA chip %d: CA1 = %02X. PC: %08X\n", which, data, safe_activecpu_get_pc()); +logerror("6522VIA chip %d: CA1 = %02X. PC: %08X\n", which, data, safe_cpu_get_pc(machine->activecpu)); #endif if ((CA1_LOW_TO_HIGH(v->pcr) && data) || (CA1_HIGH_TO_LOW(v->pcr) && !data)) { @@ -878,7 +878,7 @@ logerror("6522VIA chip %d: CA1 = %02X. PC: %08X\n", which, data, safe_activecpu if (v->intf->in_a_func) v->in_a = v->intf->in_a_func(machine, 0); else - logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); + logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } via_set_int (machine, which, INT_CA1); @@ -896,7 +896,7 @@ logerror("6522VIA chip %d: CA1 = %02X. PC: %08X\n", which, data, safe_activecpu if (v->intf->out_ca2_func) v->intf->out_ca2_func(machine, 0, 1); else - logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 1); + logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 1); } } } @@ -965,7 +965,7 @@ void via_set_input_cb1(running_machine *machine, int which, int data) if (v->intf->in_b_func) v->in_b = v->intf->in_b_func(machine, 0); else - logerror("6522VIA chip %d: Port B is being read but has no handler. PC: %08X\n", which, safe_activecpu_get_pc()); + logerror("6522VIA chip %d: Port B is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu)); } if (SO_EXT_CONTROL(v->acr) || SI_EXT_CONTROL(v->acr)) via_shift (machine, which); @@ -985,7 +985,7 @@ void via_set_input_cb1(running_machine *machine, int which, int data) if (v->intf->out_cb2_func) v->intf->out_cb2_func(machine, 0, 1); else - logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_activecpu_get_pc(), 1); + logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 1); } } } diff --git a/src/emu/machine/6532riot.c b/src/emu/machine/6532riot.c index 35b44652598..28c0fee7111 100644 --- a/src/emu/machine/6532riot.c +++ b/src/emu/machine/6532riot.c @@ -100,7 +100,7 @@ INLINE void update_irqstate(const device_config *device) if (riot->intf->irq_func != NULL) (*riot->intf->irq_func)(device, (state != 0) ? ASSERT_LINE : CLEAR_LINE); else - logerror("6532RIOT chip #%d: no irq callback function. PC: %08X\n", riot->index, safe_activecpu_get_pc()); + logerror("6532RIOT chip #%d: no irq callback function. PC: %08X\n", riot->index, safe_cpu_get_pc(device->machine->activecpu)); } @@ -263,7 +263,7 @@ WRITE8_DEVICE_HANDLER( riot6532_w ) if (port->out_func != NULL) (*port->out_func)(device, data, olddata); else - logerror("6532RIOT chip %s: Port %c is being written to but has no handler. PC: %08X - %02X\n", device->tag, 'A' + (offset & 1), safe_activecpu_get_pc(), data); + logerror("6532RIOT chip %s: Port %c is being written to but has no handler. PC: %08X - %02X\n", device->tag, 'A' + (offset & 1), safe_cpu_get_pc(device->machine->activecpu), data); } /* writes to port A need to update the PA7 state */ @@ -332,7 +332,7 @@ READ8_DEVICE_HANDLER( riot6532_r ) update_pa7_state(device); } else - logerror("6532RIOT chip %s: Port %c is being read but has no handler. PC: %08X\n", device->tag, 'A' + (offset & 1), safe_activecpu_get_pc()); + logerror("6532RIOT chip %s: Port %c is being read but has no handler. PC: %08X\n", device->tag, 'A' + (offset & 1), safe_cpu_get_pc(device->machine->activecpu)); /* apply the DDR to the result */ val = apply_ddr(port); diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c index f4e764b65ec..f195f0a7f6d 100644 --- a/src/emu/machine/6821pia.c +++ b/src/emu/machine/6821pia.c @@ -261,7 +261,7 @@ static UINT8 get_in_a_value(running_machine *machine, int which) if (!p->logged_port_a_not_connected && (p->ddr_a != 0xff)) { - logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port A read handler. Assuming pins 0x%02X not connected\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, p->ddr_a ^ 0xff); + logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port A read handler. Assuming pins 0x%02X not connected\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, p->ddr_a ^ 0xff); p->logged_port_a_not_connected = TRUE; } } @@ -301,7 +301,7 @@ static UINT8 get_in_b_value(running_machine *machine, int which) { if (!p->logged_port_b_not_connected && (p->ddr_b != 0xff)) { - logerror("cpu #%d (PC=%08X): PIA #%d: Error! No port B read handler. Three-state pins 0x%02X are undefined\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, p->ddr_b ^ 0xff); + logerror("cpu #%d (PC=%08X): PIA #%d: Error! No port B read handler. Three-state pins 0x%02X are undefined\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, p->ddr_b ^ 0xff); p->logged_port_b_not_connected = TRUE; } @@ -372,7 +372,7 @@ static void set_out_ca2(running_machine *machine, int which, int data) else { if (p->out_ca2_needs_pulled) - logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port CA2 write handler. Previous value has been lost!\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); + logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port CA2 write handler. Previous value has been lost!\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which); p->out_ca2_needs_pulled = TRUE; } @@ -397,7 +397,7 @@ static void set_out_cb2(running_machine *machine, int which, int data) else { if (p->out_cb2_needs_pulled) - logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port CB2 write handler. Previous value has been lost!\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); + logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port CB2 write handler. Previous value has been lost!\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which); p->out_cb2_needs_pulled = TRUE; } @@ -434,19 +434,19 @@ static UINT8 port_a_r(running_machine *machine, int which) set_out_ca2(machine, which, TRUE); } - LOG(("cpu #%d (PC=%08X): PIA #%d: port A read = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, ret)); + LOG(("cpu #%d (PC=%08X): PIA #%d: port A read = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, ret)); return ret; } -static UINT8 ddr_a_r(int which) +static UINT8 ddr_a_r(running_machine *machine, int which) { pia6821 *p = &pias[which]; UINT8 ret = p->ddr_a; - LOG(("cpu #%d (PC=%08X): PIA #%d: DDR A read = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, ret)); + LOG(("cpu #%d (PC=%08X): PIA #%d: DDR A read = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, ret)); return ret; } @@ -470,19 +470,19 @@ static UINT8 port_b_r(running_machine *machine, int which) p->irq_b2 = FALSE; update_interrupts(machine, p); - LOG(("cpu #%d (PC=%08X): PIA #%d: port B read = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, ret)); + LOG(("cpu #%d (PC=%08X): PIA #%d: port B read = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, ret)); return ret; } -static UINT8 ddr_b_r(int which) +static UINT8 ddr_b_r(running_machine *machine, int which) { pia6821 *p = &pias[which]; UINT8 ret = p->ddr_b; - LOG(("cpu #%d (PC=%08X): PIA #%d: DDR B read = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, ret)); + LOG(("cpu #%d (PC=%08X): PIA #%d: DDR B read = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, ret)); return ret; } @@ -498,7 +498,7 @@ static UINT8 control_a_r(running_machine *machine, int which) pia_set_input_ca1(which, p->intf->in_ca1_func(machine, 0)); else if (!p->logged_ca1_not_connected && (!p->in_ca1_pushed)) { - logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No CA1 read handler. Assuming pin not connected\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); + logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No CA1 read handler. Assuming pin not connected\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which); p->logged_ca1_not_connected = TRUE; } @@ -506,7 +506,7 @@ static UINT8 control_a_r(running_machine *machine, int which) pia_set_input_ca2(which, p->intf->in_ca2_func(machine, 0)); else if ( !p->logged_ca2_not_connected && C2_INPUT(p->ctl_a) && !p->in_ca2_pushed) { - logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No CA2 read handler. Assuming pin not connected\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); + logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No CA2 read handler. Assuming pin not connected\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which); p->logged_ca2_not_connected = TRUE; } @@ -520,7 +520,7 @@ static UINT8 control_a_r(running_machine *machine, int which) if (p->irq_a2 && C2_INPUT(p->ctl_a)) ret |= PIA_IRQ2; - LOG(("cpu #%d (PC=%08X): PIA #%d: control A read = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, ret)); + LOG(("cpu #%d (PC=%08X): PIA #%d: control A read = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, ret)); return ret; } @@ -536,7 +536,7 @@ static UINT8 control_b_r(running_machine *machine, int which) pia_set_input_cb1(which, p->intf->in_cb1_func(machine, 0)); else if (!p->logged_cb1_not_connected && !p->in_cb1_pushed) { - logerror("cpu #%d (PC=%08X): PIA #%d: Error! no CB1 read handler. Three-state pin is undefined\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); + logerror("cpu #%d (PC=%08X): PIA #%d: Error! no CB1 read handler. Three-state pin is undefined\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which); p->logged_cb1_not_connected = TRUE; } @@ -544,7 +544,7 @@ static UINT8 control_b_r(running_machine *machine, int which) pia_set_input_cb2(which, p->intf->in_cb2_func(machine, 0)); else if (!p->logged_cb2_not_connected && C2_INPUT(p->ctl_b) && !p->in_cb2_pushed) { - logerror("cpu #%d (PC=%08X): PIA #%d: Error! No CB2 read handler. Three-state pin is undefined\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); + logerror("cpu #%d (PC=%08X): PIA #%d: Error! No CB2 read handler. Three-state pin is undefined\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which); p->logged_cb2_not_connected = TRUE; } @@ -558,7 +558,7 @@ static UINT8 control_b_r(running_machine *machine, int which) if (p->irq_b2 && C2_INPUT(p->ctl_b)) ret |= PIA_IRQ2; - LOG(("cpu #%d (PC=%08X): PIA #%d: control B read = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, ret)); + LOG(("cpu #%d (PC=%08X): PIA #%d: control B read = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, ret)); return ret; } @@ -576,7 +576,7 @@ UINT8 pia_read(int which, offs_t offset) if (OUTPUT_SELECTED(p->ctl_a)) ret = port_a_r(Machine, which); else - ret = ddr_a_r(which); + ret = ddr_a_r(Machine, which); break; case 0x01: @@ -587,7 +587,7 @@ UINT8 pia_read(int which, offs_t offset) if (OUTPUT_SELECTED(p->ctl_b)) ret = port_b_r(Machine, which); else - ret = ddr_b_r(which); + ret = ddr_b_r(Machine, which); break; case 0x03: @@ -627,14 +627,14 @@ static void send_to_out_a_func(running_machine *machine, int which, const char* /* input pins are pulled high */ UINT8 data = get_out_a_value(machine, which); - LOG(("cpu #%d (PC=%08X): PIA #%d: %s = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, message, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: %s = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, message, data)); if (p->intf->out_a_func) p->intf->out_a_func(machine, 0, data); else { if (p->out_a_needs_pulled) - logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port A write handler. Previous value has been lost!\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); + logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port A write handler. Previous value has been lost!\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which); p->out_a_needs_pulled = TRUE; } @@ -648,14 +648,14 @@ static void send_to_out_b_func(running_machine *machine, int which, const char* /* input pins are high-impedance - we just send them as zeros for backwards compatibility */ UINT8 data = get_out_b_value(which); - LOG(("cpu #%d (PC=%08X): PIA #%d: %s = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, message, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: %s = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, message, data)); if (p->intf->out_b_func) p->intf->out_b_func(machine, 0, data); else { if (p->out_b_needs_pulled) - logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port B write handler. Previous value has been lost!\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which); + logerror("cpu #%d (PC=%08X): PIA #%d: Warning! No port B write handler. Previous value has been lost!\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which); p->out_b_needs_pulled = TRUE; } @@ -678,11 +678,11 @@ static void ddr_a_w(running_machine *machine, int which, UINT8 data) pia6821 *p = &pias[which]; if (data == 0x00) - LOG(("cpu #%d (PC=%08X): PIA #%d: DDR A write = %02X (input mode)\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: DDR A write = %02X (input mode)\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, data)); else if (data == 0xff) - LOG(("cpu #%d (PC=%08X): PIA #%d: DDR A write = %02X (output mode)\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: DDR A write = %02X (output mode)\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, data)); else - LOG(("cpu #%d (PC=%08X): PIA #%d: DDR A write = %02X (mixed mode)\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: DDR A write = %02X (mixed mode)\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, data)); if (p->ddr_a != data) { @@ -721,11 +721,11 @@ static void ddr_b_w(running_machine *machine, int which, UINT8 data) pia6821 *p = &pias[which]; if (data == 0x00) - LOG(("cpu #%d (PC=%08X): PIA #%d: DDR B write = %02X (input mode)\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: DDR B write = %02X (input mode)\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, data)); else if (data == 0xff) - LOG(("cpu #%d (PC=%08X): PIA #%d: DDR B write = %02X (output mode)\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: DDR B write = %02X (output mode)\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, data)); else - LOG(("cpu #%d (PC=%08X): PIA #%d: DDR B write = %02X (mixed mode)\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: DDR B write = %02X (mixed mode)\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, data)); if (p->ddr_b != data) { @@ -744,7 +744,7 @@ static void control_a_w(running_machine *machine, int which, UINT8 data) /* bit 7 and 6 are read only */ data &= 0x3f; - LOG(("cpu #%d (PC=%08X): PIA #%d: control A write = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: control A write = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, data)); /* update the control register */ p->ctl_a = data; @@ -777,7 +777,7 @@ static void control_b_w(running_machine *machine, int which, UINT8 data) /* bit 7 and 6 are read only */ data &= 0x3f; - LOG(("cpu #%d (PC=%08X): PIA #%d: control B write = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: control B write = %02X\n", cpunum_get_active(), safe_cpu_get_pc(machine->activecpu), which, data)); /* update the control register */ p->ctl_b = data; @@ -863,7 +863,7 @@ void pia_set_input_a(int which, UINT8 data, UINT8 z_mask) assert_always(p->intf->in_a_func == NULL, "pia_set_input_a() called when in_a_func implemented"); - LOG(("cpu #%d (PC=%08X): PIA #%d: set input port A = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: set input port A = %02X\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which, data)); p->in_a = data; p->port_a_z_mask = z_mask; @@ -903,13 +903,13 @@ void pia_set_input_ca1(int which, int data) /* limit the data to 0 or 1 */ data = data ? TRUE : FALSE; - LOG(("cpu #%d (PC=%08X): PIA #%d: set input CA1 = %d\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: set input CA1 = %d\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which, data)); /* the new state has caused a transition */ if ((p->in_ca1 != data) && ((data && C1_LOW_TO_HIGH(p->ctl_a)) || (!data && C1_HIGH_TO_LOW(p->ctl_a)))) { - LOG(("cpu #%d (PC=%08X): PIA #%d: CA1 triggering\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which)); + LOG(("cpu #%d (PC=%08X): PIA #%d: CA1 triggering\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which)); /* mark the IRQ */ p->irq_a1 = TRUE; @@ -950,14 +950,14 @@ void pia_set_input_ca2(int which, int data) /* limit the data to 0 or 1 */ data = data ? 1 : 0; - LOG(("cpu #%d (PC=%08X): PIA #%d: set input CA2 = %d\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: set input CA2 = %d\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which, data)); /* if input mode and the new state has caused a transition */ if (C2_INPUT(p->ctl_a) && (p->in_ca2 != data) && ((data && C2_LOW_TO_HIGH(p->ctl_a)) || (!data && C2_HIGH_TO_LOW(p->ctl_a)))) { - LOG(("cpu #%d (PC=%08X): PIA #%d: CA2 triggering\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which)); + LOG(("cpu #%d (PC=%08X): PIA #%d: CA2 triggering\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which)); /* mark the IRQ */ p->irq_a2 = TRUE; @@ -1016,7 +1016,7 @@ void pia_set_input_b(int which, UINT8 data) assert_always(p->intf->in_b_func == NULL, "pia_set_input_b() called when in_b_func implemented"); - LOG(("cpu #%d (PC=%08X): PIA #%d: set input port B = %02X\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: set input port B = %02X\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which, data)); p->in_b = data; p->in_b_pushed = TRUE; @@ -1056,13 +1056,13 @@ void pia_set_input_cb1(int which, int data) /* limit the data to 0 or 1 */ data = data ? 1 : 0; - LOG(("cpu #%d (PC=%08X): PIA #%d: set input CB1 = %d\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: set input CB1 = %d\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which, data)); /* the new state has caused a transition */ if ((p->in_cb1 != data) && ((data && C1_LOW_TO_HIGH(p->ctl_b)) || (!data && C1_HIGH_TO_LOW(p->ctl_b)))) { - LOG(("cpu #%d (PC=%08X): PIA #%d: CB1 triggering\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which)); + LOG(("cpu #%d (PC=%08X): PIA #%d: CB1 triggering\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which)); /* mark the IRQ */ p->irq_b1 = 1; @@ -1104,14 +1104,14 @@ void pia_set_input_cb2(int which, int data) /* limit the data to 0 or 1 */ data = data ? 1 : 0; - LOG(("cpu #%d (PC=%08X): PIA #%d: set input CB2 = %d\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which, data)); + LOG(("cpu #%d (PC=%08X): PIA #%d: set input CB2 = %d\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which, data)); /* if input mode and the new state has caused a transition */ if (C2_INPUT(p->ctl_b) && (p->in_cb2 != data) && ((data && C2_LOW_TO_HIGH(p->ctl_b)) || (!data && C2_HIGH_TO_LOW(p->ctl_b)))) { - LOG(("cpu #%d (PC=%08X): PIA #%d: CB2 triggering\n", cpu_getactivecpu(), safe_activecpu_get_pc(), which)); + LOG(("cpu #%d (PC=%08X): PIA #%d: CB2 triggering\n", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), which)); /* mark the IRQ */ p->irq_b2 = 1; diff --git a/src/emu/machine/6840ptm.c b/src/emu/machine/6840ptm.c index 0bf2ae2691f..e86fcec4693 100644 --- a/src/emu/machine/6840ptm.c +++ b/src/emu/machine/6840ptm.c @@ -471,7 +471,7 @@ int ptm6840_read(running_machine *machine, int which, int offset) case PTM_6840_STATUS: { - PLOG(("%06X: MC6840 #%d: Status read = %04X\n", activecpu_get_previouspc(), which, currptr->status_reg)); + PLOG(("%06X: MC6840 #%d: Status read = %04X\n", cpu_get_previouspc(machine->activecpu), which, currptr->status_reg)); currptr->status_read_since_int |= currptr->status_reg & 0x07; val = currptr->status_reg; break; @@ -493,7 +493,7 @@ int ptm6840_read(running_machine *machine, int which, int offset) currptr->lsb_buffer = result & 0xff; - PLOG(("%06X: MC6840 #%d: Counter %d read = %04X\n", activecpu_get_previouspc(), which, idx, result >> 8)); + PLOG(("%06X: MC6840 #%d: Counter %d read = %04X\n", cpu_get_previouspc(machine->activecpu), which, idx, result >> 8)); val = result >> 8; break; } @@ -609,7 +609,7 @@ void ptm6840_write (running_machine *machine, int which, int offset, int data) if (!(currptr->control_reg[idx] & 0x10)) reload_count(machine, which,idx); - PLOG(("%06X:MC6840 #%d: Counter %d latch = %04X\n", activecpu_get_previouspc(), which, idx, currptr->latch[idx])); + PLOG(("%06X:MC6840 #%d: Counter %d latch = %04X\n", cpu_get_previouspc(machine->activecpu), which, idx, currptr->latch[idx])); break; } } diff --git a/src/emu/machine/6850acia.c b/src/emu/machine/6850acia.c index 06985faf2bc..1192ce69ece 100644 --- a/src/emu/machine/6850acia.c +++ b/src/emu/machine/6850acia.c @@ -354,7 +354,7 @@ static void acia6850_check_interrupts(int which) /* Write transmit register */ -static void acia6850_data_w(int which, UINT8 data) +static void acia6850_data_w(running_machine *machine, int which, UINT8 data) { acia_6850 *acia_p = &acia[which]; @@ -366,7 +366,7 @@ static void acia6850_data_w(int which, UINT8 data) } else { - logerror("ACIA %d: Data write while in reset! (%x)\n", which, activecpu_get_previouspc()); + logerror("ACIA %d: Data write while in reset! (%x)\n", which, cpu_get_previouspc(machine->activecpu)); } } @@ -752,10 +752,10 @@ WRITE8_HANDLER( acia6850_1_ctrl_w ) { acia6850_ctrl_w(1, data); } WRITE8_HANDLER( acia6850_2_ctrl_w ) { acia6850_ctrl_w(2, data); } WRITE8_HANDLER( acia6850_3_ctrl_w ) { acia6850_ctrl_w(3, data); } -WRITE8_HANDLER( acia6850_0_data_w ) { acia6850_data_w(0, data); } -WRITE8_HANDLER( acia6850_1_data_w ) { acia6850_data_w(1, data); } -WRITE8_HANDLER( acia6850_2_data_w ) { acia6850_data_w(2, data); } -WRITE8_HANDLER( acia6850_3_data_w ) { acia6850_data_w(3, data); } +WRITE8_HANDLER( acia6850_0_data_w ) { acia6850_data_w(machine, 0, data); } +WRITE8_HANDLER( acia6850_1_data_w ) { acia6850_data_w(machine, 1, data); } +WRITE8_HANDLER( acia6850_2_data_w ) { acia6850_data_w(machine, 2, data); } +WRITE8_HANDLER( acia6850_3_data_w ) { acia6850_data_w(machine, 3, data); } READ8_HANDLER( acia6850_0_stat_r ) { return acia6850_stat_r(0); } READ8_HANDLER( acia6850_1_stat_r ) { return acia6850_stat_r(1); } @@ -797,12 +797,12 @@ WRITE16_HANDLER( acia6850_1_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl WRITE16_HANDLER( acia6850_2_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl_w(2, data & 0xff); } WRITE16_HANDLER( acia6850_3_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl_w(3, data & 0xff); } -WRITE16_HANDLER( acia6850_0_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(0, (data >> 8) & 0xff); } -WRITE16_HANDLER( acia6850_1_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(1, (data >> 8) & 0xff); } -WRITE16_HANDLER( acia6850_2_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(2, (data >> 8) & 0xff); } -WRITE16_HANDLER( acia6850_3_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(3, (data >> 8) & 0xff); } +WRITE16_HANDLER( acia6850_0_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(machine, 0, (data >> 8) & 0xff); } +WRITE16_HANDLER( acia6850_1_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(machine, 1, (data >> 8) & 0xff); } +WRITE16_HANDLER( acia6850_2_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(machine, 2, (data >> 8) & 0xff); } +WRITE16_HANDLER( acia6850_3_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(machine, 3, (data >> 8) & 0xff); } -WRITE16_HANDLER( acia6850_0_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(0, data & 0xff); } -WRITE16_HANDLER( acia6850_1_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(1, data & 0xff); } -WRITE16_HANDLER( acia6850_2_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(2, data & 0xff); } -WRITE16_HANDLER( acia6850_3_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(3, data & 0xff); } +WRITE16_HANDLER( acia6850_0_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(machine, 0, data & 0xff); } +WRITE16_HANDLER( acia6850_1_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(machine, 1, data & 0xff); } +WRITE16_HANDLER( acia6850_2_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(machine, 2, data & 0xff); } +WRITE16_HANDLER( acia6850_3_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(machine, 3, data & 0xff); } diff --git a/src/emu/machine/adc083x.c b/src/emu/machine/adc083x.c index fd564b5e7d4..16eca986fbf 100644 --- a/src/emu/machine/adc083x.c +++ b/src/emu/machine/adc083x.c @@ -7,6 +7,7 @@ #include <stdarg.h> #include "driver.h" +#include "deprecat.h" #include "machine/adc083x.h" #define VERBOSE_LEVEL ( 0 ) @@ -20,9 +21,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/emu/machine/am53cf96.c b/src/emu/machine/am53cf96.c index b1117cb9584..2a5bba17ec5 100644 --- a/src/emu/machine/am53cf96.c +++ b/src/emu/machine/am53cf96.c @@ -69,11 +69,11 @@ READ32_HANDLER( am53cf96_r ) if (reg == REG_FIFO) { -// mame_printf_debug("53cf96: read FIFO PC=%x\n", activecpu_get_pc()); +// mame_printf_debug("53cf96: read FIFO PC=%x\n", cpu_get_pc(machine->activecpu)); return 0; } -// logerror("53cf96: read reg %d = %x (PC=%x)\n", reg, rv>>shift, activecpu_get_pc()); +// logerror("53cf96: read reg %d = %x (PC=%x)\n", reg, rv>>shift, cpu_get_pc(machine->activecpu)); if (reg == REG_IRQSTATE) { @@ -106,7 +106,7 @@ WRITE32_HANDLER( am53cf96_w ) } val &= 0xff; -// logerror("53cf96: w %x to reg %d (ofs %02x data %08x mask %08x PC=%x)\n", val, reg, offset, data, mem_mask, activecpu_get_pc()); +// logerror("53cf96: w %x to reg %d (ofs %02x data %08x mask %08x PC=%x)\n", val, reg, offset, data, mem_mask, cpu_get_pc(machine->activecpu)); // if writing to the target ID, cache it off for later if (reg == REG_STATUS) @@ -144,7 +144,7 @@ WRITE32_HANDLER( am53cf96_w ) case 2: // reset device scsi_regs[REG_IRQSTATE] = 8; // indicate success - logerror("53cf96: reset target ID = %d (PC = %x)\n", last_id, activecpu_get_pc()); + logerror("53cf96: reset target ID = %d (PC = %x)\n", last_id, cpu_get_pc(machine->activecpu)); if (devices[last_id]) { SCSIReset( devices[last_id] ); @@ -172,7 +172,7 @@ WRITE32_HANDLER( am53cf96_w ) scsi_regs[REG_INTSTATE] = 4; } - logerror("53cf96: command %x exec. target ID = %d (PC = %x)\n", fifo[1], last_id, activecpu_get_pc()); + logerror("53cf96: command %x exec. target ID = %d (PC = %x)\n", fifo[1], last_id, cpu_get_pc(machine->activecpu)); if (devices[last_id]) { int length; diff --git a/src/emu/machine/at28c16.c b/src/emu/machine/at28c16.c index bc7da9ea323..46d81b090fa 100644 --- a/src/emu/machine/at28c16.c +++ b/src/emu/machine/at28c16.c @@ -50,11 +50,11 @@ WRITE8_DEVICE_HANDLER( at28c16_w ) if( c->last_write >= 0 ) { -// logerror( "%08x: at28c16_write( %d, %04x, %02x ) busy\n", activecpu_get_pc(), chip, offset, data ); +// logerror( "%08x: at28c16_write( %d, %04x, %02x ) busy\n", cpu_get_pc(machine->activecpu), chip, offset, data ); } else if( c->oe_12v ) { -// logerror( "%08x: at28c16_write( %d, %04x, %02x ) erase\n", activecpu_get_pc(), chip, offset, data ); +// logerror( "%08x: at28c16_write( %d, %04x, %02x ) erase\n", cpu_get_pc(machine->activecpu), chip, offset, data ); memset( c->data, 0xff, SIZE_DATA ); memset( c->id, 0xff, SIZE_ID ); c->last_write = 0xff; @@ -62,14 +62,14 @@ WRITE8_DEVICE_HANDLER( at28c16_w ) } else if( offset >= OFFSET_ID && c->a9_12v ) { -// logerror( "%08x: at28c16_write( %d, %04x, %02x ) id\n", activecpu_get_pc(), chip, offset, data ); +// logerror( "%08x: at28c16_write( %d, %04x, %02x ) id\n", cpu_get_pc(machine->activecpu), chip, offset, data ); c->id[ offset - OFFSET_ID ] = data; c->last_write = data; timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 ); } else { -// logerror( "%08x: at28c16_write( %d, %04x, %02x ) data\n", activecpu_get_pc(), chip, offset, data ); +// logerror( "%08x: at28c16_write( %d, %04x, %02x ) data\n", cpu_get_pc(machine->activecpu), chip, offset, data ); c->data[ offset ] = data; c->last_write = data; timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 ); @@ -93,7 +93,7 @@ READ8_DEVICE_HANDLER( at28c16_r ) } else { -// logerror( "%08x: at28c16_read( %d, %04x ) %02x data\n", activecpu_get_pc(), chip, offset, c->data[ offset ] ); +// logerror( "%08x: at28c16_read( %d, %04x ) %02x data\n", cpu_get_pc(machine->activecpu), chip, offset, c->data[ offset ] ); return c->data[ offset ]; } } diff --git a/src/emu/machine/ds2401.c b/src/emu/machine/ds2401.c index a70976405c9..51d8d9acd57 100644 --- a/src/emu/machine/ds2401.c +++ b/src/emu/machine/ds2401.c @@ -8,6 +8,7 @@ #include <stdarg.h> #include "driver.h" +#include "deprecat.h" #include "state.h" #include "machine/ds2401.h" @@ -22,9 +23,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c index 6419cbb9d05..eca67a6ec65 100644 --- a/src/emu/machine/generic.c +++ b/src/emu/machine/generic.c @@ -579,7 +579,7 @@ static void interrupt_reset(running_machine *machine) static TIMER_CALLBACK( clear_all_lines ) { int cpunum = param; - int inputcount = cpunum_input_lines(cpunum); + int inputcount = cpu_get_input_lines(machine->cpu[cpunum]); int line; /* clear NMI and all inputs */ @@ -614,7 +614,7 @@ void cpu_interrupt_enable(int cpunum, int enabled) WRITE8_HANDLER( interrupt_enable_w ) { - int activecpu = cpu_getactivecpu(); + int activecpu = cpunum_get_active(); assert_always(activecpu >= 0, "interrupt_enable_w() called with no active cpu!"); cpu_interrupt_enable(activecpu, data); } @@ -627,7 +627,7 @@ WRITE8_HANDLER( interrupt_enable_w ) READ8_HANDLER( interrupt_enable_r ) { - int activecpu = cpu_getactivecpu(); + int activecpu = cpunum_get_active(); assert_always(activecpu >= 0, "interrupt_enable_r() called with no active cpu!"); return interrupt_enable[activecpu]; } diff --git a/src/emu/machine/i2cmem.c b/src/emu/machine/i2cmem.c index 9b0b7b6b9f0..a7462f6fcb3 100644 --- a/src/emu/machine/i2cmem.c +++ b/src/emu/machine/i2cmem.c @@ -20,7 +20,8 @@ Up to 4096 bytes can be addressed. */ -#include <driver.h> +#include "driver.h" +#include "deprecat.h" #include "machine/i2cmem.h" #define VERBOSE_LEVEL ( 0 ) @@ -34,9 +35,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index 52b0bd1e5bd..db45ae0483d 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -674,17 +674,17 @@ static void write_buffer_to_dma(ide_state *ide) } /* fetch the address */ - ide->dma_address = cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor); - ide->dma_address |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; - ide->dma_address |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; - ide->dma_address |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; + ide->dma_address = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor); + ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; + ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; + ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; ide->dma_address &= 0xfffffffe; /* fetch the length */ - ide->dma_bytes_left = cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor); - ide->dma_bytes_left |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; - ide->dma_bytes_left |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; - ide->dma_bytes_left |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; + ide->dma_bytes_left = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor); + ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; + ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; + ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; ide->dma_last_buffer = (ide->dma_bytes_left >> 31) & 1; ide->dma_bytes_left &= 0xfffe; if (ide->dma_bytes_left == 0) @@ -694,7 +694,7 @@ static void write_buffer_to_dma(ide_state *ide) } /* write the next byte */ - cpunum_write_byte(ide->dma_cpu, ide->dma_address++, *data++); + cpu_write_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_address++, *data++); ide->dma_bytes_left--; } } @@ -872,17 +872,17 @@ static void read_buffer_from_dma(ide_state *ide) } /* fetch the address */ - ide->dma_address = cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor); - ide->dma_address |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; - ide->dma_address |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; - ide->dma_address |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; + ide->dma_address = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor); + ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; + ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; + ide->dma_address |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; ide->dma_address &= 0xfffffffe; /* fetch the length */ - ide->dma_bytes_left = cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor); - ide->dma_bytes_left |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; - ide->dma_bytes_left |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; - ide->dma_bytes_left |= cpunum_read_byte(ide->dma_cpu, ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; + ide->dma_bytes_left = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor); + ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 8; + ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 16; + ide->dma_bytes_left |= cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_descriptor++ ^ ide->dma_address_xor) << 24; ide->dma_last_buffer = (ide->dma_bytes_left >> 31) & 1; ide->dma_bytes_left &= 0xfffe; if (ide->dma_bytes_left == 0) @@ -892,7 +892,7 @@ static void read_buffer_from_dma(ide_state *ide) } /* read the next byte */ - *data++ = cpunum_read_byte(ide->dma_cpu, ide->dma_address++); + *data++ = cpu_read_byte(ide->device->machine->cpu[ide->dma_cpu], ide->dma_address++); ide->dma_bytes_left--; } } @@ -1182,7 +1182,7 @@ static UINT32 ide_controller_read(const device_config *device, offs_t offset, in /* logit */ // if (offset != IDE_ADDR_DATA && offset != IDE_ADDR_STATUS_COMMAND && offset != IDE_ADDR_STATUS_CONTROL) - LOG(("%08X:IDE read at %03X, size=%d\n", activecpu_get_previouspc(), offset, size)); + LOG(("%08X:IDE read at %03X, size=%d\n", cpu_get_previouspc(device->machine->activecpu), offset, size)); switch (offset) { @@ -1217,7 +1217,7 @@ static UINT32 ide_controller_read(const device_config *device, offs_t offset, in /* if we're at the end of the buffer, handle it */ if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE) { - LOG(("%08X:IDE completed PIO read\n", activecpu_get_previouspc())); + LOG(("%08X:IDE completed PIO read\n", cpu_get_previouspc(device->machine->activecpu))); continue_read(ide); } } @@ -1271,7 +1271,7 @@ static UINT32 ide_controller_read(const device_config *device, offs_t offset, in /* log anything else */ default: - logerror("%08X:unknown IDE read at %03X, size=%d\n", activecpu_get_previouspc(), offset, size); + logerror("%08X:unknown IDE read at %03X, size=%d\n", cpu_get_previouspc(device->machine->activecpu), offset, size); break; } @@ -1293,7 +1293,7 @@ static void ide_controller_write(const device_config *device, offs_t offset, int /* logit */ if (offset != IDE_ADDR_DATA) - LOG(("%08X:IDE write to %03X = %08X, size=%d\n", activecpu_get_previouspc(), offset, data, size)); + LOG(("%08X:IDE write to %03X = %08X, size=%d\n", cpu_get_previouspc(device->machine->activecpu), offset, data, size)); switch (offset) { @@ -1330,7 +1330,7 @@ static void ide_controller_write(const device_config *device, offs_t offset, int /* if we're at the end of the buffer, handle it */ if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE) { - LOG(("%08X:IDE completed PIO write\n", activecpu_get_previouspc())); + LOG(("%08X:IDE completed PIO write\n", cpu_get_previouspc(device->machine->activecpu))); if (ide->command != IDE_COMMAND_SECURITY_UNLOCK) continue_write(ide); else @@ -1440,7 +1440,7 @@ static UINT32 ide_bus_master_read(const device_config *device, offs_t offset, in { ide_state *ide = get_safe_token(device); - LOG(("%08X:ide_bus_master_read(%d, %d)\n", activecpu_get_previouspc(), offset, size)); + LOG(("%08X:ide_bus_master_read(%d, %d)\n", cpu_get_previouspc(device->machine->activecpu), offset, size)); /* command register */ if (offset == 0) @@ -1469,7 +1469,7 @@ static void ide_bus_master_write(const device_config *device, offs_t offset, int { ide_state *ide = get_safe_token(device); - LOG(("%08X:ide_bus_master_write(%d, %d, %08X)\n", activecpu_get_previouspc(), offset, size, data)); + LOG(("%08X:ide_bus_master_write(%d, %d, %08X)\n", cpu_get_previouspc(device->machine->activecpu), offset, size, data)); /* command register */ if (offset == 0) @@ -1488,8 +1488,8 @@ static void ide_bus_master_write(const device_config *device, offs_t offset, int ide->dma_bytes_left = 0; ide->dma_last_buffer = 0; ide->dma_descriptor = ide->bus_master_descriptor; - ide->dma_cpu = cpu_getactivecpu(); - ide->dma_address_xor = (activecpu_endianness() == CPU_IS_LE) ? 0 : 3; + ide->dma_cpu = cpunum_get_active(); + ide->dma_address_xor = (cpu_get_endianness(device->machine->activecpu) == CPU_IS_LE) ? 0 : 3; /* if we're going live, start the pending read/write */ if (ide->dma_active) diff --git a/src/emu/machine/intelfsh.c b/src/emu/machine/intelfsh.c index 854237987f3..7d29e128ff3 100644 --- a/src/emu/machine/intelfsh.c +++ b/src/emu/machine/intelfsh.c @@ -212,7 +212,7 @@ UINT32 intelflash_read(int chip, UINT32 address) break; } -// logerror( "%08x: intelflash_read( %d, %08x ) %08x\n", activecpu_get_pc(), chip, address, data ); +// logerror( "%08x: intelflash_read( %d, %08x ) %08x\n", cpu_get_pc(machine->activecpu), chip, address, data ); return data; } @@ -227,7 +227,7 @@ void intelflash_write(int chip, UINT32 address, UINT32 data) } c = &chips[ chip ]; -// logerror( "%08x: intelflash_write( %d, %08x, %08x )\n", activecpu_get_pc(), chip, address, data ); +// logerror( "%08x: intelflash_write( %d, %08x, %08x )\n", cpu_get_pc(machine->activecpu), chip, address, data ); switch( c->flash_mode ) { diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c index c08b477cdda..8973625b553 100644 --- a/src/emu/machine/ldpr8210.c +++ b/src/emu/machine/ldpr8210.c @@ -637,7 +637,7 @@ static READ8_HANDLER( pr8210_pia_r ) break; default: - mame_printf_debug("%03X:Unknown PR-8210 PIA read from offset %02X\n", activecpu_get_pc(), offset); + mame_printf_debug("%03X:Unknown PR-8210 PIA read from offset %02X\n", cpu_get_pc(machine->activecpu), offset); break; } return result; @@ -712,7 +712,7 @@ static WRITE8_HANDLER( pr8210_pia_w ) /* no other writes known */ default: - mame_printf_debug("%03X:Unknown PR-8210 PIA write to offset %02X = %02X\n", activecpu_get_pc(), offset, data); + mame_printf_debug("%03X:Unknown PR-8210 PIA write to offset %02X = %02X\n", cpu_get_pc(machine->activecpu), offset, data); break; } } @@ -1239,13 +1239,13 @@ static WRITE8_HANDLER( simutrek_port2_w ) { int direction = (data & 0x08) ? 1 : -1; if (LOG_SIMUTREK) - printf("%3d:JUMP TRG (Simutrek PC=%03X)\n", video_screen_get_vpos(ld->screen), activecpu_get_pc()); + printf("%3d:JUMP TRG (Simutrek PC=%03X)\n", video_screen_get_vpos(ld->screen), cpu_get_pc(machine->activecpu)); ldcore_advance_slider(ld, direction); } /* bit $04 controls who owns the JUMP TRG command */ if (LOG_SIMUTREK && ((data ^ prev) & 0x04)) - printf("%3d:Simutrek ownership line = %d (Simutrek PC=%03X)\n", video_screen_get_vpos(ld->screen), (data >> 2) & 1, activecpu_get_pc()); + printf("%3d:Simutrek ownership line = %d (Simutrek PC=%03X)\n", video_screen_get_vpos(ld->screen), (data >> 2) & 1, cpu_get_pc(machine->activecpu)); player->simutrek.controlnext = (~data >> 2) & 1; /* bits $03 control something (status?) */ diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c index 4bbbafbf9d1..dd78297fb81 100644 --- a/src/emu/machine/ldv1000.c +++ b/src/emu/machine/ldv1000.c @@ -523,7 +523,7 @@ static WRITE8_HANDLER( controller_w ) { laserdisc_state *ld = find_ldv1000(machine); if (LOG_STATUS_CHANGES && data != ld->player->status) - printf("%04X:CONTROLLER.W=%02X\n", activecpu_get_pc(), data); + printf("%04X:CONTROLLER.W=%02X\n", cpu_get_pc(machine->activecpu), data); ld->player->status = data; } @@ -538,7 +538,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_porta_w ) laserdisc_state *ld = find_ldv1000(device->machine); ld->player->counter_start = data; if (LOG_PORT_IO) - printf("%04X:PORTA.0=%02X\n", activecpu_get_pc(), data); + printf("%04X:PORTA.0=%02X\n", cpu_get_pc(device->machine->activecpu), data); } @@ -601,7 +601,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w ) player->portc0 = data; if (LOG_PORT_IO && ((data ^ prev) & 0x0f) != 0) { - printf("%04X:PORTC.0=%02X", activecpu_get_pc(), data); + printf("%04X:PORTC.0=%02X", cpu_get_pc(device->machine->activecpu), data); if (data & 0x01) printf(" PRELOAD"); if (!(data & 0x02)) printf(" /MULTIJUMP"); if (data & 0x04) printf(" SCANMODE"); @@ -697,7 +697,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portb_w ) player->portb1 = data; if (LOG_PORT_IO && ((data ^ prev) & 0xff) != 0) { - printf("%04X:PORTB.1=%02X:", activecpu_get_pc(), data); + printf("%04X:PORTB.1=%02X:", cpu_get_pc(device->machine->activecpu), data); if (!(data & 0x01)) printf(" FOCSON"); if (!(data & 0x02)) printf(" SPDLRUN"); if (!(data & 0x04)) printf(" JUMPTRIG"); @@ -753,7 +753,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portc_w ) player->portc1 = data; if (LOG_PORT_IO && ((data ^ prev) & 0xcf) != 0) { - printf("%04X:PORTC.1=%02X", activecpu_get_pc(), data); + printf("%04X:PORTC.1=%02X", cpu_get_pc(device->machine->activecpu), data); if (data & 0x01) printf(" AUD1"); if (data & 0x02) printf(" AUD2"); if (data & 0x04) printf(" AUDEN"); diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c index 5ecdcddb114..9be3dc5af63 100644 --- a/src/emu/machine/ldvp931.c +++ b/src/emu/machine/ldvp931.c @@ -475,7 +475,7 @@ static WRITE8_HANDLER( output0_w ) if (LOG_PORTS && (player->out0 ^ data) & 0xff) { - printf("%03X:out0:", activecpu_get_pc()); + printf("%03X:out0:", cpu_get_pc(machine->activecpu)); if ( (data & 0x80)) printf(" ???"); if ( (data & 0x40)) printf(" LED1"); if ( (data & 0x20)) printf(" LED2"); @@ -517,7 +517,7 @@ static WRITE8_HANDLER( output1_w ) if (LOG_PORTS && (player->out1 ^ data) & 0x08) { - mame_printf_debug("%03X:out1:", activecpu_get_pc()); + mame_printf_debug("%03X:out1:", cpu_get_pc(machine->activecpu)); if (!(data & 0x08)) mame_printf_debug(" SMS"); mame_printf_debug("\n"); player->out1 = data; @@ -678,7 +678,7 @@ static WRITE8_HANDLER( port1_w ) if (LOG_PORTS && (player->port1 ^ data) & 0x1f) { - printf("%03X:port1:", activecpu_get_pc()); + printf("%03X:port1:", cpu_get_pc(machine->activecpu)); if (!(data & 0x10)) printf(" SPEED"); if (!(data & 0x08)) printf(" TIMENABLE"); if (!(data & 0x04)) printf(" REV"); diff --git a/src/emu/machine/msm6242.c b/src/emu/machine/msm6242.c index 6e268033884..861d33510c6 100644 --- a/src/emu/machine/msm6242.c +++ b/src/emu/machine/msm6242.c @@ -100,7 +100,7 @@ READ8_DEVICE_HANDLER( msm6242_r ) case MSM6242_REG_CF: return msm6242->reg[2]; } - logerror("%04x: MSM6242 unmapped offset %02x read\n", activecpu_get_pc(), offset); + logerror("%04x: MSM6242 unmapped offset %02x read\n", cpu_get_pc(device->machine->activecpu), offset); return 0; } @@ -141,7 +141,7 @@ WRITE8_DEVICE_HANDLER( msm6242_w ) } } - logerror("%04x: MSM6242 unmapped offset %02x written with %02x\n", activecpu_get_pc(), offset, data); + logerror("%04x: MSM6242 unmapped offset %02x written with %02x\n", cpu_get_pc(device->machine->activecpu), offset, data); } diff --git a/src/emu/machine/pci.c b/src/emu/machine/pci.c index 1b8e57aebe5..bb870044d06 100644 --- a/src/emu/machine/pci.c +++ b/src/emu/machine/pci.c @@ -138,7 +138,7 @@ READ32_HANDLER(pci_32le_r) if (LOG_PCI) { logerror("pci_32le_r(): CPU #%d pc=0x%08X offset=%d result=0x%08X\n", - cpu_getactivecpu(), (unsigned) activecpu_get_reg(REG_PC), offset, result); + cpunum_get_active(), (unsigned) cpu_get_reg(machine->activecpu, REG_PC), offset, result); } return result; } @@ -155,7 +155,7 @@ WRITE32_HANDLER(pci_32le_w) if (LOG_PCI) { logerror("pci_32le_w(): CPU #%d pc=0x%08X offset=%d data=0x%08X\n", - cpu_getactivecpu(), (unsigned) activecpu_get_reg(REG_PC), offset, data); + cpunum_get_active(), (unsigned) cpu_get_reg(machine->activecpu, REG_PC), offset, data); } switch(offset) diff --git a/src/emu/machine/scsidev.c b/src/emu/machine/scsidev.c index b14c57a0a42..12d7b4a02a7 100644 --- a/src/emu/machine/scsidev.c +++ b/src/emu/machine/scsidev.c @@ -5,6 +5,7 @@ ***************************************************************************/ #include "scsidev.h" +#include "deprecat.h" typedef struct { @@ -27,7 +28,7 @@ static int scsidev_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode ) return 0; default: - logerror( "%08x: SCSIDEV unknown command %02x\n", activecpu_get_pc(), command[ 0 ] ); + logerror( "%08x: SCSIDEV unknown command %02x\n", cpu_get_pc(Machine->activecpu), command[ 0 ] ); return 0; } } @@ -42,7 +43,7 @@ static void scsidev_read_data( SCSIInstance *scsiInstance, UINT8 *data, int data switch( command[ 0 ] ) { default: - logerror( "%08x: SCSIDEV unknown read %02x\n", activecpu_get_pc(), command[ 0 ] ); + logerror( "%08x: SCSIDEV unknown read %02x\n", cpu_get_pc(Machine->activecpu), command[ 0 ] ); break; } } @@ -57,7 +58,7 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat switch( command[ 0 ] ) { default: - logerror( "%08x: SCSIDEV unknown write %02x\n", activecpu_get_pc(), command[ 0 ] ); + logerror( "%08x: SCSIDEV unknown write %02x\n", cpu_get_pc(Machine->activecpu), command[ 0 ] ); break; } } diff --git a/src/emu/machine/smc91c9x.c b/src/emu/machine/smc91c9x.c index fb0d4a5b038..5fd574ce591 100644 --- a/src/emu/machine/smc91c9x.c +++ b/src/emu/machine/smc91c9x.c @@ -377,7 +377,7 @@ READ16_DEVICE_HANDLER( smc91c9x_r ) } if (LOG_ETHERNET && offset != EREG_BANK) - logerror("%08X:smc91c9x_r(%s) = %04X & %04X\n", activecpu_get_pc(), ethernet_regname[offset], result, mem_mask); + logerror("%08X:smc91c9x_r(%s) = %04X & %04X\n", cpu_get_pc(device->machine->activecpu), ethernet_regname[offset], result, mem_mask); return result; } @@ -402,7 +402,7 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w ) COMBINE_DATA(&smc->reg[offset]); if (LOG_ETHERNET && offset != 7) - logerror("%08X:smc91c9x_w(%s) = %04X & %04X\n", activecpu_get_pc(), ethernet_regname[offset], data, mem_mask); + logerror("%08X:smc91c9x_w(%s) = %04X & %04X\n", cpu_get_pc(device->machine->activecpu), ethernet_regname[offset], data, mem_mask); /* handle it */ switch (offset) diff --git a/src/emu/machine/timekpr.c b/src/emu/machine/timekpr.c index c64937c4680..ad326d37b01 100644 --- a/src/emu/machine/timekpr.c +++ b/src/emu/machine/timekpr.c @@ -266,7 +266,7 @@ WRITE8_DEVICE_HANDLER( timekeeper_w ) data &= ~FLAGS_BL; } -// logerror( "%08x: timekeeper_write( %s, %04x, %02x )\n", activecpu_get_pc(), c->device->tag, offset, data ); +// logerror( "%08x: timekeeper_write( %s, %04x, %02x )\n", cpu_get_pc(machine->activecpu), c->device->tag, offset, data ); c->data[ offset ] = data; } @@ -274,7 +274,7 @@ READ8_DEVICE_HANDLER( timekeeper_r ) { timekeeper_state *c = get_safe_token(device); UINT8 data = c->data[ offset ]; -// logerror( "%08x: timekeeper_read( %s, %04x ) %02x\n", activecpu_get_pc(), c->device->tag, offset, data ); +// logerror( "%08x: timekeeper_read( %s, %04x ) %02x\n", cpu_get_pc(machine->activecpu), c->device->tag, offset, data ); return data; } diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c index f9ed0529280..eda514ebf8b 100644 --- a/src/emu/machine/tmp68301.c +++ b/src/emu/machine/tmp68301.c @@ -18,12 +18,12 @@ static emu_timer *tmp68301_timer[3]; // 3 Timers static int tmp68301_irq_vector[8]; -static void tmp68301_update_timer( int i ); +static void tmp68301_update_timer( running_machine *machine, int i ); static IRQ_CALLBACK(tmp68301_irq_callback) { int vector = tmp68301_irq_vector[irqline]; -// logerror("CPU #0 PC %06X: irq callback returns %04X for level %x\n",activecpu_get_pc(),vector,int_level); +// logerror("CPU #0 PC %06X: irq callback returns %04X for level %x\n",cpu_get_pc(machine->activecpu),vector,int_level); return vector; } @@ -35,7 +35,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback ) UINT16 ICR = tmp68301_regs[0x8e/2+i]; // Interrupt Controller Register (ICR7..9) UINT16 IVNR = tmp68301_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR) -// logerror("CPU #0 PC %06X: callback timer %04X, j = %d\n",activecpu_get_pc(),i,tcount); +// logerror("CPU #0 PC %06X: callback timer %04X, j = %d\n",cpu_get_pc(machine->activecpu),i,tcount); if ( (TCR & 0x0004) && // INT !(IMR & (0x100<<i)) @@ -53,7 +53,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback ) if (TCR & 0x0080) // N/1 { // Repeat - tmp68301_update_timer(i); + tmp68301_update_timer(machine, i); } else { @@ -61,7 +61,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback ) } } -static void tmp68301_update_timer( int i ) +static void tmp68301_update_timer( running_machine *machine, int i ) { UINT16 TCR = tmp68301_regs[(0x200 + i * 0x20)/2]; UINT16 MAX1 = tmp68301_regs[(0x204 + i * 0x20)/2]; @@ -95,14 +95,14 @@ static void tmp68301_update_timer( int i ) break; } -// logerror("CPU #0 PC %06X: TMP68301 Timer %d, duration %lf, max %04X\n",activecpu_get_pc(),i,duration,max); +// logerror("CPU #0 PC %06X: TMP68301 Timer %d, duration %lf, max %04X\n",cpu_get_pc(machine->activecpu),i,duration,max); if (!(TCR & 0x0002)) // CS { if (attotime_compare(duration, attotime_zero)) timer_adjust_oneshot(tmp68301_timer[i],duration,i); else - logerror("CPU #0 PC %06X: TMP68301 error, timer %d duration is 0\n",activecpu_get_pc(),i); + logerror("CPU #0 PC %06X: TMP68301 error, timer %d duration is 0\n",cpu_get_pc(machine->activecpu),i); } } @@ -156,7 +156,7 @@ WRITE16_HANDLER( tmp68301_regs_w ) if (!ACCESSING_BITS_0_7) return; -// logerror("CPU #0 PC %06X: TMP68301 Reg %04X<-%04X & %04X\n",activecpu_get_pc(),offset*2,data,mem_mask^0xffff); +// logerror("CPU #0 PC %06X: TMP68301 Reg %04X<-%04X & %04X\n",cpu_get_pc(machine->activecpu),offset*2,data,mem_mask^0xffff); switch( offset * 2 ) { @@ -167,7 +167,7 @@ WRITE16_HANDLER( tmp68301_regs_w ) { int i = ((offset*2) >> 5) & 3; - tmp68301_update_timer( i ); + tmp68301_update_timer( machine, i ); } break; } diff --git a/src/emu/machine/wd33c93.c b/src/emu/machine/wd33c93.c index cc5d578d64f..08cbc55a26d 100644 --- a/src/emu/machine/wd33c93.c +++ b/src/emu/machine/wd33c93.c @@ -12,6 +12,7 @@ */ #include "driver.h" +#include "deprecat.h" #include "state.h" #include "wd33c93.h" @@ -293,7 +294,7 @@ static void wd33c93_complete_cmd( UINT8 status ) /* command handlers */ static void wd33c93_invalid_cmd( void ) { - logerror( "Unknown/Unimplemented SCSI controller command: %02x (PC=%x)\n", scsi_data.regs[WD_COMMAND], activecpu_get_pc() ); + logerror( "Unknown/Unimplemented SCSI controller command: %02x (PC=%x)\n", scsi_data.regs[WD_COMMAND], cpu_get_pc(Machine->activecpu) ); /* complete the command */ wd33c93_complete_cmd( CSR_INVALID ); @@ -526,7 +527,7 @@ WRITE8_HANDLER(wd33c93_w) case 1: { - LOG(( "WD33C93: PC=%08x - Write REG=%02x, data = %02x\n", safe_activecpu_get_pc(), scsi_data.sasr, data )); + LOG(( "WD33C93: PC=%08x - Write REG=%02x, data = %02x\n", safe_cpu_get_pc(machine->activecpu), scsi_data.sasr, data )); /* update the register */ scsi_data.regs[scsi_data.sasr] = data; @@ -534,7 +535,7 @@ WRITE8_HANDLER(wd33c93_w) /* if we receive a command, schedule to process it */ if ( scsi_data.sasr == WD_COMMAND ) { - LOG(( "WDC33C93: PC=%08x - Executing command %08x - unit %d\n", safe_activecpu_get_pc(), data, wd33c93_getunit() )); + LOG(( "WDC33C93: PC=%08x - Executing command %08x - unit %d\n", safe_cpu_get_pc(machine->activecpu), data, wd33c93_getunit() )); /* signal we're processing it */ scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP; @@ -685,7 +686,7 @@ READ8_HANDLER(wd33c93_r) intf->irq_callback(machine, 0); } - LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_SCSI_STATUS] )); + LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", safe_cpu_get_pc(machine->activecpu), scsi_data.regs[WD_SCSI_STATUS] )); } else if ( scsi_data.sasr == WD_DATA ) { @@ -754,7 +755,7 @@ READ8_HANDLER(wd33c93_r) } } - LOG(( "WD33C93: PC=%08x - Data read (%02x)\n", safe_activecpu_get_pc(), scsi_data.regs[WD_DATA] )); + LOG(( "WD33C93: PC=%08x - Data read (%02x)\n", safe_cpu_get_pc(machine->activecpu), scsi_data.regs[WD_DATA] )); /* get the register value */ ret = scsi_data.regs[scsi_data.sasr]; diff --git a/src/emu/machine/x76f041.c b/src/emu/machine/x76f041.c index ed2f7e9ad9a..33b247b9a5e 100644 --- a/src/emu/machine/x76f041.c +++ b/src/emu/machine/x76f041.c @@ -12,6 +12,7 @@ */ #include "driver.h" +#include "deprecat.h" #include "machine/x76f041.h" #define VERBOSE_LEVEL ( 0 ) @@ -25,9 +26,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/emu/machine/x76f100.c b/src/emu/machine/x76f100.c index c88fd4c5027..af2f5e4b892 100644 --- a/src/emu/machine/x76f100.c +++ b/src/emu/machine/x76f100.c @@ -10,6 +10,7 @@ */ #include "driver.h" +#include "deprecat.h" #include "machine/x76f100.h" #define VERBOSE_LEVEL ( 0 ) @@ -23,9 +24,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/emu/machine/z80sio.c b/src/emu/machine/z80sio.c index 22dea3b275c..7085ff7f3d3 100644 --- a/src/emu/machine/z80sio.c +++ b/src/emu/machine/z80sio.c @@ -341,7 +341,7 @@ WRITE8_DEVICE_HANDLER( z80sio_c_w ) UINT8 old = chan->regs[reg]; if (reg != 0 || (reg & 0xf8)) - VPRINTF(("%04X:sio_reg_w(%c,%d) = %02X\n", activecpu_get_pc(), 'A' + ch, reg, data)); + VPRINTF(("%04X:sio_reg_w(%c,%d) = %02X\n", cpu_get_pc(device->machine->activecpu), 'A' + ch, reg, data)); /* write a new value to the selected register */ chan->regs[reg] = data; @@ -358,7 +358,7 @@ WRITE8_DEVICE_HANDLER( z80sio_c_w ) switch (data & SIO_WR0_COMMAND_MASK) { case SIO_WR0_COMMAND_CH_RESET: - VPRINTF(("%04X:SIO reset channel %c\n", activecpu_get_pc(), 'A' + ch)); + VPRINTF(("%04X:SIO reset channel %c\n", cpu_get_pc(device->machine->activecpu), 'A' + ch)); reset_channel(device, ch); break; @@ -425,7 +425,7 @@ READ8_DEVICE_HANDLER( z80sio_c_r ) break; } - VPRINTF(("%04X:sio_reg_r(%c,%d) = %02x\n", activecpu_get_pc(), 'A' + ch, reg, chan->status[reg])); + VPRINTF(("%04X:sio_reg_r(%c,%d) = %02x\n", cpu_get_pc(device->machine->activecpu), 'A' + ch, reg, chan->status[reg])); return chan->status[reg]; } @@ -447,7 +447,7 @@ WRITE8_DEVICE_HANDLER( z80sio_d_w ) int ch = offset & 1; sio_channel *chan = &sio->chan[ch]; - VPRINTF(("%04X:sio_data_w(%c) = %02X\n", activecpu_get_pc(), 'A' + ch, data)); + VPRINTF(("%04X:sio_data_w(%c) = %02X\n", cpu_get_pc(device->machine->activecpu), 'A' + ch, data)); /* if tx not enabled, just ignore it */ if (!(chan->regs[5] & SIO_WR5_TX_ENABLE)) @@ -482,7 +482,7 @@ READ8_DEVICE_HANDLER( z80sio_d_r ) sio->int_state[INT_CHA_RECEIVE - 4*ch] &= ~Z80_DAISY_INT; interrupt_check(device); - VPRINTF(("%04X:sio_data_r(%c) = %02X\n", activecpu_get_pc(), 'A' + ch, chan->inbuf)); + VPRINTF(("%04X:sio_data_r(%c) = %02X\n", cpu_get_pc(device->machine->activecpu), 'A' + ch, chan->inbuf)); return chan->inbuf; } diff --git a/src/emu/mame.c b/src/emu/mame.c index a2a05482096..4ef5236fc7b 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -560,7 +560,7 @@ void mame_schedule_exit(running_machine *machine) mame->exit_pending = TRUE; /* if we're executing, abort out immediately */ - if (cpu_getactivecpu() >= 0) + if (cpunum_get_active() >= 0) activecpu_adjust_icount(-activecpu_get_icount() - 1); /* if we're autosaving on exit, schedule a save as well */ @@ -580,7 +580,7 @@ void mame_schedule_hard_reset(running_machine *machine) mame->hard_reset_pending = TRUE; /* if we're executing, abort out immediately */ - if (cpu_getactivecpu() >= 0) + if (cpunum_get_active() >= 0) activecpu_adjust_icount(-activecpu_get_icount() - 1); } @@ -600,7 +600,7 @@ void mame_schedule_soft_reset(running_machine *machine) mame_pause(machine, FALSE); /* if we're executing, abort out immediately */ - if (cpu_getactivecpu() >= 0) + if (cpunum_get_active() >= 0) activecpu_adjust_icount(-activecpu_get_icount() - 1); } @@ -617,7 +617,7 @@ void mame_schedule_new_driver(running_machine *machine, const game_driver *drive mame->new_driver_pending = driver; /* if we're executing, abort out immediately */ - if (cpu_getactivecpu() >= 0) + if (cpunum_get_active() >= 0) activecpu_adjust_icount(-activecpu_get_icount() - 1); } @@ -1624,7 +1624,7 @@ static TIMER_CALLBACK( soft_reset ) /* unfortunately, we can't rely on callbacks to reset the interrupt */ /* structures, as these need to happen before we call the reset */ /* functions registered by the drivers */ - cpuint_reset(); + cpuint_reset(machine); /* run the driver's reset callbacks */ if (machine->config->machine_reset != NULL) @@ -1739,7 +1739,7 @@ static void handle_save(running_machine *machine) /* loop over CPUs */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); /* make sure banking is set */ activecpu_reset_banking(); @@ -1749,7 +1749,7 @@ static void handle_save(running_machine *machine) state_save_save_continue(machine); state_save_pop_tag(); - cpuintrf_pop_context(); + cpu_pop_context(); } /* finish and close */ @@ -1821,7 +1821,7 @@ static void handle_load(running_machine *machine) /* loop over CPUs */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { - cpuintrf_push_context(cpunum); + cpu_push_context(machine->cpu[cpunum]); /* make sure banking is set */ activecpu_reset_banking(); @@ -1834,7 +1834,7 @@ static void handle_load(running_machine *machine) /* make sure banking is set */ activecpu_reset_banking(); - cpuintrf_pop_context(); + cpu_pop_context(); } /* finish and close */ diff --git a/src/emu/mame.h b/src/emu/mame.h index f2e69f247c0..37933871e84 100644 --- a/src/emu/mame.h +++ b/src/emu/mame.h @@ -141,6 +141,9 @@ struct _running_machine /* configuration data */ const machine_config * config; /* points to the constructed machine_config */ const input_port_config *portconfig; /* points to a list of input port configurations */ + + /* CPU information */ + const device_config * activecpu; /* active CPU (or NULL) */ const device_config * cpu[MAX_CPU]; /* array of CPU devices */ /* game-related information */ diff --git a/src/emu/mconfig.c b/src/emu/mconfig.c index af235ac14fa..23bf7310090 100644 --- a/src/emu/mconfig.c +++ b/src/emu/mconfig.c @@ -362,7 +362,7 @@ static void machine_config_detokenize(machine_config *config, const machine_conf break; /* CPU parameters */ - case MCONFIG_TOKEN_CPU_FLAGS: + case MCONFIG_TOKEN_cpu_get_flags: assert(cpu != NULL); TOKEN_UNGET_UINT32(tokens); TOKEN_GET_UINT32_UNPACK2(tokens, entrytype, 8, cpu->flags, 24); diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index 59dd492b5c8..793a7fa2ef5 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -46,7 +46,7 @@ enum MCONFIG_TOKEN_CPU_MODIFY, MCONFIG_TOKEN_CPU_REMOVE, MCONFIG_TOKEN_CPU_REPLACE, - MCONFIG_TOKEN_CPU_FLAGS, + MCONFIG_TOKEN_cpu_get_flags, MCONFIG_TOKEN_CPU_CONFIG, MCONFIG_TOKEN_CPU_PROGRAM_MAP, MCONFIG_TOKEN_CPU_DATA_MAP, @@ -294,7 +294,7 @@ union _machine_config_token /* CPU parameters */ #define MDRV_CPU_FLAGS(_flags) \ - TOKEN_UINT32_PACK2(MCONFIG_TOKEN_CPU_FLAGS, 8, _flags, 24), + TOKEN_UINT32_PACK2(MCONFIG_TOKEN_cpu_get_flags, 8, _flags, 24), #define MDRV_CPU_CONFIG(_config) \ TOKEN_UINT32_PACK1(MCONFIG_TOKEN_CPU_CONFIG, 8), \ diff --git a/src/emu/memory.c b/src/emu/memory.c index 6f5d72b4519..29bbff21e86 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -408,10 +408,10 @@ static void mem_dump(void); the opcode base -------------------------------------------------*/ -INLINE void force_opbase_update(void) +INLINE void force_opbase_update(running_machine *machine) { opbase.entry = 0xff; - memory_set_opbase(activecpu_get_physical_pc_byte()); + memory_set_opbase(cpu_get_physical_pc_byte(Machine->activecpu)); } @@ -1140,8 +1140,8 @@ void memory_set_decrypted_region(int cpunum, offs_t addrstart, offs_t addrend, v found = TRUE; /* if we are executing from here, force an opcode base update */ - if (cpu_getactivecpu() >= 0 && cpunum == cur_context && opbase.entry == banknum) - force_opbase_update(); + if (cpunum_get_active() >= 0 && cpunum == cur_context && opbase.entry == banknum) + force_opbase_update(Machine); } /* fatal error if the decrypted region straddles the bank */ @@ -1166,7 +1166,7 @@ opbase_handler_func memory_set_opbase_handler(int cpunum, opbase_handler_func fu { opbase_handler_func old = cpudata[cpunum].opbase_handler; cpudata[cpunum].opbase_handler = function; - if (cpunum == cpu_getactivecpu()) + if (cpunum == cpunum_get_active()) opbase_handler = function; return old; } @@ -1217,7 +1217,7 @@ void memory_set_opbase(offs_t byteaddress) if (entry == STATIC_COUNT) { logerror("cpu #%d (PC=%08X): warning - op-code execute on mapped I/O\n", - cpu_getactivecpu(), activecpu_get_pc()); + cpunum_get_active(), cpu_get_pc(Machine->activecpu)); return; } } @@ -1423,8 +1423,8 @@ void memory_set_bank(int banknum, int entrynum) bankd_ptr[banknum] = bankdata[banknum].entryd[entrynum]; /* if we're executing out of this bank, adjust the opbase pointer */ - if (opbase.entry == banknum && cpu_getactivecpu() >= 0) - force_opbase_update(); + if (opbase.entry == banknum && cpunum_get_active() >= 0) + force_opbase_update(Machine); } @@ -1466,8 +1466,8 @@ void memory_set_bankptr(int banknum, void *base) bank_ptr[banknum] = base; /* if we're executing out of this bank, adjust the opbase pointer */ - if (opbase.entry == banknum && cpu_getactivecpu() >= 0) - force_opbase_update(); + if (opbase.entry == banknum && cpunum_get_active() >= 0) + force_opbase_update(Machine); } @@ -2823,49 +2823,49 @@ static void *memory_find_base(int cpunum, int spacenum, offs_t byteaddress) UINT8 cpu_readop_safe(offs_t byteaddress) { - activecpu_set_opbase(byteaddress); + cpu_set_opbase(Machine->activecpu, byteaddress); return cpu_readop_unsafe(byteaddress); } UINT16 cpu_readop16_safe(offs_t byteaddress) { - activecpu_set_opbase(byteaddress); + cpu_set_opbase(Machine->activecpu, byteaddress); return cpu_readop16_unsafe(byteaddress); } UINT32 cpu_readop32_safe(offs_t byteaddress) { - activecpu_set_opbase(byteaddress); + cpu_set_opbase(Machine->activecpu, byteaddress); return cpu_readop32_unsafe(byteaddress); } UINT64 cpu_readop64_safe(offs_t byteaddress) { - activecpu_set_opbase(byteaddress); + cpu_set_opbase(Machine->activecpu, byteaddress); return cpu_readop64_unsafe(byteaddress); } UINT8 cpu_readop_arg_safe(offs_t byteaddress) { - activecpu_set_opbase(byteaddress); + cpu_set_opbase(Machine->activecpu, byteaddress); return cpu_readop_arg_unsafe(byteaddress); } UINT16 cpu_readop_arg16_safe(offs_t byteaddress) { - activecpu_set_opbase(byteaddress); + cpu_set_opbase(Machine->activecpu, byteaddress); return cpu_readop_arg16_unsafe(byteaddress); } UINT32 cpu_readop_arg32_safe(offs_t byteaddress) { - activecpu_set_opbase(byteaddress); + cpu_set_opbase(Machine->activecpu, byteaddress); return cpu_readop_arg32_unsafe(byteaddress); } UINT64 cpu_readop_arg64_safe(offs_t byteaddress) { - activecpu_set_opbase(byteaddress); + cpu_set_opbase(Machine->activecpu, byteaddress); return cpu_readop_arg64_unsafe(byteaddress); } @@ -2876,116 +2876,116 @@ UINT64 cpu_readop_arg64_safe(offs_t byteaddress) static READ8_HANDLER( mrh8_unmap_program ) { - if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory byte read from %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset)); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap; + if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory byte read from %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM], offset)); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM].unmap; } static READ16_HANDLER( mrh16_unmap_program ) { - if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*2), mem_mask); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap; + if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word read from %08X & %04X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM], offset*2), mem_mask); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM].unmap; } static READ32_HANDLER( mrh32_unmap_program ) { - if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*4), mem_mask); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap; + if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword read from %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM], offset*4), mem_mask); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM].unmap; } static READ64_HANDLER( mrh64_unmap_program ) { - if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap; + if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword read from %08X & %08X%08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM].unmap; } static WRITE8_HANDLER( mwh8_unmap_program ) { - if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory byte write to %08X = %02X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset), data); + if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory byte write to %08X = %02X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM], offset), data); } static WRITE16_HANDLER( mwh16_unmap_program ) { - if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*2), data, mem_mask); + if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory word write to %08X = %04X & %04X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM], offset*2), data, mem_mask); } static WRITE32_HANDLER( mwh32_unmap_program ) { - if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*4), data, mem_mask); + if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory dword write to %08X = %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM], offset*4), data, mem_mask); } static WRITE64_HANDLER( mwh64_unmap_program ) { - if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); + if (log_unmap[ADDRESS_SPACE_PROGRAM] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped program memory qword write to %08X = %08X%08X & %08X%08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); } static READ8_HANDLER( mrh8_unmap_data ) { - if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory byte read from %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset)); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap; + if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory byte read from %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA], offset)); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA].unmap; } static READ16_HANDLER( mrh16_unmap_data ) { - if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*2), mem_mask); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap; + if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word read from %08X & %04X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA], offset*2), mem_mask); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA].unmap; } static READ32_HANDLER( mrh32_unmap_data ) { - if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*4), mem_mask); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap; + if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword read from %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA], offset*4), mem_mask); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA].unmap; } static READ64_HANDLER( mrh64_unmap_data ) { - if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap; + if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword read from %08X & %08X%08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA].unmap; } static WRITE8_HANDLER( mwh8_unmap_data ) { - if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory byte write to %08X = %02X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset), data); + if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory byte write to %08X = %02X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA], offset), data); } static WRITE16_HANDLER( mwh16_unmap_data ) { - if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*2), data, mem_mask); + if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory word write to %08X = %04X & %04X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA], offset*2), data, mem_mask); } static WRITE32_HANDLER( mwh32_unmap_data ) { - if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*4), data, mem_mask); + if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory dword write to %08X = %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA], offset*4), data, mem_mask); } static WRITE64_HANDLER( mwh64_unmap_data ) { - if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); + if (log_unmap[ADDRESS_SPACE_DATA] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped data memory qword write to %08X = %08X%08X & %08X%08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); } static READ8_HANDLER( mrh8_unmap_io ) { - if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O byte read from %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset)); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap; + if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O byte read from %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO], offset)); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO].unmap; } static READ16_HANDLER( mrh16_unmap_io ) { - if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word read from %08X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*2), mem_mask); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap; + if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word read from %08X & %04X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO], offset*2), mem_mask); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO].unmap; } static READ32_HANDLER( mrh32_unmap_io ) { - if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword read from %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*4), mem_mask); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap; + if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword read from %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO], offset*4), mem_mask); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO].unmap; } static READ64_HANDLER( mrh64_unmap_io ) { - if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword read from %08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); - return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap; + if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword read from %08X & %08X%08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO], offset*8), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); + return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO].unmap; } static WRITE8_HANDLER( mwh8_unmap_io ) { - if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O byte write to %08X = %02X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset), data); + if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O byte write to %08X = %02X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO], offset), data); } static WRITE16_HANDLER( mwh16_unmap_io ) { - if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word write to %08X = %04X & %04X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*2), data, mem_mask); + if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O word write to %08X = %04X & %04X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO], offset*2), data, mem_mask); } static WRITE32_HANDLER( mwh32_unmap_io ) { - if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*4), data, mem_mask); + if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O dword write to %08X = %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO], offset*4), data, mem_mask); } static WRITE64_HANDLER( mwh64_unmap_io ) { - if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword write to %08X = %08X%08X & %08X%08X\n", cpu_getactivecpu(), activecpu_get_pc(), BYTE2ADDR(&cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); + if (log_unmap[ADDRESS_SPACE_IO] && !debugger_access) logerror("cpu #%d (PC=%08X): unmapped I/O qword write to %08X = %08X%08X & %08X%08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), BYTE2ADDR(&cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO], offset*8), (int)(data >> 32), (int)(data & 0xffffffff), (int)(mem_mask >> 32), (int)(mem_mask & 0xffffffff)); } @@ -2993,20 +2993,20 @@ static WRITE64_HANDLER( mwh64_unmap_io ) no-op memory handlers -------------------------------------------------*/ -static READ8_HANDLER( mrh8_nop_program ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap; } -static READ16_HANDLER( mrh16_nop_program ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap; } -static READ32_HANDLER( mrh32_nop_program ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap; } -static READ64_HANDLER( mrh64_nop_program ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_PROGRAM].unmap; } +static READ8_HANDLER( mrh8_nop_program ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM].unmap; } +static READ16_HANDLER( mrh16_nop_program ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM].unmap; } +static READ32_HANDLER( mrh32_nop_program ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM].unmap; } +static READ64_HANDLER( mrh64_nop_program ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_PROGRAM].unmap; } -static READ8_HANDLER( mrh8_nop_data ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap; } -static READ16_HANDLER( mrh16_nop_data ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap; } -static READ32_HANDLER( mrh32_nop_data ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap; } -static READ64_HANDLER( mrh64_nop_data ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_DATA].unmap; } +static READ8_HANDLER( mrh8_nop_data ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA].unmap; } +static READ16_HANDLER( mrh16_nop_data ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA].unmap; } +static READ32_HANDLER( mrh32_nop_data ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA].unmap; } +static READ64_HANDLER( mrh64_nop_data ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_DATA].unmap; } -static READ8_HANDLER( mrh8_nop_io ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap; } -static READ16_HANDLER( mrh16_nop_io ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap; } -static READ32_HANDLER( mrh32_nop_io ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap; } -static READ64_HANDLER( mrh64_nop_io ) { return cpudata[cpu_getactivecpu()].space[ADDRESS_SPACE_IO].unmap; } +static READ8_HANDLER( mrh8_nop_io ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO].unmap; } +static READ16_HANDLER( mrh16_nop_io ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO].unmap; } +static READ32_HANDLER( mrh32_nop_io ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO].unmap; } +static READ64_HANDLER( mrh64_nop_io ) { return cpudata[cpunum_get_active()].space[ADDRESS_SPACE_IO].unmap; } static WRITE8_HANDLER( mwh8_nop ) { } static WRITE16_HANDLER( mwh16_nop ) { } diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c index 215d06bc120..37b4db64070 100644 --- a/src/emu/sound/2608intf.c +++ b/src/emu/sound/2608intf.c @@ -186,14 +186,14 @@ static void ym2608_reset(void *token) /************************************************/ READ8_HANDLER( ym2608_status_port_0_a_r ) { -//logerror("PC %04x: 2608 S0A=%02X\n",activecpu_get_pc(),ym2608_read(sndti_token(SOUND_YM2608, 0),0)); +//logerror("PC %04x: 2608 S0A=%02X\n",cpu_get_pc(machine->activecpu),ym2608_read(sndti_token(SOUND_YM2608, 0),0)); struct ym2608_info *info = sndti_token(SOUND_YM2608, 0); return ym2608_read(info->chip,0); } READ8_HANDLER( ym2608_status_port_0_b_r ) { -//logerror("PC %04x: 2608 S0B=%02X\n",activecpu_get_pc(),ym2608_read(sndti_token(SOUND_YM2608, 0),2)); +//logerror("PC %04x: 2608 S0B=%02X\n",cpu_get_pc(machine->activecpu),ym2608_read(sndti_token(SOUND_YM2608, 0),2)); struct ym2608_info *info = sndti_token(SOUND_YM2608, 0); return ym2608_read(info->chip,2); } diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c index 0ea3924fd4c..ea686b057fb 100644 --- a/src/emu/sound/2610intf.c +++ b/src/emu/sound/2610intf.c @@ -260,28 +260,28 @@ static void ym2610_reset(void *token) /************************************************/ READ8_HANDLER( ym2610_status_port_0_a_r ) { -//logerror("PC %04x: 2610 S0A=%02X\n",activecpu_get_pc(),ym2610_read(sndti_token(chip_type,0,0)); +//logerror("PC %04x: 2610 S0A=%02X\n",cpu_get_pc(machine->activecpu),ym2610_read(sndti_token(chip_type,0,0)); struct ym2610_info *info = sndti_token(chip_type,0); return ym2610_read(info->chip,0); } READ16_HANDLER( ym2610_status_port_0_a_lsb_r ) { -//logerror("PC %04x: 2610 S0A=%02X\n",activecpu_get_pc(),ym2610_read(sndti_token(chip_type,0,0)); +//logerror("PC %04x: 2610 S0A=%02X\n",cpu_get_pc(machine->activecpu),ym2610_read(sndti_token(chip_type,0,0)); struct ym2610_info *info = sndti_token(chip_type,0); return ym2610_read(info->chip,0); } READ8_HANDLER( ym2610_status_port_0_b_r ) { -//logerror("PC %04x: 2610 S0B=%02X\n",activecpu_get_pc(),ym2610_read(sndti_token(chip_type,0,2)); +//logerror("PC %04x: 2610 S0B=%02X\n",cpu_get_pc(machine->activecpu),ym2610_read(sndti_token(chip_type,0,2)); struct ym2610_info *info = sndti_token(chip_type,0); return ym2610_read(info->chip,2); } READ16_HANDLER( ym2610_status_port_0_b_lsb_r ) { -//logerror("PC %04x: 2610 S0B=%02X\n",activecpu_get_pc(),ym2610_read(sndti_token(chip_type,0,2)); +//logerror("PC %04x: 2610 S0B=%02X\n",cpu_get_pc(machine->activecpu),ym2610_read(sndti_token(chip_type,0,2)); struct ym2610_info *info = sndti_token(chip_type,0); return ym2610_read(info->chip,2); } @@ -341,14 +341,14 @@ READ16_HANDLER( ym2610_read_port_1_lsb_r ){ /************************************************/ WRITE8_HANDLER( ym2610_control_port_0_a_w ) { -//logerror("PC %04x: 2610 Reg A %02X",activecpu_get_pc(),data); +//logerror("PC %04x: 2610 Reg A %02X",cpu_get_pc(machine->activecpu),data); struct ym2610_info *info = sndti_token(chip_type,0); ym2610_write(info->chip,0,data); } WRITE16_HANDLER( ym2610_control_port_0_a_lsb_w ) { -//logerror("PC %04x: 2610 Reg A %02X",activecpu_get_pc(),data); +//logerror("PC %04x: 2610 Reg A %02X",cpu_get_pc(machine->activecpu),data); if (ACCESSING_BITS_0_7) { struct ym2610_info *info = sndti_token(chip_type,0); @@ -358,14 +358,14 @@ WRITE16_HANDLER( ym2610_control_port_0_a_lsb_w ) WRITE8_HANDLER( ym2610_control_port_0_b_w ) { -//logerror("PC %04x: 2610 Reg B %02X",activecpu_get_pc(),data); +//logerror("PC %04x: 2610 Reg B %02X",cpu_get_pc(machine->activecpu),data); struct ym2610_info *info = sndti_token(chip_type,0); ym2610_write(info->chip,2,data); } WRITE16_HANDLER( ym2610_control_port_0_b_lsb_w ) { -//logerror("PC %04x: 2610 Reg B %02X",activecpu_get_pc(),data); +//logerror("PC %04x: 2610 Reg B %02X",cpu_get_pc(machine->activecpu),data); if (ACCESSING_BITS_0_7) { struct ym2610_info *info = sndti_token(chip_type,0); diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c index 289def77ed1..d9e4b3c3dbf 100644 --- a/src/emu/sound/ay8910.c +++ b/src/emu/sound/ay8910.c @@ -796,7 +796,7 @@ int ay8910_read_ym(void *chip) if (psg->intf->portAread) psg->regs[AY_PORTA] = (*psg->intf->portAread)(Machine, 0); else - logerror("PC %04x: warning - read 8910 #%d Port A\n",activecpu_get_pc(),psg->index); + logerror("PC %04x: warning - read 8910 #%d Port A\n",cpu_get_pc(Machine->activecpu),psg->index); break; case AY_PORTB: if ((psg->regs[AY_ENABLE] & 0x80) != 0) @@ -804,7 +804,7 @@ int ay8910_read_ym(void *chip) if (psg->intf->portBread) psg->regs[AY_PORTB] = (*psg->intf->portBread)(Machine, 0); else - logerror("PC %04x: warning - read 8910 #%d Port B\n",activecpu_get_pc(),psg->index); + logerror("PC %04x: warning - read 8910 #%d Port B\n",cpu_get_pc(Machine->activecpu),psg->index); break; } return psg->regs[r]; diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c index 4ec7c3eb861..1c8d303a706 100644 --- a/src/emu/sound/es5506.c +++ b/src/emu/sound/es5506.c @@ -1564,7 +1564,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo } if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, control=%04x (raw=%04x & %04x)\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff); + fprintf(eslog, "%06x:voice %d, control=%04x (raw=%04x & %04x)\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff); break; case 0x01: /* FC */ @@ -1573,7 +1573,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo if (ACCESSING_BITS_8_15) voice->freqcount = (voice->freqcount & ~0x1fe00) | ((data & 0xff00) << 1); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, freq count=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->freqcount); + fprintf(eslog, "%06x:voice %d, freq count=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->freqcount); break; case 0x02: /* STRT (hi) */ @@ -1582,7 +1582,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo if (ACCESSING_BITS_8_15) voice->start = (voice->start & ~0x7c000000) | ((data & 0x1f00) << 18); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, loop start=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->start); + fprintf(eslog, "%06x:voice %d, loop start=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->start); break; case 0x03: /* STRT (lo) */ @@ -1591,7 +1591,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo if (ACCESSING_BITS_8_15) voice->start = (voice->start & ~0x0003fc00) | ((data & 0xff00) << 2); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, loop start=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->start); + fprintf(eslog, "%06x:voice %d, loop start=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->start); break; case 0x04: /* END (hi) */ @@ -1603,7 +1603,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo voice->control |= CONTROL_STOP0; #endif if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, loop end=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->end); + fprintf(eslog, "%06x:voice %d, loop end=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->end); break; case 0x05: /* END (lo) */ @@ -1615,7 +1615,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo voice->control |= CONTROL_STOP0; #endif if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, loop end=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->end); + fprintf(eslog, "%06x:voice %d, loop end=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->end); break; case 0x06: /* K2 */ @@ -1624,7 +1624,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo if (ACCESSING_BITS_8_15) voice->k2 = (voice->k2 & ~0xff00) | (data & 0xff00); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, K2=%04x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->k2); + fprintf(eslog, "%06x:voice %d, K2=%04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->k2); break; case 0x07: /* K1 */ @@ -1633,21 +1633,21 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo if (ACCESSING_BITS_8_15) voice->k1 = (voice->k1 & ~0xff00) | (data & 0xff00); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, K1=%04x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->k1); + fprintf(eslog, "%06x:voice %d, K1=%04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->k1); break; case 0x08: /* LVOL */ if (ACCESSING_BITS_8_15) voice->lvol = (voice->lvol & ~0xff00) | (data & 0xff00); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, left vol=%04x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->lvol); + fprintf(eslog, "%06x:voice %d, left vol=%04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->lvol); break; case 0x09: /* RVOL */ if (ACCESSING_BITS_8_15) voice->rvol = (voice->rvol & ~0xff00) | (data & 0xff00); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, right vol=%04x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->rvol); + fprintf(eslog, "%06x:voice %d, right vol=%04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->rvol); break; case 0x0a: /* ACC (hi) */ @@ -1656,7 +1656,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo if (ACCESSING_BITS_8_15) voice->accum = (voice->accum & ~0x7c000000) | ((data & 0x1f00) << 18); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, accum=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->accum); + fprintf(eslog, "%06x:voice %d, accum=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->accum); break; case 0x0b: /* ACC (lo) */ @@ -1665,7 +1665,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo if (ACCESSING_BITS_8_15) voice->accum = (voice->accum & ~0x0003fc00) | ((data & 0xff00) << 2); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, accum=%08x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->accum); + fprintf(eslog, "%06x:voice %d, accum=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->accum); break; case 0x0c: /* unused */ @@ -1712,7 +1712,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v ((data << 2) & (CONTROL_CA0 | CONTROL_CA1)); } if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, control=%04x (raw=%04x & %04x)\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->control, data, mem_mask); + fprintf(eslog, "%06x:voice %d, control=%04x (raw=%04x & %04x)\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->control, data, mem_mask); break; case 0x01: /* O4(n-1) */ @@ -1721,7 +1721,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v if (ACCESSING_BITS_8_15) voice->o4n1 = (INT16)((voice->o4n1 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, O4(n-1)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff); + fprintf(eslog, "%06x:voice %d, O4(n-1)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff); break; case 0x02: /* O3(n-1) */ @@ -1730,7 +1730,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v if (ACCESSING_BITS_8_15) voice->o3n1 = (INT16)((voice->o3n1 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, O3(n-1)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff); + fprintf(eslog, "%06x:voice %d, O3(n-1)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff); break; case 0x03: /* O3(n-2) */ @@ -1739,7 +1739,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v if (ACCESSING_BITS_8_15) voice->o3n2 = (INT16)((voice->o3n2 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, O3(n-2)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff); + fprintf(eslog, "%06x:voice %d, O3(n-2)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff); break; case 0x04: /* O2(n-1) */ @@ -1748,7 +1748,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v if (ACCESSING_BITS_8_15) voice->o2n1 = (INT16)((voice->o2n1 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, O2(n-1)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff); + fprintf(eslog, "%06x:voice %d, O2(n-1)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff); break; case 0x05: /* O2(n-2) */ @@ -1757,7 +1757,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v if (ACCESSING_BITS_8_15) voice->o2n2 = (INT16)((voice->o2n2 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, O2(n-2)=%05x\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff); + fprintf(eslog, "%06x:voice %d, O2(n-2)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff); break; case 0x06: /* O1(n-1) */ @@ -1766,7 +1766,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v if (ACCESSING_BITS_8_15) voice->o1n1 = (INT16)((voice->o1n1 & ~0xff00) | (data & 0xff00)); if (LOG_COMMANDS && eslog) - fprintf(eslog, "%06x:voice %d, O1(n-1)=%05x (accum=%08x)\n", activecpu_get_previouspc(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum); + fprintf(eslog, "%06x:voice %d, O1(n-1)=%05x (accum=%08x)\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum); break; case 0x07: @@ -1848,7 +1848,7 @@ static void es5505_reg_write(struct ES5506Chip *chip, offs_t offset, UINT16 data { struct ES5506Voice *voice = &chip->voice[chip->current_page & 0x1f]; -// logerror("%04x:ES5505 write %02x/%02x = %04x & %04x\n", activecpu_get_previouspc(), chip->current_page, offset, data, mem_mask); +// logerror("%04x:ES5505 write %02x/%02x = %04x & %04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page, offset, data, mem_mask); /* force an update */ stream_update(chip->stream); diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c index 9bbe2992207..6454472298f 100644 --- a/src/emu/sound/gaelco.c +++ b/src/emu/sound/gaelco.c @@ -190,7 +190,7 @@ static void gaelco_update(void *param, stream_sample_t **inputs, stream_sample_t READ16_HANDLER( gaelcosnd_r ) { - LOG_READ_WRITES(("%06x: (GAE1): read from %04x\n", activecpu_get_pc(), offset)); + LOG_READ_WRITES(("%06x: (GAE1): read from %04x\n", cpu_get_pc(machine->activecpu), offset)); return gaelco_sndregs[offset]; } @@ -204,7 +204,7 @@ WRITE16_HANDLER( gaelcosnd_w ) struct GAELCOSND *info = sndti_token(chip_type, 0); struct gaelcosnd_channel *channel = &info->channel[offset >> 3]; - LOG_READ_WRITES(("%06x: (GAE1): write %04x to %04x\n", activecpu_get_pc(), data, offset)); + LOG_READ_WRITES(("%06x: (GAE1): write %04x to %04x\n", cpu_get_pc(machine->activecpu), data, offset)); /* first update the stream to this point in time */ stream_update(info->stream); diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c index 4ad57d07483..611400667d7 100644 --- a/src/emu/sound/ics2115.c +++ b/src/emu/sound/ics2115.c @@ -68,7 +68,7 @@ struct ics2115{ static int caller_get_pc(void) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(Machine->activecpu); #if 0 if(pc == 0x14b || pc == 0x26e || pc == 0x284 || pc == 0x28d || pc == 0x290 || pc == 0x299 || pc == 0x2a2 || pc == 0x2b3) { diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c index fcd60be071e..9bea6513131 100644 --- a/src/emu/sound/k053260.c +++ b/src/emu/sound/k053260.c @@ -390,7 +390,7 @@ static UINT8 k053260_read( int chip, offs_t offset ) ic->channels[0].pos += ( 1 << 16 ); if ( offs > ic->rom_size ) { - logerror("%06x: K53260: Attempting to read past rom size in rom Read Mode (offs = %06x, size = %06x).\n",activecpu_get_pc(),offs,ic->rom_size ); + logerror("%06x: K53260: Attempting to read past rom size in rom Read Mode (offs = %06x, size = %06x).\n",cpu_get_pc(Machine->activecpu),offs,ic->rom_size ); return 0; } diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c index d19297c8591..8470303732d 100644 --- a/src/emu/sound/nes_apu.c +++ b/src/emu/sound/nes_apu.c @@ -601,7 +601,7 @@ INLINE void apu_update(struct nesapu_info *info, stream_sample_t *buffer16, int { int accum; - cpuintrf_push_context( info->APU.dpcm.cpu_num ); + cpu_push_context( Machine->cpu[info->APU.dpcm.cpu_num ]); while (samples--) { accum = apu_square(info, &info->APU.squ[0]); @@ -618,7 +618,7 @@ INLINE void apu_update(struct nesapu_info *info, stream_sample_t *buffer16, int *(buffer16++)=accum<<8; } - cpuintrf_pop_context(); + cpu_pop_context(); } /* READ VALUES FROM REGISTERS */ diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c index c30712f6a66..51dd8493e1b 100644 --- a/src/emu/sound/nile.c +++ b/src/emu/sound/nile.c @@ -74,7 +74,7 @@ WRITE16_HANDLER(nile_sndctrl_w) COMBINE_DATA(&info->ctrl); -// printf("CTRL: %04x -> %04x (PC=%x)\n", ctrl, info->ctrl, activecpu_get_pc()); +// printf("CTRL: %04x -> %04x (PC=%x)\n", ctrl, info->ctrl, cpu_get_pc(machine->activecpu)); ctrl^=info->ctrl; } @@ -129,7 +129,7 @@ WRITE16_HANDLER(nile_snd_w) info->vpos[v] = info->frac[v] = info->lponce[v] = 0; } -// printf("v%02d: %04x to reg %02d (PC=%x)\n", v, nile_sound_regs[offset], r, activecpu_get_pc()); +// printf("v%02d: %04x to reg %02d (PC=%x)\n", v, nile_sound_regs[offset], r, cpu_get_pc(machine->activecpu)); } static void nile_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int length) diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c index a26a45c312c..bec1f933c07 100644 --- a/src/emu/sound/pokey.c +++ b/src/emu/sound/pokey.c @@ -853,7 +853,7 @@ static int pokey_register_r(int chip, int offs) } } else - logerror("PC %04x: warning - read p[chip] #%d POT%d\n", activecpu_get_pc(), chip, pot); + logerror("PC %04x: warning - read p[chip] #%d POT%d\n", cpu_get_pc(Machine->activecpu), chip, pot); break; case ALLPOT_C: diff --git a/src/emu/sound/psx.c b/src/emu/sound/psx.c index 9c040286d1d..1d6f7cea720 100644 --- a/src/emu/sound/psx.c +++ b/src/emu/sound/psx.c @@ -26,7 +26,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } } diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c index 2ad9d0163cd..8ea1c47abf0 100644 --- a/src/emu/sound/rf5c400.c +++ b/src/emu/sound/rf5c400.c @@ -443,11 +443,11 @@ static void rf5c400_w(int chipnum, int offset, UINT16 data) default: { - //mame_printf_debug("rf5c400_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + //mame_printf_debug("rf5c400_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } - //mame_printf_debug("rf5c400_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + //mame_printf_debug("rf5c400_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); } else { diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c index a8e4273d204..3ef3ab0b9fe 100644 --- a/src/emu/sound/saa1099.c +++ b/src/emu/sound/saa1099.c @@ -67,6 +67,7 @@ #include "streams.h" #include "cpuintrf.h" #include "saa1099.h" +#include "deprecat.h" #include <math.h> @@ -333,7 +334,7 @@ static void saa1099_control_port_w( int chip, int reg, int data ) if ((data & 0xff) > 0x1c) { /* Error! */ - logerror("%04x: (SAA1099 #%d) Unknown register selected\n",activecpu_get_pc(), chip); + logerror("%04x: (SAA1099 #%d) Unknown register selected\n",cpu_get_pc(Machine->activecpu), chip); } saa->selected_reg = data & 0x1f; @@ -419,7 +420,7 @@ static void saa1099_write_port_w( int chip, int offset, int data ) int i; /* Synch & Reset generators */ - logerror("%04x: (SAA1099 #%d) -reg 0x1c- Chip reset\n",activecpu_get_pc(), chip); + logerror("%04x: (SAA1099 #%d) -reg 0x1c- Chip reset\n",cpu_get_pc(Machine->activecpu), chip); for (i = 0; i < 6; i++) { saa->channels[i].level = 0; @@ -428,7 +429,7 @@ static void saa1099_write_port_w( int chip, int offset, int data ) } break; default: /* Error! */ - logerror("%04x: (SAA1099 #%d) Unknown operation (reg:%02x, data:%02x)\n",activecpu_get_pc(), chip, reg, data); + logerror("%04x: (SAA1099 #%d) Unknown operation (reg:%02x, data:%02x)\n",cpu_get_pc(Machine->activecpu), chip, reg, data); } } diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c index e0d44ae2614..57dccdbe265 100644 --- a/src/emu/sound/x1_010.c +++ b/src/emu/sound/x1_010.c @@ -255,7 +255,7 @@ WRITE8_HANDLER( seta_sound_w ) info->smp_offset[channel] = 0; info->env_offset[channel] = 0; } - LOG_REGISTER_WRITE(("PC: %06X : offset %6X : data %2X\n", activecpu_get_pc(), offset, data )); + LOG_REGISTER_WRITE(("PC: %06X : offset %6X : data %2X\n", cpu_get_pc(machine->activecpu), offset, data )); info->reg[offset] = data; } @@ -271,7 +271,7 @@ READ16_HANDLER( seta_sound_word_r ) ret = info->HI_WORD_BUF[offset]<<8; ret += (seta_sound_r( machine, offset )&0xff); - LOG_REGISTER_READ(( "Read X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, ret )); + LOG_REGISTER_READ(( "Read X1-010 PC:%06X Offset:%04X Data:%04X\n", cpu_get_pc(machine->activecpu), offset, ret )); return ret; } @@ -280,7 +280,7 @@ WRITE16_HANDLER( seta_sound_word_w ) struct x1_010_info *info = sndti_token(SOUND_X1_010, 0); info->HI_WORD_BUF[offset] = (data>>8)&0xff; seta_sound_w( machine, offset, data&0xff ); - LOG_REGISTER_WRITE(( "Write X1-010 PC:%06X Offset:%04X Data:%04X\n", activecpu_get_pc(), offset, data )); + LOG_REGISTER_WRITE(( "Write X1-010 PC:%06X Offset:%04X Data:%04X\n", cpu_get_pc(machine->activecpu), offset, data )); } diff --git a/src/emu/timer.c b/src/emu/timer.c index d4fb794cde6..c5f400ec9c1 100644 --- a/src/emu/timer.c +++ b/src/emu/timer.c @@ -147,7 +147,7 @@ INLINE attotime get_current_time(void) return callback_timer_expire_time; /* if we're executing as a particular CPU, use its local time as a base */ - activecpu = cpu_getactivecpu(); + activecpu = cpunum_get_active(); if (activecpu >= 0) return cpunum_get_localtime(activecpu); @@ -734,7 +734,7 @@ void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, /* if this was inserted as the head, abort the current timeslice and resync */ LOG(("timer_adjust_oneshot %s.%s:%d to expire @ %s\n", which->file, which->func, which->line, attotime_string(which->expire, 9))); - if (which == timer_head && cpu_getexecutingcpu() >= 0) + if (which == timer_head && cpunum_get_executing() >= 0) activecpu_abort_timeslice(); } diff --git a/src/emu/video/cdp1869.c b/src/emu/video/cdp1869.c index d481f99224c..f254332b3ca 100644 --- a/src/emu/video/cdp1869.c +++ b/src/emu/video/cdp1869.c @@ -150,9 +150,9 @@ static STATE_POSTLOAD( cdp1869_state_save_postload ) /* CDP1802 X Register */ -static UINT16 cdp1802_get_r_x(void) +static UINT16 cdp1802_get_r_x(running_machine *machine) { - return activecpu_get_reg(CDP1802_R0 + activecpu_get_reg(CDP1802_X)); + return cpu_get_reg(machine->activecpu, CDP1802_R0 + cpu_get_reg(machine->activecpu, CDP1802_X)); } /* Palette Initialization */ @@ -383,7 +383,7 @@ WRITE8_DEVICE_HANDLER( cdp1869_out4_w ) { cdp1869_t *cdp1869 = get_safe_token(device); - UINT16 word = cdp1802_get_r_x(); + UINT16 word = cdp1802_get_r_x(device->machine); /* bit description @@ -422,7 +422,7 @@ WRITE8_DEVICE_HANDLER( cdp1869_out5_w ) { cdp1869_t *cdp1869 = get_safe_token(device); - UINT16 word = cdp1802_get_r_x(); + UINT16 word = cdp1802_get_r_x(device->machine); /* bit description @@ -479,7 +479,7 @@ WRITE8_DEVICE_HANDLER( cdp1869_out6_w ) { cdp1869_t *cdp1869 = get_safe_token(device); - UINT16 word = cdp1802_get_r_x(); + UINT16 word = cdp1802_get_r_x(device->machine); /* bit description @@ -509,7 +509,7 @@ WRITE8_DEVICE_HANDLER( cdp1869_out7_w ) { cdp1869_t *cdp1869 = get_safe_token(device); - UINT16 word = cdp1802_get_r_x(); + UINT16 word = cdp1802_get_r_x(device->machine); /* bit description diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c index a7fd139895a..43728789ec0 100644 --- a/src/emu/video/mc6845.c +++ b/src/emu/video/mc6845.c @@ -189,7 +189,7 @@ WRITE8_DEVICE_HANDLER( mc6845_register_w ) { mc6845_t *mc6845 = get_safe_token(device); - if (LOG) logerror("M6845 PC %04x: reg 0x%02x = 0x%02x\n", activecpu_get_pc(), mc6845->register_address_latch, data); + if (LOG) logerror("M6845 PC %04x: reg 0x%02x = 0x%02x\n", cpu_get_pc(device->machine->activecpu), mc6845->register_address_latch, data); switch (mc6845->register_address_latch) { diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c index bccbdecf932..18062fa8c08 100644 --- a/src/emu/video/tms34061.c +++ b/src/emu/video/tms34061.c @@ -11,6 +11,7 @@ ****************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "tms34061.h" @@ -186,7 +187,7 @@ static void register_w(offs_t offset, UINT8 data) } /* log it */ - if (VERBOSE) logerror("%04X:tms34061 %s = %04x\n", activecpu_get_pc(), regnames[regnum], tms34061.regs[regnum]); + if (VERBOSE) logerror("%04X:tms34061 %s = %04x\n", cpu_get_pc(Machine->activecpu), regnames[regnum], tms34061.regs[regnum]); /* update the state of things */ switch (regnum) @@ -264,7 +265,7 @@ static UINT8 register_r(offs_t offset) } /* log it */ - if (VERBOSE) logerror("%04X:tms34061 %s read = %04X\n", activecpu_get_pc(), regnames[regnum], result); + if (VERBOSE) logerror("%04X:tms34061 %s read = %04X\n", cpu_get_pc(Machine->activecpu), regnames[regnum], result); return (offset & 0x02) ? (result >> 8) : result; } @@ -371,7 +372,7 @@ static void xypixel_w(int offset, UINT8 data) /* mask to the VRAM size */ pixeloffs &= tms34061.vrammask; - if (VERBOSE) logerror("%04X:tms34061 xy (%04x) = %02x/%02x\n", activecpu_get_pc(), pixeloffs, data, tms34061.latchdata); + if (VERBOSE) logerror("%04X:tms34061 xy (%04x) = %02x/%02x\n", cpu_get_pc(Machine->activecpu), pixeloffs, data, tms34061.latchdata); /* set the pixel data */ tms34061.vram[pixeloffs] = data; @@ -427,7 +428,7 @@ void tms34061_w(int col, int row, int func, UINT8 data) offs = ((row << tms34061.intf.rowshift) | col) & tms34061.vrammask; if (tms34061.regs[TMS34061_CONTROL2] & 0x0040) offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16; - if (VERBOSE) logerror("%04X:tms34061 direct (%04x) = %02x/%02x\n", activecpu_get_pc(), offs, data, tms34061.latchdata); + if (VERBOSE) logerror("%04X:tms34061 direct (%04x) = %02x/%02x\n", cpu_get_pc(Machine->activecpu), offs, data, tms34061.latchdata); if (tms34061.vram[offs] != data || tms34061.latchram[offs] != tms34061.latchdata) { tms34061.vram[offs] = data; @@ -441,7 +442,7 @@ void tms34061_w(int col, int row, int func, UINT8 data) if (tms34061.regs[TMS34061_CONTROL2] & 0x0040) offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16; offs &= tms34061.vrammask; - if (VERBOSE) logerror("%04X:tms34061 shiftreg write (%04x)\n", activecpu_get_pc(), offs); + if (VERBOSE) logerror("%04X:tms34061 shiftreg write (%04x)\n", cpu_get_pc(Machine->activecpu), offs); memcpy(&tms34061.vram[offs], tms34061.shiftreg, (size_t)1 << tms34061.intf.rowshift); memset(&tms34061.latchram[offs], tms34061.latchdata, (size_t)1 << tms34061.intf.rowshift); @@ -453,14 +454,14 @@ void tms34061_w(int col, int row, int func, UINT8 data) if (tms34061.regs[TMS34061_CONTROL2] & 0x0040) offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16; offs &= tms34061.vrammask; - if (VERBOSE) logerror("%04X:tms34061 shiftreg read (%04x)\n", activecpu_get_pc(), offs); + if (VERBOSE) logerror("%04X:tms34061 shiftreg read (%04x)\n", cpu_get_pc(Machine->activecpu), offs); tms34061.shiftreg = &tms34061.vram[offs]; break; /* log anything else */ default: - logerror("Unsupported TMS34061 function %d - PC: %04X\n", func, activecpu_get_pc()); + logerror("Unsupported TMS34061 function %d - PC: %04X\n", func, cpu_get_pc(Machine->activecpu)); break; } } @@ -515,7 +516,7 @@ UINT8 tms34061_r(int col, int row, int func) /* log anything else */ default: logerror("Unsupported TMS34061 function %d - PC: %04X\n", - func, activecpu_get_pc()); + func, cpu_get_pc(Machine->activecpu)); break; } diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c index a05f7b7bbf7..545b859d929 100644 --- a/src/emu/video/voodoo.c +++ b/src/emu/video/voodoo.c @@ -3752,7 +3752,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset) /* don't log multiple identical status reads from the same address */ if (regnum == status) { - offs_t pc = activecpu_get_pc(); + offs_t pc = cpu_get_pc(v->device->machine->activecpu); if (pc == v->last_status_pc && result == v->last_status_value) logit = FALSE; v->last_status_pc = pc; @@ -3935,7 +3935,7 @@ static READ32_DEVICE_HANDLER( banshee_agp_r ) } if (LOG_REGISTERS) - logerror("%08X:banshee_r(AGP:%s)\n", activecpu_get_pc(), banshee_agp_reg_name[offset]); + logerror("%08X:banshee_r(AGP:%s)\n", cpu_get_pc(v->device->machine->activecpu), banshee_agp_reg_name[offset]); return result; } @@ -3954,15 +3954,15 @@ READ32_DEVICE_HANDLER( banshee_r ) else if (offset < 0x100000/4) result = banshee_agp_r(device, offset, mem_mask); else if (offset < 0x200000/4) - logerror("%08X:banshee_r(2D:%X)\n", activecpu_get_pc(), (offset*4) & 0xfffff); + logerror("%08X:banshee_r(2D:%X)\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0xfffff); else if (offset < 0x600000/4) result = register_r(v, offset & 0x1fffff/4); else if (offset < 0x800000/4) - logerror("%08X:banshee_r(TEX:%X)\n", activecpu_get_pc(), (offset*4) & 0x1fffff); + logerror("%08X:banshee_r(TEX:%X)\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x1fffff); else if (offset < 0xc00000/4) - logerror("%08X:banshee_r(RES:%X)\n", activecpu_get_pc(), (offset*4) & 0x3fffff); + logerror("%08X:banshee_r(RES:%X)\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x3fffff); else if (offset < 0x1000000/4) - logerror("%08X:banshee_r(YUV:%X)\n", activecpu_get_pc(), (offset*4) & 0x3fffff); + logerror("%08X:banshee_r(YUV:%X)\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x3fffff); else if (offset < 0x2000000/4) { UINT8 temp = v->fbi.lfb_stride; @@ -3985,7 +3985,7 @@ READ32_DEVICE_HANDLER( banshee_fb_r ) if (offset < v->fbi.lfb_base) { - logerror("%08X:banshee_fb_r(%X)\n", activecpu_get_pc(), offset*4); + logerror("%08X:banshee_fb_r(%X)\n", cpu_get_pc(device->machine->activecpu), offset*4); if (offset*4 <= v->fbi.mask) result = ((UINT32 *)v->fbi.ram)[offset]; } @@ -4010,7 +4010,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att)) result = v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]]; if (LOG_REGISTERS) - logerror("%08X:banshee_att_r(%X)\n", activecpu_get_pc(), v->banshee.vga[0x3c1 & 0x1f]); + logerror("%08X:banshee_att_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3c1 & 0x1f]); break; /* Input status 0 */ @@ -4023,7 +4023,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) */ result = 0x00; if (LOG_REGISTERS) - logerror("%08X:banshee_vga_r(%X)\n", activecpu_get_pc(), 0x300+offset); + logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset); break; /* Sequencer access */ @@ -4031,7 +4031,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq)) result = v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]]; if (LOG_REGISTERS) - logerror("%08X:banshee_seq_r(%X)\n", activecpu_get_pc(), v->banshee.vga[0x3c4 & 0x1f]); + logerror("%08X:banshee_seq_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3c4 & 0x1f]); break; /* Feature control */ @@ -4039,14 +4039,14 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) result = v->banshee.vga[0x3da & 0x1f]; v->banshee.attff = 0; if (LOG_REGISTERS) - logerror("%08X:banshee_vga_r(%X)\n", activecpu_get_pc(), 0x300+offset); + logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset); break; /* Miscellaneous output */ case 0x3cc: result = v->banshee.vga[0x3c2 & 0x1f]; if (LOG_REGISTERS) - logerror("%08X:banshee_vga_r(%X)\n", activecpu_get_pc(), 0x300+offset); + logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset); break; /* Graphics controller access */ @@ -4054,7 +4054,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc)) result = v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]]; if (LOG_REGISTERS) - logerror("%08X:banshee_gc_r(%X)\n", activecpu_get_pc(), v->banshee.vga[0x3ce & 0x1f]); + logerror("%08X:banshee_gc_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3ce & 0x1f]); break; /* CRTC access */ @@ -4062,7 +4062,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc)) result = v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]]; if (LOG_REGISTERS) - logerror("%08X:banshee_crtc_r(%X)\n", activecpu_get_pc(), v->banshee.vga[0x3d4 & 0x1f]); + logerror("%08X:banshee_crtc_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3d4 & 0x1f]); break; /* Input status 1 */ @@ -4078,13 +4078,13 @@ static READ8_DEVICE_HANDLER( banshee_vga_r ) */ result = 0x04; if (LOG_REGISTERS) - logerror("%08X:banshee_vga_r(%X)\n", activecpu_get_pc(), 0x300+offset); + logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset); break; default: result = v->banshee.vga[offset]; if (LOG_REGISTERS) - logerror("%08X:banshee_vga_r(%X)\n", activecpu_get_pc(), 0x300+offset); + logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset); break; } return result; @@ -4108,7 +4108,7 @@ READ32_DEVICE_HANDLER( banshee_io_r ) case io_dacData: result = v->fbi.clut[v->banshee.io[io_dacAddr] & 0x1ff] = v->banshee.io[offset]; if (LOG_REGISTERS) - logerror("%08X:banshee_dac_r(%X)\n", activecpu_get_pc(), v->banshee.io[io_dacAddr] & 0x1ff); + logerror("%08X:banshee_dac_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.io[io_dacAddr] & 0x1ff); break; case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc: @@ -4128,7 +4128,7 @@ READ32_DEVICE_HANDLER( banshee_io_r ) default: result = v->banshee.io[offset]; if (LOG_REGISTERS) - logerror("%08X:banshee_io_r(%s)\n", activecpu_get_pc(), banshee_io_reg_name[offset]); + logerror("%08X:banshee_io_r(%s)\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset]); break; } @@ -4138,7 +4138,7 @@ READ32_DEVICE_HANDLER( banshee_io_r ) READ32_DEVICE_HANDLER( banshee_rom_r ) { - logerror("%08X:banshee_rom_r(%X)\n", activecpu_get_pc(), offset*4); + logerror("%08X:banshee_rom_r(%X)\n", cpu_get_pc(device->machine->activecpu), offset*4); return 0xffffffff; } @@ -4232,7 +4232,7 @@ static WRITE32_DEVICE_HANDLER( banshee_agp_w ) } if (LOG_REGISTERS) - logerror("%08X:banshee_w(AGP:%s) = %08X & %08X\n", activecpu_get_pc(), banshee_agp_reg_name[offset], data, mem_mask); + logerror("%08X:banshee_w(AGP:%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_agp_reg_name[offset], data, mem_mask); } @@ -4249,15 +4249,15 @@ WRITE32_DEVICE_HANDLER( banshee_w ) else if (offset < 0x100000/4) banshee_agp_w(device, offset, data, mem_mask); else if (offset < 0x200000/4) - logerror("%08X:banshee_w(2D:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0xfffff, data, mem_mask); + logerror("%08X:banshee_w(2D:%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0xfffff, data, mem_mask); else if (offset < 0x600000/4) register_w(v, offset & 0x1fffff/4, data); else if (offset < 0x800000/4) - logerror("%08X:banshee_w(TEX:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x1fffff, data, mem_mask); + logerror("%08X:banshee_w(TEX:%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x1fffff, data, mem_mask); else if (offset < 0xc00000/4) - logerror("%08X:banshee_w(RES:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x3fffff, data, mem_mask); + logerror("%08X:banshee_w(RES:%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x3fffff, data, mem_mask); else if (offset < 0x1000000/4) - logerror("%08X:banshee_w(YUV:%X) = %08X & %08X\n", activecpu_get_pc(), (offset*4) & 0x3fffff, data, mem_mask); + logerror("%08X:banshee_w(YUV:%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x3fffff, data, mem_mask); else if (offset < 0x2000000/4) { UINT8 temp = v->fbi.lfb_stride; @@ -4287,7 +4287,7 @@ WRITE32_DEVICE_HANDLER( banshee_fb_w ) { if (offset*4 <= v->fbi.mask) COMBINE_DATA(&((UINT32 *)v->fbi.ram)[offset]); - logerror("%08X:banshee_fb_w(%X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + logerror("%08X:banshee_fb_w(%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), offset*4, data, mem_mask); } } else @@ -4310,14 +4310,14 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w ) { v->banshee.vga[0x3c1 & 0x1f] = data; if (LOG_REGISTERS) - logerror("%08X:banshee_vga_w(%X) = %02X\n", activecpu_get_pc(), 0x3c0+offset, data); + logerror("%08X:banshee_vga_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), 0x3c0+offset, data); } else { if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att)) v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]] = data; if (LOG_REGISTERS) - logerror("%08X:banshee_att_w(%X) = %02X\n", activecpu_get_pc(), v->banshee.vga[0x3c1 & 0x1f], data); + logerror("%08X:banshee_att_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3c1 & 0x1f], data); } v->banshee.attff ^= 1; break; @@ -4327,7 +4327,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w ) if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq)) v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]] = data; if (LOG_REGISTERS) - logerror("%08X:banshee_seq_w(%X) = %02X\n", activecpu_get_pc(), v->banshee.vga[0x3c4 & 0x1f], data); + logerror("%08X:banshee_seq_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3c4 & 0x1f], data); break; /* Graphics controller access */ @@ -4335,7 +4335,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w ) if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc)) v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]] = data; if (LOG_REGISTERS) - logerror("%08X:banshee_gc_w(%X) = %02X\n", activecpu_get_pc(), v->banshee.vga[0x3ce & 0x1f], data); + logerror("%08X:banshee_gc_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3ce & 0x1f], data); break; /* CRTC access */ @@ -4343,13 +4343,13 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w ) if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc)) v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]] = data; if (LOG_REGISTERS) - logerror("%08X:banshee_crtc_w(%X) = %02X\n", activecpu_get_pc(), v->banshee.vga[0x3d4 & 0x1f], data); + logerror("%08X:banshee_crtc_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3d4 & 0x1f], data); break; default: v->banshee.vga[offset] = data; if (LOG_REGISTERS) - logerror("%08X:banshee_vga_w(%X) = %02X\n", activecpu_get_pc(), 0x3c0+offset, data); + logerror("%08X:banshee_vga_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), 0x3c0+offset, data); break; } } @@ -4371,7 +4371,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) if ((v->banshee.io[offset] ^ old) & 0x2800) v->fbi.clut_dirty = TRUE; if (LOG_REGISTERS) - logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask); + logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask); break; case io_dacData: @@ -4382,14 +4382,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) v->fbi.clut_dirty = TRUE; } if (LOG_REGISTERS) - logerror("%08X:banshee_dac_w(%X) = %08X & %08X\n", activecpu_get_pc(), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask); + logerror("%08X:banshee_dac_w(%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask); break; case io_miscInit0: COMBINE_DATA(&v->banshee.io[offset]); v->fbi.yorigin = (data >> 18) & 0xfff; if (LOG_REGISTERS) - logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask); + logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask); break; case io_vidScreenSize: @@ -4403,14 +4403,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) video_screen_set_visarea(v->screen, 0, v->fbi.width - 1, 0, v->fbi.height - 1); adjust_vblank_timer(v); if (LOG_REGISTERS) - logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask); + logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask); break; case io_lfbMemoryConfig: v->fbi.lfb_base = (data & 0x1fff) << 10; v->fbi.lfb_stride = ((data >> 13) & 7) + 9; if (LOG_REGISTERS) - logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask); + logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask); break; case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc: @@ -4429,7 +4429,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) default: COMBINE_DATA(&v->banshee.io[offset]); if (LOG_REGISTERS) - logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", activecpu_get_pc(), banshee_io_reg_name[offset], data, mem_mask); + logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask); break; } } diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c index c0309e52087..0a723cfa0f1 100644 --- a/src/mame/audio/cage.c +++ b/src/mame/audio/cage.c @@ -193,7 +193,7 @@ void cage_set_irq_handler(void (*irqhandler)(running_machine *, int)) void cage_reset_w(int state) { if (state) - cage_control_w(0); + cage_control_w(Machine, 0); cpunum_set_input_line(Machine, cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); } @@ -381,7 +381,7 @@ static READ32_HANDLER( tms32031_io_r ) } if (LOG_32031_IOPORTS) - logerror("CAGE:%06X:%s read -> %08X\n", activecpu_get_pc(), register_names[offset & 0x7f], result); + logerror("CAGE:%06X:%s read -> %08X\n", cpu_get_pc(machine->activecpu), register_names[offset & 0x7f], result); return result; } @@ -391,7 +391,7 @@ static WRITE32_HANDLER( tms32031_io_w ) COMBINE_DATA(&tms32031_io_regs[offset]); if (LOG_32031_IOPORTS) - logerror("CAGE:%06X:%s write = %08X\n", activecpu_get_pc(), register_names[offset & 0x7f], tms32031_io_regs[offset]); + logerror("CAGE:%06X:%s write = %08X\n", cpu_get_pc(machine->activecpu), register_names[offset & 0x7f], tms32031_io_regs[offset]); switch (offset) { @@ -443,7 +443,7 @@ static WRITE32_HANDLER( tms32031_io_w ) * *************************************/ -static void update_control_lines(void) +static void update_control_lines(running_machine *machine) { int val; @@ -461,22 +461,22 @@ static void update_control_lines(void) } /* set the IOF input lines */ - cpuintrf_push_context(cage_cpu); - val = activecpu_get_reg(TMS32031_IOF); + cpu_push_context(machine->cpu[cage_cpu]); + val = cpu_get_reg(machine->activecpu, TMS32031_IOF); val &= ~0x88; if (cpu_to_cage_ready) val |= 0x08; if (cage_to_cpu_ready) val |= 0x80; - activecpu_set_reg(TMS32031_IOF, val); - cpuintrf_pop_context(); + cpu_set_reg(machine->activecpu, TMS32031_IOF, val); + cpu_pop_context(); } static READ32_HANDLER( cage_from_main_r ) { if (LOG_COMM) - logerror("%06X:CAGE read command = %04X\n", activecpu_get_pc(), cage_from_main); + logerror("%06X:CAGE read command = %04X\n", cpu_get_pc(machine->activecpu), cage_from_main); cpu_to_cage_ready = 0; - update_control_lines(); + update_control_lines(machine); cpunum_set_input_line(machine, cage_cpu, TMS32031_IRQ0, CLEAR_LINE); return cage_from_main; } @@ -485,17 +485,17 @@ static READ32_HANDLER( cage_from_main_r ) static WRITE32_HANDLER( cage_from_main_ack_w ) { if (LOG_COMM) - logerror("%06X:CAGE ack command = %04X\n", activecpu_get_pc(), cage_from_main); + logerror("%06X:CAGE ack command = %04X\n", cpu_get_pc(machine->activecpu), cage_from_main); } static WRITE32_HANDLER( cage_to_main_w ) { if (LOG_COMM) - logerror("%06X:Data from CAGE = %04X\n", activecpu_get_pc(), data); + logerror("%06X:Data from CAGE = %04X\n", cpu_get_pc(machine->activecpu), data); soundlatch_word_w(machine, 0, data, mem_mask); cage_to_cpu_ready = 1; - update_control_lines(); + update_control_lines(machine); } @@ -513,9 +513,9 @@ static READ32_HANDLER( cage_io_status_r ) UINT16 main_from_cage_r(void) { if (LOG_COMM) - logerror("%06X:main read data = %04X\n", activecpu_get_pc(), soundlatch_word_r(Machine, 0, 0)); + logerror("%06X:main read data = %04X\n", cpu_get_pc(Machine->activecpu), soundlatch_word_r(Machine, 0, 0)); cage_to_cpu_ready = 0; - update_control_lines(); + update_control_lines(Machine); return soundlatch_word_r(Machine, 0, 0xffff); } @@ -524,7 +524,7 @@ static TIMER_CALLBACK( deferred_cage_w ) { cage_from_main = param; cpu_to_cage_ready = 1; - update_control_lines(); + update_control_lines(machine); cpunum_set_input_line(machine, cage_cpu, TMS32031_IRQ0, ASSERT_LINE); } @@ -532,7 +532,7 @@ static TIMER_CALLBACK( deferred_cage_w ) void main_to_cage_w(UINT16 data) { if (LOG_COMM) - logerror("%06X:Command to CAGE = %04X\n", activecpu_get_pc(), data); + logerror("%06X:Command to CAGE = %04X\n", cpu_get_pc(Machine->activecpu), data); timer_call_after_resynch(NULL, data, deferred_cage_w); } @@ -550,7 +550,7 @@ UINT16 cage_control_r(void) } -void cage_control_w(UINT16 data) +void cage_control_w(running_machine *machine, UINT16 data) { cage_control = data; @@ -577,7 +577,7 @@ void cage_control_w(UINT16 data) cpunum_set_input_line(Machine, cage_cpu, INPUT_LINE_RESET, CLEAR_LINE); /* update the control state */ - update_control_lines(); + update_control_lines(machine); } diff --git a/src/mame/audio/cage.h b/src/mame/audio/cage.h index a2731d6de45..712520b203e 100644 --- a/src/mame/audio/cage.h +++ b/src/mame/audio/cage.h @@ -17,4 +17,4 @@ void cage_reset_w(int state); UINT16 main_from_cage_r(void); UINT16 cage_control_r(void); void main_to_cage_w(UINT16 data); -void cage_control_w(UINT16 data); +void cage_control_w(running_machine *machine, UINT16 data); diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c index d5d5056080f..a5f59484783 100644 --- a/src/mame/audio/cinemat.c +++ b/src/mame/audio/cinemat.c @@ -1591,7 +1591,7 @@ MACHINE_DRIVER_END static WRITE8_HANDLER( qb3_sound_w ) { - UINT16 rega = cpunum_get_reg(0, CCPU_A); + UINT16 rega = cpu_get_reg(machine->cpu[0], CCPU_A); demon_sound_w(0x00 | (~rega & 0x0f), 0x10); } diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c index 55ab3f6ebd8..d0d85fac166 100644 --- a/src/mame/audio/dcs.c +++ b/src/mame/audio/dcs.c @@ -904,7 +904,7 @@ static void dcs_register_state(void) } -void dcs_init(void) +void dcs_init(running_machine *machine) { memset(&dcs, 0, sizeof(dcs)); dcs_sram = NULL; @@ -915,8 +915,8 @@ void dcs_init(void) dcs.channels = 1; /* initialize the ADSP Tx and timer callbacks */ - cpunum_set_info_fct(dcs.cpunum, CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)sound_tx_callback); - cpunum_set_info_fct(dcs.cpunum, CPUINFO_PTR_ADSP2100_TIMER_HANDLER, (genf *)timer_enable_callback); + cpu_set_info_fct(machine->cpu[dcs.cpunum], CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)sound_tx_callback); + cpu_set_info_fct(machine->cpu[dcs.cpunum], CPUINFO_PTR_ADSP2100_TIMER_HANDLER, (genf *)timer_enable_callback); /* configure boot and sound ROMs */ dcs.bootrom = (UINT16 *)memory_region(Machine, "dcs"); @@ -966,8 +966,8 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset) dcs.channels = 2; /* initialize the ADSP Tx and timer callbacks */ - cpunum_set_info_fct(dcs.cpunum, CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)sound_tx_callback); - cpunum_set_info_fct(dcs.cpunum, CPUINFO_PTR_ADSP2100_TIMER_HANDLER, (genf *)timer_enable_callback); + cpu_set_info_fct(machine->cpu[dcs.cpunum], CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)sound_tx_callback); + cpu_set_info_fct(machine->cpu[dcs.cpunum], CPUINFO_PTR_ADSP2100_TIMER_HANDLER, (genf *)timer_enable_callback); /* always boot from the base of "dcs" */ dcs.bootrom = (UINT16 *)memory_region(machine, "dcs"); @@ -1407,19 +1407,19 @@ static WRITE16_HANDLER( denver_w ) WRITE32_HANDLER( dsio_idma_addr_w ) { if (LOG_DCS_TRANSFERS) - logerror("%08X:IDMA_addr = %04X\n", activecpu_get_pc(), data); - cpuintrf_push_context(dcs.cpunum); + logerror("%08X:IDMA_addr = %04X\n", cpu_get_pc(machine->activecpu), data); + cpu_push_context(machine->cpu[dcs.cpunum]); adsp2181_idma_addr_w(data); if (data == 0) dsio.start_on_next_write = 2; - cpuintrf_pop_context(); + cpu_pop_context(); } WRITE32_HANDLER( dsio_idma_data_w ) { - UINT32 pc = activecpu_get_pc(); - cpuintrf_push_context(dcs.cpunum); + UINT32 pc = cpu_get_pc(machine->activecpu); + cpu_push_context(machine->cpu[dcs.cpunum]); if (ACCESSING_BITS_0_15) { if (LOG_DCS_TRANSFERS) @@ -1432,7 +1432,7 @@ WRITE32_HANDLER( dsio_idma_data_w ) logerror("%08X:IDMA_data_w(%04X) = %04X\n", pc, adsp2181_idma_addr_r(), data >> 16); adsp2181_idma_data_w(data >> 16); } - cpuintrf_pop_context(); + cpu_pop_context(); if (dsio.start_on_next_write && --dsio.start_on_next_write == 0) { logerror("Starting DSIO CPU\n"); @@ -1444,11 +1444,11 @@ WRITE32_HANDLER( dsio_idma_data_w ) READ32_HANDLER( dsio_idma_data_r ) { UINT32 result; - cpuintrf_push_context(dcs.cpunum); + cpu_push_context(machine->cpu[dcs.cpunum]); result = adsp2181_idma_data_r(); - cpuintrf_pop_context(); + cpu_pop_context(); if (LOG_DCS_TRANSFERS) - logerror("%08X:IDMA_data_r(%04X) = %04X\n", activecpu_get_pc(), adsp2181_idma_addr_r(), result); + logerror("%08X:IDMA_data_r(%04X) = %04X\n", cpu_get_pc(machine->activecpu), adsp2181_idma_addr_r(), result); return result; } @@ -1486,7 +1486,7 @@ void dcs_reset_w(int state) /* going high halts the CPU */ if (state) { - logerror("%08x: DCS reset = %d\n", safe_activecpu_get_pc(), state); + logerror("%08x: DCS reset = %d\n", safe_cpu_get_pc(Machine->activecpu), state); /* just run through the init code again */ timer_call_after_resynch(NULL, 0, dcs_reset); @@ -1531,7 +1531,7 @@ static READ16_HANDLER( fifo_input_r ) static void dcs_delayed_data_w(running_machine *machine, int data) { if (LOG_DCS_IO) - logerror("%08X:dcs_data_w(%04X)\n", activecpu_get_pc(), data); + logerror("%08X:dcs_data_w(%04X)\n", cpu_get_pc(machine->activecpu), data); /* boost the interleave temporarily */ cpu_boost_interleave(machine, ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5)); @@ -1583,7 +1583,7 @@ static READ16_HANDLER( input_latch_r ) if (dcs.auto_ack) input_latch_ack_w(machine,0,0,0xffff); if (LOG_DCS_IO) - logerror("%08X:input_latch_r(%04X)\n", activecpu_get_pc(), dcs.input_data); + logerror("%08X:input_latch_r(%04X)\n", cpu_get_pc(machine->activecpu), dcs.input_data); return dcs.input_data; } @@ -1605,7 +1605,7 @@ static TIMER_CALLBACK( latch_delayed_w ) static WRITE16_HANDLER( output_latch_w ) { if (LOG_DCS_IO) - logerror("%08X:output_latch_w(%04X) (empty=%d)\n", activecpu_get_pc(), data, IS_OUTPUT_EMPTY()); + logerror("%08X:output_latch_w(%04X) (empty=%d)\n", cpu_get_pc(machine->activecpu), data, IS_OUTPUT_EMPTY()); timer_call_after_resynch(NULL, data, latch_delayed_w); } @@ -1637,7 +1637,7 @@ int dcs_data_r(void) delayed_ack_w(); if (LOG_DCS_IO) - logerror("%08X:dcs_data_r(%04X)\n", activecpu_get_pc(), dcs.output_data); + logerror("%08X:dcs_data_r(%04X)\n", cpu_get_pc(Machine->activecpu), dcs.output_data); return dcs.output_data; } @@ -1659,7 +1659,7 @@ static TIMER_CALLBACK( output_control_delayed_w ) static WRITE16_HANDLER( output_control_w ) { if (LOG_DCS_IO) - logerror("%04X:output_control = %04X\n", activecpu_get_pc(), data); + logerror("%04X:output_control = %04X\n", cpu_get_pc(machine->activecpu), data); timer_call_after_resynch(NULL, data, output_control_delayed_w); } @@ -1746,7 +1746,7 @@ static void reset_timer(void) { /* Road Burners: @ 28: JMP $0032 18032F, same code at $32 */ - cpuintrf_push_context(dcs.cpunum); + cpu_push_context(Machine->cpu[dcs.cpunum]); if (program_read_dword(0x18*4) == 0x0c0030 && /* ENA SEC_REG */ program_read_dword(0x19*4) == 0x804828 && /* SI = DM($0482) */ program_read_dword(0x1a*4) == 0x904828 && /* DM($0482) = SI */ @@ -1755,7 +1755,7 @@ static void reset_timer(void) { dcs.timer_ignore = TRUE; } - cpuintrf_pop_context(); + cpu_pop_context(); } /* adjust the timer if not optimized */ @@ -1844,7 +1844,7 @@ static WRITE16_HANDLER( adsp_control_w ) /* bit 9 forces a reset */ if (data & 0x0200) { - logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", activecpu_get_pc()); + logerror("%04X:Rebooting DCS due to SYSCONTROL write\n", cpu_get_pc(machine->activecpu)); cpunum_set_input_line(machine, dcs.cpunum, INPUT_LINE_RESET, PULSE_LINE); dcs_boot(); dcs.control_regs[SYSCONTROL_REG] = 0; @@ -1912,7 +1912,7 @@ static WRITE16_HANDLER( adsp_control_w ) static TIMER_CALLBACK( dcs_irq ) { /* get the index register */ - int reg = cpunum_get_reg(dcs.cpunum, ADSP2100_I0 + dcs.ireg); + int reg = cpu_get_reg(machine->cpu[dcs.cpunum], ADSP2100_I0 + dcs.ireg); /* copy the current data into the buffer */ { @@ -1920,13 +1920,13 @@ static TIMER_CALLBACK( dcs_irq ) INT16 buffer[0x400]; int i; - cpuintrf_push_context(dcs.cpunum); + cpu_push_context(machine->cpu[dcs.cpunum]); for (i = 0; i < count; i++) { buffer[i] = data_read_word_16le(reg * 2); reg += dcs.incs; } - cpuintrf_pop_context(); + cpu_pop_context(); if (dcs.channels) dmadac_transfer(0, dcs.channels, 1, dcs.channels, (dcs.size / 2) / dcs.channels, buffer); @@ -1943,7 +1943,7 @@ static TIMER_CALLBACK( dcs_irq ) } /* store it */ - cpunum_set_reg(dcs.cpunum, ADSP2100_I0 + dcs.ireg, reg); + cpu_set_reg(machine->cpu[dcs.cpunum], ADSP2100_I0 + dcs.ireg, reg); } @@ -2002,15 +2002,15 @@ static void sound_tx_callback(int port, INT32 data) /* now get the register contents in a more legible format */ /* we depend on register indexes to be continuous (wich is the case in our core) */ - source = cpunum_get_reg(dcs.cpunum, ADSP2100_I0 + dcs.ireg); - dcs.incs = cpunum_get_reg(dcs.cpunum, ADSP2100_M0 + mreg); - dcs.size = cpunum_get_reg(dcs.cpunum, ADSP2100_L0 + lreg); + source = cpu_get_reg(Machine->cpu[dcs.cpunum], ADSP2100_I0 + dcs.ireg); + dcs.incs = cpu_get_reg(Machine->cpu[dcs.cpunum], ADSP2100_M0 + mreg); + dcs.size = cpu_get_reg(Machine->cpu[dcs.cpunum], ADSP2100_L0 + lreg); /* get the base value, since we need to keep it around for wrapping */ source -= dcs.incs; /* make it go back one so we dont lose the first sample */ - cpunum_set_reg(dcs.cpunum, ADSP2100_I0 + dcs.ireg, source); + cpu_set_reg(Machine->cpu[dcs.cpunum], ADSP2100_I0 + dcs.ireg, source); /* save it as it is now */ dcs.ireg_base = source; @@ -2116,7 +2116,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data) if (data == 0x001a) { if (LOG_DCS_TRANSFERS) - logerror("%08X:DCS Transfer command %04X\n", activecpu_get_pc(), data); + logerror("%08X:DCS Transfer command %04X\n", cpu_get_pc(machine->activecpu), data); transfer.state++; if (transfer.hle_enabled) return 1; @@ -2126,7 +2126,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data) else if (data == 0x002a) { if (LOG_DCS_TRANSFERS) - logerror("%08X:DCS State change %04X\n", activecpu_get_pc(), data); + logerror("%08X:DCS State change %04X\n", cpu_get_pc(machine->activecpu), data); transfer.dcs_state = 1; } @@ -2207,7 +2207,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data) if (transfer.hle_enabled) { /* write the new data to memory */ - cpuintrf_push_context(dcs.cpunum); + cpu_push_context(machine->cpu[dcs.cpunum]); if (transfer.type == 0) { if (transfer.writes_left & 1) @@ -2217,7 +2217,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data) } else data_write_word(transfer.start++ * 2, data); - cpuintrf_pop_context(); + cpu_pop_context(); /* if we're done, start a timer to send the response words */ if (transfer.state == 0) @@ -2252,7 +2252,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data) if (data == 0x55d0 || data == 0x55d1) { if (LOG_DCS_TRANSFERS) - logerror("%08X:DCS Transfer command %04X\n", activecpu_get_pc(), data); + logerror("%08X:DCS Transfer command %04X\n", cpu_get_pc(machine->activecpu), data); transfer.state++; if (transfer.hle_enabled) return 1; @@ -2262,7 +2262,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data) else { if (LOG_DCS_TRANSFERS) - logerror("%08X:Command: %04X\n", activecpu_get_pc(), data); + logerror("%08X:Command: %04X\n", cpu_get_pc(machine->activecpu), data); } break; diff --git a/src/mame/audio/dcs.h b/src/mame/audio/dcs.h index 6f005742869..6d9b7a77ba7 100644 --- a/src/mame/audio/dcs.h +++ b/src/mame/audio/dcs.h @@ -12,7 +12,7 @@ MACHINE_DRIVER_EXTERN( dcs2_audio_2104 ); MACHINE_DRIVER_EXTERN( dcs2_audio_dsio ); MACHINE_DRIVER_EXTERN( dcs2_audio_denver ); -void dcs_init(void); +void dcs_init(running_machine *machine); void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset); void dcs_set_auto_ack(int state); diff --git a/src/mame/audio/dkong.c b/src/mame/audio/dkong.c index 5fa97e6056f..b52b90dcd2a 100644 --- a/src/mame/audio/dkong.c +++ b/src/mame/audio/dkong.c @@ -1115,7 +1115,7 @@ static READ8_DEVICE_HANDLER( dkong_tune_r ) } else { - /* printf("rom access at pc = %4x\n",activecpu_get_pc()); */ + /* printf("rom access at pc = %4x\n",cpu_get_pc(machine->activecpu)); */ return (state->snd_rom[0x1000+(page & 7)*256+offset]); } } diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c index a5e05468766..8d08ad58bbc 100644 --- a/src/mame/audio/exidy.c +++ b/src/mame/audio/exidy.c @@ -410,11 +410,11 @@ static void r6532_portb_w(const device_config *device, UINT8 newdata, UINT8 oldd if ((olddata & 0x01) && !(newdata & 0x01)) { riot6532_porta_in_set(riot, tms5220_status_r(device->machine, 0), 0xff); - logerror("(%f)%04X:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), tms5220_status_r(device->machine, 0)); + logerror("(%f)%04X:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(device->machine->activecpu), tms5220_status_r(device->machine, 0)); } if ((olddata & 0x02) && !(newdata & 0x02)) { - logerror("(%f)%04X:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), riot6532_porta_out_get(riot)); + logerror("(%f)%04X:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(device->machine->activecpu), riot6532_porta_out_get(riot)); tms5220_data_w(device->machine, 0, riot6532_porta_out_get(riot)); } } @@ -505,7 +505,7 @@ static READ8_HANDLER( exidy_sh8253_r ) static READ8_HANDLER( exidy_sh6840_r ) { - logerror("%04X:exidy_sh6840_r - unexpected read", activecpu_get_pc()); + logerror("%04X:exidy_sh6840_r - unexpected read", cpu_get_pc(machine->activecpu)); return 0; } @@ -788,7 +788,7 @@ READ8_HANDLER( victory_sound_response_r ) { UINT8 ret = pia_get_output_b(1); - if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", activecpu_get_previouspc(), ret); + if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(machine->activecpu), ret); pia_set_input_cb1(1, 0); @@ -800,7 +800,7 @@ READ8_HANDLER( victory_sound_status_r ) { UINT8 ret = (pia_get_input_ca1(1) << 7) | (pia_get_input_cb1(1) << 6); - if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", activecpu_get_previouspc(), ret); + if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(machine->activecpu), ret); return ret; } @@ -814,7 +814,7 @@ static TIMER_CALLBACK( delayed_command_w ) WRITE8_HANDLER( victory_sound_command_w ) { - if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", activecpu_get_previouspc(), data); + if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", cpu_get_previouspc(machine->activecpu), data); timer_call_after_resynch(NULL, data, delayed_command_w); } @@ -822,7 +822,7 @@ WRITE8_HANDLER( victory_sound_command_w ) static WRITE8_HANDLER( victory_sound_irq_clear_w ) { - if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound IRQ clear = %02X\n", activecpu_get_previouspc(), data); + if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound IRQ clear = %02X\n", cpu_get_previouspc(machine->activecpu), data); if (!data) pia_set_input_ca1(1, 1); } @@ -830,7 +830,7 @@ static WRITE8_HANDLER( victory_sound_irq_clear_w ) static WRITE8_HANDLER( victory_main_ack_w ) { - if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound Main ACK W = %02X\n", activecpu_get_previouspc(), data); + if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound Main ACK W = %02X\n", cpu_get_previouspc(machine->activecpu), data); if (victory_sound_response_ack_clk && !data) pia_set_input_cb1(1, 1); diff --git a/src/mame/audio/harddriv.c b/src/mame/audio/harddriv.c index 4a76e84c9cf..1cd8452e4dc 100644 --- a/src/mame/audio/harddriv.c +++ b/src/mame/audio/harddriv.c @@ -82,7 +82,7 @@ static void update_68k_interrupts(running_machine *machine) READ16_HANDLER( hd68k_snd_data_r ) { soundflag = 0; - logerror("%06X:main read from sound=%04X\n", activecpu_get_previouspc(), sounddata); + logerror("%06X:main read from sound=%04X\n", cpu_get_previouspc(machine->activecpu), sounddata); return sounddata; } @@ -104,7 +104,7 @@ static TIMER_CALLBACK( delayed_68k_w ) WRITE16_HANDLER( hd68k_snd_data_w ) { timer_call_after_resynch(NULL, data, delayed_68k_w); - logerror("%06X:main write to sound=%04X\n", activecpu_get_previouspc(), data); + logerror("%06X:main write to sound=%04X\n", cpu_get_previouspc(machine->activecpu), data); } @@ -114,7 +114,7 @@ WRITE16_HANDLER( hd68k_snd_reset_w ) cpunum_set_input_line(machine, hdcpu_sound, INPUT_LINE_RESET, CLEAR_LINE); mainflag = soundflag = 0; update_68k_interrupts(machine); - logerror("%06X:Reset sound\n", activecpu_get_previouspc()); + logerror("%06X:Reset sound\n", cpu_get_previouspc(machine->activecpu)); } @@ -129,7 +129,7 @@ READ16_HANDLER( hdsnd68k_data_r ) { mainflag = 0; update_68k_interrupts(machine); - logerror("%06X:sound read from main=%04X\n", activecpu_get_previouspc(), maindata); + logerror("%06X:sound read from main=%04X\n", cpu_get_previouspc(machine->activecpu), maindata); return maindata; } @@ -138,7 +138,7 @@ WRITE16_HANDLER( hdsnd68k_data_w ) { COMBINE_DATA(&sounddata); soundflag = 1; - logerror("%06X:sound write to main=%04X\n", activecpu_get_previouspc(), data); + logerror("%06X:sound write to main=%04X\n", cpu_get_previouspc(machine->activecpu), data); } @@ -151,14 +151,14 @@ WRITE16_HANDLER( hdsnd68k_data_w ) READ16_HANDLER( hdsnd68k_switches_r ) { - logerror("%06X:hdsnd68k_switches_r(%04X)\n", activecpu_get_previouspc(), offset); + logerror("%06X:hdsnd68k_switches_r(%04X)\n", cpu_get_previouspc(machine->activecpu), offset); return 0; } READ16_HANDLER( hdsnd68k_320port_r ) { - logerror("%06X:hdsnd68k_320port_r(%04X)\n", activecpu_get_previouspc(), offset); + logerror("%06X:hdsnd68k_320port_r(%04X)\n", cpu_get_previouspc(machine->activecpu), offset); return 0; } @@ -170,7 +170,7 @@ READ16_HANDLER( hdsnd68k_status_r ) // D14 = 'Sound Flag' // D13 = Test Switch // D12 = 5220 Ready Flag (0=Ready) - logerror("%06X:hdsnd68k_status_r(%04X)\n", activecpu_get_previouspc(), offset); + logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(machine->activecpu), offset); return (mainflag << 15) | (soundflag << 14) | 0x2000 | 0;//((input_port_read(machine, "IN0") & 0x0020) << 8) | 0; } @@ -193,17 +193,17 @@ WRITE16_HANDLER( hdsnd68k_latches_w ) { case 0: /* SPWR - 5220 write strobe */ /* data == 0 means high, 1 means low */ - logerror("%06X:SPWR=%d\n", activecpu_get_previouspc(), data); + logerror("%06X:SPWR=%d\n", cpu_get_previouspc(machine->activecpu), data); break; case 1: /* SPRES - 5220 hard reset */ /* data == 0 means low, 1 means high */ - logerror("%06X:SPRES=%d\n", activecpu_get_previouspc(), data); + logerror("%06X:SPRES=%d\n", cpu_get_previouspc(machine->activecpu), data); break; case 2: /* SPRATE */ /* data == 0 means 8kHz, 1 means 10kHz */ - logerror("%06X:SPRATE=%d\n", activecpu_get_previouspc(), data); + logerror("%06X:SPRATE=%d\n", cpu_get_previouspc(machine->activecpu), data); break; case 3: /* CRAMEN */ @@ -212,7 +212,7 @@ WRITE16_HANDLER( hdsnd68k_latches_w ) break; case 4: /* RES320 */ - logerror("%06X:RES320=%d\n", activecpu_get_previouspc(), data); + logerror("%06X:RES320=%d\n", cpu_get_previouspc(machine->activecpu), data); if (hdcpu_sounddsp != -1) cpunum_set_input_line(machine, hdcpu_sounddsp, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE); break; @@ -225,7 +225,7 @@ WRITE16_HANDLER( hdsnd68k_latches_w ) WRITE16_HANDLER( hdsnd68k_speech_w ) { - logerror("%06X:hdsnd68k_speech_w(%04X)=%04X\n", activecpu_get_previouspc(), offset, data); + logerror("%06X:hdsnd68k_speech_w(%04X)=%04X\n", cpu_get_previouspc(machine->activecpu), offset, data); } @@ -258,18 +258,18 @@ WRITE16_HANDLER( hdsnd68k_320ram_w ) READ16_HANDLER( hdsnd68k_320ports_r ) { UINT16 result; - cpuintrf_push_context(hdcpu_sounddsp); + cpu_push_context(machine->cpu[hdcpu_sounddsp]); result = TMS32010_In(offset & 7); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } WRITE16_HANDLER( hdsnd68k_320ports_w ) { - cpuintrf_push_context(hdcpu_sounddsp); + cpu_push_context(machine->cpu[hdcpu_sounddsp]); TMS32010_Out(offset & 7, data); - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -278,7 +278,7 @@ READ16_HANDLER( hdsnd68k_320com_r ) if (cramen) return comram[offset & 0x1ff]; - logerror("%06X:hdsnd68k_320com_r(%04X) -- not allowed\n", activecpu_get_previouspc(), offset); + logerror("%06X:hdsnd68k_320com_r(%04X) -- not allowed\n", cpu_get_previouspc(machine->activecpu), offset); return 0xffff; } @@ -288,7 +288,7 @@ WRITE16_HANDLER( hdsnd68k_320com_w ) if (cramen) COMBINE_DATA(&comram[offset & 0x1ff]); else - logerror("%06X:hdsnd68k_320com_w(%04X)=%04X -- not allowed\n", activecpu_get_previouspc(), offset, data); + logerror("%06X:hdsnd68k_320com_w(%04X)=%04X -- not allowed\n", cpu_get_previouspc(machine->activecpu), offset, data); } @@ -334,7 +334,7 @@ WRITE16_HANDLER( hdsnddsp_dac_w ) WRITE16_HANDLER( hdsnddsp_comport_w ) { /* COM port TD0-7 */ - logerror("%06X:hdsnddsp_comport_w=%d\n", activecpu_get_previouspc(), data); + logerror("%06X:hdsnddsp_comport_w=%d\n", cpu_get_previouspc(machine->activecpu), data); } @@ -342,7 +342,7 @@ WRITE16_HANDLER( hdsnddsp_mute_w ) { /* mute DAC audio, D0=1 */ /* dacmute = data & 1; -- NOT STUFFED */ - logerror("%06X:mute DAC=%d\n", activecpu_get_previouspc(), data); + logerror("%06X:mute DAC=%d\n", cpu_get_previouspc(machine->activecpu), data); } @@ -386,6 +386,6 @@ READ16_HANDLER( hdsnddsp_comram_r ) READ16_HANDLER( hdsnddsp_compare_r ) { - logerror("%06X:hdsnddsp_compare_r(%04X)\n", activecpu_get_previouspc(), offset); + logerror("%06X:hdsnddsp_compare_r(%04X)\n", cpu_get_previouspc(machine->activecpu), offset); return 0; } diff --git a/src/mame/audio/invinco.c b/src/mame/audio/invinco.c index 5a380aed9f9..f34adbdc634 100644 --- a/src/mame/audio/invinco.c +++ b/src/mame/audio/invinco.c @@ -108,6 +108,6 @@ WRITE8_HANDLER( invinco_audio_w ) } #if 0 - logerror("Went LO: %02X %04X\n", bitsGoneLow, activecpu_get_pc()); + logerror("Went LO: %02X %04X\n", bitsGoneLow, cpu_get_pc(machine->activecpu)); #endif } diff --git a/src/mame/audio/jaguar.c b/src/mame/audio/jaguar.c index bbb73d4978a..bb7e833d752 100644 --- a/src/mame/audio/jaguar.c +++ b/src/mame/audio/jaguar.c @@ -303,7 +303,7 @@ void cojag_sound_reset(void) READ16_HANDLER( jaguar_jerry_regs_r ) { if (offset != JINTCTRL && offset != JINTCTRL+2) - logerror("%08X:jerry read register @ F10%03X\n", activecpu_get_previouspc(), offset * 2); + logerror("%08X:jerry read register @ F10%03X\n", cpu_get_previouspc(machine->activecpu), offset * 2); switch (offset) { @@ -328,7 +328,7 @@ WRITE16_HANDLER( jaguar_jerry_regs_w ) } if (offset != JINTCTRL && offset != JINTCTRL+2 && offset != ASICTRL) - logerror("%08X:jerry write register @ F10%03X = %04X\n", activecpu_get_previouspc(), offset * 2, data); + logerror("%08X:jerry write register @ F10%03X = %04X\n", cpu_get_previouspc(machine->activecpu), offset * 2, data); } @@ -367,12 +367,12 @@ static WRITE32_HANDLER( dsp_flags_w ) /* if they were clearing the A2S interrupt, see if we are headed for the spin */ /* loop with R22 != 0; if we are, just start spinning again */ - if (cpu_getactivecpu() == 2 && ACCESSING_BITS_8_15 && (data & 0x400)) + if (cpunum_get_active() == 2 && ACCESSING_BITS_8_15 && (data & 0x400)) { /* see if we're going back to the spin loop */ - if (!(data & 0x04000) && activecpu_get_reg(JAGUAR_R22) != 0) + if (!(data & 0x04000) && cpu_get_reg(machine->activecpu, JAGUAR_R22) != 0) { - UINT32 r30 = activecpu_get_reg(JAGUAR_R30) & 0xffffff; + UINT32 r30 = cpu_get_reg(machine->activecpu, JAGUAR_R30) & 0xffffff; if (r30 >= 0xf1b124 && r30 <= 0xf1b126) jaguar_dsp_suspend(); } @@ -429,7 +429,7 @@ static TIMER_CALLBACK( serial_callback ) READ32_HANDLER( jaguar_serial_r ) { - logerror("%08X:jaguar_serial_r(%X)\n", activecpu_get_previouspc(), offset); + logerror("%08X:jaguar_serial_r(%X)\n", cpu_get_previouspc(machine->activecpu), offset); return 0; } @@ -465,7 +465,7 @@ WRITE32_HANDLER( jaguar_serial_w ) break; default: - logerror("%08X:jaguar_serial_w(%X,%X)\n", activecpu_get_previouspc(), offset, data); + logerror("%08X:jaguar_serial_w(%X,%X)\n", cpu_get_previouspc(machine->activecpu), offset, data); break; } } diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c index a95a850d909..4411642457e 100644 --- a/src/mame/audio/leland.c +++ b/src/mame/audio/leland.c @@ -377,7 +377,7 @@ static void leland_80186_dma_update(void *param, stream_sample_t **inputs, strea memset(buffer, 0, length * sizeof(*buffer)); /* loop over DMA buffers */ - cpuintrf_push_context(2); + cpu_push_context(Machine->cpu[2]); for (i = 0; i < 2; i++) { struct dma_state *d = &i80186.dma[i]; @@ -447,7 +447,7 @@ static void leland_80186_dma_update(void *param, stream_sample_t **inputs, strea } } } - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -616,7 +616,7 @@ static IRQ_CALLBACK(int_callback) if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", attotime_to_double(timer_get_time()), i80186.intr.poll_status & 0x1f); /* clear the interrupt */ - activecpu_set_info_int(CPUINFO_INT_INPUT_STATE + 0, CLEAR_LINE); + cpu_set_info_int(machine->activecpu, CPUINFO_INT_INPUT_STATE + 0, CLEAR_LINE); i80186.intr.pending = 0; /* clear the request and set the in-service bit */ @@ -730,7 +730,7 @@ generate_int: } -static void handle_eoi(int data) +static void handle_eoi(running_machine *machine, int data) { int i, j; @@ -749,7 +749,7 @@ static void handle_eoi(int data) case 0x0d: i80186.intr.in_service &= ~0x20; break; case 0x0e: i80186.intr.in_service &= ~0x40; break; case 0x0f: i80186.intr.in_service &= ~0x80; break; - default: logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", activecpu_get_pc(), data & 0x1f); + default: logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", cpu_get_pc(machine->activecpu), data & 0x1f); } if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", attotime_to_double(timer_get_time()), data & 0x1f); } @@ -1087,21 +1087,21 @@ static READ16_HANDLER( i80186_internal_port_r ) switch (offset) { case 0x22/2: - logerror("%05X:ERROR - read from 80186 EOI\n", activecpu_get_pc()); + logerror("%05X:ERROR - read from 80186 EOI\n", cpu_get_pc(machine->activecpu)); break; case 0x24/2: - if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll\n", cpu_get_pc(machine->activecpu)); if (i80186.intr.poll_status & 0x8000) int_callback(machine, 0); return i80186.intr.poll_status; case 0x26/2: - if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll status\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 interrupt poll status\n", cpu_get_pc(machine->activecpu)); return i80186.intr.poll_status; case 0x28/2: - if (LOG_PORTS) logerror("%05X:read 80186 interrupt mask\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 interrupt mask\n", cpu_get_pc(machine->activecpu)); temp = (i80186.intr.timer >> 3) & 0x01; temp |= (i80186.intr.dma[0] >> 1) & 0x04; temp |= (i80186.intr.dma[1] >> 0) & 0x08; @@ -1112,56 +1112,56 @@ static READ16_HANDLER( i80186_internal_port_r ) return temp; case 0x2a/2: - if (LOG_PORTS) logerror("%05X:read 80186 interrupt priority mask\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 interrupt priority mask\n", cpu_get_pc(machine->activecpu)); return i80186.intr.priority_mask; case 0x2c/2: - if (LOG_PORTS) logerror("%05X:read 80186 interrupt in-service\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 interrupt in-service\n", cpu_get_pc(machine->activecpu)); return i80186.intr.in_service; case 0x2e/2: - if (LOG_PORTS) logerror("%05X:read 80186 interrupt request\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 interrupt request\n", cpu_get_pc(machine->activecpu)); temp = i80186.intr.request & ~0x0001; if (i80186.intr.status & 0x0007) temp |= 1; return temp; case 0x30/2: - if (LOG_PORTS) logerror("%05X:read 80186 interrupt status\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 interrupt status\n", cpu_get_pc(machine->activecpu)); return i80186.intr.status; case 0x32/2: - if (LOG_PORTS) logerror("%05X:read 80186 timer interrupt control\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 timer interrupt control\n", cpu_get_pc(machine->activecpu)); return i80186.intr.timer; case 0x34/2: - if (LOG_PORTS) logerror("%05X:read 80186 DMA 0 interrupt control\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 DMA 0 interrupt control\n", cpu_get_pc(machine->activecpu)); return i80186.intr.dma[0]; case 0x36/2: - if (LOG_PORTS) logerror("%05X:read 80186 DMA 1 interrupt control\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 DMA 1 interrupt control\n", cpu_get_pc(machine->activecpu)); return i80186.intr.dma[1]; case 0x38/2: - if (LOG_PORTS) logerror("%05X:read 80186 INT 0 interrupt control\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 INT 0 interrupt control\n", cpu_get_pc(machine->activecpu)); return i80186.intr.ext[0]; case 0x3a/2: - if (LOG_PORTS) logerror("%05X:read 80186 INT 1 interrupt control\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 INT 1 interrupt control\n", cpu_get_pc(machine->activecpu)); return i80186.intr.ext[1]; case 0x3c/2: - if (LOG_PORTS) logerror("%05X:read 80186 INT 2 interrupt control\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 INT 2 interrupt control\n", cpu_get_pc(machine->activecpu)); return i80186.intr.ext[2]; case 0x3e/2: - if (LOG_PORTS) logerror("%05X:read 80186 INT 3 interrupt control\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 INT 3 interrupt control\n", cpu_get_pc(machine->activecpu)); return i80186.intr.ext[3]; case 0x50/2: case 0x58/2: case 0x60/2: - if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", activecpu_get_pc(), (offset - 0x50/2) / 4); + if (LOG_PORTS) logerror("%05X:read 80186 Timer %d count\n", cpu_get_pc(machine->activecpu), (offset - 0x50/2) / 4); which = (offset - 0x50/2) / 4; if (ACCESSING_BITS_0_7) internal_timer_sync(which); @@ -1170,87 +1170,87 @@ static READ16_HANDLER( i80186_internal_port_r ) case 0x52/2: case 0x5a/2: case 0x62/2: - if (LOG_PORTS) logerror("%05X:read 80186 Timer %d max A\n", activecpu_get_pc(), (offset - 0x50/2) / 4); + if (LOG_PORTS) logerror("%05X:read 80186 Timer %d max A\n", cpu_get_pc(machine->activecpu), (offset - 0x50/2) / 4); which = (offset - 0x50/2) / 4; return i80186.timer[which].maxA; case 0x54/2: case 0x5c/2: - logerror("%05X:read 80186 Timer %d max B\n", activecpu_get_pc(), (offset/2 - 0x50) / 4); + logerror("%05X:read 80186 Timer %d max B\n", cpu_get_pc(machine->activecpu), (offset/2 - 0x50) / 4); which = (offset - 0x50/2) / 4; return i80186.timer[which].maxB; case 0x56/2: case 0x5e/2: case 0x66/2: - if (LOG_PORTS) logerror("%05X:read 80186 Timer %d control\n", activecpu_get_pc(), (offset - 0x50/2) / 4); + if (LOG_PORTS) logerror("%05X:read 80186 Timer %d control\n", cpu_get_pc(machine->activecpu), (offset - 0x50/2) / 4); which = (offset - 0x50/2) / 4; return i80186.timer[which].control; case 0xa0/2: - if (LOG_PORTS) logerror("%05X:read 80186 upper chip select\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 upper chip select\n", cpu_get_pc(machine->activecpu)); return i80186.mem.upper; case 0xa2/2: - if (LOG_PORTS) logerror("%05X:read 80186 lower chip select\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 lower chip select\n", cpu_get_pc(machine->activecpu)); return i80186.mem.lower; case 0xa4/2: - if (LOG_PORTS) logerror("%05X:read 80186 peripheral chip select\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 peripheral chip select\n", cpu_get_pc(machine->activecpu)); return i80186.mem.peripheral; case 0xa6/2: - if (LOG_PORTS) logerror("%05X:read 80186 middle chip select\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 middle chip select\n", cpu_get_pc(machine->activecpu)); return i80186.mem.middle; case 0xa8/2: - if (LOG_PORTS) logerror("%05X:read 80186 middle P chip select\n", activecpu_get_pc()); + if (LOG_PORTS) logerror("%05X:read 80186 middle P chip select\n", cpu_get_pc(machine->activecpu)); return i80186.mem.middle_size; case 0xc0/2: case 0xd0/2: - if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower source address\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); + if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower source address\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); return i80186.dma[which].source; case 0xc2/2: case 0xd2/2: - if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper source address\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); + if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper source address\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); return i80186.dma[which].source >> 16; case 0xc4/2: case 0xd4/2: - if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower dest address\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); + if (LOG_PORTS) logerror("%05X:read 80186 DMA%d lower dest address\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); return i80186.dma[which].dest; case 0xc6/2: case 0xd6/2: - if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper dest address\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); + if (LOG_PORTS) logerror("%05X:read 80186 DMA%d upper dest address\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); return i80186.dma[which].dest >> 16; case 0xc8/2: case 0xd8/2: - if (LOG_PORTS) logerror("%05X:read 80186 DMA%d transfer count\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); + if (LOG_PORTS) logerror("%05X:read 80186 DMA%d transfer count\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); return i80186.dma[which].count; case 0xca/2: case 0xda/2: - if (LOG_PORTS) logerror("%05X:read 80186 DMA%d control\n", activecpu_get_pc(), (offset - 0xc0/2) / 8); + if (LOG_PORTS) logerror("%05X:read 80186 DMA%d control\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); return i80186.dma[which].control; default: - logerror("%05X:read 80186 port %02X\n", activecpu_get_pc(), offset*2); + logerror("%05X:read 80186 port %02X\n", cpu_get_pc(machine->activecpu), offset*2); break; } return 0x00; @@ -1277,21 +1277,21 @@ static WRITE16_HANDLER( i80186_internal_port_w ) switch (offset) { case 0x22/2: - if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); - handle_eoi(0x8000); + if (LOG_PORTS) logerror("%05X:80186 EOI = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); + handle_eoi(machine, 0x8000); update_interrupt_state(); break; case 0x24/2: - logerror("%05X:ERROR - write to 80186 interrupt poll = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + logerror("%05X:ERROR - write to 80186 interrupt poll = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); break; case 0x26/2: - logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + logerror("%05X:ERROR - write to 80186 interrupt poll status = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); break; case 0x28/2: - if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 interrupt mask = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.timer = (i80186.intr.timer & ~0x08) | ((data << 3) & 0x08); i80186.intr.dma[0] = (i80186.intr.dma[0] & ~0x08) | ((data << 1) & 0x08); i80186.intr.dma[1] = (i80186.intr.dma[1] & ~0x08) | ((data << 0) & 0x08); @@ -1303,69 +1303,69 @@ static WRITE16_HANDLER( i80186_internal_port_w ) break; case 0x2a/2: - if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 interrupt priority mask = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.priority_mask = data & 0x0007; update_interrupt_state(); break; case 0x2c/2: - if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 interrupt in-service = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.in_service = data & 0x00ff; update_interrupt_state(); break; case 0x2e/2: - if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 interrupt request = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.request = (i80186.intr.request & ~0x00c0) | (data & 0x00c0); update_interrupt_state(); break; case 0x30/2: - if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:WARNING - wrote to 80186 interrupt status = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.status = (i80186.intr.status & ~0x8000) | (data & 0x8000); i80186.intr.status = (i80186.intr.status & ~0x0007) | (data & 0x0007); update_interrupt_state(); break; case 0x32/2: - if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 timer interrupt contol = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.timer = data & 0x000f; break; case 0x34/2: - if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 DMA 0 interrupt control = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.dma[0] = data & 0x000f; break; case 0x36/2: - if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 DMA 1 interrupt control = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.dma[1] = data & 0x000f; break; case 0x38/2: - if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 INT 0 interrupt control = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.ext[0] = data & 0x007f; break; case 0x3a/2: - if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 INT 1 interrupt control = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.ext[1] = data & 0x007f; break; case 0x3c/2: - if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 INT 2 interrupt control = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.ext[2] = data & 0x001f; break; case 0x3e/2: - if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 INT 3 interrupt control = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.intr.ext[3] = data & 0x001f; break; case 0x50/2: case 0x58/2: case 0x60/2: - if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 Timer %d count = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0x50/2) / 4, data, mem_mask); which = (offset - 0x50/2) / 4; internal_timer_update(which, data, -1, -1, -1); break; @@ -1373,14 +1373,14 @@ static WRITE16_HANDLER( i80186_internal_port_w ) case 0x52/2: case 0x5a/2: case 0x62/2: - if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 Timer %d max A = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0x50/2) / 4, data, mem_mask); which = (offset - 0x50/2) / 4; internal_timer_update(which, -1, data, -1, -1); break; case 0x54/2: case 0x5c/2: - if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 Timer %d max B = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0x50/2) / 4, data, mem_mask); which = (offset - 0x50/2) / 4; internal_timer_update(which, -1, -1, data, -1); break; @@ -1388,33 +1388,33 @@ static WRITE16_HANDLER( i80186_internal_port_w ) case 0x56/2: case 0x5e/2: case 0x66/2: - if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X & %04X\n", activecpu_get_pc(), (offset - 0x50/2) / 4, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 Timer %d control = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0x50/2) / 4, data, mem_mask); which = (offset - 0x50/2) / 4; internal_timer_update(which, -1, -1, -1, data); break; case 0xa0/2: - if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 upper chip select = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.mem.upper = data | 0xc038; break; case 0xa2/2: - if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 lower chip select = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.mem.lower = (data & 0x3fff) | 0x0038; break; case 0xa4/2: - if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 peripheral chip select = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.mem.peripheral = data | 0x0038; break; case 0xa6/2: - if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 middle chip select = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.mem.middle = data | 0x01f8; break; case 0xa8/2: - if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 middle P chip select = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); i80186.mem.middle_size = data | 0x8038; temp = (i80186.mem.peripheral & 0xffc0) << 4; @@ -1429,12 +1429,12 @@ static WRITE16_HANDLER( i80186_internal_port_w ) /* we need to do this at a time when the 80186 context is swapped in */ /* this register is generally set once at startup and never again, so it's a good */ /* time to set it up */ - cpunum_set_irq_callback(cpu_getactivecpu(), int_callback); + cpunum_set_irq_callback(cpunum_get_active(), int_callback); break; case 0xc0/2: case 0xd0/2: - if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 DMA%d lower source address = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8, data, mem_mask); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); i80186.dma[which].source = (i80186.dma[which].source & ~0x0ffff) | (data & 0x0ffff); @@ -1442,7 +1442,7 @@ static WRITE16_HANDLER( i80186_internal_port_w ) case 0xc2/2: case 0xd2/2: - if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 DMA%d upper source address = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8, data, mem_mask); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); i80186.dma[which].source = (i80186.dma[which].source & ~0xf0000) | ((data << 16) & 0xf0000); @@ -1450,7 +1450,7 @@ static WRITE16_HANDLER( i80186_internal_port_w ) case 0xc4/2: case 0xd4/2: - if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 DMA%d lower dest address = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8, data, mem_mask); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); i80186.dma[which].dest = (i80186.dma[which].dest & ~0x0ffff) | (data & 0x0ffff); @@ -1458,7 +1458,7 @@ static WRITE16_HANDLER( i80186_internal_port_w ) case 0xc6/2: case 0xd6/2: - if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 DMA%d upper dest address = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8, data, mem_mask); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); i80186.dma[which].dest = (i80186.dma[which].dest & ~0xf0000) | ((data << 16) & 0xf0000); @@ -1466,7 +1466,7 @@ static WRITE16_HANDLER( i80186_internal_port_w ) case 0xc8/2: case 0xd8/2: - if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 DMA%d transfer count = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8, data, mem_mask); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); i80186.dma[which].count = data; @@ -1474,14 +1474,14 @@ static WRITE16_HANDLER( i80186_internal_port_w ) case 0xca/2: case 0xda/2: - if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X & %04X\n", activecpu_get_pc(), (offset - 0xc0/2) / 8, data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 DMA%d control = %04X & %04X\n", cpu_get_pc(machine->activecpu), (offset - 0xc0/2) / 8, data, mem_mask); which = (offset - 0xc0/2) / 8; stream_update(dma_stream); update_dma_control(which, data); break; case 0xfe/2: - if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X & %04X\n", activecpu_get_pc(), data, mem_mask); + if (LOG_PORTS) logerror("%05X:80186 relocation register = %04X & %04X\n", cpu_get_pc(machine->activecpu), data, mem_mask); /* we assume here there that this doesn't happen too often */ /* plus, we can't really remove the old memory range, so we also assume that it's */ @@ -1498,7 +1498,7 @@ static WRITE16_HANDLER( i80186_internal_port_w ) break; default: - logerror("%05X:80186 port %02X = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask); + logerror("%05X:80186 port %02X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); break; } } @@ -1650,7 +1650,7 @@ WRITE8_HANDLER( leland_80186_control_w ) if (LOG_COMM) { - logerror("%04X:80186 control = %02X", activecpu_get_previouspc(), data); + logerror("%04X:80186 control = %02X", cpu_get_previouspc(machine->activecpu), data); if (!(data & 0x80)) logerror(" /RESET"); if (!(data & 0x40)) logerror(" ZNMI"); if (!(data & 0x20)) logerror(" INT0"); @@ -1706,7 +1706,7 @@ WRITE8_HANDLER( leland_80186_control_w ) static TIMER_CALLBACK( command_lo_sync ) { - if (LOG_COMM) logerror("%04X:Write sound command latch lo = %02X\n", activecpu_get_previouspc(), param); + if (LOG_COMM) logerror("%04X:Write sound command latch lo = %02X\n", cpu_get_previouspc(machine->activecpu), param); sound_command = (sound_command & 0xff00) | param; } @@ -1719,14 +1719,14 @@ WRITE8_HANDLER( leland_80186_command_lo_w ) WRITE8_HANDLER( leland_80186_command_hi_w ) { - if (LOG_COMM) logerror("%04X:Write sound command latch hi = %02X\n", activecpu_get_previouspc(), data); + if (LOG_COMM) logerror("%04X:Write sound command latch hi = %02X\n", cpu_get_previouspc(machine->activecpu), data); sound_command = (sound_command & 0x00ff) | (data << 8); } static READ16_HANDLER( main_to_sound_comm_r ) { - if (LOG_COMM) logerror("%05X:Read sound command latch = %02X\n", activecpu_get_pc(), sound_command); + if (LOG_COMM) logerror("%05X:Read sound command latch = %02X\n", cpu_get_pc(machine->activecpu), sound_command); return sound_command; } @@ -1742,8 +1742,8 @@ static READ16_HANDLER( main_to_sound_comm_r ) static TIMER_CALLBACK( delayed_response_r ) { int checkpc = param; - int pc = cpunum_get_reg(0, Z80_PC); - int oldaf = cpunum_get_reg(0, Z80_AF); + int pc = cpu_get_reg(machine->cpu[0], Z80_PC); + int oldaf = cpu_get_reg(machine->cpu[0], Z80_AF); /* This is pretty cheesy, but necessary. Since the CPUs run in round-robin order, synchronizing on the write to this register from the slave side does nothing. @@ -1756,7 +1756,7 @@ static TIMER_CALLBACK( delayed_response_r ) if (LOG_COMM) logerror("(Updated sound response latch to %02X)\n", sound_response); oldaf = (oldaf & 0x00ff) | (sound_response << 8); - cpunum_set_reg(0, Z80_AF, oldaf); + cpu_set_reg(machine->cpu[0], Z80_AF, oldaf); } else logerror("ERROR: delayed_response_r - current PC = %04X, checkPC = %04X\n", pc, checkpc); @@ -1765,17 +1765,17 @@ static TIMER_CALLBACK( delayed_response_r ) READ8_HANDLER( leland_80186_response_r ) { - if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", activecpu_get_previouspc(), sound_response); + if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", cpu_get_previouspc(machine->activecpu), sound_response); /* synchronize the response */ - timer_call_after_resynch(NULL, activecpu_get_previouspc() + 2, delayed_response_r); + timer_call_after_resynch(NULL, cpu_get_previouspc(machine->activecpu) + 2, delayed_response_r); return sound_response; } static WRITE16_HANDLER( sound_to_main_comm_w ) { - if (LOG_COMM) logerror("%05X:Write sound response latch = %02X\n", activecpu_get_pc(), data); + if (LOG_COMM) logerror("%05X:Write sound response latch = %02X\n", cpu_get_pc(machine->activecpu), data); sound_response = data; } @@ -1823,7 +1823,7 @@ static WRITE16_HANDLER( dac_w ) /* set the new value */ d->value = (INT16)(UINT8)data - 0x80; - if (LOG_DAC) logerror("%05X:DAC %d value = %02X\n", activecpu_get_pc(), offset, (UINT8)data); + if (LOG_DAC) logerror("%05X:DAC %d value = %02X\n", cpu_get_pc(machine->activecpu), offset, (UINT8)data); /* if we haven't overflowed the buffer, add the value value to it */ if (count < DAC_BUFFER_SIZE - 1) @@ -1846,7 +1846,7 @@ static WRITE16_HANDLER( dac_w ) if (ACCESSING_BITS_8_15) { d->volume = ((data >> 8) ^ 0x00) / DAC_VOLUME_SCALE; - if (LOG_DAC) logerror("%05X:DAC %d volume = %02X\n", activecpu_get_pc(), offset, data); + if (LOG_DAC) logerror("%05X:DAC %d volume = %02X\n", cpu_get_pc(machine->activecpu), offset, data); } } @@ -1878,7 +1878,7 @@ static WRITE16_HANDLER( redline_dac_w ) /* update the volume */ d->volume = (offset & 0xff) / DAC_VOLUME_SCALE; - if (LOG_DAC) logerror("%05X:DAC %d value = %02X, volume = %02X\n", activecpu_get_pc(), which, data, (offset & 0x1fe) / 2); + if (LOG_DAC) logerror("%05X:DAC %d value = %02X, volume = %02X\n", cpu_get_pc(machine->activecpu), which, data, (offset & 0x1fe) / 2); } @@ -1894,7 +1894,7 @@ static WRITE16_HANDLER( dac_10bit_w ) /* set the new value */ d->value = (INT16)data16 - 0x200; - if (LOG_DAC) logerror("%05X:DAC 10-bit value = %02X\n", activecpu_get_pc(), data16); + if (LOG_DAC) logerror("%05X:DAC 10-bit value = %02X\n", cpu_get_pc(machine->activecpu), data16); /* if we haven't overflowed the buffer, add the value value to it */ if (count < DAC_BUFFER_SIZE - 1) @@ -1968,7 +1968,7 @@ static WRITE16_HANDLER( ataxx_dac_control ) return; } } - logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", activecpu_get_pc(), 5, offset, data); + logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", cpu_get_pc(machine->activecpu), 5, offset, data); } @@ -2014,11 +2014,11 @@ static READ16_HANDLER( peripheral_r ) if (is_redline) return pit8254_r(machine, offset | 0x80, mem_mask); else - logerror("%05X:Unexpected peripheral read %d/%02X\n", activecpu_get_pc(), select, offset*2); + logerror("%05X:Unexpected peripheral read %d/%02X\n", cpu_get_pc(machine->activecpu), select, offset*2); break; default: - logerror("%05X:Unexpected peripheral read %d/%02X\n", activecpu_get_pc(), select, offset*2); + logerror("%05X:Unexpected peripheral read %d/%02X\n", cpu_get_pc(machine->activecpu), select, offset*2); break; } return 0xffff; @@ -2061,7 +2061,7 @@ static WRITE16_HANDLER( peripheral_w ) break; default: - logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", activecpu_get_pc(), select, offset, data); + logerror("%05X:Unexpected peripheral write %d/%02X = %02X\n", cpu_get_pc(machine->activecpu), select, offset, data); break; } } diff --git a/src/mame/audio/meadows.c b/src/mame/audio/meadows.c index 9e0b5a0b781..bc636e07474 100644 --- a/src/mame/audio/meadows.c +++ b/src/mame/audio/meadows.c @@ -58,7 +58,7 @@ void meadows_sh_start(void) /************************************/ /* Sound handler update */ /************************************/ -void meadows_sh_update(void) +void meadows_sh_update(running_machine *machine) { int preset, amp; @@ -67,7 +67,7 @@ void meadows_sh_update(void) /* amplitude is a combination of the upper 4 bits of 0c01 */ /* and bit 4 merged from S2650's flag output */ amp = ((meadows_0c03 & ENABLE_CTR1) == 0) ? 0 : (meadows_0c01 & 0xf0) >> 1; - if( activecpu_get_reg(S2650_FO) ) + if( cpu_get_reg(machine->activecpu, S2650_FO) ) amp += 0x80; /* calculate frequency for counter #1 */ /* bit 0..3 of 0c01 are ctr preset */ diff --git a/src/mame/audio/mw8080bw.c b/src/mame/audio/mw8080bw.c index be0bf8f4456..73f559f6f12 100644 --- a/src/mame/audio/mw8080bw.c +++ b/src/mame/audio/mw8080bw.c @@ -242,7 +242,7 @@ WRITE8_HANDLER( gunfight_audio_w ) break; default: - logerror("%04x: Unknown sh port write %02x\n",activecpu_get_pc(),data); + logerror("%04x: Unknown sh port write %02x\n",cpu_get_pc(machine->activecpu),data); break; } } diff --git a/src/mame/audio/namcoc7x.c b/src/mame/audio/namcoc7x.c index a10cd0d26b5..e8b04cc300e 100644 --- a/src/mame/audio/namcoc7x.c +++ b/src/mame/audio/namcoc7x.c @@ -36,7 +36,7 @@ static UINT32 *namcoc7x_hostram; static READ16_HANDLER( speedup_r ) { - if ((activecpu_get_pc() == 0xc12d) && (!(su_82 & 0xff00))) + if ((cpu_get_pc(machine->activecpu) == 0xc12d) && (!(su_82 & 0xff00))) { cpu_spinuntil_int(); } diff --git a/src/mame/audio/redalert.c b/src/mame/audio/redalert.c index cf1e1d865d6..56f1c002793 100644 --- a/src/mame/audio/redalert.c +++ b/src/mame/audio/redalert.c @@ -183,8 +183,8 @@ static int sid_callback(void) static SOUND_START( redalert_voice ) { - cpunum_set_info_fct(2, CPUINFO_PTR_I8085_SOD_CALLBACK, (void *)sod_callback); - cpunum_set_info_fct(2, CPUINFO_PTR_I8085_SID_CALLBACK, (void *)sid_callback); + cpu_set_info_fct(machine->cpu[2], CPUINFO_PTR_I8085_SOD_CALLBACK, (void *)sod_callback); + cpu_set_info_fct(machine->cpu[2], CPUINFO_PTR_I8085_SID_CALLBACK, (void *)sid_callback); } diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c index dee83f63c3f..f8826c1fffa 100644 --- a/src/mame/audio/segasnd.c +++ b/src/mame/audio/segasnd.c @@ -331,7 +331,7 @@ void sega_usb_reset(UINT8 t1_clock_mask) READ8_HANDLER( sega_usb_status_r ) { - LOG(("%04X:usb_data_r = %02X\n", activecpu_get_pc(), (usb.out_latch & 0x81) | (usb.in_latch & 0x7e))); + LOG(("%04X:usb_data_r = %02X\n", cpu_get_pc(machine->activecpu), (usb.out_latch & 0x81) | (usb.in_latch & 0x7e))); activecpu_adjust_icount(-200); @@ -359,7 +359,7 @@ static TIMER_CALLBACK( delayed_usb_data_w ) WRITE8_HANDLER( sega_usb_data_w ) { - LOG(("%04X:usb_data_w = %02X\n", activecpu_get_pc(), data)); + LOG(("%04X:usb_data_w = %02X\n", cpu_get_pc(machine->activecpu), data)); timer_call_after_resynch(NULL, data, delayed_usb_data_w); /* boost the interleave so that sequences can be sent */ @@ -378,7 +378,7 @@ WRITE8_HANDLER( sega_usb_ram_w ) if (usb.in_latch & 0x80) usb.program_ram[offset] = data; else - LOG(("%04X:sega_usb_ram_w(%03X) = %02X while /LOAD disabled\n", activecpu_get_pc(), offset, data)); + LOG(("%04X:sega_usb_ram_w(%03X) = %02X while /LOAD disabled\n", cpu_get_pc(machine->activecpu), offset, data)); } @@ -393,7 +393,7 @@ static READ8_HANDLER( usb_p1_r ) { /* bits 0-6 are inputs and map to bits 0-6 of the input latch */ if ((usb.in_latch & 0x7f) != 0) - LOG(("%03X: P1 read = %02X\n", activecpu_get_pc(), usb.in_latch & 0x7f)); + LOG(("%03X: P1 read = %02X\n", cpu_get_pc(machine->activecpu), usb.in_latch & 0x7f)); return usb.in_latch & 0x7f; } @@ -402,7 +402,7 @@ static WRITE8_HANDLER( usb_p1_w ) { /* bit 7 maps to bit 0 on the output latch */ usb.out_latch = (usb.out_latch & 0xfe) | (data >> 7); - LOG(("%03X: P1 write = %02X\n", activecpu_get_pc(), data)); + LOG(("%03X: P1 write = %02X\n", cpu_get_pc(machine->activecpu), data)); } @@ -424,7 +424,7 @@ static WRITE8_HANDLER( usb_p2_w ) if ((old & 0x80) && !(data & 0x80)) usb.t1_clock = 0; - LOG(("%03X: P2 write -> bank=%d ready=%d clock=%d\n", activecpu_get_pc(), data & 3, (data >> 6) & 1, (data >> 7) & 1)); + LOG(("%03X: P2 write -> bank=%d ready=%d clock=%d\n", cpu_get_pc(machine->activecpu), data & 3, (data >> 6) & 1, (data >> 7) & 1)); } diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c index 8c020011588..28b9b415827 100644 --- a/src/mame/audio/seibu.c +++ b/src/mame/audio/seibu.c @@ -405,7 +405,7 @@ static WRITE8_HANDLER( seibu_pending_w ) READ16_HANDLER( seibu_main_word_r ) { - //logerror("%06x: seibu_main_word_r(%x)\n",activecpu_get_pc(),offset); + //logerror("%06x: seibu_main_word_r(%x)\n",cpu_get_pc(machine->activecpu),offset); switch (offset) { case 2: @@ -414,14 +414,14 @@ READ16_HANDLER( seibu_main_word_r ) case 5: return main2sub_pending ? 1 : 0; default: - //logerror("%06x: seibu_main_word_r(%x)\n",activecpu_get_pc(),offset); + //logerror("%06x: seibu_main_word_r(%x)\n",cpu_get_pc(machine->activecpu),offset); return 0xffff; } } WRITE16_HANDLER( seibu_main_word_w ) { - //logerror("%06x: seibu_main_word_w(%x,%02x)\n",activecpu_get_pc(),offset,data); + //logerror("%06x: seibu_main_word_w(%x,%02x)\n",cpu_get_pc(machine->activecpu),offset,data); if (ACCESSING_BITS_0_7) { switch (offset) @@ -439,7 +439,7 @@ WRITE16_HANDLER( seibu_main_word_w ) main2sub_pending = 1; break; default: - //logerror("%06x: seibu_main_word_w(%x,%02x)\n",activecpu_get_pc(),offset,data); + //logerror("%06x: seibu_main_word_w(%x,%02x)\n",cpu_get_pc(machine->activecpu),offset,data); break; } } diff --git a/src/mame/audio/snes.c b/src/mame/audio/snes.c index 9828e047b36..7550c28fc61 100644 --- a/src/mame/audio/snes.c +++ b/src/mame/audio/snes.c @@ -1233,7 +1233,7 @@ READ8_HANDLER( spc_io_r ) case 0x5: /* Port 1 */ case 0x6: /* Port 2 */ case 0x7: /* Port 3 */ -// mame_printf_debug("SPC: rd %02x @ %d, PC=%x\n", spc_port_in[offset-4], offset-4, activecpu_get_pc()); +// mame_printf_debug("SPC: rd %02x @ %d, PC=%x\n", spc_port_in[offset-4], offset-4, cpu_get_pc(machine->activecpu)); return spc_port_in[offset - 4]; case 0xA: /* Timer 0 */ case 0xB: /* Timer 1 */ @@ -1309,7 +1309,7 @@ WRITE8_HANDLER( spc_io_w ) case 0x5: /* Port 1 */ case 0x6: /* Port 2 */ case 0x7: /* Port 3 */ -// mame_printf_debug("SPC: %02x to APU @ %d (PC=%x)\n", data, offset&3, activecpu_get_pc()); +// mame_printf_debug("SPC: %02x to APU @ %d (PC=%x)\n", data, offset&3, cpu_get_pc(machine->activecpu)); spc_port_out[offset - 4] = data; cpu_boost_interleave(machine, attotime_zero, ATTOTIME_IN_USEC(20)); break; diff --git a/src/mame/audio/taito_en.c b/src/mame/audio/taito_en.c index 86f51d3dee1..fd3d7c107d7 100644 --- a/src/mame/audio/taito_en.c +++ b/src/mame/audio/taito_en.c @@ -166,7 +166,7 @@ WRITE16_HANDLER(f3_68681_w) READ16_HANDLER(es5510_dsp_r) { -// logerror("%06x: DSP read offset %04x (data is %04x)\n",activecpu_get_pc(),offset,es5510_dsp_ram[offset]); +// logerror("%06x: DSP read offset %04x (data is %04x)\n",cpu_get_pc(machine->activecpu),offset,es5510_dsp_ram[offset]); // if (es_tmp) return es5510_dsp_ram[offset]; /* switch (offset) { @@ -193,7 +193,7 @@ WRITE16_HANDLER(es5510_dsp_w) UINT8 *snd_mem = (UINT8 *)memory_region(machine, "ensoniq.0"); // if (offset>4 && offset!=0x80 && offset!=0xa0 && offset!=0xc0 && offset!=0xe0) -// logerror("%06x: DSP write offset %04x %04x\n",activecpu_get_pc(),offset,data); +// logerror("%06x: DSP write offset %04x %04x\n",cpu_get_pc(machine->activecpu),offset,data); COMBINE_DATA(&es5510_dsp_ram[offset]); diff --git a/src/mame/audio/taitosnd.c b/src/mame/audio/taitosnd.c index 309aa5ce0b5..4d4162f1a8d 100644 --- a/src/mame/audio/taitosnd.c +++ b/src/mame/audio/taitosnd.c @@ -95,7 +95,7 @@ WRITE8_HANDLER( taitosound_comm_w ) case 0x04: // port status //#ifdef REPORT_DATA_FLOW - //logerror("taitosnd: Master issued control value %02x (PC = %08x) \n",data, activecpu_get_pc() ); + //logerror("taitosnd: Master issued control value %02x (PC = %08x) \n",data, cpu_get_pc(machine->activecpu) ); //#endif /* this does a hi-lo transition to reset the sound cpu */ if (data) @@ -224,7 +224,7 @@ READ8_HANDLER( taitosound_slave_comm_r ) break; case 0x01: // mode #1 - //logerror("taitosnd: Slave cpu receives 0/1 : %01x%01x PC=%4x\n", tc0140syt.slavedata[1],tc0140syt.slavedata[0],activecpu_get_pc()); + //logerror("taitosnd: Slave cpu receives 0/1 : %01x%01x PC=%4x\n", tc0140syt.slavedata[1],tc0140syt.slavedata[0],cpu_get_pc(machine->activecpu)); tc0140syt.status &= ~TC0140SYT_PORT01_FULL; res = tc0140syt.slavedata[tc0140syt.submode ++]; break; diff --git a/src/mame/drivers/1943.c b/src/mame/drivers/1943.c index 2ead2e06bd6..ec0d9eb310c 100644 --- a/src/mame/drivers/1943.c +++ b/src/mame/drivers/1943.c @@ -47,8 +47,8 @@ static READ8_HANDLER( c1943_protection_r ) if a read from this address doesn't return the value it expects. */ - int data = activecpu_get_reg(Z80_BC) >> 8; -// logerror("protection read, PC: %04x Result:%02x\n",activecpu_get_pc(),data); + int data = cpu_get_reg(machine->activecpu, Z80_BC) >> 8; +// logerror("protection read, PC: %04x Result:%02x\n",cpu_get_pc(machine->activecpu),data); return data; } diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c index 3f09180427a..08fff301861 100644 --- a/src/mame/drivers/8080bw.c +++ b/src/mame/drivers/8080bw.c @@ -1477,12 +1477,12 @@ INPUT_PORTS_END static READ8_HANDLER(indianbt_r) { - switch(activecpu_get_pc()) + switch(cpu_get_pc(machine->activecpu)) { case 0x5fed: return 0x10; case 0x5ffc: return 0; } - logerror("unknown port 0 read @ %x\n",activecpu_get_pc()); + logerror("unknown port 0 read @ %x\n",cpu_get_pc(machine->activecpu)); return mame_rand(machine); } diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c index 1a45fd91278..ed52d6f04e0 100644 --- a/src/mame/drivers/88games.c +++ b/src/mame/drivers/88games.c @@ -474,7 +474,7 @@ static void k88games_banking( int lines ) UINT8 *RAM = memory_region(Machine, "main"); int offs; -logerror("%04x: bank select %02x\n",activecpu_get_pc(),lines); +logerror("%04x: bank select %02x\n",cpu_get_pc(Machine->activecpu),lines); /* bits 0-2 select ROM bank for 0000-1fff */ /* bit 3: when 1, palette RAM at 1000-1fff */ @@ -511,7 +511,7 @@ logerror("%04x: bank select %02x\n",activecpu_get_pc(),lines); static MACHINE_RESET( 88games ) { - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)k88games_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)k88games_banking); paletteram = &memory_region(machine, "main")[0x20000]; } diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c index d714ccd5daf..37c8c69dc44 100644 --- a/src/mame/drivers/acommand.c +++ b/src/mame/drivers/acommand.c @@ -274,7 +274,7 @@ static UINT16 *ac_devram; static READ16_HANDLER(ac_devices_r) { - logerror("(PC=%06x) read at %04x\n",activecpu_get_pc(),offset*2); + logerror("(PC=%06x) read at %04x\n",cpu_get_pc(machine->activecpu),offset*2); switch(offset) { diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c index 7ac1271b6ab..7a458c405af 100644 --- a/src/mame/drivers/actfancr.c +++ b/src/mame/drivers/actfancr.c @@ -546,7 +546,7 @@ ROM_END static READ8_HANDLER( cycle_r ) { - int pc=activecpu_get_pc(); + int pc=cpu_get_pc(machine->activecpu); int ret=actfancr_ram[0x26]; if (offset==1) return actfancr_ram[0x27]; @@ -561,7 +561,7 @@ static READ8_HANDLER( cycle_r ) static READ8_HANDLER( cyclej_r ) { - int pc=activecpu_get_pc(); + int pc=cpu_get_pc(machine->activecpu); int ret=actfancr_ram[0x26]; if (offset==1) return actfancr_ram[0x27]; diff --git a/src/mame/drivers/aeroboto.c b/src/mame/drivers/aeroboto.c index 3c52fed0937..4b8ded46e6a 100644 --- a/src/mame/drivers/aeroboto.c +++ b/src/mame/drivers/aeroboto.c @@ -48,7 +48,7 @@ static READ8_HANDLER( aeroboto_201_r ) /* serie of values to be returned from 3004, and display "PASS 201" if it is */ static const UINT8 res[4] = { 0xff,0x9f,0x1b,0x03}; static int count; - logerror("PC %04x: read 3004\n",activecpu_get_pc()); + logerror("PC %04x: read 3004\n",cpu_get_pc(machine->activecpu)); return res[(count++)&3]; } diff --git a/src/mame/drivers/aladbl.c b/src/mame/drivers/aladbl.c index 993af0738fd..655e369a066 100644 --- a/src/mame/drivers/aladbl.c +++ b/src/mame/drivers/aladbl.c @@ -138,17 +138,17 @@ static WRITE16_HANDLER( aladbl_w ) - aladbl_w : 1b2d18 - data = aa00 (only once on reset) - aladbl_w : 1b2d42 - data = 0000 (only once on reset) */ - logerror("aladbl_w : %06x - data = %04x\n",activecpu_get_pc(),data); + logerror("aladbl_w : %06x - data = %04x\n",cpu_get_pc(machine->activecpu),data); } static READ16_HANDLER( aladbl_r ) { - if (activecpu_get_pc()==0x1b2a56) return (input_port_read(machine, "MCU") & 0xff0f); // coins - if (activecpu_get_pc()==0x1b2a72) return 0x0000; - if (activecpu_get_pc()==0x1b2d24) return (input_port_read(machine, "MCU") & 0x00f0) | 0x1200; // difficulty - if (activecpu_get_pc()==0x1b2d4e) return 0x0000; + if (cpu_get_pc(machine->activecpu)==0x1b2a56) return (input_port_read(machine, "MCU") & 0xff0f); // coins + if (cpu_get_pc(machine->activecpu)==0x1b2a72) return 0x0000; + if (cpu_get_pc(machine->activecpu)==0x1b2d24) return (input_port_read(machine, "MCU") & 0x00f0) | 0x1200; // difficulty + if (cpu_get_pc(machine->activecpu)==0x1b2d4e) return 0x0000; - logerror("aladbl_r : %06x\n",activecpu_get_pc()); + logerror("aladbl_r : %06x\n",cpu_get_pc(machine->activecpu)); return 0x0000; } diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c index 3ed29294572..237c9839f91 100644 --- a/src/mame/drivers/alg.c +++ b/src/mame/drivers/alg.c @@ -219,7 +219,7 @@ static UINT8 alg_cia_0_porta_r(void) static UINT8 alg_cia_0_portb_r(void) { - logerror("%06x:alg_cia_0_portb_r\n", activecpu_get_pc()); + logerror("%06x:alg_cia_0_portb_r\n", cpu_get_pc(Machine->activecpu)); return 0xff; } @@ -227,20 +227,20 @@ static UINT8 alg_cia_0_portb_r(void) static void alg_cia_0_portb_w(UINT8 data) { /* parallel port */ - logerror("%06x:alg_cia_0_portb_w(%02x)\n", activecpu_get_pc(), data); + logerror("%06x:alg_cia_0_portb_w(%02x)\n", cpu_get_pc(Machine->activecpu), data); } static UINT8 alg_cia_1_porta_r(void) { - logerror("%06x:alg_cia_1_porta_r\n", activecpu_get_pc()); + logerror("%06x:alg_cia_1_porta_r\n", cpu_get_pc(Machine->activecpu)); return 0xff; } static void alg_cia_1_porta_w(UINT8 data) { - logerror("%06x:alg_cia_1_porta_w(%02x)\n", activecpu_get_pc(), data); + logerror("%06x:alg_cia_1_porta_w(%02x)\n", cpu_get_pc(Machine->activecpu), data); } diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c index ea1812851cc..eaf937d66fc 100644 --- a/src/mame/drivers/aliens.c +++ b/src/mame/drivers/aliens.c @@ -497,7 +497,7 @@ static MACHINE_RESET( aliens ) { UINT8 *RAM = memory_region(machine, "main"); - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)aliens_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)aliens_banking); /* init the default bank */ memory_set_bankptr( 1, &RAM[0x10000] ); diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c index 13c17a78c27..160d64acfbc 100644 --- a/src/mame/drivers/alpha68k.c +++ b/src/mame/drivers/alpha68k.c @@ -246,7 +246,7 @@ static WRITE16_HANDLER( tnexspce_coin_counters_w ) static WRITE16_HANDLER( tnexspce_unknown_w ) { - logerror("tnexspce_unknown_w : PC = %04x - offset = %04x - data = %04x\n",activecpu_get_pc(),offset,data); + logerror("tnexspce_unknown_w : PC = %04x - offset = %04x - data = %04x\n",cpu_get_pc(machine->activecpu),offset,data); if (offset==0) { alpha68k_flipscreen_w(data & 0x100); @@ -255,7 +255,7 @@ static WRITE16_HANDLER( tnexspce_unknown_w ) static WRITE16_HANDLER( alpha_microcontroller_w ) { - logerror("%04x: Alpha write trigger at %04x (%04x)\n",activecpu_get_pc(),offset,data); + logerror("%04x: Alpha write trigger at %04x (%04x)\n",cpu_get_pc(machine->activecpu),offset,data); /* 0x44 = coin clear signal to microcontroller? */ if (offset==0x2d && ACCESSING_BITS_0_7) alpha68k_flipscreen_w(data & 1); @@ -437,7 +437,7 @@ static READ16_HANDLER( kyros_alpha_trigger_r ) break; } - logerror("%04x: Alpha read trigger at %04x\n",activecpu_get_pc(),offset); + logerror("%04x: Alpha read trigger at %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; /* Values returned don't matter */ } @@ -533,7 +533,7 @@ static READ16_HANDLER( alpha_II_trigger_r ) break; } - logerror("%04x: Alpha read trigger at %04x\n",activecpu_get_pc(),offset); + logerror("%04x: Alpha read trigger at %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; /* Values returned don't matter */ } @@ -679,7 +679,7 @@ static READ16_HANDLER( alpha_V_trigger_r ) break; } - logerror("%04x: Alpha read trigger at %04x\n",activecpu_get_pc(),offset); + logerror("%04x: Alpha read trigger at %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; /* Values returned don't matter */ } @@ -3029,7 +3029,7 @@ static READ16_HANDLER( timesold_cycle_r ) { int ret=shared_ram[0x4]; - if (activecpu_get_pc()==0x9ea2 && (ret&0xff00)==0) { + if (cpu_get_pc(machine->activecpu)==0x9ea2 && (ret&0xff00)==0) { cpu_spinuntil_int(); return 0x100 | (ret&0xff); } @@ -3041,7 +3041,7 @@ static READ16_HANDLER( timesol1_cycle_r ) { int ret=shared_ram[0x4]; - if (activecpu_get_pc()==0x9e20 && (ret&0xff00)==0) { + if (cpu_get_pc(machine->activecpu)==0x9e20 && (ret&0xff00)==0) { cpu_spinuntil_int(); return 0x100 | (ret&0xff); } @@ -3053,7 +3053,7 @@ static READ16_HANDLER( btlfield_cycle_r ) { int ret=shared_ram[0x4]; - if (activecpu_get_pc()==0x9e1c && (ret&0xff00)==0) { + if (cpu_get_pc(machine->activecpu)==0x9e1c && (ret&0xff00)==0) { cpu_spinuntil_int(); return 0x100 | (ret&0xff); } @@ -3065,7 +3065,7 @@ static READ16_HANDLER( skysoldr_cycle_r ) { int ret=shared_ram[0x4]; - if (activecpu_get_pc()==0x1f4e && (ret&0xff00)==0) { + if (cpu_get_pc(machine->activecpu)==0x1f4e && (ret&0xff00)==0) { cpu_spinuntil_int(); return 0x100 | (ret&0xff); } @@ -3077,7 +3077,7 @@ static READ16_HANDLER( skyadvnt_cycle_r ) { int ret=shared_ram[0x4]; - if (activecpu_get_pc()==0x1f78 && (ret&0xff00)==0) { + if (cpu_get_pc(machine->activecpu)==0x1f78 && (ret&0xff00)==0) { cpu_spinuntil_int(); return 0x100 | (ret&0xff); } @@ -3089,7 +3089,7 @@ static READ16_HANDLER( gangwars_cycle_r ) { int ret=shared_ram[0x103]; - if (activecpu_get_pc()==0xbbb6) { + if (cpu_get_pc(machine->activecpu)==0xbbb6) { cpu_spinuntil_int(); return (ret+2) & 0xff; } @@ -3101,7 +3101,7 @@ static READ16_HANDLER( gangwarb_cycle_r ) { int ret=shared_ram[0x103]; - if (activecpu_get_pc()==0xbbca) { + if (cpu_get_pc(machine->activecpu)==0xbbca) { cpu_spinuntil_int(); return (ret+2) & 0xff; } diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c index 77561c6c4b5..93a9827e242 100644 --- a/src/mame/drivers/aquarium.c +++ b/src/mame/drivers/aquarium.c @@ -130,7 +130,7 @@ static READ8_HANDLER( aquarium_oki_r ) static WRITE8_HANDLER( aquarium_oki_w ) { - logerror("Z80-PC:%04x Writing %04x to the OKI M6295\n",activecpu_get_previouspc(),aquarium_snd_bitswap(data)); + logerror("Z80-PC:%04x Writing %04x to the OKI M6295\n",cpu_get_previouspc(machine->activecpu),aquarium_snd_bitswap(data)); okim6295_data_0_w( machine, 0, (aquarium_snd_bitswap(data)) ); } diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c index f4ac057e8de..37512978b12 100644 --- a/src/mame/drivers/arabian.c +++ b/src/mame/drivers/arabian.c @@ -165,7 +165,7 @@ static READ8_HANDLER( custom_cpu_r ) /* error cases */ default: - logerror("Input Port %04X read. PC=%04X\n", offset+0xd7f0, activecpu_get_pc()); + logerror("Input Port %04X read. PC=%04X\n", offset+0xd7f0, cpu_get_pc(machine->activecpu)); } return 0; } diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c index 597201dc0ec..cdeaa5d55aa 100644 --- a/src/mame/drivers/artmagic.c +++ b/src/mame/drivers/artmagic.c @@ -118,7 +118,7 @@ static WRITE16_HANDLER( control_w ) if (offset == 0) okim6295_set_bank_base(0, (((data >> 4) & 1) * 0x40000) % memory_region_length(machine, "oki")); - logerror("%06X:control_w(%d) = %04X\n", activecpu_get_pc(), offset, data); + logerror("%06X:control_w(%d) = %04X\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -138,7 +138,7 @@ static TIMER_CALLBACK( irq_off ) static READ16_HANDLER( ultennis_hack_r ) { /* IRQ5 points to: jsr (a5); rte */ - if (activecpu_get_pc() == 0x18c2) + if (cpu_get_pc(machine->activecpu) == 0x18c2) { hack_irq = 1; update_irq_state(machine); diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c index 237d1c9e23c..7842c898e29 100644 --- a/src/mame/drivers/astrocorp.c +++ b/src/mame/drivers/astrocorp.c @@ -118,7 +118,7 @@ static WRITE16_HANDLER( astrocorp_sound_bank_w ) if (ACCESSING_BITS_8_15) { okim6295_set_bank_base(0, 0x40000 * ((data >> 8) & 1) ); -// logerror("CPU #0 PC %06X: OKI bank %08X\n",activecpu_get_pc(),data); +// logerror("CPU #0 PC %06X: OKI bank %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -147,7 +147,7 @@ static WRITE16_HANDLER( astrocorp_enable_w ) COMBINE_DATA( &astrocorp_screen_enable ); // popmessage("%04X",data); if (data & (~1)) - logerror("CPU #0 PC %06X: screen enable = %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06X: screen enable = %04X\n",cpu_get_pc(machine->activecpu),data); } static READ16_HANDLER( astrocorp_unk_r ) diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c index fde00ea33b0..271b76889ca 100644 --- a/src/mame/drivers/atarigt.c +++ b/src/mame/drivers/atarigt.c @@ -41,8 +41,8 @@ UINT8 atarigt_is_primrage; static UINT32 * mo_command; -static void (*protection_w)(offs_t offset, UINT16 data); -static void (*protection_r)(offs_t offset, UINT16 *data); +static void (*protection_w)(running_machine *machine, offs_t offset, UINT16 data); +static void (*protection_r)(running_machine *machine, offs_t offset, UINT16 *data); static void cage_irq_callback(running_machine *machine, int reason); @@ -240,7 +240,7 @@ static READ32_HANDLER( sound_data_r ) static WRITE32_HANDLER( sound_data_w ) { if (ACCESSING_BITS_0_15) - cage_control_w(data); + cage_control_w(machine, data); if (ACCESSING_BITS_16_31) main_to_cage_w(data >> 16); } @@ -274,9 +274,9 @@ static void tmek_update_mode(offs_t offset) } -static void tmek_protection_w(offs_t offset, UINT16 data) +static void tmek_protection_w(running_machine *machine, offs_t offset, UINT16 data) { - if (LOG_PROTECTION) logerror("%06X:Protection W@%06X = %04X\n", activecpu_get_previouspc(), offset, data); + if (LOG_PROTECTION) logerror("%06X:Protection W@%06X = %04X\n", cpu_get_previouspc(machine->activecpu), offset, data); /* track accesses */ tmek_update_mode(offset); @@ -289,9 +289,9 @@ static void tmek_protection_w(offs_t offset, UINT16 data) } } -static void tmek_protection_r(offs_t offset, UINT16 *data) +static void tmek_protection_r(running_machine *machine, offs_t offset, UINT16 *data) { - if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", activecpu_get_previouspc(), offset); + if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", cpu_get_previouspc(machine->activecpu), offset); /* track accesses */ tmek_update_mode(offset); @@ -355,11 +355,11 @@ static void primage_update_mode(offs_t offset) -static void primrage_protection_w(offs_t offset, UINT16 data) +static void primrage_protection_w(running_machine *machine, offs_t offset, UINT16 data) { if (LOG_PROTECTION) { - UINT32 pc = activecpu_get_previouspc(); + UINT32 pc = cpu_get_previouspc(machine->activecpu); switch (pc) { /* protection code from 20f90 - 21000 */ @@ -392,7 +392,7 @@ static void primrage_protection_w(offs_t offset, UINT16 data) /* catch anything else */ default: - logerror("%06X:Unknown protection W@%06X = %04X\n", activecpu_get_previouspc(), offset, data); + logerror("%06X:Unknown protection W@%06X = %04X\n", cpu_get_previouspc(machine->activecpu), offset, data); break; } } @@ -425,14 +425,14 @@ static void primrage_protection_w(offs_t offset, UINT16 data) -static void primrage_protection_r(offs_t offset, UINT16 *data) +static void primrage_protection_r(running_machine *machine, offs_t offset, UINT16 *data) { /* track accesses */ primage_update_mode(offset); if (LOG_PROTECTION) { - UINT32 pc = activecpu_get_previouspc(); + UINT32 pc = cpu_get_previouspc(machine->activecpu); UINT32 p1, p2, a6; switch (pc) { @@ -452,7 +452,7 @@ if (LOG_PROTECTION) case 0x275bc: break; case 0x275cc: - a6 = activecpu_get_reg(M68K_A6); + a6 = cpu_get_reg(machine->activecpu, M68K_A6); p1 = (program_read_word(a6+8) << 16) | program_read_word(a6+10); p2 = (program_read_word(a6+12) << 16) | program_read_word(a6+14); logerror("Known Protection @ 275BC(%08X, %08X): R@%06X ", p1, p2, offset); @@ -470,7 +470,7 @@ if (LOG_PROTECTION) /* protection code from 3d8dc - 3d95a */ case 0x3d8f4: - a6 = activecpu_get_reg(M68K_A6); + a6 = cpu_get_reg(machine->activecpu, M68K_A6); p1 = (program_read_word(a6+12) << 16) | program_read_word(a6+14); logerror("Known Protection @ 3D8F4(%08X): R@%06X ", p1, offset); break; @@ -481,7 +481,7 @@ if (LOG_PROTECTION) /* protection code from 437fa - 43860 */ case 0x43814: - a6 = activecpu_get_reg(M68K_A6); + a6 = cpu_get_reg(machine->activecpu, M68K_A6); p1 = program_read_dword(a6+14) & 0xffffff; logerror("Known Protection @ 43814(%08X): R@%06X ", p1, offset); break; @@ -495,7 +495,7 @@ if (LOG_PROTECTION) /* catch anything else */ default: - logerror("%06X:Unknown protection R@%06X\n", activecpu_get_previouspc(), offset); + logerror("%06X:Unknown protection R@%06X\n", cpu_get_previouspc(machine->activecpu), offset); break; } } @@ -548,13 +548,13 @@ static READ32_HANDLER( colorram_protection_r ) if (ACCESSING_BITS_16_31) { result = atarigt_colorram_r(address); - (*protection_r)(address, &result); + (*protection_r)(machine, address, &result); result32 |= result << 16; } if (ACCESSING_BITS_0_15) { result = atarigt_colorram_r(address + 2); - (*protection_r)(address + 2, &result); + (*protection_r)(machine, address + 2, &result); result32 |= result; } @@ -570,13 +570,13 @@ static WRITE32_HANDLER( colorram_protection_w ) { if (!ignore_writes) atarigt_colorram_w(address, data >> 16, mem_mask >> 16); - (*protection_w)(address, data >> 16); + (*protection_w)(machine, address, data >> 16); } if (ACCESSING_BITS_0_15) { if (!ignore_writes) atarigt_colorram_w(address + 2, data, mem_mask); - (*protection_w)(address + 2, data); + (*protection_w)(machine, address + 2, data); } } @@ -1045,19 +1045,19 @@ ROM_END static WRITE32_HANDLER( tmek_pf_w ) { - offs_t pc = activecpu_get_pc(); + offs_t pc = cpu_get_pc(machine->activecpu); /* protected version */ if (pc == 0x2EB3C || pc == 0x2EB48) { - logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", activecpu_get_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)activecpu_get_reg(M68K_A4) - 2); + logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", cpu_get_pc(machine->activecpu), 0xd72000 + offset*4, data, mem_mask, (UINT32)cpu_get_reg(machine->activecpu, M68K_A4) - 2); /* skip these writes to make more stuff visible */ return; } /* unprotected version */ if (pc == 0x25834 || pc == 0x25860) - logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", activecpu_get_pc(), 0xd72000 + offset*4, data, mem_mask, (UINT32)activecpu_get_reg(M68K_A3) - 2); + logerror("%06X:PFW@%06X = %08X & %08X (src=%06X)\n", cpu_get_pc(machine->activecpu), 0xd72000 + offset*4, data, mem_mask, (UINT32)cpu_get_reg(machine->activecpu, M68K_A3) - 2); atarigen_playfield32_w(machine, offset, data, mem_mask); } diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c index 90736076ced..7874e2d6883 100644 --- a/src/mame/drivers/atarigx2.c +++ b/src/mame/drivers/atarigx2.c @@ -160,9 +160,9 @@ static UINT16 last_write_offset; static WRITE32_HANDLER( atarigx2_protection_w ) { { - int pc = activecpu_get_previouspc(); + int pc = cpu_get_previouspc(machine->activecpu); // if (pc == 0x11cbe || pc == 0x11c30) -// logerror("%06X:Protection W@%04X = %04X (result to %06X)\n", pc, offset, data, activecpu_get_reg(M68K_A2)); +// logerror("%06X:Protection W@%04X = %04X (result to %06X)\n", pc, offset, data, cpu_get_reg(machine->activecpu, M68K_A2)); // else if (ACCESSING_BITS_16_31) logerror("%06X:Protection W@%04X = %04X\n", pc, offset * 4, data >> 16); @@ -1140,14 +1140,14 @@ static READ32_HANDLER( atarigx2_protection_r ) result = mame_rand(machine) << 16; else result = 0xffff << 16; - logerror("%06X:Unhandled protection R@%04X = %04X\n", activecpu_get_previouspc(), offset, result); + logerror("%06X:Unhandled protection R@%04X = %04X\n", cpu_get_previouspc(machine->activecpu), offset, result); } } if (ACCESSING_BITS_16_31) - logerror("%06X:Protection R@%04X = %04X\n", activecpu_get_previouspc(), offset * 4, result >> 16); + logerror("%06X:Protection R@%04X = %04X\n", cpu_get_previouspc(machine->activecpu), offset * 4, result >> 16); else - logerror("%06X:Protection R@%04X = %04X\n", activecpu_get_previouspc(), offset * 4 + 2, result); + logerror("%06X:Protection R@%04X = %04X\n", cpu_get_previouspc(machine->activecpu), offset * 4 + 2, result); return result; } diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c index 59825aabf06..85e1389bd83 100644 --- a/src/mame/drivers/atetris.c +++ b/src/mame/drivers/atetris.c @@ -149,7 +149,7 @@ static MACHINE_RESET( atetris ) static READ8_HANDLER( atetris_slapstic_r ) { int result = slapstic_base[0x2000 + offset]; - int new_bank = slapstic_tweak(offset) & 1; + int new_bank = slapstic_tweak(machine, offset) & 1; /* update for the new bank */ if (new_bank != current_bank) diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c index 6da7effc553..9333381aa37 100644 --- a/src/mame/drivers/backfire.c +++ b/src/mame/drivers/backfire.c @@ -235,14 +235,14 @@ static READ32_HANDLER(backfire_eeprom_r) static READ32_HANDLER(backfire_control2_r) { -// logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask); +// logerror("%08x:Read eprom %08x (%08x)\n",cpu_get_pc(machine->activecpu),offset<<1,mem_mask); return (eeprom_read_bit()<<24) | input_port_read(machine, "IN1") | (input_port_read(machine, "IN1")<<16); } #ifdef UNUSED_FUNCTION static READ32_HANDLER(backfire_control3_r) { -// logerror("%08x:Read eprom %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask); +// logerror("%08x:Read eprom %08x (%08x)\n",cpu_get_pc(machine->activecpu),offset<<1,mem_mask); return (eeprom_read_bit()<<24) | input_port_read(machine, "IN2") | (input_port_read(machine, "IN2")<<16); } #endif @@ -250,7 +250,7 @@ static READ32_HANDLER(backfire_control3_r) static WRITE32_HANDLER(backfire_eeprom_w) { - logerror("%08x:write eprom %08x (%08x) %08x\n",activecpu_get_pc(),offset<<1,mem_mask,data); + logerror("%08x:write eprom %08x (%08x) %08x\n",cpu_get_pc(machine->activecpu),offset<<1,mem_mask,data); if (ACCESSING_BITS_0_7) { eeprom_set_clock_line((data & 0x2) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(data & 0x1); @@ -666,10 +666,10 @@ static void descramble_sound( running_machine *machine ) static READ32_HANDLER( backfire_speedup_r ) { -// mame_printf_debug( "%08x\n",activecpu_get_pc()); +// mame_printf_debug( "%08x\n",cpu_get_pc(machine->activecpu)); - if (activecpu_get_pc()==0xce44) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); // backfire - if (activecpu_get_pc()==0xcee4) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); // backfira + if (cpu_get_pc(machine->activecpu)==0xce44) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); // backfire + if (cpu_get_pc(machine->activecpu)==0xcee4) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); // backfira return backfire_mainram[0x18/4]; } diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c index 74d1abbc1c0..35f7e5470e9 100644 --- a/src/mame/drivers/bbusters.c +++ b/src/mame/drivers/bbusters.c @@ -283,7 +283,7 @@ static READ16_HANDLER( control_3_r ) static WRITE16_HANDLER( gun_select_w ) { - logerror("%08x: gun r\n",activecpu_get_pc()); + logerror("%08x: gun r\n",cpu_get_pc(machine->activecpu)); gun_select = data & 0xff; } diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c index 04347adcba4..713d678007a 100644 --- a/src/mame/drivers/beathead.c +++ b/src/mame/drivers/beathead.c @@ -479,7 +479,7 @@ static UINT32 *speedup_data; static READ32_HANDLER( speedup_r ) { int result = *speedup_data; - if ((activecpu_get_previouspc() & 0xfffff) == 0x006f0 && result == activecpu_get_reg(ASAP_R3)) + if ((cpu_get_previouspc(machine->activecpu) & 0xfffff) == 0x006f0 && result == cpu_get_reg(machine->activecpu, ASAP_R3)) cpu_spinuntil_int(); return result; } @@ -489,11 +489,11 @@ static UINT32 *movie_speedup_data; static READ32_HANDLER( movie_speedup_r ) { int result = *movie_speedup_data; - if ((activecpu_get_previouspc() & 0xfffff) == 0x00a88 && (activecpu_get_reg(ASAP_R28) & 0xfffff) == 0x397c0 && - movie_speedup_data[4] == activecpu_get_reg(ASAP_R1)) + if ((cpu_get_previouspc(machine->activecpu) & 0xfffff) == 0x00a88 && (cpu_get_reg(machine->activecpu, ASAP_R28) & 0xfffff) == 0x397c0 && + movie_speedup_data[4] == cpu_get_reg(machine->activecpu, ASAP_R1)) { UINT32 temp = (INT16)result + movie_speedup_data[4] * 262; - if (temp - (UINT32)activecpu_get_reg(ASAP_R15) < (UINT32)activecpu_get_reg(ASAP_R23)) + if (temp - (UINT32)cpu_get_reg(machine->activecpu, ASAP_R15) < (UINT32)cpu_get_reg(machine->activecpu, ASAP_R23)) cpu_spinuntil_int(); } return result; diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c index 2de7b8357f5..44b8fab50ad 100644 --- a/src/mame/drivers/bfcobra.c +++ b/src/mame/drivers/bfcobra.c @@ -440,7 +440,7 @@ static void RunBlit(running_machine *machine) /* This debug is now wrong ! */ if (DEBUG_BLITTER) { - mame_printf_debug("\nBlitter (%x): Running command from 0x%.5x\n\n", activecpu_get_previouspc(), blitter.program.addr - 12); + mame_printf_debug("\nBlitter (%x): Running command from 0x%.5x\n\n", cpu_get_previouspc(machine->activecpu), blitter.program.addr - 12); mame_printf_debug("Command Reg %.2x", blitter.command); mame_printf_debug(" %s %s %s %s %s %s %s\n", blitter.command & CMD_RUN ? "RUN" : " ", @@ -730,7 +730,7 @@ static READ8_HANDLER( ramdac_r ) } default: { - mame_printf_debug("Unhandled RAMDAC read (PC:%.4x)\n", activecpu_get_previouspc()); + mame_printf_debug("Unhandled RAMDAC read (PC:%.4x)\n", cpu_get_previouspc(machine->activecpu)); } } @@ -868,7 +868,7 @@ static READ8_HANDLER( chipset_r ) } default: { - mame_printf_debug("Flare One unknown read: 0x%.2x (PC:0x%.4x)\n", offset, activecpu_get_previouspc()); + mame_printf_debug("Flare One unknown read: 0x%.2x (PC:0x%.4x)\n", offset, cpu_get_previouspc(machine->activecpu)); } } @@ -884,7 +884,7 @@ static WRITE8_HANDLER( chipset_w ) case 0x03: { if (data > 0x3f) - popmessage("%x: Unusual bank access (%x)\n", activecpu_get_previouspc(), data); + popmessage("%x: Unusual bank access (%x)\n", cpu_get_previouspc(machine->activecpu), data); data &= 0x3f; bank[offset] = data; @@ -958,7 +958,7 @@ static WRITE8_HANDLER( chipset_w ) } default: { - mame_printf_debug("Flare One unknown write: 0x%.2x with 0x%.2x (PC:0x%.4x)\n", offset, data, activecpu_get_previouspc()); + mame_printf_debug("Flare One unknown write: 0x%.2x with 0x%.2x (PC:0x%.4x)\n", offset, data, cpu_get_previouspc(machine->activecpu)); } } } diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c index 8b111454220..543df23a6e5 100644 --- a/src/mame/drivers/bigevglf.c +++ b/src/mame/drivers/bigevglf.c @@ -88,7 +88,7 @@ static TIMER_CALLBACK( from_sound_latch_callback ) } static WRITE8_HANDLER(beg_fromsound_w) /* write to D800 sets bit 1 in status */ { - timer_call_after_resynch(NULL, (activecpu_get_pc()<<16)|data, from_sound_latch_callback); + timer_call_after_resynch(NULL, (cpu_get_pc(machine->activecpu)<<16)|data, from_sound_latch_callback); } static READ8_HANDLER(beg_fromsound_r) diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c index e68c422b74f..520a9c0833a 100644 --- a/src/mame/drivers/bionicc.c +++ b/src/mame/drivers/bionicc.c @@ -85,13 +85,13 @@ static UINT16 bionicc_inp[3]; static WRITE16_HANDLER( hacked_controls_w ) { -logerror("%06x: hacked_controls_w %04x %02x\n",activecpu_get_pc(),offset,data); +logerror("%06x: hacked_controls_w %04x %02x\n",cpu_get_pc(machine->activecpu),offset,data); COMBINE_DATA(&bionicc_inp[offset]); } static READ16_HANDLER( hacked_controls_r ) { -logerror("%06x: hacked_controls_r %04x %04x\n",activecpu_get_pc(),offset,bionicc_inp[offset]); +logerror("%06x: hacked_controls_r %04x %04x\n",cpu_get_pc(machine->activecpu),offset,bionicc_inp[offset]); return bionicc_inp[offset]; } diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c index 95da5b73af1..1db8d13e514 100644 --- a/src/mame/drivers/bking.c +++ b/src/mame/drivers/bking.c @@ -225,7 +225,7 @@ static READ8_HANDLER( bking3_68705_portC_r ) int portC_in = 0; if (main_sent) portC_in |= 0x01; if (!mcu_sent) portC_in |= 0x02; -//logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),portC_in); +//logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(machine->activecpu),portC_in); return portC_in; } #endif diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c index c87caf35dd2..1a170309ea5 100644 --- a/src/mame/drivers/blktiger.c +++ b/src/mame/drivers/blktiger.c @@ -41,8 +41,8 @@ VIDEO_EOF( blktiger ); /* if a read from this address doesn't return the value it expects. */ static READ8_HANDLER( blktiger_protection_r ) { - int data = activecpu_get_reg(Z80_DE) >> 8; - logerror("protection read, PC: %04x Result:%02x\n",activecpu_get_pc(),data); + int data = cpu_get_reg(machine->activecpu, Z80_DE) >> 8; + logerror("protection read, PC: %04x Result:%02x\n",cpu_get_pc(machine->activecpu),data); return data; } diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c index a14b80cf940..8fa5e371e56 100644 --- a/src/mame/drivers/blockhl.c +++ b/src/mame/drivers/blockhl.c @@ -313,14 +313,14 @@ static void blockhl_banking( int lines ) /* other bits unknown */ - if ((lines & 0x84) != 0x80) logerror("%04x: setlines %02x\n",activecpu_get_pc(),lines); + if ((lines & 0x84) != 0x80) logerror("%04x: setlines %02x\n",cpu_get_pc(Machine->activecpu),lines); } static MACHINE_RESET( blockhl ) { UINT8 *RAM = memory_region(machine, "main"); - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)blockhl_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)blockhl_banking); paletteram = &RAM[0x18000]; } diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c index 63b3048526e..4dc2957cf63 100644 --- a/src/mame/drivers/bmcbowl.c +++ b/src/mame/drivers/bmcbowl.c @@ -180,10 +180,10 @@ static READ16_HANDLER( bmc_random_read ) static READ16_HANDLER( bmc_protection_r ) { - switch(activecpu_get_previouspc()) + switch(cpu_get_previouspc(machine->activecpu)) { case 0xca68: - switch(activecpu_get_reg(M68K_D2)) + switch(cpu_get_reg(machine->activecpu, M68K_D2)) { case 0: return 0x37<<8; case 0x1013: return 0; @@ -191,7 +191,7 @@ static READ16_HANDLER( bmc_protection_r ) } break; } - logerror("Protection read @ %X\n",activecpu_get_previouspc()); + logerror("Protection read @ %X\n",cpu_get_previouspc(machine->activecpu)); return mame_rand(machine); } @@ -449,7 +449,7 @@ static READ8_HANDLER(dips1_r) case 0x00: return input_port_read(machine, "IN1"); case 0x40: return input_port_read(machine, "IN2"); } - logerror("unknown input - %X (PC=%X)\n",bmc_input,activecpu_get_previouspc()); + logerror("unknown input - %X (PC=%X)\n",bmc_input,cpu_get_previouspc(machine->activecpu)); return 0xff; } diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c index 3369b08aece..a4dbbe93f2b 100644 --- a/src/mame/drivers/btime.c +++ b/src/mame/drivers/btime.c @@ -93,11 +93,11 @@ static void btime_decrypt(running_machine *machine) /* xxxx xxx1 xxxx x1xx are encrypted. */ /* get the address of the next opcode */ - addr = activecpu_get_pc(); + addr = cpu_get_pc(machine->activecpu); /* however if the previous instruction was JSR (which caused a write to */ /* the stack), fetch the address of the next instruction. */ - addr1 = activecpu_get_previouspc(); + addr1 = cpu_get_previouspc(machine->activecpu); src1 = (addr1 < 0x9000) ? rambase : memory_region(machine, "main"); if (decrypted[addr1] == 0x20) /* JSR $xxxx */ addr = src1[addr1+1] + 256 * src1[addr1+2]; @@ -122,7 +122,7 @@ static WRITE8_HANDLER( lnc_w ) else if (offset == 0x9000) { return; } /* SMH_NOP */ else if (offset == 0x9002) { audio_command_w(machine,0,data); return; } else if (offset >= 0xb000 && offset <= 0xb1ff) ; - else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); rambase[offset] = data; @@ -140,7 +140,7 @@ static WRITE8_HANDLER( mmonkey_w ) else if (offset == 0x9000) { return; } /* SMH_NOP */ else if (offset == 0x9002) { audio_command_w(machine,0,data); return; } else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(machine,offset - 0xb000, data); return; } - else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); rambase[offset] = data; @@ -158,7 +158,7 @@ static WRITE8_HANDLER( btime_w ) else if (offset == 0x4002) btime_video_control_w(machine,0,data); else if (offset == 0x4003) audio_command_w(machine,0,data); else if (offset == 0x4004) bnj_scroll1_w(machine,0,data); - else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); rambase[offset] = data; @@ -176,7 +176,7 @@ static WRITE8_HANDLER( zoar_w ) else if (offset == 0x9804) bnj_scroll2_w(machine,0,data); else if (offset == 0x9805) bnj_scroll1_w(machine,0,data); else if (offset == 0x9806) audio_command_w(machine,0,data); - else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); rambase[offset] = data; @@ -190,7 +190,7 @@ static WRITE8_HANDLER( disco_w ) else if (offset >= 0x8000 && offset <= 0x881f) ; else if (offset == 0x9a00) audio_command_w(machine,0,data); else if (offset == 0x9c00) disco_video_control_w(machine,0,data); - else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + else logerror("CPU #%d PC %04x: warning - write %02x to unmapped memory address %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); rambase[offset] = data; diff --git a/src/mame/drivers/btoads.c b/src/mame/drivers/btoads.c index be4f288afa1..605b5b912c7 100644 --- a/src/mame/drivers/btoads.c +++ b/src/mame/drivers/btoads.c @@ -128,7 +128,7 @@ static READ8_HANDLER( sound_ready_to_send_r ) static READ8_HANDLER( sound_data_ready_r ) { - if (activecpu_get_pc() == 0xd50 && !main_to_sound_ready) + if (cpu_get_pc(machine->activecpu) == 0xd50 && !main_to_sound_ready) cpu_spinuntil_int(); return main_to_sound_ready ? 0x00 : 0x80; } diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c index 69d05e90001..19012a2149b 100644 --- a/src/mame/drivers/cave.c +++ b/src/mame/drivers/cave.c @@ -251,7 +251,7 @@ static READ16_HANDLER( soundlatch_ack_r ) return data; } else - { logerror("CPU #1 - PC %04X: Sound Buffer 2 Underflow Error\n",activecpu_get_pc()); + { logerror("CPU #1 - PC %04X: Sound Buffer 2 Underflow Error\n",cpu_get_pc(machine->activecpu)); return 0xff; } } @@ -263,7 +263,7 @@ static WRITE8_HANDLER( soundlatch_ack_w ) if (soundbuf.len<32) soundbuf.len++; else - logerror("CPU #1 - PC %04X: Sound Buffer 2 Overflow Error\n",activecpu_get_pc()); + logerror("CPU #1 - PC %04X: Sound Buffer 2 Overflow Error\n",cpu_get_pc(machine->activecpu)); } @@ -312,7 +312,7 @@ static int cave_region_byte; static WRITE16_HANDLER( cave_eeprom_msb_w ) { if (data & ~0xfe00) - logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(machine->activecpu),data); if ( ACCESSING_BITS_8_15 ) // even address { @@ -356,7 +356,7 @@ static WRITE16_HANDLER( hotdogst_eeprom_msb_w ) static WRITE16_HANDLER( cave_eeprom_lsb_w ) { if (data & ~0x00ef) - logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(machine->activecpu),data); if ( ACCESSING_BITS_0_7 ) // odd address { @@ -391,7 +391,7 @@ static WRITE16_HANDLER( gaia_coin_lsb_w ) static WRITE16_HANDLER( metmqstr_eeprom_msb_w ) { if (data & ~0xff00) - logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(machine->activecpu),data); if ( ACCESSING_BITS_8_15 ) // even address { @@ -833,7 +833,7 @@ static WRITE16_HANDLER( korokoro_eeprom_msb_w ) { if (data & ~0x7000) { - logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(machine->activecpu),data); COMBINE_DATA( &leds[1] ); show_leds(); } @@ -1067,7 +1067,7 @@ static READ16_HANDLER( agallet_irq_cause_r ) if (offset == 0) { // Speed hack for agallet - if ((activecpu_get_pc() == 0xcdca) && (irq_cause & 4)) + if ((cpu_get_pc(machine->activecpu) == 0xcdca) && (irq_cause & 4)) cpu_spinuntil_int(); } @@ -1174,7 +1174,7 @@ static WRITE8_HANDLER( hotdogst_rombank_w ) { UINT8 *RAM = memory_region(machine, "audio"); int bank = data & 0x0f; - if ( data & ~0x0f ) logerror("CPU #1 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); + if ( data & ~0x0f ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(machine->activecpu),data); if (bank > 1) bank+=2; memory_set_bankptr(2, &RAM[ 0x4000 * bank ]); } @@ -1227,7 +1227,7 @@ static WRITE8_HANDLER( mazinger_rombank_w ) { UINT8 *RAM = memory_region(machine, "audio"); int bank = data & 0x07; - if ( data & ~0x07 ) logerror("CPU #1 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); + if ( data & ~0x07 ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(machine->activecpu),data); if (bank > 1) bank+=2; memory_set_bankptr(2, &RAM[ 0x4000 * bank ]); } @@ -1271,7 +1271,7 @@ static WRITE8_HANDLER( metmqstr_rombank_w ) { UINT8 *ROM = memory_region(machine, "audio"); int bank = data & 0xf; - if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); + if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(machine->activecpu),data); if (bank >= 2) bank += 2; memory_set_bankptr(1, &ROM[ 0x4000 * bank ]); } @@ -1334,7 +1334,7 @@ static WRITE8_HANDLER( pwrinst2_rombank_w ) { UINT8 *ROM = memory_region(machine, "audio"); int bank = data & 0x07; - if ( data & ~0x07 ) logerror("CPU #1 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); + if ( data & ~0x07 ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(machine->activecpu),data); if (bank > 2) bank+=1; memory_set_bankptr(1, &ROM[ 0x4000 * bank ]); } @@ -1392,7 +1392,7 @@ static WRITE8_HANDLER( sailormn_rombank_w ) { UINT8 *RAM = memory_region(machine, "audio"); int bank = data & 0x1f; - if ( data & ~0x1f ) logerror("CPU #1 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); + if ( data & ~0x1f ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(machine->activecpu),data); if (bank > 1) bank+=2; memory_set_bankptr(1, &RAM[ 0x4000 * bank ]); } diff --git a/src/mame/drivers/cbasebal.c b/src/mame/drivers/cbasebal.c index 74c170bedf4..a3c098f9ee8 100644 --- a/src/mame/drivers/cbasebal.c +++ b/src/mame/drivers/cbasebal.c @@ -35,7 +35,7 @@ static UINT8 rambank; static WRITE8_HANDLER( cbasebal_bankswitch_w ) { /* bits 0-4 select ROM bank */ -//logerror("%04x: bankswitch %02x\n",activecpu_get_pc(),data); +//logerror("%04x: bankswitch %02x\n",cpu_get_pc(machine->activecpu),data); memory_set_bank(1, data & 0x1f); /* bit 5 used but unknown */ diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c index 8e6d0bc3593..aa8bc46c995 100644 --- a/src/mame/drivers/cbuster.c +++ b/src/mame/drivers/cbuster.c @@ -83,7 +83,7 @@ static WRITE16_HANDLER( twocrude_control_w ) break; } - logerror("Warning %04x- %02x written to control %02x\n",activecpu_get_pc(),data,offset); + logerror("Warning %04x- %02x written to control %02x\n",cpu_get_pc(machine->activecpu),data,offset); } static READ16_HANDLER( twocrude_control_r ) @@ -97,7 +97,7 @@ static READ16_HANDLER( twocrude_control_r ) return input_port_read(machine, "DSW"); case 4: /* Protection */ - logerror("%04x : protection control read at 30c000 %d\n",activecpu_get_pc(),offset); + logerror("%04x : protection control read at 30c000 %d\n",cpu_get_pc(machine->activecpu),offset); return prot; case 6: /* Credits, VBL in byte 7 */ diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c index c213f52db1d..72f9bcb7241 100644 --- a/src/mame/drivers/centiped.c +++ b/src/mame/drivers/centiped.c @@ -598,7 +598,7 @@ static WRITE8_HANDLER( mazeinv_input_select_w ) static READ8_HANDLER( bullsdrt_data_port_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x0033: case 0x6b19: diff --git a/src/mame/drivers/chaknpop.c b/src/mame/drivers/chaknpop.c index 9b8944c6ed6..e09521ab4d5 100644 --- a/src/mame/drivers/chaknpop.c +++ b/src/mame/drivers/chaknpop.c @@ -18,17 +18,17 @@ static WRITE8_HANDLER ( unknown_port_1_w ) { - //logerror("%04x: write to unknow port 1: 0x%02x\n", activecpu_get_pc(), data); + //logerror("%04x: write to unknow port 1: 0x%02x\n", cpu_get_pc(machine->activecpu), data); } static WRITE8_HANDLER ( unknown_port_2_w ) { - //logerror("%04x: write to unknow port 2: 0x%02x\n", activecpu_get_pc(), data); + //logerror("%04x: write to unknow port 2: 0x%02x\n", cpu_get_pc(machine->activecpu), data); } static WRITE8_HANDLER ( coinlock_w ) { - logerror("%04x: coin lock %sable\n", activecpu_get_pc(), data ? "dis" : "en"); + logerror("%04x: coin lock %sable\n", cpu_get_pc(machine->activecpu), data ? "dis" : "en"); } diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c index 31ece2ed43c..b292ef390f9 100644 --- a/src/mame/drivers/cinemat.c +++ b/src/mame/drivers/cinemat.c @@ -155,7 +155,7 @@ static UINT8 joystick_read(void) return 0; else { - int xval = (INT16)(cpunum_get_reg(0, CCPU_X) << 4) >> 4; + int xval = (INT16)(cpu_get_reg(Machine->cpu[0], CCPU_X) << 4) >> 4; return (input_port_read_safe(Machine, mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800; } } @@ -281,7 +281,7 @@ static READ8_HANDLER( qb3_frame_r ) static WRITE8_HANDLER( qb3_ram_bank_w ) { - memory_set_bank(1, cpunum_get_reg(0, CCPU_P) & 3); + memory_set_bank(1, cpu_get_reg(machine->cpu[0], CCPU_P) & 3); } diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c index 9087245b3d7..7c23db0b7fe 100644 --- a/src/mame/drivers/cninja.c +++ b/src/mame/drivers/cninja.c @@ -100,7 +100,7 @@ static READ16_HANDLER( cninja_irq_r ) return 0; } - logerror("%08x: Unmapped IRQ read %d\n",activecpu_get_pc(),offset); + logerror("%08x: Unmapped IRQ read %d\n",cpu_get_pc(machine->activecpu),offset); return 0; } @@ -113,7 +113,7 @@ static WRITE16_HANDLER( cninja_irq_w ) 0xc8: Raster IRQ turned on (68k IRQ level 4) 0xd8: Raster IRQ turned on (68k IRQ level 3) */ - logerror("%08x: IRQ write %d %08x\n",activecpu_get_pc(),offset,data); + logerror("%08x: IRQ write %d %08x\n",cpu_get_pc(machine->activecpu),offset,data); cninja_irq_mask=data&0xff; return; @@ -129,7 +129,7 @@ static WRITE16_HANDLER( cninja_irq_w ) return; } - logerror("%08x: Unmapped IRQ write %d %04x\n",activecpu_get_pc(),offset,data); + logerror("%08x: Unmapped IRQ write %d %04x\n",cpu_get_pc(machine->activecpu),offset,data); } static READ16_HANDLER( robocop2_prot_r ) @@ -142,10 +142,10 @@ static READ16_HANDLER( robocop2_prot_r ) case 0x4e6: /* Dip switches */ return input_port_read(machine, "DSW"); case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */ - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset); + logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(machine->activecpu),offset); return 0x84; } - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset); + logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; } diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c index 31c311f0fac..8b4c81681c8 100644 --- a/src/mame/drivers/cntsteer.c +++ b/src/mame/drivers/cntsteer.c @@ -310,7 +310,7 @@ static WRITE8_HANDLER( cntsteer_sound_w ) static WRITE8_HANDLER( zerotrgt_ctrl_w ) { - logerror("CTRL: %04x: %04x: %04x\n",activecpu_get_pc(),offset,data); + logerror("CTRL: %04x: %04x: %04x\n",cpu_get_pc(machine->activecpu),offset,data); // if (offset==0) cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, ASSERT_LINE); // Wrong - bits 0 & 1 used on this diff --git a/src/mame/drivers/cojag.c b/src/mame/drivers/cojag.c index a366db92d8b..c1e68c8efc3 100644 --- a/src/mame/drivers/cojag.c +++ b/src/mame/drivers/cojag.c @@ -401,7 +401,7 @@ static READ32_HANDLER( misc_control_r ) static WRITE32_HANDLER( misc_control_w ) { - logerror("%08X:misc_control_w(%02X)\n", activecpu_get_previouspc(), data); + logerror("%08X:misc_control_w(%02X)\n", cpu_get_previouspc(machine->activecpu), data); /* D7 = board reset (low) D6 = audio must & reset (high) @@ -486,7 +486,7 @@ static READ32_HANDLER( jaguar_wave_rom_r ) static WRITE32_HANDLER( latch_w ) { - logerror("%08X:latch_w(%X)\n", activecpu_get_previouspc(), data); + logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(machine->activecpu), data); /* adjust banking */ if (memory_region(machine, "user2")) @@ -530,7 +530,7 @@ static WRITE32_HANDLER( eeprom_data_w ) generic_nvram32[offset] = data & 0xff000000; } // else -// logerror("%08X:error writing to disabled EEPROM\n", activecpu_get_previouspc()); +// logerror("%08X:error writing to disabled EEPROM\n", cpu_get_previouspc(machine->activecpu)); eeprom_enable = 0; } @@ -579,7 +579,7 @@ static WRITE32_HANDLER( gpu_jump_w ) { /* update the data in memory */ COMBINE_DATA(gpu_jump_address); - logerror("%08X:GPU jump address = %08X\n", activecpu_get_previouspc(), *gpu_jump_address); + logerror("%08X:GPU jump address = %08X\n", cpu_get_previouspc(machine->activecpu), *gpu_jump_address); /* if the GPU is suspended, release it now */ jaguar_gpu_resume(); @@ -594,7 +594,7 @@ static READ32_HANDLER( gpu_jump_r ) { /* if the current GPU command is just pointing back to the spin loop, and */ /* we're reading it from the spin loop, we can optimize */ - if (*gpu_jump_address == gpu_spin_pc && activecpu_get_previouspc() == gpu_spin_pc) + if (*gpu_jump_address == gpu_spin_pc && cpu_get_previouspc(machine->activecpu) == gpu_spin_pc) { #if ENABLE_SPEEDUP_HACKS /* spin if we're allowed */ diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c index 80bfdde143e..6123e860523 100644 --- a/src/mame/drivers/combatsc.c +++ b/src/mame/drivers/combatsc.c @@ -243,7 +243,7 @@ static READ8_HANDLER ( combasc_YM2203_status_port_0_r ) static int boost = 1; int status = ym2203_status_port_0_r(machine,0); - if (activecpu_get_pc() == 0x334) + if (cpu_get_pc(machine->activecpu) == 0x334) { if (boost) { diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c index 32189e0ac63..9ababdd2809 100644 --- a/src/mame/drivers/coolpool.c +++ b/src/mame/drivers/coolpool.c @@ -215,7 +215,7 @@ static WRITE16_HANDLER( nvram_thrash_data_w ) static WRITE16_HANDLER( amerdart_misc_w ) { - logerror("%08x:IOP_reset_w %04x\n",activecpu_get_pc(),data); + logerror("%08x:IOP_reset_w %04x\n",cpu_get_pc(machine->activecpu),data); coin_counter_w(0, ~data & 0x0001); coin_counter_w(1, ~data & 0x0002); @@ -277,7 +277,7 @@ static TIMER_CALLBACK( amerdart_iop_response ) static WRITE16_HANDLER( amerdart_iop_w ) { - logerror("%08x:IOP write %04x\n", activecpu_get_pc(), data); + logerror("%08x:IOP write %04x\n", cpu_get_pc(machine->activecpu), data); COMBINE_DATA(&iop_cmd); timer_set(ATTOTIME_IN_USEC(100), NULL, 0, amerdart_iop_response); } @@ -292,7 +292,7 @@ static WRITE16_HANDLER( amerdart_iop_w ) static WRITE16_HANDLER( coolpool_misc_w ) { - logerror("%08x:IOP_reset_w %04x\n",activecpu_get_pc(),data); + logerror("%08x:IOP_reset_w %04x\n",cpu_get_pc(machine->activecpu),data); coin_counter_w(0, ~data & 0x0001); coin_counter_w(1, ~data & 0x0002); @@ -322,14 +322,14 @@ static TIMER_CALLBACK( deferred_iop_w ) static WRITE16_HANDLER( coolpool_iop_w ) { - logerror("%08x:IOP write %04x\n", activecpu_get_pc(), data); + logerror("%08x:IOP write %04x\n", cpu_get_pc(machine->activecpu), data); timer_call_after_resynch(NULL, data, deferred_iop_w); } static READ16_HANDLER( coolpool_iop_r ) { - logerror("%08x:IOP read %04x\n",activecpu_get_pc(),iop_answer); + logerror("%08x:IOP read %04x\n",cpu_get_pc(machine->activecpu),iop_answer); cpunum_set_input_line(machine, 0, 1, CLEAR_LINE); return iop_answer; @@ -347,14 +347,14 @@ static READ16_HANDLER( coolpool_iop_r ) static READ16_HANDLER( dsp_cmd_r ) { cmd_pending = 0; - logerror("%08x:IOP cmd_r %04x\n",activecpu_get_pc(),iop_cmd); + logerror("%08x:IOP cmd_r %04x\n",cpu_get_pc(machine->activecpu),iop_cmd); return iop_cmd; } static WRITE16_HANDLER( dsp_answer_w ) { - logerror("%08x:IOP answer %04x\n",activecpu_get_pc(),data); + logerror("%08x:IOP answer %04x\n",cpu_get_pc(machine->activecpu),data); iop_answer = data; cpunum_set_input_line(machine, 0, 1, ASSERT_LINE); } @@ -471,7 +471,7 @@ static READ16_HANDLER( coolpool_input_r ) } } -// logerror("%08X:read port 7 (X=%02X Y=%02X oldX=%02X oldY=%02X res=%04X)\n", activecpu_get_pc(), +// logerror("%08X:read port 7 (X=%02X Y=%02X oldX=%02X oldY=%02X res=%04X)\n", cpu_get_pc(machine->activecpu), // newx, newy, oldx, oldy, result); lastresult = result; return result; diff --git a/src/mame/drivers/couple.c b/src/mame/drivers/couple.c index eab4d3f3a1f..d53d8a5fab0 100644 --- a/src/mame/drivers/couple.c +++ b/src/mame/drivers/couple.c @@ -89,7 +89,7 @@ static WRITE8_HANDLER( couple_vram_hi_w ) #ifdef UNUSED_FUNCTION static READ8_HANDLER( dummy_inputs_r ) { - logerror("Read %02x @ %06x\n",offset,activecpu_get_pc()); + logerror("Read %02x @ %06x\n",offset,cpu_get_pc(machine->activecpu)); return 0xff; } #endif diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c index 99192ea00da..b1a1bd979e6 100644 --- a/src/mame/drivers/cps1.c +++ b/src/mame/drivers/cps1.c @@ -355,7 +355,7 @@ static READ16_HANDLER( qsound_rom_r ) if (rom) return rom[offset] | 0xff00; else { - popmessage("%06x: read sound ROM byte %04x",activecpu_get_pc(),offset); + popmessage("%06x: read sound ROM byte %04x",cpu_get_pc(machine->activecpu),offset); return 0; } } diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c index 3c4892a12cf..c567c0a666d 100644 --- a/src/mame/drivers/cps3.c +++ b/src/mame/drivers/cps3.c @@ -725,7 +725,7 @@ static DRIVER_INIT( cps3 ) int i; // set strict verify - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY); cps3_key1 = -1; cps3_key2 = -1; @@ -2604,7 +2604,7 @@ static UINT32 cps3_dma_callback(UINT32 src, UINT32 dst, UINT32 data, int size) } else { - //printf("PC %08x :src %08x, dst %08x, returning %08x\n", activecpu_get_pc(), src, dst, data); + //printf("PC %08x :src %08x, dst %08x, returning %08x\n", cpu_get_pc(machine->activecpu), src, dst, data); } /* I doubt this is endian safe.. needs checking / fixing */ diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c index 0e4be76459b..6abee53bd41 100644 --- a/src/mame/drivers/crbaloon.c +++ b/src/mame/drivers/crbaloon.c @@ -63,7 +63,7 @@ static WRITE8_HANDLER( pc3092_w ) { pc3092_data[offset] = data & 0x0f; - if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", safe_activecpu_get_pc(), offset, pc3092_data[offset]); + if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", safe_cpu_get_pc(machine->activecpu), offset, pc3092_data[offset]); pc3092_update(); } @@ -79,7 +79,7 @@ static CUSTOM_INPUT( pc3092_r ) else ret = 0x00; - if (LOG_PC3092) logerror("%04X: read PC3092 = 0x%02x\n", safe_activecpu_get_pc(), ret); + if (LOG_PC3092) logerror("%04X: read PC3092 = 0x%02x\n", safe_cpu_get_pc(field->port->machine->activecpu), ret); return ret; } @@ -143,7 +143,7 @@ static READ8_HANDLER( pc3259_r ) break; } - if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", safe_activecpu_get_pc(), reg, ret); + if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", safe_cpu_get_pc(machine->activecpu), reg, ret); return ret | (input_port_read(machine, "DSW1") & 0xf0); } diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c index 0e5cf365488..5a8aa444820 100644 --- a/src/mame/drivers/crgolf.c +++ b/src/mame/drivers/crgolf.c @@ -109,7 +109,7 @@ static WRITE8_HANDLER( switch_input_select_w ) static WRITE8_HANDLER( unknown_w ) { - logerror("%04X:unknown_w = %02X\n", activecpu_get_pc(), data); + logerror("%04X:unknown_w = %02X\n", cpu_get_pc(machine->activecpu), data); } diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c index 2625b43a2db..527c0ffa0ab 100644 --- a/src/mame/drivers/crimfght.c +++ b/src/mame/drivers/crimfght.c @@ -440,7 +440,7 @@ static MACHINE_RESET( crimfght ) { UINT8 *RAM = memory_region(machine, "main"); - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)crimfght_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)crimfght_banking); /* init the default bank */ memory_set_bankptr( 2, &RAM[0x10000] ); diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c index e592325ffb2..9112ce22ef6 100644 --- a/src/mame/drivers/cubeqst.c +++ b/src/mame/drivers/cubeqst.c @@ -115,7 +115,7 @@ static VIDEO_UPDATE( cubeqst ) /* Bit 3 selects LD/#GRAPHICS */ fillbitmap(bitmap, colormap[255], cliprect); - cpuintrf_push_context(LINE_CPU); + cpu_push_context(screen->machine->cpu[LINE_CPU]); /* TODO: Add 1 for linebuffering? */ for (y = cliprect->min_y; y <= cliprect->max_y; ++y) @@ -174,7 +174,7 @@ static VIDEO_UPDATE( cubeqst ) } } - cpuintrf_pop_context(); + cpu_pop_context(); return 0; } @@ -249,13 +249,13 @@ static WRITE16_HANDLER( control_w ) static TIMER_CALLBACK( delayed_bank_swap ) { - cpuintrf_push_context(LINE_CPU); + cpu_push_context(machine->cpu[LINE_CPU]); cubeqcpu_swap_line_banks(); /* TODO: This is a little dubious */ clear_stack(); - cpuintrf_pop_context(); + cpu_pop_context(); } diff --git a/src/mame/drivers/cubocd32.c b/src/mame/drivers/cubocd32.c index 5cbafba6a0c..4b730d32b07 100644 --- a/src/mame/drivers/cubocd32.c +++ b/src/mame/drivers/cubocd32.c @@ -116,14 +116,14 @@ static void cd32_cia_0_porta_w(UINT8 data) static UINT8 cd32_cia_0_portb_r(void) { /* parallel port */ - logerror("%06x:CIA0_portb_r\n", activecpu_get_pc()); + logerror("%06x:CIA0_portb_r\n", cpu_get_pc(Machine->activecpu)); return 0xff; } static void cd32_cia_0_portb_w(UINT8 data) { /* parallel port */ - logerror("%06x:CIA0_portb_w(%02x)\n", activecpu_get_pc(), data); + logerror("%06x:CIA0_portb_w(%02x)\n", cpu_get_pc(Machine->activecpu), data); } static ADDRESS_MAP_START( cd32_map, ADDRESS_SPACE_PROGRAM, 32 ) diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c index 9beacfb3528..125d4ac0688 100644 --- a/src/mame/drivers/cvs.c +++ b/src/mame/drivers/cvs.c @@ -153,7 +153,7 @@ UINT8 cvs_get_character_banking_mode(void) READ8_HANDLER( cvs_video_or_color_ram_r ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) return cvs_video_ram[offset]; else return cvs_color_ram[offset]; @@ -161,7 +161,7 @@ READ8_HANDLER( cvs_video_or_color_ram_r ) WRITE8_HANDLER( cvs_video_or_color_ram_w ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) cvs_video_ram[offset] = data; else cvs_color_ram[offset] = data; @@ -170,7 +170,7 @@ WRITE8_HANDLER( cvs_video_or_color_ram_w ) READ8_HANDLER( cvs_bullet_ram_or_palette_r ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) return cvs_palette_ram[offset & 0x0f]; else return cvs_bullet_ram[offset]; @@ -178,7 +178,7 @@ READ8_HANDLER( cvs_bullet_ram_or_palette_r ) WRITE8_HANDLER( cvs_bullet_ram_or_palette_w ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) cvs_palette_ram[offset & 0x0f] = data; else cvs_bullet_ram[offset] = data; @@ -187,7 +187,7 @@ WRITE8_HANDLER( cvs_bullet_ram_or_palette_w ) READ8_HANDLER( cvs_s2636_0_or_character_ram_r ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) return cvs_character_ram[(0 * 0x800) | 0x400 | character_ram_page_start | offset]; else return cvs_s2636_0_ram[offset]; @@ -195,7 +195,7 @@ READ8_HANDLER( cvs_s2636_0_or_character_ram_r ) WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) cvs_character_ram[(0 * 0x800) | 0x400 | character_ram_page_start | offset] = data; else cvs_s2636_0_ram[offset] = data; @@ -204,7 +204,7 @@ WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w ) READ8_HANDLER( cvs_s2636_1_or_character_ram_r ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) return cvs_character_ram[(1 * 0x800) | 0x400 | character_ram_page_start | offset]; else return cvs_s2636_1_ram[offset]; @@ -212,7 +212,7 @@ READ8_HANDLER( cvs_s2636_1_or_character_ram_r ) WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) cvs_character_ram[(1 * 0x800) | 0x400 | character_ram_page_start | offset] = data; else cvs_s2636_1_ram[offset] = data; @@ -221,7 +221,7 @@ WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w ) READ8_HANDLER( cvs_s2636_2_or_character_ram_r ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) return cvs_character_ram[(2 * 0x800) | 0x400 | character_ram_page_start | offset]; else return cvs_s2636_2_ram[offset]; @@ -229,7 +229,7 @@ READ8_HANDLER( cvs_s2636_2_or_character_ram_r ) WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w ) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) cvs_character_ram[(2 * 0x800) | 0x400 | character_ram_page_start | offset] = data; else cvs_s2636_2_ram[offset] = data; @@ -283,7 +283,7 @@ static READ8_HANDLER( cvs_input_r ) case 0x04: ret = input_port_read(machine, "IN3"); break; case 0x06: ret = input_port_read(machine, "DSW3"); break; case 0x07: ret = input_port_read(machine, "DSW2"); break; - default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", activecpu_get_pc(), offset & 0x0f); break; + default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", cpu_get_pc(machine->activecpu), offset & 0x0f); break; } return ret; @@ -388,7 +388,7 @@ static WRITE8_HANDLER( cvs_speech_rom_address_lo_w ) { /* assuming that d0-d2 are cleared here */ speech_rom_bit_address = (speech_rom_bit_address & 0xf800) | (data << 3); - LOG(("%04x : CVS: Speech Address = %04x\n", activecpu_get_pc(), speech_rom_bit_address >> 3)); + LOG(("%04x : CVS: Speech Address = %04x\n", cpu_get_pc(machine->activecpu), speech_rom_bit_address >> 3)); } static WRITE8_HANDLER( cvs_speech_rom_address_hi_w ) @@ -400,7 +400,7 @@ static WRITE8_HANDLER( cvs_speech_rom_address_hi_w ) static void cvs_set_speech_command_w(running_machine *machine, UINT8 data) { soundlatch2_w(machine, 0, data & 0x7f); - if (~data & 0x40) LOG(("%04x : CVS: Speech Command W = %04x\n", activecpu_get_pc(), data & 0x7f)); + if (~data & 0x40) LOG(("%04x : CVS: Speech Command W = %04x\n", cpu_get_pc(machine->activecpu), data & 0x7f)); } @@ -470,7 +470,7 @@ static WRITE8_HANDLER( audio_command_w ) soundlatch_w(machine, 0, data); cvs_dac_cpu_interrupt(); - LOG(("%04x : CVS: Audio command = %02x\n", activecpu_get_pc(), data)); + LOG(("%04x : CVS: Audio command = %02x\n", cpu_get_pc(machine->activecpu), data)); } cvs_set_speech_command_w(machine, data); diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c index c1ff1203ed5..cb166d85412 100644 --- a/src/mame/drivers/cybertnk.c +++ b/src/mame/drivers/cybertnk.c @@ -178,7 +178,7 @@ static UINT16 *tx_vram; static UINT16 *shared_ram; static UINT16 *io_ram; -#define LOG_UNKNOWN_WRITE logerror("unknown io write CPU%d:%08x 0x%08x 0x%04x & 0x%04x\n", cpu_getactivecpu(), activecpu_get_pc(), offset*2, data, mem_mask); +#define LOG_UNKNOWN_WRITE logerror("unknown io write CPU%d:%08x 0x%08x 0x%04x & 0x%04x\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); #define IGNORE_MISSING_ROM 1 static TILE_GET_INFO( get_tx_tile_info ) diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c index d6a2ecb29d8..4c4e21ad498 100644 --- a/src/mame/drivers/darius.c +++ b/src/mame/drivers/darius.c @@ -167,7 +167,7 @@ static WRITE16_HANDLER( cpua_ctrl_w ) parse_control(machine); - logerror("CPU #0 PC %06x: write %04x to cpu control\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(machine->activecpu),data); } static WRITE16_HANDLER( darius_watchdog_w ) @@ -203,7 +203,7 @@ static READ16_HANDLER( darius_ioc_r ) return input_port_read(machine, "DSW"); } -logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } @@ -238,7 +238,7 @@ static WRITE16_HANDLER( darius_ioc_w ) return; } -logerror("CPU #0 PC %06x: warning - write unmapped ioc offset %06x with %04x\n",activecpu_get_pc(),offset,data); +logerror("CPU #0 PC %06x: warning - write unmapped ioc offset %06x with %04x\n",cpu_get_pc(machine->activecpu),offset,data); } @@ -528,7 +528,7 @@ static const msm5205_interface msm5205_config = static READ8_HANDLER( adpcm_command_read ) { - /* logerror("read port 0: %02x PC=%4x\n",adpcm_command, activecpu_get_pc() ); */ + /* logerror("read port 0: %02x PC=%4x\n",adpcm_command, cpu_get_pc(machine->activecpu) ); */ return adpcm_command; } @@ -545,13 +545,13 @@ static READ8_HANDLER( readport3 ) static WRITE8_HANDLER ( adpcm_nmi_disable ) { nmi_enable = 0; - /* logerror("write port 0: NMI DISABLE PC=%4x\n", data, activecpu_get_pc() ); */ + /* logerror("write port 0: NMI DISABLE PC=%4x\n", data, cpu_get_pc(machine->activecpu) ); */ } static WRITE8_HANDLER ( adpcm_nmi_enable ) { nmi_enable = 1; - /* logerror("write port 1: NMI ENABLE PC=%4x\n", activecpu_get_pc() ); */ + /* logerror("write port 1: NMI ENABLE PC=%4x\n", cpu_get_pc(machine->activecpu) ); */ } static WRITE8_HANDLER( adpcm_data_w ) diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c index d4d06a77632..4791967125f 100644 --- a/src/mame/drivers/darkhors.c +++ b/src/mame/drivers/darkhors.c @@ -234,7 +234,7 @@ static NVRAM_HANDLER( darkhors ) static WRITE32_HANDLER( darkhors_eeprom_w ) { if (data & ~0xff000000) - logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %08X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %08X\n",cpu_get_pc(machine->activecpu),data); if ( ACCESSING_BITS_24_31 ) { diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c index 8987bf81bc1..81df29e6cb7 100644 --- a/src/mame/drivers/dassault.c +++ b/src/mame/drivers/dassault.c @@ -811,7 +811,7 @@ static READ16_HANDLER( dassault_main_skip ) { int ret=dassault_ram[0]; - if (activecpu_get_previouspc()==0x1170 && ret&0x8000) + if (cpu_get_previouspc(machine->activecpu)==0x1170 && ret&0x8000) cpu_spinuntil_int(); return ret; @@ -821,7 +821,7 @@ static READ16_HANDLER( thndzone_main_skip ) { int ret=dassault_ram[0]; - if (activecpu_get_pc()==0x114c && ret&0x8000) + if (cpu_get_pc(machine->activecpu)==0x114c && ret&0x8000) cpu_spinuntil_int(); return ret; diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c index 28f1264e8c5..d214a26c772 100644 --- a/src/mame/drivers/dblewing.c +++ b/src/mame/drivers/dblewing.c @@ -269,7 +269,7 @@ static READ16_HANDLER ( dlbewing_prot_r ) if ((offset*2)==0x748) return 0;//dblwings_408_data; // dblwings_408_data // 3rd player 1st level? if ((offset*2)==0x786) return 0; - mame_printf_debug("dblewing prot r %08x, %04x, %04x\n",activecpu_get_pc(), offset*2, mem_mask); + mame_printf_debug("dblewing prot r %08x, %04x, %04x\n",cpu_get_pc(machine->activecpu), offset*2, mem_mask); return 0;//mame_rand(machine); } @@ -295,7 +295,7 @@ static WRITE16_HANDLER( dblewing_prot_w ) if ((offset*2)==0x78a) { dblwings_78a_data = data; return; } if ((offset*2)==0x788) { dblwings_788_data = data; return; } - mame_printf_debug("dblewing prot w %08x, %04x, %04x %04x\n",activecpu_get_pc(), offset*2, mem_mask,data); + mame_printf_debug("dblewing prot w %08x, %04x, %04x %04x\n",cpu_get_pc(machine->activecpu), offset*2, mem_mask,data); } static ADDRESS_MAP_START( dblewing_map, ADDRESS_SPACE_PROGRAM, 16 ) diff --git a/src/mame/drivers/dcheese.c b/src/mame/drivers/dcheese.c index 4b0e56d2ee4..5071f9c93ca 100644 --- a/src/mame/drivers/dcheese.c +++ b/src/mame/drivers/dcheese.c @@ -182,7 +182,7 @@ static WRITE8_HANDLER( sound_control_w ) if ((diff & 0x40) && (data & 0x40)) sndti_reset(SOUND_BSMT2000, 0); if (data != 0x40 && data != 0x60) - logerror("%04X:sound_control_w = %02X\n", activecpu_get_pc(), data); + logerror("%04X:sound_control_w = %02X\n", cpu_get_pc(machine->activecpu), data); } diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c index 2b8ea14f183..450c2ded314 100644 --- a/src/mame/drivers/ddenlovr.c +++ b/src/mame/drivers/ddenlovr.c @@ -591,11 +591,11 @@ static void blit_vert_line(void) -INLINE void log_blit(int data) +INLINE void log_blit(running_machine *machine, int data) { #if 1 logerror("%06x: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x clip: ctrl %x xy %03x %03x wh %03x %03x\n", - activecpu_get_pc(), + cpu_get_pc(machine->activecpu), ddenlovr_blit_address,ddenlovr_blit_x,ddenlovr_blit_y,data, ddenlovr_dest_layer,ddenlovr_blit_pen,ddenlovr_blit_pen_mode,ddenlovr_rect_width,ddenlovr_rect_height,ddenlovr_line_length, ddenlovr_clip_ctrl,ddenlovr_clip_x,ddenlovr_clip_y, ddenlovr_clip_width,ddenlovr_clip_height ); @@ -703,7 +703,7 @@ profiler_mark(PROFILER_VIDEO); case 0x24: - log_blit(data); + log_blit(machine, data); switch (data) { @@ -734,7 +734,7 @@ profiler_mark(PROFILER_VIDEO); ; #ifdef MAME_DEBUG popmessage("unknown blitter command %02x",data); - logerror("%06x: unknown blitter command %02x\n", activecpu_get_pc(), data); + logerror("%06x: unknown blitter command %02x\n", cpu_get_pc(machine->activecpu), data); #endif } @@ -753,7 +753,7 @@ profiler_mark(PROFILER_VIDEO); break; default: - logerror("%06x: Blitter %d reg %02x = %02x\n", activecpu_get_pc(), blitter, ddenlovr_blit_reg[blitter], data); + logerror("%06x: Blitter %d reg %02x = %02x\n", cpu_get_pc(machine->activecpu), blitter, ddenlovr_blit_reg[blitter], data); break; } } @@ -866,7 +866,7 @@ profiler_mark(PROFILER_VIDEO); case 0x24: - log_blit(data); + log_blit(machine, data); switch (data) { @@ -903,7 +903,7 @@ profiler_mark(PROFILER_VIDEO); ; #ifdef MAME_DEBUG popmessage("unknown blitter command %02x",data); - logerror("%06x: unknown blitter command %02x\n", activecpu_get_pc(), data); + logerror("%06x: unknown blitter command %02x\n", cpu_get_pc(machine->activecpu), data); #endif } @@ -911,7 +911,7 @@ profiler_mark(PROFILER_VIDEO); break; default: - logerror("%06x: Blitter %d reg %02x = %02x\n", activecpu_get_pc(), blitter, ddenlovr_blit_reg[blitter], data); + logerror("%06x: Blitter %d reg %02x = %02x\n", cpu_get_pc(machine->activecpu), blitter, ddenlovr_blit_reg[blitter], data); break; } } @@ -1070,7 +1070,7 @@ profiler_mark(PROFILER_VIDEO); case 0x90: - log_blit(data); + log_blit(machine, data); switch (data) { @@ -1101,7 +1101,7 @@ profiler_mark(PROFILER_VIDEO); ; #ifdef MAME_DEBUG popmessage("unknown blitter command %02x",data); - logerror("%06x: unknown blitter command %02x\n", activecpu_get_pc(), data); + logerror("%06x: unknown blitter command %02x\n", cpu_get_pc(machine->activecpu), data); #endif } @@ -1110,7 +1110,7 @@ profiler_mark(PROFILER_VIDEO); break; default: - logerror("%06x: Blitter 0 reg %02x = %02x\n", activecpu_get_pc(), ddenlovr_blit_reg, data); + logerror("%06x: Blitter 0 reg %02x = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_blit_reg, data); break; } @@ -1155,7 +1155,7 @@ static READ8_HANDLER( rongrong_gfxrom_r ) if (address >= size) { - logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", activecpu_get_pc(), address); + logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", cpu_get_pc(machine->activecpu), address); address %= size; } @@ -1486,7 +1486,7 @@ static WRITE16_HANDLER( ddenlovr_select2_16_w ) static READ8_HANDLER( rongrong_input2_r ) { -// logerror("%04x: input2_r offset %d select %x\n",activecpu_get_pc(),offset,ddenlovr_select2 ); +// logerror("%04x: input2_r offset %d select %x\n",cpu_get_pc(machine->activecpu),offset,ddenlovr_select2 ); /* 0 and 1 are read from offset 1, 2 from offset 0... */ switch( ddenlovr_select2 ) { @@ -1510,7 +1510,7 @@ static READ8_HANDLER( quiz365_input_r ) static READ16_HANDLER( quiz365_input2_r ) { -// logerror("%04x: input2_r offset %d select %x\n",activecpu_get_pc(),offset,ddenlovr_select2 ); +// logerror("%04x: input2_r offset %d select %x\n",cpu_get_pc(machine->activecpu),offset,ddenlovr_select2 ); /* 0 and 1 are read from offset 1, 2 from offset 0... */ switch( ddenlovr_select2 ) { @@ -1527,7 +1527,7 @@ static WRITE8_HANDLER( rongrong_blitter_busy_w ) { rongrong_blitter_busy_select = data; if (data != 0x18) - logerror("%04x: rongrong_blitter_busy_w data = %02x\n",activecpu_get_pc(),data); + logerror("%04x: rongrong_blitter_busy_w data = %02x\n",cpu_get_pc(machine->activecpu),data); } static READ8_HANDLER( rongrong_blitter_busy_r ) { @@ -1536,7 +1536,7 @@ static READ8_HANDLER( rongrong_blitter_busy_r ) case 0x18: return 0; // bit 5 = blitter busy default: - logerror("%04x: rongrong_blitter_busy_r with select = %02x\n",activecpu_get_pc(),rongrong_blitter_busy_select); + logerror("%04x: rongrong_blitter_busy_r with select = %02x\n",cpu_get_pc(machine->activecpu),rongrong_blitter_busy_select); } return 0xff; } @@ -1826,7 +1826,7 @@ static WRITE8_HANDLER( rongrong_select_w ) { UINT8 *rom = memory_region(machine, "main"); -//logerror("%04x: rongrong_select_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: rongrong_select_w %02x\n",cpu_get_pc(machine->activecpu),data); /* bits 0-4 = **both** ROM bank **AND** input select */ memory_set_bankptr(1, &rom[0x10000 + 0x8000 * (data & 0x1f)]); ddenlovr_select = data; @@ -2139,7 +2139,7 @@ static READ8_HANDLER( funkyfig_dsw_r ) if (!(ddenlovr_select & 0x01)) return input_port_read(machine, "DSW1"); if (!(ddenlovr_select & 0x02)) return input_port_read(machine, "DSW2"); if (!(ddenlovr_select & 0x04)) return input_port_read(machine, "DSW3"); - logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select); + logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select); return 0xff; } @@ -2152,7 +2152,7 @@ static READ8_HANDLER( funkyfig_coin_r ) case 0x22: return input_port_read(machine, "IN2"); case 0x23: return funkyfig_lockout; } - logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2); + logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select2); return 0xff; } @@ -2163,7 +2163,7 @@ static READ8_HANDLER( funkyfig_key_r ) case 0x20: return input_port_read(machine, "IN0"); case 0x21: return input_port_read(machine, "IN1"); } - logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2); + logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select2); return 0xff; } @@ -2176,13 +2176,13 @@ static WRITE8_HANDLER( funkyfig_lockout_w ) coin_counter_w(0, data & 0x01); coin_lockout_w(0,(~data) & 0x02); if (data & ~0x03) - logerror("%06x: warning, unknown bits written, lockout = %02x\n", activecpu_get_pc(), data); + logerror("%06x: warning, unknown bits written, lockout = %02x\n", cpu_get_pc(machine->activecpu), data); break; // case 0xef: 16 bytes on startup default: - logerror("%06x: warning, unknown bits written, ddenlovr_select2 = %02x, data = %02x\n", activecpu_get_pc(), ddenlovr_select2, data); + logerror("%06x: warning, unknown bits written, ddenlovr_select2 = %02x, data = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select2, data); } } @@ -2306,7 +2306,7 @@ static READ8_HANDLER( hanakanz_gfxrom_r ) if (address >= size) { - logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", activecpu_get_pc(), address); + logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", cpu_get_pc(machine->activecpu), address); address %= size; } @@ -2336,7 +2336,7 @@ static WRITE8_HANDLER( hanakanz_coincounter_w ) coin_counter_w(0, data & 1); if (data & 0xf0) - logerror("%04x: warning, coin counter = %02x\n", activecpu_get_pc(), data); + logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(machine->activecpu), data); #ifdef MAME_DEBUG // popmessage("93 = %02x",data); @@ -2503,7 +2503,7 @@ static void mjchuuka_get_romdata(running_machine *machine) if (address >= size) { - logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", activecpu_get_pc(), address); + logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", cpu_get_pc(machine->activecpu), address); address %= size; } @@ -2554,7 +2554,7 @@ static WRITE8_HANDLER( mjchuuka_coincounter_w ) coin_lockout_w(0,(~data) & 0x08); if (data & 0x74) - logerror("%04x: warning, coin counter = %02x\n", activecpu_get_pc(), data); + logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(machine->activecpu), data); #ifdef MAME_DEBUG // popmessage("40 = %02x",data); @@ -2624,7 +2624,7 @@ static WRITE8_HANDLER( mjmyster_rambank_w ) { UINT8 *rom = memory_region(machine, "main"); memory_set_bankptr(2, &rom[0x90000 + 0x1000 * (data & 0x07)]); -// logerror("%04x: rambank = %02x\n", activecpu_get_pc(), data); +// logerror("%04x: rambank = %02x\n", cpu_get_pc(machine->activecpu), data); } static WRITE8_HANDLER( mjmyster_select2_w ) @@ -2644,7 +2644,7 @@ static READ8_HANDLER( mjmyster_coins_r ) case 0x03: return 0xff; } - logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2); + logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select2); return 0xff; } @@ -2658,7 +2658,7 @@ static READ8_HANDLER( mjmyster_keyb_r ) else if (keyb & 0x04) ret = input_port_read(machine, "KEY2"); else if (keyb & 0x08) ret = input_port_read(machine, "KEY3"); else if (keyb & 0x10) ret = input_port_read(machine, "KEY4"); - else logerror("%06x: warning, unknown bits read, keyb = %02x\n", activecpu_get_pc(), keyb); + else logerror("%06x: warning, unknown bits read, keyb = %02x\n", cpu_get_pc(machine->activecpu), keyb); keyb <<= 1; @@ -2672,7 +2672,7 @@ static READ8_HANDLER( mjmyster_dsw_r ) if (!(ddenlovr_select & 0x04)) return input_port_read(machine, "DSW2"); if (!(ddenlovr_select & 0x08)) return input_port_read(machine, "DSW1"); if (!(ddenlovr_select & 0x10)) return input_port_read(machine, "DSW5"); - logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select); + logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select); return 0xff; } @@ -2690,7 +2690,7 @@ static WRITE8_HANDLER( mjmyster_coincounter_w ) break; default: - logerror("%06x: warning, unknown bits written, ddenlovr_select2 = %02x, data = %02x\n", activecpu_get_pc(), ddenlovr_select2, data); + logerror("%06x: warning, unknown bits written, ddenlovr_select2 = %02x, data = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select2, data); } } @@ -2775,7 +2775,7 @@ static READ8_HANDLER( hginga_dsw_r ) if (!(ddenlovr_select & 0x04)) return input_port_read(machine, "DSW2"); if (!(ddenlovr_select & 0x08)) return input_port_read(machine, "DSW1"); if (!(ddenlovr_select & 0x10)) return input_port_read(machine, "DSW5"); - logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", activecpu_get_pc(), ddenlovr_select); + logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select); return 0xff; } @@ -2796,7 +2796,7 @@ static READ8_HANDLER( hginga_coins_r ) case 0x22: return 0x7f; // bit 7 = blitter busy, bit 6 = hopper case 0x23: return hginga_coins; } - logerror("%04x: coins_r with select = %02x\n", activecpu_get_pc(), hginga_select); + logerror("%04x: coins_r with select = %02x\n", cpu_get_pc(machine->activecpu), hginga_select); return 0xff; } @@ -2824,7 +2824,7 @@ static WRITE8_HANDLER( hginga_coins_w ) hginga_coins = data; break; default: - logerror("%04x: coins_w with select = %02x, data = %02x\n", activecpu_get_pc(), hginga_select, data); + logerror("%04x: coins_w with select = %02x, data = %02x\n", cpu_get_pc(machine->activecpu), hginga_select, data); } } @@ -2846,7 +2846,7 @@ static READ8_HANDLER( hginga_input_r ) case 0xa2: return input_port_read(machine, keynames1[hginga_ip++]); } - logerror("%04x: input_r with select = %02x\n", activecpu_get_pc(), hginga_select); + logerror("%04x: input_r with select = %02x\n", cpu_get_pc(machine->activecpu), hginga_select); return 0xff; } @@ -2940,7 +2940,7 @@ static READ8_HANDLER( hgokou_input_r ) case 0x22: return hgokou_player_r(machine, 0); case 0x23: return hginga_coins; } - logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", activecpu_get_pc(), hginga_select); + logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", cpu_get_pc(machine->activecpu), hginga_select); return 0xff; } @@ -2965,7 +2965,7 @@ static WRITE8_HANDLER( hgokou_input_w ) case 0x2f: break; // ? written with 2f default: - logerror("%04x: input_w with select = %02x, data = %02x\n",activecpu_get_pc(),hginga_select,data); + logerror("%04x: input_w with select = %02x, data = %02x\n",cpu_get_pc(machine->activecpu),hginga_select,data); } } @@ -3055,7 +3055,7 @@ static READ8_HANDLER( hparadis_input_r ) case 0x80: return input_port_read(machine, keynames0[hginga_ip++]); // P1 (Keys) case 0x81: return input_port_read(machine, keynames1[hginga_ip++]); // P2 (Keys) } - logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", activecpu_get_pc(), hginga_select); + logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", cpu_get_pc(machine->activecpu), hginga_select); return 0xff; } @@ -3076,7 +3076,7 @@ static WRITE8_HANDLER( hparadis_coin_w ) case 0x0c: coin_counter_w(0, data & 1); break; case 0x0d: break; default: - logerror("%04x: coins_w with select = %02x, data = %02x\n",activecpu_get_pc(),hginga_select,data); + logerror("%04x: coins_w with select = %02x, data = %02x\n",cpu_get_pc(machine->activecpu),hginga_select,data); } } @@ -3135,7 +3135,7 @@ static READ8_HANDLER( mjmywrld_coins_r ) case 0x83: return 0x00; } - logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", activecpu_get_pc(), ddenlovr_select2); + logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(machine->activecpu), ddenlovr_select2); return 0xff; } @@ -3322,7 +3322,7 @@ static WRITE8_HANDLER( mjflove_coincounter_w ) if (data & 0xfe) { - logerror("%04x: warning, coin counter = %02x\n", activecpu_get_pc(), data); + logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(machine->activecpu), data); // popmessage("COIN = %02x",data); } } @@ -6594,7 +6594,7 @@ static INTERRUPT_GEN( quizchq_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise quizchq would lock up. */ - if (cpunum_get_info_int(0,CPUINFO_INT_INPUT_STATE + 0)) + if (cpu_get_info_int(machine->cpu[0],CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) @@ -6674,7 +6674,7 @@ static INTERRUPT_GEN( mmpanic_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise the game would lock up. */ - if (cpunum_get_info_int(0,CPUINFO_INT_INPUT_STATE + 0)) + if (cpu_get_info_int(machine->cpu[0],CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) @@ -6746,7 +6746,7 @@ static INTERRUPT_GEN( hanakanz_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise quizchq would lock up. */ - if (cpunum_get_info_int(0,CPUINFO_INT_INPUT_STATE + 0)) + if (cpu_get_info_int(machine->cpu[0],CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) @@ -6822,7 +6822,7 @@ static INTERRUPT_GEN( mjchuuka_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise quizchq would lock up. */ - if (cpunum_get_info_int(0,CPUINFO_INT_INPUT_STATE + 0)) + if (cpu_get_info_int(machine->cpu[0],CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) @@ -6880,7 +6880,7 @@ static INTERRUPT_GEN( mjmyster_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise quizchq would lock up. */ - if (cpunum_get_info_int(0,CPUINFO_INT_INPUT_STATE + 0)) + if (cpu_get_info_int(machine->cpu[0],CPUINFO_INT_INPUT_STATE + 0)) return; switch( cpu_getiloops() ) @@ -6936,7 +6936,7 @@ static INTERRUPT_GEN( hginga_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise hginga would lock up. */ - if (cpunum_get_info_int(0,CPUINFO_INT_INPUT_STATE + 0)) + if (cpu_get_info_int(machine->cpu[0],CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c index 3292800cb6b..a460ccf69a4 100644 --- a/src/mame/drivers/ddragon.c +++ b/src/mame/drivers/ddragon.c @@ -243,7 +243,7 @@ static WRITE8_HANDLER( toffy_bankswitch_w ) static READ8_HANDLER( darktowr_mcu_bank_r ) { - // logerror("BankRead %05x %08x\n",activecpu_get_pc(),offset); + // logerror("BankRead %05x %08x\n",cpu_get_pc(machine->activecpu),offset); /* Horrible hack - the alternate TStrike set is mismatched against the MCU, so just hack around the protection here. (The hacks are 'right' as I have @@ -252,9 +252,9 @@ static READ8_HANDLER( darktowr_mcu_bank_r ) if (!strcmp(machine->gamedrv->name, "tstrike")) { /* Static protection checks at boot-up */ - if (activecpu_get_pc() == 0x9ace) + if (cpu_get_pc(machine->activecpu) == 0x9ace) return 0; - if (activecpu_get_pc() == 0x9ae4) + if (cpu_get_pc(machine->activecpu) == 0x9ae4) return 0x63; /* Just return whatever the code is expecting */ @@ -271,7 +271,7 @@ static READ8_HANDLER( darktowr_mcu_bank_r ) static WRITE8_HANDLER( darktowr_mcu_bank_w ) { - logerror("BankWrite %05x %08x %08x\n", activecpu_get_pc(), offset, data); + logerror("BankWrite %05x %08x %08x\n", cpu_get_pc(machine->activecpu), offset, data); if (offset == 0x1400 || offset == 0) { @@ -374,14 +374,14 @@ static CUSTOM_INPUT( sub_cpu_busy ) static WRITE8_HANDLER( darktowr_mcu_w ) { - logerror("McuWrite %05x %08x %08x\n",activecpu_get_pc(),offset,data); + logerror("McuWrite %05x %08x %08x\n",cpu_get_pc(machine->activecpu),offset,data); darktowr_mcu_ports[offset]=data; } static READ8_HANDLER( ddragon_hd63701_internal_registers_r ) { - logerror("%04x: read %d\n", activecpu_get_pc(), offset); + logerror("%04x: read %d\n", cpu_get_pc(machine->activecpu), offset); return 0; } @@ -413,7 +413,7 @@ static WRITE8_HANDLER( ddragon_hd63701_internal_registers_w ) static READ8_HANDLER( ddragon_spriteram_r ) { /* Double Dragon crash fix - see notes above */ - if (offset == 0x49 && activecpu_get_pc() == 0x6261 && ddragon_spriteram[offset] == 0x1f) + if (offset == 0x49 && cpu_get_pc(machine->activecpu) == 0x6261 && ddragon_spriteram[offset] == 0x1f) return 0x1; return ddragon_spriteram[offset]; @@ -422,7 +422,7 @@ static READ8_HANDLER( ddragon_spriteram_r ) static WRITE8_HANDLER( ddragon_spriteram_w ) { - if (cpu_getactivecpu() == 1 && offset == 0) + if (cpunum_get_active() == 1 && offset == 0) dd_sub_cpu_busy = 1; ddragon_spriteram[offset] = data; diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c index a2e66e28f48..4b085a071bf 100644 --- a/src/mame/drivers/ddragon3.c +++ b/src/mame/drivers/ddragon3.c @@ -88,7 +88,7 @@ static WRITE16_HANDLER( ddragon3_io16_w ) break; default: - logerror("OUTPUT 1400[%02x] %08x, pc=%06x \n", offset,(unsigned)data, activecpu_get_pc() ); + logerror("OUTPUT 1400[%02x] %08x, pc=%06x \n", offset,(unsigned)data, cpu_get_pc(machine->activecpu) ); break; } } diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c index 4d7d3ecdfd2..81f081692a2 100644 --- a/src/mame/drivers/dec0.c +++ b/src/mame/drivers/dec0.c @@ -83,7 +83,7 @@ static WRITE16_HANDLER( dec0_control_w ) break; case 0xa: /* Mix Psel(?). */ - logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",activecpu_get_pc(),data,0x30c010+(offset<<1)); + logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(machine->activecpu),data,0x30c010+(offset<<1)); break; case 0xc: /* Cblk - coin blockout. Seems to be unused by the games */ @@ -91,11 +91,11 @@ static WRITE16_HANDLER( dec0_control_w ) case 0xe: /* Reset Intel 8751? - not sure, all the games write here at startup */ dec0_i8751_reset(); - logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",activecpu_get_pc(),data,0x30c010+(offset<<1)); + logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(machine->activecpu),data,0x30c010+(offset<<1)); break; default: - logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",activecpu_get_pc(),data,0x30c010+(offset<<1)); + logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(machine->activecpu),data,0x30c010+(offset<<1)); break; } } diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c index 4e1b18592b1..41cb1a10e52 100644 --- a/src/mame/drivers/deco32.c +++ b/src/mame/drivers/deco32.c @@ -286,7 +286,7 @@ static READ32_HANDLER( deco32_irq_controller_r ) // return 0xffffff80 | vblank | (0x40); //test for lock load guns } - logerror("%08x: Unmapped IRQ read %08x (%08x)\n",activecpu_get_pc(),offset,mem_mask); + logerror("%08x: Unmapped IRQ read %08x (%08x)\n",cpu_get_pc(machine->activecpu),offset,mem_mask); return 0xffffffff; } @@ -296,7 +296,7 @@ static WRITE32_HANDLER( deco32_irq_controller_w ) switch (offset) { case 0: /* IRQ enable - probably an irq mask, but only values used are 0xc8 and 0xca */ -// logerror("%08x: IRQ write %d %08x\n",activecpu_get_pc(),offset,data); +// logerror("%08x: IRQ write %d %08x\n",cpu_get_pc(machine->activecpu),offset,data); raster_enable=(data&0xff)==0xc8; /* 0xca seems to be off */ break; @@ -334,7 +334,7 @@ static READ32_HANDLER( captaven_prot_r ) case 0xed4: return input_port_read(machine, "IN2"); /* Misc */ } - logerror("%08x: Unmapped protection read %04x\n",activecpu_get_pc(),offset<<2); + logerror("%08x: Unmapped protection read %04x\n",cpu_get_pc(machine->activecpu),offset<<2); return 0xffffffff; } @@ -372,13 +372,13 @@ static WRITE32_HANDLER( fghthist_eeprom_w ) static READ32_HANDLER( dragngun_service_r ) { -// logerror("%08x:Read service\n",activecpu_get_pc()); +// logerror("%08x:Read service\n",cpu_get_pc(machine->activecpu)); return input_port_read(machine, "IN2"); } static READ32_HANDLER( lockload_gun_mirror_r ) { -//logerror("%08x:Read gun %d\n",activecpu_get_pc(),offset); +//logerror("%08x:Read gun %d\n",cpu_get_pc(machine->activecpu),offset); //return ((mame_rand(machine)%0xffff)<<16) | mame_rand(machine)%0xffff; if (offset) /* Mirror of player 1 and player 2 fire buttons */ return input_port_read(machine, "IN4") | ((mame_rand(machine)%0xff)<<16); @@ -387,7 +387,7 @@ static READ32_HANDLER( lockload_gun_mirror_r ) static READ32_HANDLER( dragngun_prot_r ) { -// logerror("%08x:Read prot %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask); +// logerror("%08x:Read prot %08x (%08x)\n",cpu_get_pc(machine->activecpu),offset<<1,mem_mask); static int strobe=0; if (!strobe) strobe=8; @@ -438,7 +438,7 @@ static WRITE32_HANDLER( dragngun_eeprom_w ) eeprom_set_cs_line((data & 0x4) ? CLEAR_LINE : ASSERT_LINE); return; } - logerror("%08x:Write control 1 %08x %08x\n",activecpu_get_pc(),offset,data); + logerror("%08x:Write control 1 %08x %08x\n",cpu_get_pc(machine->activecpu),offset,data); } static READ32_HANDLER(dragngun_oki_2_r) @@ -463,7 +463,7 @@ static READ32_HANDLER( tattass_prot_r ) case 0x35a: return tattass_eprom_bit << 16; } - logerror("%08x:Read prot %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask); + logerror("%08x:Read prot %08x (%08x)\n",cpu_get_pc(machine->activecpu),offset<<1,mem_mask); return 0xffffffff; } @@ -626,7 +626,7 @@ static READ32_HANDLER( nslasher_prot_r ) case 0x35a: return (eeprom_read_bit()<< 16) | 0xffff; // Debug switch in low word?? } - //logerror("%08x: Read unmapped prot %08x (%08x)\n",activecpu_get_pc(),offset<<1,mem_mask); + //logerror("%08x: Read unmapped prot %08x (%08x)\n",cpu_get_pc(machine->activecpu),offset<<1,mem_mask); return 0xffffffff; } @@ -646,7 +646,7 @@ static WRITE32_HANDLER( nslasher_eeprom_w ) static WRITE32_HANDLER( nslasher_prot_w ) { - //logerror("%08x:write prot %08x (%08x) %08x\n",activecpu_get_pc(),offset<<1,mem_mask,data); + //logerror("%08x:write prot %08x (%08x) %08x\n",cpu_get_pc(machine->activecpu),offset<<1,mem_mask,data); /* Only sound port of chip is used - no protection */ if (offset==0x700/4) { diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c index db5e5520f2e..0b74c10d4d9 100644 --- a/src/mame/drivers/deco_mlc.c +++ b/src/mame/drivers/deco_mlc.c @@ -119,7 +119,7 @@ static READ32_HANDLER(test2_r) { // if (offset==0) // return input_port_read(machine, "IN0"); //0xffffffff; -// logerror("%08x: Test2_r %d\n",activecpu_get_pc(),offset); +// logerror("%08x: Test2_r %d\n",cpu_get_pc(machine->activecpu),offset); return mame_rand(machine); //0xffffffff; } @@ -131,7 +131,7 @@ static READ32_HANDLER(test3_r) */ //if (offset==0) // return mame_rand(machine)|(mame_rand(machine)<<16); -// logerror("%08x: Test3_r %d\n",activecpu_get_pc(),offset); +// logerror("%08x: Test3_r %d\n",cpu_get_pc(machine->activecpu),offset); return 0xffffffff; } @@ -149,7 +149,7 @@ static WRITE32_HANDLER( avengrs_eprom_w ) //volume control todo } else - logerror("%08x: eprom_w %08x mask %08x\n",activecpu_get_pc(),data,mem_mask); + logerror("%08x: eprom_w %08x mask %08x\n",cpu_get_pc(machine->activecpu),data,mem_mask); } static WRITE32_HANDLER( avengrs_palette_w ) @@ -164,7 +164,7 @@ static READ32_HANDLER( avengrs_sound_r ) if (ACCESSING_BITS_24_31) { return ymz280b_status_0_r(machine,0)<<24; } else { - logerror("%08x: non-byte read from sound mask %08x\n",activecpu_get_pc(),mem_mask); + logerror("%08x: non-byte read from sound mask %08x\n",cpu_get_pc(machine->activecpu),mem_mask); } return 0; @@ -178,7 +178,7 @@ static WRITE32_HANDLER( avengrs_sound_w ) else ymz280b_register_0_w(machine,0,data>>24); } else { - logerror("%08x: non-byte written to sound %08x mask %08x\n",activecpu_get_pc(),data,mem_mask); + logerror("%08x: non-byte written to sound %08x mask %08x\n",cpu_get_pc(machine->activecpu),data,mem_mask); } } @@ -186,7 +186,7 @@ static READ32_HANDLER( decomlc_vbl_r ) { static int i=0xffffffff; i ^=0xffffffff; -//logerror("vbl r %08x\n", activecpu_get_pc()); +//logerror("vbl r %08x\n", cpu_get_pc(machine->activecpu)); // Todo: Vblank probably in $10 return i; } @@ -273,7 +273,7 @@ static READ32_HANDLER(stadhr96_prot_146_r) */ offset<<=1; - logerror("%08x: Read prot %04x\n", activecpu_get_pc(), offset); + logerror("%08x: Read prot %04x\n", cpu_get_pc(machine->activecpu), offset); if (offset==0x5c4) return 0xaa55 << 16; @@ -713,7 +713,7 @@ static void descramble_sound( running_machine *machine ) static READ32_HANDLER( avengrgs_speedup_r ) { UINT32 a=mlc_ram[0x89a0/4]; - UINT32 p=activecpu_get_pc(); + UINT32 p=cpu_get_pc(machine->activecpu); if ((p==0x3234 || p==0x32dc) && (a&1)) cpu_spinuntil_int(); @@ -723,13 +723,13 @@ static READ32_HANDLER( avengrgs_speedup_r ) static DRIVER_INIT( avengrgs ) { // init options - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); // set up speed cheat - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x3234); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x32dc); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x3234); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x32dc); mainCpuIsArm=0; memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r ); diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c index 7b2e41a75fa..83c346f12cd 100644 --- a/src/mame/drivers/djboy.c +++ b/src/mame/drivers/djboy.c @@ -401,7 +401,7 @@ static WRITE8_HANDLER( beast_data_w ) { prot_busy_count = 1; - logerror( "0x%04x: prot_w(0x%02x)\n", activecpu_get_pc(), data ); + logerror( "0x%04x: prot_w(0x%02x)\n", cpu_get_pc(machine->activecpu), data ); watchdog_reset_w(machine,0,0); @@ -601,7 +601,7 @@ static WRITE8_HANDLER( beast_data_w ) default: case 0x97: case 0x9a: - logerror( "!!0x%04x: prot_w(0x%02x)\n", activecpu_get_pc(), data ); + logerror( "!!0x%04x: prot_w(0x%02x)\n", cpu_get_pc(machine->activecpu), data ); break; } } @@ -624,7 +624,7 @@ static READ8_HANDLER( beast_data_r ) { logerror( "prot_r: data expected!\n" ); } - logerror( "0x%04x: prot_r() == 0x%02x\n", activecpu_get_pc(), data ); + logerror( "0x%04x: prot_r() == 0x%02x\n", cpu_get_pc(machine->activecpu), data ); return data; } /* beast_data_r */ diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c index 38cf9449ebc..26b7c4644b3 100644 --- a/src/mame/drivers/djmain.c +++ b/src/mame/drivers/djmain.c @@ -417,17 +417,17 @@ static WRITE32_HANDLER( light_ctrl_2_w ) static WRITE32_HANDLER( unknown590000_w ) { - //logerror("%08X: unknown 590000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, mem_mask); + //logerror("%08X: unknown 590000 write %08X: %08X & %08X\n", cpu_get_previouspc(machine->activecpu), offset, data, mem_mask); } static WRITE32_HANDLER( unknown802000_w ) { - //logerror("%08X: unknown 802000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, mem_mask); + //logerror("%08X: unknown 802000 write %08X: %08X & %08X\n", cpu_get_previouspc(machine->activecpu), offset, data, mem_mask); } static WRITE32_HANDLER( unknownc02000_w ) { - //logerror("%08X: unknown c02000 write %08X: %08X & %08X\n", activecpu_get_previouspc(), offset, data, mem_mask); + //logerror("%08X: unknown c02000 write %08X: %08X & %08X\n", cpu_get_previouspc(machine->activecpu), offset, data, mem_mask); } diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c index 4c1bd180061..a0952bed388 100644 --- a/src/mame/drivers/dkong.c +++ b/src/mame/drivers/dkong.c @@ -497,18 +497,18 @@ static READ8_DEVICE_HANDLER( dk_dma_read_byte ) { UINT8 result; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); result = program_read_byte(offset); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } static WRITE8_DEVICE_HANDLER( dk_dma_write_byte ) { - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); program_write_byte(offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } static READ8_DEVICE_HANDLER( hb_dma_read_byte ) @@ -523,9 +523,9 @@ static READ8_DEVICE_HANDLER( hb_dma_read_byte ) addr = ((bucket<<7) & 0x7c00) | (offset & 0x3ff); - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); data = program_read_byte(addr); - cpuintrf_pop_context(); + cpu_pop_context(); return data; } @@ -541,9 +541,9 @@ static WRITE8_DEVICE_HANDLER( hb_dma_write_byte ) addr = ((bucket<<7) & 0x7c00) | (offset & 0x3ff); - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); program_write_byte(addr, data); - cpuintrf_pop_context(); + cpu_pop_context(); } static READ8_DEVICE_HANDLER( p8257_ctl_r ) @@ -650,7 +650,7 @@ static WRITE8_HANDLER( s2650_data_w ) { dkong_state *state = machine->driver_data; #if DEBUG_PROTECTION - logerror("write : pc = %04x, loopback = %02x\n",activecpu_get_pc(), data); + logerror("write : pc = %04x, loopback = %02x\n",cpu_get_pc(machine->activecpu), data); #endif state->hunchloopback = data; @@ -660,10 +660,10 @@ static READ8_HANDLER( s2650_port0_r ) { dkong_state *state = machine->driver_data; #if DEBUG_PROTECTION - logerror("port 0 : pc = %04x, loopback = %02x\n",activecpu_get_pc(), state->hunchloopback); + logerror("port 0 : pc = %04x, loopback = %02x\n",cpu_get_pc(machine->activecpu), state->hunchloopback); #endif - switch (COMBINE_TYPE_PC(state->protect_type, activecpu_get_pc())) + switch (COMBINE_TYPE_PC(state->protect_type, cpu_get_pc(machine->activecpu))) { case COMBINE_TYPE_PC(DK2650_HUNCHBKD, 0x00e9): return 0xff; case COMBINE_TYPE_PC(DK2650_HUNCHBKD, 0x0114): return 0xfb; //fb @@ -679,7 +679,7 @@ static READ8_HANDLER( s2650_port0_r ) case DK2650_SHOOTGAL: return 0x00; case DK2650_SPCLFORC: return 0x00; } - fatalerror("Unhandled read from port 0 : pc = %4x\n",activecpu_get_pc()); + fatalerror("Unhandled read from port 0 : pc = %4x\n",cpu_get_pc(machine->activecpu)); } @@ -687,10 +687,10 @@ static READ8_HANDLER( s2650_port1_r ) { dkong_state *state = machine->driver_data; #if DEBUG_PROTECTION - logerror("port 1 : pc = %04x, loopback = %02x\n",activecpu_get_pc(), state->hunchloopback); + logerror("port 1 : pc = %04x, loopback = %02x\n",cpu_get_pc(machine->activecpu), state->hunchloopback); #endif - switch (COMBINE_TYPE_PC(state->protect_type, activecpu_get_pc())) + switch (COMBINE_TYPE_PC(state->protect_type, cpu_get_pc(machine->activecpu))) { case COMBINE_TYPE_PC(DK2650_EIGHTACT, 0x0021): return 0x00; case COMBINE_TYPE_PC(DK2650_HERBIEDK, 0x002b): return 0x00; @@ -703,7 +703,7 @@ static READ8_HANDLER( s2650_port1_r ) case DK2650_EIGHTACT: return 1; case DK2650_HERBIEDK: return 1; } - fatalerror("Unhandled read from port 1 : pc = %4x\n",activecpu_get_pc()); + fatalerror("Unhandled read from port 1 : pc = %4x\n",cpu_get_pc(machine->activecpu)); } diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c index 38a9986c658..b134323cbbf 100644 --- a/src/mame/drivers/dorachan.c +++ b/src/mame/drivers/dorachan.c @@ -31,16 +31,16 @@ static CUSTOM_INPUT( dorachan_protection_r ) { UINT8 ret = 0; - if ((cpu_getactivecpu() >= 0)) + if ((cpunum_get_active() >= 0)) { - switch (activecpu_get_previouspc()) + switch (cpu_get_previouspc(field->port->machine->activecpu)) { case 0x70ce: ret = 0xf2; break; case 0x72a2: ret = 0xd5; break; case 0x72b5: ret = 0xcb; break; default: - mame_printf_debug("unhandled $2400 read @ %x\n",activecpu_get_previouspc()); + mame_printf_debug("unhandled $2400 read @ %x\n",cpu_get_previouspc(field->port->machine->activecpu)); break; } } diff --git a/src/mame/drivers/dribling.c b/src/mame/drivers/dribling.c index 411b74e30d6..95ade88e20b 100644 --- a/src/mame/drivers/dribling.c +++ b/src/mame/drivers/dribling.c @@ -112,7 +112,7 @@ static WRITE8_DEVICE_HANDLER( misc_w ) /* bit 1 = (10) = PC1 */ /* bit 0 = (32) = PC0 */ input_mux = data & 7; - logerror("%04X:misc_w(%02X)\n", activecpu_get_previouspc(), data); + logerror("%04X:misc_w(%02X)\n", cpu_get_previouspc(device->machine->activecpu), data); } @@ -126,14 +126,14 @@ static WRITE8_DEVICE_HANDLER( sound_w ) /* bit 2 = folla a */ /* bit 1 = folla m */ /* bit 0 = folla b */ - logerror("%04X:sound_w(%02X)\n", activecpu_get_previouspc(), data); + logerror("%04X:sound_w(%02X)\n", cpu_get_previouspc(device->machine->activecpu), data); } static WRITE8_DEVICE_HANDLER( pb_w ) { /* write PB0-7 */ - logerror("%04X:pb_w(%02X)\n", activecpu_get_previouspc(), data); + logerror("%04X:pb_w(%02X)\n", cpu_get_previouspc(device->machine->activecpu), data); } diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c index f50b48688d7..03112d49152 100644 --- a/src/mame/drivers/dunhuang.c +++ b/src/mame/drivers/dunhuang.c @@ -212,7 +212,7 @@ static WRITE8_HANDLER( dunhuang_clear_y_w ) static WRITE8_HANDLER( dunhuang_horiz_clear_w ) { int i; -// logerror("%06x: horiz clear, y = %02x, data = %02d\n", activecpu_get_pc(), dunhuang_clear_y,data); +// logerror("%06x: horiz clear, y = %02x, data = %02d\n", cpu_get_pc(machine->activecpu), dunhuang_clear_y,data); for (i = 0; i < 0x40; i++) { int addr = dunhuang_clear_y * 0x40 + i; @@ -228,7 +228,7 @@ static WRITE8_HANDLER( dunhuang_horiz_clear_w ) static WRITE8_HANDLER( dunhuang_vert_clear_w ) { int i; -// logerror("%06x: vert clear, x = %02x, y = %02x, data = %02x\n", activecpu_get_pc(), dunhuang_pos_x,dunhuang_pos_y,data); +// logerror("%06x: vert clear, x = %02x, y = %02x, data = %02x\n", cpu_get_pc(machine->activecpu), dunhuang_pos_x,dunhuang_pos_y,data); for (i = 0; i < 0x08; i++) { int addr = (dunhuang_pos_x & 0x3f) + (i & 0x07) * 0x40; @@ -258,7 +258,7 @@ static WRITE8_HANDLER( dunhuang_block_h_w ) int i,j, addr; UINT8 *tile_addr; -// logerror("%06x: block dst %x, src %x, xy %x %x, wh %x %x, clr %x\n", activecpu_get_pc(), dunhuang_block_dest, (dunhuang_block_addr_hi << 8) + dunhuang_block_addr_lo, dunhuang_block_x,dunhuang_block_y,dunhuang_block_w+1,dunhuang_block_h+1,dunhuang_block_c); +// logerror("%06x: block dst %x, src %x, xy %x %x, wh %x %x, clr %x\n", cpu_get_pc(machine->activecpu), dunhuang_block_dest, (dunhuang_block_addr_hi << 8) + dunhuang_block_addr_lo, dunhuang_block_x,dunhuang_block_y,dunhuang_block_w+1,dunhuang_block_h+1,dunhuang_block_c); dunhuang_block_h = data; @@ -297,7 +297,7 @@ static WRITE8_HANDLER( dunhuang_block_h_w ) break; default: - popmessage("%06x: block dst=%x", activecpu_get_pc(), dunhuang_block_dest); + popmessage("%06x: block dst=%x", cpu_get_pc(machine->activecpu), dunhuang_block_dest); } } @@ -357,7 +357,7 @@ static READ8_HANDLER( dunhuang_dsw_r ) if (!(dunhuang_input & 0x04)) return input_port_read(machine, "DSW3"); if (!(dunhuang_input & 0x08)) return input_port_read(machine, "DSW4"); if (!(dunhuang_input & 0x10)) return input_port_read(machine, "DSW5"); - logerror("%06x: warning, unknown dsw bits read, dunhuang_input = %02x\n", activecpu_get_pc(), dunhuang_input); + logerror("%06x: warning, unknown dsw bits read, dunhuang_input = %02x\n", cpu_get_pc(machine->activecpu), dunhuang_input); return 0xff; } static READ8_HANDLER( dunhuang_input_r ) @@ -367,7 +367,7 @@ static READ8_HANDLER( dunhuang_input_r ) if (!(dunhuang_input & 0x04)) return input_port_read(machine, "IN2"); if (!(dunhuang_input & 0x08)) return input_port_read(machine, "IN3"); if (!(dunhuang_input & 0x10)) return input_port_read(machine, "IN4"); - logerror("%06x: warning, unknown input bits read, dunhuang_input = %02x\n", activecpu_get_pc(), dunhuang_input); + logerror("%06x: warning, unknown input bits read, dunhuang_input = %02x\n", cpu_get_pc(machine->activecpu), dunhuang_input); return 0xff; } diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c index 69695e8bb7e..803695421db 100644 --- a/src/mame/drivers/dwarfd.c +++ b/src/mame/drivers/dwarfd.c @@ -544,7 +544,7 @@ static INTERRUPT_GEN( dwarfd_interrupt ) { if(cpu_getiloops() < NUM_LINES) { - cpunum_set_info_fct(0, CPUINFO_PTR_I8085_SOD_CALLBACK, (void*)dwarfd_sod_callback); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_I8085_SOD_CALLBACK, (void*)dwarfd_sod_callback); cpunum_set_input_line(machine, 0,I8085_RST65_LINE,HOLD_LINE); // 34 - every 8th line line=cpu_getiloops(); idx=0; @@ -776,7 +776,7 @@ static DRIVER_INIT(dwarfd) // src[i] = src[i]&0xe0; } - cpunum_set_info_fct(0, CPUINFO_PTR_I8085_SOD_CALLBACK, (void*)dwarfd_sod_callback); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_I8085_SOD_CALLBACK, (void*)dwarfd_sod_callback); videobuf=auto_malloc(0x8000); dwarfd_ram=auto_malloc(0x1000); diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index 859fdeab135..7b44b220bc9 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -284,7 +284,7 @@ static int hnoridur_bank; static WRITE8_HANDLER( hnoridur_rombank_w ) { UINT8 *ROM = memory_region(machine, "main") + 0x10000 + 0x8000*data; -//logerror("%04x: rom bank = %02x\n",activecpu_get_pc(),data); +//logerror("%04x: rom bank = %02x\n",cpu_get_pc(machine->activecpu),data); memory_set_bankptr(1,ROM); hnoridur_bank = data; } @@ -675,7 +675,7 @@ static WRITE8_HANDLER( yarunara_blit_romregion_w ) case 0x81: dynax_blit_romregion_w(machine,0,3); return; case 0x82: dynax_blit_romregion_w(machine,0,4); return; // mjcomv1 } - logerror("%04x: unmapped romregion=%02X\n",activecpu_get_pc(),data); + logerror("%04x: unmapped romregion=%02X\n",cpu_get_pc(machine->activecpu),data); } static ADDRESS_MAP_START( yarunara_io_map, ADDRESS_SPACE_IO, 8 ) @@ -1039,7 +1039,7 @@ static READ8_HANDLER( htengoku_dsw_r ) if (!(htengoku_dsw & 0x04)) return input_port_read(machine, "DSW2"); if (!(htengoku_dsw & 0x08)) return input_port_read(machine, "DSW3"); if (!(htengoku_dsw & 0x10)) return input_port_read(machine, "DSW4"); - logerror("%06x: warning, unknown bits read, htengoku_dsw = %02x\n", activecpu_get_pc(), htengoku_dsw); + logerror("%06x: warning, unknown bits read, htengoku_dsw = %02x\n", cpu_get_pc(machine->activecpu), htengoku_dsw); return 0xff; } @@ -1063,7 +1063,7 @@ static WRITE8_HANDLER( htengoku_coin_w ) case 0xff: break; // CRT controller? default: - logerror("%04x: coins_w with select = %02x, data = %02x\n", activecpu_get_pc(), htengoku_select,data); + logerror("%04x: coins_w with select = %02x, data = %02x\n", cpu_get_pc(machine->activecpu), htengoku_select,data); } } @@ -1078,7 +1078,7 @@ static READ8_HANDLER( htengoku_input_r ) case 0x82: return input_port_read(machine, keynames0[htengoku_ip++]); case 0x0d: return 0xff; // unused } - logerror("%04x: input_r with select = %02x\n", activecpu_get_pc(), htengoku_select); + logerror("%04x: input_r with select = %02x\n", cpu_get_pc(machine->activecpu), htengoku_select); return 0xff; } @@ -1091,7 +1091,7 @@ static READ8_HANDLER( htengoku_coin_r ) case 0x02: return 0xbf | ((htengoku_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0 : (1<<6));; // bit 7 = blitter busy, bit 6 = hopper case 0x03: return htengoku_coins; } - logerror("%04x: coin_r with select = %02x\n", activecpu_get_pc(), htengoku_select); + logerror("%04x: coin_r with select = %02x\n", cpu_get_pc(machine->activecpu), htengoku_select); return 0xff; } @@ -1111,7 +1111,7 @@ static WRITE8_HANDLER( htengoku_blit_romregion_w ) case 0x81: dynax_blit_romregion_w(machine,0,1); return; case 0x00: dynax_blit_romregion_w(machine,0,2); return; } - logerror("%04x: unmapped romregion=%02X\n",activecpu_get_pc(),data); + logerror("%04x: unmapped romregion=%02X\n",cpu_get_pc(machine->activecpu),data); } static READ8_HANDLER( unk_r ) @@ -1194,7 +1194,7 @@ static WRITE8_HANDLER( tenkai_ip_w ) break; return; } - logerror("%04x: unmapped ip_sel=%02x written with %02x\n", activecpu_get_pc(), tenkai_ipsel,data); + logerror("%04x: unmapped ip_sel=%02x written with %02x\n", cpu_get_pc(machine->activecpu), tenkai_ipsel,data); } static READ8_HANDLER( tenkai_ip_r ) @@ -1212,7 +1212,7 @@ static READ8_HANDLER( tenkai_ip_r ) return input_port_read(machine, "IN0"); // coins default: - logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", activecpu_get_pc(), tenkai_ipsel, offset); + logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(machine->activecpu), tenkai_ipsel, offset); return 0xff; } } @@ -1227,17 +1227,17 @@ static READ8_HANDLER( tenkai_ip_r ) // player 2 case 0x81: if (tenkai_ip >= 5) - logerror("%04x: unmapped tenkai_ip=%02x read\n", activecpu_get_pc(), tenkai_ip); + logerror("%04x: unmapped tenkai_ip=%02x read\n", cpu_get_pc(machine->activecpu), tenkai_ip); return 0xff;//input_port_read(machine, keynames1[tenkai_ip++]); // player 1 case 0x82: if (tenkai_ip >= 5) - logerror("%04x: unmapped tenkai_ip=%02x read\n", activecpu_get_pc(), tenkai_ip); + logerror("%04x: unmapped tenkai_ip=%02x read\n", cpu_get_pc(machine->activecpu), tenkai_ip); return input_port_read(machine, keynames0[tenkai_ip++]); default: - logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", activecpu_get_pc(), tenkai_ipsel, offset); + logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(machine->activecpu), tenkai_ipsel, offset); return 0xff; } } @@ -1257,7 +1257,7 @@ static READ8_HANDLER( tenkai_dsw_r ) if (~tenkai_dswsel & 0x04) return input_port_read(machine, "DSW2"); if (~tenkai_dswsel & 0x08) return input_port_read(machine, "DSW3"); if (~tenkai_dswsel & 0x10) return input_port_read(machine, "DSW4"); - logerror("%04x: unmapped dsw %02x read\n",activecpu_get_pc(),tenkai_dswsel); + logerror("%04x: unmapped dsw %02x read\n",cpu_get_pc(machine->activecpu),tenkai_dswsel); return 0xff; } @@ -1348,7 +1348,7 @@ static READ8_HANDLER( tenkai_8000_r ) return tenkai_palette_r(machine,offset); } - logerror("%04x: unmapped offset %04X read with rombank=%02X\n",activecpu_get_pc(),offset,rombank); + logerror("%04x: unmapped offset %04X read with rombank=%02X\n",cpu_get_pc(machine->activecpu),offset,rombank); return 0x00; } @@ -1366,7 +1366,7 @@ static WRITE8_HANDLER( tenkai_8000_w ) return; } - logerror("%04x: unmapped offset %04X=%02X written with rombank=%02X\n",activecpu_get_pc(),offset,data,rombank); + logerror("%04x: unmapped offset %04X=%02X written with rombank=%02X\n",cpu_get_pc(machine->activecpu),offset,data,rombank); } static int tenkai_6c, tenkai_70; @@ -1393,7 +1393,7 @@ static WRITE8_HANDLER( tenkai_blit_romregion_w ) case 0x83: dynax_blit_romregion_w(machine,0,1); return; case 0x80: dynax_blit_romregion_w(machine,0,2); return; } - logerror("%04x: unmapped romregion=%02X\n",activecpu_get_pc(),data); + logerror("%04x: unmapped romregion=%02X\n",cpu_get_pc(machine->activecpu),data); } static ADDRESS_MAP_START( tenkai_map, ADDRESS_SPACE_PROGRAM, 8 ) diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c index 29455dec2c0..026b80fa9f6 100644 --- a/src/mame/drivers/enigma2.c +++ b/src/mame/drivers/enigma2.c @@ -317,7 +317,7 @@ static READ8_HANDLER( dip_switch_r ) { UINT8 ret = 0x00; -if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, activecpu_get_pc(), protection_data); +if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, cpu_get_pc(machine->activecpu), protection_data); switch (offset) { case 0x01: @@ -328,7 +328,7 @@ if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, activec break; case 0x02: - if (activecpu_get_pc() == 0x07e5) + if (cpu_get_pc(machine->activecpu) == 0x07e5) ret = 0xaa; else ret = 0xf4; @@ -363,7 +363,7 @@ static READ8_HANDLER( sound_latch_r ) static WRITE8_HANDLER( protection_data_w ) { -if (LOG_PROT) logerror("Protection Data Write: %x at %x\n", data, safe_activecpu_get_pc()); +if (LOG_PROT) logerror("Protection Data Write: %x at %x\n", data, safe_cpu_get_pc(machine->activecpu)); protection_data = data; } diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c index 4cda8d19232..381f6365e09 100644 --- a/src/mame/drivers/eolith.c +++ b/src/mame/drivers/eolith.c @@ -102,7 +102,7 @@ static READ32_HANDLER( eolith_custom_r ) bit 8 = ??? bit 9 = ??? */ - eolith_speedup_read(); + eolith_speedup_read(machine); return (input_port_read(machine, "IN0") & ~0x300) | (mame_rand(machine) & 0x300); } diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c index 45e199d7b58..6d6a38a0eab 100644 --- a/src/mame/drivers/eolith16.c +++ b/src/mame/drivers/eolith16.c @@ -44,7 +44,7 @@ static WRITE16_HANDLER( eeprom_w ) static READ16_HANDLER( eolith16_custom_r ) { - eolith_speedup_read(); + eolith_speedup_read(machine); return input_port_read(machine, "SPECIAL"); } diff --git a/src/mame/drivers/eolithsp.c b/src/mame/drivers/eolithsp.c index e94e7d90396..bedc0b2a94b 100644 --- a/src/mame/drivers/eolithsp.c +++ b/src/mame/drivers/eolithsp.c @@ -17,13 +17,13 @@ static int eolith_speedup_resume_scanline; static int eolith_vblank = 0; static int eolith_scanline = 0; -void eolith_speedup_read(void) +void eolith_speedup_read(running_machine *machine) { /* for debug */ -// if ((activecpu_get_pc()!=eolith_speedup_address) && (eolith_vblank!=1) ) -// printf("%06x eolith speedup_read data %02x\n",activecpu_get_pc(), eolith_vblank); +// if ((cpu_get_pc(machine->activecpu)!=eolith_speedup_address) && (eolith_vblank!=1) ) +// printf("%06x eolith speedup_read data %02x\n",cpu_get_pc(machine->activecpu), eolith_vblank); - if (activecpu_get_pc()==eolith_speedup_address && eolith_vblank==0 && eolith_scanline < eolith_speedup_resume_scanline) + if (cpu_get_pc(machine->activecpu)==eolith_speedup_address && eolith_vblank==0 && eolith_scanline < eolith_speedup_resume_scanline) { cpu_spinuntil_trigger(1000); } diff --git a/src/mame/drivers/epos.c b/src/mame/drivers/epos.c index ca807072755..b5e7ba26507 100644 --- a/src/mame/drivers/epos.c +++ b/src/mame/drivers/epos.c @@ -45,7 +45,7 @@ static WRITE8_HANDLER( dealer_decrypt_rom ) else counter = (counter - 1) & 0x03; -// logerror("PC %08x: ctr=%04x\n",activecpu_get_pc(),counter); +// logerror("PC %08x: ctr=%04x\n",cpu_get_pc(machine->activecpu),counter); memory_set_bankptr(1, rom + 0x10000 * counter); diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c index 214d935d0ab..507906a9589 100644 --- a/src/mame/drivers/esd16.c +++ b/src/mame/drivers/esd16.c @@ -145,7 +145,7 @@ static READ16_HANDLER( esd_eeprom_r ) return ((eeprom_read_bit() & 0x01) << 15); } -// logerror("(0x%06x) unk EEPROM read: %04x\n", activecpu_get_pc(), mem_mask); +// logerror("(0x%06x) unk EEPROM read: %04x\n", cpu_get_pc(machine->activecpu), mem_mask); return 0; } @@ -163,7 +163,7 @@ static WRITE16_HANDLER( esd_eeprom_w ) eeprom_set_cs_line((data & 0x0100) ? CLEAR_LINE : ASSERT_LINE ); } -// logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", activecpu_get_pc(), data, mem_mask); +// logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", cpu_get_pc(machine->activecpu), data, mem_mask); } static ADDRESS_MAP_START( hedpanic_readmem, ADDRESS_SPACE_PROGRAM, 16 ) @@ -278,7 +278,7 @@ ADDRESS_MAP_END static WRITE8_HANDLER( esd16_sound_rombank_w ) { int bank = data & 0xf; - if (data != bank) logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n",activecpu_get_pc(),data); + if (data != bank) logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(machine->activecpu),data); if (bank >= 3) bank += 1; memory_set_bankptr(1, memory_region(machine, "audio") + 0x4000 * bank); } diff --git a/src/mame/drivers/exerion.c b/src/mame/drivers/exerion.c index 17515ad2181..1cb87c5fe73 100644 --- a/src/mame/drivers/exerion.c +++ b/src/mame/drivers/exerion.c @@ -73,7 +73,7 @@ static WRITE8_HANDLER( exerion_portb_w ) static READ8_HANDLER( exerion_protection_r ) { - if (activecpu_get_pc() == 0x4143) + if (cpu_get_pc(machine->activecpu) == 0x4143) return memory_region(machine, "main")[0x33c0 + (exerion_ram[0xd] << 2) + offset]; else return exerion_ram[0x8 + offset]; diff --git a/src/mame/drivers/f-32.c b/src/mame/drivers/f-32.c index 774aad7981d..a7a59b4463b 100644 --- a/src/mame/drivers/f-32.c +++ b/src/mame/drivers/f-32.c @@ -95,9 +95,9 @@ ADDRESS_MAP_END static READ32_HANDLER( f32_input_port_1_r ) { /* burn a bunch of cycles because this is polled frequently during busy loops */ - if ((activecpu_get_pc() == 0x000379de) || - (activecpu_get_pc() == 0x000379cc) ) activecpu_adjust_icount(-100); - //else printf("PC %08x\n", activecpu_get_pc() ); + if ((cpu_get_pc(machine->activecpu) == 0x000379de) || + (cpu_get_pc(machine->activecpu) == 0x000379cc) ) activecpu_adjust_icount(-100); + //else printf("PC %08x\n", cpu_get_pc(machine->activecpu) ); return input_port_read(machine, "SYSTEM_P2"); } diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c index 3d54e8f87c1..2996a81f77f 100644 --- a/src/mame/drivers/fantland.c +++ b/src/mame/drivers/fantland.c @@ -64,7 +64,7 @@ static WRITE8_HANDLER( fantland_nmi_enable_w ) fantland_nmi_enable = data; if ((fantland_nmi_enable != 0) && (fantland_nmi_enable != 8)) - logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", activecpu_get_pc(), data); + logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", cpu_get_pc(machine->activecpu), data); } static WRITE16_HANDLER( fantland_nmi_enable_16_w ) @@ -165,7 +165,7 @@ static WRITE8_HANDLER( borntofi_nmi_enable_w ) // data & 0x31 changes when lightgun fires if ((fantland_nmi_enable != 0) && (fantland_nmi_enable != 8)) - logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", activecpu_get_pc(), data); + logerror("CPU #0 PC = %04X: nmi_enable = %02x\n", cpu_get_pc(machine->activecpu), data); // popmessage("%02X",data); } @@ -300,7 +300,7 @@ static void borntofi_adpcm_start(int voice) msm5205_reset_w(voice,0); borntofi_adpcm[voice].playing = 1; borntofi_adpcm[voice].nibble = 0; -// logerror("CPU #0 PC = %04X: adpcm start = %06x, stop = %06x\n", activecpu_get_pc(), borntofi_adpcm[voice].addr[0], borntofi_adpcm[voice].addr[1]); +// logerror("CPU #0 PC = %04X: adpcm start = %06x, stop = %06x\n", cpu_get_pc(machine->activecpu), borntofi_adpcm[voice].addr[0], borntofi_adpcm[voice].addr[1]); } static void borntofi_adpcm_stop(int voice) @@ -321,7 +321,7 @@ static WRITE8_HANDLER( borntofi_msm5205_w ) { case 0x00: borntofi_adpcm_stop(voice); break; case 0x03: borntofi_adpcm_start(voice); break; - default: logerror("CPU #0 PC = %04X: adpcm reg %d <- %02x\n", activecpu_get_pc(), reg, data); + default: logerror("CPU #0 PC = %04X: adpcm reg %d <- %02x\n", cpu_get_pc(machine->activecpu), reg, data); } } else diff --git a/src/mame/drivers/fastfred.c b/src/mame/drivers/fastfred.c index 21831d8497a..15ff31f171c 100644 --- a/src/mame/drivers/fastfred.c +++ b/src/mame/drivers/fastfred.c @@ -18,7 +18,7 @@ // to change if a different ROM set ever surfaces. static READ8_HANDLER( fastfred_custom_io_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x03c0: return 0x9d; case 0x03e6: return 0x9f; @@ -44,14 +44,14 @@ static READ8_HANDLER( fastfred_custom_io_r ) case 0x7b58: return 0x20; } - logerror("Uncaught custom I/O read %04X at %04X\n", 0xc800+offset, activecpu_get_pc()); + logerror("Uncaught custom I/O read %04X at %04X\n", 0xc800+offset, cpu_get_pc(machine->activecpu)); return 0x00; } static READ8_HANDLER( flyboy_custom1_io_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x049d: return 0xad; /* compare */ case 0x04b9: /* compare with 0x9e ??? When ??? */ @@ -72,14 +72,14 @@ static READ8_HANDLER( flyboy_custom1_io_r ) return 0x00; } - logerror("Uncaught custom I/O read %04X at %04X\n", 0xc085+offset, activecpu_get_pc()); + logerror("Uncaught custom I/O read %04X at %04X\n", 0xc085+offset, cpu_get_pc(machine->activecpu)); return 0x00; } static READ8_HANDLER( flyboy_custom2_io_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x0395: return 0xf7; /* $C900 compare */ case 0x03f5: /* $c8fd */ @@ -97,7 +97,7 @@ static READ8_HANDLER( flyboy_custom2_io_r ) return 0x00; } - logerror("Uncaught custom I/O read %04X at %04X\n", 0xc8fb+offset, activecpu_get_pc()); + logerror("Uncaught custom I/O read %04X at %04X\n", 0xc8fb+offset, cpu_get_pc(machine->activecpu)); return 0x00; } diff --git a/src/mame/drivers/filetto.c b/src/mame/drivers/filetto.c index 5904888edea..44a8491f41d 100644 --- a/src/mame/drivers/filetto.c +++ b/src/mame/drivers/filetto.c @@ -279,7 +279,7 @@ static VIDEO_UPDATE( filetto ) static READ8_HANDLER( vga_regs_r ) { - logerror("(PC=%05x) Warning: VGA reg port read\n",activecpu_get_pc()); + logerror("(PC=%05x) Warning: VGA reg port read\n",cpu_get_pc(machine->activecpu)); return 0xff; } @@ -299,7 +299,7 @@ static WRITE8_HANDLER( vga_regs_w ) //logerror("write %02x to video register [%02x]",data,video_index); } else - logerror("(PC=%05x) Warning: Undefined VGA reg port write (I=%02x D=%02x)\n",activecpu_get_pc(),video_index,data); + logerror("(PC=%05x) Warning: Undefined VGA reg port write (I=%02x D=%02x)\n",cpu_get_pc(machine->activecpu),video_index,data); } } @@ -323,7 +323,7 @@ static UINT8 disk_data[2]; static READ8_HANDLER( disk_iobank_r ) { - //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,activecpu_get_pc()); + //printf("Read Prototyping card [%02x] @ PC=%05x\n",offset,cpu_get_pc(machine->activecpu)); //if(offset == 0) return input_port_read(machine, "DSW"); if(offset == 1) return input_port_read(machine, "IN1"); @@ -500,7 +500,7 @@ static UINT8 status; static READ8_HANDLER( fdc765_status_r ) { static UINT8 tmp,clr_status; -// popmessage("Read FDC status @ PC=%05x",activecpu_get_pc()); +// popmessage("Read FDC status @ PC=%05x",cpu_get_pc(machine->activecpu)); tmp = status | 0x80; clr_status++; if(clr_status == 0x10) @@ -544,9 +544,9 @@ static DMA8237_MEM_READ( pc_dma_read_byte ) offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16) & 0xFF0000; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); result = program_read_byte(page_offset + offset); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -557,9 +557,9 @@ static DMA8237_MEM_WRITE( pc_dma_write_byte ) offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16) & 0xFF0000; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); program_write_byte(page_offset + offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } static READ8_HANDLER(dma_page_select_r) diff --git a/src/mame/drivers/findout.c b/src/mame/drivers/findout.c index f7cd8a33b9b..cd5ce788ae1 100644 --- a/src/mame/drivers/findout.c +++ b/src/mame/drivers/findout.c @@ -98,7 +98,7 @@ static WRITE8_DEVICE_HANDLER( sound_w ) /* bit 7 goes directly to the sound amplifier */ dac_data_w(0,((data & 0x80) >> 7) * 255); -// logerror("%04x: sound_w %02x\n",activecpu_get_pc(),data); +// logerror("%04x: sound_w %02x\n",cpu_get_pc(machine->activecpu),data); // popmessage("%02x",data); } @@ -130,7 +130,7 @@ static MACHINE_RESET( findout ) static READ8_HANDLER( catchall ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(machine->activecpu); if (pc != 0x3c74 && pc != 0x0364 && pc != 0x036d) /* weed out spurious blit reads */ logerror("%04x: unmapped memory read from %04x\n",pc,offset); diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c index b4f101306ac..0ef470688ee 100644 --- a/src/mame/drivers/firebeat.c +++ b/src/mame/drivers/firebeat.c @@ -109,6 +109,7 @@ */ #include "driver.h" +#include "deprecat.h" #include "cpu/powerpc/ppc.h" #include "machine/intelfsh.h" #include "machine/scsicd.h" @@ -578,8 +579,8 @@ static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data if (reg != 0x70 && chip == 0) { - //printf("gcu%d_w: %08X, %08X, %08X at %08X\n", chip, data, offset, mem_mask, activecpu_get_pc()); - //logerror("gcu%d_w: %08X, %08X, %08X at %08X\n", chip, data, offset, mem_mask, activecpu_get_pc()); + //printf("gcu%d_w: %08X, %08X, %08X at %08X\n", chip, data, offset, mem_mask, cpu_get_pc(machine->activecpu)); + //logerror("gcu%d_w: %08X, %08X, %08X at %08X\n", chip, data, offset, mem_mask, cpu_get_pc(machine->activecpu)); } switch(reg) @@ -973,7 +974,7 @@ static void atapi_command_reg_w(running_machine *machine, int reg, UINT16 data) if (reg == ATAPI_REG_DATA) { -// printf("ATAPI: packet write %04x at %08X\n", data, activecpu_get_pc()); +// printf("ATAPI: packet write %04x at %08X\n", data, cpu_get_pc(machine->activecpu)); atapi_data[atapi_data_ptr] = data; atapi_data_ptr++; @@ -1763,14 +1764,14 @@ static UINT32 *work_ram; static MACHINE_START( firebeat ) { /* set conservative DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_END, 0x01ffffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_READONLY, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x01ffffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); } static ADDRESS_MAP_START( firebeat_map, ADDRESS_SPACE_PROGRAM, 32 ) @@ -2255,7 +2256,7 @@ static void security_w(UINT8 data) { int r = ibutton_w(data); if (r >= 0) - ppc4xx_spu_receive_byte(0, r); + ppc4xx_spu_receive_byte(Machine->cpu[0], r); } /*****************************************************************************/ @@ -2290,7 +2291,7 @@ static void init_firebeat(running_machine *machine) cur_cab_data = cab_data; - ppc4xx_spu_set_tx_handler(0, security_w); + ppc4xx_spu_set_tx_handler(machine->cpu[0], security_w); set_ibutton(rom); diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c index 0cf5333abe7..bb743844cbe 100644 --- a/src/mame/drivers/firetrap.c +++ b/src/mame/drivers/firetrap.c @@ -114,7 +114,7 @@ static MACHINE_RESET( firetrap ) static READ8_HANDLER( firetrap_8751_r ) { - //logerror("PC:%04x read from 8751\n",activecpu_get_pc()); + //logerror("PC:%04x read from 8751\n",cpu_get_pc(machine->activecpu)); return i8751_return; } @@ -189,7 +189,7 @@ static WRITE8_HANDLER( firetrap_8751_w ) i8751_return=3; else { i8751_return=0xff; - logerror("%04x: Unknown i8751 command %02x!\n",activecpu_get_pc(),data); + logerror("%04x: Unknown i8751 command %02x!\n",cpu_get_pc(machine->activecpu),data); } /* Signal main cpu task is complete */ diff --git a/src/mame/drivers/fitfight.c b/src/mame/drivers/fitfight.c index ed8b1fd7281..976117138e1 100644 --- a/src/mame/drivers/fitfight.c +++ b/src/mame/drivers/fitfight.c @@ -227,35 +227,35 @@ ADDRESS_MAP_END static READ8_HANDLER(snd_porta_r) { - //mame_printf_debug("PA R @%x\n",activecpu_get_pc()); + //mame_printf_debug("PA R @%x\n",cpu_get_pc(machine->activecpu)); return mame_rand(machine); } static READ8_HANDLER(snd_portb_r) { - //mame_printf_debug("PB R @%x\n",activecpu_get_pc()); + //mame_printf_debug("PB R @%x\n",cpu_get_pc(machine->activecpu)); return mame_rand(machine); } static READ8_HANDLER(snd_portc_r) { - //mame_printf_debug("PC R @%x\n",activecpu_get_pc()); + //mame_printf_debug("PC R @%x\n",cpu_get_pc(machine->activecpu)); return mame_rand(machine); } static WRITE8_HANDLER(snd_porta_w) { - //mame_printf_debug("PA W %x @%x\n",data,activecpu_get_pc()); + //mame_printf_debug("PA W %x @%x\n",data,cpu_get_pc(machine->activecpu)); } static WRITE8_HANDLER(snd_portb_w) { - //mame_printf_debug("PB W %x @%x\n",data,activecpu_get_pc()); + //mame_printf_debug("PB W %x @%x\n",data,cpu_get_pc(machine->activecpu)); } static WRITE8_HANDLER(snd_portc_w) { - //mame_printf_debug("PC W %x @%x\n",data,activecpu_get_pc()); + //mame_printf_debug("PC W %x @%x\n",data,cpu_get_pc(machine->activecpu)); } static ADDRESS_MAP_START( snd_io, ADDRESS_SPACE_IO, 8 ) diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c index b06c8bea011..ca554faa5d8 100644 --- a/src/mame/drivers/fortecar.c +++ b/src/mame/drivers/fortecar.c @@ -56,7 +56,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w ) static READ8_DEVICE_HANDLER( ppi0_portc_r ) { -// popmessage("%04x",activecpu_get_pc()); +// popmessage("%04x",cpu_get_pc(machine->activecpu)); return (~(eeprom_read_bit()<<1) & 2); } diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c index 0bebe29ef5c..3a3c0e8babf 100644 --- a/src/mame/drivers/fromanc2.c +++ b/src/mame/drivers/fromanc2.c @@ -120,7 +120,7 @@ static READ16_HANDLER( fromanc2_keymatrix_r ) case 0x04: ret = input_port_read(machine, "KEY2"); break; case 0x08: ret = input_port_read(machine, "KEY3"); break; default: ret = 0xffff; - logerror("PC:%08X unknown %02X\n", activecpu_get_pc(), fromanc2_portselect); + logerror("PC:%08X unknown %02X\n", cpu_get_pc(machine->activecpu), fromanc2_portselect); break; } diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c index 830a9966795..481dc99eb77 100644 --- a/src/mame/drivers/fuukifg2.c +++ b/src/mame/drivers/fuukifg2.c @@ -132,7 +132,7 @@ static WRITE8_HANDLER( fuuki16_sound_rombank_w ) if (data <= 2) memory_set_bankptr(1, memory_region(machine, "audio") + 0x8000 * data + 0x10000); else - logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n",activecpu_get_pc(),data); + logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(machine->activecpu),data); } static WRITE8_HANDLER( fuuki16_oki_banking_w ) diff --git a/src/mame/drivers/gaelco.c b/src/mame/drivers/gaelco.c index 777f9ffa30b..996a9430545 100644 --- a/src/mame/drivers/gaelco.c +++ b/src/mame/drivers/gaelco.c @@ -556,7 +556,7 @@ static WRITE16_HANDLER( gaelco_vram_encrypted_w ) { // mame_printf_debug("gaelco_vram_encrypted_w!!\n"); - data = gaelco_decrypt(offset, data, 0x0f, 0x4228); + data = gaelco_decrypt(machine, offset, data, 0x0f, 0x4228); COMBINE_DATA(&gaelco_videoram[offset]); tilemap_mark_tile_dirty(gaelco_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 2); @@ -567,7 +567,7 @@ static WRITE16_HANDLER(gaelco_encrypted_w) { // mame_printf_debug("gaelco_encrypted_w!!\n"); - data = gaelco_decrypt(offset, data, 0x0f, 0x4228); + data = gaelco_decrypt(machine, offset, data, 0x0f, 0x4228); COMBINE_DATA(&gaelco_screen[offset]); } @@ -575,7 +575,7 @@ static WRITE16_HANDLER( thoop_vram_encrypted_w ) { // mame_printf_debug("gaelco_vram_encrypted_w!!\n"); - data = gaelco_decrypt(offset, data, 0x0e, 0x4228); + data = gaelco_decrypt(machine, offset, data, 0x0e, 0x4228); COMBINE_DATA(&gaelco_videoram[offset]); tilemap_mark_tile_dirty(gaelco_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 2); @@ -585,7 +585,7 @@ static WRITE16_HANDLER(thoop_encrypted_w) { // mame_printf_debug("gaelco_encrypted_w!!\n"); - data = gaelco_decrypt(offset, data, 0x0e, 0x4228); + data = gaelco_decrypt(machine, offset, data, 0x0e, 0x4228); COMBINE_DATA(&gaelco_screen[offset]); } diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c index 09aeef2820d..10401534cb7 100644 --- a/src/mame/drivers/gaelco3d.c +++ b/src/mame/drivers/gaelco3d.c @@ -195,7 +195,7 @@ static MACHINE_RESET( common ) } /* initialize the ADSP Tx callback */ - cpunum_set_info_fct(2, CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)adsp_tx_callback); + cpu_set_info_fct(machine->cpu[2], CPUINFO_PTR_ADSP2100_TX_HANDLER, (genf *)adsp_tx_callback); /* allocate a timer for feeding the autobuffer */ adsp_autobuffer_timer = timer_alloc(adsp_autobuffer_irq, NULL); @@ -309,7 +309,7 @@ static TIMER_CALLBACK( delayed_sound_w ) static WRITE16_HANDLER( sound_data_w ) { - logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); if (ACCESSING_BITS_0_7) timer_call_after_resynch(NULL, data & 0xff, delayed_sound_w); } @@ -325,7 +325,7 @@ static READ16_HANDLER( sound_data_r ) static READ16_HANDLER( sound_status_r ) { - logerror("%06X:sound_status_r(%02X) = %02X\n", activecpu_get_pc(), offset, sound_status); + logerror("%06X:sound_status_r(%02X) = %02X\n", cpu_get_pc(machine->activecpu), offset, sound_status); if (ACCESSING_BITS_0_7) return sound_status; return 0xffff; @@ -367,7 +367,7 @@ static WRITE16_HANDLER( analog_port_clock_w ) } } else - logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } @@ -385,7 +385,7 @@ static WRITE16_HANDLER( analog_port_latch_w ) } } else - logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } @@ -398,7 +398,7 @@ static WRITE16_HANDLER( analog_port_latch_w ) static READ32_HANDLER( tms_m68k_ram_r ) { -// logerror("%06X:tms_m68k_ram_r(%04X) = %08X\n", activecpu_get_pc(), offset, !(offset & 1) ? ((INT32)m68k_ram_base[offset/2] >> 16) : (int)(INT16)m68k_ram_base[offset/2]); +// logerror("%06X:tms_m68k_ram_r(%04X) = %08X\n", cpu_get_pc(machine->activecpu), offset, !(offset & 1) ? ((INT32)m68k_ram_base[offset/2] >> 16) : (int)(INT16)m68k_ram_base[offset/2]); return (INT32)(INT16)m68k_ram_base[offset ^ tms_offset_xor]; } @@ -427,7 +427,7 @@ static WRITE16_HANDLER( tms_reset_w ) { /* this is set to 0 while data is uploaded, then set to $ffff after it is done */ /* it does not ever appear to be touched after that */ - logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE); } @@ -436,7 +436,7 @@ static WRITE16_HANDLER( tms_irq_w ) { /* this is written twice, 0,1, in quick succession */ /* done after uploading, and after modifying the comm area */ - logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); if (ACCESSING_BITS_0_7) cpunum_set_input_line(machine, 1, 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); } @@ -444,14 +444,14 @@ static WRITE16_HANDLER( tms_irq_w ) static WRITE16_HANDLER( tms_control3_w ) { - logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:tms_control3_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } static WRITE16_HANDLER( tms_comm_w ) { COMBINE_DATA(&tms_comm_base[offset ^ tms_offset_xor]); - logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset*2, data, mem_mask); + logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); } @@ -545,7 +545,7 @@ static WRITE16_HANDLER( adsp_rombank_w ) static TIMER_CALLBACK( adsp_autobuffer_irq ) { /* get the index register */ - int reg = cpunum_get_reg(2, ADSP2100_I0 + adsp_ireg); + int reg = cpu_get_reg(machine->cpu[2], ADSP2100_I0 + adsp_ireg); /* copy the current data into the buffer */ // logerror("ADSP buffer: I%d=%04X incs=%04X size=%04X\n", adsp_ireg, reg, adsp_incs, adsp_size); @@ -566,7 +566,7 @@ static TIMER_CALLBACK( adsp_autobuffer_irq ) } /* store it */ - cpunum_set_reg(2, ADSP2100_I0 + adsp_ireg, reg); + cpu_set_reg(machine->cpu[2], ADSP2100_I0 + adsp_ireg, reg); } @@ -594,15 +594,15 @@ static void adsp_tx_callback(int port, INT32 data) /* now get the register contents in a more legible format */ /* we depend on register indexes to be continuous (wich is the case in our core) */ - source = cpunum_get_reg(2, ADSP2100_I0 + adsp_ireg); - adsp_incs = cpunum_get_reg(2, ADSP2100_M0 + mreg); - adsp_size = cpunum_get_reg(2, ADSP2100_L0 + lreg); + source = cpu_get_reg(Machine->cpu[2], ADSP2100_I0 + adsp_ireg); + adsp_incs = cpu_get_reg(Machine->cpu[2], ADSP2100_M0 + mreg); + adsp_size = cpu_get_reg(Machine->cpu[2], ADSP2100_L0 + lreg); /* get the base value, since we need to keep it around for wrapping */ source -= adsp_incs; /* make it go back one so we dont lose the first sample */ - cpunum_set_reg(2, ADSP2100_I0 + adsp_ireg, source); + cpu_set_reg(Machine->cpu[2], ADSP2100_I0 + adsp_ireg, source); /* save it as it is now */ adsp_ireg_base = source; @@ -648,36 +648,36 @@ static WRITE32_HANDLER( unknown_107_w ) { /* arbitrary data written */ if (ACCESSING_BITS_0_7) - logerror("%06X:unknown_107_w = %02X\n", activecpu_get_pc(), data & 0xff); + logerror("%06X:unknown_107_w = %02X\n", cpu_get_pc(machine->activecpu), data & 0xff); else - logerror("%06X:unknown_107_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:unknown_107_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } static WRITE32_HANDLER( unknown_127_w ) { /* arbitrary data written */ if (ACCESSING_BITS_0_7) - logerror("%06X:unknown_127_w = %02X\n", activecpu_get_pc(), data & 0xff); + logerror("%06X:unknown_127_w = %02X\n", cpu_get_pc(machine->activecpu), data & 0xff); else - logerror("%06X:unknown_127_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:unknown_127_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } static WRITE32_HANDLER( unknown_137_w ) { /* only written $00 or $ff */ if (ACCESSING_BITS_0_7) - logerror("%06X:unknown_137_w = %02X\n", activecpu_get_pc(), data & 0xff); + logerror("%06X:unknown_137_w = %02X\n", cpu_get_pc(machine->activecpu), data & 0xff); else - logerror("%06X:unknown_137_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:unknown_137_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } static WRITE32_HANDLER( unknown_13a_w ) { /* only written $0000 or $0001 */ if (ACCESSING_BITS_0_15) - logerror("%06X:unknown_13a_w = %04X\n", activecpu_get_pc(), data & 0xffff); + logerror("%06X:unknown_13a_w = %04X\n", cpu_get_pc(machine->activecpu), data & 0xffff); else - logerror("%06X:unknown_13a_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:unknown_13a_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c index 54aee3b8d6a..dce31138f42 100644 --- a/src/mame/drivers/gaiden.c +++ b/src/mame/drivers/gaiden.c @@ -198,7 +198,7 @@ static WRITE16_HANDLER( wildfang_protection_w ) data >>= 8; -// logerror("PC %06x: prot = %02x\n",activecpu_get_pc(),data); +// logerror("PC %06x: prot = %02x\n",cpu_get_pc(machine->activecpu),data); switch (data & 0xf0) { @@ -236,7 +236,7 @@ static WRITE16_HANDLER( wildfang_protection_w ) static READ16_HANDLER( wildfang_protection_r ) { -// logerror("PC %06x: read prot %02x\n",activecpu_get_pc(),prot); +// logerror("PC %06x: read prot %02x\n",cpu_get_pc(machine->activecpu),prot); return prot; } @@ -326,7 +326,7 @@ static WRITE16_HANDLER( raiga_protection_w ) data >>= 8; -// logerror("PC %06x: prot = %02x\n",activecpu_get_pc(),data); +// logerror("PC %06x: prot = %02x\n",cpu_get_pc(machine->activecpu),data); switch (data & 0xf0) { @@ -372,7 +372,7 @@ static WRITE16_HANDLER( raiga_protection_w ) static READ16_HANDLER( raiga_protection_r ) { -// logerror("PC %06x: read prot %02x\n",activecpu_get_pc(),prot); +// logerror("PC %06x: read prot %02x\n",cpu_get_pc(machine->activecpu),prot); return prot; } diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c index 6b7d00340ee..c502eb058aa 100644 --- a/src/mame/drivers/galastrm.c +++ b/src/mame/drivers/galastrm.c @@ -150,7 +150,7 @@ popmessage(t); coin_counter_w(1, data & 0x04000000); coin_word = (data >> 16) &0xffff; } -//logerror("CPU #0 PC %06x: write input %06x\n",activecpu_get_pc(),offset); +//logerror("CPU #0 PC %06x: write input %06x\n",cpu_get_pc(machine->activecpu),offset); } } } diff --git a/src/mame/drivers/galaxia.c b/src/mame/drivers/galaxia.c index df432d29ff9..4105b6b1db7 100644 --- a/src/mame/drivers/galaxia.c +++ b/src/mame/drivers/galaxia.c @@ -100,7 +100,7 @@ static VIDEO_UPDATE( galaxia ) static WRITE8_HANDLER(galaxia_video_w) { - if (activecpu_get_reg(S2650_FO)) + if (cpu_get_reg(machine->activecpu, S2650_FO)) { galaxia_video[offset]=data; } diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index 93583e02cff..db035eae371 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -388,13 +388,13 @@ static WRITE8_HANDLER( konami_sound_filter_w ) static WRITE8_DEVICE_HANDLER( konami_portc_0_w ) { - logerror("%04X:ppi0_portc_w = %02X\n", activecpu_get_pc(), data); + logerror("%04X:ppi0_portc_w = %02X\n", cpu_get_pc(device->machine->activecpu), data); } static WRITE8_DEVICE_HANDLER( konami_portc_1_w ) { - logerror("%04X:ppi1_portc_w = %02X\n", activecpu_get_pc(), data); + logerror("%04X:ppi1_portc_w = %02X\n", cpu_get_pc(device->machine->activecpu), data); } @@ -758,7 +758,7 @@ static WRITE8_DEVICE_HANDLER( scorpion_protection_w ) static READ8_HANDLER( scorpion_sound_status_r ) { - logerror("%04X:scorpion_sound_status_r()\n", safe_activecpu_get_pc()); + logerror("%04X:scorpion_sound_status_r()\n", safe_cpu_get_pc(machine->activecpu)); return 1; } @@ -766,7 +766,7 @@ static READ8_HANDLER( scorpion_sound_status_r ) static WRITE8_HANDLER( scorpion_sound_data_w ) { scorpion_sound_data = data; -// logerror("%04X:scorpion_sound_data_w(%02X)\n", safe_activecpu_get_pc(), data); +// logerror("%04X:scorpion_sound_data_w(%02X)\n", safe_cpu_get_pc(machine->activecpu), data); } @@ -774,7 +774,7 @@ static WRITE8_HANDLER( scorpion_sound_control_w ) { if (!(data & 0x04)) mame_printf_debug("Secondary sound = %02X\n", scorpion_sound_data); -// logerror("%04X:scorpion_sound_control_w(%02X)\n", safe_activecpu_get_pc(), data); +// logerror("%04X:scorpion_sound_control_w(%02X)\n", safe_cpu_get_pc(machine->activecpu), data); } @@ -978,7 +978,7 @@ static READ8_HANDLER( jumpbug_protection_r ) case 0x0235: return 0x02; case 0x0311: return 0xff; /* not checked */ } - logerror("Unknown protection read. Offset: %04X PC=%04X\n",0xb000+offset,activecpu_get_pc()); + logerror("Unknown protection read. Offset: %04X PC=%04X\n",0xb000+offset,cpu_get_pc(machine->activecpu)); return 0xff; } @@ -1005,7 +1005,7 @@ static TIMER_CALLBACK( checkmaj_irq0_gen ) static READ8_HANDLER( checkmaj_protection_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x0f15: return 0xf5; case 0x0f8f: return 0x7c; @@ -1014,7 +1014,7 @@ static READ8_HANDLER( checkmaj_protection_r ) case 0x10f1: return 0xaa; case 0x1402: return 0xaa; default: - logerror("Unknown protection read. PC=%04X\n",activecpu_get_pc()); + logerror("Unknown protection read. PC=%04X\n",cpu_get_pc(machine->activecpu)); } return 0; diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c index 78a51b366b0..d32e0283364 100644 --- a/src/mame/drivers/galaxold.c +++ b/src/mame/drivers/galaxold.c @@ -383,7 +383,7 @@ TO DO : /* Send sound data to the sound cpu and cause an nmi */ static READ8_HANDLER( drivfrcg_port0_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x002e: case 0x0297: @@ -954,7 +954,7 @@ ADDRESS_MAP_END static READ8_HANDLER( hexpoola_data_port_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x0022: return 0; diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c index 119ef0b9435..747e0bbf351 100644 --- a/src/mame/drivers/galpani2.c +++ b/src/mame/drivers/galpani2.c @@ -80,17 +80,17 @@ static MACHINE_RESET( galpani2 ) kaneko16_sprite_yoffs = 0x000; } -static void galpani2_write_kaneko(void) +static void galpani2_write_kaneko(running_machine *machine) { - cpunum_write_byte(0,0x100000,0x4b); - cpunum_write_byte(0,0x100001,0x41); - cpunum_write_byte(0,0x100002,0x4e); - cpunum_write_byte(0,0x100003,0x45); - cpunum_write_byte(0,0x100004,0x4b); - cpunum_write_byte(0,0x100005,0x4f); + cpu_write_byte(machine->cpu[0],0x100000,0x4b); + cpu_write_byte(machine->cpu[0],0x100001,0x41); + cpu_write_byte(machine->cpu[0],0x100002,0x4e); + cpu_write_byte(machine->cpu[0],0x100003,0x45); + cpu_write_byte(machine->cpu[0],0x100004,0x4b); + cpu_write_byte(machine->cpu[0],0x100005,0x4f); } -void galpani2_mcu_run(void) +void galpani2_mcu_run(running_machine *machine) { int i,x; @@ -99,30 +99,30 @@ void galpani2_mcu_run(void) x = 0; for (i = 0x100000; i < 0x100007; i++) - x |= cpunum_read_byte(0,i); + x |= cpu_read_byte(machine->cpu[0],i); if ( x == 0 ) { - galpani2_write_kaneko(); - cpunum_write_byte(1,0x100006,1); + galpani2_write_kaneko(machine); + cpu_write_byte(machine->cpu[1],0x100006,1); logerror("MCU executes CHECK0\n"); } } -static void galpani2_mcu_nmi(void) +static void galpani2_mcu_nmi(running_machine *machine) { UINT32 mcu_list, mcu_command, mcu_address, mcu_src, mcu_dst, mcu_size; /* "Last Check" */ - galpani2_write_kaneko(); + galpani2_write_kaneko(machine); for ( mcu_list = 0x100020; mcu_list < (0x100020 + 0x40); mcu_list += 4 ) { - mcu_command = cpunum_read_byte(0, mcu_list + 1 ); + mcu_command = cpu_read_byte(machine->cpu[0], mcu_list + 1 ); mcu_address = 0x100000 + - (cpunum_read_byte(0, mcu_list + 2)<<8) + - (cpunum_read_byte(0, mcu_list + 3)<<0) ; + (cpu_read_byte(machine->cpu[0], mcu_list + 2)<<8) + + (cpu_read_byte(machine->cpu[0], mcu_list + 3)<<0) ; switch (mcu_command) { @@ -130,47 +130,47 @@ static void galpani2_mcu_nmi(void) break; case 0x0a: // Copy N bytes from RAM1 to RAM2 - mcu_src = (cpunum_read_byte(0, mcu_address + 2)<<8) + - (cpunum_read_byte(0, mcu_address + 3)<<0) ; + mcu_src = (cpu_read_byte(machine->cpu[0], mcu_address + 2)<<8) + + (cpu_read_byte(machine->cpu[0], mcu_address + 3)<<0) ; - mcu_dst = (cpunum_read_byte(0, mcu_address + 6)<<8) + - (cpunum_read_byte(0, mcu_address + 7)<<0) ; + mcu_dst = (cpu_read_byte(machine->cpu[0], mcu_address + 6)<<8) + + (cpu_read_byte(machine->cpu[0], mcu_address + 7)<<0) ; - mcu_size = (cpunum_read_byte(0, mcu_address + 8)<<8) + - (cpunum_read_byte(0, mcu_address + 9)<<0) ; + mcu_size = (cpu_read_byte(machine->cpu[0], mcu_address + 8)<<8) + + (cpu_read_byte(machine->cpu[0], mcu_address + 9)<<0) ; - logerror("CPU #0 PC %06X : MCU executes command $A, %04X %02X-> %04x\n",activecpu_get_pc(),mcu_src,mcu_size,mcu_dst); + logerror("CPU #0 PC %06X : MCU executes command $A, %04X %02X-> %04x\n",cpu_get_pc(machine->activecpu),mcu_src,mcu_size,mcu_dst); for( ; mcu_size > 0 ; mcu_size-- ) { mcu_src &= 0xffff; mcu_dst &= 0xffff; - cpunum_write_byte(1,0x100000 + mcu_dst,cpunum_read_byte(0,0x100000 + mcu_src)); + cpu_write_byte(machine->cpu[1],0x100000 + mcu_dst,cpu_read_byte(machine->cpu[0],0x100000 + mcu_src)); mcu_src ++; mcu_dst ++; } /* Raise a "job done" flag */ - cpunum_write_byte(0,mcu_address+0,0xff); - cpunum_write_byte(0,mcu_address+1,0xff); + cpu_write_byte(machine->cpu[0],mcu_address+0,0xff); + cpu_write_byte(machine->cpu[0],mcu_address+1,0xff); break; default: /* Raise a "job done" flag */ - cpunum_write_byte(0,mcu_address+0,0xff); - cpunum_write_byte(0,mcu_address+1,0xff); + cpu_write_byte(machine->cpu[0],mcu_address+0,0xff); + cpu_write_byte(machine->cpu[0],mcu_address+1,0xff); - logerror("CPU #0 PC %06X : MCU ERROR, unknown command %02X\n",activecpu_get_pc(),mcu_command); + logerror("CPU #0 PC %06X : MCU ERROR, unknown command %02X\n",cpu_get_pc(machine->activecpu),mcu_command); } /* Erase command? */ - cpunum_write_byte(0,mcu_list + 1,0x00); + cpu_write_byte(machine->cpu[0],mcu_list + 1,0x00); } } static WRITE16_HANDLER( galpani2_mcu_nmi_w ) { static UINT16 old = 0; - if ( (data & 1) && !(old & 1) ) galpani2_mcu_nmi(); + if ( (data & 1) && !(old & 1) ) galpani2_mcu_nmi(machine); old = data; } @@ -203,7 +203,7 @@ static WRITE16_HANDLER( galpani2_oki_0_bank_w ) if (ACCESSING_BITS_0_7) { UINT8 *ROM = memory_region(machine, "oki1"); - logerror("CPU #0 PC %06X : OKI 0 bank %08X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06X : OKI 0 bank %08X\n",cpu_get_pc(machine->activecpu),data); memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000); } } @@ -213,7 +213,7 @@ static WRITE16_HANDLER( galpani2_oki_1_bank_w ) if (ACCESSING_BITS_0_7) { okim6295_set_bank_base(1, 0x40000 * (data & 0xf) ); - logerror("CPU #0 PC %06X : OKI 1 bank %08X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06X : OKI 1 bank %08X\n",cpu_get_pc(machine->activecpu),data); } } diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c index 31652935ab9..579097b3163 100644 --- a/src/mame/drivers/galpani3.c +++ b/src/mame/drivers/galpani3.c @@ -198,7 +198,7 @@ static void galpani3_mcu_run(running_machine *machine) UINT16 mcu_offset = mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */ UINT16 mcu_subcmd = mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */ - logerror("(PC=%06X): MCU executed command : %04X %04X\n",activecpu_get_pc(),mcu_command,mcu_offset*2); + logerror("(PC=%06X): MCU executed command : %04X %04X\n",cpu_get_pc(machine->activecpu),mcu_command,mcu_offset*2); /* the only MCU commands found in program code are: 0x04: protection: provide code/data, that's exactly where we are stuck !!! @@ -211,7 +211,7 @@ static void galpani3_mcu_run(running_machine *machine) case 0x03: // DSW { mcu_ram[mcu_offset] = input_port_read(machine, "DSW"); - logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", activecpu_get_pc(), mcu_command, mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2); } break; @@ -300,7 +300,7 @@ GALPANI3_MCU_COM_W(3) static READ16_HANDLER( galpani3_mcu_status_r ) { - logerror("cpu #%d (PC=%06X): read mcu status\n", cpu_getactivecpu(), activecpu_get_previouspc()); + logerror("cpu #%d (PC=%06X): read mcu status\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu)); return 0; } diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c index c5a6db6e451..ba6848804a6 100644 --- a/src/mame/drivers/gamecstl.c +++ b/src/mame/drivers/gamecstl.c @@ -185,7 +185,7 @@ static UINT8 mxtc_config_r(int function, int reg) static void mxtc_config_w(running_machine *machine, int function, int reg, UINT8 data) { -// mame_printf_debug("MXTC: write %d, %02X, %02X at %08X\n", function, reg, data, activecpu_get_pc()); +// mame_printf_debug("MXTC: write %d, %02X, %02X at %08X\n", function, reg, data, cpu_get_pc(machine->activecpu)); switch(reg) { @@ -269,7 +269,7 @@ static UINT8 piix4_config_r(int function, int reg) static void piix4_config_w(int function, int reg, UINT8 data) { -// mame_printf_debug("PIIX4: write %d, %02X, %02X at %08X\n", function, reg, data, activecpu_get_pc()); +// mame_printf_debug("PIIX4: write %d, %02X, %02X at %08X\n", function, reg, data, cpu_get_pc(machine->activecpu)); piix4_config_reg[function][reg] = data; } @@ -425,9 +425,9 @@ static DMA8237_MEM_READ( pc_dma_read_byte ) offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16) & 0xFF0000; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); result = program_read_byte(page_offset + offset); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -438,9 +438,9 @@ static DMA8237_MEM_WRITE( pc_dma_write_byte ) offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16) & 0xFF0000; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); program_write_byte(page_offset + offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c index 61460b8a3d8..da66d0d1e36 100644 --- a/src/mame/drivers/gaplus.c +++ b/src/mame/drivers/gaplus.c @@ -287,7 +287,7 @@ static WRITE8_HANDLER( gaplus_sreset_w ) static WRITE8_HANDLER( gaplus_freset_w ) { int bit = !BIT(offset,11); -logerror("%04x: freset %d\n",activecpu_get_pc(),bit); +logerror("%04x: freset %d\n",cpu_get_pc(machine->activecpu),bit); namcoio_set_reset_line(0, bit ? CLEAR_LINE : ASSERT_LINE); namcoio_set_reset_line(1, bit ? CLEAR_LINE : ASSERT_LINE); } diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c index a679086e922..26de864e41b 100644 --- a/src/mame/drivers/gbusters.c +++ b/src/mame/drivers/gbusters.c @@ -59,7 +59,7 @@ static WRITE8_HANDLER( gbusters_1f98_w ) /* other bits unused/unknown */ if (data & 0xfe){ - //logerror("%04x: (1f98) write %02x\n",activecpu_get_pc(), data); + //logerror("%04x: (1f98) write %02x\n",cpu_get_pc(machine->activecpu), data); //popmessage("$1f98 = %02x", data); } } @@ -86,13 +86,13 @@ static WRITE8_HANDLER( gbusters_coin_counter_w ) sprintf(baf,"ccnt = %02x", data); popmessage(baf); #endif - logerror("%04x: (ccount) write %02x\n",activecpu_get_pc(), data); + logerror("%04x: (ccount) write %02x\n",cpu_get_pc(machine->activecpu), data); } } static WRITE8_HANDLER( gbusters_unknown_w ) { - logerror("%04x: write %02x to 0x1f9c\n",activecpu_get_pc(), data); + logerror("%04x: write %02x to 0x1f9c\n",cpu_get_pc(machine->activecpu), data); { char baf[40]; @@ -424,7 +424,7 @@ static void gbusters_banking( int lines ) memory_set_bankptr( 1, &RAM[offs] ); if (lines & 0xf0){ - //logerror("%04x: (lines) write %02x\n",activecpu_get_pc(), lines); + //logerror("%04x: (lines) write %02x\n",cpu_get_pc(machine->activecpu), lines); //popmessage("lines = %02x", lines); } @@ -435,7 +435,7 @@ static MACHINE_RESET( gbusters ) { UINT8 *RAM = memory_region(machine, "main"); - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)gbusters_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)gbusters_banking); /* mirror address for banked ROM */ memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000 ); diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c index 78acacbb64f..c2c014763e0 100644 --- a/src/mame/drivers/gcpinbal.c +++ b/src/mame/drivers/gcpinbal.c @@ -96,7 +96,7 @@ static READ16_HANDLER( ioc_r ) } -//logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",activecpu_get_pc(),offset); +//logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(machine->activecpu),offset); return gcpinbal_ioc_ram[offset]; } @@ -186,7 +186,7 @@ static WRITE16_HANDLER( ioc_w ) break; default: - logerror("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n",activecpu_get_pc(),offset,data); + logerror("CPU #0 PC %06x: warning - write ioc offset %06x with %04x\n",cpu_get_pc(machine->activecpu),offset,data); break; } diff --git a/src/mame/drivers/genesis.c b/src/mame/drivers/genesis.c index 0bccff68484..a07408e0bb8 100644 --- a/src/mame/drivers/genesis.c +++ b/src/mame/drivers/genesis.c @@ -439,7 +439,7 @@ UINT16 *genesis_io_ram; /* megaplay.c uses a local copy 'OLD_megaplay_genesis_io_w' */ WRITE16_HANDLER ( genesis_io_w ) { -// logerror ("write io offset :%02x data %04x PC: 0x%06x\n",offset,data,activecpu_get_previouspc()); +// logerror ("write io offset :%02x data %04x PC: 0x%06x\n",offset,data,cpu_get_previouspc(machine->activecpu)); switch (offset) { diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c index dbaabd0f846..474f1d33f28 100644 --- a/src/mame/drivers/ghosteo.c +++ b/src/mame/drivers/ghosteo.c @@ -77,7 +77,7 @@ static struct lcd_config static READ32_HANDLER( r1 ) { -// int pc = activecpu_get_pc(); +// int pc = cpu_get_pc(machine->activecpu); // if(pc != 0x9a0 && pc != 0x7b4) printf("r1 @ %X\n",pc); return 1; @@ -85,7 +85,7 @@ static READ32_HANDLER( r1 ) static READ32_HANDLER( r2 ) { -// int pc = activecpu_get_pc(); +// int pc = cpu_get_pc(machine->activecpu); // if(pc != 0xd64 && pc != 0xd3c )printf("r2 @ %X\n",pc); return 2; diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c index 341084dcfd6..50b7ef0b416 100644 --- a/src/mame/drivers/gladiatr.c +++ b/src/mame/drivers/gladiatr.c @@ -1019,7 +1019,7 @@ static DRIVER_INIT( gladiatr ) static READ8_HANDLER(f6a3_r) { - if(activecpu_get_previouspc()==0x8e) + if(cpu_get_previouspc(machine->activecpu)==0x8e) generic_nvram[0x6a3]=1; return generic_nvram[0x6a3]; diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c index 1be58113bfb..03a4b186afd 100644 --- a/src/mame/drivers/goal92.c +++ b/src/mame/drivers/goal92.c @@ -51,7 +51,7 @@ static READ16_HANDLER( goal92_inputs_r ) return input_port_read(machine, "DSW2"); default: - logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n",offset, mem_mask,activecpu_get_pc()); + logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n",offset, mem_mask,cpu_get_pc(machine->activecpu)); } return 0; diff --git a/src/mame/drivers/goindol.c b/src/mame/drivers/goindol.c index f3b2d4825cf..f2785cb1525 100644 --- a/src/mame/drivers/goindol.c +++ b/src/mame/drivers/goindol.c @@ -69,7 +69,7 @@ static UINT8 *ram; static WRITE8_HANDLER( prot_fc44_w ) { -logerror("%04x: prot_fc44_w(%02x)\n",activecpu_get_pc(),data); +logerror("%04x: prot_fc44_w(%02x)\n",cpu_get_pc(machine->activecpu),data); ram[0x0419] = 0x5b; ram[0x041a] = 0x3f; ram[0x041b] = 0x6d; @@ -77,19 +77,19 @@ logerror("%04x: prot_fc44_w(%02x)\n",activecpu_get_pc(),data); static WRITE8_HANDLER( prot_fd99_w ) { -logerror("%04x: prot_fd99_w(%02x)\n",activecpu_get_pc(),data); +logerror("%04x: prot_fd99_w(%02x)\n",cpu_get_pc(machine->activecpu),data); ram[0x0421] = 0x3f; } static WRITE8_HANDLER( prot_fc66_w ) { -logerror("%04x: prot_fc66_w(%02x)\n",activecpu_get_pc(),data); +logerror("%04x: prot_fc66_w(%02x)\n",cpu_get_pc(machine->activecpu),data); ram[0x0423] = 0x06; } static WRITE8_HANDLER( prot_fcb0_w ) { -logerror("%04x: prot_fcb0_w(%02x)\n",activecpu_get_pc(),data); +logerror("%04x: prot_fcb0_w(%02x)\n",cpu_get_pc(machine->activecpu),data); ram[0x0425] = 0x06; } diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c index 4b6d990b7b2..eb94a4e6e4d 100644 --- a/src/mame/drivers/gradius3.c +++ b/src/mame/drivers/gradius3.c @@ -47,7 +47,7 @@ static WRITE16_HANDLER( K052109_halfword_w ) /* is this a bug in the game or something else? */ if (!ACCESSING_BITS_0_7) K052109_w(machine,offset,(data >> 8) & 0xff); -// logerror("%06x half %04x = %04x\n",activecpu_get_pc(),offset,data); +// logerror("%06x half %04x = %04x\n",cpu_get_pc(machine->activecpu),offset,data); } static READ16_HANDLER( K051937_halfword_r ) @@ -105,7 +105,7 @@ static WRITE16_HANDLER( cpuA_ctrl_w ) irqAen = data & 0x20; /* other bits unknown */ -//logerror("%06x: write %04x to c0000\n",activecpu_get_pc(),data); +//logerror("%06x: write %04x to c0000\n",cpu_get_pc(machine->activecpu),data); } } @@ -139,11 +139,11 @@ static WRITE16_HANDLER( cpuB_irqtrigger_w ) { if (irqBmask & 4) { -logerror("%04x trigger cpu B irq 4 %02x\n",activecpu_get_pc(),data); +logerror("%04x trigger cpu B irq 4 %02x\n",cpu_get_pc(machine->activecpu),data); cpunum_set_input_line(machine, 1,4,HOLD_LINE); } else -logerror("%04x MISSED cpu B irq 4 %02x\n",activecpu_get_pc(),data); +logerror("%04x MISSED cpu B irq 4 %02x\n",cpu_get_pc(machine->activecpu),data); } static WRITE16_HANDLER( sound_command_w ) diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c index afe0d1eb735..4c2e1eff845 100644 --- a/src/mame/drivers/groundfx.c +++ b/src/mame/drivers/groundfx.c @@ -467,11 +467,11 @@ ROM_END static READ32_HANDLER( irq_speedup_r_groundfx ) { int ptr; - if ((activecpu_get_sp()&2)==0) ptr=groundfx_ram[(activecpu_get_sp()&0x1ffff)/4]; - else ptr=(((groundfx_ram[(activecpu_get_sp()&0x1ffff)/4])&0x1ffff)<<16) | - (groundfx_ram[((activecpu_get_sp()&0x1ffff)/4)+1]>>16); + if ((cpu_get_sp(machine->activecpu)&2)==0) ptr=groundfx_ram[(cpu_get_sp(machine->activecpu)&0x1ffff)/4]; + else ptr=(((groundfx_ram[(cpu_get_sp(machine->activecpu)&0x1ffff)/4])&0x1ffff)<<16) | + (groundfx_ram[((cpu_get_sp(machine->activecpu)&0x1ffff)/4)+1]>>16); - if (activecpu_get_pc()==0x1ece && ptr==0x1b9a) + if (cpu_get_pc(machine->activecpu)==0x1ece && ptr==0x1b9a) cpu_spinuntil_int(); return groundfx_ram[0xb574/4]; diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c index dd52bd94205..1225b819215 100644 --- a/src/mame/drivers/gstream.c +++ b/src/mame/drivers/gstream.c @@ -478,7 +478,7 @@ ROM_END static READ32_HANDLER( gstream_speedup_r ) { - if (activecpu_get_pc()==0xc0001592) + if (cpu_get_pc(machine->activecpu)==0xc0001592) { activecpu_eat_cycles(50); } diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c index 0046f68b029..7823643de5b 100644 --- a/src/mame/drivers/gsword.c +++ b/src/mame/drivers/gsword.c @@ -221,7 +221,7 @@ static READ8_HANDLER( gsword_8741_2_r ) case 0x04: /* Player 2 Controller */ return input_port_read(machine, "IN3"); // default: -// logerror("8741-2 unknown read %d PC=%04x\n",offset,activecpu_get_pc()); +// logerror("8741-2 unknown read %d PC=%04x\n",offset,cpu_get_pc(machine->activecpu)); } /* unknown */ return 0; @@ -239,7 +239,7 @@ static READ8_HANDLER( gsword_8741_3_r ) return input_port_read(machine, "IN3"); } /* unknown */ -// logerror("8741-3 unknown read %d PC=%04x\n",offset,activecpu_get_pc()); +// logerror("8741-3 unknown read %d PC=%04x\n",offset,cpu_get_pc(machine->activecpu)); return 0; } diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c index 519af445580..40709bf640d 100644 --- a/src/mame/drivers/gticlub.c +++ b/src/mame/drivers/gticlub.c @@ -539,7 +539,7 @@ READ8_HANDLER( K056230_r ) } } -// mame_printf_debug("K056230_r: %d at %08X\n", offset, activecpu_get_pc()); +// mame_printf_debug("K056230_r: %d at %08X\n", offset, cpu_get_pc(machine->activecpu)); return 0; } @@ -577,19 +577,19 @@ WRITE8_HANDLER( K056230_w ) break; } } -// mame_printf_debug("K056230_w: %d, %02X at %08X\n", offset, data, activecpu_get_pc()); +// mame_printf_debug("K056230_w: %d, %02X at %08X\n", offset, data, cpu_get_pc(machine->activecpu)); } UINT32 *lanc_ram; READ32_HANDLER( lanc_ram_r ) { -// mame_printf_debug("LANC_RAM_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); +// mame_printf_debug("LANC_RAM_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); return lanc_ram[offset & 0x7ff]; } WRITE32_HANDLER( lanc_ram_w ) { -// mame_printf_debug("LANC_RAM_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); +// mame_printf_debug("LANC_RAM_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); COMBINE_DATA(lanc_ram + (offset & 0x7ff)); } @@ -598,14 +598,14 @@ WRITE32_HANDLER( lanc_ram_w ) static MACHINE_START( gticlub ) { /* set conservative DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_END, 0x000fffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_READONLY, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x000fffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); } static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 ) diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c index 3e5a4c6c12e..02eca71f374 100644 --- a/src/mame/drivers/gunbustr.c +++ b/src/mame/drivers/gunbustr.c @@ -136,7 +136,7 @@ popmessage(t); coin_counter_w(1, data & 0x04000000); coin_word = (data >> 16) &0xffff; } -//logerror("CPU #0 PC %06x: write input %06x\n",activecpu_get_pc(),offset); +//logerror("CPU #0 PC %06x: write input %06x\n",cpu_get_pc(machine->activecpu),offset); } } } @@ -422,7 +422,7 @@ ROM_END static READ32_HANDLER( main_cycle_r ) { - if (activecpu_get_pc()==0x55a && (gunbustr_ram[0x3acc/4]&0xff000000)==0) + if (cpu_get_pc(machine->activecpu)==0x55a && (gunbustr_ram[0x3acc/4]&0xff000000)==0) cpu_spinuntil_int(); return gunbustr_ram[0x3acc/4]; diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c index d423e53c663..66f85ab160d 100644 --- a/src/mame/drivers/gunpey.c +++ b/src/mame/drivers/gunpey.c @@ -86,7 +86,7 @@ static WRITE16_HANDLER(main_w) static READ16_HANDLER(main_r) { if(offset>0x502d/2 && offset<0x56c0/2) - logerror("R %x @%x\n",offset*2,activecpu_get_pc()); + logerror("R %x @%x\n",offset*2,cpu_get_pc(machine->activecpu)); return mainram[offset]; } diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c index 5416816dc00..483b9c2f544 100644 --- a/src/mame/drivers/halleys.c +++ b/src/mame/drivers/halleys.c @@ -311,7 +311,7 @@ static void blit(int offset) #if HALLEYS_DEBUG if (0) { - logerror("%04x:[%04x]", activecpu_get_pc(), offset); + logerror("%04x:[%04x]", cpu_get_pc(machine->activecpu), offset); for (ecx=0; ecx<16; ecx++) logerror(" %02x", param[ecx]); logerror("\n"); } #endif @@ -968,7 +968,7 @@ static WRITE8_HANDLER( bgtile_w ) static READ8_HANDLER( blitter_status_r ) { - if (game_id==GAME_HALLEYS && activecpu_get_pc()==0x8017) return(0x55); // HACK: trick SRAM test on startup + if (game_id==GAME_HALLEYS && cpu_get_pc(machine->activecpu)==0x8017) return(0x55); // HACK: trick SRAM test on startup return(0); } @@ -1038,7 +1038,7 @@ static READ8_HANDLER( collision_id_r ) UPDATE: re-implemented pixel collision to accompany the hack method. */ - if (game_id==GAME_HALLEYS && activecpu_get_pc()==halleys_collision_detection) // HACK: collision detection bypass + if (game_id==GAME_HALLEYS && cpu_get_pc(machine->activecpu)==halleys_collision_detection) // HACK: collision detection bypass { if (collision_count) { collision_count--; return(collision_list[collision_count]); } diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c index 295d882b3e9..d09237fdc9a 100644 --- a/src/mame/drivers/harddriv.c +++ b/src/mame/drivers/harddriv.c @@ -3707,9 +3707,9 @@ static UINT32 *rddsp32_speedup; static offs_t rddsp32_speedup_pc; static READ32_HANDLER( rddsp32_speedup_r ) { - if (activecpu_get_pc() == rddsp32_speedup_pc && (*rddsp32_speedup >> 16) == 0) + if (cpu_get_pc(machine->activecpu) == rddsp32_speedup_pc && (*rddsp32_speedup >> 16) == 0) { - UINT32 r14 = activecpu_get_reg(DSP32_R14); + UINT32 r14 = cpu_get_reg(machine->activecpu, DSP32_R14); UINT32 r1 = program_read_word(r14 - 0x14); int cycles_to_burn = 17 * 4 * (0x2bc - r1 - 2); if (cycles_to_burn > 20 * 4) diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c index 8dd5e72d64e..72bffc2c2fb 100644 --- a/src/mame/drivers/hexion.c +++ b/src/mame/drivers/hexion.c @@ -97,7 +97,7 @@ WRITE8_HANDLER( hexion_gfxrom_select_w ); static WRITE8_HANDLER( coincntr_w ) { -//logerror("%04x: coincntr_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: coincntr_w %02x\n",cpu_get_pc(machine->activecpu),data); /* bits 0/1 = coin counters */ coin_counter_w(0,data & 0x01); diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c index 19990018e6c..3e9e560f5ee 100644 --- a/src/mame/drivers/hng64.c +++ b/src/mame/drivers/hng64.c @@ -571,14 +571,14 @@ static READ32_HANDLER( hng64_random_read ) static READ32_HANDLER( hng64_com_r ) { - logerror("com read (PC=%08x): %08x %08x = %08x\n", activecpu_get_pc(), (offset*4)+0xc0000000, mem_mask, hng64_com_ram[offset]); + logerror("com read (PC=%08x): %08x %08x = %08x\n", cpu_get_pc(machine->activecpu), (offset*4)+0xc0000000, mem_mask, hng64_com_ram[offset]); return hng64_com_ram[offset] ; } static WRITE32_HANDLER( hng64_com_w ) { - logerror("com write (PC=%08x): %08x %08x = %08x\n", activecpu_get_pc(), (offset*4)+0xc0000000, mem_mask, data); + logerror("com write (PC=%08x): %08x %08x = %08x\n", cpu_get_pc(machine->activecpu), (offset*4)+0xc0000000, mem_mask, data); COMBINE_DATA(&hng64_com_ram[offset]); } @@ -588,7 +588,7 @@ static UINT32 hng64_com_shared_b; static WRITE32_HANDLER( hng64_com_share_w ) { - logerror("commw (PC=%08x): %08x %08x %08x\n", activecpu_get_pc(), data, (offset*4)+0xc0001000, mem_mask); + logerror("commw (PC=%08x): %08x %08x %08x\n", cpu_get_pc(machine->activecpu), data, (offset*4)+0xc0001000, mem_mask); if (offset==0x0) COMBINE_DATA(&hng64_com_shared_a); if (offset==0x1) COMBINE_DATA(&hng64_com_shared_b); @@ -596,7 +596,7 @@ static WRITE32_HANDLER( hng64_com_share_w ) static READ32_HANDLER( hng64_com_share_r ) { - logerror("commr (PC=%08x): %08x %08x\n", activecpu_get_pc(), (offset*4)+0xc0001000, mem_mask); + logerror("commr (PC=%08x): %08x %08x\n", cpu_get_pc(machine->activecpu), (offset*4)+0xc0001000, mem_mask); // if(offset==0x0) return hng64_com_shared_a; // if(offset==0x1) return hng64_com_shared_b; @@ -631,7 +631,7 @@ static WRITE32_HANDLER( hng64_pal_w ) static READ32_HANDLER( hng64_port_read ) { - logerror("HNG64 port read (PC=%08x) 0x%08x\n", activecpu_get_pc(),offset*4); + logerror("HNG64 port read (PC=%08x) 0x%08x\n", cpu_get_pc(machine->activecpu),offset*4); if(offset==0x421) return 0x00000002; if(offset==0x441) return hng64_interrupt_level_request; @@ -703,25 +703,25 @@ READ32_HANDLER( hng64_cart_r ) static READ32_HANDLER( hng64_sram_r ) { - logerror("HNG64 reading from SRAM 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, hng64_sram[offset], activecpu_get_pc()); + logerror("HNG64 reading from SRAM 0x%08x == 0x%08x. (PC=%08x)\n", offset*4, hng64_sram[offset], cpu_get_pc(machine->activecpu)); return hng64_sram[offset]; } static WRITE32_HANDLER( hng64_sram_w ) { - logerror("HNG64 writing to SRAM 0x%08x == 0x%08x & 0x%08x. (PC=%08x)\n", offset*4, data, mem_mask, activecpu_get_pc()); + logerror("HNG64 writing to SRAM 0x%08x == 0x%08x & 0x%08x. (PC=%08x)\n", offset*4, data, mem_mask, cpu_get_pc(machine->activecpu)); COMBINE_DATA (&hng64_sram[offset]); } static WRITE32_HANDLER( hng64_dualport_w ) { - logerror("dualport WRITE %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], activecpu_get_pc()); + logerror("dualport WRITE %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(machine->activecpu)); COMBINE_DATA (&hng64_dualport[offset]); } static READ32_HANDLER( hng64_dualport_r ) { - logerror("dualport R %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], activecpu_get_pc()); + logerror("dualport R %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(machine->activecpu)); // These hacks create some red marks for the boot-up sequence switch (offset*4) @@ -805,7 +805,7 @@ static WRITE32_HANDLER( dl_w ) // if (offset == 0x85 && hng64_dl[offset] == 0x1) // Just before the second half of the writes // hng64_dl[0x86] = 0x2 ; // set 0x86 to 2 (so it drops into the loop) -// mame_printf_debug("dl W (%08x) : %.8x %.8x\n", activecpu_get_pc(), offset, hng64_dl[offset]) ; +// mame_printf_debug("dl W (%08x) : %.8x %.8x\n", cpu_get_pc(machine->activecpu), offset, hng64_dl[offset]) ; } static READ32_HANDLER( dl_r ) @@ -813,8 +813,8 @@ static READ32_HANDLER( dl_r ) // A read of 0x86 ONLY happens if there are more display lists than what are readily available. // (PC = 8006fe1c) -// mame_printf_debug("dl R (%08x) : %x %x\n", activecpu_get_pc(), offset, hng64_dl[offset]) ; -// usrintf_showmessage("dl R (%08x) : %x %x", activecpu_get_pc(), offset, hng64_dl[offset]) ; +// mame_printf_debug("dl R (%08x) : %x %x\n", cpu_get_pc(machine->activecpu), offset, hng64_dl[offset]) ; +// usrintf_showmessage("dl R (%08x) : %x %x", cpu_get_pc(machine->activecpu), offset, hng64_dl[offset]) ; return hng64_dl[offset] ; } @@ -1488,26 +1488,26 @@ static MACHINE_RESET(hyperneo) activeBuffer = 0 ; /* set the fastest DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x00ffffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, hng_mainram); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); - - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x04000000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x05ffffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, hng_cart); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); - - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 2); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x00ffffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, hng_mainram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); + + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x04000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x05ffffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, hng_cart); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); + + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); } diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c index dea8e3b09cf..126f2ad6a2a 100644 --- a/src/mame/drivers/homedata.c +++ b/src/mame/drivers/homedata.c @@ -319,7 +319,7 @@ static WRITE8_HANDLER( mrokumei_sound_io_w ) dac_signed_data_w(0,data); break; default: - logerror("%04x: I/O write to port %04x\n",activecpu_get_pc(),offset); + logerror("%04x: I/O write to port %04x\n",cpu_get_pc(machine->activecpu),offset); break; } } @@ -363,7 +363,7 @@ static WRITE8_HANDLER( reikaids_upd7807_portc_w ) 1 \ ROM bank 0 / */ -// logerror("%04x: port C wr %02x (STATUS %d DATA %d)\n",activecpu_get_pc(),data,BIT(data,2),BIT(data,6)); +// logerror("%04x: port C wr %02x (STATUS %d DATA %d)\n",cpu_get_pc(machine->activecpu),data,BIT(data,2),BIT(data,6)); memory_set_bankptr(2,memory_region(machine, "audio") + 0x10000 * (data & 0x03)); @@ -407,7 +407,7 @@ static READ8_HANDLER( reikaids_io_r ) vblank = 0; -//logerror("%04x: io_r %02x\n",activecpu_get_pc(),res); +//logerror("%04x: io_r %02x\n",cpu_get_pc(machine->activecpu),res); return res; } @@ -416,14 +416,14 @@ static int snd_command; static READ8_HANDLER( reikaids_snd_command_r ) { -//logerror("%04x: sndmcd_r (%02x)\n",activecpu_get_pc(),snd_command); +//logerror("%04x: sndmcd_r (%02x)\n",cpu_get_pc(machine->activecpu),snd_command); return snd_command; } static WRITE8_HANDLER( reikaids_snd_command_w ) { snd_command = data; -//logerror("%04x: coprocessor_command_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: coprocessor_command_w %02x\n",cpu_get_pc(machine->activecpu),data); } @@ -440,13 +440,13 @@ static int to_cpu,from_cpu; static WRITE8_HANDLER( pteacher_snd_command_w ) { -//logerror("%04x: snd_command_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: snd_command_w %02x\n",cpu_get_pc(machine->activecpu),data); from_cpu = data; } static READ8_HANDLER( pteacher_snd_r ) { -//logerror("%04x: pteacher_snd_r %02x\n",activecpu_get_pc(),to_cpu); +//logerror("%04x: pteacher_snd_r %02x\n",cpu_get_pc(machine->activecpu),to_cpu); return to_cpu; } @@ -471,7 +471,7 @@ static READ8_HANDLER( pteacher_keyboard_r ) static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" }; int dips = input_port_read(machine, "DSW"); -// logerror("%04x: keyboard_r with port A = %02x\n",activecpu_get_pc(),upd7807_porta); +// logerror("%04x: keyboard_r with port A = %02x\n",cpu_get_pc(machine->activecpu),upd7807_porta); if (upd7807_porta & 0x80) { @@ -494,7 +494,7 @@ static READ8_HANDLER( pteacher_upd7807_porta_r ) if (!BIT(upd7807_portc,6)) upd7807_porta = from_cpu; else -logerror("%04x: read PA with PC *not* clear\n",activecpu_get_pc()); +logerror("%04x: read PA with PC *not* clear\n",cpu_get_pc(machine->activecpu)); return upd7807_porta; } @@ -502,7 +502,7 @@ logerror("%04x: read PA with PC *not* clear\n",activecpu_get_pc()); static WRITE8_HANDLER( pteacher_snd_answer_w ) { to_cpu = data; -//logerror("%04x: to_cpu = %02x\n",activecpu_get_pc(),to_cpu); +//logerror("%04x: to_cpu = %02x\n",cpu_get_pc(machine->activecpu),to_cpu); } static WRITE8_HANDLER( pteacher_upd7807_porta_w ) @@ -523,7 +523,7 @@ static WRITE8_HANDLER( pteacher_upd7807_portc_w ) 0 input (coin) */ -// logerror("%04x: port C wr %02x\n",activecpu_get_pc(),data); +// logerror("%04x: port C wr %02x\n",cpu_get_pc(machine->activecpu),data); memory_set_bankptr(2,memory_region(machine, "audio") + 0x10000 * ((data & 0x0c) >> 2)); diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c index 81f04736129..7b7aa458b20 100644 --- a/src/mame/drivers/hornet.c +++ b/src/mame/drivers/hornet.c @@ -308,6 +308,7 @@ */ #include "driver.h" +#include "deprecat.h" #include "cpu/powerpc/ppc.h" #include "cpu/sharc/sharc.h" #include "machine/eeprom.h" @@ -1006,14 +1007,14 @@ static MACHINE_START( hornet ) memset(jvs_sdata, 0, 1024); /* set conservative DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_END, 0x003fffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_PPC_FASTRAM_BASE, workram); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_READONLY, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x003fffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); state_save_register_global(led_reg0); state_save_register_global(led_reg1); @@ -1191,19 +1192,19 @@ static int jvs_encode_data(UINT8 *in, int length) if (b == 0xe0) { sum += 0xd0 + 0xdf; - ppc4xx_spu_receive_byte(0, 0xd0); - ppc4xx_spu_receive_byte(0, 0xdf); + ppc4xx_spu_receive_byte(Machine->cpu[0], 0xd0); + ppc4xx_spu_receive_byte(Machine->cpu[0], 0xdf); } else if (b == 0xd0) { sum += 0xd0 + 0xcf; - ppc4xx_spu_receive_byte(0, 0xd0); - ppc4xx_spu_receive_byte(0, 0xcf); + ppc4xx_spu_receive_byte(Machine->cpu[0], 0xd0); + ppc4xx_spu_receive_byte(Machine->cpu[0], 0xcf); } else { sum += b; - ppc4xx_spu_receive_byte(0, b); + ppc4xx_spu_receive_byte(Machine->cpu[0], b); } } return sum; @@ -1292,11 +1293,11 @@ static void jamma_jvs_cmd_exec(void) // write jvs return data sum = 0x00 + (rdata_ptr+1); - ppc4xx_spu_receive_byte(0, 0xe0); // sync - ppc4xx_spu_receive_byte(0, 0x00); // node - ppc4xx_spu_receive_byte(0, rdata_ptr+1); // num of bytes + ppc4xx_spu_receive_byte(Machine->cpu[0], 0xe0); // sync + ppc4xx_spu_receive_byte(Machine->cpu[0], 0x00); // node + ppc4xx_spu_receive_byte(Machine->cpu[0], rdata_ptr+1); // num of bytes sum += jvs_encode_data(rdata, rdata_ptr); - ppc4xx_spu_receive_byte(0, sum - 1); // checksum + ppc4xx_spu_receive_byte(Machine->cpu[0], sum - 1); // checksum jvs_sdata_ptr = 0; } @@ -1326,7 +1327,7 @@ static DRIVER_INIT(hornet) led_reg0 = led_reg1 = 0x7f; - ppc4xx_spu_set_tx_handler(0, jamma_jvs_w); + ppc4xx_spu_set_tx_handler(machine->cpu[0], jamma_jvs_w); } static DRIVER_INIT(hornet_2board) @@ -1340,7 +1341,7 @@ static DRIVER_INIT(hornet_2board) led_reg0 = led_reg1 = 0x7f; - ppc4xx_spu_set_tx_handler(0, jamma_jvs_w); + ppc4xx_spu_set_tx_handler(machine->cpu[0], jamma_jvs_w); } /*****************************************************************************/ diff --git a/src/mame/drivers/hotblock.c b/src/mame/drivers/hotblock.c index fccbf1f8d75..14b1ee7119e 100644 --- a/src/mame/drivers/hotblock.c +++ b/src/mame/drivers/hotblock.c @@ -73,8 +73,8 @@ static READ8_HANDLER( hotblock_port4_r ) static WRITE8_HANDLER( hotblock_port4_w ) { -// mame_printf_debug("port4_w: pc = %06x : data %04x\n",activecpu_get_pc(),data); -// popmessage("port4_w: pc = %06x : data %04x",activecpu_get_pc(),data); +// mame_printf_debug("port4_w: pc = %06x : data %04x\n",cpu_get_pc(machine->activecpu),data); +// popmessage("port4_w: pc = %06x : data %04x",cpu_get_pc(machine->activecpu),data); hotblock_port4=data; } @@ -82,7 +82,7 @@ static WRITE8_HANDLER( hotblock_port4_w ) static WRITE8_HANDLER( hotblock_port0_w ) { -// popmessage("port4_w: pc = %06x : data %04x",activecpu_get_pc(),data); +// popmessage("port4_w: pc = %06x : data %04x",cpu_get_pc(machine->activecpu),data); hotblock_port0=data; } diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c index 6b0d91693d2..99c6ac53b2e 100644 --- a/src/mame/drivers/hyprduel.c +++ b/src/mame/drivers/hyprduel.c @@ -131,7 +131,7 @@ static WRITE16_HANDLER( hyprduel_irq_cause_w ) static WRITE16_HANDLER( hypr_subcpu_control_w ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(machine->activecpu); if (data & 0x01) { @@ -318,7 +318,7 @@ INLINE void blt_write(running_machine *machine, const int tmap, const offs_t off case 2: hyprduel_vram_1_w(machine,offs,data,mask); break; case 3: hyprduel_vram_2_w(machine,offs,data,mask); break; } -// logerror("CPU #0 PC %06X : Blitter %X] %04X <- %04X & %04X\n",activecpu_get_pc(),tmap,offs,data,mask); +// logerror("CPU #0 PC %06X : Blitter %X] %04X <- %04X & %04X\n",cpu_get_pc(machine->activecpu),tmap,offs,data,mask); } @@ -343,7 +343,7 @@ static WRITE16_HANDLER( hyprduel_blitter_w ) int shift = (dst_offs & 0x80) ? 0 : 8; UINT16 mask = (dst_offs & 0x80) ? 0xff00 : 0x00ff; -// logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n",activecpu_get_pc(),tmap,src_offs,dst_offs); +// logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n",cpu_get_pc(machine->activecpu),tmap,src_offs,dst_offs); dst_offs >>= 7+1; switch( tmap ) @@ -353,7 +353,7 @@ static WRITE16_HANDLER( hyprduel_blitter_w ) case 3: break; default: - logerror("CPU #0 PC %06X : Blitter unknown destination: %08X\n",activecpu_get_pc(),tmap); + logerror("CPU #0 PC %06X : Blitter unknown destination: %08X\n",cpu_get_pc(machine->activecpu),tmap); return; } @@ -363,7 +363,7 @@ static WRITE16_HANDLER( hyprduel_blitter_w ) src_offs %= src_len; b1 = blt_read(src,src_offs); -// logerror("CPU #0 PC %06X : Blitter opcode %02X at %06X\n",activecpu_get_pc(),b1,src_offs); +// logerror("CPU #0 PC %06X : Blitter opcode %02X at %06X\n",cpu_get_pc(machine->activecpu),b1,src_offs); src_offs++; count = ((~b1) & 0x3f) + 1; @@ -447,7 +447,7 @@ static WRITE16_HANDLER( hyprduel_blitter_w ) default: - logerror("CPU #0 PC %06X : Blitter unknown opcode %02X at %06X\n",activecpu_get_pc(),b1,src_offs-1); + logerror("CPU #0 PC %06X : Blitter unknown opcode %02X at %06X\n",cpu_get_pc(machine->activecpu),b1,src_offs-1); return; } diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c index 03c6a0d4d5b..de13b779108 100644 --- a/src/mame/drivers/igs009.c +++ b/src/mame/drivers/igs009.c @@ -169,7 +169,7 @@ static WRITE8_HANDLER( jingbell_nmi_and_coins_w ) { if ((nmi_enable ^ data) & (~0xdd)) { - logerror("PC %06X: nmi_and_coins = %02x\n",activecpu_get_pc(),data); + logerror("PC %06X: nmi_and_coins = %02x\n",cpu_get_pc(machine->activecpu),data); // popmessage("%02x",data); } @@ -226,7 +226,7 @@ static WRITE8_HANDLER( jingbell_magic_w ) default: // popmessage("magic %x <- %04x",igs_magic[0],data); - logerror("%06x: warning, writing to igs_magic %02x = %02x\n", activecpu_get_pc(), igs_magic[0], data); + logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0], data); } } @@ -240,11 +240,11 @@ static READ8_HANDLER( jingbell_magic_r ) if ( !(igs_magic[1] & 0x04) ) return input_port_read(machine, "DSW3"); if ( !(igs_magic[1] & 0x08) ) return input_port_read(machine, "DSW4"); if ( !(igs_magic[1] & 0x10) ) return input_port_read(machine, "DSW5"); - logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", activecpu_get_pc(), igs_magic[1]); + logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[1]); break; default: - logerror("%06x: warning, reading with igs_magic = %02x\n", activecpu_get_pc(), igs_magic[0]); + logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0]); } return 0; diff --git a/src/mame/drivers/igs_180.c b/src/mame/drivers/igs_180.c index b1ed5e588b4..539fa862d4d 100644 --- a/src/mame/drivers/igs_180.c +++ b/src/mame/drivers/igs_180.c @@ -421,7 +421,7 @@ static WRITE8_HANDLER( nmi_enable_w ) { nmi_enable = data & 1; if (data & (~1)) - logerror("PC %06X: nmi_enable = %02x\n",activecpu_get_pc(),data); + logerror("PC %06X: nmi_enable = %02x\n",cpu_get_pc(machine->activecpu),data); } static int irq_enable; @@ -429,7 +429,7 @@ static WRITE8_HANDLER( irq_enable_w ) { irq_enable = data & 1; if (data & (~1)) - logerror("PC %06X: irq_enable = %02x\n",activecpu_get_pc(),data); + logerror("PC %06X: irq_enable = %02x\n",cpu_get_pc(machine->activecpu),data); } static UINT8 input_select; @@ -471,7 +471,7 @@ static READ8_HANDLER( input_r ) case 0x34: return 0x32; default: - logerror("PC %06X: input %02x read\n",activecpu_get_pc(),input_select); + logerror("PC %06X: input %02x read\n",cpu_get_pc(machine->activecpu),input_select); return 0xff; } } diff --git a/src/mame/drivers/igs_blit.c b/src/mame/drivers/igs_blit.c index d36fa4af686..6aa7ae42fb0 100644 --- a/src/mame/drivers/igs_blit.c +++ b/src/mame/drivers/igs_blit.c @@ -73,10 +73,10 @@ static WRITE16_HANDLER( igs_priority_w ) { COMBINE_DATA(&igs_priority); -// logerror("%06x: igs_priority = %02x\n", activecpu_get_pc(), igs_priority); +// logerror("%06x: igs_priority = %02x\n", cpu_get_pc(machine->activecpu), igs_priority); if (data & ~0x7) - logerror("%06x: warning, unknown bits written to igs_priority = %02x\n", activecpu_get_pc(), igs_priority); + logerror("%06x: warning, unknown bits written to igs_priority = %02x\n", cpu_get_pc(machine->activecpu), igs_priority); } @@ -244,7 +244,7 @@ static WRITE16_HANDLER( igs_blit_flags_w ) COMBINE_DATA(&blitter.flags); - logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, gfx %03x%04x, depth %02x, pen %02x, flags %03x\n", activecpu_get_pc(), + logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, gfx %03x%04x, depth %02x, pen %02x, flags %03x\n", cpu_get_pc(machine->activecpu), blitter.x,blitter.y,blitter.w,blitter.h,blitter.gfx_hi,blitter.gfx_lo,blitter.depth,blitter.pen,blitter.flags); dest = layer[ blitter.flags & 0x0007 ]; @@ -678,7 +678,7 @@ static WRITE16_HANDLER( chmplst2_magic_w ) } if ( igs_input_sel & ~0x7f ) - logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", activecpu_get_pc(), igs_input_sel); + logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", cpu_get_pc(machine->activecpu), igs_input_sel); // popmessage("sel2 %02x",igs_input_sel&~0x1f); break; @@ -692,13 +692,13 @@ static WRITE16_HANDLER( chmplst2_magic_w ) } if ( chmplst2_pen_hi & ~0xf ) - logerror("%06x: warning, unknown bits written in chmplst2_pen_hi = %02x\n", activecpu_get_pc(), chmplst2_pen_hi); + logerror("%06x: warning, unknown bits written in chmplst2_pen_hi = %02x\n", cpu_get_pc(machine->activecpu), chmplst2_pen_hi); // popmessage("oki %02x",chmplst2_pen_hi & 0x08); break; default: - logerror("%06x: warning, writing to igs_magic %02x = %02x\n", activecpu_get_pc(), igs_magic[0], data); + logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0], data); } } @@ -714,7 +714,7 @@ static READ16_HANDLER( chmplst2_magic_r ) if (~igs_input_sel & 0x10) return input_port_read(machine, "KEY4"); /* fall through */ default: - logerror("%06x: warning, reading with igs_magic = %02x\n", activecpu_get_pc(), igs_magic[0]); + logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0]); break; case 0x03: return 0xff; // ? @@ -766,13 +766,13 @@ static WRITE16_HANDLER( chindrag_magic_w ) coin_counter_w(0,data & 2); if (data & ~0x2) - logerror("%06x: warning, unknown bits written in coin counter = %02x\n", activecpu_get_pc(), data); + logerror("%06x: warning, unknown bits written in coin counter = %02x\n", cpu_get_pc(machine->activecpu), data); break; default: // popmessage("magic %x <- %04x",igs_magic[0],data); - logerror("%06x: warning, writing to igs_magic %02x = %02x\n", activecpu_get_pc(), igs_magic[0], data); + logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0], data); } } @@ -807,7 +807,7 @@ static READ16_HANDLER( chindrag_magic_r ) case 0x34: return 0x32; default: - logerror("%06x: warning, reading with igs_magic = %02x\n", activecpu_get_pc(), igs_magic[0]); + logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0]); } return 0; @@ -833,13 +833,13 @@ static WRITE16_HANDLER( grtwall_magic_w ) } if (data & ~0x11) - logerror("%06x: warning, unknown bits written in coin counter = %02x\n", activecpu_get_pc(), data); + logerror("%06x: warning, unknown bits written in coin counter = %02x\n", cpu_get_pc(machine->activecpu), data); // popmessage("coin %02x",data); break; default: - logerror("%06x: warning, writing to igs_magic %02x = %02x\n", activecpu_get_pc(), igs_magic[0], data); + logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0], data); } } @@ -872,7 +872,7 @@ static READ16_HANDLER( grtwall_magic_r ) case 0x34: return 0x32; default: - logerror("%06x: warning, reading with igs_magic = %02x\n", activecpu_get_pc(), igs_magic[0]); + logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0]); } return 0; @@ -888,7 +888,7 @@ static WRITE16_HANDLER( lhb_okibank_w ) } if ( data & (~0x200) ) - logerror("%06x: warning, unknown bits written in oki bank = %02x\n", activecpu_get_pc(), data); + logerror("%06x: warning, unknown bits written in oki bank = %02x\n", cpu_get_pc(machine->activecpu), data); // popmessage("oki %04x",data); } @@ -905,7 +905,7 @@ static WRITE16_HANDLER( lhb_inputs_w ) } if ( igs_input_sel & (~0x7f) ) - logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", activecpu_get_pc(), igs_input_sel); + logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", cpu_get_pc(machine->activecpu), igs_input_sel); // popmessage("sel2 %02x",igs_input_sel&~0x1f); } @@ -923,7 +923,7 @@ static READ16_HANDLER( lhb_inputs_r ) if (~igs_input_sel & 0x08) return input_port_read(machine, "KEY3"); if (~igs_input_sel & 0x10) return input_port_read(machine, "KEY4"); - logerror("%06x: warning, reading with igs_input_sel = %02x\n", activecpu_get_pc(), igs_input_sel); + logerror("%06x: warning, reading with igs_input_sel = %02x\n", cpu_get_pc(machine->activecpu), igs_input_sel); break; } return 0; @@ -948,13 +948,13 @@ static WRITE16_HANDLER( vbowl_magic_w ) } if (data & ~0x3) - logerror("%06x: warning, unknown bits written in coin counter = %02x\n", activecpu_get_pc(), data); + logerror("%06x: warning, unknown bits written in coin counter = %02x\n", cpu_get_pc(machine->activecpu), data); break; default: // popmessage("magic %x <- %04x",igs_magic[0],data); - logerror("%06x: warning, writing to igs_magic %02x = %02x\n", activecpu_get_pc(), igs_magic[0], data); + logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0], data); } } @@ -988,7 +988,7 @@ static READ16_HANDLER( vbowl_magic_r ) case 0x34: return 0x32; default: - logerror("%06x: warning, reading with igs_magic = %02x\n", activecpu_get_pc(), igs_magic[0]); + logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0]); } return 0; @@ -1015,13 +1015,13 @@ static WRITE16_HANDLER( xymg_magic_w ) } if ( igs_input_sel & ~0x3f ) - logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", activecpu_get_pc(), igs_input_sel); + logerror("%06x: warning, unknown bits written in igs_input_sel = %02x\n", cpu_get_pc(machine->activecpu), igs_input_sel); // popmessage("sel2 %02x",igs_input_sel&~0x1f); break; default: - logerror("%06x: warning, writing to igs_magic %02x = %02x\n", activecpu_get_pc(), igs_magic[0], data); + logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0], data); } } @@ -1062,7 +1062,7 @@ static READ16_HANDLER( xymg_magic_r ) case 0x34: return 0x32; default: - logerror("%06x: warning, reading with igs_magic = %02x\n", activecpu_get_pc(), igs_magic[0]); + logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(machine->activecpu), igs_magic[0]); break; } @@ -1248,7 +1248,7 @@ static WRITE16_HANDLER( vbowl_pen_hi_w ) } if (data & ~0x7) - logerror("%06x: warning, unknown bits written to pen_hi = %04x\n", activecpu_get_pc(), igs_priority); + logerror("%06x: warning, unknown bits written to pen_hi = %04x\n", cpu_get_pc(machine->activecpu), igs_priority); } static WRITE16_HANDLER( vbowl_link_0_w ) { } diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c index e07c49cb712..d8fdd7b8608 100644 --- a/src/mame/drivers/igs_m027.c +++ b/src/mame/drivers/igs_m027.c @@ -40,7 +40,7 @@ static WRITE32_HANDLER( igs_cg_videoram_w ) { COMBINE_DATA(&igs_cg_videoram[offset]); //if(data!=0) - logerror("PC(%08X) CG @%x = %x!\n",activecpu_get_pc(),offset ,igs_cg_videoram[offset]); + logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(machine->activecpu),offset ,igs_cg_videoram[offset]); diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c index 2ccc0dc83f2..ba007d44529 100644 --- a/src/mame/drivers/itech32.c +++ b/src/mame/drivers/itech32.c @@ -817,14 +817,14 @@ static WRITE32_HANDLER( tms2_trigger_w ) static READ32_HANDLER( drivedge_tms1_speedup_r ) { - if (tms1_ram[0x382] == 0 && activecpu_get_pc() == 0xee) START_TMS_SPINNING(0); + if (tms1_ram[0x382] == 0 && cpu_get_pc(machine->activecpu) == 0xee) START_TMS_SPINNING(0); return tms1_ram[0x382]; } static READ32_HANDLER( drivedge_tms2_speedup_r ) { - if (tms2_ram[0x382] == 0 && activecpu_get_pc() == 0x809808) START_TMS_SPINNING(1); + if (tms2_ram[0x382] == 0 && cpu_get_pc(machine->activecpu) == 0x809808) START_TMS_SPINNING(1); return tms2_ram[0x382]; } @@ -946,10 +946,10 @@ static UINT8 written[0x8000]; static READ32_HANDLER( test1_r ) { - if (ACCESSING_BITS_24_31 && !written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+0); - if (ACCESSING_BITS_16_23 && !written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+1); - if (ACCESSING_BITS_8_15 && !written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+2); - if (ACCESSING_BITS_0_7 && !written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0x100 + offset*4+3); + if (ACCESSING_BITS_24_31 && !written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(machine->activecpu), 0x100 + offset*4+0); + if (ACCESSING_BITS_16_23 && !written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(machine->activecpu), 0x100 + offset*4+1); + if (ACCESSING_BITS_8_15 && !written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(machine->activecpu), 0x100 + offset*4+2); + if (ACCESSING_BITS_0_7 && !written[0x100 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(machine->activecpu), 0x100 + offset*4+3); return ((UINT32 *)main_ram)[0x100/4 + offset]; } @@ -964,10 +964,10 @@ static WRITE32_HANDLER( test1_w ) static READ32_HANDLER( test2_r ) { - if (ACCESSING_BITS_24_31 && !written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+0); - if (ACCESSING_BITS_16_23 && !written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+1); - if (ACCESSING_BITS_8_15 && !written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+2); - if (ACCESSING_BITS_0_7 && !written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", activecpu_get_pc(), 0xc00 + offset*4+3); + if (ACCESSING_BITS_24_31 && !written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(machine->activecpu), 0xc00 + offset*4+0); + if (ACCESSING_BITS_16_23 && !written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(machine->activecpu), 0xc00 + offset*4+1); + if (ACCESSING_BITS_8_15 && !written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(machine->activecpu), 0xc00 + offset*4+2); + if (ACCESSING_BITS_0_7 && !written[0xc00 + offset*4+3]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(machine->activecpu), 0xc00 + offset*4+3); return ((UINT32 *)main_ram)[0xc00/4 + offset]; } diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c index bcfd6d4b8d7..1a245815e8a 100644 --- a/src/mame/drivers/jalmah.c +++ b/src/mame/drivers/jalmah.c @@ -874,7 +874,7 @@ static WRITE16_HANDLER( jalmah_okirom_w ) oki_za = (data & 2) ? 1 : 0; memcpy(&oki[0x20000], &oki[(oki_rom * 0x80000) + ((oki_bank+oki_za) * 0x20000) + 0x40000], 0x20000); } - //popmessage("PC=%06x %02x %02x %02x",activecpu_get_pc(),oki_rom,oki_za,oki_bank); + //popmessage("PC=%06x %02x %02x %02x",cpu_get_pc(machine->activecpu),oki_rom,oki_za,oki_bank); } static WRITE16_HANDLER( jalmah_okibank_w ) @@ -885,7 +885,7 @@ static WRITE16_HANDLER( jalmah_okibank_w ) oki_bank = data & 3; memcpy(&oki[0x20000], &oki[(oki_rom * 0x80000) + ((oki_bank+oki_za) * 0x20000) + 0x40000], 0x20000); } - //popmessage("PC=%06x %02x %02x %02x",activecpu_get_pc(),oki_rom,oki_za,oki_bank); + //popmessage("PC=%06x %02x %02x %02x",cpu_get_pc(machine->activecpu),oki_rom,oki_za,oki_bank); } static WRITE16_HANDLER( jalmah_flip_screen_w ) @@ -1575,7 +1575,7 @@ static READ16_HANDLER( urashima_mcu_r ) res = resp[respcount++]; if (respcount >= sizeof(resp)/sizeof(resp[0])) respcount = 0; -// logerror("%04x: mcu_r %02x\n",activecpu_get_pc(),res); +// logerror("%04x: mcu_r %02x\n",cpu_get_pc(machine->activecpu),res); return res; } @@ -1791,7 +1791,7 @@ static READ16_HANDLER( daireika_mcu_r ) res = resp[respcount++]; if (respcount >= sizeof(resp)/sizeof(resp[0])) respcount = 0; -// logerror("%04x: mcu_r %02x\n",activecpu_get_pc(),res); +// logerror("%04x: mcu_r %02x\n",cpu_get_pc(machine->activecpu),res); return res; } @@ -2067,7 +2067,7 @@ static READ16_HANDLER( mjzoomin_mcu_r ) res = resp[respcount++]; if (respcount >= sizeof(resp)/sizeof(resp[0])) respcount = 0; -// logerror("%04x: mcu_r %02x\n",activecpu_get_pc(),res); +// logerror("%04x: mcu_r %02x\n",cpu_get_pc(machine->activecpu),res); return res; } @@ -2202,7 +2202,7 @@ static READ16_HANDLER( kakumei_mcu_r ) res = resp[respcount++]; if (respcount >= sizeof(resp)/sizeof(resp[0])) respcount = 0; -// popmessage("%04x: mcu_r %02x",activecpu_get_pc(),res); +// popmessage("%04x: mcu_r %02x",cpu_get_pc(machine->activecpu),res); return res; } @@ -2223,7 +2223,7 @@ static READ16_HANDLER( suchipi_mcu_r ) res = resp[respcount++]; if (respcount >= sizeof(resp)/sizeof(resp[0])) respcount = 0; -// popmessage("%04x: mcu_r %02x",activecpu_get_pc(),res); +// popmessage("%04x: mcu_r %02x",cpu_get_pc(machine->activecpu),res); return res; } diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c index a33d2012bb7..207ea0f12c2 100644 --- a/src/mame/drivers/jchan.c +++ b/src/mame/drivers/jchan.c @@ -225,7 +225,7 @@ static void jchan_mcu_run(running_machine *machine) UINT16 mcu_offset = mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */ UINT16 mcu_subcmd = mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */ - logerror("CPU #0 (PC=%06X) : MCU executed command: %04X %04X %04X ",activecpu_get_pc(),mcu_command,mcu_offset*2,mcu_subcmd); + logerror("CPU #0 (PC=%06X) : MCU executed command: %04X %04X %04X ",cpu_get_pc(machine->activecpu),mcu_command,mcu_offset*2,mcu_subcmd); /* the only MCU commands found in program code are: @@ -302,7 +302,7 @@ static void jchan_mcu_run(running_machine *machine) case 0x03: // DSW { mcu_ram[mcu_offset] = input_port_read(machine, "DSW"); - logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n",activecpu_get_pc(),mcu_command,mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n",cpu_get_pc(machine->activecpu),mcu_command,mcu_offset*2); } break; @@ -386,7 +386,7 @@ JCHAN_MCU_COM_W(3) static READ16_HANDLER( jchan_mcu_status_r ) { - logerror("cpu #%d (PC=%06X): read mcu status\n", cpu_getactivecpu(), activecpu_get_previouspc()); + logerror("cpu #%d (PC=%06X): read mcu status\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu)); return 0; } @@ -474,7 +474,7 @@ static UINT16 *mainsub_shared_ram; static WRITE16_HANDLER( main2sub_cmd_w ) { COMBINE_DATA(&main2sub_cmd); - logerror("cpu #%d (PC=%06X): write cmd %04x to subcpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), main2sub_cmd); + logerror("cpu #%d (PC=%06X): write cmd %04x to subcpu\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu), main2sub_cmd); cpunum_set_input_line(machine, 1, 4, HOLD_LINE); } static READ16_HANDLER ( main2sub_status_r ) @@ -484,35 +484,35 @@ static READ16_HANDLER ( main2sub_status_r ) static WRITE16_HANDLER( main2sub_status_w ) { COMBINE_DATA(&main2sub_status); - logerror("cpu #%d (PC=%06X): write status (%04x)\n", cpu_getactivecpu(), activecpu_get_previouspc(), main2sub_status); + logerror("cpu #%d (PC=%06X): write status (%04x)\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu), main2sub_status); } static READ16_HANDLER ( main2sub_result_r ) { - logerror("cpu #%d (PC=%06X): read subcpu result (%04x)\n", cpu_getactivecpu(), activecpu_get_previouspc(), main2sub_result); + logerror("cpu #%d (PC=%06X): read subcpu result (%04x)\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu), main2sub_result); return main2sub_result; } static WRITE16_HANDLER( main2sub_unknown ) { #define mainsub_unknown (0x400100+offset/2) COMBINE_DATA(&mainsub_shared_ram[offset]); - logerror("cpu #%d (PC=%06X): write unknown (%06X):%04x to subcpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), mainsub_unknown, main2sub_param(offset)); + logerror("cpu #%d (PC=%06X): write unknown (%06X):%04x to subcpu\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu), mainsub_unknown, main2sub_param(offset)); } static WRITE16_HANDLER( main2sub_param_w ) { COMBINE_DATA(&main2sub_param(offset)); - logerror("cpu #%d (PC=%06X): write param(%d):%04x to subcpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), offset, main2sub_param(offset)); + logerror("cpu #%d (PC=%06X): write param(%d):%04x to subcpu\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu), offset, main2sub_param(offset)); } static WRITE16_HANDLER( sub2main_cmd_w ) { COMBINE_DATA(&sub2main_cmd); - logerror("cpu #%d (PC=%06X): write cmd %04x to maincpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), sub2main_cmd); + logerror("cpu #%d (PC=%06X): write cmd %04x to maincpu\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu), sub2main_cmd); cpunum_set_input_line(machine, 0, 3, HOLD_LINE); } static READ16_HANDLER ( sub2main_cmd_r ) { - logerror("cpu #%d (PC=%06X): read cmd %04x from subcpu\n", cpu_getactivecpu(), activecpu_get_previouspc(), sub2main_cmd); + logerror("cpu #%d (PC=%06X): read cmd %04x from subcpu\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu), sub2main_cmd); return sub2main_cmd; } diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c index 611363720f0..76d6fd8d603 100644 --- a/src/mame/drivers/kaneko16.c +++ b/src/mame/drivers/kaneko16.c @@ -399,7 +399,7 @@ static WRITE16_HANDLER( bakubrkr_oki_bank_sw ) { if (ACCESSING_BITS_0_7) { okim6295_set_bank_base(0, 0x40000 * (data & 0x7) ); - logerror("PC:%06X Selecting OKI bank %02X\n",activecpu_get_pc(),data&0xff); + logerror("PC:%06X Selecting OKI bank %02X\n",cpu_get_pc(machine->activecpu),data&0xff); } } @@ -470,7 +470,7 @@ static WRITE16_HANDLER( bloodwar_oki_0_bank_w ) if (ACCESSING_BITS_0_7) { okim6295_set_bank_base(0, 0x40000 * (data & 0xf) ); -// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",activecpu_get_pc(),data); +// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -479,7 +479,7 @@ static WRITE16_HANDLER( bloodwar_oki_1_bank_w ) if (ACCESSING_BITS_0_7) { okim6295_set_bank_base(1, 0x40000 * data ); -// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",activecpu_get_pc(),data); +// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -540,7 +540,7 @@ static WRITE16_HANDLER( bonkadv_oki_0_bank_w ) if (ACCESSING_BITS_0_7) { okim6295_set_bank_base(0, 0x40000 * (data & 0xF)); - logerror("CPU #0 PC %06X : OKI0 bank %08X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06X : OKI0 bank %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -549,7 +549,7 @@ static WRITE16_HANDLER( bonkadv_oki_1_bank_w ) if (ACCESSING_BITS_0_7) { okim6295_set_bank_base(1, 0x40000 * data ); - logerror("CPU #0 PC %06X : OKI1 bank %08X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06X : OKI1 bank %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -619,7 +619,7 @@ static WRITE16_HANDLER( gtmr_oki_0_bank_w ) if (ACCESSING_BITS_0_7) { okim6295_set_bank_base(0, 0x40000 * (data & 0xF) ); -// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",activecpu_get_pc(),data); +// logerror("CPU #0 PC %06X : OKI0 bank %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -628,7 +628,7 @@ static WRITE16_HANDLER( gtmr_oki_1_bank_w ) if (ACCESSING_BITS_0_7) { okim6295_set_bank_base(1, 0x40000 * (data & 0x1) ); -// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",activecpu_get_pc(),data); +// logerror("CPU #0 PC %06X : OKI1 bank %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -637,7 +637,7 @@ static WRITE16_HANDLER( gtmr_oki_0_data_w ) if (ACCESSING_BITS_0_7) { okim6295_data_0_w(machine,0,data); -// logerror("CPU #0 PC %06X : OKI0 <- %08X\n",activecpu_get_pc(),data); +// logerror("CPU #0 PC %06X : OKI0 <- %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -646,7 +646,7 @@ static WRITE16_HANDLER( gtmr_oki_1_data_w ) if (ACCESSING_BITS_0_7) { okim6295_data_1_w(machine,0,data); -// logerror("CPU #0 PC %06X : OKI1 <- %08X\n",activecpu_get_pc(),data); +// logerror("CPU #0 PC %06X : OKI1 <- %08X\n",cpu_get_pc(machine->activecpu),data); } } @@ -725,7 +725,7 @@ static READ16_HANDLER( gtmr2_wheel_r ) return (input_port_read(machine, "WHEEL2") << 8); break; default: - logerror("gtmr2_wheel_r : read at %06x with joystick\n", activecpu_get_pc()); + logerror("gtmr2_wheel_r : read at %06x with joystick\n", cpu_get_pc(machine->activecpu)); return (~0); break; } diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c index 01c778294d5..8b9f0c18298 100644 --- a/src/mame/drivers/karnov.c +++ b/src/mame/drivers/karnov.c @@ -84,7 +84,7 @@ static void karnov_i8751_w(running_machine *machine, int data) if (data==0x401) i8751_return=0x4138; /* ^Whistling wind */ if (data==0x408) i8751_return=0x4276; /* ^Heavy Gates */ -// if (!i8751_return && data!=0x300) logerror("CPU %04x - Unknown Write %02x intel\n",activecpu_get_pc(),data); +// if (!i8751_return && data!=0x300) logerror("CPU %04x - Unknown Write %02x intel\n",cpu_get_pc(machine->activecpu),data); cpunum_set_input_line(machine, 0,6,HOLD_LINE); /* Signal main cpu task is complete */ i8751_needs_ack=1; @@ -114,7 +114,7 @@ static void wndrplnt_i8751_w(running_machine *machine, int data) case 0x18: i8751_return=0x5341; break; } } -// else logerror("CPU %04x - Unknown Write %02x intel\n",activecpu_get_pc(),data); +// else logerror("CPU %04x - Unknown Write %02x intel\n",cpu_get_pc(machine->activecpu),data); /* These are 68k function call addresses - different address for each power-up */ if (data==0x400) i8751_return=0x594; @@ -248,7 +248,7 @@ static void chelnov_i8751_w(running_machine *machine, int data) } } -// logerror("CPU %04x - Unknown Write %02x intel\n",activecpu_get_pc(),data); +// logerror("CPU %04x - Unknown Write %02x intel\n",cpu_get_pc(machine->activecpu),data); cpunum_set_input_line(machine, 0,6,HOLD_LINE); /* Signal main cpu task is complete */ i8751_needs_ack=1; diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c index f0b96e24f26..f63733d8bed 100644 --- a/src/mame/drivers/kickgoal.c +++ b/src/mame/drivers/kickgoal.c @@ -165,7 +165,7 @@ WRITE16_HANDLER( kickgoal_snd_w ) { if (ACCESSING_BITS_0_7) { - logerror("PC:%06x Writing %04x to Sound CPU\n",activecpu_get_previouspc(),data); + logerror("PC:%06x Writing %04x to Sound CPU\n",cpu_get_previouspc(machine->activecpu),data); if (data >= 0x40) { if (data == 0xfe) { okim6295_data_0_w(0,0x40); /* Stop playing the melody */ @@ -216,7 +216,7 @@ WRITE16_HANDLER( kickgoal_snd_w ) static WRITE16_HANDLER( actionhw_snd_w ) { - logerror("PC:%06x Writing %04x to Sound CPU - mask %04x\n",activecpu_get_previouspc(),data,mem_mask); + logerror("PC:%06x Writing %04x to Sound CPU - mask %04x\n",cpu_get_previouspc(machine->activecpu),data,mem_mask); if (!ACCESSING_BITS_0_7) data >>= 8; diff --git a/src/mame/drivers/kingobox.c b/src/mame/drivers/kingobox.c index f1c604fab6f..6685339742f 100644 --- a/src/mame/drivers/kingobox.c +++ b/src/mame/drivers/kingobox.c @@ -536,7 +536,7 @@ static const ay8910_interface ay8910_config = static INTERRUPT_GEN( kingofb_interrupt ) { if ( kingofb_nmi_enable ) - cpunum_set_input_line(machine, cpu_getactivecpu(), INPUT_LINE_NMI, PULSE_LINE); + cpunum_set_input_line(machine, cpunum_get_active(), INPUT_LINE_NMI, PULSE_LINE); } static MACHINE_DRIVER_START( kingofb ) diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c index 4c56acd6a47..3266c175147 100644 --- a/src/mame/drivers/kinst.c +++ b/src/mame/drivers/kinst.c @@ -190,26 +190,26 @@ static MACHINE_START( kinst ) } /* set the fastest DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x08000000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x087fffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase2); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); - - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x0007ffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); - - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 2); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x08000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x087fffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); + + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x0007ffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); + + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); } @@ -349,7 +349,7 @@ static READ32_HANDLER( kinst_control_r ) case 4: /* $a0 */ result = input_port_read(machine, portnames[offset]); - if (activecpu_get_pc() == 0x802d428) + if (cpu_get_pc(machine->activecpu) == 0x802d428) cpu_spinuntil_int(); break; } @@ -891,7 +891,7 @@ static DRIVER_INIT( kinst ) { static const UINT8 kinst_control_map[8] = { 0,1,2,3,4,5,6,7 }; - dcs_init(); + dcs_init(machine); /* set up the control register mapping */ control_map = kinst_control_map; @@ -909,7 +909,7 @@ static DRIVER_INIT( kinst2 ) // write: $98 on ki2 = $80 on ki // write: $a0 on ki2 = $98 on ki - dcs_init(); + dcs_init(machine); /* set up the control register mapping */ control_map = kinst2_control_map; diff --git a/src/mame/drivers/koftball.c b/src/mame/drivers/koftball.c index c387d9b3c40..ea5f1491d57 100644 --- a/src/mame/drivers/koftball.c +++ b/src/mame/drivers/koftball.c @@ -107,7 +107,7 @@ static READ16_HANDLER(prot_r) case 0x8000: return 0x0f0f; } - logerror("unk prot r %x %x\n",prot_data, activecpu_get_previouspc()); + logerror("unk prot r %x %x\n",prot_data, cpu_get_previouspc(machine->activecpu)); return mame_rand(machine); } diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c index 06c08994aa8..47f89ea42b3 100644 --- a/src/mame/drivers/konamigv.c +++ b/src/mame/drivers/konamigv.c @@ -595,7 +595,7 @@ static WRITE32_HANDLER( btcflash_w ) static READ32_HANDLER( btc_trackball_r ) { -// mame_printf_debug( "r %08x %08x %08x\n", activecpu_get_pc(), offset, mem_mask ); +// mame_printf_debug( "r %08x %08x %08x\n", cpu_get_pc(machine->activecpu), offset, mem_mask ); if( offset == 1 && mem_mask == 0xffff0000 ) { @@ -617,7 +617,7 @@ static READ32_HANDLER( btc_trackball_r ) static WRITE32_HANDLER( btc_trackball_w ) { -// mame_printf_debug( "w %08x %08x %08x %08x\n", activecpu_get_pc(), offset, data, mem_mask ); +// mame_printf_debug( "w %08x %08x %08x %08x\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask ); } static NVRAM_HANDLER( btchamp ) diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c index dceb82863c6..0988b44eabe 100644 --- a/src/mame/drivers/konamigx.c +++ b/src/mame/drivers/konamigx.c @@ -524,7 +524,7 @@ static WRITE32_HANDLER( eeprom_w ) */ konamigx_wrport1_1 = (data>>16)&0xff; -// logerror("write %x to IRQ register (PC=%x)\n", konamigx_wrport1_1, activecpu_get_pc()); +// logerror("write %x to IRQ register (PC=%x)\n", konamigx_wrport1_1, cpu_get_pc(machine->activecpu)); // gx_syncen is to ensure each IRQ is trigger at least once after being enabled if (konamigx_wrport1_1 & 0x80) gx_syncen |= konamigx_wrport1_1 & 0x1f; @@ -588,7 +588,7 @@ static READ32_HANDLER(waitskip_r) { UINT32 data = gx_workram[waitskip.offs+offset]; - if (activecpu_get_pc() == waitskip.pc && (data & mem_mask) == (waitskip.data & mem_mask)) + if (cpu_get_pc(machine->activecpu) == waitskip.pc && (data & mem_mask) == (waitskip.data & mem_mask)) { cpu_spinuntil_trigger(resume_trigger); suspension_active = 1; @@ -769,7 +769,7 @@ static READ32_HANDLER( sound020_r ) rv |= LSW<<8; } -// mame_printf_debug("Read 68k @ %x (PC=%x)\n", reg, activecpu_get_pc()); +// mame_printf_debug("Read 68k @ %x (PC=%x)\n", reg, cpu_get_pc(machine->activecpu)); // we clearly have some problem because some games require these hacks // perhaps 68000/68020 timing is skewed? @@ -779,31 +779,31 @@ static READ32_HANDLER( sound020_r ) if (reg == 0) rv |= 0xff00; break; case 2: // Winning Spike - if (activecpu_get_pc() == 0x2026fe) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x2026fe) rv = 0xc0c0c0c0; break; case 3: // Run'n Gun 2 - if (activecpu_get_pc() == 0x24f122) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x24f122) rv = 0xc0c0c0c0; break; case 4: // Rushing Heroes - if (activecpu_get_pc() == 0x20eda6) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x20eda6) rv = 0xc0c0c0c0; break; case 5: // Vs. Net Soccer ver. UAB - if (activecpu_get_pc() == 0x24c63e) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x24c63e) rv = 0xc0c0c0c0; break; case 6: // Slam Dunk 2 - if (activecpu_get_pc() == 0x24f21c) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x24f21c) rv = 0xc0c0c0c0; break; case 7: // Vs. Net Soccer ver. AAA - if (activecpu_get_pc() == 0x24c722) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x24c722) rv = 0xc0c0c0c0; break; case 8: // Vs. Net Soccer ver. EAD - if (activecpu_get_pc() == 0x24c482) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x24c482) rv = 0xc0c0c0c0; break; case 9: // Vs. Net Soccer ver. EAB - if (activecpu_get_pc() == 0x24c46c) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x24c46c) rv = 0xc0c0c0c0; break; case 10: // Vs. Net Soccer ver. JAB - if (activecpu_get_pc() == 0x24c5f0) rv = 0xc0c0c0c0; + if (cpu_get_pc(machine->activecpu) == 0x24c5f0) rv = 0xc0c0c0c0; break; } @@ -1081,7 +1081,7 @@ static WRITE32_HANDLER( type4_prot_w ) } else { - logerror("GXT4: unknown protection command %x (PC=%x)\n", last_prot_op, activecpu_get_pc()); + logerror("GXT4: unknown protection command %x (PC=%x)\n", last_prot_op, cpu_get_pc(machine->activecpu)); } if (konamigx_wrport1_1 & 0x10) diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c index 7a598f512fa..c4989009585 100644 --- a/src/mame/drivers/konamim2.c +++ b/src/mame/drivers/konamim2.c @@ -294,7 +294,7 @@ static UINT32 unk20004 = 0; static READ64_HANDLER(unk4_r) { UINT64 r = 0; -// logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), activecpu_get_pc()); +// logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), cpu_get_pc(machine->activecpu)); if (ACCESSING_BITS_32_63) { @@ -311,13 +311,13 @@ static READ64_HANDLER(unk4_r) static WRITE64_HANDLER(unk4_w) { // logerror("unk4_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), -// offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), activecpu_get_pc()); +// offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), cpu_get_pc(machine->activecpu)); if (ACCESSING_BITS_0_31) { if (data & 0x800000) { - mame_printf_debug("CPU%d: CPU1 IRQ at %08X\n", cpu_getactivecpu(), activecpu_get_pc()); + mame_printf_debug("CPU%d: CPU1 IRQ at %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu)); cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ0, ASSERT_LINE); } @@ -870,7 +870,7 @@ static READ64_HANDLER(cde_r) default: { - // mame_printf_debug("cde_r: %08X at %08X\n", reg*4, activecpu_get_pc()); + // mame_printf_debug("cde_r: %08X at %08X\n", reg*4, cpu_get_pc(machine->activecpu)); break; } } @@ -904,7 +904,7 @@ static WRITE64_HANDLER(cde_w) { case 0x028/4: // Command write { - //printf("cde_w: %08X, %08X at %08X\n", d, reg*4, activecpu_get_pc()); + //printf("cde_w: %08X, %08X at %08X\n", d, reg*4, cpu_get_pc(machine->activecpu)); if (d == 0x0180) { @@ -1032,7 +1032,7 @@ static WRITE64_HANDLER(cde_w) default: { - // mame_printf_debug("cde_w: %08X, %08X at %08X\n", d, reg*4, activecpu_get_pc()); + // mame_printf_debug("cde_w: %08X, %08X at %08X\n", d, reg*4, cpu_get_pc(machine->activecpu)); break; } } @@ -1075,7 +1075,7 @@ static READ64_HANDLER(cpu_r) if (ACCESSING_BITS_32_63) { - r = (UINT64)(cpu_getactivecpu() ? 0x80000000 : 0); + r = (UINT64)(cpunum_get_active() ? 0x80000000 : 0); //r |= 0x40000000; // sets Video-LowRes !? return r << 32; } diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c index 75060c9f7dd..7eb48837275 100644 --- a/src/mame/drivers/ksys573.c +++ b/src/mame/drivers/ksys573.c @@ -232,9 +232,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { @@ -635,7 +635,7 @@ static READ32_HANDLER( atapi_r ) break; } -// mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, activecpu_get_pc()); +// mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, cpu_get_pc(machine->activecpu)); data <<= shift; } @@ -791,11 +791,11 @@ static WRITE32_HANDLER( atapi_w ) } atapi_regs[reg] = data; -// mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, activecpu_get_pc()); +// mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, cpu_get_pc(machine->activecpu)); if (reg == ATAPI_REG_CMDSTATUS) { -// mame_printf_debug("ATAPI command %x issued! (PC=%x)\n", data, activecpu_get_pc()); +// mame_printf_debug("ATAPI command %x issued! (PC=%x)\n", data, cpu_get_pc(machine->activecpu)); switch (data) { @@ -1048,7 +1048,7 @@ static READ32_HANDLER( flash_r ) if( flash_bank < 0 ) { - mame_printf_debug( "%08x: flash_r( %08x, %08x ) no bank selected %08x\n", activecpu_get_pc(), offset, mem_mask, control ); + mame_printf_debug( "%08x: flash_r( %08x, %08x ) no bank selected %08x\n", cpu_get_pc(machine->activecpu), offset, mem_mask, control ); data = 0xffffffff; } else @@ -1084,7 +1084,7 @@ static WRITE32_HANDLER( flash_w ) if( flash_bank < 0 ) { - mame_printf_debug( "%08x: flash_w( %08x, %08x, %08x ) no bank selected %08x\n", activecpu_get_pc(), offset, mem_mask, data, control ); + mame_printf_debug( "%08x: flash_w( %08x, %08x, %08x ) no bank selected %08x\n", cpu_get_pc(machine->activecpu), offset, mem_mask, data, control ); } else { @@ -2142,7 +2142,7 @@ static READ32_HANDLER( gx894pwbba_r ) } verboselog( 2, "gx894pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data ); -// printf( "%08x: gx894pwbba_r( %08x, %08x ) %08x\n", activecpu_get_pc(), offset, mem_mask, data ); +// printf( "%08x: gx894pwbba_r( %08x, %08x ) %08x\n", cpu_get_pc(machine->activecpu), offset, mem_mask, data ); return data; } diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c index b5fc3d07d67..9ddd61af77c 100644 --- a/src/mame/drivers/lastfght.c +++ b/src/mame/drivers/lastfght.c @@ -154,21 +154,21 @@ static int lastfght_x, lastfght_y, lastfght_w, lastfght_h; // high byte of a 16 bit register static WRITE16_HANDLER( lastfght_hi_w ) { - if (ACCESSING_BITS_8_15) logerror("%06x: 600000.b = %02x\n", activecpu_get_pc(),data>>8); + if (ACCESSING_BITS_8_15) logerror("%06x: 600000.b = %02x\n", cpu_get_pc(machine->activecpu),data>>8); if (ACCESSING_BITS_0_7) { lastfght_hi = data << 8; - //logerror("%06x: lastfght_hi = %02x\n", activecpu_get_pc(),data); + //logerror("%06x: lastfght_hi = %02x\n", cpu_get_pc(machine->activecpu),data); } } // screen x static WRITE16_HANDLER( lastfght_x_w ) { - if (ACCESSING_BITS_8_15) logerror("%06x: 800008.b = %02x\n", activecpu_get_pc(),data>>8); + if (ACCESSING_BITS_8_15) logerror("%06x: 800008.b = %02x\n", cpu_get_pc(machine->activecpu),data>>8); if (ACCESSING_BITS_0_7) { lastfght_x = lastfght_hi | data; - //logerror("%06x: lastfght_x = %02x\n", activecpu_get_pc(),data); + //logerror("%06x: lastfght_x = %02x\n", cpu_get_pc(machine->activecpu),data); } } // screen y, screen width - 1 @@ -177,12 +177,12 @@ static WRITE16_HANDLER( lastfght_yw_w ) if (ACCESSING_BITS_8_15) { lastfght_y = lastfght_hi | (data >> 8); - //logerror("%06x: lastfght_y = %02x\n", activecpu_get_pc(),data>>8); + //logerror("%06x: lastfght_y = %02x\n", cpu_get_pc(machine->activecpu),data>>8); } if (ACCESSING_BITS_0_7) { lastfght_w = lastfght_hi | data; - //logerror("%06x: lastfght_w = %02x\n", activecpu_get_pc(),data); + //logerror("%06x: lastfght_w = %02x\n", cpu_get_pc(machine->activecpu),data); } } // screen height - 1 @@ -191,9 +191,9 @@ static WRITE16_HANDLER( lastfght_h_w ) if (ACCESSING_BITS_8_15) { lastfght_h = lastfght_hi | (data >> 8); - //logerror("%06x: lastfght_h = %02x\n", activecpu_get_pc(),data>>8); + //logerror("%06x: lastfght_h = %02x\n", cpu_get_pc(machine->activecpu),data>>8); } - if (ACCESSING_BITS_0_7) logerror("%06x: 80000d.b = %02x\n", activecpu_get_pc(),data); + if (ACCESSING_BITS_0_7) logerror("%06x: 80000d.b = %02x\n", cpu_get_pc(machine->activecpu),data); } // source delta x << 6, source x << 6 static WRITE16_HANDLER( lastfght_sx_w ) @@ -201,12 +201,12 @@ static WRITE16_HANDLER( lastfght_sx_w ) if (ACCESSING_BITS_8_15) { lastfght_dsx = lastfght_hi | (data >> 8); - //logerror("%06x: lastfght_dsx = %02x\n", activecpu_get_pc(),data>>8); + //logerror("%06x: lastfght_dsx = %02x\n", cpu_get_pc(machine->activecpu),data>>8); } if (ACCESSING_BITS_0_7) { lastfght_sx = lastfght_hi | data; - //logerror("%06x: lastfght_sx = %02x\n", activecpu_get_pc(),data); + //logerror("%06x: lastfght_sx = %02x\n", cpu_get_pc(machine->activecpu),data); } } // source y << 6, source y1 << 6 @@ -215,12 +215,12 @@ static WRITE16_HANDLER( lastfght_sy_w ) if (ACCESSING_BITS_8_15) { lastfght_sy = lastfght_hi | (data >> 8); - //logerror("%06x: lastfght_sy = %02x\n", activecpu_get_pc(),data>>8); + //logerror("%06x: lastfght_sy = %02x\n", cpu_get_pc(machine->activecpu),data>>8); } if (ACCESSING_BITS_0_7) { lastfght_sy1 = lastfght_hi | data; - //logerror("%06x: lastfght_sy1 = %02x\n", activecpu_get_pc(),data); + //logerror("%06x: lastfght_sy1 = %02x\n", cpu_get_pc(machine->activecpu),data); } } // source rom (0x200000 bytes), source page (512x256 bytes) @@ -229,12 +229,12 @@ static WRITE16_HANDLER( lastfght_sr_w ) if (ACCESSING_BITS_8_15) { lastfght_sp = (lastfght_hi>>8) >> 4; - //logerror("%06x: lastfght_sp = %02x\n", activecpu_get_pc(),data>>8); + //logerror("%06x: lastfght_sp = %02x\n", cpu_get_pc(machine->activecpu),data>>8); } if (ACCESSING_BITS_0_7) { lastfght_sr = data; - //logerror("%06x: lastfght_sr = %02x\n", activecpu_get_pc(),data); + //logerror("%06x: lastfght_sr = %02x\n", cpu_get_pc(machine->activecpu),data); } } // source x1 << 6, source delta y << 6 @@ -243,12 +243,12 @@ static WRITE16_HANDLER( lastfght_sd_w ) if (ACCESSING_BITS_8_15) { lastfght_sx1 = lastfght_hi | (data >> 8); - //logerror("%06x: lastfght_sx1 = %02x\n", activecpu_get_pc(),data>>8); + //logerror("%06x: lastfght_sx1 = %02x\n", cpu_get_pc(machine->activecpu),data>>8); } if (ACCESSING_BITS_0_7) { lastfght_dsy = lastfght_hi | data; - //logerror("%06x: lastfght_dsy = %02x\n", activecpu_get_pc(),data); + //logerror("%06x: lastfght_dsy = %02x\n", cpu_get_pc(machine->activecpu),data); } } // start blit @@ -261,7 +261,7 @@ static WRITE16_HANDLER( lastfght_blit_w ) bitmap_t *dest = lastfght_bitmap[lastfght_dest]; #if 0 - logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, sx %03x.%02x, sx1 %03x.%02x, dsx %03x.%02x, sy %03x.%02x, sy1 %03x.%02x, dsy %03x.%02x, sp %02x, sr %02x, data %02x\n", activecpu_get_pc(), + logerror("%06x: blit x %03x, y %03x, w %03x, h %03x, sx %03x.%02x, sx1 %03x.%02x, dsx %03x.%02x, sy %03x.%02x, sy1 %03x.%02x, dsy %03x.%02x, sp %02x, sr %02x, data %02x\n", cpu_get_pc(machine->activecpu), lastfght_x,lastfght_y,lastfght_w+1,lastfght_h+1, lastfght_sx>>6,lastfght_sx&0x3f, lastfght_sx1>>6,lastfght_dsx&0x3f, lastfght_sx1>>6,lastfght_sx1&0x3f, lastfght_sy>>6,lastfght_sy&0x3f, lastfght_sy1>>6,lastfght_dsy&0x3f, lastfght_sy1>>6,lastfght_sy1&0x3f, @@ -285,7 +285,7 @@ static WRITE16_HANDLER( lastfght_blit_w ) } } } - if (ACCESSING_BITS_0_7) logerror("%06x: 600007.b = %02x\n", activecpu_get_pc(),data); + if (ACCESSING_BITS_0_7) logerror("%06x: 600007.b = %02x\n", cpu_get_pc(machine->activecpu),data); } // toggle framebuffer static WRITE16_HANDLER( lastfght_dest_w ) @@ -338,8 +338,8 @@ static READ16_HANDLER( lastfght_sound_r ) static WRITE16_HANDLER( lastfght_sound_w ) { - if (ACCESSING_BITS_8_15) logerror("%06x: sound_w msb = %02x\n", activecpu_get_pc(),data>>8); - if (ACCESSING_BITS_0_7) logerror("%06x: sound_w lsb = %02x\n", activecpu_get_pc(),data); + if (ACCESSING_BITS_8_15) logerror("%06x: sound_w msb = %02x\n", cpu_get_pc(machine->activecpu),data>>8); + if (ACCESSING_BITS_0_7) logerror("%06x: sound_w lsb = %02x\n", cpu_get_pc(machine->activecpu),data); } /*************************************************************************** diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c index 454afd0d055..b8b4bc024f6 100644 --- a/src/mame/drivers/lethal.c +++ b/src/mame/drivers/lethal.c @@ -422,7 +422,7 @@ static WRITE8_HANDLER( le_4800_w ) break; default: - logerror("Unknown LE 48xx register write: %x to %x (PC=%x)\n", data, offset, activecpu_get_pc()); + logerror("Unknown LE 48xx register write: %x to %x (PC=%x)\n", data, offset, cpu_get_pc(machine->activecpu)); break; } } diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c index f9a43bcf3fd..f60f876e4bb 100644 --- a/src/mame/drivers/liberate.c +++ b/src/mame/drivers/liberate.c @@ -53,10 +53,10 @@ static READ8_HANDLER( deco16_bank_r ) /* Else the handler falls through to read the usual address */ if (offset<0x800) return videoram[offset]; if (offset<0x1000) return spriteram[offset-0x800]; - if (offset<0x2200) { logerror("%04x: Unmapped bank read %04x\n",activecpu_get_pc(),offset); return 0; } + if (offset<0x2200) { logerror("%04x: Unmapped bank read %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; } if (offset<0x2800) return scratchram[offset-0x2200]; - logerror("%04x: Unmapped bank read %04x\n",activecpu_get_pc(),offset); + logerror("%04x: Unmapped bank read %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; } @@ -76,7 +76,7 @@ static READ8_HANDLER( deco16_io_r ) if (offset==3) return input_port_read(machine, "DSW1"); /* Dip 1 */ if (offset==4) return input_port_read(machine, "DSW2"); /* Dip 2 */ - logerror("%04x: Read input %d\n",activecpu_get_pc(),offset); + logerror("%04x: Read input %d\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } return ROM[0x8000+offset]; diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c index 96040ddfe22..e74d6763bed 100644 --- a/src/mame/drivers/limenko.c +++ b/src/mame/drivers/limenko.c @@ -967,7 +967,7 @@ ROM_END static READ32_HANDLER( dynabomb_speedup_r ) { - if(activecpu_get_pc() == 0xc25b8) + if(cpu_get_pc(machine->activecpu) == 0xc25b8) { activecpu_eat_cycles(50); } @@ -977,7 +977,7 @@ static READ32_HANDLER( dynabomb_speedup_r ) static READ32_HANDLER( legendoh_speedup_r ) { - if(activecpu_get_pc() == 0x23e32) + if(cpu_get_pc(machine->activecpu) == 0x23e32) { activecpu_eat_cycles(50); } @@ -987,7 +987,7 @@ static READ32_HANDLER( legendoh_speedup_r ) static READ32_HANDLER( sb2003_speedup_r ) { - if(activecpu_get_pc() == 0x26da4) + if(cpu_get_pc(machine->activecpu) == 0x26da4) { activecpu_eat_cycles(50); } @@ -997,7 +997,7 @@ static READ32_HANDLER( sb2003_speedup_r ) static READ32_HANDLER( spotty_speedup_r ) { - if(activecpu_get_pc() == 0x8560) + if(cpu_get_pc(machine->activecpu) == 0x8560) { activecpu_eat_cycles(50); } diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c index a0434d67667..81c57e14f1f 100644 --- a/src/mame/drivers/lockon.c +++ b/src/mame/drivers/lockon.c @@ -73,65 +73,65 @@ static READ16_HANDLER( main_gnd_r ) { UINT16 result; - cpuintrf_push_context(GROUND_CPU); + cpu_push_context(machine->cpu[GROUND_CPU]); result = program_read_word(V30_GND_ADDR | offset * 2); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } static WRITE16_HANDLER( main_gnd_w ) { - cpuintrf_push_context(GROUND_CPU); + cpu_push_context(machine->cpu[GROUND_CPU]); if (ACCESSING_BITS_0_7) program_write_byte(V30_GND_ADDR | (offset * 2 + 0), data); if (ACCESSING_BITS_8_15) program_write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8); - cpuintrf_pop_context(); + cpu_pop_context(); } static READ16_HANDLER( main_obj_r ) { UINT16 result; - cpuintrf_push_context(OBJECT_CPU); + cpu_push_context(machine->cpu[OBJECT_CPU]); result = program_read_word(V30_OBJ_ADDR | offset * 2); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } static WRITE16_HANDLER( main_obj_w ) { - cpuintrf_push_context(OBJECT_CPU); + cpu_push_context(machine->cpu[OBJECT_CPU]); if (ACCESSING_BITS_0_7) program_write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data); if (ACCESSING_BITS_8_15) program_write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8); - cpuintrf_pop_context(); + cpu_pop_context(); } static WRITE16_HANDLER( tst_w ) { if (offset < 0x800) { - cpuintrf_push_context(GROUND_CPU); + cpu_push_context(machine->cpu[GROUND_CPU]); if (ACCESSING_BITS_0_7) program_write_byte(V30_GND_ADDR | (offset * 2 + 0), data); if (ACCESSING_BITS_8_15) program_write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8); - cpuintrf_pop_context(); + cpu_pop_context(); - cpuintrf_push_context(OBJECT_CPU); + cpu_push_context(machine->cpu[OBJECT_CPU]); if (ACCESSING_BITS_0_7) program_write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data); if (ACCESSING_BITS_8_15) program_write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8); - cpuintrf_pop_context(); + cpu_pop_context(); } } @@ -139,18 +139,18 @@ static READ16_HANDLER( main_z80_r ) { UINT16 val; - cpuintrf_push_context(SOUND_CPU); + cpu_push_context(machine->cpu[SOUND_CPU]); val = program_read_byte(offset); - cpuintrf_pop_context(); + cpu_pop_context(); return 0xff00 | val; } static WRITE16_HANDLER( main_z80_w ) { - cpuintrf_push_context(SOUND_CPU); + cpu_push_context(machine->cpu[SOUND_CPU]); program_write_byte(offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } static WRITE16_HANDLER( inten_w ) diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c index b6173a24b0a..7532f563d95 100644 --- a/src/mame/drivers/looping.c +++ b/src/mame/drivers/looping.c @@ -411,8 +411,8 @@ static int last; static WRITE8_HANDLER( out_0_w ) { mame_printf_debug("out0 = %02X\n", data); } static WRITE8_HANDLER( out_2_w ) { mame_printf_debug("out2 = %02X\n", data); } -static READ8_HANDLER( adc_r ) { mame_printf_debug("%04X:ADC read\n", activecpu_get_pc()); return 0xff; } -static WRITE8_HANDLER( adc_w ) { mame_printf_debug("%04X:ADC write = %02X\n", activecpu_get_pc(), data); } +static READ8_HANDLER( adc_r ) { mame_printf_debug("%04X:ADC read\n", cpu_get_pc(machine->activecpu)); return 0xff; } +static WRITE8_HANDLER( adc_w ) { mame_printf_debug("%04X:ADC write = %02X\n", cpu_get_pc(machine->activecpu), data); } static WRITE8_HANDLER( plr2_w ) { diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c index 2028e6f2f86..c36779f1791 100644 --- a/src/mame/drivers/lordgun.c +++ b/src/mame/drivers/lordgun.c @@ -116,7 +116,7 @@ static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w ) if (data & ~0xfd) { // popmessage("EE: %02x", data); - logerror("PC %06X - Unknown EEPROM bit written %02X\n",activecpu_get_pc(),data); + logerror("PC %06X - Unknown EEPROM bit written %02X\n",cpu_get_pc(device->machine->activecpu),data); } coin_counter_w(0, data & 0x01); @@ -236,7 +236,7 @@ ADDRESS_MAP_END static WRITE8_HANDLER( lordgun_okibank_w ) { okim6295_set_bank_base(0, (data & 2) ? 0x40000 : 0); - if (data & ~3) logerror("%04x: unknown okibank bits %02x\n", activecpu_get_pc(), data); + if (data & ~3) logerror("%04x: unknown okibank bits %02x\n", cpu_get_pc(machine->activecpu), data); // popmessage("OKI %x", data); } diff --git a/src/mame/drivers/lwings.c b/src/mame/drivers/lwings.c index e88789b8ba9..8d5068d37d8 100644 --- a/src/mame/drivers/lwings.c +++ b/src/mame/drivers/lwings.c @@ -104,7 +104,7 @@ static INTERRUPT_GEN( lwings_interrupt ) static WRITE8_HANDLER( avengers_protection_w ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(machine->activecpu); if( pc == 0x2eeb ) { @@ -225,7 +225,7 @@ static READ8_HANDLER( avengers_protection_r ) int x,y; int dx,dy,dist,dir; - if( activecpu_get_pc() == 0x7c7 ) + if( cpu_get_pc(machine->activecpu) == 0x7c7 ) { /* palette data */ return avengers_fetch_paldata(); diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c index 0016b337111..65eb70d2335 100644 --- a/src/mame/drivers/m92.c +++ b/src/mame/drivers/m92.c @@ -275,14 +275,14 @@ static TIMER_CALLBACK( m92_scanline_interrupt ) static READ16_HANDLER( m92_eeprom_r ) { UINT8 *RAM = memory_region(machine, "user1"); -// logerror("%05x: EEPROM RE %04x\n",activecpu_get_pc(),offset); +// logerror("%05x: EEPROM RE %04x\n",cpu_get_pc(machine->activecpu),offset); return RAM[offset] | 0xff00; } static WRITE16_HANDLER( m92_eeprom_w ) { UINT8 *RAM = memory_region(machine, "user1"); -// logerror("%05x: EEPROM WR %04x\n",activecpu_get_pc(),offset); +// logerror("%05x: EEPROM WR %04x\n",cpu_get_pc(machine->activecpu),offset); if (ACCESSING_BITS_0_7) RAM[offset] = data; } @@ -347,7 +347,7 @@ static WRITE16_HANDLER( m92_soundlatch_w ) static READ16_HANDLER( m92_sound_status_r ) { -//logerror("%06x: read sound status\n",activecpu_get_pc()); +//logerror("%06x: read sound status\n",cpu_get_pc(machine->activecpu)); return sound_status; } diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c index 5e7febc56ef..eba01ab2ad7 100644 --- a/src/mame/drivers/macrossp.c +++ b/src/mame/drivers/macrossp.c @@ -338,7 +338,7 @@ static READ32_HANDLER ( macrossp_soundstatus_r ) { static int toggle; -// logerror("%08x read soundstatus\n",activecpu_get_pc()); +// logerror("%08x read soundstatus\n",cpu_get_pc(machine->activecpu)); /* bit 1 is sound status */ /* bit 0 unknown - it is expected to toggle, vblank? */ @@ -352,7 +352,7 @@ static WRITE32_HANDLER( macrossp_soundcmd_w ) { if (ACCESSING_BITS_16_31) { - //logerror("%08x write soundcmd %08x (%08x)\n",activecpu_get_pc(),data,mem_mask); + //logerror("%08x write soundcmd %08x (%08x)\n",cpu_get_pc(machine->activecpu),data,mem_mask); soundlatch_word_w(machine,0,data >> 16,0xffff); sndpending = 1; cpunum_set_input_line(machine, 1,2,HOLD_LINE); @@ -363,7 +363,7 @@ static WRITE32_HANDLER( macrossp_soundcmd_w ) static READ16_HANDLER( macrossp_soundcmd_r ) { -// logerror("%06x read soundcmd\n",activecpu_get_pc()); +// logerror("%06x read soundcmd\n",cpu_get_pc(machine->activecpu)); sndpending = 0; return soundlatch_word_r(machine,offset,mem_mask); } @@ -778,14 +778,14 @@ PC :0001810A 01810A: cmp.w $f10140.l, D0 PC :00018110 018110: beq 18104 */ COMBINE_DATA(¯ossp_mainram[0x10158/4]); - if (activecpu_get_pc()==0x001810A) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x001810A) cpu_spinuntil_int(); } #ifdef UNUSED_FUNCTION static WRITE32_HANDLER( quizmoon_speedup_w ) { COMBINE_DATA(¯ossp_mainram[0x00020/4]); - if (activecpu_get_pc()==0x1cc) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x1cc) cpu_spinuntil_int(); } #endif diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c index f9cb001b9a7..974adcb4dbb 100644 --- a/src/mame/drivers/macs.c +++ b/src/mame/drivers/macs.c @@ -112,7 +112,7 @@ static READ8_HANDLER( macs_input_r ) case 5: return input_port_read(machine, "DSW3"); case 6: return input_port_read(machine, "DSW4"); case 7: return input_port_read(machine, "SYS1"); - default: popmessage("Unmapped I/O read at PC = %06x offset = %02x",activecpu_get_pc(),offset+0xc0); + default: popmessage("Unmapped I/O read at PC = %06x offset = %02x",cpu_get_pc(machine->activecpu),offset+0xc0); } return 0xff; diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c index 933fed79172..ebbcf8640db 100644 --- a/src/mame/drivers/mainevt.c +++ b/src/mame/drivers/mainevt.c @@ -109,7 +109,7 @@ static WRITE8_HANDLER( mainevt_sh_bankswitch_w ) { int bank_A,bank_B; -//logerror("CPU #1 PC: %04x bank switch = %02x\n",activecpu_get_pc(),data); +//logerror("CPU #1 PC: %04x bank switch = %02x\n",cpu_get_pc(machine->activecpu),data); /* bits 0-3 select the 007232 banks */ bank_A=(data&0x3); @@ -124,7 +124,7 @@ static WRITE8_HANDLER( dv_sh_bankswitch_w ) { int bank_A,bank_B; -//logerror("CPU #1 PC: %04x bank switch = %02x\n",activecpu_get_pc(),data); +//logerror("CPU #1 PC: %04x bank switch = %02x\n",cpu_get_pc(machine->activecpu),data); /* bits 0-3 select the 007232 banks */ bank_A=(data&0x3); diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c index 344e9d0d897..eaa13709703 100644 --- a/src/mame/drivers/malzak.c +++ b/src/mame/drivers/malzak.c @@ -171,7 +171,7 @@ static WRITE8_HANDLER( port40_w ) // Bits 1-3 are all set high upon death, until the game continues // Bit 6 is used only in Malzak II, and is set high after checking // the selected version -// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n",cpunum_get_physical_pc_byte(0),data); +// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n",cpu_get_physical_pc_byte(machine->cpu[0]),data); if(data & 0x40) malzak_bank1 = 1; else diff --git a/src/mame/drivers/mario.c b/src/mame/drivers/mario.c index e0bb8674a92..8e846d8c6ec 100644 --- a/src/mame/drivers/mario.c +++ b/src/mame/drivers/mario.c @@ -129,18 +129,18 @@ static READ8_DEVICE_HANDLER(mario_dma_read_byte) { UINT8 result; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); result = program_read_byte(offset); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } static WRITE8_DEVICE_HANDLER(mario_dma_write_byte) { - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); program_write_byte(offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } /************************************* diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c index 32dc8980718..131b65e1858 100644 --- a/src/mame/drivers/mcr.c +++ b/src/mame/drivers/mcr.c @@ -523,8 +523,8 @@ static READ8_HANDLER( nflfoot_ip2_r ) nflfoot_serial_in_active = FALSE; } - if (activecpu_get_pc() != 0x107) - logerror("%04X:ip2_r = %02X\n", activecpu_get_pc(), val); + if (cpu_get_pc(machine->activecpu) != 0x107) + logerror("%04X:ip2_r = %02X\n", cpu_get_pc(machine->activecpu), val); return val; } @@ -534,7 +534,7 @@ static WRITE8_HANDLER( nflfoot_op4_w ) const device_config *sio = devtag_get_device(machine, Z80SIO, "ipu_sio"); /* bit 7 = J3-7 on IPU board = /RXDA on SIO */ - logerror("%04X:op4_w(%d%d%d)\n", activecpu_get_pc(), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1); + logerror("%04X:op4_w(%d%d%d)\n", cpu_get_pc(machine->activecpu), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1); /* look for a non-zero start bit to go active */ if (!nflfoot_serial_out_active && (data & 0x80)) diff --git a/src/mame/drivers/mcr3.c b/src/mame/drivers/mcr3.c index 564a5b74aff..c9636068545 100644 --- a/src/mame/drivers/mcr3.c +++ b/src/mame/drivers/mcr3.c @@ -435,7 +435,7 @@ static READ8_HANDLER( turbotag_kludge_r ) /* Unfortunately, the game refuses to start if any bad ROM is */ /* found; to work around this, we catch the checksum byte read */ /* and modify it to what we know we will be getting. */ - if (activecpu_get_previouspc() == 0xb29) + if (cpu_get_previouspc(machine->activecpu) == 0xb29) return 0x82; else return 0x92; diff --git a/src/mame/drivers/mcr68.c b/src/mame/drivers/mcr68.c index 55409ad3315..bd35369a1ec 100644 --- a/src/mame/drivers/mcr68.c +++ b/src/mame/drivers/mcr68.c @@ -233,7 +233,7 @@ static WRITE16_HANDLER( pigskin_protection_w ) protection_data[3] = protection_data[4]; protection_data[4] = data & 0xff; - logerror("%06X:protection_w=%02X\n", activecpu_get_previouspc(), data & 0xff); + logerror("%06X:protection_w=%02X\n", cpu_get_previouspc(machine->activecpu), data & 0xff); } } diff --git a/src/mame/drivers/meadows.c b/src/mame/drivers/meadows.c index 49fed6fae88..e89e61f64df 100644 --- a/src/mame/drivers/meadows.c +++ b/src/mame/drivers/meadows.c @@ -260,7 +260,7 @@ static WRITE8_HANDLER( audio_hardware_w ) break; logerror("audio_w ctr1 preset $%x amp %d\n", data & 15, data >> 4); meadows_0c01 = data; - meadows_sh_update(); + meadows_sh_update(machine); break; case 2: /* counter clk 5 MHz / 32 (/ 2 or / 4) */ @@ -268,7 +268,7 @@ static WRITE8_HANDLER( audio_hardware_w ) break; logerror("audio_w ctr2 preset $%02x\n", data); meadows_0c02 = data; - meadows_sh_update(); + meadows_sh_update(machine); break; case 3: /* audio enable */ @@ -276,7 +276,7 @@ static WRITE8_HANDLER( audio_hardware_w ) break; logerror("audio_w enable ctr2/2:%d ctr2:%d dac:%d ctr1:%d\n", data&1, (data>>1)&1, (data>>2)&1, (data>>3)&1); meadows_0c03 = data; - meadows_sh_update(); + meadows_sh_update(machine); break; } } diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c index fd2e97305ed..cbf97661fda 100644 --- a/src/mame/drivers/mediagx.c +++ b/src/mame/drivers/mediagx.c @@ -505,7 +505,7 @@ static READ32_HANDLER( parallel_port_r ) { UINT8 nibble = parallel_latched;//(input_port_read_safe(machine, portnames[parallel_pointer / 3], 0) >> (4 * (parallel_pointer % 3))) & 15; r |= ((~nibble & 0x08) << 12) | ((nibble & 0x07) << 11); - logerror("%08X:parallel_port_r()\n", activecpu_get_pc()); + logerror("%08X:parallel_port_r()\n", cpu_get_pc(machine->activecpu)); /* if (controls_data == 0x18) { r |= input_port_read(machine, "IN0") << 8; @@ -552,7 +552,7 @@ static WRITE32_HANDLER( parallel_port_w ) 7x..ff = advance pointer */ - logerror("%08X:", activecpu_get_pc()); + logerror("%08X:", cpu_get_pc(machine->activecpu)); parallel_latched = (input_port_read_safe(machine, portnames[parallel_pointer / 3], 0) >> (4 * (parallel_pointer % 3))) & 15; // parallel_pointer++; @@ -776,9 +776,9 @@ static DMA8237_MEM_READ( pc_dma_read_byte ) offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16) & 0xFF0000; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); result = program_read_byte(page_offset + offset); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -789,9 +789,9 @@ static DMA8237_MEM_WRITE( pc_dma_write_byte ) offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16) & 0xFF0000; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); program_write_byte(page_offset + offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } @@ -1140,9 +1140,9 @@ struct _speedup_entry static speedup_entry *speedup_table; static int speedup_count; -INLINE UINT32 generic_speedup(speedup_entry *entry) +INLINE UINT32 generic_speedup(running_machine *machine, speedup_entry *entry) { - if (activecpu_get_pc() == entry->pc) + if (cpu_get_pc(machine->activecpu) == entry->pc) { entry->hits++; cpu_spinuntil_int(); @@ -1150,18 +1150,18 @@ INLINE UINT32 generic_speedup(speedup_entry *entry) return main_ram[entry->offset/4]; } -static READ32_HANDLER( speedup0_r ) { return generic_speedup(&speedup_table[0]); } -static READ32_HANDLER( speedup1_r ) { return generic_speedup(&speedup_table[1]); } -static READ32_HANDLER( speedup2_r ) { return generic_speedup(&speedup_table[2]); } -static READ32_HANDLER( speedup3_r ) { return generic_speedup(&speedup_table[3]); } -static READ32_HANDLER( speedup4_r ) { return generic_speedup(&speedup_table[4]); } -static READ32_HANDLER( speedup5_r ) { return generic_speedup(&speedup_table[5]); } -static READ32_HANDLER( speedup6_r ) { return generic_speedup(&speedup_table[6]); } -static READ32_HANDLER( speedup7_r ) { return generic_speedup(&speedup_table[7]); } -static READ32_HANDLER( speedup8_r ) { return generic_speedup(&speedup_table[8]); } -static READ32_HANDLER( speedup9_r ) { return generic_speedup(&speedup_table[9]); } -static READ32_HANDLER( speedup10_r ) { return generic_speedup(&speedup_table[10]); } -static READ32_HANDLER( speedup11_r ) { return generic_speedup(&speedup_table[11]); } +static READ32_HANDLER( speedup0_r ) { return generic_speedup(machine, &speedup_table[0]); } +static READ32_HANDLER( speedup1_r ) { return generic_speedup(machine, &speedup_table[1]); } +static READ32_HANDLER( speedup2_r ) { return generic_speedup(machine, &speedup_table[2]); } +static READ32_HANDLER( speedup3_r ) { return generic_speedup(machine, &speedup_table[3]); } +static READ32_HANDLER( speedup4_r ) { return generic_speedup(machine, &speedup_table[4]); } +static READ32_HANDLER( speedup5_r ) { return generic_speedup(machine, &speedup_table[5]); } +static READ32_HANDLER( speedup6_r ) { return generic_speedup(machine, &speedup_table[6]); } +static READ32_HANDLER( speedup7_r ) { return generic_speedup(machine, &speedup_table[7]); } +static READ32_HANDLER( speedup8_r ) { return generic_speedup(machine, &speedup_table[8]); } +static READ32_HANDLER( speedup9_r ) { return generic_speedup(machine, &speedup_table[9]); } +static READ32_HANDLER( speedup10_r ) { return generic_speedup(machine, &speedup_table[10]); } +static READ32_HANDLER( speedup11_r ) { return generic_speedup(machine, &speedup_table[11]); } static const read32_machine_func speedup_handlers[] = { diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c index a9d697a528e..74aed2c3c3a 100644 --- a/src/mame/drivers/megadriv.c +++ b/src/mame/drivers/megadriv.c @@ -197,7 +197,7 @@ static UINT16 read_next_instruction(void) /* read original encrypted memory at that address */ recurse = 1; - result = program_read_word_16be(activecpu_get_pc()); + result = program_read_word_16be(cpu_get_pc(machine->activecpu)); recurse = 0; return result; } @@ -237,13 +237,13 @@ static void megadriv_z80_bank_w(UINT16 data) static WRITE16_HANDLER( megadriv_68k_z80_bank_write ) { - //logerror("%06x: 68k writing bit to bank register %01x\n", activecpu_get_pc(),data&0x01); + //logerror("%06x: 68k writing bit to bank register %01x\n", cpu_get_pc(machine->activecpu),data&0x01); megadriv_z80_bank_w(data&0x01); } static WRITE8_HANDLER(megadriv_z80_z80_bank_w) { - //logerror("%04x: z80 writing bit to bank register %01x\n", activecpu_get_pc(),data&0x01); + //logerror("%04x: z80 writing bit to bank register %01x\n", cpu_get_pc(machine->activecpu),data&0x01); megadriv_z80_bank_w(data&0x01); } @@ -624,7 +624,7 @@ static void megadrive_vdp_set_register(running_machine *machine, int regnum, UIN // if (regnum == 0x0a) // mame_printf_debug("Set HINT Reload Register to %d on scanline %d\n",value, genesis_scanline_counter); -// mame_printf_debug("%06x Setting VDP Register #%02x to %02x\n",activecpu_get_pc(), regnum,value); +// mame_printf_debug("%06x Setting VDP Register #%02x to %02x\n",cpu_get_pc(machine->activecpu), regnum,value); } static void update_megadrive_vdp_code_and_address(void) @@ -804,7 +804,7 @@ static void handle_dma_bits(running_machine *machine) UINT16 length; source = (MEGADRIVE_REG15_DMASOURCE1 | (MEGADRIVE_REG16_DMASOURCE2<<8) | ((MEGADRIVE_REG17_DMASOURCE3&0xff)<<16))<<1; length = (MEGADRIVE_REG13_DMALENGTH1 | (MEGADRIVE_REG14_DMALENGTH2<<8))<<1; - // mame_printf_debug("%06x 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", activecpu_get_pc(), source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, megadrive_vdp_code,MEGADRIVE_REG0F_AUTO_INC); + // mame_printf_debug("%06x 68k DMAtran set source %06x length %04x dest %04x enabled %01x code %02x %02x\n", cpu_get_pc(machine->activecpu), source, length, megadrive_vdp_address,MEGADRIVE_REG01_DMA_ENABLE, megadrive_vdp_code,MEGADRIVE_REG0F_AUTO_INC); } @@ -1381,7 +1381,7 @@ READ16_HANDLER( megadriv_vdp_r ) // if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read control port access, offset %04x mem_mask %04x\n",offset,mem_mask); retvalue = megadriv_vdp_ctrl_port_r(); // retvalue = mame_rand(machine); - // mame_printf_debug("%06x: Read Control Port at scanline %d hpos %d (return %04x)\n",activecpu_get_pc(),genesis_scanline_counter, get_hposition(),retvalue); + // mame_printf_debug("%06x: Read Control Port at scanline %d hpos %d (return %04x)\n",cpu_get_pc(machine->activecpu),genesis_scanline_counter, get_hposition(),retvalue); break; case 0x08: @@ -1391,7 +1391,7 @@ READ16_HANDLER( megadriv_vdp_r ) // if ((!ACCESSING_BITS_8_15) || (!ACCESSING_BITS_0_7)) mame_printf_debug("8-bit VDP read HV counter port access, offset %04x mem_mask %04x\n",offset,mem_mask); retvalue = megadriv_read_hv_counters(); // retvalue = mame_rand(machine); - // mame_printf_debug("%06x: Read HV counters at scanline %d hpos %d (return %04x)\n",activecpu_get_pc(),genesis_scanline_counter, get_hposition(),retvalue); + // mame_printf_debug("%06x: Read HV counters at scanline %d hpos %d (return %04x)\n",cpu_get_pc(machine->activecpu),genesis_scanline_counter, get_hposition(),retvalue); break; case 0x10: @@ -1424,7 +1424,7 @@ static READ16_HANDLER( megadriv_68k_YM2612_read) } else { - logerror("%06x: 68000 attempting to access YM2612 (read) without bus\n", activecpu_get_pc()); + logerror("%06x: 68000 attempting to access YM2612 (read) without bus\n", cpu_get_pc(machine->activecpu)); return 0; } @@ -1452,7 +1452,7 @@ static WRITE16_HANDLER( megadriv_68k_YM2612_write) } else { - logerror("%06x: 68000 attempting to access YM2612 (write) without bus\n", activecpu_get_pc()); + logerror("%06x: 68000 attempting to access YM2612 (write) without bus\n", cpu_get_pc(machine->activecpu)); } } @@ -2039,7 +2039,7 @@ static READ16_HANDLER( megadriv_68k_io_read ) switch (offset) { case 0: - logerror("%06x read version register\n", activecpu_get_pc()); + logerror("%06x read version register\n", cpu_get_pc(machine->activecpu)); retdata = megadrive_region_export<<7 | // Export megadrive_region_pal<<6 | // NTSC 0x20 | // No Sega CD @@ -2245,7 +2245,7 @@ static READ16_HANDLER( megadriv_68k_read_z80_ram ) } else { - logerror("%06x: 68000 attempting to access Z80 (read) address space without bus\n", activecpu_get_pc()); + logerror("%06x: 68000 attempting to access Z80 (read) address space without bus\n", cpu_get_pc(machine->activecpu)); return mame_rand(machine); } } @@ -2272,7 +2272,7 @@ static WRITE16_HANDLER( megadriv_68k_write_z80_ram ) } else { - logerror("%06x: 68000 attempting to access Z80 (write) address space without bus\n", activecpu_get_pc()); + logerror("%06x: 68000 attempting to access Z80 (write) address space without bus\n", cpu_get_pc(machine->activecpu)); } } @@ -2297,13 +2297,13 @@ static READ16_HANDLER( megadriv_68k_check_z80_bus ) if (genz80.z80_has_bus || genz80.z80_is_reset) retvalue = nextvalue | 0x0100; else retvalue = (nextvalue & 0xfeff); - //logerror("%06x: 68000 check z80 Bus (byte MSB access) returning %04x mask %04x\n", activecpu_get_pc(),retvalue, mem_mask); + //logerror("%06x: 68000 check z80 Bus (byte MSB access) returning %04x mask %04x\n", cpu_get_pc(machine->activecpu),retvalue, mem_mask); return retvalue; } else if (!ACCESSING_BITS_8_15) // is this valid? { - //logerror("%06x: 68000 check z80 Bus (byte LSB access) %04x\n", activecpu_get_pc(),mem_mask); + //logerror("%06x: 68000 check z80 Bus (byte LSB access) %04x\n", cpu_get_pc(machine->activecpu),mem_mask); if (genz80.z80_has_bus || genz80.z80_is_reset) retvalue = 0x0001; else retvalue = 0x0000; @@ -2311,11 +2311,11 @@ static READ16_HANDLER( megadriv_68k_check_z80_bus ) } else { - //logerror("%06x: 68000 check z80 Bus (word access) %04x\n", activecpu_get_pc(),mem_mask); + //logerror("%06x: 68000 check z80 Bus (word access) %04x\n", cpu_get_pc(machine->activecpu),mem_mask); if (genz80.z80_has_bus || genz80.z80_is_reset) retvalue = nextvalue | 0x0100; else retvalue = (nextvalue & 0xfeff); - // mame_printf_debug("%06x: 68000 check z80 Bus (word access) %04x %04x\n", activecpu_get_pc(),mem_mask, retvalue); + // mame_printf_debug("%06x: 68000 check z80 Bus (word access) %04x %04x\n", cpu_get_pc(machine->activecpu),mem_mask, retvalue); return retvalue; } } @@ -2328,13 +2328,13 @@ static WRITE16_HANDLER( megadriv_68k_req_z80_bus ) { if (data & 0x0100) { - //logerror("%06x: 68000 request z80 Bus (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 request z80 Bus (byte MSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_has_bus=0; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); } else { - //logerror("%06x: 68000 return z80 Bus (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 return z80 Bus (byte MSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_has_bus=1; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); @@ -2344,13 +2344,13 @@ static WRITE16_HANDLER( megadriv_68k_req_z80_bus ) { if (data & 0x0001) { - //logerror("%06x: 68000 request z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 request z80 Bus (byte LSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_has_bus=0; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); } else { - //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_has_bus=1; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); } @@ -2359,13 +2359,13 @@ static WRITE16_HANDLER( megadriv_68k_req_z80_bus ) { if (data & 0x0100) { - //logerror("%06x: 68000 request z80 Bus (word access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 request z80 Bus (word access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_has_bus=0; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, ASSERT_LINE); } else { - //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 return z80 Bus (byte LSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_has_bus=1; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_HALT, CLEAR_LINE); } @@ -2378,13 +2378,13 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset ) { if (data & 0x0100) { - //logerror("%06x: 68000 clear z80 reset (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 clear z80 reset (byte MSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_is_reset=0; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE); } else { - //logerror("%06x: 68000 start z80 reset (byte MSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 start z80 reset (byte MSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_is_reset=1; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); sndti_reset(SOUND_YM2612, 0); @@ -2394,13 +2394,13 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset ) { if (data & 0x0001) { - //logerror("%06x: 68000 clear z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 clear z80 reset (byte LSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_is_reset=0; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE); } else { - //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_is_reset=1; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); sndti_reset(SOUND_YM2612, 0); @@ -2411,13 +2411,13 @@ static WRITE16_HANDLER ( megadriv_68k_req_z80_reset ) { if (data & 0x0100) { - //logerror("%06x: 68000 clear z80 reset (word access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 clear z80 reset (word access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_is_reset=0; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, CLEAR_LINE ); } else { - //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", activecpu_get_pc(),data,mem_mask); + //logerror("%06x: 68000 start z80 reset (byte LSB access) %04x %04x\n", cpu_get_pc(machine->activecpu),data,mem_mask); genz80.z80_is_reset=1; cpunum_set_input_line(machine, genz80.z80_cpunum, INPUT_LINE_RESET, ASSERT_LINE); sndti_reset(SOUND_YM2612, 0); @@ -3645,7 +3645,7 @@ static UINT32 pm_io(running_machine *machine, int reg, int write, UINT32 d) svp.emu_status &= ~SSP_PMC_HAVE_ADDR; } - if (reg == 4 || (activecpu_get_reg(SSP_ST) & 0x60)) + if (reg == 4 || (cpu_get_reg(machine->activecpu, SSP_ST) & 0x60)) { #define CADDR ((((mode<<16)&0x7f0000)|addr)<<1) UINT16 *dram = (UINT16 *)svp.dram; @@ -6489,7 +6489,7 @@ static void megadriv_init_common(running_machine *machine) vdp_get_word_from_68k_mem = vdp_get_word_from_68k_mem_default; - cpunum_set_info_fct(0, CPUINFO_PTR_M68K_TAS_CALLBACK, (void *)megadriv_tas_callback); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M68K_TAS_CALLBACK, (void *)megadriv_tas_callback); if ((machine->gamedrv->ipt==ipt_megadri6) || (machine->gamedrv->ipt==ipt_ssf2ghw)) { @@ -6703,8 +6703,8 @@ DRIVER_INIT( _32x ) _32x_240mode = 0; // checking if these help brutal, they don't. - cpunum_set_info_int(2, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_COMPATIBLE_OPTIONS); - cpunum_set_info_int(3, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_COMPATIBLE_OPTIONS); + cpu_set_info_int(machine->cpu[2], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_COMPATIBLE_OPTIONS); + cpu_set_info_int(machine->cpu[3], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_COMPATIBLE_OPTIONS); DRIVER_INIT_CALL(megadriv); } diff --git a/src/mame/drivers/megaplay.c b/src/mame/drivers/megaplay.c index a02ee03928a..71b79d6ec11 100644 --- a/src/mame/drivers/megaplay.c +++ b/src/mame/drivers/megaplay.c @@ -517,7 +517,7 @@ static READ16_HANDLER ( OLD_megaplay_genesis_io_r ) static WRITE16_HANDLER ( OLD_megaplay_genesis_io_w ) { -// logerror ("write io offset :%02x data %04x PC: 0x%06x\n",offset,data,activecpu_get_previouspc()); +// logerror ("write io offset :%02x data %04x PC: 0x%06x\n",offset,data,cpu_get_previouspc(machine->activecpu)); switch (offset) { @@ -681,7 +681,7 @@ static WRITE8_HANDLER( megaplay_game_w ) bios_mode = MP_GAME; readpos = 1; // popmessage("Game bank selected: 0x%03x",game_banksel); - logerror("BIOS [0x%04x]: 68K address space bank selected: 0x%03x\n",activecpu_get_previouspc(),game_banksel); + logerror("BIOS [0x%04x]: 68K address space bank selected: 0x%03x\n",cpu_get_previouspc(machine->activecpu),game_banksel); } } diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c index 9f40e604854..192685d8026 100644 --- a/src/mame/drivers/meritm.c +++ b/src/mame/drivers/meritm.c @@ -406,7 +406,7 @@ static void meritm_switch_banks( void ) static WRITE8_HANDLER(meritm_psd_a15_w) { meritm_psd_a15 = data; - //logerror( "Writing PSD_A15 with %02x at PC=%04X\n", data, activecpu_get_pc() ); + //logerror( "Writing PSD_A15 with %02x at PC=%04X\n", data, cpu_get_pc(machine->activecpu) ); meritm_switch_banks(); }; diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c index 4d8e89a0a5b..7bda3cb5e02 100644 --- a/src/mame/drivers/metro.c +++ b/src/mame/drivers/metro.c @@ -185,7 +185,7 @@ static void update_irq_state(running_machine *machine) /* For games that supply an *IRQ Vector* on the data bus */ static IRQ_CALLBACK(metro_irq_callback) { -// logerror("CPU #0 PC %06X: irq callback returns %04X\n",activecpu_get_pc(),metro_irq_vectors[int_level]); +// logerror("CPU #0 PC %06X: irq callback returns %04X\n",cpu_get_pc(machine->activecpu),metro_irq_vectors[int_level]); return metro_irq_vectors[irqline]&0xff; } @@ -198,7 +198,7 @@ static MACHINE_RESET( metro ) static WRITE16_HANDLER( metro_irq_cause_w ) { -//if (data & ~0x15) logerror("CPU #0 PC %06X : unknown bits of irqcause written: %04X\n",activecpu_get_pc(),data); +//if (data & ~0x15) logerror("CPU #0 PC %06X : unknown bits of irqcause written: %04X\n",cpu_get_pc(machine->activecpu),data); if (ACCESSING_BITS_0_7) { @@ -576,14 +576,14 @@ static WRITE16_HANDLER( metro_coin_lockout_1word_w ) // coin_lockout_w(0, data & 1); // coin_lockout_w(1, data & 2); } - if (data & ~3) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n",activecpu_get_pc(),data); + if (data & ~3) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n",cpu_get_pc(machine->activecpu),data); } static WRITE16_HANDLER( metro_coin_lockout_4words_w ) { // coin_lockout_w( (offset >> 1) & 1, offset & 1 ); - if (data & ~1) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n",activecpu_get_pc(),data); + if (data & ~1) logerror("CPU #0 PC %06X : unknown bits of coin lockout written: %04X\n",cpu_get_pc(machine->activecpu),data); } @@ -688,7 +688,7 @@ INLINE void blt_write(running_machine *machine, const int tmap, const offs_t off case 2: metro_vram_1_w(machine,offs,data,mask); break; case 3: metro_vram_2_w(machine,offs,data,mask); break; } -// logerror("CPU #0 PC %06X : Blitter %X] %04X <- %04X & %04X\n",activecpu_get_pc(),tmap,offs,data,mask); +// logerror("CPU #0 PC %06X : Blitter %X] %04X <- %04X & %04X\n",cpu_get_pc(machine->activecpu),tmap,offs,data,mask); } @@ -711,7 +711,7 @@ static WRITE16_HANDLER( metro_blitter_w ) int shift = (dst_offs & 0x80) ? 0 : 8; UINT16 mask = (dst_offs & 0x80) ? 0x00ff : 0xff00; -// logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n",activecpu_get_pc(),tmap,src_offs,dst_offs); +// logerror("CPU #0 PC %06X : Blitter regs %08X, %08X, %08X\n",cpu_get_pc(machine->activecpu),tmap,src_offs,dst_offs); dst_offs >>= 7+1; switch( tmap ) @@ -721,7 +721,7 @@ static WRITE16_HANDLER( metro_blitter_w ) case 3: break; default: - logerror("CPU #0 PC %06X : Blitter unknown destination: %08X\n",activecpu_get_pc(),tmap); + logerror("CPU #0 PC %06X : Blitter unknown destination: %08X\n",cpu_get_pc(machine->activecpu),tmap); return; } @@ -731,7 +731,7 @@ static WRITE16_HANDLER( metro_blitter_w ) src_offs %= src_len; b1 = blt_read(src,src_offs); -// logerror("CPU #0 PC %06X : Blitter opcode %02X at %06X\n",activecpu_get_pc(),b1,src_offs); +// logerror("CPU #0 PC %06X : Blitter opcode %02X at %06X\n",cpu_get_pc(machine->activecpu),b1,src_offs); src_offs++; count = ((~b1) & 0x3f) + 1; @@ -815,7 +815,7 @@ static WRITE16_HANDLER( metro_blitter_w ) default: - logerror("CPU #0 PC %06X : Blitter unknown opcode %02X at %06X\n",activecpu_get_pc(),b1,src_offs-1); + logerror("CPU #0 PC %06X : Blitter unknown opcode %02X at %06X\n",cpu_get_pc(machine->activecpu),b1,src_offs-1); return; } @@ -921,7 +921,7 @@ static READ16_HANDLER( balcube_dsw_r ) case 0x17FFE: return (dsw2 & 0x40) ? 0x40 : 0; case 0x0FFFE: return (dsw2 & 0x80) ? 0x40 : 0; } - logerror("CPU #0 PC %06X : unknown dsw address read: %04X\n",activecpu_get_pc(),offset); + logerror("CPU #0 PC %06X : unknown dsw address read: %04X\n",cpu_get_pc(machine->activecpu),offset); return 0xffff; } diff --git a/src/mame/drivers/micro3d.c b/src/mame/drivers/micro3d.c index 8a33f7cb852..f03ec7c1a3f 100644 --- a/src/mame/drivers/micro3d.c +++ b/src/mame/drivers/micro3d.c @@ -550,11 +550,11 @@ switch(offset) cpunum_set_input_line_and_vector(machine, 0,3, HOLD_LINE, M68681.IVR); // Generate an interrupt, if allowed. } cpunum_set_input_line(machine, 2, MCS51_RX_LINE, ASSERT_LINE); // Generate 8031 interrupt - mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,activecpu_get_pc()); + mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,cpu_get_pc(machine->activecpu)); #endif M68681.SRB &=~0x0400; // Data has been sent - TX ready for more. cpunum_set_input_line(machine, 2, MCS51_RX_LINE, ASSERT_LINE); // Generate 8031 interrupt - mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,activecpu_get_pc()); + mame_printf_debug("Sound board TX: %4X at PC=%4X\n",value,cpu_get_pc(machine->activecpu)); break; case 0x0c: //mame_printf_debug("IVR: %d",value); @@ -567,7 +567,7 @@ switch(offset) if(value & 0x20) { // cpunum_set_reset_line(2 CLEAR_LINE); - logerror("8031 running at:%x (val=%x).\n",activecpu_get_pc(),value); + logerror("8031 running at:%x (val=%x).\n",cpu_get_pc(machine->activecpu),value); } break; @@ -575,7 +575,7 @@ switch(offset) if(value & 0x20) { // cpunum_set_reset_line(2, ASSERT_LINE); - logerror("8031 reset at:%x (val=%x).\n",activecpu_get_pc(),value); + logerror("8031 reset at:%x (val=%x).\n",cpu_get_pc(machine->activecpu),value); } break; diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c index 30f0ead172b..41ff3e0b308 100644 --- a/src/mame/drivers/midvunit.c +++ b/src/mame/drivers/midvunit.c @@ -260,13 +260,13 @@ static READ32_HANDLER( tms32031_control_r ) /* timer is clocked at 100ns */ int which = (offset >> 4) & 1; INT32 result = attotime_to_double(attotime_mul(timer_timeelapsed(timer[which]), timer_rate)); -// logerror("%06X:tms32031_control_r(%02X) = %08X\n", activecpu_get_pc(), offset, result); +// logerror("%06X:tms32031_control_r(%02X) = %08X\n", cpu_get_pc(machine->activecpu), offset, result); return result; } /* log anything else except the memory control register */ if (offset != 0x64) - logerror("%06X:tms32031_control_r(%02X)\n", activecpu_get_pc(), offset); + logerror("%06X:tms32031_control_r(%02X)\n", cpu_get_pc(machine->activecpu), offset); return tms32031_control[offset]; } @@ -284,7 +284,7 @@ static WRITE32_HANDLER( tms32031_control_w ) else if (offset == 0x20 || offset == 0x30) { int which = (offset >> 4) & 1; -// logerror("%06X:tms32031_control_w(%02X) = %08X\n", activecpu_get_pc(), offset, data); +// logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(machine->activecpu), offset, data); if (data & 0x40) timer_adjust_oneshot(timer[which], attotime_never, 0); @@ -295,7 +295,7 @@ static WRITE32_HANDLER( tms32031_control_w ) timer_rate = 10000000.; } else - logerror("%06X:tms32031_control_w(%02X) = %08X\n", activecpu_get_pc(), offset, data); + logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -417,7 +417,7 @@ static READ32_HANDLER( midvplus_misc_r ) } if (offset != 0 && offset != 3) - logerror("%06X:midvplus_misc_r(%d) = %08X\n", activecpu_get_pc(), offset, result); + logerror("%06X:midvplus_misc_r(%d) = %08X\n", cpu_get_pc(machine->activecpu), offset, result); return result; } @@ -446,7 +446,7 @@ static WRITE32_HANDLER( midvplus_misc_w ) } if (logit) - logerror("%06X:midvplus_misc_w(%d) = %08X\n", activecpu_get_pc(), offset, data); + logerror("%06X:midvplus_misc_w(%d) = %08X\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -1524,7 +1524,7 @@ static READ32_HANDLER( generic_speedup_r ) static void init_crusnusa_common(running_machine *machine, offs_t speedup) { - dcs_init(); + dcs_init(machine); adc_shift = 24; /* speedups */ @@ -1537,7 +1537,7 @@ static DRIVER_INIT( crusnu21 ) { init_crusnusa_common(machine, 0xc051); } static void init_crusnwld_common(running_machine *machine, offs_t speedup) { - dcs_init(); + dcs_init(machine); adc_shift = 16; /* control register is different */ @@ -1565,7 +1565,7 @@ static DRIVER_INIT( crusnw13 ) { init_crusnwld_common(machine, 0); } static DRIVER_INIT( offroadc ) { - dcs_init(); + dcs_init(machine); adc_shift = 16; /* control register is different */ diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c index f1051516af6..fab3a01d30f 100644 --- a/src/mame/drivers/midzeus.c +++ b/src/mame/drivers/midzeus.c @@ -129,7 +129,7 @@ static WRITE32_HANDLER( cmos_w ) if (bitlatch[2] && !cmos_protected) COMBINE_DATA(&generic_nvram32[offset]); else - logerror("%06X:timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", activecpu_get_pc(), bitlatch[2], cmos_protected); + logerror("%06X:timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", cpu_get_pc(machine->activecpu), bitlatch[2], cmos_protected); cmos_protected = TRUE; } @@ -165,7 +165,7 @@ static WRITE32_DEVICE_HANDLER( zeus2_timekeeper_w ) if (bitlatch[2] && !cmos_protected) timekeeper_w(device, offset, data); else - logerror("%06X:zeus2_timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", activecpu_get_pc(), bitlatch[2], cmos_protected); + logerror("%06X:zeus2_timekeeper_w with bitlatch[2] = %d, cmos_protected = %d\n", cpu_get_pc(device->machine->activecpu), bitlatch[2], cmos_protected); cmos_protected = TRUE; } @@ -181,7 +181,7 @@ static WRITE32_HANDLER( zpram_w ) if (bitlatch[2]) COMBINE_DATA(&zpram[offset]); else - logerror("%06X:zpram_w with bitlatch[2] = %d\n", activecpu_get_pc(), bitlatch[2]); + logerror("%06X:zpram_w with bitlatch[2] = %d\n", cpu_get_pc(machine->activecpu), bitlatch[2]); } @@ -240,7 +240,7 @@ static READ32_HANDLER( bitlatches_r ) /* unknown purpose */ default: - logerror("%06X:bitlatches_r(%X)\n", activecpu_get_pc(), offset); + logerror("%06X:bitlatches_r(%X)\n", cpu_get_pc(machine->activecpu), offset); break; } return ~0; @@ -257,19 +257,19 @@ static WRITE32_HANDLER( bitlatches_w ) /* unknown purpose */ default: if (oldval ^ data) - logerror("%06X:bitlatches_w(%X) = %X\n", activecpu_get_pc(), offset, data); + logerror("%06X:bitlatches_w(%X) = %X\n", cpu_get_pc(machine->activecpu), offset, data); break; /* unknown purpose; crusnexo toggles this between 0 and 1 every 20 frames; thegrid writes 1 */ case 0: if (data != 0 && data != 1) - logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", activecpu_get_pc(), offset, data); + logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(machine->activecpu), offset, data); break; /* unknown purpose; mk4/invasn write 1 here at initialization; crusnexo/thegrid write 3 */ case 1: if (data != 1 && data != 3) - logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", activecpu_get_pc(), offset, data); + logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(machine->activecpu), offset, data); break; /* CMOS/ZPRAM extra enable latch; only low bit is used */ @@ -279,7 +279,7 @@ static WRITE32_HANDLER( bitlatches_w ) /* unknown purpose; invasn writes 2 here at startup */ case 4: if (data != 2) - logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", activecpu_get_pc(), offset, data); + logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(machine->activecpu), offset, data); break; /* ROM bank selection on Zeus 2 */ @@ -290,19 +290,19 @@ static WRITE32_HANDLER( bitlatches_w ) /* unknown purpose; crusnexo/thegrid write 1 at startup */ case 7: if (data != 1) - logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", activecpu_get_pc(), offset, data); + logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(machine->activecpu), offset, data); break; /* unknown purpose; crusnexo writes 4 at startup; thegrid writes 6 */ case 8: if (data != 4 && data != 6) - logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", activecpu_get_pc(), offset, data); + logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(machine->activecpu), offset, data); break; /* unknown purpose; thegrid writes 1 at startup */ case 9: if (data != 1) - logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", activecpu_get_pc(), offset, data); + logerror("%06X:bitlatches_w(%X) = %X (unexpected)\n", cpu_get_pc(machine->activecpu), offset, data); break; } } @@ -368,7 +368,7 @@ static WRITE32_HANDLER( crusnexo_leds_w ) static READ32_HANDLER( linkram_r ) { - logerror("%06X:unknown_8a000_r(%02X)\n", activecpu_get_pc(), offset); + logerror("%06X:unknown_8a000_r(%02X)\n", cpu_get_pc(machine->activecpu), offset); if (offset == 0) return 0x30313042; else if (offset == 0x3c) @@ -378,7 +378,7 @@ static READ32_HANDLER( linkram_r ) static WRITE32_HANDLER( linkram_w ) { - logerror("%06X:unknown_8a000_w(%02X) = %08X\n", activecpu_get_pc(), offset, data); + logerror("%06X:unknown_8a000_w(%02X) = %08X\n", cpu_get_pc(machine->activecpu), offset, data); COMBINE_DATA(&linkram[offset]); } @@ -403,7 +403,7 @@ static READ32_HANDLER( tms32031_control_r ) /* log anything else except the memory control register */ if (offset != 0x64) - logerror("%06X:tms32031_control_r(%02X)\n", activecpu_get_pc(), offset); + logerror("%06X:tms32031_control_r(%02X)\n", cpu_get_pc(machine->activecpu), offset); return tms32031_control[offset]; } @@ -425,7 +425,7 @@ static WRITE32_HANDLER( tms32031_control_w ) timer_adjust_oneshot(timer[which], attotime_never, 0); } else - logerror("%06X:tms32031_control_w(%02X) = %08X\n", activecpu_get_pc(), offset, data); + logerror("%06X:tms32031_control_w(%02X) = %08X\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -476,7 +476,7 @@ static READ32_HANDLER( analog_r ) { static const char * const tags[] = { "ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3" }; if (offset < 8 || offset > 11) - logerror("%06X:analog_r(%X)\n", activecpu_get_pc(), offset); + logerror("%06X:analog_r(%X)\n", cpu_get_pc(machine->activecpu), offset); return input_port_read(machine, tags[offset & 3]); } diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c index bfd256eabbe..9e0e32e6a97 100644 --- a/src/mame/drivers/mirax.c +++ b/src/mame/drivers/mirax.c @@ -101,7 +101,7 @@ static READ8_HANDLER(snd_read) static WRITE8_HANDLER(audio_w) { - if(activecpu_get_previouspc()==0x2fd) + if(cpu_get_previouspc(machine->activecpu)==0x2fd) { nAyCtrl=offset; nAyData=data; @@ -111,7 +111,7 @@ static WRITE8_HANDLER(audio_w) static WRITE8_HANDLER(ay1_sel) { - if(activecpu_get_previouspc()==0x309) + if(cpu_get_previouspc(machine->activecpu)==0x309) { ay8910_control_port_0_w(machine,0,nAyCtrl); ay8910_write_port_0_w(machine,0,nAyData); @@ -121,7 +121,7 @@ static WRITE8_HANDLER(ay1_sel) static WRITE8_HANDLER(ay2_sel) { - if(activecpu_get_previouspc()==0x309) + if(cpu_get_previouspc(machine->activecpu)==0x309) { ay8910_control_port_1_w(machine,0,nAyCtrl); ay8910_write_port_1_w(machine,0,nAyData); diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c index ccc2b381c4c..c139749e07c 100644 --- a/src/mame/drivers/missile.c +++ b/src/mame/drivers/missile.c @@ -510,9 +510,9 @@ static MACHINE_RESET( missile ) * *************************************/ -INLINE int get_madsel(void) +INLINE int get_madsel(running_machine *machine) { - UINT16 pc = activecpu_get_previouspc(); + UINT16 pc = cpu_get_previouspc(machine->activecpu); /* if we're at a different instruction than last time, reset our delay counter */ if (pc != madsel_lastpc) @@ -663,7 +663,7 @@ static VIDEO_UPDATE( missile ) static WRITE8_HANDLER( missile_w ) { /* if we're in MADSEL mode, write to video RAM */ - if (get_madsel()) + if (get_madsel(machine)) { write_vram(offset, data); return; @@ -712,7 +712,7 @@ static WRITE8_HANDLER( missile_w ) /* anything else */ else - logerror("%04X:Unknown write to %04X = %02X\n", activecpu_get_pc(), offset, data); + logerror("%04X:Unknown write to %04X = %02X\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -721,7 +721,7 @@ static READ8_HANDLER( missile_r ) UINT8 result = 0xff; /* if we're in MADSEL mode, read from video RAM */ - if (get_madsel()) + if (get_madsel(machine)) return read_vram(offset); /* otherwise, strip A15 and handle manually */ @@ -763,7 +763,7 @@ static READ8_HANDLER( missile_r ) /* anything else */ else - logerror("%04X:Unknown read from %04X\n", activecpu_get_pc(), offset); + logerror("%04X:Unknown read from %04X\n", cpu_get_pc(machine->activecpu), offset); return result; } diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c index 00c4c9badbc..6ba25d4e0d2 100644 --- a/src/mame/drivers/mitchell.c +++ b/src/mame/drivers/mitchell.c @@ -329,7 +329,7 @@ static WRITE8_HANDLER( input_w ) { case 0: default: -logerror("PC %04x: write %02x to port 01\n",activecpu_get_pc(),data); +logerror("PC %04x: write %02x to port 01\n",cpu_get_pc(machine->activecpu),data); break; case 1: mahjong_input_select_w(machine,offset,data); diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c index 5ef06869d39..b74f5924724 100644 --- a/src/mame/drivers/mjkjidai.c +++ b/src/mame/drivers/mjkjidai.c @@ -106,7 +106,7 @@ static READ8_HANDLER( keyboard_r ) int res = 0x3f,i; static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8", "KEY9", "KEY10", "KEY11" }; -// logerror("%04x: keyboard_r\n", activecpu_get_pc()); +// logerror("%04x: keyboard_r\n", cpu_get_pc(machine->activecpu)); for (i = 0; i < 12; i++) { @@ -130,7 +130,7 @@ static READ8_HANDLER( keyboard_r ) static WRITE8_HANDLER( keyboard_select_w ) { -// logerror("%04x: keyboard_select %d = %02x\n",activecpu_get_pc(),offset,data); +// logerror("%04x: keyboard_select %d = %02x\n",cpu_get_pc(machine->activecpu),offset,data); switch (offset) { diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c index 9afca03c7d4..c3a2551015a 100644 --- a/src/mame/drivers/mjsister.c +++ b/src/mame/drivers/mjsister.c @@ -93,7 +93,7 @@ static WRITE8_HANDLER( mjsister_banksel1_w ) case 0xf: mjsister_vrambank = 1 ; break; default: - logerror("%04x p30_w:%02x\n",activecpu_get_pc(),data); + logerror("%04x p30_w:%02x\n",cpu_get_pc(machine->activecpu),data); } if (tmp != mjsister_colorbank) @@ -115,7 +115,7 @@ static WRITE8_HANDLER( mjsister_banksel2_w ) case 0xd: rombank1 = 1; break; default: - logerror("%04x p31_w:%02x\n",activecpu_get_pc(),data); + logerror("%04x p31_w:%02x\n",cpu_get_pc(machine->activecpu),data); } memory_set_bankptr(1,&BANKROM[rombank0*0x10000+rombank1*0x8000]+0x10000); diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c index 2ef67dcf613..bf919edd269 100644 --- a/src/mame/drivers/mlanding.c +++ b/src/mame/drivers/mlanding.c @@ -80,7 +80,7 @@ static READ16_HANDLER( io1_r ) //240006 static WRITE16_HANDLER(ml_subreset_w) { //wrong - if(activecpu_get_pc()==0x822) + if(cpu_get_pc(machine->activecpu)==0x822) cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, PULSE_LINE); } diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c index eae0fb1a038..424de9d1201 100644 --- a/src/mame/drivers/model1.c +++ b/src/mame/drivers/model1.c @@ -783,7 +783,7 @@ static WRITE16_HANDLER(md1_w) if(0 && offset) return; if(1 && model1_dump) - logerror("TGP: md1_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, activecpu_get_pc()); + logerror("TGP: md1_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(machine->activecpu)); } static WRITE16_HANDLER(md0_w) @@ -792,7 +792,7 @@ static WRITE16_HANDLER(md0_w) if(0 && offset) return; if(1 && model1_dump) - logerror("TGP: md0_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, activecpu_get_pc()); + logerror("TGP: md0_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(machine->activecpu)); } static WRITE16_HANDLER(p_w) @@ -800,7 +800,7 @@ static WRITE16_HANDLER(p_w) UINT16 old = paletteram16[offset]; paletteram16_xBBBBBGGGGGRRRRR_word_w(machine, offset, data, mem_mask); if(0 && paletteram16[offset] != old) - logerror("XVIDEO: p_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, activecpu_get_pc()); + logerror("XVIDEO: p_w %x, %04x @ %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(machine->activecpu)); } static UINT16 *mr; @@ -808,7 +808,7 @@ static WRITE16_HANDLER(mr_w) { COMBINE_DATA(mr+offset); if(0 && offset == 0x1138/2) - logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x500000, data, mem_mask, activecpu_get_pc()); + logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x500000, data, mem_mask, cpu_get_pc(machine->activecpu)); } static UINT16 *mr2; @@ -817,28 +817,28 @@ static WRITE16_HANDLER(mr2_w) COMBINE_DATA(mr2+offset); #if 0 if(0 && offset == 0x6e8/2) { - logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x400000, data, mem_mask, activecpu_get_pc()); + logerror("MR.w %x, %04x @ %04x (%x)\n", offset*2+0x400000, data, mem_mask, cpu_get_pc(machine->activecpu)); } if(offset/2 == 0x3680/4) - logerror("MW f80[r25], %04x%04x (%x)\n", mr2[0x3680/2+1], mr2[0x3680/2], activecpu_get_pc()); + logerror("MW f80[r25], %04x%04x (%x)\n", mr2[0x3680/2+1], mr2[0x3680/2], cpu_get_pc(machine->activecpu)); if(offset/2 == 0x06ca/4) - logerror("MW fca[r19], %04x%04x (%x)\n", mr2[0x06ca/2+1], mr2[0x06ca/2], activecpu_get_pc()); + logerror("MW fca[r19], %04x%04x (%x)\n", mr2[0x06ca/2+1], mr2[0x06ca/2], cpu_get_pc(machine->activecpu)); if(offset/2 == 0x1eca/4) - logerror("MW fca[r22], %04x%04x (%x)\n", mr2[0x1eca/2+1], mr2[0x1eca/2], activecpu_get_pc()); + logerror("MW fca[r22], %04x%04x (%x)\n", mr2[0x1eca/2+1], mr2[0x1eca/2], cpu_get_pc(machine->activecpu)); #endif // wingwar scene position, pc=e1ce -> d735 if(offset/2 == 0x1f08/4) - logerror("MW 8[r10], %f (%x)\n", *(float *)(mr2+0x1f08/2), activecpu_get_pc()); + logerror("MW 8[r10], %f (%x)\n", *(float *)(mr2+0x1f08/2), cpu_get_pc(machine->activecpu)); if(offset/2 == 0x1f0c/4) - logerror("MW c[r10], %f (%x)\n", *(float *)(mr2+0x1f0c/2), activecpu_get_pc()); + logerror("MW c[r10], %f (%x)\n", *(float *)(mr2+0x1f0c/2), cpu_get_pc(machine->activecpu)); if(offset/2 == 0x1f10/4) - logerror("MW 10[r10], %f (%x)\n", *(float *)(mr2+0x1f10/2), activecpu_get_pc()); + logerror("MW 10[r10], %f (%x)\n", *(float *)(mr2+0x1f10/2), cpu_get_pc(machine->activecpu)); } static READ16_HANDLER( snd_68k_ready_r ) { - int sr = cpunum_get_reg(1, M68K_SR); + int sr = cpu_get_reg(machine->cpu[1], M68K_SR); if ((sr & 0x0700) > 0x0100) { diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c index 5b876dc9e55..10bd414469a 100644 --- a/src/mame/drivers/model2.c +++ b/src/mame/drivers/model2.c @@ -100,7 +100,7 @@ static int copro_fifoin_pop(UINT32 *result) if (dsp_type == DSP_TYPE_TGP) return 0; - fatalerror("Copro FIFOIN underflow (at %08X)", activecpu_get_pc()); + fatalerror("Copro FIFOIN underflow (at %08X)", cpu_get_pc(Machine->activecpu)); return 0; } @@ -116,15 +116,15 @@ static int copro_fifoin_pop(UINT32 *result) { if (copro_fifoin_num == 0) { - cpuintrf_push_context(2); + cpu_push_context(Machine->cpu[2]); sharc_set_flag_input(0, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } else { - cpuintrf_push_context(2); + cpu_push_context(Machine->cpu[2]); sharc_set_flag_input(0, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } } @@ -137,11 +137,11 @@ static void copro_fifoin_push(UINT32 data) { if (copro_fifoin_num == COPRO_FIFOIN_SIZE) { - fatalerror("Copro FIFOIN overflow (at %08X)", activecpu_get_pc()); + fatalerror("Copro FIFOIN overflow (at %08X)", cpu_get_pc(Machine->activecpu)); return; } - //mame_printf_debug("COPRO FIFOIN at %08X, %08X, %f\n", activecpu_get_pc(), data, *(float*)&data); + //mame_printf_debug("COPRO FIFOIN at %08X, %08X, %f\n", cpu_get_pc(Machine->activecpu), data, *(float*)&data); copro_fifoin_data[copro_fifoin_wpos++] = data; if (copro_fifoin_wpos == COPRO_FIFOIN_SIZE) @@ -154,9 +154,9 @@ static void copro_fifoin_push(UINT32 data) // clear FIFO empty flag on SHARC if (dsp_type == DSP_TYPE_SHARC) { - cpuintrf_push_context(2); + cpu_push_context(Machine->cpu[2]); sharc_set_flag_input(0, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } } @@ -196,15 +196,15 @@ static UINT32 copro_fifoout_pop(void) { if (copro_fifoout_num == COPRO_FIFOOUT_SIZE) { - cpuintrf_push_context(2); + cpu_push_context(Machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } else { - cpuintrf_push_context(2); + cpu_push_context(Machine->cpu[2]); sharc_set_flag_input(1, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } } @@ -216,7 +216,7 @@ static void copro_fifoout_push(UINT32 data) //if (copro_fifoout_wpos == copro_fifoout_rpos) if (copro_fifoout_num == COPRO_FIFOOUT_SIZE) { - fatalerror("Copro FIFOOUT overflow (at %08X)", activecpu_get_pc()); + fatalerror("Copro FIFOOUT overflow (at %08X)", cpu_get_pc(Machine->activecpu)); return; } @@ -235,17 +235,17 @@ static void copro_fifoout_push(UINT32 data) { if (copro_fifoout_num == COPRO_FIFOOUT_SIZE) { - cpuintrf_push_context(2); + cpu_push_context(Machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); } else { - cpuintrf_push_context(2); + cpu_push_context(Machine->cpu[2]); sharc_set_flag_input(1, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); //cpunum_set_input_line(Machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE); } @@ -570,9 +570,9 @@ static WRITE32_HANDLER(copro_fifo_w) { if (dsp_type == DSP_TYPE_SHARC) { - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_external_dma_write(model2_coprocnt, data & 0xffff); - cpuintrf_pop_context(); + cpu_pop_context(); } else if (dsp_type == DSP_TYPE_TGP) { @@ -583,7 +583,7 @@ static WRITE32_HANDLER(copro_fifo_w) } else { - //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); copro_fifoin_push(data); } } @@ -597,9 +597,9 @@ static WRITE32_HANDLER(copro_sharc_iop_w) (strcmp(machine->gamedrv->name, "vstriker" ) == 0) || (strcmp(machine->gamedrv->name, "gunblade" ) == 0)) { - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_external_iop_write(offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } else { @@ -610,9 +610,9 @@ static WRITE32_HANDLER(copro_sharc_iop_w) else { iop_data |= (data & 0xffff) << 16; - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_external_iop_write(offset, iop_data); - cpuintrf_pop_context(); + cpu_pop_context(); } iop_write_num++; } @@ -687,15 +687,15 @@ static WRITE32_HANDLER(geo_sharc_fifo_w) { if (model2_geoctl & 0x80000000) { - cpuintrf_push_context(3); + cpu_push_context(machine->cpu[3]); sharc_external_dma_write(model2_geocnt, data & 0xffff); - cpuintrf_pop_context(); + cpu_pop_context(); model2_geocnt++; } else { - //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); } } @@ -705,9 +705,9 @@ static WRITE32_HANDLER(geo_sharc_iop_w) { if ((strcmp(machine->gamedrv->name, "schamp" ) == 0)) { - cpuintrf_push_context(3); + cpu_push_context(machine->cpu[3]); sharc_external_iop_write(offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } else { @@ -718,9 +718,9 @@ static WRITE32_HANDLER(geo_sharc_iop_w) else { geo_iop_data |= (data & 0xffff) << 16; - cpuintrf_push_context(3); + cpu_push_context(machine->cpu[3]); sharc_external_iop_write(offset, geo_iop_data); - cpuintrf_pop_context(); + cpu_pop_context(); } geo_iop_write_num++; } @@ -767,7 +767,7 @@ static READ32_HANDLER( geo_r ) } // fatalerror("geo_r: %08X, %08X\n", address, mem_mask); - mame_printf_debug("geo_r: PC:%08x - %08X\n", safe_activecpu_get_pc(), address); + mame_printf_debug("geo_r: PC:%08x - %08X\n", safe_cpu_get_pc(machine->activecpu), address); return 0; } @@ -901,7 +901,7 @@ static int to_68k; static int snd_68k_ready_r(void) { - int sr = cpunum_get_reg(1, M68K_SR); + int sr = cpu_get_reg(Machine->cpu[1], M68K_SR); if ((sr & 0x0700) > 0x0100) { @@ -1005,7 +1005,7 @@ static READ32_HANDLER( model2_prot_r ) else return 0xfff0; } - else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, activecpu_get_pc()); + else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); return retval; } @@ -1075,7 +1075,7 @@ static WRITE32_HANDLER( model2_prot_w ) strcpy((char *)protram, " TECMO LTD. DEAD OR ALIVE 1996.10.22 VER. 1.00"); } } - else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, activecpu_get_pc()); + else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); } @@ -1744,7 +1744,7 @@ static const scsp_interface scsp_config = static READ32_HANDLER(copro_sharc_input_fifo_r) { UINT32 result; - //mame_printf_debug("SHARC FIFOIN pop at %08X\n", activecpu_get_pc()); + //mame_printf_debug("SHARC FIFOIN pop at %08X\n", cpu_get_pc(machine->activecpu)); copro_fifoin_pop(&result); return result; @@ -1763,7 +1763,7 @@ static READ32_HANDLER(copro_sharc_buffer_r) static WRITE32_HANDLER(copro_sharc_buffer_w) { - //mame_printf_debug("sharc_buffer_w: %08X at %08X, %08X, %f\n", offset, activecpu_get_pc(), data, *(float*)&data); + //mame_printf_debug("sharc_buffer_w: %08X at %08X, %08X, %f\n", offset, cpu_get_pc(machine->activecpu), data, *(float*)&data); model2_bufferram[offset & 0x7fff] = data; } diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c index 641a1f592c9..c9e1cbb2b0f 100644 --- a/src/mame/drivers/model3.c +++ b/src/mame/drivers/model3.c @@ -895,7 +895,7 @@ static void real3d_dma_callback(UINT32 src, UINT32 dst, int length, int byteswap case 0x9c: /* Unknown */ break; default: - fatalerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, activecpu_get_pc()); + fatalerror("dma_callback: %08X, %08X, %d at %08X", src, dst, length, cpu_get_pc(Machine->activecpu)); break; } } @@ -978,14 +978,14 @@ static void model3_exit(running_machine *machine) static void configure_fast_ram(running_machine *machine) { /* set conservative DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_END, 0x007fffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_READONLY, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x007fffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); } static MACHINE_START(model3_10) @@ -1200,7 +1200,7 @@ static WRITE64_HANDLER( model3_ctrl_w ) } break; default: - //mame_printf_debug("Lightgun: Unknown command %02X at %08X\n", (UINT32)(data >> 24), activecpu_get_pc()); + //mame_printf_debug("Lightgun: Unknown command %02X at %08X\n", (UINT32)(data >> 24), cpu_get_pc(machine->activecpu)); break; } } @@ -1354,14 +1354,14 @@ static WRITE64_HANDLER(model3_sound_w) static UINT64 network_ram[0x10000]; static READ64_HANDLER(network_r) { - mame_printf_debug("network_r: %02X at %08X\n", offset, activecpu_get_pc()); + mame_printf_debug("network_r: %02X at %08X\n", offset, cpu_get_pc(machine->activecpu)); return network_ram[offset]; } static WRITE64_HANDLER(network_w) { COMBINE_DATA(network_ram + offset); - mame_printf_debug("network_w: %02X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), activecpu_get_pc()); + mame_printf_debug("network_w: %02X, %08X%08X at %08X\n", offset, (UINT32)(data >> 32), (UINT32)(data), cpu_get_pc(machine->activecpu)); } static int prot_data_ptr = 0; diff --git a/src/mame/drivers/mole.c b/src/mame/drivers/mole.c index 2847807ca83..5bd39aa3e29 100644 --- a/src/mame/drivers/mole.c +++ b/src/mame/drivers/mole.c @@ -81,7 +81,7 @@ static READ8_HANDLER( mole_protection_r ) { case 0x08: return 0xb0; /* random mole placement */ case 0x26: - if (activecpu_get_pc() == 0x53d7) + if (cpu_get_pc(machine->activecpu) == 0x53d7) { return 0x06; /* bonus round */ } diff --git a/src/mame/drivers/mosaic.c b/src/mame/drivers/mosaic.c index 710dec61269..afc2768c111 100644 --- a/src/mame/drivers/mosaic.c +++ b/src/mame/drivers/mosaic.c @@ -51,7 +51,7 @@ static READ8_HANDLER( protection_r ) { int res = (prot_val >> 8) & 0xff; - logerror("%06x: protection_r %02x\n",activecpu_get_pc(),res); + logerror("%06x: protection_r %02x\n",cpu_get_pc(machine->activecpu),res); prot_val <<= 8; @@ -60,7 +60,7 @@ static READ8_HANDLER( protection_r ) static WRITE8_HANDLER( gfire2_protection_w ) { - logerror("%06x: protection_w %02x\n",activecpu_get_pc(),data); + logerror("%06x: protection_w %02x\n",cpu_get_pc(machine->activecpu),data); switch(data) { diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c index 9f650d08530..24c3427a946 100644 --- a/src/mame/drivers/mpu4.c +++ b/src/mame/drivers/mpu4.c @@ -518,7 +518,7 @@ static const ptm6840_interface ptm_ic2_intf = /* IC3, lamp data lines + alpha numeric display */ static WRITE8_HANDLER( pia_ic3_porta_w ) { - LOG_IC3(("%04x IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", activecpu_get_previouspc(),data)); + LOG_IC3(("%04x IC3 PIA Port A Set to %2x (lamp strobes 1 - 9)\n", cpu_get_previouspc(machine->activecpu),data)); if(ic23_active) { @@ -530,7 +530,7 @@ static WRITE8_HANDLER( pia_ic3_porta_w ) static WRITE8_HANDLER( pia_ic3_portb_w ) { - LOG_IC3(("%04x IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", activecpu_get_previouspc(),data)); + LOG_IC3(("%04x IC3 PIA Port B Set to %2x (lamp strobes 10 - 17)\n", cpu_get_previouspc(machine->activecpu),data)); if(ic23_active) { @@ -542,7 +542,7 @@ static WRITE8_HANDLER( pia_ic3_portb_w ) static WRITE8_HANDLER( pia_ic3_ca2_w ) { - LOG_IC3(("%04x IC3 PIA Write CA2 (alpha data), %02X\n", activecpu_get_previouspc(),data)); + LOG_IC3(("%04x IC3 PIA Write CA2 (alpha data), %02X\n", cpu_get_previouspc(machine->activecpu),data)); alpha_data_line = data; ROC10937_draw_16seg(0); @@ -551,7 +551,7 @@ static WRITE8_HANDLER( pia_ic3_ca2_w ) static WRITE8_HANDLER( pia_ic3_cb2_w ) { - LOG_IC3(("%04x IC3 PIA Write CB (alpha reset), %02X\n",activecpu_get_previouspc(),data)); + LOG_IC3(("%04x IC3 PIA Write CB (alpha reset), %02X\n",cpu_get_previouspc(machine->activecpu),data)); if ( data ) ROC10937_reset(0); ROC10937_draw_16seg(0); @@ -679,14 +679,14 @@ static READ8_HANDLER( pia_ic4_portb_r ) if ( lamp_undercurrent ) ic4_input_b |= 0x01; #endif - LOG_IC3(("%04x IC4 PIA Read of Port B %x\n",activecpu_get_previouspc(),ic4_input_b)); + LOG_IC3(("%04x IC4 PIA Read of Port B %x\n",cpu_get_previouspc(machine->activecpu),ic4_input_b)); return ic4_input_b; } static WRITE8_HANDLER( pia_ic4_ca2_w ) { - LOG_IC3(("%04x IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", activecpu_get_previouspc(),data)); + LOG_IC3(("%04x IC4 PIA Write CA (input MUX strobe /LED B), %02X\n", cpu_get_previouspc(machine->activecpu),data)); IC23GB = data; ic23_update(); @@ -704,14 +704,14 @@ static const pia6821_interface pia_ic4_intf = /* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */ static READ8_HANDLER( pia_ic5_porta_r ) { - LOG(("%04x IC5 PIA Read of Port A (AUX1)\n",activecpu_get_previouspc())); + LOG(("%04x IC5 PIA Read of Port A (AUX1)\n",cpu_get_previouspc(machine->activecpu))); return input_port_read(machine, "AUX1"); } static READ8_HANDLER( pia_ic5_portb_r ) { - LOG(("%04x IC5 PIA Read of Port B (coin input AUX2)\n",activecpu_get_previouspc())); + LOG(("%04x IC5 PIA Read of Port B (coin input AUX2)\n",cpu_get_previouspc(machine->activecpu))); coin_lockout_w(0, (pia_get_output_b(2) & 0x01) ); coin_lockout_w(1, (pia_get_output_b(2) & 0x02) ); coin_lockout_w(2, (pia_get_output_b(2) & 0x04) ); @@ -722,7 +722,7 @@ static READ8_HANDLER( pia_ic5_portb_r ) static WRITE8_HANDLER( pia_ic5_ca2_w ) { - LOG(("%04x IC5 PIA Write CA2 (Serial Tx) %2x\n",activecpu_get_previouspc(),data)); + LOG(("%04x IC5 PIA Write CA2 (Serial Tx) %2x\n",cpu_get_previouspc(machine->activecpu),data)); serial_data = data; } @@ -805,7 +805,7 @@ static const pia6821_interface pia_ic5_intf = /* IC6, Reel A and B and AY registers (MODs below 4 only) */ static WRITE8_HANDLER( pia_ic6_portb_w ) { - LOG(("%04x IC6 PIA Port B Set to %2x (Reel A and B)\n", activecpu_get_previouspc(),data)); + LOG(("%04x IC6 PIA Port B Set to %2x (Reel A and B)\n", cpu_get_previouspc(machine->activecpu),data)); stepper_update(0, data & 0x0F ); stepper_update(1, (data>>4) & 0x0F ); @@ -824,7 +824,7 @@ static WRITE8_HANDLER( pia_ic6_portb_w ) static WRITE8_HANDLER( pia_ic6_porta_w ) { - LOG(("%04x IC6 PIA Write A %2x\n", activecpu_get_previouspc(),data)); + LOG(("%04x IC6 PIA Write A %2x\n", cpu_get_previouspc(machine->activecpu),data)); if (mod_number <4) { ay_data = data; @@ -835,7 +835,7 @@ static WRITE8_HANDLER( pia_ic6_porta_w ) static WRITE8_HANDLER( pia_ic6_ca2_w ) { - LOG(("%04x IC6 PIA write CA2 %2x (AY8913 BC1)\n", activecpu_get_previouspc(),data)); + LOG(("%04x IC6 PIA write CA2 %2x (AY8913 BC1)\n", cpu_get_previouspc(machine->activecpu),data)); if (mod_number <4) { if ( data ) ay8913_address |= 0x01; @@ -847,7 +847,7 @@ static WRITE8_HANDLER( pia_ic6_ca2_w ) static WRITE8_HANDLER( pia_ic6_cb2_w ) { - LOG(("%04x IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", activecpu_get_previouspc(),data)); + LOG(("%04x IC6 PIA write CB2 %2x (AY8913 BCDIR)\n", cpu_get_previouspc(machine->activecpu),data)); if (mod_number <4) { if ( data ) ay8913_address |= 0x02; @@ -868,7 +868,7 @@ static const pia6821_interface pia_ic6_intf = /* IC7 Reel C and D, mechanical meters/Reel E and F, input strobe bit A */ static WRITE8_HANDLER( pia_ic7_porta_w ) { - LOG(("%04x IC7 PIA Port A Set to %2x (Reel C and D)\n", activecpu_get_previouspc(),data)); + LOG(("%04x IC7 PIA Port A Set to %2x (Reel C and D)\n", cpu_get_previouspc(machine->activecpu),data)); stepper_update(2, data & 0x0F ); stepper_update(3, (data >> 4)& 0x0F ); @@ -910,13 +910,13 @@ all eight meters are driven from this port, giving the 8 line driver chip pia_set_input_b(4, mmtr_data &~0x80); } - LOG(("%04x IC7 PIA Port B Set to %2x (Meters, Reel E and F)\n", activecpu_get_previouspc(),data)); + LOG(("%04x IC7 PIA Port B Set to %2x (Meters, Reel E and F)\n", cpu_get_previouspc(machine->activecpu),data)); } static WRITE8_HANDLER( pia_ic7_ca2_w ) { - LOG(("%04x IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", activecpu_get_previouspc(),data)); + LOG(("%04x IC7 PIA write CA2 %2x (input strobe bit 0 / LED A)\n", cpu_get_previouspc(machine->activecpu),data)); IC23GA = data; ic24_setup(); @@ -934,7 +934,7 @@ is on PB7. */ pia_set_input_b(4,mmtr_data|0x80); Mechmtr_update(7, cycles, data ); } - LOG(("%04x IC7 PIA write CB2 %2x \n", activecpu_get_previouspc(),data)); + LOG(("%04x IC7 PIA write CB2 %2x \n", cpu_get_previouspc(machine->activecpu),data)); } @@ -951,7 +951,7 @@ static READ8_HANDLER( pia_ic8_porta_r ) { static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" }; - LOG_IC8(("%04x IC8 PIA Read of Port A (MUX input data)\n", activecpu_get_previouspc())); + LOG_IC8(("%04x IC8 PIA Read of Port A (MUX input data)\n", cpu_get_previouspc(machine->activecpu))); /* The orange inputs are polled twice as often as the black ones, for reasons of efficiency. This is achieved via connecting every input line to an AND gate, thus allowing two strobes to represent each orange input bank (strobes are active low). */ @@ -963,7 +963,7 @@ static READ8_HANDLER( pia_ic8_porta_r ) static WRITE8_HANDLER( pia_ic8_portb_w ) { int i; - LOG_IC8(("%04x IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", activecpu_get_previouspc(),data)); + LOG_IC8(("%04x IC8 PIA Port B Set to %2x (OUTPUT PORT, TRIACS)\n", cpu_get_previouspc(machine->activecpu),data)); for (i = 0; i < 8; i++) if ( data & (1 << i) ) output_set_indexed_value("triac", i, data & (1 << i)); } @@ -971,7 +971,7 @@ static WRITE8_HANDLER( pia_ic8_portb_w ) static WRITE8_HANDLER( pia_ic8_ca2_w ) { - LOG_IC8(("%04x IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", activecpu_get_previouspc(), data & 0xFF)); + LOG_IC8(("%04x IC8 PIA write CA2 (input_strobe bit 2 / LED C) %02X\n", cpu_get_previouspc(machine->activecpu), data & 0xFF)); IC23GC = data; ic23_update(); @@ -980,7 +980,7 @@ static WRITE8_HANDLER( pia_ic8_ca2_w ) static WRITE8_HANDLER( pia_ic8_cb2_w ) { - LOG_IC8(("%04x IC8 PIA write CB2 (alpha clock) %02X\n", activecpu_get_previouspc(), data & 0xFF)); + LOG_IC8(("%04x IC8 PIA write CB2 (alpha clock) %02X\n", cpu_get_previouspc(machine->activecpu), data & 0xFF)); if ( !alpha_clock && (data) ) { @@ -1311,7 +1311,7 @@ static WRITE8_HANDLER( characteriser_w ) { UINT8 x; int call=data; - LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", activecpu_get_previouspc(),offset,data)); + LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(machine->activecpu),offset,data)); if (offset == 0) { if (call == 0) @@ -1355,7 +1355,7 @@ static WRITE8_HANDLER( characteriser_w ) static READ8_HANDLER( characteriser_r ) { LOG_CHR(("Characteriser read offset %02X \n",offset)); - LOG_CHR_FULL(("%04x Characteriser read offset %02X", activecpu_get_previouspc(),offset)); + LOG_CHR_FULL(("%04x Characteriser read offset %02X", cpu_get_previouspc(machine->activecpu),offset)); if (offset == 0) { LOG_CHR(("Characteriser read data %02X \n",MPU4_chr_data[prot_col])); diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c index 20c1de33d39..305f9a23fb9 100644 --- a/src/mame/drivers/mpu4drvr.c +++ b/src/mame/drivers/mpu4drvr.c @@ -920,19 +920,19 @@ static READ16_HANDLER( mpu4_vid_scn2674_r ) */ case 0: - LOGSTUFF(("Read Irq Register %06x\n",activecpu_get_pc())); + LOGSTUFF(("Read Irq Register %06x\n",cpu_get_pc(machine->activecpu))); return scn2674_irq_register; case 1: - LOGSTUFF(("Read Status Register %06x\n",activecpu_get_pc())); + LOGSTUFF(("Read Status Register %06x\n",cpu_get_pc(machine->activecpu))); return scn2674_status_register; - case 2: LOGSTUFF(("Read Screen1_l Register %06x\n",activecpu_get_pc()));return scn2674_screen1_l; - case 3: LOGSTUFF(("Read Screen1_h Register %06x\n",activecpu_get_pc()));return scn2674_screen1_h; - case 4: LOGSTUFF(("Read Cursor_l Register %06x\n",activecpu_get_pc()));return scn2674_cursor_l; - case 5: LOGSTUFF(("Read Cursor_h Register %06x\n",activecpu_get_pc()));return scn2674_cursor_h; - case 6: LOGSTUFF(("Read Screen2_l Register %06x\n",activecpu_get_pc()));return scn2674_screen2_l; - case 7: LOGSTUFF(("Read Screen2_h Register %06x\n",activecpu_get_pc()));return scn2674_screen2_h; + case 2: LOGSTUFF(("Read Screen1_l Register %06x\n",cpu_get_pc(machine->activecpu)));return scn2674_screen1_l; + case 3: LOGSTUFF(("Read Screen1_h Register %06x\n",cpu_get_pc(machine->activecpu)));return scn2674_screen1_h; + case 4: LOGSTUFF(("Read Cursor_l Register %06x\n",cpu_get_pc(machine->activecpu)));return scn2674_cursor_l; + case 5: LOGSTUFF(("Read Cursor_h Register %06x\n",cpu_get_pc(machine->activecpu)));return scn2674_cursor_h; + case 6: LOGSTUFF(("Read Screen2_l Register %06x\n",cpu_get_pc(machine->activecpu)));return scn2674_screen2_l; + case 7: LOGSTUFF(("Read Screen2_h Register %06x\n",cpu_get_pc(machine->activecpu)));return scn2674_screen2_h; } return 0xffff; @@ -1388,7 +1388,7 @@ static WRITE16_HANDLER( characteriser16_w ) { int x; int call=data; - LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", activecpu_get_previouspc(),offset,data)); + LOG_CHR_FULL(("%04x Characteriser write offset %02X data %02X", cpu_get_previouspc(machine->activecpu),offset,data)); for (x = prot_col; x < 64; x++) { if (call == 0) @@ -1410,7 +1410,7 @@ static WRITE16_HANDLER( characteriser16_w ) static READ16_HANDLER( characteriser16_r ) { - LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", activecpu_get_previouspc(),offset,MPU4_chr_data[prot_col])); + LOG_CHR_FULL(("%04x Characteriser read offset %02X,data %02X", cpu_get_previouspc(machine->activecpu),offset,MPU4_chr_data[prot_col])); LOG_CHR(("Characteriser read offset %02X \n",offset)); LOG_CHR(("Characteriser read data %02X \n",MPU4_chr_data[prot_col])); return MPU4_chr_data[prot_col]; diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c index bbc8058ec85..14f17dbfd0f 100644 --- a/src/mame/drivers/mquake.c +++ b/src/mame/drivers/mquake.c @@ -69,14 +69,14 @@ static void mquake_cia_0_porta_w(UINT8 data) static UINT8 mquake_cia_0_portb_r(void) { /* parallel port */ - logerror("%06x:CIA0_portb_r\n", activecpu_get_pc()); + logerror("%06x:CIA0_portb_r\n", cpu_get_pc(Machine->activecpu)); return 0xff; } static void mquake_cia_0_portb_w(UINT8 data) { /* parallel port */ - logerror("%06x:CIA0_portb_w(%02x)\n", activecpu_get_pc(), data); + logerror("%06x:CIA0_portb_w(%02x)\n", cpu_get_pc(Machine->activecpu), data); } @@ -118,7 +118,7 @@ static WRITE16_HANDLER( es5503_word_lsb_w ) static WRITE16_HANDLER( output_w ) { if (ACCESSING_BITS_0_7) - logerror("%06x:output_w(%x) = %02x\n", activecpu_get_pc(), offset, data); + logerror("%06x:output_w(%x) = %02x\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -126,13 +126,13 @@ static READ16_HANDLER( coin_chip_r ) { if (offset == 1) return input_port_read(machine, "COINCHIP"); - logerror("%06x:coin_chip_r(%02x) & %04x\n", activecpu_get_pc(), offset, mem_mask); + logerror("%06x:coin_chip_r(%02x) & %04x\n", cpu_get_pc(machine->activecpu), offset, mem_mask); return 0xffff; } static WRITE16_HANDLER( coin_chip_w ) { - logerror("%06x:coin_chip_w(%02x) = %04x & %04x\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06x:coin_chip_w(%02x) = %04x & %04x\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } // inputs at 282000, 282002 (full word) diff --git a/src/mame/drivers/mrdo.c b/src/mame/drivers/mrdo.c index ae0d1fdefb9..35b60b51b57 100644 --- a/src/mame/drivers/mrdo.c +++ b/src/mame/drivers/mrdo.c @@ -34,7 +34,7 @@ VIDEO_UPDATE( mrdo ); static READ8_HANDLER( mrdo_SECRE_r ) { UINT8 *RAM = memory_region(machine, "main"); - return RAM[ activecpu_get_reg(Z80_HL) ]; + return RAM[ cpu_get_reg(machine->activecpu, Z80_HL) ]; } diff --git a/src/mame/drivers/msisaac.c b/src/mame/drivers/msisaac.c index b3ef58e7b6f..2171aa230d6 100644 --- a/src/mame/drivers/msisaac.c +++ b/src/mame/drivers/msisaac.c @@ -175,7 +175,7 @@ MCU simulation TODO: break; default: - logerror("CPU#0 read from MCU pc=%4x, mcu_val=%2x\n", activecpu_get_pc(), mcu_val ); + logerror("CPU#0 read from MCU pc=%4x, mcu_val=%2x\n", cpu_get_pc(machine->activecpu), mcu_val ); return mcu_val; break; } @@ -197,7 +197,7 @@ static WRITE8_HANDLER( msisaac_mcu_w ) buggychl_mcu_w(offset,data); #else //if(data != 0x0a && data != 0x42 && data != 0x02) - // popmessage("PC = %04x %02x",activecpu_get_pc(),data); + // popmessage("PC = %04x %02x",cpu_get_pc(machine->activecpu),data); mcu_val = data; #endif } diff --git a/src/mame/drivers/mw8080bw.c b/src/mame/drivers/mw8080bw.c index 884777e5086..c4a0d1c35ff 100644 --- a/src/mame/drivers/mw8080bw.c +++ b/src/mame/drivers/mw8080bw.c @@ -2084,7 +2084,7 @@ static WRITE8_HANDLER( spcenctr_io_w ) spcenctr_trench_width = data; /* - - - - - 1 1 1 */ else - logerror("%04x: Unmapped I/O port write to %02x = %02x\n", activecpu_get_pc(), offset, data); + logerror("%04x: Unmapped I/O port write to %02x = %02x\n", cpu_get_pc(machine->activecpu), offset, data); } diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c index 447bbdfa6a6..151335cb108 100644 --- a/src/mame/drivers/mystwarr.c +++ b/src/mame/drivers/mystwarr.c @@ -377,7 +377,7 @@ static WRITE16_HANDLER( K053247_scattered_word_w ) { if (offset & 0x0078) { -// mame_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, activecpu_get_pc()); +// mame_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, cpu_get_pc(machine->activecpu)); COMBINE_DATA(spriteram16+offset); } else diff --git a/src/mame/drivers/namcona1.c b/src/mame/drivers/namcona1.c index d664e58fedc..235f21c32e1 100644 --- a/src/mame/drivers/namcona1.c +++ b/src/mame/drivers/namcona1.c @@ -639,7 +639,7 @@ static void namcona1_blit( running_machine *machine ) (void)src0; /* logerror( "0x%08x: blt(%08x,%08x,numBytes=%04x);src=%04x %04x %04x; dst=%04x %04x %04x; gfx=%04x\n", - activecpu_get_pc(), + cpu_get_pc(machine->activecpu), dst_baseaddr,src_baseaddr,num_bytes, src0,src1,src2, dst0,dst1,dst2, @@ -789,7 +789,7 @@ static READ16_HANDLER( na1mcu_shared_r ) #if 0 if (offset >= 0x70000/2) { - logerror("MD: %04x @ %x PC %x\n", ((data>>8)&0xff) | ((data<<8)&0xff00), offset*2, activecpu_get_pc()); + logerror("MD: %04x @ %x PC %x\n", ((data>>8)&0xff) | ((data<<8)&0xff00), offset*2, cpu_get_pc(machine->activecpu)); } #endif @@ -843,7 +843,7 @@ static WRITE8_HANDLER( port4_w ) { if ((data & 0x08) && !(mcu_port4 & 0x08)) { - logerror("launching 68k, PC=%x\n", activecpu_get_pc()); + logerror("launching 68k, PC=%x\n", cpu_get_pc(machine->activecpu)); // reset and launch the 68k cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE); diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c index 77a378beaad..98f86468755 100644 --- a/src/mame/drivers/namconb1.c +++ b/src/mame/drivers/namconb1.c @@ -730,7 +730,7 @@ static READ32_HANDLER( custom_key_r ) break; /* no protection? */ } - logerror( "custom_key_r(%d); pc=%08x\n", offset, activecpu_get_pc() ); + logerror( "custom_key_r(%d); pc=%08x\n", offset, cpu_get_pc(machine->activecpu) ); return 0; } /* custom_key_r */ diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c index 819e9a3433d..8c1aff901f8 100644 --- a/src/mame/drivers/namcos1.c +++ b/src/mame/drivers/namcos1.c @@ -358,12 +358,12 @@ static WRITE8_HANDLER( namcos1_sub_firq_w ) static WRITE8_HANDLER( irq_ack_w ) { - cpunum_set_input_line(machine, cpu_getactivecpu(), 0, CLEAR_LINE); + cpunum_set_input_line(machine, cpunum_get_active(), 0, CLEAR_LINE); } static WRITE8_HANDLER( firq_ack_w ) { - cpunum_set_input_line(machine, cpu_getactivecpu(), M6809_FIRQ_LINE, CLEAR_LINE); + cpunum_set_input_line(machine, cpunum_get_active(), M6809_FIRQ_LINE, CLEAR_LINE); } diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c index 5073bed2dde..0af6f72d176 100644 --- a/src/mame/drivers/namcos11.c +++ b/src/mame/drivers/namcos11.c @@ -281,7 +281,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - logerror( "%02x:%08x: %s", cpu_getactivecpu(), safe_activecpu_get_pc(), buf ); + logerror( "%02x:%08x: %s", cpunum_get_active(), safe_cpu_get_pc(Machine->activecpu), buf ); } } diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c index c1457bbe78c..992b55ce04d 100644 --- a/src/mame/drivers/namcos12.c +++ b/src/mame/drivers/namcos12.c @@ -940,9 +940,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/mame/drivers/namcos21.c b/src/mame/drivers/namcos21.c index 3095fadaf0d..2b8a60be1b8 100644 --- a/src/mame/drivers/namcos21.c +++ b/src/mame/drivers/namcos21.c @@ -375,20 +375,20 @@ static READ16_HANDLER(dspcuskey_r) UINT16 result = 0; if( namcos2_gametype == NAMCOS21_SOLVALOU ) { - switch( activecpu_get_pc() ) + switch( cpu_get_pc(machine->activecpu) ) { case 0x805e: result = 0x0000; break; case 0x805f: result = 0xfeba; break; case 0x8067: result = 0xffff; break; case 0x806e: result = 0x0145; break; default: - logerror( "unk cuskey_r; pc=0x%x\n", activecpu_get_pc() ); + logerror( "unk cuskey_r; pc=0x%x\n", cpu_get_pc(machine->activecpu) ); break; } } else if( namcos2_gametype == NAMCOS21_CYBERSLED ) { - switch( activecpu_get_pc() ) + switch( cpu_get_pc(machine->activecpu) ) { case 0x8061: result = 0xfe95; break; case 0x8069: result = 0xffff; break; @@ -399,7 +399,7 @@ static READ16_HANDLER(dspcuskey_r) } else if( namcos2_gametype == NAMCOS21_AIRCOMBAT ) { - switch( activecpu_get_pc() ) + switch( cpu_get_pc(machine->activecpu) ) { case 0x8062: result = 0xfeb9; break; case 0x806a: result = 0xffff; break; @@ -569,7 +569,7 @@ ReadWordFromSlaveInput( void ) { mpDspState->slaveBytesAdvertised--; } - logerror( "-%04x(0x%04x) %x\n", data, mpDspState->slaveBytesAvailable, activecpu_get_pc() ); + logerror( "-%04x(0x%04x) %x\n", data, mpDspState->slaveBytesAvailable, cpu_get_pc(Machine->activecpu) ); } return data; } /* ReadWordFromSlaveInput */ @@ -607,7 +607,7 @@ static WRITE16_HANDLER( dspram16_w ) } else if( namcos2_gametype == NAMCOS21_SOLVALOU && offset == 0x103 && - cpu_getactivecpu()==0 ) + cpunum_get_active()==0 ) { /* hack; synchronization for solvalou */ cpu_yield(); } @@ -914,7 +914,7 @@ static WRITE16_HANDLER(slave_port3_w) static WRITE16_HANDLER( slave_XF_output_w ) { - logerror( "0x%x:slaveXF(%d)\n", activecpu_get_pc(), data ); + logerror( "0x%x:slaveXF(%d)\n", cpu_get_pc(machine->activecpu), data ); } /* slave_XF_output_w */ static READ16_HANDLER( slave_portf_r ) @@ -968,8 +968,8 @@ static WRITE16_HANDLER( pointram_control_w ) /* pointram_control&0x20 : bank for depthcue data */ /* logerror( "dsp_control_w:%x:%x[%x]:=%04x ", - cpu_getactivecpu(), - activecpu_get_pc(), + cpunum_get_active(), + cpu_get_pc(machine->activecpu), offset, pointram_control ); @@ -1152,7 +1152,7 @@ static WRITE16_HANDLER( winrun_dspcomram_w ) static READ16_HANDLER( winrun_cuskey_r ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(machine->activecpu); switch( pc ) { case 0x0064: /* winrun91 */ diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c index 16af5759e6a..2a019a75f71 100644 --- a/src/mame/drivers/namcos22.c +++ b/src/mame/drivers/namcos22.c @@ -1629,7 +1629,7 @@ static WRITE16_HANDLER( upload_code_to_slave_dsp_w ) else { logerror( "%08x: master port#7: 0x%04x\n", - activecpu_get_previouspc(), data ); + cpu_get_previouspc(machine->activecpu), data ); } break; @@ -2119,7 +2119,7 @@ static WRITE32_HANDLER( namcos22_system_controller_w ) if(offs<4 || offs>=8) { mame_printf_debug( "%08x: sys[0x%02x] := 0x%02x\n", - activecpu_get_previouspc(), + cpu_get_previouspc(machine->activecpu), offs, dat>>24 ); } @@ -2386,12 +2386,12 @@ static WRITE32_HANDLER( alpinesa_prot_w ) } #else int i; - unsigned sptr = activecpu_get_sp(); + unsigned sptr = cpu_get_sp(machine->activecpu); mAlpineSurferProtData = 0; for(i=0;i<4;i++) { mAlpineSurferProtData<<=8; - mAlpineSurferProtData |= cpunum_read_byte( 0, sptr+4+i ); + mAlpineSurferProtData |= cpu_read_byte(machine->cpu[0], sptr+4+i ); } #endif } /* alpinesa_prot_w */ @@ -5055,7 +5055,7 @@ static UINT16 su_82; // for MCU BIOS v1.41 static READ16_HANDLER( mcu141_speedup_r ) { - if ((activecpu_get_pc() == 0xc12d) && (!(su_82 & 0xff00))) + if ((cpu_get_pc(machine->activecpu) == 0xc12d) && (!(su_82 & 0xff00))) { cpu_spinuntil_int(); } @@ -5071,7 +5071,7 @@ static WRITE16_HANDLER( mcu_speedup_w ) // for MCU BIOS v1.30 static READ16_HANDLER( mcu130_speedup_r ) { - if ((activecpu_get_pc() == 0xc12a) && (!(su_82 & 0xff00))) + if ((cpu_get_pc(machine->activecpu) == 0xc12a) && (!(su_82 & 0xff00))) { cpu_spinuntil_int(); } @@ -5082,7 +5082,7 @@ static READ16_HANDLER( mcu130_speedup_r ) // for NSTX7702 v1.00 (C74) static READ16_HANDLER( mcuc74_speedup_r ) { - if (((activecpu_get_pc() == 0xc0df) || (activecpu_get_pc() == 0xc101)) && (!(su_82 & 0xff00))) + if (((cpu_get_pc(machine->activecpu) == 0xc0df) || (cpu_get_pc(machine->activecpu) == 0xc101)) && (!(su_82 & 0xff00))) { cpu_spinuntil_int(); } diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index fed4b105d8f..ea5642a4537 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -788,7 +788,7 @@ static READ64_HANDLER( naomi_rom_board_r ) } else { - mame_printf_verbose("ROM: read mask %llx @ %x (PC=%x)\n", mem_mask, offset, activecpu_get_pc()); + mame_printf_verbose("ROM: read mask %llx @ %x (PC=%x)\n", mem_mask, offset, cpu_get_pc(machine->activecpu)); } return U64(0xffffffffffffffff); @@ -825,7 +825,7 @@ static WRITE64_HANDLER( naomi_rom_board_w ) { // ROM_DATA // Doa2 writes here (16 bit decryption key ?) - mame_printf_verbose("ROM: write %llx to 5f7008 (PC=%x)\n", data, activecpu_get_pc()); + mame_printf_verbose("ROM: write %llx to 5f7008 (PC=%x)\n", data, cpu_get_pc(machine->activecpu)); } else if ((offset == 15) && ACCESSING_BITS_0_15) { @@ -862,7 +862,7 @@ static WRITE64_HANDLER( naomi_rom_board_w ) } else { - mame_printf_verbose("ROM: write %llx to %x, mask %llx (PC=%x)\n", data, offset, mem_mask, activecpu_get_pc()); + mame_printf_verbose("ROM: write %llx to %x, mask %llx (PC=%x)\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); } } diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c index cf68b504dab..1670bf683fb 100644 --- a/src/mame/drivers/naughtyb.c +++ b/src/mame/drivers/naughtyb.c @@ -150,16 +150,16 @@ static READ8_HANDLER( popflame_protection_r ) /* Not used by bootleg/hack */ return values[count]; #if 0 - if ( activecpu_get_pc() == (0x26F2 + 0x03) ) + if ( cpu_get_pc(machine->activecpu) == (0x26F2 + 0x03) ) { popflame_prot_count = 0; return 0x01; } /* Must not carry when rotated left */ - if ( activecpu_get_pc() == (0x26F9 + 0x03) ) + if ( cpu_get_pc(machine->activecpu) == (0x26F9 + 0x03) ) return 0x80; /* Must carry when rotated left */ - if ( activecpu_get_pc() == (0x270F + 0x03) ) + if ( cpu_get_pc(machine->activecpu) == (0x270F + 0x03) ) { switch( popflame_prot_count++ ) { @@ -169,7 +169,7 @@ static READ8_HANDLER( popflame_protection_r ) /* Not used by bootleg/hack */ case 3: return 0x38; /* x011 1xxx, matches 0x07 at $2693, stored in $400D */ } } - logerror("CPU #0 PC %06x: unmapped protection read\n", activecpu_get_pc()); + logerror("CPU #0 PC %06x: unmapped protection read\n", cpu_get_pc(machine->activecpu)); return 0x00; #endif } diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c index 87ad1b1b737..228e3132046 100644 --- a/src/mame/drivers/nbmj9195.c +++ b/src/mame/drivers/nbmj9195.c @@ -239,7 +239,7 @@ static int tmpz84c011_pio_r(running_machine *machine, int offset) break; default: - logerror("PC %04X: TMPZ84C011_PIO Unknown Port Read %02X\n", activecpu_get_pc(), offset); + logerror("PC %04X: TMPZ84C011_PIO Unknown Port Read %02X\n", cpu_get_pc(machine->activecpu), offset); portdata = 0xff; break; } @@ -324,7 +324,7 @@ static int tmpz84c011_pio_r(running_machine *machine, int offset) break; default: - logerror("PC %04X: TMPZ84C011_PIO Unknown Port Read %02X\n", activecpu_get_pc(), offset); + logerror("PC %04X: TMPZ84C011_PIO Unknown Port Read %02X\n", cpu_get_pc(machine->activecpu), offset); portdata = 0xff; break; } @@ -372,7 +372,7 @@ static void tmpz84c011_pio_w(running_machine *machine, int offset, int data) break; default: - logerror("PC %04X: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", activecpu_get_pc(), offset, data); + logerror("PC %04X: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", cpu_get_pc(machine->activecpu), offset, data); break; } } @@ -410,7 +410,7 @@ static void tmpz84c011_pio_w(running_machine *machine, int offset, int data) break; default: - logerror("PC %04X: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", activecpu_get_pc(), offset, data); + logerror("PC %04X: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", cpu_get_pc(machine->activecpu), offset, data); break; } } diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c index cb6e6cc812e..d55b474ea9b 100644 --- a/src/mame/drivers/neogeo.c +++ b/src/mame/drivers/neogeo.c @@ -140,7 +140,7 @@ static UINT8 led2_value; *************************************/ static void calendar_clock(void); -static void set_output_latch(UINT8 data); +static void set_output_latch(running_machine *machine, UINT8 data); static void set_output_data(UINT8 data); @@ -175,11 +175,11 @@ void neogeo_set_display_position_interrupt_control(UINT16 data) } -void neogeo_set_display_counter_msb(UINT16 data) +void neogeo_set_display_counter_msb(running_machine *machine, UINT16 data) { display_counter = (display_counter & 0x0000ffff) | ((UINT32)data << 16); - if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", activecpu_get_pc(), display_counter); + if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(machine->activecpu), display_counter); } @@ -187,7 +187,7 @@ void neogeo_set_display_counter_lsb(running_machine *machine, UINT16 data) { display_counter = (display_counter & 0xffff0000) | data; - if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", activecpu_get_pc(), display_counter); + if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(machine->activecpu), display_counter); if (display_position_interrupt_control & IRQ2CTRL_LOAD_RELATIVE) { @@ -356,7 +356,7 @@ static WRITE16_HANDLER( io_control_w ) switch (offset) { case 0x00: select_controller(data & 0x00ff); break; - case 0x18: set_output_latch(data & 0x00ff); break; + case 0x18: set_output_latch(machine, data & 0x00ff); break; case 0x20: set_output_data(data & 0x00ff); break; case 0x28: pd4990a_control_16_w(machine, 0, data, mem_mask); break; // case 0x30: break; // coin counters @@ -365,7 +365,7 @@ static WRITE16_HANDLER( io_control_w ) // case 0x33: break; // coui lockout default: - logerror("PC: %x Unmapped I/O control write. Offset: %x Data: %x\n", activecpu_get_pc(), offset, data); + logerror("PC: %x Unmapped I/O control write. Offset: %x Data: %x\n", cpu_get_pc(machine->activecpu), offset, data); break; } } @@ -392,7 +392,7 @@ READ16_HANDLER( neogeo_unmapped_r ) else { recurse = 1; - ret = program_read_word(activecpu_get_pc()); + ret = program_read_word(cpu_get_pc(machine->activecpu)); recurse = 0; } @@ -561,7 +561,7 @@ static WRITE16_HANDLER( audio_command_w ) /* boost the interleave to let the audio CPU read the command */ cpu_boost_interleave(machine, attotime_zero, ATTOTIME_IN_USEC(50)); - if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", activecpu_get_pc(), data, mem_mask); + if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", cpu_get_pc(machine->activecpu), data, mem_mask); } } @@ -570,7 +570,7 @@ static READ8_HANDLER( audio_command_r ) { UINT8 ret = soundlatch_r(machine, 0); - if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", activecpu_get_pc(), ret); + if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", cpu_get_pc(machine->activecpu), ret); /* this is a guess */ audio_cpu_clear_nmi_w(machine, 0, 0); @@ -581,7 +581,7 @@ static READ8_HANDLER( audio_command_r ) static WRITE8_HANDLER( audio_result_w ) { - if (LOG_CPU_COMM && (audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", activecpu_get_pc(), data); + if (LOG_CPU_COMM && (audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", cpu_get_pc(machine->activecpu), data); audio_result = data; } @@ -591,7 +591,7 @@ static CUSTOM_INPUT( get_audio_result ) { UINT32 ret = audio_result; -// if (LOG_CPU_COMM && (cpu_getactivecpu() >= 0)) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", activecpu_get_pc(), ret); +// if (LOG_CPU_COMM && (cpunum_get_active() >= 0)) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(machine->activecpu), ret); return ret; } @@ -626,7 +626,7 @@ static void _set_main_cpu_bank_address(running_machine *machine) void neogeo_set_main_cpu_bank_address(running_machine *machine, UINT32 bank_address) { - if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", safe_activecpu_get_pc(), bank_address); + if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", safe_cpu_get_pc(machine->activecpu), bank_address); main_cpu_bank_address = bank_address; @@ -640,14 +640,14 @@ static WRITE16_HANDLER( main_cpu_bank_select_w ) UINT32 len = memory_region_length(machine, "main"); if ((len <= 0x100000) && (data & 0x07)) - logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", activecpu_get_pc(), data); + logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", cpu_get_pc(machine->activecpu), data); else { bank_address = ((data & 0x07) + 1) * 0x100000; if (bank_address >= len) { - logerror("PC %06x: warning: bankswitch to empty bank %02x\n", activecpu_get_pc(), data); + logerror("PC %06x: warning: bankswitch to empty bank %02x\n", cpu_get_pc(machine->activecpu), data); bank_address = 0x100000; } @@ -686,9 +686,9 @@ static void set_audio_cpu_banking(void) } -static void audio_cpu_bank_select(int region, UINT8 bank) +static void audio_cpu_bank_select(running_machine *machine, int region, UINT8 bank) { - if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", safe_activecpu_get_pc(), region, bank); + if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", safe_cpu_get_pc(machine->activecpu), region, bank); audio_cpu_banks[region] = bank; @@ -698,7 +698,7 @@ static void audio_cpu_bank_select(int region, UINT8 bank) static READ8_HANDLER( audio_cpu_bank_select_f000_f7ff_r ) { - audio_cpu_bank_select(0, offset >> 8); + audio_cpu_bank_select(machine, 0, offset >> 8); return 0; } @@ -706,7 +706,7 @@ static READ8_HANDLER( audio_cpu_bank_select_f000_f7ff_r ) static READ8_HANDLER( audio_cpu_bank_select_e000_efff_r ) { - audio_cpu_bank_select(1, offset >> 8); + audio_cpu_bank_select(machine, 1, offset >> 8); return 0; } @@ -714,7 +714,7 @@ static READ8_HANDLER( audio_cpu_bank_select_e000_efff_r ) static READ8_HANDLER( audio_cpu_bank_select_c000_dfff_r ) { - audio_cpu_bank_select(2, offset >> 8); + audio_cpu_bank_select(machine, 2, offset >> 8); return 0; } @@ -722,7 +722,7 @@ static READ8_HANDLER( audio_cpu_bank_select_c000_dfff_r ) static READ8_HANDLER( audio_cpu_bank_select_8000_bfff_r ) { - audio_cpu_bank_select(3, offset >> 8); + audio_cpu_bank_select(machine, 3, offset >> 8); return 0; } @@ -742,7 +742,7 @@ static void _set_audio_cpu_rom_source(running_machine *machine) cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, PULSE_LINE); - if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", safe_activecpu_get_pc(), audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); + if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", safe_cpu_get_pc(machine->activecpu), audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); } } @@ -821,11 +821,11 @@ static WRITE16_HANDLER( system_control_w ) case 0x02: /* unknown - HC32 middle pin 1 */ case 0x03: /* unknown - uPD4990 pin ? */ case 0x04: /* unknown - HC32 middle pin 10 */ - logerror("PC: %x Unmapped system control write. Offset: %x Data: %x\n", safe_activecpu_get_pc(), offset & 0x07, bit); + logerror("PC: %x Unmapped system control write. Offset: %x Data: %x\n", safe_cpu_get_pc(machine->activecpu), offset & 0x07, bit); break; } - if (LOG_VIDEO_SYSTEM && ((offset & 0x07) != 0x06)) logerror("PC: %x System control write. Offset: %x Data: %x\n", safe_activecpu_get_pc(), offset & 0x07, bit); + if (LOG_VIDEO_SYSTEM && ((offset & 0x07) != 0x06)) logerror("PC: %x System control write. Offset: %x Data: %x\n", safe_cpu_get_pc(machine->activecpu), offset & 0x07, bit); } } @@ -900,7 +900,7 @@ static void set_outputs(void) } -static void set_output_latch(UINT8 data) +static void set_output_latch(running_machine *machine, UINT8 data) { /* looks like the LEDs are set on the falling edge */ @@ -916,7 +916,7 @@ static void set_output_latch(UINT8 data) led2_value = ~output_data; if (falling_bits & 0xc7) - logerror("PC: %x Unmaped LED write. Data: %x\n", activecpu_get_pc(), falling_bits); + logerror("PC: %x Unmaped LED write. Data: %x\n", cpu_get_pc(machine->activecpu), falling_bits); output_latch = data; diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c index b8da7bb92a2..09eecc16473 100644 --- a/src/mame/drivers/ninjaw.c +++ b/src/mame/drivers/ninjaw.c @@ -224,7 +224,7 @@ static WRITE16_HANDLER( cpua_ctrl_w ) parse_control(machine); - logerror("CPU #0 PC %06x: write %04x to cpu control\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(machine->activecpu),data); } diff --git a/src/mame/drivers/niyanpai.c b/src/mame/drivers/niyanpai.c index b2e5bb78439..be3d5aee854 100644 --- a/src/mame/drivers/niyanpai.c +++ b/src/mame/drivers/niyanpai.c @@ -106,7 +106,7 @@ static int tmpz84c011_pio_r(running_machine *machine, int offset) break; default: - logerror("PC %04X: TMPZ84C011_PIO Unknown Port Read %02X\n", activecpu_get_pc(), offset); + logerror("PC %04X: TMPZ84C011_PIO Unknown Port Read %02X\n", cpu_get_pc(machine->activecpu), offset); portdata = 0xff; break; } @@ -134,7 +134,7 @@ static void tmpz84c011_pio_w(running_machine *machine, int offset, int data) break; default: - logerror("PC %04X: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", activecpu_get_pc(), offset, data); + logerror("PC %04X: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", cpu_get_pc(machine->activecpu), offset, data); break; } } diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c index 7b441c97af4..64f39dc295d 100644 --- a/src/mame/drivers/nmk16.c +++ b/src/mame/drivers/nmk16.c @@ -246,7 +246,7 @@ static WRITE8_HANDLER ( ssmissin_soundbank_w ) static WRITE16_HANDLER( tharrier_mcu_control_w ) { -// logerror("%04x: mcu_control_w %02x\n",activecpu_get_pc(),data); +// logerror("%04x: mcu_control_w %02x\n",cpu_get_pc(machine->activecpu),data); } static READ16_HANDLER( tharrier_mcu_r ) @@ -263,8 +263,8 @@ static READ16_HANDLER( tharrier_mcu_r ) int res; - if (activecpu_get_pc()==0x8aa) res = (nmk16_mainram[0x9064/2])|0x20; /* Task Force Harrier */ - else if (activecpu_get_pc()==0x8ce) res = (nmk16_mainram[0x9064/2])|0x60; /* Task Force Harrier */ + if (cpu_get_pc(machine->activecpu)==0x8aa) res = (nmk16_mainram[0x9064/2])|0x20; /* Task Force Harrier */ + else if (cpu_get_pc(machine->activecpu)==0x8ce) res = (nmk16_mainram[0x9064/2])|0x60; /* Task Force Harrier */ else { res = to_main[prot_count++]; @@ -4633,7 +4633,7 @@ static WRITE16_HANDLER( twinactn_flipscreen_w ) flip_screen_set(data & 1); if (data & (~1)) - logerror("%06x: unknown flip screen bit written %04x\n", activecpu_get_pc(), data); + logerror("%06x: unknown flip screen bit written %04x\n", cpu_get_pc(machine->activecpu), data); } #endif @@ -4679,9 +4679,9 @@ static WRITE8_HANDLER( twinactn_oki_bank_w ) okim6295_set_bank_base(0, (data & 3) * 0x40000); if (data & (~3)) - logerror("%04x: invalid oki bank %02x\n", activecpu_get_pc(), data); + logerror("%04x: invalid oki bank %02x\n", cpu_get_pc(machine->activecpu), data); -// logerror("%04x: oki bank %02x\n", activecpu_get_pc(), data); +// logerror("%04x: oki bank %02x\n", cpu_get_pc(machine->activecpu), data); } static ADDRESS_MAP_START( twinactn_sound_cpu, ADDRESS_SPACE_PROGRAM, 8 ) diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c index 2f80bd7382e..aebec3acb71 100644 --- a/src/mame/drivers/nwk-tr.c +++ b/src/mame/drivers/nwk-tr.c @@ -685,7 +685,7 @@ WRITE32_HANDLER(K001604_reg_w) if (offset != 0x08 && offset != 0x09 && offset != 0x0a /*&& offset != 0x17 && offset != 0x18*/) { - //printf("K001604_reg_w (%d), %02X, %08X, %08X at %08X\n", chip, offset, data, mem_mask, activecpu_get_pc()); + //printf("K001604_reg_w (%d), %02X, %08X, %08X at %08X\n", chip, offset, data, mem_mask, cpu_get_pc(machine->activecpu)); } } @@ -853,7 +853,7 @@ static READ32_HANDLER( lanc1_r ) default: { - //printf("lanc1_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + //printf("lanc1_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); return 0xffffffff; } } @@ -861,7 +861,7 @@ static READ32_HANDLER( lanc1_r ) static WRITE32_HANDLER( lanc1_w ) { - //printf("lanc1_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + //printf("lanc1_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); } static READ32_HANDLER( lanc2_r ) @@ -889,7 +889,7 @@ static READ32_HANDLER( lanc2_r ) } } - //printf("lanc2_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + //printf("lanc2_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); return r; } @@ -913,7 +913,7 @@ static WRITE32_HANDLER( lanc2_w ) fpga_uploaded = 1; - //printf("lanc2_fpga_w: %02X at %08X\n", value, activecpu_get_pc()); + //printf("lanc2_fpga_w: %02X at %08X\n", value, cpu_get_pc(machine->activecpu)); } else if (ACCESSING_BITS_0_7) { @@ -922,7 +922,7 @@ static WRITE32_HANDLER( lanc2_w ) } else { - //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); } } if (offset == 4) @@ -941,7 +941,7 @@ static WRITE32_HANDLER( lanc2_w ) } } - //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + //printf("lanc2_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); } /*****************************************************************************/ @@ -949,14 +949,14 @@ static WRITE32_HANDLER( lanc2_w ) static MACHINE_START( nwktr ) { /* set conservative DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_END, 0x003fffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_READONLY, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x003fffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, work_ram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); } static ADDRESS_MAP_START( nwktr_map, ADDRESS_SPACE_PROGRAM, 32 ) @@ -1161,8 +1161,8 @@ static DRIVER_INIT(nwktr) K056800_init(sound_irq_callback); K033906_init(); -// cpunum_set_info_fct(0, CPUINFO_PTR_SPU_TX_HANDLER, (genf *)jamma_jvs_w); -// cpunum_set_info_fct(0, CPUINFO_PTR_SPU_RX_HANDLER, (genf *)jamma_jvs_r); +// cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_SPU_TX_HANDLER, (genf *)jamma_jvs_w); +// cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_SPU_RX_HANDLER, (genf *)jamma_jvs_r); adc1213x_init(0, adc12138_input_callback); lanc2_init(); diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c index ac2611f1ac1..cb227bc66a9 100644 --- a/src/mame/drivers/nyny.c +++ b/src/mame/drivers/nyny.c @@ -445,7 +445,7 @@ static WRITE8_HANDLER( nyny_ay8910_37_port_a_w ) { /* not sure what this does */ - /*logerror("%x PORT A write %x at Y=%x X=%x\n", safe_activecpu_get_pc(), data, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen));*/ + /*logerror("%x PORT A write %x at Y=%x X=%x\n", safe_cpu_get_pc(machine->activecpu), data, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen));*/ } diff --git a/src/mame/drivers/offtwall.c b/src/mame/drivers/offtwall.c index 3449d184e44..8f192476d89 100644 --- a/src/mame/drivers/offtwall.c +++ b/src/mame/drivers/offtwall.c @@ -154,11 +154,11 @@ static READ16_HANDLER( bankswitch_r ) static READ16_HANDLER( bankrom_r ) { /* this is the banked ROM read */ - logerror("%06X: %04X\n", activecpu_get_previouspc(), offset); + logerror("%06X: %04X\n", cpu_get_previouspc(machine->activecpu), offset); /* if the values are $3e000 or $3e002 are being read by code just below the ROM bank area, we need to return the correct value to give the proper checksum */ - if ((offset == 0x3000 || offset == 0x3001) && activecpu_get_previouspc() > 0x37000) + if ((offset == 0x3000 || offset == 0x3001) && cpu_get_previouspc(machine->activecpu) > 0x37000) { UINT32 checksum = (program_read_word(0x3fd210) << 16) | program_read_word(0x3fd212); UINT32 us = 0xaaaa5555 - checksum; @@ -195,7 +195,7 @@ static UINT16 *spritecache_count; static READ16_HANDLER( spritecache_count_r ) { - int prevpc = activecpu_get_previouspc(); + int prevpc = cpu_get_previouspc(machine->activecpu); /* if this read is coming from $99f8 or $9992, it's in the sprite copy loop */ if (prevpc == 0x99f8 || prevpc == 0x9992) @@ -250,7 +250,7 @@ static UINT16 *unknown_verify_base; static READ16_HANDLER( unknown_verify_r ) { - int prevpc = activecpu_get_previouspc(); + int prevpc = cpu_get_previouspc(machine->activecpu); if (prevpc < 0x5c5e || prevpc > 0xc432) return unknown_verify_base[offset]; else diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c index ba68f050c0b..0a86d33f6ec 100644 --- a/src/mame/drivers/ojankohs.c +++ b/src/mame/drivers/ojankohs.c @@ -159,7 +159,7 @@ static READ8_HANDLER( ojankohs_keymatrix_r ) ret &= input_port_read(machine, "KEY4"); break; default: ret = 0xff; - logerror("PC:%04X unknown %02X\n", activecpu_get_pc(), ojankohs_portselect); + logerror("PC:%04X unknown %02X\n", cpu_get_pc(machine->activecpu), ojankohs_portselect); break; } diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c index 272f45bbef0..b2f9ec4313a 100644 --- a/src/mame/drivers/opwolf.c +++ b/src/mame/drivers/opwolf.c @@ -359,7 +359,7 @@ static WRITE8_HANDLER( opwolf_adpcm_b_w ) msm5205_reset_w(0, 0); } -// logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,activecpu_get_pc() ); +// logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,cpu_get_pc(machine->activecpu) ); } @@ -381,18 +381,18 @@ static WRITE8_HANDLER( opwolf_adpcm_c_w ) msm5205_reset_w(1, 0); } -// logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,activecpu_get_pc() ); +// logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,cpu_get_pc(machine->activecpu) ); } static WRITE8_HANDLER( opwolf_adpcm_d_w ) { -// logerror("CPU #1 d00%i-data=%2x pc=%4x\n",offset,data,activecpu_get_pc() ); +// logerror("CPU #1 d00%i-data=%2x pc=%4x\n",offset,data,cpu_get_pc(machine->activecpu) ); } static WRITE8_HANDLER( opwolf_adpcm_e_w ) { -// logerror("CPU #1 e00%i-data=%2x pc=%4x\n",offset,data,activecpu_get_pc() ); +// logerror("CPU #1 e00%i-data=%2x pc=%4x\n",offset,data,cpu_get_pc(machine->activecpu) ); } diff --git a/src/mame/drivers/overdriv.c b/src/mame/drivers/overdriv.c index fa755fbbdd2..256592031f2 100644 --- a/src/mame/drivers/overdriv.c +++ b/src/mame/drivers/overdriv.c @@ -125,7 +125,7 @@ static NVRAM_HANDLER( overdriv ) static WRITE16_HANDLER( eeprom_w ) { -//logerror("%06x: write %04x to eeprom_w\n",activecpu_get_pc(),data); +//logerror("%06x: write %04x to eeprom_w\n",cpu_get_pc(machine->activecpu),data); if (ACCESSING_BITS_0_7) { /* bit 0 is data */ @@ -172,7 +172,7 @@ static WRITE16_HANDLER( cpuA_ctrl_w ) coin_counter_w(0,data & 0x10); coin_counter_w(1,data & 0x20); -//logerror("%06x: write %04x to cpuA_ctrl_w\n",activecpu_get_pc(),data); +//logerror("%06x: write %04x to cpuA_ctrl_w\n",cpu_get_pc(machine->activecpu),data); } } diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c index cf603437849..155420670ff 100644 --- a/src/mame/drivers/pacman.c +++ b/src/mame/drivers/pacman.c @@ -554,7 +554,7 @@ static READ8_HANDLER( alibaba_mystery_2_r ) static READ8_HANDLER( maketrax_special_port2_r ) { int data = input_port_read(machine, "DSW1"); - int pc = activecpu_get_previouspc(); + int pc = cpu_get_previouspc(machine->activecpu); if ((pc == 0x1973) || (pc == 0x2389)) return data | 0x40; @@ -575,7 +575,7 @@ static READ8_HANDLER( maketrax_special_port2_r ) static READ8_HANDLER( maketrax_special_port3_r ) { - int pc = activecpu_get_previouspc(); + int pc = cpu_get_previouspc(machine->activecpu); if (pc == 0x040e) return 0x20; @@ -597,7 +597,7 @@ static READ8_HANDLER( maketrax_special_port3_r ) static READ8_HANDLER( korosuke_special_port2_r ) { int data = input_port_read(machine, "DSW1"); - int pc = activecpu_get_previouspc(); + int pc = cpu_get_previouspc(machine->activecpu); if ((pc == 0x196e) || (pc == 0x2387)) return data | 0x40; @@ -617,7 +617,7 @@ static READ8_HANDLER( korosuke_special_port2_r ) static READ8_HANDLER( korosuke_special_port3_r ) { - int pc = activecpu_get_previouspc(); + int pc = cpu_get_previouspc(machine->activecpu); if (pc == 0x0445) return 0x20; @@ -692,7 +692,7 @@ static WRITE8_HANDLER( porky_banking_w ) static READ8_HANDLER( drivfrcp_port1_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x0030: case 0x0291: @@ -704,7 +704,7 @@ static READ8_HANDLER( drivfrcp_port1_r ) static READ8_HANDLER( _8bpm_port1_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x0030: case 0x0466: @@ -716,7 +716,7 @@ static READ8_HANDLER( _8bpm_port1_r ) static READ8_HANDLER( porky_port1_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x0034: return 0x01; @@ -5416,7 +5416,7 @@ static READ8_HANDLER( cannonbp_protection_r ) switch (offset) { default: - logerror("CPU0 %04x: Unhandled protection read, offset %04x\n", activecpu_get_pc(), offset); + logerror("CPU0 %04x: Unhandled protection read, offset %04x\n", cpu_get_pc(machine->activecpu), offset); return 0x00; case 0x0000: // unknown @@ -5439,7 +5439,7 @@ static READ8_HANDLER( cannonbp_protection_r ) cannonb_bit_to_read = 7; return 0x00; case 0x0001: // affects the ball hitting the blocks as well as jump address after bonus round - if (activecpu_get_pc() == 0x2b97) + if (cpu_get_pc(machine->activecpu) == 0x2b97) return (BIT(0x46, cannonb_bit_to_read--) << 7); else return 0xff; /* value taken from the bootlegs */ diff --git a/src/mame/drivers/pandoras.c b/src/mame/drivers/pandoras.c index 13eae7c9149..163153b0135 100644 --- a/src/mame/drivers/pandoras.c +++ b/src/mame/drivers/pandoras.c @@ -70,7 +70,7 @@ static WRITE8_HANDLER( pandoras_int_control_w ){ break; default: - logerror("%04x: (irq_ctrl) write %02x to %02x\n",activecpu_get_pc(), data, offset); + logerror("%04x: (irq_ctrl) write %02x to %02x\n",cpu_get_pc(machine->activecpu), data, offset); } } diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c index 4ad23976587..d4cd77c4e83 100644 --- a/src/mame/drivers/paradise.c +++ b/src/mame/drivers/paradise.c @@ -46,7 +46,7 @@ static WRITE8_HANDLER( paradise_rombank_w ) int bank_n = memory_region_length(machine, "main")/0x4000 - 1; if (bank >= bank_n) { - logerror("PC %04X - invalid rom bank %x\n",activecpu_get_pc(),bank); + logerror("PC %04X - invalid rom bank %x\n",cpu_get_pc(machine->activecpu),bank); bank %= bank_n; } @@ -56,7 +56,7 @@ static WRITE8_HANDLER( paradise_rombank_w ) static WRITE8_HANDLER( paradise_okibank_w ) { - if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown oki bank bits %02X\n",activecpu_get_pc(),data); + if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown oki bank bits %02X\n",cpu_get_pc(machine->activecpu),data); if (sndti_exists(SOUND_OKIM6295, 1)) okim6295_set_bank_base(1, (data & 0x02) ? 0x40000 : 0); diff --git a/src/mame/drivers/parodius.c b/src/mame/drivers/parodius.c index 3b8dda03d60..ff2153093ee 100644 --- a/src/mame/drivers/parodius.c +++ b/src/mame/drivers/parodius.c @@ -71,7 +71,7 @@ static WRITE8_HANDLER( parodius_052109_053245_w ) static WRITE8_HANDLER( parodius_videobank_w ) { - if (videobank & 0xf8) logerror("%04x: videobank = %02x\n",activecpu_get_pc(),data); + if (videobank & 0xf8) logerror("%04x: videobank = %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 0 = select palette or work RAM at 0000-07ff */ /* bit 1 = select 052109 or 053245 at 2000-27ff */ @@ -81,7 +81,7 @@ static WRITE8_HANDLER( parodius_videobank_w ) static WRITE8_HANDLER( parodius_3fc0_w ) { - if ((data & 0xf4) != 0x10) logerror("%04x: 3fc0 = %02x\n",activecpu_get_pc(),data); + if ((data & 0xf4) != 0x10) logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 0/1 = coin counters */ coin_counter_w(0,data & 0x01); @@ -386,7 +386,7 @@ static void parodius_banking(int lines) UINT8 *RAM = memory_region(Machine, "main"); int offs = 0; - if (lines & 0xf0) logerror("%04x: setlines %02x\n",activecpu_get_pc(),lines); + if (lines & 0xf0) logerror("%04x: setlines %02x\n",cpu_get_pc(Machine->activecpu),lines); offs = 0x10000 + (((lines & 0x0f)^0x0f) * 0x4000); if (offs >= 0x48000) offs -= 0x40000; @@ -397,7 +397,7 @@ static MACHINE_RESET( parodius ) { UINT8 *RAM = memory_region(machine, "main"); - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)parodius_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)parodius_banking); paletteram = &memory_region(machine, "main")[0x48000]; diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c index b773c1307a3..11773638a36 100644 --- a/src/mame/drivers/pasha2.c +++ b/src/mame/drivers/pasha2.c @@ -454,7 +454,7 @@ ROM_END static READ16_HANDLER( pasha2_speedup_r ) { - if(activecpu_get_pc() == 0x8302) + if(cpu_get_pc(machine->activecpu) == 0x8302) { cpu_spinuntil_int(); } diff --git a/src/mame/drivers/pbaction.c b/src/mame/drivers/pbaction.c index 7d4d864df1f..1255e6ca9f6 100644 --- a/src/mame/drivers/pbaction.c +++ b/src/mame/drivers/pbaction.c @@ -388,7 +388,7 @@ ROM_END static READ8_HANDLER( pbactio3_prot_kludge_r ) { /* on startup, the game expect this location to NOT act as RAM */ - if (activecpu_get_pc() == 0xab80) + if (cpu_get_pc(machine->activecpu) == 0xab80) return 0; return work_ram[0]; diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c index 2ce85d72af0..fd84a3f459d 100644 --- a/src/mame/drivers/pgm.c +++ b/src/mame/drivers/pgm.c @@ -300,7 +300,7 @@ static READ16_HANDLER ( z80_ram_r ) static READ32_HANDLER( arm7_latch_arm_r ) { - if (PGMARM7LOGERROR) logerror("ARM7: Latch read: %08x (%08x) (%06x)\n", arm7_latch, mem_mask, activecpu_get_pc() ); + if (PGMARM7LOGERROR) logerror("ARM7: Latch read: %08x (%08x) (%06x)\n", arm7_latch, mem_mask, cpu_get_pc(machine->activecpu) ); return arm7_latch; } @@ -315,7 +315,7 @@ static TIMER_CALLBACK( arm_irq ) //static emu_timer * arm_comms_timer; static WRITE32_HANDLER( arm7_latch_arm_w ) { - if (PGMARM7LOGERROR) logerror("ARM7: Latch write: %08x (%08x) (%06x)\n", data, mem_mask, activecpu_get_pc() ); + if (PGMARM7LOGERROR) logerror("ARM7: Latch write: %08x (%08x) (%06x)\n", data, mem_mask, cpu_get_pc(machine->activecpu) ); COMBINE_DATA(&arm7_latch); #ifdef PGMARM7SPEEDHACK @@ -330,25 +330,25 @@ static WRITE32_HANDLER( arm7_latch_arm_w ) static READ32_HANDLER( arm7_shareram_r ) { - if (PGMARM7LOGERROR) logerror("ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x) (%06x)\n", offset << 2, arm7_shareram[offset], mem_mask, activecpu_get_pc() ); + if (PGMARM7LOGERROR) logerror("ARM7: ARM7 Shared RAM Read: %04x = %08x (%08x) (%06x)\n", offset << 2, arm7_shareram[offset], mem_mask, cpu_get_pc(machine->activecpu) ); return arm7_shareram[offset]; } static WRITE32_HANDLER( arm7_shareram_w ) { - if (PGMARM7LOGERROR) logerror("ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x) (%06x)\n", offset << 2, data, mem_mask, activecpu_get_pc() ); + if (PGMARM7LOGERROR) logerror("ARM7: ARM7 Shared RAM Write: %04x = %08x (%08x) (%06x)\n", offset << 2, data, mem_mask, cpu_get_pc(machine->activecpu) ); COMBINE_DATA(&arm7_shareram[offset]); } static READ16_HANDLER( arm7_latch_68k_r ) { - if (PGMARM7LOGERROR) logerror("M68K: Latch read: %04x (%04x) (%06x)\n", arm7_latch & 0x0000ffff, mem_mask, activecpu_get_pc() ); + if (PGMARM7LOGERROR) logerror("M68K: Latch read: %04x (%04x) (%06x)\n", arm7_latch & 0x0000ffff, mem_mask, cpu_get_pc(machine->activecpu) ); return arm7_latch; } static WRITE16_HANDLER( arm7_latch_68k_w ) { - if (PGMARM7LOGERROR) logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, activecpu_get_pc() ); + if (PGMARM7LOGERROR) logerror("M68K: Latch write: %04x (%04x) (%06x)\n", data & 0x0000ffff, mem_mask, cpu_get_pc(machine->activecpu) ); COMBINE_DATA(&arm7_latch); #ifdef PGMARM7SPEEDHACK @@ -365,33 +365,33 @@ static WRITE16_HANDLER( arm7_latch_68k_w ) static READ16_HANDLER( arm7_ram_r ) { UINT16 *share16 = (UINT16 *)arm7_shareram; - if (PGMARM7LOGERROR) logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, activecpu_get_pc() ); + if (PGMARM7LOGERROR) logerror("M68K: ARM7 Shared RAM Read: %04x = %04x (%08x) (%06x)\n", BYTE_XOR_LE(offset), share16[BYTE_XOR_LE(offset)], mem_mask, cpu_get_pc(machine->activecpu) ); return share16[BYTE_XOR_LE(offset)]; } static WRITE16_HANDLER( arm7_ram_w ) { UINT16 *share16 = (UINT16 *)arm7_shareram; - if (PGMARM7LOGERROR) logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, activecpu_get_pc() ); + if (PGMARM7LOGERROR) logerror("M68K: ARM7 Shared RAM Write: %04x = %04x (%04x) (%06x)\n", BYTE_XOR_LE(offset), data, mem_mask, cpu_get_pc(machine->activecpu) ); COMBINE_DATA(&share16[BYTE_XOR_LE(offset)]); } static WRITE16_HANDLER ( z80_ram_w ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(machine->activecpu); if(ACCESSING_BITS_8_15) z80_mainram[offset*2] = data >> 8; if(ACCESSING_BITS_0_7) z80_mainram[offset*2+1] = data; if(pc != 0xf12 && pc != 0xde2 && pc != 0x100c50 && pc != 0x100b20) - if (PGMLOGERROR) logerror("Z80: write %04x, %04x @ %04x (%06x)\n", offset*2, data, mem_mask, activecpu_get_pc()); + if (PGMLOGERROR) logerror("Z80: write %04x, %04x @ %04x (%06x)\n", offset*2, data, mem_mask, cpu_get_pc(machine->activecpu)); } static WRITE16_HANDLER ( z80_reset_w ) { - if (PGMLOGERROR) logerror("Z80: reset %04x @ %04x (%06x)\n", data, mem_mask, activecpu_get_pc()); + if (PGMLOGERROR) logerror("Z80: reset %04x @ %04x (%06x)\n", data, mem_mask, cpu_get_pc(machine->activecpu)); if(data == 0x5050) { sndti_reset(SOUND_ICS2115, 0); @@ -414,13 +414,13 @@ static WRITE16_HANDLER ( z80_reset_w ) static WRITE16_HANDLER ( z80_ctrl_w ) { - if (PGMLOGERROR) logerror("Z80: ctrl %04x @ %04x (%06x)\n", data, mem_mask, activecpu_get_pc()); + if (PGMLOGERROR) logerror("Z80: ctrl %04x @ %04x (%06x)\n", data, mem_mask, cpu_get_pc(machine->activecpu)); } static WRITE16_HANDLER ( m68k_l1_w ) { if(ACCESSING_BITS_0_7) { - if (PGMLOGERROR) logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, activecpu_get_pc()); + if (PGMLOGERROR) logerror("SL 1 m68.w %02x (%06x) IRQ\n", data & 0xff, cpu_get_pc(machine->activecpu)); soundlatch_w(machine, 0, data); cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE ); } @@ -428,7 +428,7 @@ static WRITE16_HANDLER ( m68k_l1_w ) static WRITE8_HANDLER( z80_l3_w ) { - if (PGMLOGERROR) logerror("SL 3 z80.w %02x (%04x)\n", data, activecpu_get_pc()); + if (PGMLOGERROR) logerror("SL 3 z80.w %02x (%04x)\n", data, cpu_get_pc(machine->activecpu)); soundlatch3_w(machine, 0, data); } @@ -1473,7 +1473,7 @@ static WRITE16_HANDLER( killbld_prot_w ) kb_cmd=data; else //offset==2 { - logerror("%06X: ASIC25 W CMD %X VAL %X",activecpu_get_pc(),kb_cmd,data); + logerror("%06X: ASIC25 W CMD %X VAL %X",cpu_get_pc(machine->activecpu),kb_cmd,data); if(kb_cmd==0) reg=data; else if(kb_cmd==2) @@ -1646,7 +1646,7 @@ static READ16_HANDLER( killbld_prot_r ) } } - logerror("%06X: ASIC25 R CMD %X VAL %X",activecpu_get_pc(),kb_cmd,res); + logerror("%06X: ASIC25 R CMD %X VAL %X",cpu_get_pc(machine->activecpu),kb_cmd,res); return res; } @@ -1833,7 +1833,7 @@ static READ16_HANDLER( olds_r16 ) } } - logerror("%06X: ASIC25 R CMD %X VAL %X\n",activecpu_get_pc(),kb_cmd,res); + logerror("%06X: ASIC25 R CMD %X VAL %X\n",cpu_get_pc(machine->activecpu),kb_cmd,res); return res; } @@ -1846,7 +1846,7 @@ static WRITE16_HANDLER( olds_w16 ) kb_cmd=data; else //offset==2 { - logerror("%06X: ASIC25 W CMD %X VAL %X\n",activecpu_get_pc(),kb_cmd,data); + logerror("%06X: ASIC25 W CMD %X VAL %X\n",cpu_get_pc(machine->activecpu),kb_cmd,data); if(kb_cmd==0) reg=data; else if(kb_cmd==2) //a bitswap= diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c index 89b6014f519..400167026f0 100644 --- a/src/mame/drivers/phoenix.c +++ b/src/mame/drivers/phoenix.c @@ -1020,7 +1020,7 @@ static DRIVER_INIT( condor ) static DRIVER_INIT( survival ) { - cpunum_set_info_fct(0, CPUINFO_PTR_I8085_SID_CALLBACK, (void*)survival_sid_callback); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_I8085_SID_CALLBACK, (void*)survival_sid_callback); } diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c index 45a8296c579..14989159a4d 100644 --- a/src/mame/drivers/pirates.c +++ b/src/mame/drivers/pirates.c @@ -139,7 +139,7 @@ static WRITE16_HANDLER( pirates_out_w ) /* bit 7 used (function unknown) */ } -// logerror("%06x: out_w %04x\n",activecpu_get_pc(),data); +// logerror("%06x: out_w %04x\n",cpu_get_pc(machine->activecpu),data); } static CUSTOM_INPUT( prot_r ) @@ -147,23 +147,23 @@ static CUSTOM_INPUT( prot_r ) // static int prot = 0xa3; int bit; -// logerror("%06x: IN1_r\n",activecpu_get_pc()); +// logerror("%06x: IN1_r\n",cpu_get_pc(machine->activecpu)); #if 0 /* Pirates protection workaround. It more complicated than this... see code at 602e and 62a6 */ /* For Genix, see 6576 for setting values and 67c2,d3b4 and dbc2 for tests. */ - if (activecpu_get_pc() == 0x6134) + if (cpu_get_pc(machine->activecpu) == 0x6134) { bit = prot & 1; prot = (prot >> 1) | (bit << 7); } - else if (activecpu_get_pc() == 0x6020) + else if (cpu_get_pc(machine->activecpu) == 0x6020) bit = 0; - else if (activecpu_get_pc() == 0x6168) + else if (cpu_get_pc(machine->activecpu) == 0x6168) bit = 0; - else if (activecpu_get_pc() == 0x61cc) + else if (cpu_get_pc(machine->activecpu) == 0x61cc) bit = 1; else #endif diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c index 148d0f0fbcd..10f45b4b231 100644 --- a/src/mame/drivers/pktgaldx.c +++ b/src/mame/drivers/pktgaldx.c @@ -127,7 +127,7 @@ static WRITE16_HANDLER( paletteram16_xRGB_w ) static READ16_HANDLER( pckgaldx_protection_r ) { - logerror("pckgaldx_protection_r address %06x\n",activecpu_get_pc()); + logerror("pckgaldx_protection_r address %06x\n",cpu_get_pc(machine->activecpu)); return -1; } diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c index 1ca7e934fa4..daf4493b53b 100644 --- a/src/mame/drivers/plygonet.c +++ b/src/mame/drivers/plygonet.c @@ -201,7 +201,7 @@ static READ32_HANDLER( dsp_host_interface_r ) if (mem_mask == 0x0000ff00) { value <<= 8; } if (mem_mask == 0xff000000) { value <<= 24; } - logerror("Dsp HI Read (host-side) %08x (HI %04x) = %08x (@%x)\n", mem_mask, hi_addr, value, activecpu_get_pc()); + logerror("Dsp HI Read (host-side) %08x (HI %04x) = %08x (@%x)\n", mem_mask, hi_addr, value, cpu_get_pc(machine->activecpu)); return value; } @@ -215,7 +215,7 @@ static WRITE32_HANDLER( shared_ram_write ) 0xc000 + (offset<<1), 0xc000 +((offset<<1)+1), mem_mask, - activecpu_get_pc()); + cpu_get_pc(machine->activecpu)); /* write to the current dsp56k word */ if (mem_mask | (0xffff0000)) diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c index 717a19cf067..c5917321410 100644 --- a/src/mame/drivers/pntnpuzl.c +++ b/src/mame/drivers/pntnpuzl.c @@ -280,13 +280,13 @@ READ16_HANDLER ( pntnpuzl_random_r ) static READ16_HANDLER( pntnpuzl_vid_r ) { -// logerror("read_videoram: pc = %06x : offset %04x reg %04x\n",activecpu_get_pc(),offset*2, pntnpuzl_bank[0]); +// logerror("read_videoram: pc = %06x : offset %04x reg %04x\n",cpu_get_pc(machine->activecpu),offset*2, pntnpuzl_bank[0]); return pntnpuzl_3a0000ram[offset+ (pntnpuzl_bank[0]&0x0001)*0x8000 ]; } static WRITE16_HANDLER( pntnpuzl_vid_w ) { -// logerror("write_to_videoram: pc = %06x : offset %04x data %04x reg %04x\n",activecpu_get_pc(),offset*2, data, pntnpuzl_bank[0]); +// logerror("write_to_videoram: pc = %06x : offset %04x data %04x reg %04x\n",cpu_get_pc(machine->activecpu),offset*2, data, pntnpuzl_bank[0]); COMBINE_DATA(&pntnpuzl_3a0000ram[offset+ (pntnpuzl_bank[0]&0x0001)*0x8000 ]); } @@ -336,7 +336,7 @@ static WRITE16_HANDLER( pntnpuzl_200000_w ) static WRITE16_HANDLER( pntnpuzl_280018_w ) { -// logerror("%04x: 280018: %04x\n",activecpu_get_pc(),data); +// logerror("%04x: 280018: %04x\n",cpu_get_pc(machine->activecpu),data); serial >>= 1; if (data & 0x2000) serial |= 0x400; diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c index ea12f83bda4..3fbd1a1dfdb 100644 --- a/src/mame/drivers/polepos.c +++ b/src/mame/drivers/polepos.c @@ -249,7 +249,7 @@ static READ16_HANDLER( polepos2_ic25_r ) last_result = (INT8)last_signed * (UINT8)last_unsigned; } -// logerror("%04X: read IC25 @ %04X = %02X\n", activecpu_get_pc(), offset, result); +// logerror("%04X: read IC25 @ %04X = %02X\n", cpu_get_pc(machine->activecpu), offset, result); return result | (result << 8); } @@ -328,7 +328,7 @@ static WRITE8_HANDLER( polepos_latch_w ) static WRITE16_HANDLER( polepos_z8002_nvi_enable_w ) { - int which = cpu_getactivecpu(); + int which = cpunum_get_active(); data &= 1; diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c index d8cd9483533..eb891f19d1f 100644 --- a/src/mame/drivers/policetr.c +++ b/src/mame/drivers/policetr.c @@ -169,7 +169,7 @@ static WRITE32_HANDLER( control_w ) /* log any unknown bits */ if (data & 0x4f1fffff) - logerror("%08X: control_w = %08X & %08X\n", activecpu_get_previouspc(), data, mem_mask); + logerror("%08X: control_w = %08X & %08X\n", cpu_get_previouspc(machine->activecpu), data, mem_mask); } @@ -216,7 +216,7 @@ static WRITE32_HANDLER( speedup_w ) COMBINE_DATA(speedup_data); /* see if the PC matches */ - if ((activecpu_get_previouspc() & 0x1fffffff) == speedup_pc) + if ((cpu_get_previouspc(machine->activecpu) & 0x1fffffff) == speedup_pc) { UINT64 curr_cycles = activecpu_gettotalcycles(); diff --git a/src/mame/drivers/popeye.c b/src/mame/drivers/popeye.c index b7744a53967..8195f0d0a95 100644 --- a/src/mame/drivers/popeye.c +++ b/src/mame/drivers/popeye.c @@ -41,7 +41,7 @@ extern VIDEO_UPDATE( popeye ); static INTERRUPT_GEN( popeye_interrupt ) { /* NMIs are enabled by the I register?? How can that be? */ - if (activecpu_get_reg(Z80_I) & 1) /* skyskipr: 0/1, popeye: 2/3 but also 0/1 */ + if (cpu_get_reg(machine->activecpu, Z80_I) & 1) /* skyskipr: 0/1, popeye: 2/3 but also 0/1 */ cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE); } diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c index cb27df9dc7d..d0188d946b7 100644 --- a/src/mame/drivers/ppmast93.c +++ b/src/mame/drivers/ppmast93.c @@ -197,7 +197,7 @@ static WRITE8_HANDLER(ppmast_sound_w) case 0: ym2413_register_port_0_w(machine,0,data); break; case 1: ym2413_data_port_0_w(machine,0,data); break; case 2: dac_0_data_w(machine,0,data);break; - default: logerror("%x %x - %x\n",offset,data,activecpu_get_previouspc()); + default: logerror("%x %x - %x\n",offset,data,cpu_get_previouspc(machine->activecpu)); } } diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c index bec101ac156..166677fc769 100644 --- a/src/mame/drivers/psikyo.c +++ b/src/mame/drivers/psikyo.c @@ -111,7 +111,7 @@ static CUSTOM_INPUT( z80_nmi_r ) /* main CPU might be waiting for sound CPU to finish NMI, so set a timer to give sound CPU a chance to run */ timer_call_after_resynch(NULL, 0, NULL); -// logerror("PC %06X - Read coin port during Z80 NMI\n", activecpu_get_pc()); +// logerror("PC %06X - Read coin port during Z80 NMI\n", cpu_get_pc(machine->activecpu)); } return ret; @@ -150,7 +150,7 @@ static READ32_HANDLER( sngkace_input_r ) case 0x0: return input_port_read(machine, "P1_P2"); case 0x1: return input_port_read(machine, "DSW"); case 0x2: return input_port_read(machine, "COIN"); - default: logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset * 2); + default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(machine->activecpu), offset * 2); return 0; } } @@ -161,7 +161,7 @@ static READ32_HANDLER( gunbird_input_r ) { case 0x0: return input_port_read(machine, "P1_P2"); case 0x1: return input_port_read(machine, "DSW"); - default: logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2); + default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(machine->activecpu), offset*2); return 0; } } @@ -280,12 +280,12 @@ static WRITE32_HANDLER( s1945_mcu_w ) s1945_mcu_latching |= 4; break; default: -// logerror("MCU: function %02x, direction %02x, latch1 %02x, latch2 %02x (%x)\n", data, s1945_mcu_direction, s1945_mcu_latch1, s1945_mcu_latch2, activecpu_get_pc()); +// logerror("MCU: function %02x, direction %02x, latch1 %02x, latch2 %02x (%x)\n", data, s1945_mcu_direction, s1945_mcu_latch1, s1945_mcu_latch2, cpu_get_pc(machine->activecpu)); break; } break; default: -// logerror("MCU.w %x, %02x (%x)\n", offset, data, activecpu_get_pc()); +// logerror("MCU.w %x, %02x (%x)\n", offset, data, cpu_get_pc(machine->activecpu)); ; } } @@ -318,7 +318,7 @@ static READ32_HANDLER( s1945_input_r ) case 0x0: return input_port_read(machine, "P1_P2"); case 0x1: return (input_port_read(machine, "DSW") & 0xffff000f) | s1945_mcu_r(machine, offset-1, mem_mask); case 0x2: return s1945_mcu_r(machine, offset-1, mem_mask); - default: logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2); + default: logerror("PC %06X - Read input %02X !\n", cpu_get_pc(machine->activecpu), offset*2); return 0; } } diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c index ed1fdde564e..eb71ee06247 100644 --- a/src/mame/drivers/psikyo4.c +++ b/src/mame/drivers/psikyo4.c @@ -1056,7 +1056,7 @@ PC :00001B46: TST R2,R2 PC :00001B48: BT $00001B3C */ - if (activecpu_get_pc()==0x00001B3E) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x00001B3E) cpu_spinuntil_int(); return ps4_ram[0x000020/4]; } @@ -1072,7 +1072,7 @@ PC :00001B52: TST R2,R2 PC :00001B54: BT $00001B48 */ - if (activecpu_get_pc()==0x00001B4A) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x00001B4A) cpu_spinuntil_int(); return ps4_ram[0x000020/4]; } @@ -1088,7 +1088,7 @@ PC :000029F6: TST R3,R3 PC :000029F8: BT $000029EC */ - if (activecpu_get_pc()==0x000029EE) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x000029EE) cpu_spinuntil_int(); return ps4_ram[0x00001c/4]; } diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c index 61a2d8cbf53..fb22c765b02 100644 --- a/src/mame/drivers/psikyosh.c +++ b/src/mame/drivers/psikyosh.c @@ -1139,13 +1139,13 @@ ROM_END static DRIVER_INIT( soldivid ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_0; } static DRIVER_INIT( s1945ii ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_DEFAULT; } @@ -1153,13 +1153,13 @@ static DRIVER_INIT( daraku ) { UINT8 *RAM = memory_region(machine, "main"); memory_set_bankptr(1,&RAM[0x100000]); - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_DARAKU; } static DRIVER_INIT( sbomberb ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_DEFAULT; } @@ -1167,7 +1167,7 @@ static DRIVER_INIT( gunbird2 ) { UINT8 *RAM = memory_region(machine, "main"); memory_set_bankptr(1,&RAM[0x100000]); - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_DEFAULT; } @@ -1175,25 +1175,25 @@ static DRIVER_INIT( s1945iii ) { UINT8 *RAM = memory_region(machine, "main"); memory_set_bankptr(1,&RAM[0x100000]); - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_S1945III; } static DRIVER_INIT( dragnblz ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_DRAGNBLZ; } static DRIVER_INIT( gnbarich ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_GNBARICH; } static DRIVER_INIT( mjgtaste ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); use_factory_eeprom=eeprom_MJGTASTE; /* needs to install mahjong controls too (can select joystick in test mode tho) */ } diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c index 34f611ecde6..c7fab7790ca 100644 --- a/src/mame/drivers/qdrmfgp.c +++ b/src/mame/drivers/qdrmfgp.c @@ -247,10 +247,10 @@ static READ16_DEVICE_HANDLER( gp2_ide_std_r ) { if (offset == 0x07) { - switch (activecpu_get_previouspc()) + switch (cpu_get_previouspc(device->machine->activecpu)) { case 0xdb4c: - if ((workram[0x5fa4/2] - activecpu_get_reg(M68K_D0)) <= 0x10) + if ((workram[0x5fa4/2] - cpu_get_reg(device->machine->activecpu, M68K_D0)) <= 0x10) gp2_irq_control = 1; break; case 0xdec2: diff --git a/src/mame/drivers/quizo.c b/src/mame/drivers/quizo.c index e64e053f9ee..873153f68b5 100644 --- a/src/mame/drivers/quizo.c +++ b/src/mame/drivers/quizo.c @@ -108,7 +108,7 @@ static WRITE8_HANDLER(port60_w) { if(data>9) { - logerror("ROMBANK %x @ %x\n", data, activecpu_get_pc()); + logerror("ROMBANK %x @ %x\n", data, cpu_get_pc(machine->activecpu)); data=0; } port60=data; diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c index cd0992df25e..afcd3d6cbf4 100644 --- a/src/mame/drivers/quizpun2.c +++ b/src/mame/drivers/quizpun2.c @@ -135,9 +135,9 @@ static MACHINE_RESET( quizpun2 ) prot.addr = 0; } -static void log_protection( const char *warning ) +static void log_protection( running_machine *machine, const char *warning ) { - logerror("%04x: protection - %s (state %x, wait %x, param %02x, cmd %02x, addr %02x)\n", activecpu_get_pc(), warning, + logerror("%04x: protection - %s (state %x, wait %x, param %02x, cmd %02x, addr %02x)\n", cpu_get_pc(machine->activecpu), warning, prot.state, prot.wait_param, prot.param, @@ -174,7 +174,7 @@ static READ8_HANDLER( quizpun2_protection_r ) break; default: - log_protection("unknown address"); + log_protection(machine, "unknown address"); ret = 0x2e59 >> ((prot.addr & 1) ? 0 : 8); // return the address of: XOR A, RET } break; @@ -187,12 +187,12 @@ static READ8_HANDLER( quizpun2_protection_r ) } default: - log_protection("unknown read"); + log_protection(machine, "unknown read"); ret = 0x00; } #if VERBOSE_PROTECTION_LOG - log_protection("info READ"); + log_protection(machine, "info READ"); #endif prot.addr++; @@ -235,7 +235,7 @@ static WRITE8_HANDLER( quizpun2_protection_w ) prot.addr = 0; } else - log_protection("unknown command"); + log_protection(machine, "unknown command"); } else if (prot.cmd >= 0x00 && prot.cmd <= 0x0f ) { @@ -250,7 +250,7 @@ static WRITE8_HANDLER( quizpun2_protection_w ) else { prot.state = STATE_IDLE; - log_protection("unknown command"); + log_protection(machine, "unknown command"); } } else @@ -262,7 +262,7 @@ static WRITE8_HANDLER( quizpun2_protection_w ) } #if VERBOSE_PROTECTION_LOG - log_protection("info WRITE"); + log_protection(machine, "info WRITE"); #endif } diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c index 27864321c10..b1f6eb59912 100644 --- a/src/mame/drivers/r2dtank.c +++ b/src/mame/drivers/r2dtank.c @@ -91,7 +91,7 @@ static READ8_HANDLER( audio_command_r ) { UINT8 ret = soundlatch_r(machine, 0); -if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Command Read: %x\n", safe_activecpu_get_pc(), ret); +if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Command Read: %x\n", safe_cpu_get_pc(machine->activecpu), ret); return ret; } @@ -102,14 +102,14 @@ static WRITE8_HANDLER( audio_command_w ) soundlatch_w(machine, 0, ~data); cpunum_set_input_line(machine, 1, M6802_IRQ_LINE, HOLD_LINE); -if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", safe_activecpu_get_pc(), data^0xff); +if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Command Write: %x\n", safe_cpu_get_pc(machine->activecpu), data^0xff); } static READ8_HANDLER( audio_answer_r ) { UINT8 ret = soundlatch2_r(machine, 0); -if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", safe_activecpu_get_pc(), ret); +if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", safe_cpu_get_pc(machine->activecpu), ret); return ret; } @@ -118,13 +118,13 @@ if (LOG_AUDIO_COMM) logerror("%08X CPU#0 Audio Answer Read: %x\n", safe_active static WRITE8_HANDLER( audio_answer_w ) { /* HACK - prevents lock-up, but causes game to end some in-between sreens prematurely */ - if (safe_activecpu_get_pc() == 0xfb12) + if (safe_cpu_get_pc(machine->activecpu) == 0xfb12) data = 0x00; soundlatch2_w(machine, 0, data); cpunum_set_input_line(machine, 0, M6809_IRQ_LINE, HOLD_LINE); -if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", safe_activecpu_get_pc(), data); +if (LOG_AUDIO_COMM) logerror("%08X CPU#1 Audio Answer Write: %x\n", safe_cpu_get_pc(machine->activecpu), data); } @@ -139,7 +139,7 @@ static WRITE8_HANDLER( AY8910_select_w ) D5-D7 - not used */ AY8910_selected = data; -if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910_select_w: %x\n", safe_activecpu_get_pc(), data); +if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910_select_w: %x\n", safe_cpu_get_pc(machine->activecpu), data); } @@ -150,12 +150,12 @@ static READ8_HANDLER( AY8910_port_r ) if (AY8910_selected & 0x08) { ret = ay8910_read_port_0_r(machine, offset); -if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Port Read: %x\n", safe_activecpu_get_pc(), ret);} +if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Port Read: %x\n", safe_cpu_get_pc(machine->activecpu), ret);} if (AY8910_selected & 0x10) { ret = ay8910_read_port_1_r(machine, offset); -if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Port Read: %x\n", safe_activecpu_get_pc(), ret);} +if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Port Read: %x\n", safe_cpu_get_pc(machine->activecpu), ret);} return ret; } @@ -166,23 +166,23 @@ static WRITE8_HANDLER( AY8910_port_w ) if (AY8910_selected & 0x04) { if (AY8910_selected & 0x08) -{if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Control Write: %x\n", safe_activecpu_get_pc(), data); +{if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Control Write: %x\n", safe_cpu_get_pc(machine->activecpu), data); ay8910_control_port_0_w(machine, offset, data); } if (AY8910_selected & 0x10) -{if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Control Write: %x\n", safe_activecpu_get_pc(), data); +{if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Control Write: %x\n", safe_cpu_get_pc(machine->activecpu), data); ay8910_control_port_1_w(machine, offset, data); } } else { if (AY8910_selected & 0x08) -{if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Port Write: %x\n", safe_activecpu_get_pc(), data); +{if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #0 Port Write: %x\n", safe_cpu_get_pc(machine->activecpu), data); ay8910_write_port_0_w(machine, offset, data); } if (AY8910_selected & 0x10) -{if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Port Write: %x\n", safe_activecpu_get_pc(), data); +{if (LOG_AUDIO_COMM) logerror("%08X CPU#1 AY8910 #1 Port Write: %x\n", safe_cpu_get_pc(machine->activecpu), data); ay8910_write_port_1_w(machine, offset, data); } } diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c index c1206f15e90..169dbbc4a28 100644 --- a/src/mame/drivers/raiden.c +++ b/src/mame/drivers/raiden.c @@ -450,7 +450,7 @@ ROM_END /* Spin the sub-cpu if it is waiting on the master cpu */ static READ16_HANDLER( sub_cpu_spin_r ) { - int pc=activecpu_get_pc(); + int pc=cpu_get_pc(machine->activecpu); int ret=raiden_shared_ram[0x4]; if (pc==0xfcde6 && ret!=0x40) @@ -461,7 +461,7 @@ static READ16_HANDLER( sub_cpu_spin_r ) static READ16_HANDLER( sub_cpu_spina_r ) { - int pc=activecpu_get_pc(); + int pc=cpu_get_pc(machine->activecpu); int ret=raiden_shared_ram[0x4]; if (pc==0xfcde8 && ret!=0x40) diff --git a/src/mame/drivers/raiden2.c b/src/mame/drivers/raiden2.c index e9ff6b6b8c6..996324b3a24 100644 --- a/src/mame/drivers/raiden2.c +++ b/src/mame/drivers/raiden2.c @@ -682,18 +682,18 @@ WRITE16_HANDLER(sprcpt_flags_2_w) // XXX // write only: 4c0 4c1 500 501 502 503 -static UINT16 handle_io_r(int offset) +static UINT16 handle_io_r(running_machine *machine, int offset) { - logerror("io_r %04x, %04x (%x)\n", offset*2, mainram[offset], activecpu_get_pc()); + logerror("io_r %04x, %04x (%x)\n", offset*2, mainram[offset], cpu_get_pc(machine->activecpu)); return mainram[offset]; } -static void handle_io_w(int offset, UINT16 data, UINT16 mem_mask) +static void handle_io_w(running_machine *machine, int offset, UINT16 data, UINT16 mem_mask) { COMBINE_DATA(&mainram[offset]); switch(offset) { default: - logerror("io_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, activecpu_get_pc()); + logerror("io_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, cpu_get_pc(machine->activecpu)); } } @@ -702,7 +702,7 @@ static READ16_HANDLER(any_r) c_r[offset]++; if(offset >= 0x400/2 && offset < 0x800/2) - return handle_io_r(offset); + return handle_io_r(machine, offset); return mainram[offset]; } @@ -711,22 +711,22 @@ static WRITE16_HANDLER(any_w) { int show = 0; if(offset >= 0x400/2 && offset < 0x800/2) - handle_io_w(offset, data, mem_mask); + handle_io_w(machine, offset, data, mem_mask); c_w[offset]++; - // logerror("mainram_w %04x, %02x (%x)\n", offset, data, activecpu_get_pc()); + // logerror("mainram_w %04x, %02x (%x)\n", offset, data, cpu_get_pc(machine->activecpu)); if(mainram[offset] != data && offset >= 0x400 && offset < 0x800) { if(0 && offset != 0x4c0/2 && offset != 0x500/2 && offset != 0x444/2 && offset != 0x6de/2 && offset != 0x47e/2 && offset != 0x4a0/2 && offset != 0x620/2 && offset != 0x6c6/2 && offset != 0x628/2 && offset != 0x62a/2) - logerror("mainram_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, activecpu_get_pc()); + logerror("mainram_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, cpu_get_pc(machine->activecpu)); } if(0 && c_w[offset]>1000 && !c_r[offset]) { if(offset != 0x4c0/2 && (offset<0x500/2 || offset > 0x503/2)) - logerror("mainram_w %04x, %04x & %04x [%d.%d] (%x)\n", offset*2, data, mem_mask, c_w[offset], c_r[offset], activecpu_get_pc()); + logerror("mainram_w %04x, %04x & %04x [%d.%d] (%x)\n", offset*2, data, mem_mask, c_w[offset], c_r[offset], cpu_get_pc(machine->activecpu)); } // if(offset == 0x471 || (offset >= 0xb146 && offset < 0xb156)) @@ -737,7 +737,7 @@ static WRITE16_HANDLER(any_w) // show = offset == 0x704 || offset == 0x710 || offset == 0x71c; if(show) - logerror("mainram_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, activecpu_get_pc()); + logerror("mainram_w %04x, %04x & %04x (%x)\n", offset*2, data, mem_mask, cpu_get_pc(machine->activecpu)); // if(offset == 0x700) // cpu_setbank(2, memory_region(machine, "user1")+0x20000*data); @@ -749,7 +749,7 @@ static WRITE16_HANDLER(w1x) { COMBINE_DATA(&w1ram[offset]); if(0 && offset < 0x800/2) - logerror("w1x %05x, %04x & %04x (%05x)\n", offset*2+0x10000, data, mem_mask, activecpu_get_pc()); + logerror("w1x %05x, %04x & %04x (%05x)\n", offset*2+0x10000, data, mem_mask, cpu_get_pc(machine->activecpu)); } #ifdef UNUSED_FUNCTION @@ -2049,7 +2049,7 @@ INPUT_PORTS_END static INTERRUPT_GEN( rdx_v33_interrupt ) { - cpunum_set_input_line_and_vector(machine, cpu_getactivecpu(), 0, HOLD_LINE, 0xc0/4); /* VBL */ + cpunum_set_input_line_and_vector(machine, cpunum_get_active(), 0, HOLD_LINE, 0xc0/4); /* VBL */ logerror("VSYNC\n"); } diff --git a/src/mame/drivers/realbrk.c b/src/mame/drivers/realbrk.c index 1ef85a6d19e..f68d8101754 100644 --- a/src/mame/drivers/realbrk.c +++ b/src/mame/drivers/realbrk.c @@ -63,7 +63,7 @@ static READ16_HANDLER( realbrk_dsw_r ) ((input_port_read(machine, "SW3") & 0x0300) << 4) | ((input_port_read(machine, "SW4") & 0x0300) << 6) ; - logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",activecpu_get_pc(),realbrk_dsw_select[0]); + logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",cpu_get_pc(machine->activecpu),realbrk_dsw_select[0]); return 0xffff; } @@ -124,7 +124,7 @@ static READ16_HANDLER( backup_ram_r ) { /*TODO: understand the format & cmds of the backup-ram,maybe it's an unemulated tmp68301 feature?*/ - if(activecpu_get_previouspc() == 0x02c08e) + if(cpu_get_previouspc(machine->activecpu) == 0x02c08e) return 0xffff; else return backup_ram[offset]; @@ -135,7 +135,7 @@ static READ16_HANDLER( backup_ram_dx_r ) { /*TODO: understand the format & cmds of the backup-ram,maybe it's an unemulated tmp68301 feature?*/ - if(activecpu_get_previouspc() == 0x02f046) + if(cpu_get_previouspc(machine->activecpu) == 0x02f046) return 0xffff; else return backup_ram[offset]; diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c index c5b62adabaf..a16d1d8baa6 100644 --- a/src/mame/drivers/rmhaihai.c +++ b/src/mame/drivers/rmhaihai.c @@ -76,8 +76,8 @@ static READ8_HANDLER( keyboard_r ) { static const char *const keynames[] = { "KEY0", "KEY1" }; - logerror("%04x: keyboard_r\n",activecpu_get_pc()); - switch(activecpu_get_pc()) + logerror("%04x: keyboard_r\n",cpu_get_pc(machine->activecpu)); + switch(cpu_get_pc(machine->activecpu)) { /* read keyboard */ case 0x0aba: // rmhaihai, rmhaisei @@ -124,7 +124,7 @@ static READ8_HANDLER( keyboard_r ) static WRITE8_HANDLER( keyboard_w ) { -logerror("%04x: keyboard_w %02x\n",activecpu_get_pc(),data); +logerror("%04x: keyboard_w %02x\n",cpu_get_pc(machine->activecpu),data); keyboard_cmd = data; } diff --git a/src/mame/drivers/rollerg.c b/src/mame/drivers/rollerg.c index cc0ea744e45..c0e3f840cb2 100644 --- a/src/mame/drivers/rollerg.c +++ b/src/mame/drivers/rollerg.c @@ -27,7 +27,7 @@ static int readzoomroms; static WRITE8_HANDLER( rollerg_0010_w ) { -logerror("%04x: write %02x to 0010\n",activecpu_get_pc(),data); +logerror("%04x: write %02x to 0010\n",cpu_get_pc(machine->activecpu),data); /* bits 0/1 are coin counters */ coin_counter_w(0,data & 0x01); @@ -343,7 +343,7 @@ static void rollerg_banking( int lines ) static MACHINE_RESET( rollerg ) { - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)rollerg_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)rollerg_banking); readzoomroms = 0; } diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c index dae0c300d5d..81204061394 100644 --- a/src/mame/drivers/route16.c +++ b/src/mame/drivers/route16.c @@ -897,9 +897,9 @@ ROM_END static READ8_HANDLER( routex_prot_read ) { - if (activecpu_get_pc() == 0x2f) return 0xfb; + if (cpu_get_pc(machine->activecpu) == 0x2f) return 0xfb; - logerror ("cpu #%d (PC=%08X): unmapped prot read\n", cpu_getactivecpu(), activecpu_get_pc()); + logerror ("cpu #%d (PC=%08X): unmapped prot read\n", cpunum_get_active(), cpu_get_pc(machine->activecpu)); return 0x00; } diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c index 91a330805f7..91110383d74 100644 --- a/src/mame/drivers/royalmah.c +++ b/src/mame/drivers/royalmah.c @@ -290,7 +290,7 @@ static WRITE8_HANDLER ( suzume_bank_w ) suzume_bank = data; -logerror("%04x: bank %02x\n",activecpu_get_pc(),data); +logerror("%04x: bank %02x\n",cpu_get_pc(machine->activecpu),data); /* bits 6, 4 and 3 used for something input related? */ @@ -325,7 +325,7 @@ static WRITE8_HANDLER ( tontonb_bank_w ) UINT8 *rom = memory_region(machine, "main"); int address; -logerror("%04x: bank %02x\n",activecpu_get_pc(),data); +logerror("%04x: bank %02x\n",cpu_get_pc(machine->activecpu),data); if (data == 0) return; // tontonb fix? @@ -343,7 +343,7 @@ static WRITE8_HANDLER ( dynax_bank_w ) UINT8 *rom = memory_region(machine, "main"); int address; -//logerror("%04x: bank %02x\n",activecpu_get_pc(),data); +//logerror("%04x: bank %02x\n",cpu_get_pc(machine->activecpu),data); dsw_select = data & 0x60; @@ -582,7 +582,7 @@ static READ8_HANDLER( mjifb_rom_io_r ) case 0x9011: return input_port_read(machine, "SYSTEM"); } - logerror("%04X: unmapped input read at %04X\n", activecpu_get_pc(), offset); + logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -610,7 +610,7 @@ static WRITE8_HANDLER( mjifb_rom_io_w ) return; } - logerror("%04X: unmapped input write at %04X = %02X\n", activecpu_get_pc(), offset,data); + logerror("%04X: unmapped input write at %04X = %02X\n", cpu_get_pc(machine->activecpu), offset,data); } static WRITE8_HANDLER( mjifb_videoram_w ) @@ -689,7 +689,7 @@ static READ8_HANDLER( mjdejavu_rom_io_r ) case 0x9011: return input_port_read(machine, "SYSTEM"); } - logerror("%04X: unmapped input read at %04X\n", activecpu_get_pc(), offset); + logerror("%04X: unmapped input read at %04X\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -714,7 +714,7 @@ static WRITE8_HANDLER( mjdejavu_rom_io_w ) return; } - logerror("%04X: unmapped input write at %04X = %02X\n", activecpu_get_pc(), offset,data); + logerror("%04X: unmapped input write at %04X = %02X\n", cpu_get_pc(machine->activecpu), offset,data); } static ADDRESS_MAP_START( mjdejavu_map, ADDRESS_SPACE_PROGRAM, 8 ) @@ -805,7 +805,7 @@ static READ8_HANDLER( cafetime_dsw_r ) case 0x03: return input_port_read(machine, "DSW4"); case 0x04: return input_port_read(machine, "DSWTOP"); } - logerror("%04X: unmapped dsw read %02X\n", activecpu_get_pc(), dsw_select); + logerror("%04X: unmapped dsw read %02X\n", cpu_get_pc(machine->activecpu), dsw_select); return 0xff; } diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c index 0641f8fa168..49cdc4355dc 100644 --- a/src/mame/drivers/sandscrp.c +++ b/src/mame/drivers/sandscrp.c @@ -235,7 +235,7 @@ static WRITE8_HANDLER( sandscrp_bankswitch_w ) UINT8 *RAM = memory_region(machine, "main"); int bank = data & 0x07; - if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); + if ( bank != data ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(machine->activecpu),data); if (bank < 3) RAM = &RAM[0x4000 * bank]; else RAM = &RAM[0x4000 * (bank-3) + 0x10000]; diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c index b8c3112beda..fefd9683033 100644 --- a/src/mame/drivers/scramble.c +++ b/src/mame/drivers/scramble.c @@ -451,7 +451,7 @@ ADDRESS_MAP_END static READ8_HANDLER( hncholms_prot_r ) { - if(activecpu_get_pc() == 0x2b || activecpu_get_pc() == 0xa27) + if(cpu_get_pc(machine->activecpu) == 0x2b || cpu_get_pc(machine->activecpu) == 0xa27) return 1; else return 0; diff --git a/src/mame/drivers/sderby.c b/src/mame/drivers/sderby.c index bcc22174c37..975d0bd3aba 100644 --- a/src/mame/drivers/sderby.c +++ b/src/mame/drivers/sderby.c @@ -91,7 +91,7 @@ static READ16_HANDLER ( sderby_input_r ) return 0xffff; // to avoid game to reset (needs more work) } - logerror("sderby_input_r : offset = %x - PC = %06x\n",offset*2,activecpu_get_pc()); + logerror("sderby_input_r : offset = %x - PC = %06x\n",offset*2,cpu_get_pc(machine->activecpu)); return 0xffff; } @@ -135,7 +135,7 @@ static READ16_HANDLER( roulette_input_r ) static READ16_HANDLER( rprot_r ) { - logerror("rprot_r : offset = %02x\n",activecpu_get_pc()); + logerror("rprot_r : offset = %02x\n",cpu_get_pc(machine->activecpu)); /* This is the only mask I found that allow a normal play. Using other values, the game hangs waiting for response, diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c index 964ac211097..e3aba6b678e 100644 --- a/src/mame/drivers/seattle.c +++ b/src/mame/drivers/seattle.c @@ -511,20 +511,20 @@ static MACHINE_START( seattle ) galileo.timer[3].timer = timer_alloc(galileo_timer_callback, NULL); /* set the fastest DRC options, but strict verification */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x007fffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); - - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x007fffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); + + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); /* register for save states */ state_save_register_global_array(galileo.reg); @@ -574,8 +574,8 @@ static MACHINE_RESET( seattle ) } else if (mame_find_cpu_index(machine, "cage") != -1) { - cage_control_w(0); - cage_control_w(3); + cage_control_w(machine, 0); + cage_control_w(machine, 3); } /* reset the other devices */ @@ -764,7 +764,7 @@ static void vblank_assert(running_machine *machine, int state) * *************************************/ -static UINT32 pci_bridge_r(UINT8 reg, UINT8 type) +static UINT32 pci_bridge_r(running_machine *machine, UINT8 reg, UINT8 type) { UINT32 result = galileo.pci_bridge_regs[reg]; @@ -780,16 +780,16 @@ static UINT32 pci_bridge_r(UINT8 reg, UINT8 type) } if (LOG_PCI) - logerror("%08X:PCI bridge read: reg %d type %d = %08X\n", activecpu_get_pc(), reg, type, result); + logerror("%08X:PCI bridge read: reg %d type %d = %08X\n", cpu_get_pc(machine->activecpu), reg, type, result); return result; } -static void pci_bridge_w(UINT8 reg, UINT8 type, UINT32 data) +static void pci_bridge_w(running_machine *machine, UINT8 reg, UINT8 type, UINT32 data) { galileo.pci_bridge_regs[reg] = data; if (LOG_PCI) - logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", activecpu_get_pc(), reg, type, data); + logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", cpu_get_pc(machine->activecpu), reg, type, data); } @@ -800,7 +800,7 @@ static void pci_bridge_w(UINT8 reg, UINT8 type, UINT32 data) * *************************************/ -static UINT32 pci_3dfx_r(UINT8 reg, UINT8 type) +static UINT32 pci_3dfx_r(running_machine *machine, UINT8 reg, UINT8 type) { UINT32 result = galileo.pci_3dfx_regs[reg]; @@ -816,12 +816,12 @@ static UINT32 pci_3dfx_r(UINT8 reg, UINT8 type) } if (LOG_PCI) - logerror("%08X:PCI 3dfx read: reg %d type %d = %08X\n", activecpu_get_pc(), reg, type, result); + logerror("%08X:PCI 3dfx read: reg %d type %d = %08X\n", cpu_get_pc(machine->activecpu), reg, type, result); return result; } -static void pci_3dfx_w(UINT8 reg, UINT8 type, UINT32 data) +static void pci_3dfx_w(running_machine *machine, UINT8 reg, UINT8 type, UINT32 data) { galileo.pci_3dfx_regs[reg] = data; @@ -838,7 +838,7 @@ static void pci_3dfx_w(UINT8 reg, UINT8 type, UINT32 data) break; } if (LOG_PCI) - logerror("%08X:PCI 3dfx write: reg %d type %d = %08X\n", activecpu_get_pc(), reg, type, data); + logerror("%08X:PCI 3dfx write: reg %d type %d = %08X\n", cpu_get_pc(machine->activecpu), reg, type, data); } @@ -849,7 +849,7 @@ static void pci_3dfx_w(UINT8 reg, UINT8 type, UINT32 data) * *************************************/ -static UINT32 pci_ide_r(UINT8 reg, UINT8 type) +static UINT32 pci_ide_r(running_machine *machine, UINT8 reg, UINT8 type) { UINT32 result = galileo.pci_ide_regs[reg]; @@ -865,16 +865,16 @@ static UINT32 pci_ide_r(UINT8 reg, UINT8 type) } if (LOG_PCI) - logerror("%08X:PCI IDE read: reg %d type %d = %08X\n", activecpu_get_pc(), reg, type, result); + logerror("%08X:PCI IDE read: reg %d type %d = %08X\n", cpu_get_pc(machine->activecpu), reg, type, result); return result; } -static void pci_ide_w(UINT8 reg, UINT8 type, UINT32 data) +static void pci_ide_w(running_machine *machine, UINT8 reg, UINT8 type, UINT32 data) { galileo.pci_ide_regs[reg] = data; if (LOG_PCI) - logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", activecpu_get_pc(), reg, type, data); + logerror("%08X:PCI bridge write: reg %d type %d = %08X\n", cpu_get_pc(machine->activecpu), reg, type, data); } @@ -1102,7 +1102,7 @@ static READ32_HANDLER( galileo_r ) activecpu_eat_cycles(100); if (LOG_TIMERS) - logerror("%08X:hires_timer_r = %08X\n", activecpu_get_pc(), result); + logerror("%08X:hires_timer_r = %08X\n", cpu_get_pc(machine->activecpu), result); break; } @@ -1121,21 +1121,21 @@ static READ32_HANDLER( galileo_r ) /* unit 0 is the PCI bridge */ if (unit == 0 && func == 0) - result = pci_bridge_r(reg, type); + result = pci_bridge_r(machine, reg, type); /* unit 8 is the 3dfx card */ else if (unit == 8 && func == 0) - result = pci_3dfx_r(reg, type); + result = pci_3dfx_r(machine, reg, type); /* unit 9 is the IDE controller */ else if (unit == 9 && func == 0) - result = pci_ide_r(reg, type); + result = pci_ide_r(machine, reg, type); /* anything else, just log */ else { result = ~0; - logerror("%08X:PCIBus read: bus %d unit %d func %d reg %d type %d = %08X\n", activecpu_get_pc(), bus, unit, func, reg, type, result); + logerror("%08X:PCIBus read: bus %d unit %d func %d reg %d type %d = %08X\n", cpu_get_pc(machine->activecpu), bus, unit, func, reg, type, result); } break; } @@ -1145,11 +1145,11 @@ static READ32_HANDLER( galileo_r ) case GREG_INT_MASK: case GREG_TIMER_CONTROL: // if (LOG_GALILEO) -// logerror("%08X:Galileo read from offset %03X = %08X\n", activecpu_get_pc(), offset*4, result); +// logerror("%08X:Galileo read from offset %03X = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); break; default: - logerror("%08X:Galileo read from offset %03X = %08X\n", activecpu_get_pc(), offset*4, result); + logerror("%08X:Galileo read from offset %03X = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); break; } @@ -1173,7 +1173,7 @@ static WRITE32_HANDLER( galileo_w ) int which = offset % 4; if (LOG_DMA) - logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); /* keep the read only activity bit */ galileo.reg[offset] &= ~0x4000; @@ -1203,7 +1203,7 @@ static WRITE32_HANDLER( galileo_w ) if (!timer->active) timer->count = data; if (LOG_TIMERS) - logerror("%08X:timer/counter %d count = %08X [start=%08X]\n", activecpu_get_pc(), offset % 4, data, timer->count); + logerror("%08X:timer/counter %d count = %08X [start=%08X]\n", cpu_get_pc(machine->activecpu), offset % 4, data, timer->count); break; } @@ -1212,7 +1212,7 @@ static WRITE32_HANDLER( galileo_w ) int which, mask; if (LOG_TIMERS) - logerror("%08X:timer/counter control = %08X\n", activecpu_get_pc(), data); + logerror("%08X:timer/counter control = %08X\n", cpu_get_pc(machine->activecpu), data); for (which = 0, mask = 0x01; which < 4; which++, mask <<= 2) { galileo_timer *timer = &galileo.timer[which]; @@ -1259,19 +1259,19 @@ static WRITE32_HANDLER( galileo_w ) /* unit 0 is the PCI bridge */ if (unit == 0 && func == 0) - pci_bridge_w(reg, type, data); + pci_bridge_w(machine, reg, type, data); /* unit 8 is the 3dfx card */ else if (unit == 8 && func == 0) - pci_3dfx_w(reg, type, data); + pci_3dfx_w(machine, reg, type, data); /* unit 9 is the IDE controller */ else if (unit == 9 && func == 0) - pci_ide_w(reg, type, data); + pci_ide_w(machine, reg, type, data); /* anything else, just log */ else - logerror("%08X:PCIBus write: bus %d unit %d func %d reg %d type %d = %08X\n", activecpu_get_pc(), bus, unit, func, reg, type, data); + logerror("%08X:PCIBus write: bus %d unit %d func %d reg %d type %d = %08X\n", cpu_get_pc(machine->activecpu), bus, unit, func, reg, type, data); break; } @@ -1282,11 +1282,11 @@ static WRITE32_HANDLER( galileo_w ) case GREG_CONFIG_ADDRESS: case GREG_INT_MASK: if (LOG_GALILEO) - logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); break; default: - logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + logerror("%08X:Galileo write to offset %03X = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); break; } } @@ -1320,7 +1320,7 @@ static WRITE32_DEVICE_HANDLER( seattle_voodoo_w ) /* spin until we send the magic trigger */ cpunum_spinuntil_trigger(0, 45678); - if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo (already stalled)\n", activecpu_get_pc()); + if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo (already stalled)\n", cpu_get_pc(device->machine->activecpu)); } @@ -1339,7 +1339,7 @@ static void voodoo_stall(const device_config *device, int stall) } else { - if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", activecpu_get_pc()); + if (LOG_DMA) logerror("%08X:Stalling CPU on voodoo\n", cpu_get_pc(device->machine->activecpu)); cpunum_spinuntil_trigger(0, 45678); } } @@ -1359,9 +1359,9 @@ static void voodoo_stall(const device_config *device, int stall) galileo.dma_stalled_on_voodoo[which] = FALSE; /* resume execution */ - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); galileo_perform_dma(device->machine, which); - cpuintrf_pop_context(); + cpu_pop_context(); break; } @@ -1399,7 +1399,7 @@ static WRITE32_HANDLER( analog_port_w ) static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" }; if (data < 8 || data > 15) - logerror("%08X:Unexpected analog port select = %08X\n", activecpu_get_pc(), data); + logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(machine->activecpu), data); pending_analog_read = input_port_read(machine, portnames[data & 7]); } @@ -2785,12 +2785,12 @@ static void init_common(running_machine *machine, int ioasic, int serialnum, int speedup_index = 0; } -static void add_speedup(offs_t pc, UINT32 op) +static void add_speedup(running_machine *machine, offs_t pc, UINT32 op) { - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_HOTSPOT_SELECT, speedup_index++); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_HOTSPOT_PC, pc); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_HOTSPOT_OPCODE, op); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_HOTSPOT_CYCLES, 250); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_SELECT, speedup_index++); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_PC, pc); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_OPCODE, op); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_CYCLES, 250); } @@ -2800,9 +2800,9 @@ static DRIVER_INIT( wg3dh ) init_common(machine, MIDWAY_IOASIC_STANDARD, 310/* others? */, 80, PHOENIX_CONFIG); /* speedups */ - add_speedup(0x8004413C, 0x0C0054B4); /* confirmed */ - add_speedup(0x80094930, 0x00A2102B); /* confirmed */ - add_speedup(0x80092984, 0x3C028011); /* confirmed */ + add_speedup(machine, 0x8004413C, 0x0C0054B4); /* confirmed */ + add_speedup(machine, 0x80094930, 0x00A2102B); /* confirmed */ + add_speedup(machine, 0x80092984, 0x3C028011); /* confirmed */ } @@ -2812,7 +2812,7 @@ static DRIVER_INIT( mace ) init_common(machine, MIDWAY_IOASIC_MACE, 319/* others? */, 80, SEATTLE_CONFIG); /* speedups */ - add_speedup(0x800108F8, 0x8C420000); /* confirmed */ + add_speedup(machine, 0x800108F8, 0x8C420000); /* confirmed */ } @@ -2822,9 +2822,9 @@ static DRIVER_INIT( sfrush ) init_common(machine, MIDWAY_IOASIC_STANDARD, 315/* no alternates */, 100, FLAGSTAFF_CONFIG); /* speedups */ - add_speedup(0x80059F34, 0x3C028012); /* confirmed */ - add_speedup(0x800A5AF4, 0x8E300010); /* confirmed */ - add_speedup(0x8004C260, 0x3C028012); /* confirmed */ + add_speedup(machine, 0x80059F34, 0x3C028012); /* confirmed */ + add_speedup(machine, 0x800A5AF4, 0x8E300010); /* confirmed */ + add_speedup(machine, 0x8004C260, 0x3C028012); /* confirmed */ } @@ -2834,10 +2834,10 @@ static DRIVER_INIT( sfrushrk ) init_common(machine, MIDWAY_IOASIC_SFRUSHRK, 331/* unknown */, 100, FLAGSTAFF_CONFIG); /* speedups */ - add_speedup(0x800343E8, 0x3C028012); /* confirmed */ - add_speedup(0x8008F4F0, 0x3C028012); /* confirmed */ - add_speedup(0x800A365C, 0x8E300014); /* confirmed */ - add_speedup(0x80051DAC, 0x3C028012); /* confirmed */ + add_speedup(machine, 0x800343E8, 0x3C028012); /* confirmed */ + add_speedup(machine, 0x8008F4F0, 0x3C028012); /* confirmed */ + add_speedup(machine, 0x800A365C, 0x8E300014); /* confirmed */ + add_speedup(machine, 0x80051DAC, 0x3C028012); /* confirmed */ } @@ -2848,8 +2848,8 @@ static DRIVER_INIT( calspeed ) midway_ioasic_set_auto_ack(1); /* speedups */ - add_speedup(0x80032534, 0x02221024); /* confirmed */ - add_speedup(0x800B1BE4, 0x8E110014); /* confirmed */ + add_speedup(machine, 0x80032534, 0x02221024); /* confirmed */ + add_speedup(machine, 0x800B1BE4, 0x8E110014); /* confirmed */ } @@ -2859,9 +2859,9 @@ static DRIVER_INIT( vaportrx ) init_common(machine, MIDWAY_IOASIC_VAPORTRX, 324/* 334? unknown */, 100, SEATTLE_WIDGET_CONFIG); /* speedups */ - add_speedup(0x80049F14, 0x3C028020); /* confirmed */ - add_speedup(0x8004859C, 0x3C028020); /* confirmed */ - add_speedup(0x8005922C, 0x8E020014); /* confirmed */ + add_speedup(machine, 0x80049F14, 0x3C028020); /* confirmed */ + add_speedup(machine, 0x8004859C, 0x3C028020); /* confirmed */ + add_speedup(machine, 0x8005922C, 0x8E020014); /* confirmed */ } @@ -2883,8 +2883,8 @@ static DRIVER_INIT( blitz ) rombase[0x934/4] += 4; /* main CPU speedups */ - add_speedup(0x80135510, 0x3C028024); /* confirmed */ - add_speedup(0x800087DC, 0x8E820010); /* confirmed */ + add_speedup(machine, 0x80135510, 0x3C028024); /* confirmed */ + add_speedup(machine, 0x800087DC, 0x8E820010); /* confirmed */ } @@ -2894,8 +2894,8 @@ static DRIVER_INIT( blitz99 ) init_common(machine, MIDWAY_IOASIC_BLITZ99, 481/* or 484 or 520 */, 80, SEATTLE_CONFIG); /* speedups */ - add_speedup(0x8014E41C, 0x3C038025); /* confirmed */ - add_speedup(0x80011F10, 0x8E020018); /* confirmed */ + add_speedup(machine, 0x8014E41C, 0x3C038025); /* confirmed */ + add_speedup(machine, 0x80011F10, 0x8E020018); /* confirmed */ } @@ -2905,8 +2905,8 @@ static DRIVER_INIT( blitz2k ) init_common(machine, MIDWAY_IOASIC_BLITZ99, 494/* or 498 */, 80, SEATTLE_CONFIG); /* speedups */ - add_speedup(0x8015773C, 0x3C038025); /* confirmed */ - add_speedup(0x80012CA8, 0x8E020018); /* confirmed */ + add_speedup(machine, 0x8015773C, 0x3C038025); /* confirmed */ + add_speedup(machine, 0x80012CA8, 0x8E020018); /* confirmed */ } @@ -2919,8 +2919,8 @@ static DRIVER_INIT( carnevil ) memory_install_readwrite32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x16800000, 0x1680001f, 0, 0, carnevil_gun_r, carnevil_gun_w); /* speedups */ - add_speedup(0x8015176C, 0x3C03801A); /* confirmed */ - add_speedup(0x80011FBC, 0x8E020018); /* confirmed */ + add_speedup(machine, 0x8015176C, 0x3C03801A); /* confirmed */ + add_speedup(machine, 0x80011FBC, 0x8E020018); /* confirmed */ } @@ -2930,9 +2930,9 @@ static DRIVER_INIT( hyprdriv ) init_common(machine, MIDWAY_IOASIC_HYPRDRIV, 469/* unknown */, 80, SEATTLE_WIDGET_CONFIG); /* speedups */ - add_speedup(0x801643BC, 0x3C03801B); /* confirmed */ - add_speedup(0x80011FB8, 0x8E020018); /* confirmed */ - //add_speedup(0x80136A80, 0x3C02801D); /* potential */ + add_speedup(machine, 0x801643BC, 0x3C03801B); /* confirmed */ + add_speedup(machine, 0x80011FB8, 0x8E020018); /* confirmed */ + //add_speedup(machine, 0x80136A80, 0x3C02801D); /* potential */ } diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c index 4ec62d0ecb1..c619aa02868 100644 --- a/src/mame/drivers/segac2.c +++ b/src/mame/drivers/segac2.c @@ -529,7 +529,7 @@ static WRITE16_HANDLER( control_w ) /* protection chip reads */ static READ16_HANDLER( prot_r ) { - if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", activecpu_get_previouspc(), prot_func ? prot_read_buf : 0xff); + if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", cpu_get_previouspc(machine->activecpu), prot_func ? prot_read_buf : 0xff); return prot_read_buf | 0xf0; } @@ -554,7 +554,7 @@ static WRITE16_HANDLER( prot_w ) /* determine the value to return, should a read occur */ if (prot_func) prot_read_buf = prot_func(table_index); - if (LOG_PROTECTION) logerror("%06X:protection w=%02X, new result=%02X\n", activecpu_get_previouspc(), data & 0x0f, prot_read_buf); + if (LOG_PROTECTION) logerror("%06X:protection w=%02X, new result=%02X\n", cpu_get_previouspc(machine->activecpu), data & 0x0f, prot_read_buf); /* if the palette changed, force an update */ if (new_sp_palbase != sp_palbase || new_bg_palbase != bg_palbase) diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c index 449e6561151..e214e6d683b 100644 --- a/src/mame/drivers/segag80r.c +++ b/src/mame/drivers/segag80r.c @@ -183,16 +183,16 @@ static MACHINE_RESET( pignewt ) * *************************************/ -static offs_t decrypt_offset(offs_t offset) +static offs_t decrypt_offset(running_machine *machine, offs_t offset) { offs_t pc; /* if no active CPU, don't do anything */ - if (cpu_getactivecpu() == -1) + if (cpunum_get_active() == -1) return offset; /* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */ - pc = activecpu_get_previouspc(); + pc = cpu_get_previouspc(machine->activecpu); if ((UINT16)pc == 0xffff || program_read_byte(pc) != 0x32) return offset; @@ -200,12 +200,12 @@ static offs_t decrypt_offset(offs_t offset) return (offset & 0xff00) | (*sega_decrypt)(pc, program_read_byte(pc + 1)); } -static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(offset)] = data; } -static WRITE8_HANDLER( vidram_w ) { segag80r_videoram_w(machine, decrypt_offset(offset), data); } -static WRITE8_HANDLER( monsterb_vidram_w ) { monsterb_videoram_w(machine, decrypt_offset(offset), data); } -static WRITE8_HANDLER( pignewt_vidram_w ) { pignewt_videoram_w(machine, decrypt_offset(offset), data); } -static WRITE8_HANDLER( sindbadm_vidram_w ) { sindbadm_videoram_w(machine, decrypt_offset(offset), data); } -static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(machine, decrypt_offset(offset), data); } +static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(machine, offset)] = data; } +static WRITE8_HANDLER( vidram_w ) { segag80r_videoram_w(machine, decrypt_offset(machine, offset), data); } +static WRITE8_HANDLER( monsterb_vidram_w ) { monsterb_videoram_w(machine, decrypt_offset(machine, offset), data); } +static WRITE8_HANDLER( pignewt_vidram_w ) { pignewt_videoram_w(machine, decrypt_offset(machine, offset), data); } +static WRITE8_HANDLER( sindbadm_vidram_w ) { sindbadm_videoram_w(machine, decrypt_offset(machine, offset), data); } +static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(machine, decrypt_offset(machine, offset), data); } diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c index ce31ecb91e4..6c449d694c9 100644 --- a/src/mame/drivers/segag80v.c +++ b/src/mame/drivers/segag80v.c @@ -212,16 +212,16 @@ static MACHINE_RESET( g80v ) * *************************************/ -static offs_t decrypt_offset(offs_t offset) +static offs_t decrypt_offset(running_machine *machine, offs_t offset) { offs_t pc; /* if no active CPU, don't do anything */ - if (cpu_getactivecpu() == -1) + if (cpunum_get_active() == -1) return offset; /* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */ - pc = activecpu_get_previouspc(); + pc = cpu_get_previouspc(machine->activecpu); if ((UINT16)pc == 0xffff || program_read_byte(pc) != 0x32) return offset; @@ -229,9 +229,9 @@ static offs_t decrypt_offset(offs_t offset) return (offset & 0xff00) | (*sega_decrypt)(pc, program_read_byte(pc + 1)); } -static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(offset)] = data; } -static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(machine, decrypt_offset(offset), data); } -static WRITE8_HANDLER( vectorram_w ) { vectorram[decrypt_offset(offset)] = data; } +static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(machine, offset)] = data; } +static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(machine, decrypt_offset(machine, offset), data); } +static WRITE8_HANDLER( vectorram_w ) { vectorram[decrypt_offset(machine, offset)] = data; } @@ -385,7 +385,7 @@ static WRITE8_HANDLER( unknown_w ) /* writing an 0x04 here enables interrupts */ /* some games write 0x00/0x01 here as well */ if (data != 0x00 && data != 0x01 && data != 0x04) - mame_printf_debug("%04X:unknown_w = %02X\n", activecpu_get_pc(), data); + mame_printf_debug("%04X:unknown_w = %02X\n", cpu_get_pc(machine->activecpu), data); } diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c index 12f77e7505d..f21d489eb4f 100644 --- a/src/mame/drivers/segahang.c +++ b/src/mame/drivers/segahang.c @@ -173,7 +173,7 @@ static READ16_HANDLER( hangon_io_r ) } } - logerror("%06X:hangon_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); + logerror("%06X:hangon_io_r - unknown read access to address %04X\n", cpu_get_pc(machine->activecpu), offset * 2); return segaic16_open_bus_r(machine,0,mem_mask); } @@ -197,7 +197,7 @@ static WRITE16_HANDLER( hangon_io_w ) return; } - logerror("%06X:hangon_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask); + logerror("%06X:hangon_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset * 2, data, mem_mask); } @@ -225,7 +225,7 @@ static READ16_HANDLER( sharrier_io_r ) } } - logerror("%06X:sharrier_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); + logerror("%06X:sharrier_io_r - unknown read access to address %04X\n", cpu_get_pc(machine->activecpu), offset * 2); return segaic16_open_bus_r(machine,0,mem_mask); } @@ -249,7 +249,7 @@ static WRITE16_HANDLER( sharrier_io_w ) return; } - logerror("%06X:sharrier_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask); + logerror("%06X:sharrier_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset * 2, data, mem_mask); } diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c index dd1808be796..f984a7e8e56 100644 --- a/src/mame/drivers/segald.c +++ b/src/mame/drivers/segald.c @@ -97,26 +97,26 @@ static READ8_HANDLER( astron_DISC_read ) if (nmi_enable) ldv1000_input_latch = laserdisc_data_r(laserdisc); - logerror("DISC read (0x%04x) @ 0x%04x [0x%x]\n", ldv1000_input_latch, offset, activecpu_get_pc()); + logerror("DISC read (0x%04x) @ 0x%04x [0x%x]\n", ldv1000_input_latch, offset, cpu_get_pc(machine->activecpu)); return ldv1000_input_latch; } static READ8_HANDLER( astron_OUT_read ) { - logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", out_RAM[offset], offset, activecpu_get_pc()); + logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", out_RAM[offset], offset, cpu_get_pc(machine->activecpu)); return out_RAM[offset]; } static READ8_HANDLER( astron_OBJ_read ) { - logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", obj_RAM[offset], offset, activecpu_get_pc()); + logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", obj_RAM[offset], offset, cpu_get_pc(machine->activecpu)); return obj_RAM[offset]; } static READ8_HANDLER( astron_COLOR_read ) { - logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", color_RAM[offset], offset, activecpu_get_pc()); + logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", color_RAM[offset], offset, cpu_get_pc(machine->activecpu)); return color_RAM[offset]; } @@ -124,7 +124,7 @@ static READ8_HANDLER( astron_COLOR_read ) /* WRITES */ static WRITE8_HANDLER( astron_DISC_write ) { - logerror("DISC write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, activecpu_get_pc()); + logerror("DISC write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(machine->activecpu)); ldv1000_output_latch = data; @@ -134,7 +134,7 @@ static WRITE8_HANDLER( astron_DISC_write ) static WRITE8_HANDLER( astron_OUT_write ) { - logerror("OUT write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, activecpu_get_pc()); + logerror("OUT write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(machine->activecpu)); switch(offset) { @@ -171,7 +171,7 @@ static WRITE8_HANDLER( astron_OUT_write ) static WRITE8_HANDLER( astron_OBJ_write ) { obj_RAM[offset] = data; - logerror("OBJ write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, activecpu_get_pc()); + logerror("OBJ write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(machine->activecpu)); } static WRITE8_HANDLER( astron_COLOR_write ) @@ -194,13 +194,13 @@ static WRITE8_HANDLER( astron_COLOR_write ) a = (highBits & 0x80) ? 0 : 255; palette_set_color(machine, palIndex, MAKE_ARGB(a, r, g, b)); - logerror("COLOR write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, activecpu_get_pc()); + logerror("COLOR write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(machine->activecpu)); } static WRITE8_HANDLER( astron_FIX_write ) { fix_RAM[offset] = data; - /* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, activecpu_get_pc()); */ + /* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(machine->activecpu)); */ } static WRITE8_HANDLER( astron_io_bankswitch_w ) diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c index d885785a1a0..282fafb9a78 100644 --- a/src/mame/drivers/segaorun.c +++ b/src/mame/drivers/segaorun.c @@ -257,7 +257,7 @@ static MACHINE_RESET( outrun ) segaic16_tilemap_reset(0); /* hook the RESET line, which resets CPU #1 */ - cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)outrun_reset); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)outrun_reset); /* start timers to track interrupts */ timer_set(video_screen_get_time_until_pos(machine->primary_screen, 223, 0), NULL, 223, scanline_callback); @@ -271,52 +271,52 @@ static MACHINE_RESET( outrun ) * *************************************/ -static void log_unknown_ppi_read( unsigned port ) +static void log_unknown_ppi_read( running_machine *machine, unsigned port ) { static const char ports[] = "ABC"; - logerror("%06X:read from 8255 port %c\n", activecpu_get_pc(), ports[port]); + logerror("%06X:read from 8255 port %c\n", cpu_get_pc(machine->activecpu), ports[port]); } -static void log_unknown_ppi_write( unsigned port, UINT8 data ) +static void log_unknown_ppi_write( running_machine *machine, unsigned port, UINT8 data ) { static const char ports[] = "ABC"; - logerror("%06X:write %02X to 8255 port %c\n", activecpu_get_pc(), data, ports[port]); + logerror("%06X:write %02X to 8255 port %c\n", cpu_get_pc(machine->activecpu), data, ports[port]); } static READ8_DEVICE_HANDLER( unknown_porta_r ) { - log_unknown_ppi_read(0); + log_unknown_ppi_read(device->machine, 0); return 0; } static READ8_DEVICE_HANDLER( unknown_portb_r ) { - log_unknown_ppi_read(1); + log_unknown_ppi_read(device->machine, 1); return 0; } static READ8_DEVICE_HANDLER( unknown_portc_r ) { - log_unknown_ppi_read(2); + log_unknown_ppi_read(device->machine, 2); return 0; } static WRITE8_DEVICE_HANDLER( unknown_porta_w ) { - log_unknown_ppi_write(0, data); + log_unknown_ppi_write(device->machine, 0, data); } static WRITE8_DEVICE_HANDLER( unknown_portb_w ) { - log_unknown_ppi_write(1, data); + log_unknown_ppi_write(device->machine, 1, data); } @@ -347,7 +347,7 @@ static READ16_HANDLER( misc_io_r ) { if (custom_io_r) return custom_io_r(machine, offset, mem_mask); - logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); + logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(machine->activecpu), offset * 2); return segaic16_open_bus_r(machine,0,mem_mask); } @@ -359,7 +359,7 @@ static WRITE16_HANDLER( misc_io_w ) custom_io_w(machine, offset, data, mem_mask); return; } - logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask); + logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset * 2, data, mem_mask); } @@ -387,7 +387,7 @@ static READ16_HANDLER( outrun_custom_io_r ) return watchdog_reset_r(machine,0); } - logerror("%06X:outrun_custom_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); + logerror("%06X:outrun_custom_io_r - unknown read access to address %04X\n", cpu_get_pc(machine->activecpu), offset * 2); return segaic16_open_bus_r(machine,0,mem_mask); } @@ -425,7 +425,7 @@ static WRITE16_HANDLER( outrun_custom_io_w ) segaic16_sprites_draw_0_w(machine, offset, data, mem_mask); return; } - logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask); + logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset * 2, data, mem_mask); } @@ -449,7 +449,7 @@ static READ16_HANDLER( shangon_custom_io_r ) return input_port_read_safe(machine, ports[adc_select], 0x0010); } } - logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); + logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(machine->activecpu), offset * 2); return segaic16_open_bus_r(machine,0,mem_mask); } @@ -483,7 +483,7 @@ static WRITE16_HANDLER( shangon_custom_io_w ) /* ADC trigger */ return; } - logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask); + logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset * 2, data, mem_mask); } diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c index 9458df18ded..da8d348bb5e 100644 --- a/src/mame/drivers/segas16a.c +++ b/src/mame/drivers/segas16a.c @@ -281,7 +281,7 @@ static READ16_HANDLER( standard_io_r ) case 0x2000/2: return input_port_read(machine, (offset & 1) ? "DSW2" : "DSW1"); } - logerror("%06X:standard_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); + logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(machine->activecpu), offset * 2); return 0xffff; } @@ -298,7 +298,7 @@ static WRITE16_HANDLER( standard_io_w ) timer_call_after_resynch(NULL, ((offset & 3) << 8) | (data & 0xff), delayed_ppi8255_w); return; } - logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask); + logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset * 2, data, mem_mask); } diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c index 1cc1622185b..d56981b0c56 100644 --- a/src/mame/drivers/segas16b.c +++ b/src/mame/drivers/segas16b.c @@ -1143,7 +1143,7 @@ static READ16_HANDLER( standard_io_r ) case 0x2000/2: return input_port_read(machine, (offset & 1) ? "DSW1" : "DSW2"); } - logerror("%06X:standard_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); + logerror("%06X:standard_io_r - unknown read access to address %04X\n", cpu_get_pc(machine->activecpu), offset * 2); return segaic16_open_bus_r(machine,0,mem_mask); } @@ -1174,7 +1174,7 @@ static WRITE16_HANDLER( standard_io_w ) coin_counter_w(0, data & 0x01); return; } - logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask); + logerror("%06X:standard_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset * 2, data, mem_mask); } diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c index 1f26764d0ae..2f22c91a3ab 100644 --- a/src/mame/drivers/segas18.c +++ b/src/mame/drivers/segas18.c @@ -335,7 +335,7 @@ static READ16_HANDLER( misc_io_r ) } if (custom_io_r) return custom_io_r(machine, offset, mem_mask); - logerror("%06X:misc_io_r - unknown read access to address %04X\n", activecpu_get_pc(), offset * 2); + logerror("%06X:misc_io_r - unknown read access to address %04X\n", cpu_get_pc(machine->activecpu), offset * 2); return segaic16_open_bus_r(machine,0,mem_mask); } @@ -369,7 +369,7 @@ static WRITE16_HANDLER( misc_io_w ) custom_io_w(machine, offset, data, mem_mask); return; } - logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", activecpu_get_pc(), offset * 2, data, mem_mask); + logerror("%06X:misc_io_w - unknown write access to address %04X = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset * 2, data, mem_mask); } diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c index c7711c054b4..29e4b90387c 100644 --- a/src/mame/drivers/segas24.c +++ b/src/mame/drivers/segas24.c @@ -670,13 +670,13 @@ static READ16_HANDLER( hotrod3_ctrl_r ) static READ16_HANDLER( iod_r ) { - logerror("IO daughterboard read %02x (%x)\n", offset, activecpu_get_pc()); + logerror("IO daughterboard read %02x (%x)\n", offset, cpu_get_pc(machine->activecpu)); return 0xffff; } static WRITE16_HANDLER( iod_w ) { - logerror("IO daughterboard write %02x, %04x & %04x (%x)\n", offset, data, mem_mask, activecpu_get_pc()); + logerror("IO daughterboard write %02x, %04x & %04x (%x)\n", offset, data, mem_mask, cpu_get_pc(machine->activecpu)); } @@ -706,7 +706,7 @@ static void reset_reset(running_machine *machine) static void resetcontrol_w(UINT8 data) { resetcontrol = data; - logerror("Reset control %02x (%x:%x)\n", resetcontrol, cpu_getactivecpu(), activecpu_get_pc()); + logerror("Reset control %02x (%x:%x)\n", resetcontrol, cpunum_get_active(), cpu_get_pc(Machine->activecpu)); reset_reset(Machine); } @@ -782,7 +782,7 @@ static WRITE16_HANDLER( mlatch_w ) int i; UINT8 mxor = 0; if(!mlatch_table) { - logerror("Protection: magic latch accessed but no table loaded (%d:%x)\n", cpu_getactivecpu(), activecpu_get_pc()); + logerror("Protection: magic latch accessed but no table loaded (%d:%x)\n", cpunum_get_active(), cpu_get_pc(machine->activecpu)); return; } @@ -793,9 +793,9 @@ static WRITE16_HANDLER( mlatch_w ) if(mlatch & (1<<i)) mxor |= 1 << mlatch_table[i]; mlatch = data ^ mxor; - logerror("Magic latching %02x ^ %02x as %02x (%d:%x)\n", data & 0xff, mxor, mlatch, cpu_getactivecpu(), activecpu_get_pc()); + logerror("Magic latching %02x ^ %02x as %02x (%d:%x)\n", data & 0xff, mxor, mlatch, cpunum_get_active(), cpu_get_pc(machine->activecpu)); } else { - logerror("Magic latch reset (%d:%x)\n", cpu_getactivecpu(), activecpu_get_pc()); + logerror("Magic latch reset (%d:%x)\n", cpunum_get_active(), cpu_get_pc(machine->activecpu)); mlatch = 0x00; } } @@ -897,10 +897,9 @@ static WRITE16_HANDLER(irq_w) static READ16_HANDLER(irq_r) { - extern int activecpu; switch(offset) { case 0: { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(machine->activecpu); static int turns; if(pc == 0x84a4 || pc == 0x84a6) return 0; diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c index 4f2c2cc2203..b7944434625 100644 --- a/src/mame/drivers/segas32.c +++ b/src/mame/drivers/segas32.c @@ -449,7 +449,7 @@ static void int_control_w(running_machine *machine, int offset, UINT8 data) { int duration; -// logerror("%06X:int_control_w(%X) = %02X\n", activecpu_get_pc(), offset, data); +// logerror("%06X:int_control_w(%X) = %02X\n", cpu_get_pc(machine->activecpu), offset, data); switch (offset) { case 0: @@ -752,7 +752,7 @@ static READ16_HANDLER( io_expansion_r ) if (custom_io_r[0]) return (*custom_io_r[0])(machine, offset, mem_mask); else - logerror("%06X:io_expansion_r(%X)\n", activecpu_get_pc(), offset); + logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(machine->activecpu), offset); return 0xffff; } @@ -766,7 +766,7 @@ static WRITE16_HANDLER( io_expansion_w ) if (custom_io_w[0]) (*custom_io_w[0])(machine, offset, data, mem_mask); else - logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); + logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(machine->activecpu), offset, data & 0xff); } @@ -776,7 +776,7 @@ static READ32_HANDLER( io_expansion_0_r ) return (*custom_io_r[0])(machine, offset*2+0, mem_mask) | ((*custom_io_r[0])(machine, offset*2+1, mem_mask >> 16) << 16); else - logerror("%06X:io_expansion_r(%X)\n", activecpu_get_pc(), offset); + logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(machine->activecpu), offset); return 0xffffffff; } @@ -789,14 +789,14 @@ static WRITE32_HANDLER( io_expansion_0_w ) if (custom_io_w[0]) (*custom_io_w[0])(machine, offset*2+0, data, mem_mask); else - logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); + logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(machine->activecpu), offset, data & 0xff); } if (ACCESSING_BITS_16_23) { if (custom_io_w[0]) (*custom_io_w[0])(machine, offset*2+1, data >> 16, mem_mask >> 16); else - logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); + logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(machine->activecpu), offset, data & 0xff); } } @@ -807,7 +807,7 @@ static READ32_HANDLER( io_expansion_1_r ) return (*custom_io_r[1])(machine, offset*2+0, mem_mask) | ((*custom_io_r[1])(machine, offset*2+1, mem_mask >> 16) << 16); else - logerror("%06X:io_expansion_r(%X)\n", activecpu_get_pc(), offset); + logerror("%06X:io_expansion_r(%X)\n", cpu_get_pc(machine->activecpu), offset); return 0xffffffff; } @@ -820,14 +820,14 @@ static WRITE32_HANDLER( io_expansion_1_w ) if (custom_io_w[1]) (*custom_io_w[1])(machine, offset*2+0, data, mem_mask); else - logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); + logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(machine->activecpu), offset, data & 0xff); } if (ACCESSING_BITS_16_23) { if (custom_io_w[1]) (*custom_io_w[1])(machine, offset*2+1, data >> 16, mem_mask >> 16); else - logerror("%06X:io_expansion_w(%X) = %02X\n", activecpu_get_pc(), offset, data & 0xff); + logerror("%06X:io_expansion_w(%X) = %02X\n", cpu_get_pc(machine->activecpu), offset, data & 0xff); } } @@ -852,7 +852,7 @@ static READ16_HANDLER( analog_custom_io_r ) analog_value[offset & 3] <<= 1; return result; } - logerror("%06X:unknown analog_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask); + logerror("%06X:unknown analog_custom_io_r(%X) & %04X\n", cpu_get_pc(machine->activecpu), offset*2, mem_mask); return 0xffff; } @@ -869,7 +869,7 @@ static WRITE16_HANDLER( analog_custom_io_w ) analog_value[offset & 3] = input_port_read_safe(machine, names[offset & 3], 0); return; } - logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask); + logerror("%06X:unknown analog_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); } @@ -885,7 +885,7 @@ static READ16_HANDLER( extra_custom_io_r ) return input_port_read_safe(machine, names[offset & 3], 0xffff); } - logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask); + logerror("%06X:unknown extra_custom_io_r(%X) & %04X\n", cpu_get_pc(machine->activecpu), offset*2, mem_mask); return 0xffff; } @@ -906,7 +906,7 @@ static WRITE16_HANDLER( orunners_custom_io_w ) analog_bank = data & 1; return; } - logerror("%06X:unknown orunners_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask); + logerror("%06X:unknown orunners_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); } @@ -925,7 +925,7 @@ static READ16_HANDLER( sonic_custom_io_r ) return (UINT8)(input_port_read(machine, names[offset/2]) - sonic_last[offset/2]); } - logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", activecpu_get_pc(), offset*2, mem_mask); + logerror("%06X:unknown sonic_custom_io_r(%X) & %04X\n", cpu_get_pc(machine->activecpu), offset*2, mem_mask); return 0xffff; } @@ -944,7 +944,7 @@ static WRITE16_HANDLER( sonic_custom_io_w ) return; } - logerror("%06X:unknown sonic_custom_io_w(%X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask); + logerror("%06X:unknown sonic_custom_io_w(%X) = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); } @@ -957,7 +957,7 @@ static WRITE16_HANDLER( sonic_custom_io_w ) static WRITE16_HANDLER( random_number_16_w ) { -// mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask); +// mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); } static READ16_HANDLER( random_number_16_r ) @@ -967,7 +967,7 @@ static READ16_HANDLER( random_number_16_r ) static WRITE32_HANDLER( random_number_32_w ) { -// mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask); +// mame_printf_debug("%06X:random_seed_w(%04X) = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); } static READ32_HANDLER( random_number_32_r ) diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c index 5e1acb2adac..a5fa153397c 100644 --- a/src/mame/drivers/segaxbd.c +++ b/src/mame/drivers/segaxbd.c @@ -209,7 +209,7 @@ static MACHINE_RESET( xboard ) segaic16_tilemap_reset(0); /* hook the RESET line, which resets CPU #1 */ - cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)xboard_reset); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)xboard_reset); /* set up the compare/timer chip */ segaic16_compare_timer_init(0, sound_data_w, timer_ack_callback); @@ -468,14 +468,14 @@ static WRITE16_HANDLER( loffire_sync0_w ) static READ16_HANDLER( smgp_excs_r ) { - logerror("%06X:smgp_excs_r(%04X)\n", activecpu_get_pc(), offset*2); + logerror("%06X:smgp_excs_r(%04X)\n", cpu_get_pc(machine->activecpu), offset*2); return 0xffff; } static WRITE16_HANDLER( smgp_excs_w ) { - logerror("%06X:smgp_excs_w(%04X) = %04X & %04X\n", activecpu_get_pc(), offset*2, data, mem_mask); + logerror("%06X:smgp_excs_w(%04X) = %04X & %04X\n", cpu_get_pc(machine->activecpu), offset*2, data, mem_mask); } diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c index e14464626bd..42c72756754 100644 --- a/src/mame/drivers/seibuspi.c +++ b/src/mame/drivers/seibuspi.c @@ -695,12 +695,12 @@ static int fifoout_read_request = 0; static UINT8 sb_coin_latch = 0; -static UINT8 z80_fifoout_pop(void) +static UINT8 z80_fifoout_pop(running_machine *machine) { UINT8 r; if (fifoout_wpos == fifoout_rpos) { - logerror("Sound FIFOOUT underflow at %08X\n", activecpu_get_pc()); + logerror("Sound FIFOOUT underflow at %08X\n", cpu_get_pc(machine->activecpu)); } r = fifoout_data[fifoout_rpos++]; if(fifoout_rpos == FIFO_SIZE) @@ -716,7 +716,7 @@ static UINT8 z80_fifoout_pop(void) return r; } -static void z80_fifoout_push(UINT8 data) +static void z80_fifoout_push(running_machine *machine, UINT8 data) { fifoout_data[fifoout_wpos++] = data; if (fifoout_wpos == FIFO_SIZE) @@ -725,18 +725,18 @@ static void z80_fifoout_push(UINT8 data) } if(fifoout_wpos == fifoout_rpos) { - fatalerror("Sound FIFOOUT overflow at %08X", activecpu_get_pc()); + fatalerror("Sound FIFOOUT overflow at %08X", cpu_get_pc(machine->activecpu)); } fifoout_read_request = 1; } -static UINT8 z80_fifoin_pop(void) +static UINT8 z80_fifoin_pop(running_machine *machine) { UINT8 r; if (fifoin_wpos == fifoin_rpos) { - fatalerror("Sound FIFOIN underflow at %08X", activecpu_get_pc()); + fatalerror("Sound FIFOIN underflow at %08X", cpu_get_pc(machine->activecpu)); } r = fifoin_data[fifoin_rpos++]; if(fifoin_rpos == FIFO_SIZE) @@ -752,7 +752,7 @@ static UINT8 z80_fifoin_pop(void) return r; } -static void z80_fifoin_push(UINT8 data) +static void z80_fifoin_push(running_machine *machine, UINT8 data) { fifoin_data[fifoin_wpos++] = data; if(fifoin_wpos == FIFO_SIZE) @@ -761,7 +761,7 @@ static void z80_fifoin_push(UINT8 data) } if(fifoin_wpos == fifoin_rpos) { - fatalerror("Sound FIFOIN overflow at %08X", activecpu_get_pc()); + fatalerror("Sound FIFOIN overflow at %08X", cpu_get_pc(machine->activecpu)); } fifoin_read_request = 1; @@ -785,7 +785,7 @@ static WRITE8_HANDLER( sb_coin_w ) static READ32_HANDLER( sound_fifo_r ) { - UINT8 r = z80_fifoout_pop(); + UINT8 r = z80_fifoout_pop(machine); return r; } @@ -793,7 +793,7 @@ static READ32_HANDLER( sound_fifo_r ) static WRITE32_HANDLER( sound_fifo_w ) { if( ACCESSING_BITS_0_7 ) { - z80_fifoin_push(data & 0xff); + z80_fifoin_push(machine, data & 0xff); } } @@ -934,14 +934,14 @@ static WRITE32_HANDLER( spi_6295_1_w ) static READ8_HANDLER( z80_soundfifo_r ) { - UINT8 r = z80_fifoin_pop(); + UINT8 r = z80_fifoin_pop(machine); return r; } static WRITE8_HANDLER( z80_soundfifo_w ) { - z80_fifoout_push(data); + z80_fifoout_push(machine, data); } static READ8_HANDLER( z80_soundfifo_status_r ) @@ -1818,25 +1818,25 @@ MACHINE_DRIVER_END static READ32_HANDLER ( senkyu_speedup_r ) { - if (activecpu_get_pc()==0x00305bb2) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x00305bb2) cpu_spinuntil_int(); // idle return spimainram[(0x0018cb4-0x800)/4]; } static READ32_HANDLER( senkyua_speedup_r ) { - if (activecpu_get_pc()== 0x30582e) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)== 0x30582e) cpu_spinuntil_int(); // idle return spimainram[(0x0018c9c-0x800)/4]; } static READ32_HANDLER ( batlball_speedup_r ) { -// printf("activecpu_get_pc() %06x\n", activecpu_get_pc()); +// printf("cpu_get_pc(machine->activecpu) %06x\n", cpu_get_pc(machine->activecpu)); /* batlbalu */ - if (activecpu_get_pc()==0x00305996) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x00305996) cpu_spinuntil_int(); // idle /* batlball */ - if (activecpu_get_pc()==0x003058aa) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x003058aa) cpu_spinuntil_int(); // idle return spimainram[(0x0018db4-0x800)/4]; } @@ -1844,21 +1844,21 @@ static READ32_HANDLER ( batlball_speedup_r ) static READ32_HANDLER ( rdft_speedup_r ) { /* rdft */ - if (activecpu_get_pc()==0x0203f0a) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0203f0a) cpu_spinuntil_int(); // idle /* rdftau */ - if (activecpu_get_pc()==0x0203f16) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0203f16) cpu_spinuntil_int(); // idle /* rdftj */ - if (activecpu_get_pc()==0x0203f22) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0203f22) cpu_spinuntil_int(); // idle /* rdftdi */ - if (activecpu_get_pc()==0x0203f46) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0203f46) cpu_spinuntil_int(); // idle /* rdftu */ - if (activecpu_get_pc()==0x0203f3a) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0203f3a) cpu_spinuntil_int(); // idle -// mame_printf_debug("%08x\n",activecpu_get_pc()); +// mame_printf_debug("%08x\n",cpu_get_pc(machine->activecpu)); return spimainram[(0x00298d0-0x800)/4]; } @@ -1866,15 +1866,15 @@ static READ32_HANDLER ( rdft_speedup_r ) static READ32_HANDLER ( viprp1_speedup_r ) { /* viprp1 */ - if (activecpu_get_pc()==0x0202769) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0202769) cpu_spinuntil_int(); // idle /* viprp1s */ - if (activecpu_get_pc()==0x02027e9) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x02027e9) cpu_spinuntil_int(); // idle /* viprp1ot */ - if (activecpu_get_pc()==0x02026bd) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x02026bd) cpu_spinuntil_int(); // idle -// mame_printf_debug("%08x\n",activecpu_get_pc()); +// mame_printf_debug("%08x\n",cpu_get_pc(machine->activecpu)); return spimainram[(0x001e2e0-0x800)/4]; } @@ -1882,8 +1882,8 @@ static READ32_HANDLER ( viprp1_speedup_r ) static READ32_HANDLER ( viprp1o_speedup_r ) { /* viperp1o */ - if (activecpu_get_pc()==0x0201f99) cpu_spinuntil_int(); // idle -// mame_printf_debug("%08x\n",activecpu_get_pc()); + if (cpu_get_pc(machine->activecpu)==0x0201f99) cpu_spinuntil_int(); // idle +// mame_printf_debug("%08x\n",cpu_get_pc(machine->activecpu)); return spimainram[(0x001d49c-0x800)/4]; } @@ -1891,8 +1891,8 @@ static READ32_HANDLER ( viprp1o_speedup_r ) // causes input problems? READ32_HANDLER ( ejanhs_speedup_r ) { -// mame_printf_debug("%08x\n",activecpu_get_pc()); - if (activecpu_get_pc()==0x03032c7) cpu_spinuntil_int(); // idle +// mame_printf_debug("%08x\n",cpu_get_pc(machine->activecpu)); + if (cpu_get_pc(machine->activecpu)==0x03032c7) cpu_spinuntil_int(); // idle return spimainram[(0x002d224-0x800)/4]; } #endif @@ -1901,18 +1901,18 @@ static READ32_HANDLER ( rf2_speedup_r ) { /* rdft22kc */ - if (activecpu_get_pc()==0x0203926) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0203926) cpu_spinuntil_int(); // idle /* rdft2, rdft2j */ - if (activecpu_get_pc()==0x0204372) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0204372) cpu_spinuntil_int(); // idle /* rdft2us */ - if (activecpu_get_pc()==0x020420e) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x020420e) cpu_spinuntil_int(); // idle /* rdft2a */ - if (activecpu_get_pc()==0x0204366) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0204366) cpu_spinuntil_int(); // idle -// mame_printf_debug("%08x\n",activecpu_get_pc()); +// mame_printf_debug("%08x\n",cpu_get_pc(machine->activecpu)); return spimainram[(0x0282AC-0x800)/4]; } @@ -1920,10 +1920,10 @@ static READ32_HANDLER ( rf2_speedup_r ) static READ32_HANDLER ( rfjet_speedup_r ) { /* rfjet, rfjetu, rfjeta */ - if (activecpu_get_pc()==0x0206082) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0206082) cpu_spinuntil_int(); // idle /* rfjetus */ - if (activecpu_get_pc()==0x0205b39) + if (cpu_get_pc(machine->activecpu)==0x0205b39) { UINT32 r; cpu_spinuntil_int(); // idle @@ -1933,9 +1933,9 @@ static READ32_HANDLER ( rfjet_speedup_r ) } /* rfjetj */ - if (activecpu_get_pc()==0x0205f2e) cpu_spinuntil_int(); // idle + if (cpu_get_pc(machine->activecpu)==0x0205f2e) cpu_spinuntil_int(); // idle -// mame_printf_debug("%08x\n",activecpu_get_pc()); +// mame_printf_debug("%08x\n",cpu_get_pc(machine->activecpu)); return spimainram[(0x002894c-0x800)/4]; diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c index 1084be07b17..6688c3391ad 100644 --- a/src/mame/drivers/seicross.c +++ b/src/mame/drivers/seicross.c @@ -96,7 +96,7 @@ static READ8_HANDLER( friskyt_portB_r ) static WRITE8_HANDLER( friskyt_portB_w ) { -//logerror("PC %04x: 8910 port B = %02x\n",activecpu_get_pc(),data); +//logerror("PC %04x: 8910 port B = %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 0 is IRQ enable */ cpu_interrupt_enable(0,data & 1); diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index 76c7dd4b54b..5f1dd10d3a3 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -1322,7 +1322,7 @@ static struct st_chip { /*------------------------------ uppdate timer ------------------------------*/ -static void uPD71054_update_timer( int no ) +static void uPD71054_update_timer( running_machine *machine, int no ) { UINT16 max = uPD71054.max[no]&0xffff; @@ -1332,7 +1332,7 @@ static void uPD71054_update_timer( int no ) } else { timer_adjust_oneshot( uPD71054.timer[no], attotime_never, no); logerror( "CPU #0 PC %06X: uPD71054 error, timer %d duration is 0\n", - activecpu_get_pc(), no ); + cpu_get_pc(machine->activecpu), no ); } } @@ -1344,7 +1344,7 @@ static void uPD71054_update_timer( int no ) static TIMER_CALLBACK( uPD71054_timer_callback ) { cpunum_set_input_line(machine, 0, 4, HOLD_LINE ); - uPD71054_update_timer( param ); + uPD71054_update_timer( machine, param ); } @@ -1390,7 +1390,7 @@ static WRITE16_HANDLER( timer_regs_w ) uPD71054.max[offset] = (uPD71054.max[offset]&0x00ff)+(data<<8); } if( uPD71054.max[offset] != 0 ) { - uPD71054_update_timer( offset ); + uPD71054_update_timer( machine, offset ); } break; case 0x0003: @@ -1457,7 +1457,7 @@ static READ16_HANDLER( mirror_ram_r ) static WRITE16_HANDLER( mirror_ram_w ) { COMBINE_DATA(&mirror_ram[offset]); -// logerror("PC %06X - Mirror RAM Written: %04X <- %04X\n", activecpu_get_pc(), offset*2, data); +// logerror("PC %06X - Mirror RAM Written: %04X <- %04X\n", cpu_get_pc(machine->activecpu), offset*2, data); } @@ -1672,7 +1672,7 @@ static READ16_HANDLER ( calibr50_ip_r ) case 0x16/2: return (dir2>>8); // upper 4 bits of p2 rotation case 0x18/2: return 0xffff; // ? (value's read but not used) default: - logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2); + logerror("PC %06X - Read input %02X !\n", cpu_get_pc(machine->activecpu), offset*2); return 0; } } @@ -2395,7 +2395,7 @@ static READ16_HANDLER( krzybowl_input_r ) case 0xc/2: return dir2y & 0xff; case 0xe/2: return dir2y >> 8; default: - logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2); + logerror("PC %06X - Read input %02X !\n", cpu_get_pc(machine->activecpu), offset*2); return 0; } } @@ -2618,7 +2618,7 @@ static READ16_HANDLER( kiwame_input_r ) case 0x08/2: return 0xffff; default: - logerror("PC %06X - Read input %02X !\n", activecpu_get_pc(), offset*2); + logerror("PC %06X - Read input %02X !\n", cpu_get_pc(machine->activecpu), offset*2); return 0x0000; } } @@ -2654,12 +2654,12 @@ ADDRESS_MAP_END static READ16_HANDLER( thunderl_protection_r ) { -// logerror("PC %06X - Protection Read\n", activecpu_get_pc()); +// logerror("PC %06X - Protection Read\n", cpu_get_pc(machine->activecpu)); return 0x00dd; } static WRITE16_HANDLER( thunderl_protection_w ) { -// logerror("PC %06X - Protection Written: %04X <- %04X\n", activecpu_get_pc(), offset*2, data); +// logerror("PC %06X - Protection Written: %04X <- %04X\n", cpu_get_pc(machine->activecpu), offset*2, data); } /* Similar to downtown etc. */ @@ -3021,14 +3021,14 @@ static READ16_HANDLER( pairlove_prot_r ) { int retdata; retdata = pairslove_protram[offset]; - //mame_printf_debug("pairs love protection? read %06x %04x %04x\n",activecpu_get_pc(), offset,retdata); + //mame_printf_debug("pairs love protection? read %06x %04x %04x\n",cpu_get_pc(machine->activecpu), offset,retdata); pairslove_protram[offset]=pairslove_protram_old[offset]; return retdata; } static WRITE16_HANDLER( pairlove_prot_w ) { -// mame_printf_debug("pairs love protection? write %06x %04x %04x\n",activecpu_get_pc(), offset,data); +// mame_printf_debug("pairs love protection? write %06x %04x %04x\n",cpu_get_pc(machine->activecpu), offset,data); pairslove_protram_old[offset]=pairslove_protram[offset]; pairslove_protram[offset]=data; } @@ -3120,7 +3120,7 @@ static READ16_HANDLER( inttoote_key_r ) case 0x40: return input_port_read(machine, "BET3"); case 0x80: return input_port_read(machine, "BET4"); } - logerror("%06X: unknown read, select = %04x\n",activecpu_get_pc(),*inttoote_key_select); + logerror("%06X: unknown read, select = %04x\n",cpu_get_pc(machine->activecpu),*inttoote_key_select); return 0xffff; } @@ -9293,12 +9293,12 @@ static READ16_HANDLER( twineagl_debug_r ) static UINT8 xram[8]; static READ16_HANDLER( twineagl_200100_r ) { -logerror("%04x: twineagl_200100_r %d\n",activecpu_get_pc(),offset); +logerror("%04x: twineagl_200100_r %d\n",cpu_get_pc(machine->activecpu),offset); return xram[offset]; } static WRITE16_HANDLER( twineagl_200100_w ) { -logerror("%04x: twineagl_200100_w %d = %02x\n",activecpu_get_pc(),offset,data); +logerror("%04x: twineagl_200100_w %d = %02x\n",cpu_get_pc(machine->activecpu),offset,data); if (ACCESSING_BITS_0_7) xram[offset] = data & 0xff; } diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c index 98c78258861..31028d74efd 100644 --- a/src/mame/drivers/seta2.c +++ b/src/mame/drivers/seta2.c @@ -429,7 +429,7 @@ static WRITE16_HANDLER( seta2_sound_bank_w ) int banks = (memory_region_length( machine, "x1" ) - 0x100000) / 0x20000; if (data >= banks) { - logerror("CPU #0 PC %06X: invalid sound bank %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06X: invalid sound bank %04X\n",cpu_get_pc(machine->activecpu),data); data %= banks; } memcpy(ROM + offset * 0x20000, ROM + 0x100000 + data * 0x20000, 0x20000); diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c index c67d4a131fc..9d060d20c67 100644 --- a/src/mame/drivers/sf.c +++ b/src/mame/drivers/sf.c @@ -149,7 +149,7 @@ static WRITE16_HANDLER( protection_w ) } default: { - logerror("Write protection at %06x (%04x)\n", activecpu_get_pc(), data&0xffff); + logerror("Write protection at %06x (%04x)\n", cpu_get_pc(machine->activecpu), data&0xffff); logerror("*** Unknown protection %d\n", program_read_byte(0xffc684)); break; } diff --git a/src/mame/drivers/shangha3.c b/src/mame/drivers/shangha3.c index 55576730fd7..7dab2d5cde9 100644 --- a/src/mame/drivers/shangha3.c +++ b/src/mame/drivers/shangha3.c @@ -55,13 +55,13 @@ static READ16_HANDLER( shangha3_prot_r ) static int count; static const int result[] = { 0x0,0x1,0x3,0x7,0xf,0xe,0xc,0x8,0x0}; -logerror("PC %04x: read 20004e\n",activecpu_get_pc()); +logerror("PC %04x: read 20004e\n",cpu_get_pc(machine->activecpu)); return result[count++ % 9]; } static WRITE16_HANDLER( shangha3_prot_w ) { -logerror("PC %04x: write %02x to 20004e\n",activecpu_get_pc(),data); +logerror("PC %04x: write %02x to 20004e\n",cpu_get_pc(machine->activecpu),data); } diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c index d03db3a6457..e06fc5e1485 100644 --- a/src/mame/drivers/simpl156.c +++ b/src/mame/drivers/simpl156.c @@ -1151,7 +1151,7 @@ static const UINT8 gangonta_eeprom[128] = { /* Everything seems more stable if we run the CPU speed x4 and use Idle skips.. maybe it has an internal multipler? */ static READ32_HANDLER( joemacr_speedup_r ) { - if (activecpu_get_pc()==0x284) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); + if (cpu_get_pc(machine->activecpu)==0x284) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); return simpl156_systemram[0x18/4]; } @@ -1164,7 +1164,7 @@ static DRIVER_INIT (joemacr) static READ32_HANDLER( chainrec_speedup_r ) { - if (activecpu_get_pc()==0x2d4) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); + if (cpu_get_pc(machine->activecpu)==0x2d4) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); return simpl156_systemram[0x18/4]; } @@ -1177,7 +1177,7 @@ static DRIVER_INIT (chainrec) static READ32_HANDLER( prtytime_speedup_r ) { - if (activecpu_get_pc()==0x4f0) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); + if (cpu_get_pc(machine->activecpu)==0x4f0) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); return simpl156_systemram[0xae0/4]; } @@ -1198,7 +1198,7 @@ static DRIVER_INIT (gangonta) static READ32_HANDLER( charlien_speedup_r ) { - if (activecpu_get_pc()==0xc8c8) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); + if (cpu_get_pc(machine->activecpu)==0xc8c8) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); return simpl156_systemram[0x10/4]; } @@ -1210,7 +1210,7 @@ static DRIVER_INIT (charlien) static READ32_HANDLER( osman_speedup_r ) { - if (activecpu_get_pc()==0x5974) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); + if (cpu_get_pc(machine->activecpu)==0x5974) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); return simpl156_systemram[0x10/4]; } diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c index 414c4feca54..4fc159481c2 100644 --- a/src/mame/drivers/slapfght.c +++ b/src/mame/drivers/slapfght.c @@ -1798,10 +1798,10 @@ static READ8_HANDLER( gtstarb1_port_0_read ) 6D38: 20 F8 jr nz,$6D32 6D3A: 10 E0 djnz $6D1C */ - if (activecpu_get_pc() == 0x6d1e) return 0; - if (activecpu_get_pc() == 0x6d24) return 6; - if (activecpu_get_pc() == 0x6d2c) return 2; - if (activecpu_get_pc() == 0x6d34) return 4; + if (cpu_get_pc(machine->activecpu) == 0x6d1e) return 0; + if (cpu_get_pc(machine->activecpu) == 0x6d24) return 6; + if (cpu_get_pc(machine->activecpu) == 0x6d2c) return 2; + if (cpu_get_pc(machine->activecpu) == 0x6d34) return 4; /* The bootleg hangs in the "test mode" before diplaying (wrong) lives settings : 6AD4: DB 00 in a,($00) @@ -1822,11 +1822,11 @@ static READ8_HANDLER( gtstarb1_port_0_read ) 6AF7: 20 FA jr nz,$6AF3 This seems to be what used to be the MCU status. */ - if (activecpu_get_pc() == 0x6ad6) return 2; /* bit 1 must be ON */ - if (activecpu_get_pc() == 0x6ae4) return 2; /* bit 1 must be ON */ - if (activecpu_get_pc() == 0x6af5) return 0; /* bit 2 must be OFF */ + if (cpu_get_pc(machine->activecpu) == 0x6ad6) return 2; /* bit 1 must be ON */ + if (cpu_get_pc(machine->activecpu) == 0x6ae4) return 2; /* bit 1 must be ON */ + if (cpu_get_pc(machine->activecpu) == 0x6af5) return 0; /* bit 2 must be OFF */ - logerror("Port Read PC=%04x\n",activecpu_get_pc()); + logerror("Port Read PC=%04x\n",cpu_get_pc(machine->activecpu)); return 0; } @@ -1836,7 +1836,7 @@ static READ8_HANDLER( gtstarb1_dpram_r ) /* requires this or it gets stuck with 'rom test' on screen */ /* it is possible the program roms are slighly corrupt like the gfx roms, or that the bootleg simply shouldn't execute the code due to the modified roms */ - if (activecpu_get_pc()==0x6d54) return 0xff; + if (cpu_get_pc(machine->activecpu)==0x6d54) return 0xff; return slapfight_dpram[offset]; } @@ -1881,8 +1881,8 @@ static READ8_HANDLER( slapfigh_mcu_r ) /* pass initial checks */ static const int protvalues[] = { 0xc7, 0x55, -1 }; - if ((activecpu_get_pc()==0x1369) || // slapfigh - (activecpu_get_pc()==0x136d)) // slapfiga + if ((cpu_get_pc(machine->activecpu)==0x1369) || // slapfigh + (cpu_get_pc(machine->activecpu)==0x136d)) // slapfiga { int retdat = protvalues[slapfigh_prot_pos]; if (retdat == -1) @@ -1894,7 +1894,7 @@ static READ8_HANDLER( slapfigh_mcu_r ) slapfigh_prot_pos++; return retdat; } - logerror("MCU Read PC=%04x\n",activecpu_get_pc()); + logerror("MCU Read PC=%04x\n",cpu_get_pc(machine->activecpu)); return 0; } diff --git a/src/mame/drivers/smstrv.c b/src/mame/drivers/smstrv.c index a6358a5f702..e1fa048d0e0 100644 --- a/src/mame/drivers/smstrv.c +++ b/src/mame/drivers/smstrv.c @@ -293,44 +293,44 @@ INPUT_PORTS_EXTERN(ettrivia); static READ8_DEVICE_HANDLER( r1 ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(device->machine->activecpu); if(pc != 0x81cb) - printf("r1 @ %X\n",activecpu_get_pc()); + printf("r1 @ %X\n",cpu_get_pc(device->machine->activecpu)); return mame_rand(device->machine); } static READ8_DEVICE_HANDLER( r2 ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(device->machine->activecpu); if(pc != 0x81cb) - printf("r2 @ %X\n",activecpu_get_pc()); + printf("r2 @ %X\n",cpu_get_pc(device->machine->activecpu)); return mame_rand(device->machine); } static READ8_DEVICE_HANDLER( r3 ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(device->machine->activecpu); if(pc != 0x81cb && pc != 0x90fa && pc != 0x911b && pc != 0x90d3 && pc != 0x90c4) - printf("r3 @ %X\n",activecpu_get_pc()); + printf("r3 @ %X\n",cpu_get_pc(device->machine->activecpu)); return mame_rand(device->machine) & ~1; //with 1 jumps back (infinite loop): a status ready for something? } static READ8_DEVICE_HANDLER( r4 ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(device->machine->activecpu); if(pc != 0x81cb) - printf("r4 @ %X\n",activecpu_get_pc()); + printf("r4 @ %X\n",cpu_get_pc(device->machine->activecpu)); return mame_rand(device->machine); } static READ8_DEVICE_HANDLER( r5 ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(device->machine->activecpu); if(pc != 0x81cb) - printf("r5 @ %X\n",activecpu_get_pc()); + printf("r5 @ %X\n",cpu_get_pc(device->machine->activecpu)); return mame_rand(device->machine); } static READ8_DEVICE_HANDLER( r6 ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(device->machine->activecpu); if(pc != 0x81cb) - printf("r6 @ %X\n",activecpu_get_pc()); + printf("r6 @ %X\n",cpu_get_pc(device->machine->activecpu)); return mame_rand(device->machine); } diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c index 51e789718e6..3ceffcb1655 100644 --- a/src/mame/drivers/snesb.c +++ b/src/mame/drivers/snesb.c @@ -148,7 +148,7 @@ static READ8_HANDLER(sb2b_6a6xxx_r) case 0xfb7: return 0x47; } - logerror("Unknown protection read read %x @ %x\n",offset, activecpu_get_pc()); + logerror("Unknown protection read read %x @ %x\n",offset, cpu_get_pc(machine->activecpu)); return 0; } diff --git a/src/mame/drivers/solomon.c b/src/mame/drivers/solomon.c index dfda7390286..7677a9e1d6b 100644 --- a/src/mame/drivers/solomon.c +++ b/src/mame/drivers/solomon.c @@ -34,17 +34,17 @@ static WRITE8_HANDLER( solomon_sh_command_w ) static READ8_HANDLER( solomon_0xe603_r ) { - if (activecpu_get_pc()==0x161) // all the time .. return 0 to act as before for coin / startup etc. + if (cpu_get_pc(machine->activecpu)==0x161) // all the time .. return 0 to act as before for coin / startup etc. { return 0; } - else if (activecpu_get_pc()==0x4cf0) // stop it clearing the screen at certain scores + else if (cpu_get_pc(machine->activecpu)==0x4cf0) // stop it clearing the screen at certain scores { - return (activecpu_get_reg(Z80_BC) & 0x08); + return (cpu_get_reg(machine->activecpu, Z80_BC) & 0x08); } else { - mame_printf_debug("unhandled solomon_0xe603_r %04x\n",activecpu_get_pc()); + mame_printf_debug("unhandled solomon_0xe603_r %04x\n",cpu_get_pc(machine->activecpu)); return 0; } } diff --git a/src/mame/drivers/spaceg.c b/src/mame/drivers/spaceg.c index bfb9c913591..8c73d71c825 100644 --- a/src/mame/drivers/spaceg.c +++ b/src/mame/drivers/spaceg.c @@ -225,8 +225,8 @@ static WRITE8_HANDLER( zvideoram_w ) break; default: - logerror("mode =%02x pc=%04x\n",*io9401,activecpu_get_pc() ); - popmessage("mode =%02x pc=%04x\n",*io9401,activecpu_get_pc() ); + logerror("mode =%02x pc=%04x\n",*io9401,cpu_get_pc(machine->activecpu) ); + popmessage("mode =%02x pc=%04x\n",*io9401,cpu_get_pc(machine->activecpu) ); return; break; } diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c index fbf57e2ba08..0312492921f 100644 --- a/src/mame/drivers/spdodgeb.c +++ b/src/mame/drivers/spdodgeb.c @@ -231,7 +231,7 @@ static void mcu63705_update_inputs(running_machine *machine) static READ8_HANDLER( mcu63701_r ) { -// logerror("CPU #0 PC %04x: read from port %02x of 63701 data address 3801\n",activecpu_get_pc(),offset); +// logerror("CPU #0 PC %04x: read from port %02x of 63701 data address 3801\n",cpu_get_pc(machine->activecpu),offset); if (mcu63701_command == 0) return 0x6a; else switch (offset) @@ -247,7 +247,7 @@ static READ8_HANDLER( mcu63701_r ) static WRITE8_HANDLER( mcu63701_w ) { -// logerror("CPU #0 PC %04x: write %02x to 63701 control address 3800\n",activecpu_get_pc(),data); +// logerror("CPU #0 PC %04x: write %02x to 63701 control address 3800\n",cpu_get_pc(machine->activecpu),data); mcu63701_command = data; mcu63705_update_inputs(machine); } diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c index 48ecf36387c..2fc92e7acf6 100644 --- a/src/mame/drivers/spy.c +++ b/src/mame/drivers/spy.c @@ -50,12 +50,12 @@ static READ8_HANDLER( spy_bankedram1_r ) { if (pmcbank) { - //logerror("%04x read pmcram %04x\n",activecpu_get_pc(),offset); + //logerror("%04x read pmcram %04x\n",cpu_get_pc(machine->activecpu),offset); return pmcram[offset]; } else { - //logerror("%04x read pmc internal ram %04x\n",activecpu_get_pc(),offset); + //logerror("%04x read pmc internal ram %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; } } @@ -73,11 +73,11 @@ static WRITE8_HANDLER( spy_bankedram1_w ) { if (pmcbank) { - //logerror("%04x pmcram %04x = %02x\n",activecpu_get_pc(),offset,data); + //logerror("%04x pmcram %04x = %02x\n",cpu_get_pc(machine->activecpu),offset,data); pmcram[offset] = data; } //else - //logerror("%04x pmc internal ram %04x = %02x\n",activecpu_get_pc(),offset,data); + //logerror("%04x pmc internal ram %04x = %02x\n",cpu_get_pc(machine->activecpu),offset,data); } else ram[offset] = data; @@ -304,7 +304,7 @@ static WRITE8_HANDLER( spy_3f90_w ) /* bit 7 = PMC-BK */ pmcbank = (data & 0x80) >> 7; -//logerror("%04x: 3f90_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 3f90_w %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 6 = PMC-START */ if ((data & 0x40) && !(old & 0x40)) { diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c index 5803b30da63..03eaf2b0563 100644 --- a/src/mame/drivers/srmp2.c +++ b/src/mame/drivers/srmp2.c @@ -472,7 +472,7 @@ static WRITE8_HANDLER( srmp3_input_1_w ) ---- -x-- : Player 2 side flag ? */ - logerror("PC:%04X DATA:%02X srmp3_input_1_w\n", activecpu_get_pc(), data); + logerror("PC:%04X DATA:%02X srmp3_input_1_w\n", cpu_get_pc(machine->activecpu), data); srmp2_port_select = 0; @@ -496,7 +496,7 @@ static WRITE8_HANDLER( srmp3_input_2_w ) /* Key matrix reading related ? */ - logerror("PC:%04X DATA:%02X srmp3_input_2_w\n", activecpu_get_pc(), data); + logerror("PC:%04X DATA:%02X srmp3_input_2_w\n", cpu_get_pc(machine->activecpu), data); srmp2_port_select = 1; @@ -514,12 +514,12 @@ static READ8_HANDLER( srmp3_input_r ) int keydata = 0xff; static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; - logerror("PC:%04X srmp3_input_r\n", activecpu_get_pc()); + logerror("PC:%04X srmp3_input_r\n", cpu_get_pc(machine->activecpu)); // PC:0x8903 ROM:0xC903 // PC:0x7805 ROM:0x7805 - if ((activecpu_get_pc() == 0x8903) || (activecpu_get_pc() == 0x7805)) /* Panel keys */ + if ((cpu_get_pc(machine->activecpu) == 0x8903) || (cpu_get_pc(machine->activecpu) == 0x7805)) /* Panel keys */ { int i, j, t; @@ -540,7 +540,7 @@ static READ8_HANDLER( srmp3_input_r ) // PC:0x8926 ROM:0xC926 // PC:0x7822 ROM:0x7822 - if ((activecpu_get_pc() == 0x8926) || (activecpu_get_pc() == 0x7822)) /* Analizer and memory reset keys */ + if ((cpu_get_pc(machine->activecpu) == 0x8926) || (cpu_get_pc(machine->activecpu) == 0x7822)) /* Analizer and memory reset keys */ { keydata = input_port_read(machine, "SERVICE"); } diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c index 4ab1bca7e86..d7c4e1ed712 100644 --- a/src/mame/drivers/srmp6.c +++ b/src/mame/drivers/srmp6.c @@ -365,7 +365,7 @@ static WRITE16_HANDLER( video_regs_w ) case 0x56/2: // written 8,9,8,9 successively default: - logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", activecpu_get_previouspc(), offset*2, data, mem_mask); + logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", cpu_get_previouspc(machine->activecpu), offset*2, data, mem_mask); break; } COMBINE_DATA(&video_regs[offset]); @@ -373,7 +373,7 @@ static WRITE16_HANDLER( video_regs_w ) static READ16_HANDLER( video_regs_r ) { - logerror("video_regs_r (PC=%06X): %04x\n", activecpu_get_previouspc(), offset*2); + logerror("video_regs_r (PC=%06X): %04x\n", cpu_get_previouspc(machine->activecpu), offset*2); return video_regs[offset]; } diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c index 2aede0bf958..f955340d3ca 100644 --- a/src/mame/drivers/ssfindo.c +++ b/src/mame/drivers/ssfindo.c @@ -319,7 +319,7 @@ static READ32_HANDLER(PS7500_IO_r) case IOLINES: //TODO: eeprom 24c01 #if 0 - mame_printf_debug("IOLINESR %i @%x\n", offset, activecpu_get_pc()); + mame_printf_debug("IOLINESR %i @%x\n", offset, cpu_get_pc(machine->activecpu)); #endif if(flashType == 1) @@ -351,7 +351,7 @@ static READ32_HANDLER(PS7500_IO_r) return PS7500_IO[offset]; //default: - //mame_printf_debug("ior %i @%x\n",offset,activecpu_get_pc()); + //mame_printf_debug("ior %i @%x\n",offset,cpu_get_pc(machine->activecpu)); } return mame_rand(machine);//PS7500_IO[offset]; } @@ -369,13 +369,13 @@ static WRITE32_HANDLER(PS7500_IO_w) if(data&0xc0) adrLatch=0; - if(activecpu_get_pc() == 0xbac0 && flashType == 1) + if(cpu_get_pc(machine->activecpu) == 0xbac0 && flashType == 1) { flashN=data&1; } #if 0 - logerror("IOLINESW %i = %x @%x\n",offset,data,activecpu_get_pc()); + logerror("IOLINESW %i = %x @%x\n",offset,data,cpu_get_pc(machine->activecpu)); #endif break; @@ -453,7 +453,7 @@ static WRITE32_HANDLER(io_w) COMBINE_DATA(&temp); #if 0 - logerror("[io_w] = %x @%x [latch=%x]\n",data,activecpu_get_pc(),adrLatch); + logerror("[io_w] = %x @%x [latch=%x]\n",data,cpu_get_pc(machine->activecpu),adrLatch); #endif if(adrLatch==1) diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c index 7dd96f29cec..cc6d91998b3 100644 --- a/src/mame/drivers/sshangha.c +++ b/src/mame/drivers/sshangha.c @@ -78,7 +78,7 @@ static WRITE16_HANDLER( sshangha_protection16_w ) { COMBINE_DATA(&sshangha_prot_data[offset]); - logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %04x\n",activecpu_get_pc(),offset<<1,data); + logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %04x\n",cpu_get_pc(machine->activecpu),offset<<1,data); if (offset == (0x260 >> 1)) { //soundlatch_w(0,data&0xff); @@ -107,7 +107,7 @@ static READ16_HANDLER( sshangha_protection16_r ) // Protection TODO } - logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",activecpu_get_pc(),offset<<1); + logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",cpu_get_pc(machine->activecpu),offset<<1); return sshangha_prot_data[offset]; } diff --git a/src/mame/drivers/sslam.c b/src/mame/drivers/sslam.c index 357d08b124c..7aab43f268a 100644 --- a/src/mame/drivers/sslam.c +++ b/src/mame/drivers/sslam.c @@ -321,7 +321,7 @@ static WRITE16_HANDLER( sslam_snd_w ) { if (ACCESSING_BITS_0_7) { - logerror("PC:%06x Writing %04x to Sound CPU\n",activecpu_get_previouspc(),data); + logerror("PC:%06x Writing %04x to Sound CPU\n",cpu_get_previouspc(machine->activecpu),data); if (data >= 0x40) { if (data == 0xfe) { /* This should reset the sound MCU and stop audio playback, but here, it */ diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c index fdc916d33f6..d0fe1e4a5bc 100644 --- a/src/mame/drivers/ssv.c +++ b/src/mame/drivers/ssv.c @@ -400,7 +400,7 @@ static WRITE16_HANDLER( dsp_w ) break; default: dsp_ram[0x21] = 0; - logerror("SSV DSP: unknown function %x (%x)\n", dsp_ram[0x20], activecpu_get_pc()); + logerror("SSV DSP: unknown function %x (%x)\n", dsp_ram[0x20], cpu_get_pc(machine->activecpu)); break; } } @@ -501,7 +501,7 @@ static WRITE16_HANDLER( gdfs_eeprom_w ) static UINT16 data_old; if (data & ~0x7b00) - logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(machine->activecpu),data); if ( ACCESSING_BITS_8_15 ) { @@ -548,7 +548,7 @@ static READ16_HANDLER( gdfs_blitram_r ) return 0; } - logerror("CPU #0 PC: %06X - Blit reg read: %02X\n",activecpu_get_pc(),offset*2); + logerror("CPU #0 PC: %06X - Blit reg read: %02X\n",cpu_get_pc(machine->activecpu),offset*2); return 0; } @@ -561,7 +561,7 @@ static WRITE16_HANDLER( gdfs_blitram_w ) case 0x8a/2: { if (data & ~0x43) - logerror("CPU #0 PC: %06X - Unknown gdfs_gfxram_bank bit written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown gdfs_gfxram_bank bit written %04X\n",cpu_get_pc(machine->activecpu),data); if (ACCESSING_BITS_0_7) gdfs_gfxram_bank = data & 3; @@ -597,13 +597,13 @@ static WRITE16_HANDLER( gdfs_blitram_w ) } else { - logerror("CPU #0 PC: %06X - Blit out of range: src %x, dst %x, len %x\n",activecpu_get_pc(),src,dst,len); + logerror("CPU #0 PC: %06X - Blit out of range: src %x, dst %x, len %x\n",cpu_get_pc(machine->activecpu),src,dst,len); } } break; default: - logerror("CPU #0 PC: %06X - Blit reg written: %02X <- %04X\n",activecpu_get_pc(),offset*2,data); + logerror("CPU #0 PC: %06X - Blit reg written: %02X <- %04X\n",cpu_get_pc(machine->activecpu),offset*2,data); } } @@ -650,7 +650,7 @@ static READ16_HANDLER( hypreact_input_r ) if (input_sel & 0x0002) return input_port_read(machine, "KEY1"); if (input_sel & 0x0004) return input_port_read(machine, "KEY2"); if (input_sel & 0x0008) return input_port_read(machine, "KEY3"); - logerror("CPU #0 PC %06X: unknown input read: %04X\n",activecpu_get_pc(),input_sel); + logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(machine->activecpu),input_sel); return 0xffff; } @@ -798,7 +798,7 @@ static READ16_HANDLER( srmp4_input_r ) if (input_sel & 0x0004) return input_port_read(machine, "KEY1"); if (input_sel & 0x0008) return input_port_read(machine, "KEY2"); if (input_sel & 0x0010) return input_port_read(machine, "KEY3"); - logerror("CPU #0 PC %06X: unknown input read: %04X\n",activecpu_get_pc(),input_sel); + logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(machine->activecpu),input_sel); return 0xffff; } @@ -847,7 +847,7 @@ static READ16_HANDLER( srmp7_input_r ) if (input_sel & 0x0004) return input_port_read(machine, "KEY1"); if (input_sel & 0x0008) return input_port_read(machine, "KEY2"); if (input_sel & 0x0010) return input_port_read(machine, "KEY3"); - logerror("CPU #0 PC %06X: unknown input read: %04X\n",activecpu_get_pc(),input_sel); + logerror("CPU #0 PC %06X: unknown input read: %04X\n",cpu_get_pc(machine->activecpu),input_sel); return 0xffff; } diff --git a/src/mame/drivers/st0016.c b/src/mame/drivers/st0016.c index 9a720e06131..55cf89a5a85 100644 --- a/src/mame/drivers/st0016.c +++ b/src/mame/drivers/st0016.c @@ -400,7 +400,7 @@ static INTERRUPT_GEN(st0016_int) if(!cpu_getiloops()) cpunum_set_input_line(machine, 0,0,HOLD_LINE); else - if(activecpu_get_reg(Z80_IFF1)) /* dirty hack ... */ + if(cpu_get_reg(machine->activecpu, Z80_IFF1)) /* dirty hack ... */ cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE ); } diff --git a/src/mame/drivers/stadhero.c b/src/mame/drivers/stadhero.c index bb2d3213365..3c4777ab5bc 100644 --- a/src/mame/drivers/stadhero.c +++ b/src/mame/drivers/stadhero.c @@ -40,7 +40,7 @@ static READ16_HANDLER( stadhero_control_r ) return input_port_read(machine, "DSW"); } - logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",activecpu_get_pc(),0x30c000+offset); + logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(machine->activecpu),0x30c000+offset); return ~0; } @@ -55,7 +55,7 @@ static WRITE16_HANDLER( stadhero_control_w ) cpunum_set_input_line(machine, 1,INPUT_LINE_NMI,PULSE_LINE); break; default: - logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",activecpu_get_pc(),data,0x30c010+offset); + logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(machine->activecpu),data,0x30c010+offset); break; } } diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c index 020e47809fc..dcd77b731df 100644 --- a/src/mame/drivers/starwars.c +++ b/src/mame/drivers/starwars.c @@ -90,9 +90,9 @@ static WRITE8_HANDLER( irq_ack_w ) * *************************************/ -static void esb_slapstic_tweak(offs_t offset) +static void esb_slapstic_tweak(running_machine *machine, offs_t offset) { - int new_bank = slapstic_tweak(offset); + int new_bank = slapstic_tweak(machine, offset); /* update for the new bank */ if (new_bank != slapstic_current_bank) @@ -106,14 +106,14 @@ static void esb_slapstic_tweak(offs_t offset) static READ8_HANDLER( esb_slapstic_r ) { int result = slapstic_base[offset]; - esb_slapstic_tweak(offset); + esb_slapstic_tweak(machine, offset); return result; } static WRITE8_HANDLER( esb_slapstic_w ) { - esb_slapstic_tweak(offset); + esb_slapstic_tweak(machine, offset); } @@ -129,7 +129,7 @@ static OPBASE_HANDLER( esb_setopbase ) /* if we are in the slapstic region, process it */ if ((address & 0xe000) == 0x8000) { - offs_t pc = activecpu_get_pc(); + offs_t pc = cpu_get_pc(machine->activecpu); /* filter out duplicates; we get these because the handler gets called for multiple reasons: @@ -140,7 +140,7 @@ static OPBASE_HANDLER( esb_setopbase ) { slapstic_last_pc = pc; slapstic_last_address = address; - esb_slapstic_tweak(address & 0x1fff); + esb_slapstic_tweak(machine, address & 0x1fff); } return ~0; } diff --git a/src/mame/drivers/steaser.c b/src/mame/drivers/steaser.c index 17bb42afa5e..f961a0f90c3 100644 --- a/src/mame/drivers/steaser.c +++ b/src/mame/drivers/steaser.c @@ -78,7 +78,7 @@ static WRITE16_HANDLER(blitter_9b8000_w) dx<<=1; #if 0 - printf("[%x] %x blit %x -> %x,%x (%x*%x ) [%x] %x - %.4x %.4x - %.4x - %.4x\n",data,activecpu_get_pc(),of,x0,y0,dx,dy,data_9b0000,data_9a8000,data_9a0000,data_998000,data_990000,data_988000); + printf("[%x] %x blit %x -> %x,%x (%x*%x ) [%x] %x - %.4x %.4x - %.4x - %.4x\n",data,cpu_get_pc(machine->activecpu),of,x0,y0,dx,dy,data_9b0000,data_9a8000,data_9a0000,data_998000,data_990000,data_988000); #endif for(y=0;y<dy;++y) @@ -134,12 +134,12 @@ static WRITE16_HANDLER(mcu_w) static WRITE16_HANDLER(unk_w) { - switch(activecpu_get_pc()) + switch(cpu_get_pc(machine->activecpu)) { case 0x1348: mainram[0x00932/2]=0xffff; break; //dirt way to exit loop /* case 0x16ce: { - int addr=(activecpu_get_reg(M68K_D2)+0x089c)>>1; + int addr=(cpu_get_reg(machine->activecpu, M68K_D2)+0x089c)>>1; mainram[addr&0x7fff]=0xffff;//mame_rand(machine); } break;*/ diff --git a/src/mame/drivers/strnskil.c b/src/mame/drivers/strnskil.c index ff72f0abcbe..c2bd276b24f 100644 --- a/src/mame/drivers/strnskil.c +++ b/src/mame/drivers/strnskil.c @@ -46,7 +46,7 @@ static READ8_HANDLER( pettanp_protection_r ) { int res; - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x6066: res = 0xa5; break; case 0x60dc: res = 0x20; break; /* bits 0-3 unknown */ @@ -57,7 +57,7 @@ static READ8_HANDLER( pettanp_protection_r ) default: res = 0xff; break; } - logerror("%04x: protection_r -> %02x\n",activecpu_get_pc(),res); + logerror("%04x: protection_r -> %02x\n",cpu_get_pc(machine->activecpu),res); return res; } @@ -65,7 +65,7 @@ static READ8_HANDLER( banbam_protection_r ) { int res; - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x6094: res = 0xa5; break; case 0x6118: res = 0x20; break; /* bits 0-3 unknown */ @@ -76,13 +76,13 @@ static READ8_HANDLER( banbam_protection_r ) default: res = 0xff; break; } - logerror("%04x: protection_r -> %02x\n",activecpu_get_pc(),res); + logerror("%04x: protection_r -> %02x\n",cpu_get_pc(machine->activecpu),res); return res; } static WRITE8_HANDLER( protection_w ) { - logerror("%04x: protection_w %02x\n",activecpu_get_pc(),data); + logerror("%04x: protection_w %02x\n",cpu_get_pc(machine->activecpu),data); } /****************************************************************************/ diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c index 0c0ccaade23..a51aeda5101 100644 --- a/src/mame/drivers/stv.c +++ b/src/mame/drivers/stv.c @@ -459,9 +459,9 @@ static UINT8 stv_SMPC_r8 (running_machine *machine, int offset) // if (offset == 0x33) //country code // return_data = input_port_read(machine, "FAKE"); - if (activecpu_get_pc()==0x060020E6) return_data = 0x10;//??? + if (cpu_get_pc(machine->activecpu)==0x060020E6) return_data = 0x10;//??? - //if(LOG_SMPC) logerror ("cpu #%d (PC=%08X) SMPC: Read from Byte Offset %02x Returns %02x\n", cpu_getactivecpu(), activecpu_get_pc(), offset, return_data); + //if(LOG_SMPC) logerror ("cpu #%d (PC=%08X) SMPC: Read from Byte Offset %02x Returns %02x\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset, return_data); return return_data; @@ -684,7 +684,7 @@ static void stv_SMPC_w8 (running_machine *machine, int offset, UINT8 data) smpc_ram[0x21] = (0x80) | ((NMI_reset & 1) << 6); break; default: - if(LOG_SMPC) logerror ("cpu #%d (PC=%08X) SMPC: undocumented Command %02x\n", cpu_getactivecpu(), activecpu_get_pc(), data); + if(LOG_SMPC) logerror ("cpu #%d (PC=%08X) SMPC: undocumented Command %02x\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), data); } // we've processed the command, clear status flag @@ -871,7 +871,7 @@ static int port_i; static READ32_HANDLER ( stv_io_r32 ) { -// if(LOG_IOGA) logerror("(PC=%08X): I/O r %08X & %08X\n", activecpu_get_pc(), offset*4, mem_mask); +// if(LOG_IOGA) logerror("(PC=%08X): I/O r %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, mem_mask); // popmessage("SEL: %02x MUX: %02x %02x %02x %02x %02x",port_sel,mux_data,ioga[1],ioga[2],ioga[3],ioga[5]); switch(offset) @@ -950,8 +950,8 @@ static READ32_HANDLER ( stv_io_r32 ) { case 0x77: { - //popmessage("(PC=%06x) offs 5 %04x %02x",activecpu_get_pc(),port_sel,((ioga[5] & 0xff0000) >> 16)); - logerror("(PC=%06x) offs 5 %04x %02x\n",activecpu_get_pc(),port_sel,((ioga[5] & 0xff0000) >> 16)); + //popmessage("(PC=%06x) offs 5 %04x %02x",cpu_get_pc(machine->activecpu),port_sel,((ioga[5] & 0xff0000) >> 16)); + logerror("(PC=%06x) offs 5 %04x %02x\n",cpu_get_pc(machine->activecpu),port_sel,((ioga[5] & 0xff0000) >> 16)); //stv_workram_h[0x8e830/4] = ((ioga[5] & 0xff0000) >> 16) ^ 0x3; //stv_workram_h[0x8e834/4] = ((ioga[5] & 0xff0000) >> 16) ^ 0x3; @@ -966,8 +966,8 @@ static READ32_HANDLER ( stv_io_r32 ) case 0x60: return ioga[5]; case 0x77: { - //popmessage("(PC=%06x) offs 6 %04x %02x",activecpu_get_pc(),port_sel,((ioga[5] & 0xff0000) >> 16)); - logerror("(PC=%06x) offs 6 %04x %02x\n",activecpu_get_pc(),port_sel,((ioga[5] & 0xff0000) >> 16)); + //popmessage("(PC=%06x) offs 6 %04x %02x",cpu_get_pc(machine->activecpu),port_sel,((ioga[5] & 0xff0000) >> 16)); + logerror("(PC=%06x) offs 6 %04x %02x\n",cpu_get_pc(machine->activecpu),port_sel,((ioga[5] & 0xff0000) >> 16)); return 0;//sound board status,non-zero = processing } default: @@ -976,7 +976,7 @@ static READ32_HANDLER ( stv_io_r32 ) } break; case 7: - if(LOG_IOGA) logerror("(PC %d=%06x) Warning: READ from PORT_AD\n",cpu_getactivecpu(), activecpu_get_pc()); + if(LOG_IOGA) logerror("(PC %d=%06x) Warning: READ from PORT_AD\n",cpunum_get_active(), cpu_get_pc(machine->activecpu)); popmessage("Read from PORT_AD"); port_i++; return port_ad[port_i & 7]; @@ -987,7 +987,7 @@ static READ32_HANDLER ( stv_io_r32 ) static WRITE32_HANDLER ( stv_io_w32 ) { -// if(LOG_IOGA) logerror("(PC=%08X): I/O w %08X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); +// if(LOG_IOGA) logerror("(PC=%08X): I/O w %08X = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); switch(offset) { @@ -1160,7 +1160,7 @@ static READ32_HANDLER( stv_scu_r32 ) //} if (offset == 31) { - if(LOG_SCU) logerror("(PC=%08x) DMA status reg read\n",activecpu_get_pc()); + if(LOG_SCU) logerror("(PC=%08x) DMA status reg read\n",cpu_get_pc(machine->activecpu)); return stv_scu[offset]; } else if ( offset == 35 ) @@ -1170,18 +1170,18 @@ static READ32_HANDLER( stv_scu_r32 ) } else if( offset == 41) { - logerror("(PC=%08x) IRQ status reg read\n",activecpu_get_pc()); + logerror("(PC=%08x) IRQ status reg read\n",cpu_get_pc(machine->activecpu)); /*TODO:for now we're activating everything here,but we need to return the proper active irqs*/ return 0xffffffff; } else if( offset == 50 ) { - logerror("(PC=%08x) SCU version reg read\n",activecpu_get_pc()); + logerror("(PC=%08x) SCU version reg read\n",cpu_get_pc(machine->activecpu)); return 0x00000000;/*SCU Version 0*/ } else { - if(LOG_SCU) logerror("(PC=%08x) SCU reg read at %d = %08x\n",activecpu_get_pc(),offset,stv_scu[offset]); + if(LOG_SCU) logerror("(PC=%08x) SCU reg read at %d = %08x\n",cpu_get_pc(machine->activecpu),offset,stv_scu[offset]); return stv_scu[offset]; } } @@ -1398,7 +1398,7 @@ static WRITE32_HANDLER( stv_scu_w32 ) stv_scu[40] != 0xffffffff) { if(LOG_SCU) logerror("cpu #%d (PC=%08X) IRQ mask reg set %08x = %d%d%d%d|%d%d%d%d|%d%d%d%d|%d%d%d%d\n", - cpu_getactivecpu(), activecpu_get_pc(), + cpunum_get_active(), cpu_get_pc(machine->activecpu), stv_scu[offset], stv_scu[offset] & 0x8000 ? 1 : 0, /*A-Bus irq*/ stv_scu[offset] & 0x4000 ? 1 : 0, /*<reserved>*/ @@ -1991,17 +1991,17 @@ static WRITE32_HANDLER( stv_scsp_regs_w32 ) * Enter into Radiant Silver Gun specific menu for a test... */ static WRITE32_HANDLER( minit_w ) { - logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data); + logerror("cpu #%d (PC=%08X) MINIT write = %08x\n",cpunum_get_active(), cpu_get_pc(machine->activecpu),data); cpu_boost_interleave(machine, minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost)); cpu_trigger(machine, 1000); - cpunum_set_info_int(1, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE); } static WRITE32_HANDLER( sinit_w ) { - logerror("cpu #%d (PC=%08X) SINIT write = %08x\n",cpu_getactivecpu(), activecpu_get_pc(),data); + logerror("cpu #%d (PC=%08X) SINIT write = %08x\n",cpunum_get_active(), cpu_get_pc(machine->activecpu),data); cpu_boost_interleave(machine, sinit_boost_timeslice, ATTOTIME_IN_USEC(sinit_boost)); - cpunum_set_info_int(0, CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_FRT_INPUT, PULSE_LINE); } @@ -2319,7 +2319,7 @@ static WRITE32_HANDLER ( w60ffc44_write ) { COMBINE_DATA(&stv_workram_h[0xffc44/4]); - logerror("cpu #%d (PC=%08X): 60ffc44_write write = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), data, mem_mask); + logerror("cpu #%d (PC=%08X): 60ffc44_write write = %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), data, mem_mask); //sinit_w(offset,data,mem_mask); } @@ -2327,7 +2327,7 @@ static WRITE32_HANDLER ( w60ffc48_write ) { COMBINE_DATA(&stv_workram_h[0xffc48/4]); - logerror("cpu #%d (PC=%08X): 60ffc48_write write = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), data, mem_mask); + logerror("cpu #%d (PC=%08X): 60ffc48_write write = %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), data, mem_mask); //minit_w(offset,data,mem_mask); } @@ -2356,8 +2356,8 @@ DRIVER_INIT ( stv ) // do strict overwrite verification - maruchan and rsgun crash after coinup without this. // cottonbm needs strict PCREL // todo: test what games need this and don't turn it on for them... - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); - cpunum_set_info_int(1, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_STRICT_VERIFY|SH2DRC_STRICT_PCREL); /* debug .. watch the command buffer rsgun, cottonbm etc. appear to use to communicate between cpus */ memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc44, 0x60ffc47, 0, 0, w60ffc44_write ); diff --git a/src/mame/drivers/stvinit.c b/src/mame/drivers/stvinit.c index 6df279c9aac..dd320d17dea 100644 --- a/src/mame/drivers/stvinit.c +++ b/src/mame/drivers/stvinit.c @@ -6,6 +6,7 @@ to be honest i think some of these cause more problems than they're worth ... */ #include "driver.h" +#include "deprecat.h" #include "machine/eeprom.h" #include "cpu/sh2/sh2.h" #include "machine/stvprot.h" @@ -119,7 +120,7 @@ NVRAM_HANDLER( stv ) static READ32_HANDLER( stv_speedup_r ) { - if (activecpu_get_pc()==0x60154b2) cpu_spinuntil_int(); // bios menus.. + if (cpu_get_pc(machine->activecpu)==0x60154b2) cpu_spinuntil_int(); // bios menus.. cpu_spinuntil_int(); return stv_workram_h[0x0335d0/4]; @@ -127,7 +128,7 @@ static READ32_HANDLER( stv_speedup_r ) static READ32_HANDLER( stv_speedup2_r ) { - if (activecpu_get_pc()==0x6013aee) cpu_spinuntil_int(); // for use in japan + if (cpu_get_pc(machine->activecpu)==0x6013aee) cpu_spinuntil_int(); // for use in japan cpu_spinuntil_int(); @@ -137,15 +138,15 @@ static READ32_HANDLER( stv_speedup2_r ) void install_stvbios_speedups(running_machine *machine) { // flushes 0 & 1 on both CPUs are for the BIOS speedups - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60154b2); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013aee); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60154b2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013aee); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60154b2); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013aee); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60154b2); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013aee); /* idle skip bios? .. not 100% sure this is safe .. we'll see */ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60335d0, 0x60335d3, 0, 0, stv_speedup_r ); @@ -154,7 +155,7 @@ void install_stvbios_speedups(running_machine *machine) static READ32_HANDLER( shienryu_slave_speedup_r ) { - if (activecpu_get_pc()==0x0600440e) + if (cpu_get_pc(machine->activecpu)==0x0600440e) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); // is this safe... we can't skip till vbl because its not a vbl wait loop return stv_workram_h[0x0ae8e4/4]; @@ -163,7 +164,7 @@ static READ32_HANDLER( shienryu_slave_speedup_r ) static READ32_HANDLER( shienryu_speedup_r ) { - if (activecpu_get_pc()==0x060041C6) cpu_spinuntil_int(); // after you enable the sound cpu ... + if (cpu_get_pc(machine->activecpu)==0x060041C6) cpu_spinuntil_int(); // after you enable the sound cpu ... return stv_workram_h[0x0ae8e0/4]; } @@ -174,11 +175,11 @@ DRIVER_INIT(shienryu) stv_default_eeprom_length = sizeof(shienryu_default_eeprom); // master - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60041c6); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60041c6); // slave - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600440e); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600440e); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ae8e0, 0x60ae8e3, 0, 0, shienryu_speedup_r ); // after you enable sound cpu memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60ae8e4, 0x60ae8e7, 0, 0, shienryu_slave_speedup_r ); // after you enable sound cpu @@ -188,13 +189,13 @@ DRIVER_INIT(shienryu) static READ32_HANDLER( prikura_speedup_r ) { - if (activecpu_get_pc()==0x6018640) cpu_spinuntil_int(); // after you enable the sound cpu ... + if (cpu_get_pc(machine->activecpu)==0x6018640) cpu_spinuntil_int(); // after you enable the sound cpu ... return stv_workram_h[0x0b9228/4]; } static void prikura_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x06018c6e ) + if ( cpu_get_pc(Machine->activecpu) == 0x06018c6e ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } @@ -209,14 +210,14 @@ DRIVER_INIT(prikura) (loops for 263473 instructions) */ // master - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6018640); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6018640); // slave - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6018c6e); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6018c6e); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b9228, 0x60b922b, 0, 0, prikura_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)prikura_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)prikura_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -228,7 +229,7 @@ DRIVER_INIT(prikura) static READ32_HANDLER( hanagumi_speedup_r ) { - if (activecpu_get_pc()==0x06010160) cpu_spinuntil_int(); // title logos + if (cpu_get_pc(machine->activecpu)==0x06010160) cpu_spinuntil_int(); // title logos return stv_workram_h[0x94188/4]; } @@ -260,8 +261,8 @@ DRIVER_INIT(hanagumi) (loops for 288688 instructions) */ - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6010160); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6010160); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6094188, 0x609418b, 0, 0, hanagumi_speedup_r ); memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6015438, 0x601543b, 0, 0, hanagumi_slave_off ); @@ -290,7 +291,7 @@ CPU0: Aids Screen static READ32_HANDLER( puyosun_speedup_r ) { - if (activecpu_get_pc()==0x6021CF0) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); // spinuntilint breaks controls again .. urgh + if (cpu_get_pc(machine->activecpu)==0x6021CF0) cpu_spinuntil_time(ATTOTIME_IN_USEC(400)); // spinuntilint breaks controls again .. urgh return stv_workram_h[0x0ffc10/4]; @@ -298,21 +299,21 @@ static READ32_HANDLER( puyosun_speedup_r ) static void puyosun_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x60236fe ) + if ( cpu_get_pc(Machine->activecpu) == 0x60236fe ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(puyosun) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6021cf0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6021cf0); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60236fe); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60236fe); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, puyosun_speedup_r ); // idle loop of main cpu - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)puyosun_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)puyosun_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -332,15 +333,15 @@ CPU0 Data East Logo: static READ32_HANDLER( mausuke_speedup_r ) { - if (activecpu_get_pc()==0x060461A0) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); // spinuntilint breaks controls again .. urgh + if (cpu_get_pc(machine->activecpu)==0x060461A0) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); // spinuntilint breaks controls again .. urgh return stv_workram_h[0x0ffc10/4]; } DRIVER_INIT(mausuke) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60461A0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60461A0); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, mausuke_speedup_r ); // idle loop of main cpu @@ -353,14 +354,14 @@ DRIVER_INIT(mausuke) #if 0 static READ32_HANDLER( cottonbm_speedup_r ) { - if (activecpu_get_pc()==0x06030EE2) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); // spinuntilint breaks lots of things + if (cpu_get_pc(machine->activecpu)==0x06030EE2) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); // spinuntilint breaks lots of things return stv_workram_h[0x0ffc10/4]; } static void cottonbm_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x6032b52) + if (cpu_get_pc(Machine->activecpu) == 0x6032b52) if ( (data & 0x00800000) == 0 ) { if ( @@ -380,12 +381,12 @@ static void cottonbm_slave_speedup( UINT32 data ) DRIVER_INIT(cottonbm) { -// cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); -// cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6030ee2); -// cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); -// cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6032b52); +// cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); +// cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6030ee2); +// cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); +// cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6032b52); -// cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cottonbm_slave_speedup ); +// cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cottonbm_slave_speedup ); // memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cottonbm_speedup_r ); // idle loop of main cpu DRIVER_INIT_CALL(stv); @@ -395,14 +396,14 @@ DRIVER_INIT(cottonbm) static READ32_HANDLER( cotton2_speedup_r ) { - if (activecpu_get_pc()==0x06031c7a) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); // spinuntilint breaks lots of things + if (cpu_get_pc(machine->activecpu)==0x06031c7a) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); // spinuntilint breaks lots of things return stv_workram_h[0x0ffc10/4]; } static void cotton2_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x60338ea) + if (cpu_get_pc(Machine->activecpu) == 0x60338ea) if ( (data & 0x00800000) == 0 ) { if ( @@ -421,13 +422,13 @@ static void cotton2_slave_speedup( UINT32 data ) DRIVER_INIT(cotton2) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6031c7a); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60338ea); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6031c7a); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60338ea); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, cotton2_speedup_r ); // idle loop of main cpu - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cotton2_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)cotton2_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -438,25 +439,25 @@ static int dnmtdeka_pending_commands; static READ32_HANDLER( dnmtdeka_speedup_r ) { - if (activecpu_get_pc()==0x6027c90) cpu_spinuntil_int();//cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x6027c90) cpu_spinuntil_int();//cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x0985a0/4]; } static WRITE32_HANDLER(dnmtdeka_cmd_write) { COMBINE_DATA(&stv_workram_h[0x0e0ad4/4 + offset]); - if ( (cpu_getactivecpu() == 0) && (activecpu_get_pc() == 0x00000d04) ) + if ( (cpunum_get_active() == 0) && (cpu_get_pc(machine->activecpu) == 0x00000d04) ) return; if ( data != 0 ) dnmtdeka_pending_commands++; - //logerror( "CMD: Written by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, dnmtdeka_pending_commands ); + //logerror( "CMD: Written by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset, data, dnmtdeka_pending_commands ); cpu_trigger(machine, 1000); } static READ32_HANDLER(dnmtdeka_cmd_read) { - //logerror( "CMD: Read by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, stv_workram_h[0xe0bd0/4 + offset], dnmtdeka_pending_commands ); - if ( activecpu_get_pc() == 0x060051f2 ) + //logerror( "CMD: Read by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset, stv_workram_h[0xe0bd0/4 + offset], dnmtdeka_pending_commands ); + if ( cpu_get_pc(machine->activecpu) == 0x060051f2 ) { if ( stv_workram_h[0x0e0ad4/4 + offset] == 0 ) { @@ -476,19 +477,19 @@ static READ32_HANDLER(dnmtdeka_cmd_read) DRIVER_INIT(dnmtdeka) { // install all 3 speedups on both master and slave - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c90); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); - - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c90); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c90); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); + + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c90); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); dnmtdeka_pending_commands = 0; @@ -502,25 +503,25 @@ static int diehard_pending_commands; static READ32_HANDLER(diehard_speedup_r) { - if ( activecpu_get_pc() == 0x06027c98 ) cpu_spinuntil_int(); + if ( cpu_get_pc(machine->activecpu) == 0x06027c98 ) cpu_spinuntil_int(); return stv_workram_h[0x000986ac/4]; } static WRITE32_HANDLER(diehard_cmd_write) { COMBINE_DATA(&stv_workram_h[0xe0bd0/4 + offset]); - if ( (cpu_getactivecpu() == 0) && (activecpu_get_pc() == 0x00000d04) ) + if ( (cpunum_get_active() == 0) && (cpu_get_pc(machine->activecpu) == 0x00000d04) ) return; if ( data != 0 ) diehard_pending_commands++; - //logerror( "CMD: Written by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, diehard_pending_commands ); + //logerror( "CMD: Written by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset, data, diehard_pending_commands ); cpu_trigger(machine, 1000); } static READ32_HANDLER(diehard_cmd_read) { - //logerror( "CMD: Read by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, stv_workram_h[0xe0bd0/4 + offset], diehard_pending_commands ); - if ( activecpu_get_pc() == 0x060051f2 ) + //logerror( "CMD: Read by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset, stv_workram_h[0xe0bd0/4 + offset], diehard_pending_commands ); + if ( cpu_get_pc(machine->activecpu) == 0x060051f2 ) { if ( stv_workram_h[0xe0bd0/4 + offset] == 0 ) { @@ -534,7 +535,7 @@ static READ32_HANDLER(diehard_cmd_read) static READ32_HANDLER(diehard_cmd_ack_read) { - //logerror( "CMDACK: Read by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, stv_workram_h[0x000e0dd8/4], diehard_pending_commands ); + //logerror( "CMDACK: Read by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset, stv_workram_h[0x000e0dd8/4], diehard_pending_commands ); if ( (stv_workram_h[0x000e0dd8/4] & 0xff000000) == 0 && diehard_pending_commands == 0 ) { @@ -545,7 +546,7 @@ static READ32_HANDLER(diehard_cmd_ack_read) static WRITE32_HANDLER(diehard_cmd_ack_write) { - //logerror( "CMDACK: Write by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, diehard_pending_commands ); + //logerror( "CMDACK: Write by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset, data, diehard_pending_commands ); if ( diehard_pending_commands > 0 ) { diehard_pending_commands--; @@ -555,7 +556,7 @@ static WRITE32_HANDLER(diehard_cmd_ack_write) static WRITE32_HANDLER(diehard_cmd_ack_write_cpu0) { - //logerror( "CMDACK: Write by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpu_getactivecpu(), activecpu_get_pc(), offset, data, diehard_pending_commands ); + //logerror( "CMDACK: Write by cpu=%d, at = %08X, offset = %08X, data = %08X, commands = %d\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset, data, diehard_pending_commands ); COMBINE_DATA(&stv_workram_h[0x000e0dd8/4]); cpu_trigger(machine, 1000); } @@ -565,19 +566,19 @@ DRIVER_INIT(diehard) diehard_pending_commands = 0; // install all 3 speedups on both master and slave - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c98); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c98); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c98); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6027c98); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0xd04); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60051f2); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060986ac, 0x060986af, 0, 0, diehard_speedup_r ); @@ -593,14 +594,14 @@ DRIVER_INIT(diehard) static READ32_HANDLER( fhboxers_speedup_r ) { - if (activecpu_get_pc()==0x060041c2) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x060041c2) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x00420c/4]; } static READ32_HANDLER( fhboxers_speedup2_r ) { - if (activecpu_get_pc()==0x0600bb0a) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x0600bb0a) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x090740/4]; @@ -608,7 +609,7 @@ static READ32_HANDLER( fhboxers_speedup2_r ) static READ32_HANDLER( fhboxers_speedup3_r ) { - if (activecpu_get_pc()==0x0600b31e ) + if (cpu_get_pc(machine->activecpu)==0x0600b31e ) cpu_spinuntil_int(); return stv_workram_h[0x90bb4/4]; @@ -616,12 +617,12 @@ static READ32_HANDLER( fhboxers_speedup3_r ) DRIVER_INIT(fhboxers) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60041c2); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600bb0a); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600b31e); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60041c2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600bb0a); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x600b31e); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600420c, 0x600420f, 0, 0, fhboxers_speedup_r ); // idle loop of main cpu memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x6090740, 0x6090743, 0, 0, fhboxers_speedup2_r ); // idle loop of second cpu @@ -635,22 +636,22 @@ DRIVER_INIT(fhboxers) static READ32_HANDLER( groovef_hack1_r ) { - if(activecpu_get_pc() == 0x6005e7c) stv_workram_h[0x0fffcc/4] = 0x00000000; -// popmessage("1 %08x",activecpu_get_pc()); + if(cpu_get_pc(machine->activecpu) == 0x6005e7c) stv_workram_h[0x0fffcc/4] = 0x00000000; +// popmessage("1 %08x",cpu_get_pc(machine->activecpu)); return stv_workram_h[0x0fffcc/4]; } static READ32_HANDLER( groovef_hack2_r ) { - if(activecpu_get_pc() == 0x6005e86) stv_workram_h[0x0ca6cc/4] = 0x00000000; -// popmessage("2 %08x",activecpu_get_pc()); + if(cpu_get_pc(machine->activecpu) == 0x6005e86) stv_workram_h[0x0ca6cc/4] = 0x00000000; +// popmessage("2 %08x",cpu_get_pc(machine->activecpu)); return stv_workram_h[0x0ca6cc/4]; } static READ32_HANDLER( groovef_speedup_r ) { // logerror ("groove speedup \n"); - if (activecpu_get_pc()==0x060a4970) + if (cpu_get_pc(machine->activecpu)==0x060a4970) { cpu_spinuntil_int(); // title logos // logerror ("groove speedup skipping\n"); @@ -663,29 +664,29 @@ static READ32_HANDLER( groovef_speedup_r ) #ifdef UNUSED_FUNCTION static READ32_HANDLER( groovef_second_cpu_off_r ) { - if (activecpu_get_pc()==0x060060c2) cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); + if (cpu_get_pc(machine->activecpu)==0x060060c2) cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); return 0; } #endif static void groovef_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x060060c2 ) + if ( cpu_get_pc(Machine->activecpu) == 0x060060c2 ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT( groovef ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6005e7c); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6005e86); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60a4970); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6005e7c); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6005e86); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60a4970); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60060c2); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60060c2); /* prevent game from hanging on startup -- todo: remove these hacks */ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ca6cc, 0x60ca6cf, 0, 0, groovef_hack2_r ); @@ -693,7 +694,7 @@ DRIVER_INIT( groovef ) memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60c64ec, 0x60c64ef, 0, 0, groovef_speedup_r ); // memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0x60060dc, 0x60060df, 0, 0, groovef_second_cpu_off_r ); // not a good idea, needs it for ai. - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)groovef_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)groovef_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -730,39 +731,39 @@ and Hanafuda works without hack now (unless the sound ram one) static READ32_HANDLER( danchih_hack_r ) { - logerror( "DMASt_SCU1: Read at PC=%08x, value = %08x\n", activecpu_get_pc(), stv_workram_h[0x0ffcbc/4] ); - if (activecpu_get_pc()==0x06028b28) return 0x0e0c0000; + logerror( "DMASt_SCU1: Read at PC=%08x, value = %08x\n", cpu_get_pc(machine->activecpu), stv_workram_h[0x0ffcbc/4] ); + if (cpu_get_pc(machine->activecpu)==0x06028b28) return 0x0e0c0000; return stv_workram_h[0x0ffcbc/4]; } static READ32_HANDLER( danchih_speedup_r ) { - if (activecpu_get_pc()==0x06028c8e) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x06028c8e) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x0ffc10/4]; } static void danchih_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x0602ae26 ) + if ( cpu_get_pc(Machine->activecpu) == 0x0602ae26 ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT( danchih ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028b28); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028c8e); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602ae26); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028b28); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028c8e); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602ae26); /* prevent game from hanging on title screen -- todo: remove these hacks */ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffcbc, 0x60ffcbf, 0, 0, danchih_hack_r ); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, danchih_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)danchih_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)danchih_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -793,14 +794,14 @@ TODO: understand where it gets 0x02020000,it must be 0x0000000 static READ32_HANDLER( astrass_hack_r ) { /*PC reads at 0x60011ba if -debug is active?*/ - if(activecpu_get_pc()==0x60011b8 || activecpu_get_pc() == 0x60011ba) return 0x00000000; + if(cpu_get_pc(machine->activecpu)==0x60011b8 || cpu_get_pc(machine->activecpu) == 0x60011ba) return 0x00000000; return stv_workram_h[0x000770/4]; } static READ32_HANDLER( astrass_speedup_r ) { - if(activecpu_get_pc() == 0x0605b9da ) + if(cpu_get_pc(machine->activecpu) == 0x0605b9da ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x8e4d8/4]; @@ -808,10 +809,10 @@ static READ32_HANDLER( astrass_speedup_r ) DRIVER_INIT( astrass ) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60011b8); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605b9da); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60011b8); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605b9da); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06000770, 0x06000773, 0, 0, astrass_hack_r ); @@ -826,31 +827,31 @@ DRIVER_INIT( astrass ) static READ32_HANDLER(thunt_speedup_r) { - if (activecpu_get_pc() == 0x0602A024) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu) == 0x0602A024) cpu_spinuntil_int(); return stv_workram_h[0x00031424/4]; } static READ32_HANDLER(thunt_speedup2_r) { - if (activecpu_get_pc() == 0x06013EEA) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu) == 0x06013EEA) cpu_spinuntil_int(); return stv_workram_h[0x00075958/4]; } static void thunt_slave_speedup(UINT32 data) { - if (activecpu_get_pc() == 0x0602AAF8) + if (cpu_get_pc(Machine->activecpu) == 0x0602AAF8) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(thunt) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602A024); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013EEA); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602AAF8); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602A024); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013EEA); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602AAF8); /* 0602A024: MOV.L @R6,R0 // 06031424 @@ -879,7 +880,7 @@ DRIVER_INIT(thunt) 0602AB28: BRA $0602AAF8 */ - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)thunt_slave_speedup); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)thunt_slave_speedup); DRIVER_INIT_CALL(stv); @@ -888,36 +889,36 @@ DRIVER_INIT(thunt) static READ32_HANDLER(sandor_speedup_r) { - if (activecpu_get_pc() == 0x0602a0f8) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu) == 0x0602a0f8) cpu_spinuntil_int(); return stv_workram_h[0x000314f8/4]; } static READ32_HANDLER(sandor_speedup2_r) { - if (activecpu_get_pc() == 0x06013fbe) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu) == 0x06013fbe) cpu_spinuntil_int(); return stv_workram_h[0x00075a2c/4]; } static void sandor_slave_speedup(UINT32 data) { - if (activecpu_get_pc() == 0x0602abcc) + if (cpu_get_pc(Machine->activecpu) == 0x0602abcc) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(sandor) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602a0f8); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013fbe); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602abcc); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602a0f8); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT+1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013fbe); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602abcc); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060314f8, 0x060314fb, 0, 0, sandor_speedup_r ); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06075a2c, 0x06075a2f, 0, 0, sandor_speedup2_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)sandor_slave_speedup); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)sandor_slave_speedup); DRIVER_INIT_CALL(stv); minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(1); @@ -925,13 +926,13 @@ DRIVER_INIT(sandor) static READ32_HANDLER(grdforce_speedup_r) { - if ( activecpu_get_pc() == 0x06041E32 ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if ( cpu_get_pc(machine->activecpu) == 0x06041E32 ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x000ffc10/4]; } static void grdforce_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x06043aa2) + if (cpu_get_pc(Machine->activecpu) == 0x06043aa2) if ( (data & 0x00800000) == 0 ) { if ( @@ -951,10 +952,10 @@ static void grdforce_slave_speedup( UINT32 data ) DRIVER_INIT(grdforce) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6041e32); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6043aa2); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6041e32); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6043aa2); /* 06041E2C: MOV.L @($03C8,GBR),R0 06041E2E: JSR R0 @@ -967,7 +968,7 @@ DRIVER_INIT(grdforce) */ memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, grdforce_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)grdforce_slave_speedup); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)grdforce_slave_speedup); DRIVER_INIT_CALL(stv); @@ -976,8 +977,8 @@ DRIVER_INIT(grdforce) static READ32_HANDLER( batmanfr_speedup_r ) { - //logerror( "batmanfr speedup: pc = %08x, mem = %08x\n", activecpu_get_pc(), stv_workram_h[0x0002acf0/4] ); - if ( activecpu_get_pc() != 0x060121c0 ) + //logerror( "batmanfr speedup: pc = %08x, mem = %08x\n", cpu_get_pc(machine->activecpu), stv_workram_h[0x0002acf0/4] ); + if ( cpu_get_pc(machine->activecpu) != 0x060121c0 ) cpu_spinuntil_int(); return stv_workram_h[0x0002acf0/4]; @@ -985,7 +986,7 @@ static READ32_HANDLER( batmanfr_speedup_r ) static void batmanfr_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x060125bc ) + if (cpu_get_pc(Machine->activecpu) == 0x060125bc ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } @@ -993,13 +994,13 @@ static void batmanfr_slave_speedup( UINT32 data ) DRIVER_INIT(batmanfr) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60121c0); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60125bc); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60121c0); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60125bc); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0602acf0, 0x0602acf3, 0, 0, batmanfr_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)batmanfr_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)batmanfr_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -1009,7 +1010,7 @@ DRIVER_INIT(batmanfr) static void colmns97_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x060298a2 ) + if (cpu_get_pc(Machine->activecpu) == 0x060298a2 ) if ( (data & 0x00800000) == 0 ) if ( (stv_workram_h[0x0ffc48/4] != 0x260ef3fc) ) { @@ -1021,10 +1022,10 @@ static void colmns97_slave_speedup( UINT32 data ) DRIVER_INIT(colmns97) { - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60298a2); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60298a2); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)colmns97_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)colmns97_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -1034,27 +1035,27 @@ DRIVER_INIT(colmns97) static READ32_HANDLER(winterht_speedup_r) { - if ( activecpu_get_pc() == 0x06098aea ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20));//cpu_spinuntil_int(); + if ( cpu_get_pc(machine->activecpu) == 0x06098aea ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20));//cpu_spinuntil_int(); return stv_workram_h[0x000ffc10/4]; } static void winterht_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x0609ae4e ) + if (cpu_get_pc(Machine->activecpu) == 0x0609ae4e ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(winterht) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6098aea); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x609ae4e); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6098aea); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x609ae4e); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, winterht_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)winterht_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)winterht_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -1063,13 +1064,13 @@ DRIVER_INIT(winterht) static READ32_HANDLER(seabass_speedup_r) { - if ( activecpu_get_pc() == 0x0602cbfa ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if ( cpu_get_pc(machine->activecpu) == 0x0602cbfa ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x000ffc10/4]; } static void seabass_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x060321ee ) + if (cpu_get_pc(Machine->activecpu) == 0x060321ee ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } @@ -1077,14 +1078,14 @@ static void seabass_slave_speedup( UINT32 data ) DRIVER_INIT(seabass) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602cbfa); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60321ee); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602cbfa); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60321ee); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, seabass_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)seabass_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)seabass_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -1093,26 +1094,26 @@ DRIVER_INIT(seabass) static void vfremix_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x0604C332 ) + if (cpu_get_pc(Machine->activecpu) == 0x0604C332 ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } static READ32_HANDLER(vfremix_speedup_r) { - if ( activecpu_get_pc() == 0x0602c30c ) cpu_spinuntil_int(); + if ( cpu_get_pc(machine->activecpu) == 0x0602c30c ) cpu_spinuntil_int(); return stv_workram_h[0x00074f98/4]; } DRIVER_INIT(vfremix) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602c30c); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x604c332); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602c30c); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x604c332); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06074f98, 0x06074f9b, 0, 0, vfremix_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)vfremix_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)vfremix_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -1122,27 +1123,27 @@ DRIVER_INIT(vfremix) static READ32_HANDLER(sss_speedup_r) { - if ( activecpu_get_pc() == 0x06026398 ) cpu_spinuntil_int(); + if ( cpu_get_pc(machine->activecpu) == 0x06026398 ) cpu_spinuntil_int(); return stv_workram_h[0x000ffc10/4]; } static void sss_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x06028cd6 ) + if (cpu_get_pc(Machine->activecpu) == 0x06028cd6 ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(sss) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6026398); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028cd6); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6026398); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6028cd6); install_standard_protection(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, sss_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sss_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sss_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -1151,13 +1152,13 @@ DRIVER_INIT(sss) static READ32_HANDLER(othellos_speedup_r) { - if ( activecpu_get_pc() == 0x0602bcbe ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if ( cpu_get_pc(machine->activecpu) == 0x0602bcbe ) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x000ffc10/4]; } static void othellos_slave_speedup( UINT32 data ) { - if (activecpu_get_pc() == 0x0602d92e ) + if (cpu_get_pc(Machine->activecpu) == 0x0602d92e ) if ( (data & 0x00800000) == 0 ) if ( (stv_workram_h[0x0ffc48/4] != 0x260fd25c ) ) { @@ -1168,13 +1169,13 @@ static void othellos_slave_speedup( UINT32 data ) DRIVER_INIT(othellos) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602bcbe); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602d92e); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602bcbe); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602d92e); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060ffc10, 0x060ffc13, 0, 0, othellos_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)othellos_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)othellos_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -1184,17 +1185,17 @@ DRIVER_INIT(othellos) static void sasissu_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x060710be ) + if ( cpu_get_pc(Machine->activecpu) == 0x060710be ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(sasissu) { - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60710be); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60710be); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sasissu_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)sasissu_slave_speedup ); DRIVER_INIT_CALL(stv); @@ -1203,14 +1204,14 @@ DRIVER_INIT(sasissu) static READ32_HANDLER(gaxeduel_speedup_r) { - if ( activecpu_get_pc() == 0x06012ee4 ) cpu_spinuntil_int(); + if ( cpu_get_pc(machine->activecpu) == 0x06012ee4 ) cpu_spinuntil_int(); return stv_workram_l[0x000f4068 / 4]; } DRIVER_INIT(gaxeduel) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6012ee4); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6012ee4); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x002f4068, 0x002f406b, 0, 0, gaxeduel_speedup_r); DRIVER_INIT_CALL(stv); @@ -1218,14 +1219,14 @@ DRIVER_INIT(gaxeduel) static READ32_HANDLER(suikoenb_speedup_r) { - if ( activecpu_get_pc() == 0x06013f7a ) cpu_spinuntil_int(); + if ( cpu_get_pc(machine->activecpu) == 0x06013f7a ) cpu_spinuntil_int(); return stv_workram_h[0x000705d0 / 4]; } DRIVER_INIT(suikoenb) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013f7a); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6013f7a); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x060705d0, 0x060705d3, 0, 0, suikoenb_speedup_r); DRIVER_INIT_CALL(stv); @@ -1241,13 +1242,13 @@ DRIVER_INIT(sokyugrt) static READ32_HANDLER( znpwfv_speedup_r ) { - if (activecpu_get_pc()==0x6012ec2) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x6012ec2) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x0ffc10/4]; } static void znpwfv_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x060175a6 ) + if ( cpu_get_pc(Machine->activecpu) == 0x060175a6 ) if ( (data & 0x00800000) == 0 ) { if ( @@ -1265,12 +1266,12 @@ static void znpwfv_slave_speedup( UINT32 data ) DRIVER_INIT(znpwfv) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6012ec2); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60175a6); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6012ec2); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x60175a6); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)znpwfv_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)znpwfv_slave_speedup ); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, znpwfv_speedup_r ); DRIVER_INIT_CALL(stv); @@ -1279,25 +1280,25 @@ DRIVER_INIT(znpwfv) static READ32_HANDLER( twcup98_speedup_r ) { - if (activecpu_get_pc()==0x605edde) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x605edde) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x0ffc10/4]; } static void twcup98_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x06062bca ) + if ( cpu_get_pc(Machine->activecpu) == 0x06062bca ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(twcup98) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605edde); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6062bca); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605edde); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6062bca); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)twcup98_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)twcup98_slave_speedup ); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, twcup98_speedup_r ); DRIVER_INIT_CALL(stv); @@ -1308,25 +1309,25 @@ DRIVER_INIT(twcup98) static READ32_HANDLER( smleague_speedup_r ) { - if (activecpu_get_pc()==0x6063bf4) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x6063bf4) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x0ffc10/4]; } static void smleague_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x06062bca ) + if ( cpu_get_pc(Machine->activecpu) == 0x06062bca ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(smleague) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6063bf4); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6062bca); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6063bf4); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6062bca); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)smleague_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)smleague_slave_speedup ); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, smleague_speedup_r ); DRIVER_INIT_CALL(stv); @@ -1336,15 +1337,15 @@ DRIVER_INIT(smleague) static READ32_HANDLER( finlarch_speedup_r ) { - if (activecpu_get_pc()==0x6064d60) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x6064d60) cpu_spinuntil_int(); return stv_workram_h[0x0ffc10/4]; } DRIVER_INIT(finlarch) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6064d60); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6064d60); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, finlarch_speedup_r ); @@ -1354,13 +1355,13 @@ DRIVER_INIT(finlarch) static READ32_HANDLER( maruchan_speedup_r ) { - if (activecpu_get_pc()==0x06012a52) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x06012a52) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x0ffc10/4]; } static void maruchan_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x0601ba46 ) + if ( cpu_get_pc(Machine->activecpu) == 0x0601ba46 ) if ( (data & 0x00800000) == 0 ) if ( (stv_workram_h[0x0ffc48/4] != 0x260ef3c8) && @@ -1376,12 +1377,12 @@ static void maruchan_slave_speedup( UINT32 data ) DRIVER_INIT(maruchan) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601ba46); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601ba46); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601ba46); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601ba46); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)maruchan_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)maruchan_slave_speedup ); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, maruchan_speedup_r ); DRIVER_INIT_CALL(stv); @@ -1391,7 +1392,7 @@ DRIVER_INIT(maruchan) static READ32_HANDLER( pblbeach_speedup_r ) { - if (activecpu_get_pc()==0x0605eb78) + if (cpu_get_pc(machine->activecpu)==0x0605eb78) if (stv_workram_h[0x006c398/4] != 0) cpu_spinuntil_int(); return stv_workram_h[0x006c398/4]; @@ -1399,8 +1400,8 @@ static READ32_HANDLER( pblbeach_speedup_r ) DRIVER_INIT(pblbeach) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605eb78); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605eb78); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0606c398, 0x0606c39b, 0, 0, pblbeach_speedup_r ); @@ -1409,15 +1410,15 @@ DRIVER_INIT(pblbeach) static READ32_HANDLER( shanhigw_speedup_r ) { - if (activecpu_get_pc()==0x06020c5c) + if (cpu_get_pc(machine->activecpu)==0x06020c5c) cpu_spinuntil_int(); return stv_workram_h[0x95cd8/4]; } DRIVER_INIT(shanhigw) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6020c5c); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6020c5c); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x06095cd8, 0x06095cdb, 0, 0, shanhigw_speedup_r ); @@ -1426,14 +1427,14 @@ DRIVER_INIT(shanhigw) static READ32_HANDLER( elandore_speedup_r ) { - if (activecpu_get_pc()==0x0604eac0) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x0604eac0) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x0ffc10/4]; } static void elandore_slave_speedup(UINT32 data) { - if (activecpu_get_pc() == 0x0605340a) + if (cpu_get_pc(Machine->activecpu) == 0x0605340a) if ( (data & 0x00800000) == 0 ) if ( (stv_workram_h[0x0ffc48/4] != 0x260ee018) ) { @@ -1445,14 +1446,14 @@ static void elandore_slave_speedup(UINT32 data) DRIVER_INIT(elandore) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x604eac0); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605340a); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x604eac0); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x605340a); install_standard_protection(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, elandore_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)elandore_slave_speedup); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)elandore_slave_speedup); DRIVER_INIT_CALL(stv); minit_boost_timeslice = sinit_boost_timeslice = ATTOTIME_IN_USEC(0); @@ -1460,13 +1461,13 @@ DRIVER_INIT(elandore) static READ32_HANDLER( rsgun_speedup_r ) { - if (activecpu_get_pc()==0x06034d04) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); + if (cpu_get_pc(machine->activecpu)==0x06034d04) cpu_spinuntil_time(ATTOTIME_IN_USEC(20)); return stv_workram_h[0x0ffc10/4]; } static void rsgun_slave_speedup(UINT32 data) { - if (activecpu_get_pc() == 0x06036152) + if (cpu_get_pc(Machine->activecpu) == 0x06036152) if ( (data & 0x00800000) == 0 ) if ((stv_workram_h[0x0ffc48/4] != 0x260efc50)) { @@ -1478,14 +1479,14 @@ static void rsgun_slave_speedup(UINT32 data) DRIVER_INIT(rsgun) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6034d04); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6036152); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6034d04); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6036152); install_standard_protection(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60ffc10, 0x60ffc13, 0, 0, rsgun_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)rsgun_slave_speedup); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf *)rsgun_slave_speedup); DRIVER_INIT_CALL(stv); @@ -1507,25 +1508,25 @@ DRIVER_INIT(decathlt) static READ32_HANDLER( nameclv3_speedup_r ) { - if (activecpu_get_pc()==0x601eb4c) cpu_spinuntil_time(ATTOTIME_IN_USEC(30)); + if (cpu_get_pc(machine->activecpu)==0x601eb4c) cpu_spinuntil_time(ATTOTIME_IN_USEC(30)); return stv_workram_h[0x0452c0/4]; } static void nameclv3_slave_speedup( UINT32 data ) { - if ( activecpu_get_pc() == 0x0602B80e ) + if ( cpu_get_pc(Machine->activecpu) == 0x0602B80e ) if ( (data & 0x00800000) == 0 ) cpunum_spinuntil_trigger(1, 1000); } DRIVER_INIT(nameclv3) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601eb4c); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); - cpunum_set_info_int(1, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602b80e); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x601eb4c); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_SELECT, FIRST_SPEEDUP_SLOT); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x602b80e); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60452c0, 0x60452c3, 0, 0, nameclv3_speedup_r ); - cpunum_set_info_fct(1, CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)nameclv3_slave_speedup ); + cpu_set_info_fct(machine->cpu[1], CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK, (genf*)nameclv3_slave_speedup ); DRIVER_INIT_CALL(stv); } diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c index 4c0382cc944..47d8eacd9c5 100644 --- a/src/mame/drivers/suna16.c +++ b/src/mame/drivers/suna16.c @@ -55,7 +55,7 @@ static WRITE16_HANDLER( suna16_soundlatch_w ) { soundlatch_w( machine, 0, data & 0xff ); } - if (data & ~0xff) logerror("CPU#0 PC %06X - Sound latch unknown bits: %04X\n", activecpu_get_pc(), data); + if (data & ~0xff) logerror("CPU#0 PC %06X - Sound latch unknown bits: %04X\n", cpu_get_pc(machine->activecpu), data); } @@ -69,7 +69,7 @@ static WRITE16_HANDLER( bssoccer_leds_w ) set_led_status(3, data & 0x08); coin_counter_w(0, data & 0x10); } - if (data & ~0x1f) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", activecpu_get_pc(), data); + if (data & ~0x1f) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(machine->activecpu), data); } @@ -81,7 +81,7 @@ static WRITE16_HANDLER( uballoon_leds_w ) set_led_status(0, data & 0x02); set_led_status(1, data & 0x04); } - if (data & ~0x07) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", activecpu_get_pc(), data); + if (data & ~0x07) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(machine->activecpu), data); } @@ -91,7 +91,7 @@ static WRITE16_HANDLER( bestbest_coin_w ) { coin_counter_w(0, data & 0x04); } - if (data & ~0x04) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", activecpu_get_pc(), data); + if (data & ~0x04) logerror("CPU#0 PC %06X - Leds unknown bits: %04X\n", cpu_get_pc(machine->activecpu), data); } @@ -212,7 +212,7 @@ static WRITE16_HANDLER( bestbest_prot_w ) case 0x00: prot = prot ^ 0x0009; break; case 0x08: prot = prot ^ 0x0002; break; case 0x0c: prot = prot ^ 0x0003; break; -// default: logerror("CPU#0 PC %06X - Unknown protection value: %04X\n", activecpu_get_pc(), data); +// default: logerror("CPU#0 PC %06X - Unknown protection value: %04X\n", cpu_get_pc(machine->activecpu), data); } } } @@ -338,7 +338,7 @@ static WRITE8_HANDLER( bssoccer_pcm_1_bankswitch_w ) { UINT8 *RAM = memory_region(machine, "pcm1"); int bank = data & 7; - if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", activecpu_get_pc(), data); + if (bank & ~7) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(machine->activecpu), data); memory_set_bankptr(1, &RAM[bank * 0x10000 + 0x1000]); } @@ -346,7 +346,7 @@ static WRITE8_HANDLER( bssoccer_pcm_2_bankswitch_w ) { UINT8 *RAM = memory_region(machine, "pcm2"); int bank = data & 7; - if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", activecpu_get_pc(), data); + if (bank & ~7) logerror("CPU#3 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(machine->activecpu), data); memory_set_bankptr(2, &RAM[bank * 0x10000 + 0x1000]); } @@ -410,7 +410,7 @@ static WRITE8_HANDLER( uballoon_pcm_1_bankswitch_w ) { UINT8 *RAM = memory_region(machine, "pcm"); int bank = data & 1; - if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", activecpu_get_pc(), data); + if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(machine->activecpu), data); memory_set_bankptr(1, &RAM[bank * 0x10000 + 0x400]); } diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c index f06f18ad37c..a8b4b12b018 100644 --- a/src/mame/drivers/suna8.c +++ b/src/mame/drivers/suna8.c @@ -469,7 +469,7 @@ static READ8_HANDLER( hardhead_ip_r ) case 2: return input_port_read(machine, "DSW1"); case 3: return input_port_read(machine, "DSW2"); default: - logerror("CPU #0 - PC %04X: Unknown IP read: %02X\n",activecpu_get_pc(),*hardhead_ip); + logerror("CPU #0 - PC %04X: Unknown IP read: %02X\n",cpu_get_pc(machine->activecpu),*hardhead_ip); return 0xff; } } @@ -483,7 +483,7 @@ static WRITE8_HANDLER( hardhead_bankswitch_w ) { int bank = data & 0x0f; - if (data & ~0xef) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0xef) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(machine->activecpu),data); memory_set_bank(1, bank); } @@ -550,7 +550,7 @@ static WRITE8_HANDLER( rranger_bankswitch_w ) int bank = data & 0x07; if ((~data & 0x10) && (bank >= 4)) bank += 4; - if (data & ~0xf7) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0xf7) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",cpu_get_pc(machine->activecpu),data); memory_set_bank(1, bank); @@ -622,7 +622,7 @@ static READ8_HANDLER( brickzn_c140_r ) static WRITE8_HANDLER( brickzn_palettebank_w ) { suna8_palettebank = (data >> 1) & 1; - if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown palettebank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown palettebank bits: %02X\n",cpu_get_pc(machine->activecpu),data); /* Also used as soundlatch - depending on c0c0? */ soundlatch_w(machine,0,data); @@ -636,7 +636,7 @@ static WRITE8_HANDLER( brickzn_palettebank_w ) static WRITE8_HANDLER( brickzn_spritebank_w ) { suna8_spritebank = (data >> 1) & 1; - if (data & ~0x03) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x03) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(machine->activecpu),data); flip_screen_set( data & 0x01 ); } @@ -653,7 +653,7 @@ static WRITE8_HANDLER( brickzn_rombank_w ) { int bank = data & 0x0f; - if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(machine->activecpu),data); memory_set_bank(1, bank); suna8_rombank = data; @@ -697,7 +697,7 @@ static UINT8 suna8_nmi_enable; static WRITE8_HANDLER( hardhea2_nmi_w ) { suna8_nmi_enable = data & 0x01; -// if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown nmi bits: %02X\n",activecpu_get_pc(),data); +// if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown nmi bits: %02X\n",cpu_get_pc(machine->activecpu),data); } /* @@ -707,7 +707,7 @@ static WRITE8_HANDLER( hardhea2_nmi_w ) static WRITE8_HANDLER( hardhea2_flipscreen_w ) { flip_screen_set(data & 0x01); - if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(machine->activecpu),data); } static WRITE8_HANDLER( hardhea2_leds_w ) @@ -715,7 +715,7 @@ static WRITE8_HANDLER( hardhea2_leds_w ) set_led_status(0, data & 0x01); set_led_status(1, data & 0x02); coin_counter_w(0, data & 0x04); - if (data & ~0x07) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x07) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",cpu_get_pc(machine->activecpu),data); } /* @@ -726,7 +726,7 @@ static WRITE8_HANDLER( hardhea2_leds_w ) static WRITE8_HANDLER( hardhea2_spritebank_w ) { suna8_spritebank = (data >> 1) & 1; - if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(machine->activecpu),data); } /* @@ -737,7 +737,7 @@ static WRITE8_HANDLER( hardhea2_rombank_w ) { int bank = data & 0x0f; - if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(machine->activecpu),data); memory_set_bank(1, bank); suna8_rombank = data; @@ -819,7 +819,7 @@ static UINT8 spritebank_latch; static WRITE8_HANDLER( starfigh_spritebank_latch_w ) { spritebank_latch = (data >> 2) & 1; - if (data & ~0x04) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x04) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(machine->activecpu),data); } static WRITE8_HANDLER( starfigh_spritebank_w ) @@ -862,7 +862,7 @@ ADDRESS_MAP_END static WRITE8_HANDLER( sparkman_nmi_w ) { suna8_nmi_enable = data & 0x01; - if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown nmi bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown nmi bits: %02X\n",cpu_get_pc(machine->activecpu),data); } /* @@ -872,7 +872,7 @@ static WRITE8_HANDLER( sparkman_nmi_w ) static WRITE8_HANDLER( sparkman_flipscreen_w ) { flip_screen_set(data & 0x01); - if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x01) logerror("CPU #0 - PC %04X: unknown flipscreen bits: %02X\n",cpu_get_pc(machine->activecpu),data); } static WRITE8_HANDLER( sparkman_leds_w ) @@ -880,7 +880,7 @@ static WRITE8_HANDLER( sparkman_leds_w ) set_led_status(0, data & 0x01); set_led_status(1, data & 0x02); coin_counter_w(0, data & 0x04); - if (data & ~0x07) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x07) logerror("CPU#0 - PC %06X: unknown leds bits: %02X\n",cpu_get_pc(machine->activecpu),data); } /* @@ -891,7 +891,7 @@ static WRITE8_HANDLER( sparkman_leds_w ) static WRITE8_HANDLER( sparkman_spritebank_w ) { suna8_spritebank = (data >> 1) & 1; - if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x02) logerror("CPU #0 - PC %04X: unknown spritebank bits: %02X\n",cpu_get_pc(machine->activecpu),data); } /* @@ -902,7 +902,7 @@ static WRITE8_HANDLER( sparkman_rombank_w ) { int bank = data & 0x0f; - if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",activecpu_get_pc(),data); + if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",cpu_get_pc(machine->activecpu),data); memory_set_bank(1, bank); suna8_rombank = data; diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c index 30a6d89163b..7bc9c2d0341 100644 --- a/src/mame/drivers/supbtime.c +++ b/src/mame/drivers/supbtime.c @@ -46,7 +46,7 @@ static READ16_HANDLER( supbtime_controls_r ) return 0; } - logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",activecpu_get_pc(),offset); + logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",cpu_get_pc(machine->activecpu),offset); return ~0; } diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c index 6715f7b0323..711baeb66b8 100644 --- a/src/mame/drivers/superchs.c +++ b/src/mame/drivers/superchs.c @@ -484,7 +484,7 @@ ROM_END static READ32_HANDLER( main_cycle_r ) { - if (activecpu_get_pc()==0x702) + if (cpu_get_pc(machine->activecpu)==0x702) cpu_spinuntil_int(); return superchs_ram[0]; @@ -492,7 +492,7 @@ static READ32_HANDLER( main_cycle_r ) static READ16_HANDLER( sub_cycle_r ) { - if (activecpu_get_pc()==0x454) + if (cpu_get_pc(machine->activecpu)==0x454) cpu_spinuntil_int(); return superchs_ram[2]&0xffff; diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c index 2892ed171a2..4babf6c621c 100644 --- a/src/mame/drivers/superqix.c +++ b/src/mame/drivers/superqix.c @@ -195,13 +195,13 @@ static int from_mcu_pending, from_z80_pending, invert_coin_lockout; static READ8_HANDLER( in4_mcu_r ) { -// logerror("%04x: in4_mcu_r\n",activecpu_get_pc()); +// logerror("%04x: in4_mcu_r\n",cpu_get_pc(machine->activecpu)); return input_port_read(machine, "P2") | (from_mcu_pending << 6) | (from_z80_pending << 7); } static READ8_HANDLER( sqix_from_mcu_r ) { -// logerror("%04x: read mcu answer (%02x)\n",activecpu_get_pc(),from_mcu); +// logerror("%04x: read mcu answer (%02x)\n",cpu_get_pc(machine->activecpu),from_mcu); return from_mcu; } @@ -220,7 +220,7 @@ static READ8_HANDLER( mcu_acknowledge_r ) static WRITE8_HANDLER( sqix_z80_mcu_w ) { -// logerror("%04x: sqix_z80_mcu_w %02x\n",activecpu_get_pc(),data); +// logerror("%04x: sqix_z80_mcu_w %02x\n",cpu_get_pc(machine->activecpu),data); portb = data; } @@ -256,7 +256,7 @@ static WRITE8_HANDLER( mcu_p1_w ) case 7: if ((data & 1) == 0) { -// logerror("%04x: MCU -> Z80 %02x\n",activecpu_get_pc(),port3); +// logerror("%04x: MCU -> Z80 %02x\n",cpu_get_pc(machine->activecpu),port3); from_mcu = port3_latch; from_mcu_pending = 1; from_z80_pending = 0; // ???? @@ -277,7 +277,7 @@ static READ8_HANDLER( mcu_p3_r ) } else if ((port1 & 0x40) == 0) { -// logerror("%04x: read Z80 command %02x\n",activecpu_get_pc(),from_z80); +// logerror("%04x: read Z80 command %02x\n",cpu_get_pc(machine->activecpu),from_z80); from_z80_pending = 0; return from_z80; } @@ -379,7 +379,7 @@ static UINT8 portA_in, portB_out, portC; static READ8_HANDLER( hotsmash_68705_portA_r ) { -//logerror("%04x: 68705 reads port A = %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 reads port A = %02x\n",cpu_get_pc(machine->activecpu),portA_in); return portA_in; } @@ -414,7 +414,7 @@ static WRITE8_HANDLER( hotsmash_68705_portC_w ) case 0x3: // command from Z80 portA_in = from_z80; -logerror("%04x: z80 reads command %02x\n",activecpu_get_pc(),from_z80); +logerror("%04x: z80 reads command %02x\n",cpu_get_pc(machine->activecpu),from_z80); break; case 0x4: @@ -442,14 +442,14 @@ static WRITE8_HANDLER( hotsmash_z80_mcu_w ) static READ8_HANDLER(hotsmash_from_mcu_r) { -logerror("%04x: z80 reads answer %02x\n",activecpu_get_pc(),from_mcu); +logerror("%04x: z80 reads answer %02x\n",cpu_get_pc(machine->activecpu),from_mcu); from_mcu_pending = 0; return from_mcu; } static READ8_HANDLER(hotsmash_ay_port_a_r) { -//logerror("%04x: ay_port_a_r and mcu_pending is %d\n",activecpu_get_pc(),from_mcu_pending); +//logerror("%04x: ay_port_a_r and mcu_pending is %d\n",cpu_get_pc(machine->activecpu),from_mcu_pending); return input_port_read(machine, "SYSTEM") | ((from_mcu_pending^1) << 7); } @@ -478,13 +478,13 @@ static READ8_HANDLER(pbillian_from_mcu_r) case 0x81: curr_player = 1; return 0; } - logerror("408[%x] r at %x\n",from_z80,activecpu_get_pc()); + logerror("408[%x] r at %x\n",from_z80,cpu_get_pc(machine->activecpu)); return 0; } static READ8_HANDLER(pbillian_ay_port_a_r) { -// logerror("%04x: ay_port_a_r\n",activecpu_get_pc()); +// logerror("%04x: ay_port_a_r\n",cpu_get_pc(machine->activecpu)); /* bits 76------ MCU status bits */ return (mame_rand(machine) & 0xc0) | input_port_read(machine, "BUTTONS"); } diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c index 68f8adbbaaf..d882f258bf2 100644 --- a/src/mame/drivers/suprgolf.c +++ b/src/mame/drivers/suprgolf.c @@ -44,14 +44,14 @@ static WRITE8_HANDLER( rom_bank_select_w ) suprgolf_rom_bank = data; - mame_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,activecpu_get_previouspc()); + mame_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,cpu_get_previouspc(machine->activecpu)); memory_set_bankptr(2, region_base + (data&0x3f ) * 0x4000); } static WRITE8_HANDLER( rom2_bank_select_w ) { UINT8 *region_base = memory_region(machine, "user2"); - mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,activecpu_get_previouspc()); + mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,cpu_get_previouspc(machine->activecpu)); memory_set_bankptr(1, region_base + (data&0x3f ) * 0x4000); } diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c index 2d7c26ed5f8..3584d3061d4 100644 --- a/src/mame/drivers/suprnova.c +++ b/src/mame/drivers/suprnova.c @@ -688,7 +688,7 @@ static WRITE32_HANDLER( skns_io_w ) cpunum_set_input_line(machine, 0,0xf,CLEAR_LINE);*/ /* idle skip for vblokbrk/sarukani, i can't find a better place to put it :-( but i think it works ok unless its making the game too fast */ - if (activecpu_get_pc()==0x04013B42) + if (cpu_get_pc(machine->activecpu)==0x04013B42) { if (!strcmp(machine->gamedrv->name,"vblokbrk") || !strcmp(machine->gamedrv->name,"sarukani")) @@ -904,7 +904,7 @@ MACHINE_DRIVER_END static READ32_HANDLER( bios_skip_r ) { #if BIOS_SKIP - if ((activecpu_get_pc()==0x6f8) || (activecpu_get_pc()==0x6fa)) program_write_byte(0x06000029,1); + if ((cpu_get_pc(machine->activecpu)==0x6f8) || (cpu_get_pc(machine->activecpu)==0x6fa)) program_write_byte(0x06000029,1); #endif return skns_main_ram[0x00028/4]; } @@ -921,7 +921,7 @@ static READ32_HANDLER( gutsn_speedup_r ) 04022072: CMP/EQ R2,R3 04022074: BT $0402206C */ - if (activecpu_get_pc()==0x402206e) + if (cpu_get_pc(machine->activecpu)==0x402206e) { if(skns_main_ram[0x00078/4] == skns_main_ram[0x0c780/4]) cpu_spinuntil_int(); @@ -931,19 +931,19 @@ static READ32_HANDLER( gutsn_speedup_r ) static READ32_HANDLER( cyvern_speedup_r ) { - if (activecpu_get_pc()==0x402ebd2) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x402ebd2) cpu_spinuntil_int(); return skns_main_ram[0x4d3c8/4]; } static READ32_HANDLER( puzloopj_speedup_r ) { - if (activecpu_get_pc()==0x401dca0) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x401dca0) cpu_spinuntil_int(); return skns_main_ram[0x86714/4]; } static READ32_HANDLER( puzloopu_speedup_r ) { - if (activecpu_get_pc()==0x401dab0) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x401dab0) cpu_spinuntil_int(); return skns_main_ram[0x85cec/4]; } @@ -956,97 +956,97 @@ static READ32_HANDLER( puzzloop_speedup_r ) 0401DA18: BF $0401DA26 0401DA26: BRA $0401DA12 */ - if (activecpu_get_pc()==0x401da14) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x401da14) cpu_spinuntil_int(); return skns_main_ram[0x81d38/4]; } static READ32_HANDLER( senknow_speedup_r ) { - if (activecpu_get_pc()==0x4017dce) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x4017dce) cpu_spinuntil_int(); return skns_main_ram[0x0000dc/4]; } static READ32_HANDLER( teljan_speedup_r ) { - if (activecpu_get_pc()==0x401ba32) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x401ba32) cpu_spinuntil_int(); return skns_main_ram[0x002fb4/4]; } static READ32_HANDLER( jjparads_speedup_r ) { - if (activecpu_get_pc()==0x4015e84) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x4015e84) cpu_spinuntil_int(); return skns_main_ram[0x000994/4]; } static READ32_HANDLER( jjparad2_speedup_r ) { - if (activecpu_get_pc()==0x401620a) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x401620a) cpu_spinuntil_int(); return skns_main_ram[0x000984/4]; } static READ32_HANDLER( ryouran_speedup_r ) { - if (activecpu_get_pc()==0x40182ce) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x40182ce) cpu_spinuntil_int(); return skns_main_ram[0x000a14/4]; } static READ32_HANDLER( galpans2_speedup_r ) { - if (activecpu_get_pc()==0x4049ae2) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x4049ae2) cpu_spinuntil_int(); return skns_main_ram[0x0fb6bc/4]; } static READ32_HANDLER( panicstr_speedup_r ) { - if (activecpu_get_pc()==0x404e68a) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x404e68a) cpu_spinuntil_int(); return skns_main_ram[0x0f19e4/4]; } static READ32_HANDLER( sengekis_speedup_r ) // 60006ee 600308e { - if (activecpu_get_pc()==0x60006ec) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x60006ec) cpu_spinuntil_int(); return skns_main_ram[0xb74bc/4]; } static READ32_HANDLER( sengekij_speedup_r ) // 60006ee 600308e { - if (activecpu_get_pc()==0x60006ec) cpu_spinuntil_int(); + if (cpu_get_pc(machine->activecpu)==0x60006ec) cpu_spinuntil_int(); return skns_main_ram[0xb7380/4]; } static void init_skns(running_machine *machine) { // init DRC to fastest options - cpunum_set_info_int(0, CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6f8); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x6f8); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000028, 0x600002b, 0, 0, bios_skip_r ); } -static void set_drc_pcflush(UINT32 addr) +static void set_drc_pcflush(running_machine *machine, UINT32 addr) { - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); - cpunum_set_info_int(0, CPUINFO_INT_SH2_PCFLUSH_ADDR, addr); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_SELECT, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, addr); } static DRIVER_INIT( galpani4 ) { skns_sprite_kludge(-5,-1); init_skns(machine); } static DRIVER_INIT( galpanis ) { skns_sprite_kludge(-5,-1); init_skns(machine); } -static DRIVER_INIT( cyvern ) { skns_sprite_kludge(+0,+2); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x604d3c8, 0x604d3cb, 0, 0, cyvern_speedup_r ); set_drc_pcflush(0x402ebd2); } -static DRIVER_INIT( galpans2 ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60fb6bc, 0x60fb6bf, 0, 0, galpans2_speedup_r ); set_drc_pcflush(0x4049ae2); } -static DRIVER_INIT( gutsn ) { skns_sprite_kludge(+0,+0); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600c780, 0x600c783, 0, 0, gutsn_speedup_r ); set_drc_pcflush(0x402206e); } -static DRIVER_INIT( panicstr ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60f19e4, 0x60f19e7, 0, 0, panicstr_speedup_r ); set_drc_pcflush(0x404e68a); } -static DRIVER_INIT( senknow ) { skns_sprite_kludge(+1,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60000dc, 0x60000df, 0, 0, senknow_speedup_r ); set_drc_pcflush(0x4017dce); } -static DRIVER_INIT( puzzloop ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6081d38, 0x6081d3b, 0, 0, puzzloop_speedup_r ); set_drc_pcflush(0x401da14); } -static DRIVER_INIT( puzloopj ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6086714, 0x6086717, 0, 0, puzloopj_speedup_r ); set_drc_pcflush(0x401dca0); } -static DRIVER_INIT( puzloopu ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6085cec, 0x6085cef, 0, 0, puzloopu_speedup_r ); set_drc_pcflush(0x401dab0); } -static DRIVER_INIT( jjparads ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000994, 0x6000997, 0, 0, jjparads_speedup_r ); set_drc_pcflush(0x4015e84); } -static DRIVER_INIT( jjparad2 ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000984, 0x6000987, 0, 0, jjparad2_speedup_r ); set_drc_pcflush(0x401620a); } -static DRIVER_INIT( ryouran ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000a14, 0x6000a17, 0, 0, ryouran_speedup_r ); set_drc_pcflush(0x40182ce); } -static DRIVER_INIT( teljan ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002fb4, 0x6002fb7, 0, 0, teljan_speedup_r ); set_drc_pcflush(0x401ba32); } -static DRIVER_INIT( sengekis ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b74bc, 0x60b74bf, 0, 0, sengekis_speedup_r ); set_drc_pcflush(0x60006ec); } -static DRIVER_INIT( sengekij ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b7380, 0x60b7383, 0, 0, sengekij_speedup_r ); set_drc_pcflush(0x60006ec); } -static DRIVER_INIT( sarukani ) { skns_sprite_kludge(-1,-1); init_skns(machine); set_drc_pcflush(0x4013b42); } // Speedup is in skns_io_w() +static DRIVER_INIT( cyvern ) { skns_sprite_kludge(+0,+2); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x604d3c8, 0x604d3cb, 0, 0, cyvern_speedup_r ); set_drc_pcflush(machine, 0x402ebd2); } +static DRIVER_INIT( galpans2 ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60fb6bc, 0x60fb6bf, 0, 0, galpans2_speedup_r ); set_drc_pcflush(machine, 0x4049ae2); } +static DRIVER_INIT( gutsn ) { skns_sprite_kludge(+0,+0); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x600c780, 0x600c783, 0, 0, gutsn_speedup_r ); set_drc_pcflush(machine, 0x402206e); } +static DRIVER_INIT( panicstr ) { skns_sprite_kludge(-1,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60f19e4, 0x60f19e7, 0, 0, panicstr_speedup_r ); set_drc_pcflush(machine, 0x404e68a); } +static DRIVER_INIT( senknow ) { skns_sprite_kludge(+1,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60000dc, 0x60000df, 0, 0, senknow_speedup_r ); set_drc_pcflush(machine, 0x4017dce); } +static DRIVER_INIT( puzzloop ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6081d38, 0x6081d3b, 0, 0, puzzloop_speedup_r ); set_drc_pcflush(machine, 0x401da14); } +static DRIVER_INIT( puzloopj ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6086714, 0x6086717, 0, 0, puzloopj_speedup_r ); set_drc_pcflush(machine, 0x401dca0); } +static DRIVER_INIT( puzloopu ) { skns_sprite_kludge(-9,-1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6085cec, 0x6085cef, 0, 0, puzloopu_speedup_r ); set_drc_pcflush(machine, 0x401dab0); } +static DRIVER_INIT( jjparads ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000994, 0x6000997, 0, 0, jjparads_speedup_r ); set_drc_pcflush(machine, 0x4015e84); } +static DRIVER_INIT( jjparad2 ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000984, 0x6000987, 0, 0, jjparad2_speedup_r ); set_drc_pcflush(machine, 0x401620a); } +static DRIVER_INIT( ryouran ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000a14, 0x6000a17, 0, 0, ryouran_speedup_r ); set_drc_pcflush(machine, 0x40182ce); } +static DRIVER_INIT( teljan ) { skns_sprite_kludge(+5,+1); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6002fb4, 0x6002fb7, 0, 0, teljan_speedup_r ); set_drc_pcflush(machine, 0x401ba32); } +static DRIVER_INIT( sengekis ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b74bc, 0x60b74bf, 0, 0, sengekis_speedup_r ); set_drc_pcflush(machine, 0x60006ec); } +static DRIVER_INIT( sengekij ) { skns_sprite_kludge(-192,-272); init_skns(machine); memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60b7380, 0x60b7383, 0, 0, sengekij_speedup_r ); set_drc_pcflush(machine, 0x60006ec); } +static DRIVER_INIT( sarukani ) { skns_sprite_kludge(-1,-1); init_skns(machine); set_drc_pcflush(machine, 0x4013b42); } // Speedup is in skns_io_w() diff --git a/src/mame/drivers/surpratk.c b/src/mame/drivers/surpratk.c index a4107b52a84..d4cb2f78dcf 100644 --- a/src/mame/drivers/surpratk.c +++ b/src/mame/drivers/surpratk.c @@ -61,7 +61,7 @@ static WRITE8_HANDLER( bankedram_w ) static WRITE8_HANDLER( surpratk_videobank_w ) { -logerror("%04x: videobank = %02x\n",activecpu_get_pc(),data); +logerror("%04x: videobank = %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 0 = select 053245 at 0000-07ff */ /* bit 1 = select palette at 0000-07ff */ /* bit 2 = select palette bank 0 or 1 */ @@ -70,7 +70,7 @@ logerror("%04x: videobank = %02x\n",activecpu_get_pc(),data); static WRITE8_HANDLER( surpratk_5fc0_w ) { - if ((data & 0xf4) != 0x10) logerror("%04x: 3fc0 = %02x\n",activecpu_get_pc(),data); + if ((data & 0xf4) != 0x10) logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 0/1 = coin counters */ coin_counter_w(0,data & 0x01); @@ -330,7 +330,7 @@ static void surpratk_banking(int lines) UINT8 *RAM = memory_region(Machine, "main"); int offs = 0; -logerror("%04x: setlines %02x\n",activecpu_get_pc(),lines); +logerror("%04x: setlines %02x\n",cpu_get_pc(Machine->activecpu),lines); offs = 0x10000 + ((lines & 0x1f) * 0x2000); if (offs >= 0x48000) offs -= 0x40000; @@ -339,7 +339,7 @@ logerror("%04x: setlines %02x\n",activecpu_get_pc(),lines); static MACHINE_RESET( surpratk ) { - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)surpratk_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)surpratk_banking); paletteram = &memory_region(machine, "main")[0x48000]; } diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c index f7a3899b97c..7ad5744b4c7 100644 --- a/src/mame/drivers/system1.c +++ b/src/mame/drivers/system1.c @@ -54,43 +54,43 @@ static int inport16_step,inport17_step,inport23_step; static READ8_HANDLER( inport16_r ) { -// logerror("IN $16 : pc = %04x - data = %02x\n",activecpu_get_pc(),inport16_step); +// logerror("IN $16 : pc = %04x - data = %02x\n",cpu_get_pc(machine->activecpu),inport16_step); return(inport16_step); } static READ8_HANDLER( inport1c_r ) { -// logerror("IN $1c : pc = %04x - data = 0x80\n",activecpu_get_pc()); +// logerror("IN $1c : pc = %04x - data = 0x80\n",cpu_get_pc(machine->activecpu)); return(0x80); // infinite loop (at 0x0fb3) until bit 7 is set } static READ8_HANDLER( inport22_r ) { -// logerror("IN $22 : pc = %04x - data = %02x\n",activecpu_get_pc(),inport17_step); +// logerror("IN $22 : pc = %04x - data = %02x\n",cpu_get_pc(machine->activecpu),inport17_step); return(inport17_step); } static READ8_HANDLER( inport23_r ) { -// logerror("IN $23 : pc = %04x - step = %02x\n",activecpu_get_pc(),inport23_step); +// logerror("IN $23 : pc = %04x - step = %02x\n",cpu_get_pc(machine->activecpu),inport23_step); return(inport23_step); } static WRITE8_HANDLER( outport16_w ) { -// logerror("OUT $16 : pc = %04x - data = %02x\n",activecpu_get_pc(),data); +// logerror("OUT $16 : pc = %04x - data = %02x\n",cpu_get_pc(machine->activecpu),data); inport16_step = data; } static WRITE8_HANDLER( outport17_w ) { -// logerror("OUT $17 : pc = %04x - data = %02x\n",activecpu_get_pc(),data); +// logerror("OUT $17 : pc = %04x - data = %02x\n",cpu_get_pc(machine->activecpu),data); inport17_step = data; } static WRITE8_HANDLER( outport24_w ) { -// logerror("OUT $24 : pc = %04x - data = %02x\n",activecpu_get_pc(),data); +// logerror("OUT $24 : pc = %04x - data = %02x\n",cpu_get_pc(machine->activecpu),data); inport23_step = data; } diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c index bd2cb69b852..cff323d5e73 100644 --- a/src/mame/drivers/system16.c +++ b/src/mame/drivers/system16.c @@ -299,7 +299,7 @@ static WRITE8_HANDLER( tturfbl_soundbank_w ) break; default: tturfbl_soundbank_ptr = NULL; - logerror("Invalid bank setting %02X (%04X)\n", data, activecpu_get_pc()); + logerror("Invalid bank setting %02X (%04X)\n", data, cpu_get_pc(machine->activecpu)); break; } } diff --git a/src/mame/drivers/system18.c b/src/mame/drivers/system18.c index 339b7427219..1033a4faea4 100644 --- a/src/mame/drivers/system18.c +++ b/src/mame/drivers/system18.c @@ -218,7 +218,7 @@ static WRITE8_HANDLER( shdancbl_bankctrl_w ) break; default: shdancbl_soundbank_ptr = NULL; - logerror("Invalid bank setting %02X (%04X)\n", data, activecpu_get_pc()); + logerror("Invalid bank setting %02X (%04X)\n", data, cpu_get_pc(machine->activecpu)); break; } } @@ -545,11 +545,11 @@ static READ16_HANDLER( sys18_io_r ) return -1; case 0x2000/2: /* Unused */ - logerror("read video control latch %06X (%06X)\n", offset, activecpu_get_pc()); + logerror("read video control latch %06X (%06X)\n", offset, cpu_get_pc(machine->activecpu)); return -1; case 0x3000/2: /* Expansion connector */ - logerror("read expansion area %06X (%06X)\n", offset, activecpu_get_pc()); + logerror("read expansion area %06X (%06X)\n", offset, cpu_get_pc(machine->activecpu)); return -1; } } @@ -617,11 +617,11 @@ static WRITE16_HANDLER( sys18_io_w ) break; case 0x2000/2: /* Video control latch */ - logerror("write video control latch %06X = %04X (%06X)\n", offset, data, activecpu_get_pc()); + logerror("write video control latch %06X = %04X (%06X)\n", offset, data, cpu_get_pc(machine->activecpu)); break; case 0x3000/2: /* Expansion connector */ -// logerror("write expansion area %06X = %04X (%06X)\n", offset, data, activecpu_get_pc()); +// logerror("write expansion area %06X = %04X (%06X)\n", offset, data, cpu_get_pc(machine->activecpu)); break; } } @@ -738,7 +738,7 @@ static MACHINE_RESET( shdancbl ) } static READ16_HANDLER( shdancbl_skip_r ){ - if (activecpu_get_pc()==0x2f76) {cpu_spinuntil_int(); return 0xffff;} + if (cpu_get_pc(machine->activecpu)==0x2f76) {cpu_spinuntil_int(); return 0xffff;} return sys16_workingram[0]; } @@ -771,7 +771,7 @@ static DRIVER_INIT( shdancbl ) /***************************************************************************/ static READ16_HANDLER( mwalkbl_skip_r ){ - if (activecpu_get_pc()==0x308a) {cpu_spinuntil_int(); return 0xffff;} + if (cpu_get_pc(machine->activecpu)==0x308a) {cpu_spinuntil_int(); return 0xffff;} return sys16_workingram[0x202c/2]; } diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c index 2db6afb41d6..4ba7acc3b7d 100644 --- a/src/mame/drivers/taito_f2.c +++ b/src/mame/drivers/taito_f2.c @@ -369,7 +369,7 @@ static READ16_HANDLER( growl_dsw_r ) return input_port_read(machine, "DSWB"); } - logerror("CPU #0 PC %06x: warning - read unmapped dsw_r offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped dsw_r offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -389,7 +389,7 @@ static READ16_HANDLER( growl_input_r ) } - logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -423,7 +423,7 @@ static READ16_HANDLER( footchmp_input_r ) return input_port_read(machine, "IN4"); } - logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -457,7 +457,7 @@ static READ16_HANDLER( ninjak_input_r ) // return (coin_word & mem_mask); } - logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -482,7 +482,7 @@ static READ16_HANDLER( cameltry_paddle_r ) return res; } - logerror("CPU #0 PC %06x: warning - read unmapped paddle offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped paddle offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0; } @@ -498,7 +498,7 @@ static READ16_HANDLER( driftout_paddle_r ) return input_port_read(machine, "PADDLE2"); } - logerror("CPU #0 PC %06x: warning - read unmapped paddle offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped paddle offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -526,7 +526,7 @@ static READ16_HANDLER( deadconx_input_r ) return input_port_read(machine, "IN1"); } - logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped input offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -546,7 +546,7 @@ static READ16_HANDLER( mjnquest_dsw_r ) } } - logerror("CPU #0 PC %06x: warning - read unmapped dsw_r offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped dsw_r offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -572,7 +572,7 @@ static READ16_HANDLER( mjnquest_input_r ) } - logerror("CPU #0 mjnquest_input %06x: warning - read unknown input %06x\n", activecpu_get_pc(), mjnquest_input); + logerror("CPU #0 mjnquest_input %06x: warning - read unknown input %06x\n", cpu_get_pc(machine->activecpu), mjnquest_input); return 0xff; } @@ -593,7 +593,7 @@ static READ16_HANDLER( quizhq_input1_r ) return input_port_read(machine, "IN0"); } - logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -612,7 +612,7 @@ static READ16_HANDLER( quizhq_input2_r ) return input_port_read(machine, "IN2"); } - logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -631,7 +631,7 @@ static READ16_HANDLER( yesnoj_input_r ) return input_port_read(machine, "IN2"); } #ifdef MAME_DEBUG - logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped input_r offset %06x\n", cpu_get_pc(machine->activecpu), offset); #endif return 0x0; diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c index 5d77e6ed0af..0f6b7c3bed2 100644 --- a/src/mame/drivers/taito_f3.c +++ b/src/mame/drivers/taito_f3.c @@ -77,7 +77,7 @@ static READ32_HANDLER( f3_control_r ) return (coin_word[1]<<16) | input_port_read(machine, "IN3"); } - logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xffffffff; } @@ -120,7 +120,7 @@ static WRITE32_HANDLER( f3_control_w ) } return; } - logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %08x\n",activecpu_get_pc(),offset,data); + logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %08x\n",cpu_get_pc(machine->activecpu),offset,data); } static WRITE32_HANDLER( f3_sound_reset_0_w ) @@ -3465,7 +3465,7 @@ static void tile_decode(running_machine *machine) #define F3_IRQ_SPEEDUP_1_R(GAME, counter, mem_addr, mask) \ static READ32_HANDLER( irq_speedup_r_##GAME ) \ { \ - if (activecpu_get_pc()==counter && (f3_ram[mem_addr]&mask)!=0) \ + if (cpu_get_pc(machine->activecpu)==counter && (f3_ram[mem_addr]&mask)!=0) \ cpu_spinuntil_int(); \ return f3_ram[mem_addr]; \ } @@ -3473,7 +3473,7 @@ static READ32_HANDLER( irq_speedup_r_##GAME ) \ #define F3_IRQ_SPEEDUP_2_R(GAME, counter, mem_addr, mask) \ static READ32_HANDLER( irq_speedup_r_##GAME ) \ { \ - if (activecpu_get_pc()==counter && (f3_ram[mem_addr]&mask)==0) \ + if (cpu_get_pc(machine->activecpu)==counter && (f3_ram[mem_addr]&mask)==0) \ cpu_spinuntil_int(); \ return f3_ram[mem_addr]; \ } @@ -3482,10 +3482,10 @@ static READ32_HANDLER( irq_speedup_r_##GAME ) \ static READ32_HANDLER( irq_speedup_r_##GAME ) \ { \ int ptr; \ - if ((activecpu_get_sp()&2)==0) ptr=f3_ram[(activecpu_get_sp()&0x1ffff)/4]; \ - else ptr=(((f3_ram[(activecpu_get_sp()&0x1ffff)/4])&0x1ffff)<<16) | \ - (f3_ram[((activecpu_get_sp()&0x1ffff)/4)+1]>>16); \ - if (activecpu_get_pc()==counter && ptr==stack) \ + if ((cpu_get_sp(machine->activecpu)&2)==0) ptr=f3_ram[(cpu_get_sp(machine->activecpu)&0x1ffff)/4]; \ + else ptr=(((f3_ram[(cpu_get_sp(machine->activecpu)&0x1ffff)/4])&0x1ffff)<<16) | \ + (f3_ram[((cpu_get_sp(machine->activecpu)&0x1ffff)/4)+1]>>16); \ + if (cpu_get_pc(machine->activecpu)==counter && ptr==stack) \ cpu_spinuntil_int(); \ return f3_ram[mem_addr]; \ } diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c index 6c41e644c3b..0ae89738348 100644 --- a/src/mame/drivers/taito_l.c +++ b/src/mame/drivers/taito_l.c @@ -143,7 +143,7 @@ static void palette_notifier(int addr) if(addr > 0x200) { -logerror("Large palette ? %03x (%04x)\n", addr, activecpu_get_pc()); +logerror("Large palette ? %03x (%04x)\n", addr, cpu_get_pc(Machine->activecpu)); } else { @@ -298,7 +298,7 @@ static INTERRUPT_GEN( vbl_interrupt ) cpunum_set_irq_callback(0, irq_callback); /* kludge to make plgirls boot */ - if (cpunum_get_reg(0,Z80_IM) != 2) return; + if (cpu_get_reg(machine->cpu[0],Z80_IM) != 2) return; // What is really generating interrupts 0 and 1 is still to be found @@ -356,7 +356,7 @@ static WRITE8_HANDLER( rombankswitch_w ) logerror("New rom size : %x\n", (high+1)*0x2000); } -// logerror("robs %d, %02x (%04x)\n", offset, data, activecpu_get_pc()); +// logerror("robs %d, %02x (%04x)\n", offset, data, cpu_get_pc(machine->activecpu)); cur_rombank = data; memory_set_bankptr(1, memory_region(machine, "main")+0x10000+0x2000*cur_rombank); } @@ -374,7 +374,7 @@ static WRITE8_HANDLER( rombank2switch_w ) logerror("New rom2 size : %x\n", (high2+1)*0x4000); } -// logerror("robs2 %02x (%04x)\n", data, activecpu_get_pc()); +// logerror("robs2 %02x (%04x)\n", data, cpu_get_pc(machine->activecpu)); cur_rombank2 = data; memory_set_bankptr(6, memory_region(machine, "slave")+0x10000+0x4000*cur_rombank2); @@ -396,7 +396,7 @@ static WRITE8_HANDLER( rambankswitch_w ) if(cur_rambank[offset]!=data) { cur_rambank[offset]=data; -//logerror("rabs %d, %02x (%04x)\n", offset, data, activecpu_get_pc()); +//logerror("rabs %d, %02x (%04x)\n", offset, data, cpu_get_pc(machine->activecpu)); if(data>=0x14 && data<=0x1f) { data -= 0x14; @@ -410,7 +410,7 @@ static WRITE8_HANDLER( rambankswitch_w ) } else { -logerror("unknown rambankswitch %d, %02x (%04x)\n", offset, data, activecpu_get_pc()); +logerror("unknown rambankswitch %d, %02x (%04x)\n", offset, data, cpu_get_pc(machine->activecpu)); current_notifier[offset] = 0; current_base[offset] = empty_ram; } @@ -500,8 +500,8 @@ static const UINT8 puzznic_mcu_reply[] = { 0x50, 0x1f, 0xb6, 0xba, 0x06, 0x03, 0 static WRITE8_HANDLER( mcu_data_w ) { last_data = data; - last_data_adr = activecpu_get_pc(); -// logerror("mcu write %02x (%04x)\n", data, activecpu_get_pc()); + last_data_adr = cpu_get_pc(machine->activecpu); +// logerror("mcu write %02x (%04x)\n", data, cpu_get_pc(machine->activecpu)); switch(data) { case 0x43: @@ -514,12 +514,12 @@ static WRITE8_HANDLER( mcu_data_w ) static WRITE8_HANDLER( mcu_control_w ) { -// logerror("mcu control %02x (%04x)\n", data, activecpu_get_pc()); +// logerror("mcu control %02x (%04x)\n", data, cpu_get_pc(machine->activecpu)); } static READ8_HANDLER( mcu_data_r ) { -// logerror("mcu read (%04x) [%02x, %04x]\n", activecpu_get_pc(), last_data, last_data_adr); +// logerror("mcu read (%04x) [%02x, %04x]\n", cpu_get_pc(machine->activecpu), last_data, last_data_adr); if(mcu_pos==mcu_reply_len) return 0; @@ -528,14 +528,14 @@ static READ8_HANDLER( mcu_data_r ) static READ8_HANDLER( mcu_control_r ) { -// logerror("mcu control read (%04x)\n", activecpu_get_pc()); +// logerror("mcu control read (%04x)\n", cpu_get_pc(machine->activecpu)); return 0x1; } #if 0 static WRITE8_HANDLER( sound_w ) { - logerror("Sound_w %02x (%04x)\n", data, activecpu_get_pc()); + logerror("Sound_w %02x (%04x)\n", data, cpu_get_pc(machine->activecpu)); } #endif @@ -564,7 +564,7 @@ static READ8_HANDLER( mux_r ) case 7: return input_port_read(machine, "IN2"); default: - logerror("Mux read from unknown port %d (%04x)\n", mux_ctrl, activecpu_get_pc()); + logerror("Mux read from unknown port %d (%04x)\n", mux_ctrl, cpu_get_pc(machine->activecpu)); return 0xff; } } @@ -577,7 +577,7 @@ static WRITE8_HANDLER( mux_w ) control2_w(machine,0, data); break; default: - logerror("Mux write to unknown port %d, %02x (%04x)\n", mux_ctrl, data, activecpu_get_pc()); + logerror("Mux write to unknown port %d, %02x (%04x)\n", mux_ctrl, data, cpu_get_pc(machine->activecpu)); } } @@ -2068,7 +2068,7 @@ static WRITE8_HANDLER( portA_w ) cur_bank = data & 0x03; bankaddress = 0x10000 + (cur_bank-1) * 0x4000; memory_set_bankptr(7,&RAM[bankaddress]); - //logerror ("YM2203 bank change val=%02x pc=%04x\n",cur_bank, activecpu_get_pc() ); + //logerror ("YM2203 bank change val=%02x pc=%04x\n",cur_bank, cpu_get_pc(machine->activecpu) ); } } diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c index 5a34262b44c..b1cf40cb231 100644 --- a/src/mame/drivers/taito_z.c +++ b/src/mame/drivers/taito_z.c @@ -940,7 +940,7 @@ static WRITE16_HANDLER( cpua_ctrl_w ) /* assumes Z80 sandwiched between 68Ks */ output_set_lamp_value(1, (data&0x40) ? 1 : 0); } - logerror("CPU #0 PC %06x: write %04x to cpu control\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(machine->activecpu),data); } static WRITE16_HANDLER( cpua_noz80_ctrl_w ) /* assumes no Z80 */ @@ -951,7 +951,7 @@ static WRITE16_HANDLER( cpua_noz80_ctrl_w ) /* assumes no Z80 */ parse_control_noz80(machine); - logerror("CPU #0 PC %06x: write %04x to cpu control\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(machine->activecpu),data); } @@ -1218,7 +1218,7 @@ static READ16_HANDLER( bshark_stick_r ) return input_port_read(machine, "Y_ADJUST"); } - logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -1241,7 +1241,7 @@ static READ16_HANDLER( nightstr_stick_r ) return input_port_read(machine, "Y_ADJUST"); } - logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped stick offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -1289,7 +1289,7 @@ static READ16_HANDLER( sci_steer_input_r ) return (steer & 0xff00) >> 8; } - logerror("CPU #0 PC %06x: warning - read unmapped steer input offset %06x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped steer input offset %06x\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } @@ -1372,7 +1372,7 @@ static READ16_HANDLER( dblaxle_steer_input_r ) return steer & 0xff; } - logerror("CPU #0 PC %06x: warning - read unmapped steer input offset %02x\n", activecpu_get_pc(), offset); + logerror("CPU #0 PC %06x: warning - read unmapped steer input offset %02x\n", cpu_get_pc(machine->activecpu), offset); return 0x00; } @@ -1389,7 +1389,7 @@ static READ16_HANDLER( chasehq_motor_r ) return 0x55; /* motor cpu status ? */ default: -logerror("CPU #0 PC %06x: warning - read motor cpu %03x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - read motor cpu %03x\n",cpu_get_pc(machine->activecpu),offset); return 0; } } @@ -1398,7 +1398,7 @@ static WRITE16_HANDLER( chasehq_motor_w ) { /* Writes $e00000-25 and $e00200-219 */ -logerror("CPU #0 PC %06x: warning - write %04x to motor cpu %03x\n",activecpu_get_pc(),data,offset); +logerror("CPU #0 PC %06x: warning - write %04x to motor cpu %03x\n",cpu_get_pc(machine->activecpu),data,offset); } diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c index 6c5c2a428fb..f98a3605194 100644 --- a/src/mame/drivers/taitoair.c +++ b/src/mame/drivers/taitoair.c @@ -248,7 +248,7 @@ static WRITE16_HANDLER( system_control_w ) cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE); - logerror("68K:%06x writing %04x to TMS32025. %s HOLD , %s RESET\n",activecpu_get_previouspc(),data,((data & 4) ? "Clear" : "Assert"),((data & 1) ? "Clear" : "Assert")); + logerror("68K:%06x writing %04x to TMS32025. %s HOLD , %s RESET\n",cpu_get_previouspc(machine->activecpu),data,((data & 4) ? "Clear" : "Assert"),((data & 1) ? "Clear" : "Assert")); } static READ16_HANDLER( lineram_r ) @@ -276,7 +276,7 @@ static WRITE16_HANDLER( dspram_w ) static READ16_HANDLER( dsp_HOLD_signal_r ) { /* HOLD signal is active low */ - // logerror("TMS32025:%04x Reading %01x level from HOLD signal\n",activecpu_get_previouspc(),dsp_HOLD_signal); + // logerror("TMS32025:%04x Reading %01x level from HOLD signal\n",cpu_get_previouspc(machine->activecpu),dsp_HOLD_signal); return dsp_HOLD_signal; } @@ -284,7 +284,7 @@ static READ16_HANDLER( dsp_HOLD_signal_r ) static WRITE16_HANDLER( dsp_HOLDA_signal_w ) { if (offset) - logerror("TMS32025:%04x Writing %01x level to HOLD-Acknowledge signal\n",activecpu_get_previouspc(),data); + logerror("TMS32025:%04x Writing %01x level to HOLD-Acknowledge signal\n",cpu_get_previouspc(machine->activecpu),data); } diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c index f8945e1e85f..2fcad460eff 100644 --- a/src/mame/drivers/taitojc.c +++ b/src/mame/drivers/taitojc.c @@ -413,7 +413,7 @@ static WRITE32_HANDLER( taitojc_palette_w ) static READ32_HANDLER ( jc_control_r ) { UINT32 r = 0; -// mame_printf_debug("jc_control_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); +// mame_printf_debug("jc_control_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); switch(offset) { case 0x0: @@ -523,7 +523,7 @@ static UINT8 mcu_comm_reg_r(int reg) } default: { - //mame_printf_debug("hc11_reg_r: %02X at %08X\n", reg, activecpu_get_pc()); + //mame_printf_debug("hc11_reg_r: %02X at %08X\n", reg, cpu_get_pc(machine->activecpu)); break; } } @@ -548,7 +548,7 @@ static void mcu_comm_reg_w(int reg, UINT8 data) } default: { - //mame_printf_debug("hc11_reg_w: %02X, %02X at %08X\n", reg, data, activecpu_get_pc()); + //mame_printf_debug("hc11_reg_w: %02X, %02X at %08X\n", reg, data, cpu_get_pc(machine->activecpu)); break; } } @@ -748,7 +748,7 @@ static void debug_dsp_command(void) static int first_dsp_reset; static WRITE32_HANDLER(dsp_shared_w) { - //mame_printf_debug("dsp_shared_ram: %08X, %04X at %08X\n", offset, data >> 16, activecpu_get_pc()); + //mame_printf_debug("dsp_shared_ram: %08X, %04X at %08X\n", offset, data >> 16, cpu_get_pc(machine->activecpu)); if (ACCESSING_BITS_24_31) { dsp_shared_ram[offset] &= 0x00ff; @@ -899,7 +899,7 @@ static READ16_HANDLER( dsp_rom_r ) { UINT16 *rom = (UINT16*)memory_region(machine, "gfx2"); UINT16 data = rom[dsp_rom_pos++]; - //mame_printf_debug("dsp_rom_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + //mame_printf_debug("dsp_rom_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); return data; } @@ -943,7 +943,7 @@ static READ16_HANDLER( dsp_texaddr_r ) static WRITE16_HANDLER( dsp_texaddr_w ) { dsp_tex_address = data; -// mame_printf_debug("texaddr = %08X at %08X\n", data, activecpu_get_pc()); +// mame_printf_debug("texaddr = %08X at %08X\n", data, cpu_get_pc(machine->activecpu)); texture_x = (((data >> 0) & 0x1f) << 1) | ((data >> 12) & 0x1); texture_y = (((data >> 5) & 0x1f) << 1) | ((data >> 13) & 0x1); diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c index 60d0e951fd2..b1ceb8d2b8a 100644 --- a/src/mame/drivers/taitowlf.c +++ b/src/mame/drivers/taitowlf.c @@ -130,7 +130,7 @@ static UINT8 mxtc_config_r(int function, int reg) static void mxtc_config_w(running_machine *machine, int function, int reg, UINT8 data) { -// mame_printf_debug("MXTC: write %d, %02X, %02X at %08X\n", function, reg, data, activecpu_get_pc()); +// mame_printf_debug("MXTC: write %d, %02X, %02X at %08X\n", function, reg, data, cpu_get_pc(machine->activecpu)); switch(reg) { @@ -214,7 +214,7 @@ static UINT8 piix4_config_r(int function, int reg) static void piix4_config_w(int function, int reg, UINT8 data) { -// mame_printf_debug("PIIX4: write %d, %02X, %02X at %08X\n", function, reg, data, activecpu_get_pc()); +// mame_printf_debug("PIIX4: write %d, %02X, %02X at %08X\n", function, reg, data, cpu_get_pc(machine->activecpu)); piix4_config_reg[function][reg] = data; } @@ -370,9 +370,9 @@ static DMA8237_MEM_READ( pc_dma_read_byte ) offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16) & 0xFF0000; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); result = program_read_byte(page_offset + offset); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } @@ -383,9 +383,9 @@ static DMA8237_MEM_WRITE( pc_dma_write_byte ) offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16) & 0xFF0000; - cpuintrf_push_context(0); + cpu_push_context(device->machine->cpu[0]); program_write_byte(page_offset + offset, data); - cpuintrf_pop_context(); + cpu_pop_context(); } diff --git a/src/mame/drivers/tecmosys.c b/src/mame/drivers/tecmosys.c index 7952670d3e8..f3a10991bbb 100644 --- a/src/mame/drivers/tecmosys.c +++ b/src/mame/drivers/tecmosys.c @@ -331,11 +331,11 @@ static WRITE16_HANDLER( unk880000_w ) case 0x22/2: watchdog_reset( machine ); - //logerror( "watchdog_w( %06x, %04x ) @ %06x\n", (offset * 2)+0x880000, data, activecpu_get_pc() ); + //logerror( "watchdog_w( %06x, %04x ) @ %06x\n", (offset * 2)+0x880000, data, cpu_get_pc(machine->activecpu) ); break; default: - logerror( "unk880000_w( %06x, %04x ) @ %06x\n", (offset * 2)+0x880000, data, activecpu_get_pc() ); + logerror( "unk880000_w( %06x, %04x ) @ %06x\n", (offset * 2)+0x880000, data, cpu_get_pc(machine->activecpu) ); break; } } @@ -344,7 +344,7 @@ static READ16_HANDLER( unk880000_r ) { //UINT16 ret = tecmosys_880000regs[offset]; - logerror( "unk880000_r( %06x ) @ %06x = %04x\n", (offset * 2 ) +0x880000, activecpu_get_pc(), tecmosys_880000regs[offset] ); + logerror( "unk880000_r( %06x ) @ %06x = %04x\n", (offset * 2 ) +0x880000, cpu_get_pc(machine->activecpu), tecmosys_880000regs[offset] ); /* this code allows scroll regs to be updated, but tkdensho at least resets perodically */ diff --git a/src/mame/drivers/tehkanwc.c b/src/mame/drivers/tehkanwc.c index e06df430cb1..99a116c19e1 100644 --- a/src/mame/drivers/tehkanwc.c +++ b/src/mame/drivers/tehkanwc.c @@ -179,7 +179,7 @@ static WRITE8_HANDLER( sound_answer_w ) /* in Gridiron, the sound CPU goes in a tight loop after the self test, */ /* probably waiting to be reset by a watchdog */ - if (activecpu_get_pc() == 0x08bc) timer_set(ATTOTIME_IN_SEC(1), NULL,0,reset_callback); + if (cpu_get_pc(machine->activecpu) == 0x08bc) timer_set(ATTOTIME_IN_SEC(1), NULL,0,reset_callback); } diff --git a/src/mame/drivers/tetrisp2.c b/src/mame/drivers/tetrisp2.c index f38556393c6..2bb2b2793fc 100644 --- a/src/mame/drivers/tetrisp2.c +++ b/src/mame/drivers/tetrisp2.c @@ -197,7 +197,7 @@ static WRITE16_HANDLER( nndmseal_sound_bank_w ) memcpy(memory_region(machine, "oki"), rom + (bank_lo * 0x80000), 0x20000); -// logerror("PC:%06X sound bank_lo = %02X\n",activecpu_get_pc(),bank_lo); +// logerror("PC:%06X sound bank_lo = %02X\n",cpu_get_pc(machine->activecpu),bank_lo); } else { @@ -205,7 +205,7 @@ static WRITE16_HANDLER( nndmseal_sound_bank_w ) memcpy(memory_region(machine, "oki") + 0x20000, rom + (bank_lo * 0x80000) + (bank_hi * 0x20000), 0x20000); -// logerror("PC:%06X sound bank_hi = %02X\n",activecpu_get_pc(),bank_hi); +// logerror("PC:%06X sound bank_hi = %02X\n",cpu_get_pc(machine->activecpu),bank_hi); } } } diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c index 1970305ceca..9c1022ef6b8 100644 --- a/src/mame/drivers/thedeep.c +++ b/src/mame/drivers/thedeep.c @@ -126,7 +126,7 @@ static WRITE8_HANDLER( thedeep_protection_w ) break; default: - logerror( "pc %04x: protection_command %02x\n", activecpu_get_pc(),protection_command); + logerror( "pc %04x: protection_command %02x\n", cpu_get_pc(machine->activecpu),protection_command); } } @@ -144,7 +144,7 @@ static READ8_HANDLER( thedeep_protection_r ) static WRITE8_HANDLER( thedeep_e100_w ) { if (data != 1) - logerror("pc %04x: e100 = %02x\n", activecpu_get_pc(),data); + logerror("pc %04x: e100 = %02x\n", cpu_get_pc(machine->activecpu),data); } static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) diff --git a/src/mame/drivers/thunderj.c b/src/mame/drivers/thunderj.c index 2c16d924d34..8183f14d77a 100644 --- a/src/mame/drivers/thunderj.c +++ b/src/mame/drivers/thunderj.c @@ -117,10 +117,10 @@ static READ16_HANDLER( shared_ram_r ) /* look for a byte access, and then check for the high bit and a TAS opcode */ if (mem_mask != 0xffff && (result & mem_mask & 0x8080)) { - offs_t ppc = activecpu_get_previouspc(); + offs_t ppc = cpu_get_previouspc(machine->activecpu); if (ppc < 0xa0000) { - int cpunum = cpu_getactivecpu(); + int cpunum = cpunum_get_active(); UINT16 opcode = rom_base[cpunum][ppc / 2]; /* look for TAS or BTST #$7; both CPUs spin waiting for these in order to */ diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c index 0bb84d2aeb4..2d290325568 100644 --- a/src/mame/drivers/thunderx.c +++ b/src/mame/drivers/thunderx.c @@ -67,12 +67,12 @@ static READ8_HANDLER( thunderx_bankedram_r ) { if (pmcbank) { -// logerror("%04x read pmcram %04x\n",activecpu_get_pc(),offset); +// logerror("%04x read pmcram %04x\n",cpu_get_pc(machine->activecpu),offset); return pmcram[offset]; } else { - logerror("%04x read pmc internal ram %04x\n",activecpu_get_pc(),offset); + logerror("%04x read pmc internal ram %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; } } @@ -89,11 +89,11 @@ static WRITE8_HANDLER( thunderx_bankedram_w ) // if (offset == 0x200) debug_signal_breakpoint(1); if (pmcbank) { - logerror("%04x pmcram %04x = %02x\n",activecpu_get_pc(),offset,data); + logerror("%04x pmcram %04x = %02x\n",cpu_get_pc(machine->activecpu),offset,data); pmcram[offset] = data; } else - logerror("%04x pmc internal ram %04x = %02x\n",activecpu_get_pc(),offset,data); + logerror("%04x pmc internal ram %04x = %02x\n",cpu_get_pc(machine->activecpu),offset,data); } else paletteram_xBBBBBGGGGGRRRRR_be_w(machine,offset,data); @@ -295,7 +295,7 @@ static READ8_HANDLER( thunderx_1f98_r ) static WRITE8_HANDLER( thunderx_1f98_w ) { -// logerror("%04x: 1f98_w %02x\n",activecpu_get_pc(),data); +// logerror("%04x: 1f98_w %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 0 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE); @@ -320,7 +320,7 @@ static WRITE8_HANDLER( scontra_bankswitch_w ) UINT8 *RAM = memory_region(machine, "main"); int offs; -//logerror("%04x: bank switch %02x\n",activecpu_get_pc(),data); +//logerror("%04x: bank switch %02x\n",cpu_get_pc(machine->activecpu),data); /* bits 0-3 ROM bank */ offs = 0x10000 + (data & 0x0f)*0x2000; @@ -339,7 +339,7 @@ static WRITE8_HANDLER( scontra_bankswitch_w ) static WRITE8_HANDLER( thunderx_videobank_w ) { -//logerror("%04x: select video ram bank %02x\n",activecpu_get_pc(),data); +//logerror("%04x: select video ram bank %02x\n",cpu_get_pc(machine->activecpu),data); /* 0x01 = work RAM at 4000-5fff */ /* 0x00 = palette at 5800-5fff */ /* 0x10 = unknown RAM at 5800-5fff */ @@ -1025,7 +1025,7 @@ static void thunderx_banking( int lines ) UINT8 *RAM = memory_region(Machine, "main"); int offs; -// logerror("thunderx %04x: bank select %02x\n", activecpu_get_pc(), lines ); +// logerror("thunderx %04x: bank select %02x\n", cpu_get_pc(machine->activecpu), lines ); offs = 0x10000 + (((lines & 0x0f) ^ 0x08) * 0x2000); if (offs >= 0x28000) offs -= 0x20000; @@ -1043,7 +1043,7 @@ static MACHINE_RESET( thunderx ) { UINT8 *RAM = memory_region(machine, "main"); - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)thunderx_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)thunderx_banking); memory_set_bankptr( 1, &RAM[0x10000] ); /* init the default bank */ paletteram = &RAM[0x28000]; diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c index 1f1303f930f..102fff549d9 100644 --- a/src/mame/drivers/tickee.c +++ b/src/mame/drivers/tickee.c @@ -197,7 +197,7 @@ static WRITE16_HANDLER( tickee_control_w ) } if (olddata != tickee_control[offset]) - logerror("%08X:tickee_control_w(%d) = %04X (was %04X)\n", activecpu_get_pc(), offset, tickee_control[offset], olddata); + logerror("%08X:tickee_control_w(%d) = %04X (was %04X)\n", cpu_get_pc(machine->activecpu), offset, tickee_control[offset], olddata); } diff --git a/src/mame/drivers/tigeroad.c b/src/mame/drivers/tigeroad.c index 28ef217761d..56f759dcbf1 100644 --- a/src/mame/drivers/tigeroad.c +++ b/src/mame/drivers/tigeroad.c @@ -90,7 +90,7 @@ static void f1dream_protection_w(running_machine *machine) { int indx; int value = 255; - int prevpc = activecpu_get_previouspc(); + int prevpc = cpu_get_previouspc(machine->activecpu); if (prevpc == 0x244c) { @@ -151,7 +151,7 @@ static void f1dream_protection_w(running_machine *machine) static WRITE16_HANDLER( f1dream_control_w ) { - logerror("protection write, PC: %04x FFE1 Value:%01x\n",activecpu_get_pc(), ram16[0x3fe0/2]); + logerror("protection write, PC: %04x FFE1 Value:%01x\n",cpu_get_pc(machine->activecpu), ram16[0x3fe0/2]); f1dream_protection_w(machine); } diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c index 7780087862d..9135fe056d5 100644 --- a/src/mame/drivers/tmaster.c +++ b/src/mame/drivers/tmaster.c @@ -308,7 +308,7 @@ static WRITE16_HANDLER( tmaster_color_w ) COMBINE_DATA( &tmaster_color ); #if 0 if (tmaster_color & ~7) - logerror("%06x: color %04x\n", activecpu_get_pc(), tmaster_color); + logerror("%06x: color %04x\n", cpu_get_pc(machine->activecpu), tmaster_color); #endif } @@ -345,7 +345,7 @@ static void tmaster_draw(running_machine *machine) addr <<= 1; #if 0 - logerror("%06x: blit w %03x, h %02x, x %03x, y %02x, addr %06x, mode %02x\n", activecpu_get_pc(), + logerror("%06x: blit w %03x, h %02x, x %03x, y %02x, addr %06x, mode %02x\n", cpu_get_pc(machine->activecpu), sw,sh,sx,sy, addr, mode ); #endif @@ -369,7 +369,7 @@ static void tmaster_draw(running_machine *machine) case 0x00: // blit with transparency if (addr > size - sw*sh) { - logerror("%06x: blit error, addr %06x out of bounds\n", activecpu_get_pc(),addr); + logerror("%06x: blit error, addr %06x out of bounds\n", cpu_get_pc(machine->activecpu),addr); addr = size - sw*sh; } @@ -486,7 +486,7 @@ static READ16_HANDLER( galgames_eeprom_r ) static WRITE16_HANDLER( galgames_eeprom_w ) { if (data & ~0x0003) - logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(machine->activecpu),data); if ( ACCESSING_BITS_0_7 ) { @@ -575,12 +575,12 @@ static WRITE16_HANDLER( galgames_cart_clock_w ) { memory_set_bank(1, 1); // ram memory_set_bank(3, 0); // rom - logerror("%06x: romram bank = %04x\n", activecpu_get_pc(), data); + logerror("%06x: romram bank = %04x\n", cpu_get_pc(machine->activecpu), data); } else { memory_set_bank(1, 0); // rom - logerror("%06x: unknown romram bank = %04x\n", activecpu_get_pc(), data); + logerror("%06x: unknown romram bank = %04x\n", cpu_get_pc(machine->activecpu), data); } } } diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c index c46c1ac0d25..c2b6555d007 100644 --- a/src/mame/drivers/tmnt.c +++ b/src/mame/drivers/tmnt.c @@ -385,8 +385,8 @@ static READ16_HANDLER( ssriders_protection_r ) return data; default: - popmessage("%06x: unknown protection read",activecpu_get_pc()); - logerror("%06x: read 1c0800 (D7=%02x 1058fc=%02x 105a0a=%02x)\n",activecpu_get_pc(),(UINT32)activecpu_get_reg(M68K_D7),cmd,data); + popmessage("%06x: unknown protection read",cpu_get_pc(machine->activecpu)); + logerror("%06x: read 1c0800 (D7=%02x 1058fc=%02x 105a0a=%02x)\n",cpu_get_pc(machine->activecpu),(UINT32)cpu_get_reg(machine->activecpu, M68K_D7),cmd,data); return 0xffff; } } diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c index 353ac110b0a..4c094608685 100644 --- a/src/mame/drivers/toaplan2.c +++ b/src/mame/drivers/toaplan2.c @@ -309,7 +309,7 @@ static MACHINE_RESET( toaplan2 ) This is important for games with common RAM; the RAM test will fail when leaving service mode if the sound CPU is not reset. */ - cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)toaplan2_reset); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)toaplan2_reset); } static MACHINE_RESET( ghox ) @@ -661,7 +661,7 @@ static WRITE16_HANDLER( toaplan2_hd647180_cpu_w ) else /* Teki Paki */ { mcu_data = data & 0xff; - logerror("PC:%08x Writing command (%04x) to secondary CPU shared port\n",activecpu_get_previouspc(),mcu_data); + logerror("PC:%08x Writing command (%04x) to secondary CPU shared port\n",cpu_get_previouspc(machine->activecpu),mcu_data); } } } @@ -734,7 +734,7 @@ static WRITE16_HANDLER( ghox_mcu_w ) } else { - logerror("PC:%08x Writing %08x to HD647180 cpu shared ram status port\n",activecpu_get_previouspc(),mcu_data); + logerror("PC:%08x Writing %08x to HD647180 cpu shared ram status port\n",cpu_get_previouspc(machine->activecpu),mcu_data); } toaplan2_shared_ram16[0x56 / 2] = 0x004e; /* Return a RTS instruction */ toaplan2_shared_ram16[0x58 / 2] = 0x0075; @@ -811,7 +811,7 @@ static WRITE16_HANDLER( shared_ram_w ) case 0xcf8: case 0xff8: toaplan2_shared_ram16[offset + 1] = data; /* Dogyuun */ toaplan2_shared_ram16[offset + 2] = data; /* FixEight */ - logerror("PC:%08x Writing (%04x) to shared RAM at %04x\n",activecpu_get_previouspc(),data,(offset*2)); + logerror("PC:%08x Writing (%04x) to shared RAM at %04x\n",cpu_get_previouspc(machine->activecpu),data,(offset*2)); if (data == 0x81) data = 0x0001; break; default: break; @@ -834,7 +834,7 @@ static READ16_HANDLER( toaplan2_snd_cpu_r ) mcu_data = 0xffff; } - logerror("PC:%06x reading status %08x from the NEC V25+ secondary CPU port\n",activecpu_get_previouspc(),response); + logerror("PC:%06x reading status %08x from the NEC V25+ secondary CPU port\n",cpu_get_previouspc(machine->activecpu),response); return response; } @@ -845,7 +845,7 @@ static WRITE16_HANDLER( dogyuun_snd_cpu_w ) mcu_data = data; dogyuun_okisnd_w(machine, data); } - logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",activecpu_get_previouspc(),mcu_data); + logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",cpu_get_previouspc(machine->activecpu),mcu_data); } static READ16_HANDLER( kbash_snd_cpu_r ) @@ -864,7 +864,7 @@ static WRITE16_HANDLER( kbash_snd_cpu_w ) { kbash_okisnd_w(machine, data); } - logerror("PC:%06x Writing Sound command (%04x) to the NEC V25+ secondary CPU\n",activecpu_get_previouspc(),data); + logerror("PC:%06x Writing Sound command (%04x) to the NEC V25+ secondary CPU\n",cpu_get_previouspc(machine->activecpu),data); } static READ16_HANDLER( fixeight_sec_cpu_r ) @@ -888,7 +888,7 @@ static READ16_HANDLER( fixeight_sec_cpu_r ) { response = mcu_data; /* Return the shared RAM data during POST */ } - logerror("PC:%06x reading status %08x from the NEC V25+ secondary CPU port\n",activecpu_get_previouspc(),response); + logerror("PC:%06x reading status %08x from the NEC V25+ secondary CPU port\n",cpu_get_previouspc(machine->activecpu),response); return response; } @@ -926,7 +926,7 @@ static WRITE16_HANDLER( fixeight_sec_cpu_w ) mcu_data = data; } } - logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",activecpu_get_previouspc(),mcu_data); + logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",cpu_get_previouspc(machine->activecpu),mcu_data); } static WRITE16_HANDLER( vfive_snd_cpu_w ) @@ -935,7 +935,7 @@ static WRITE16_HANDLER( vfive_snd_cpu_w ) { mcu_data = data; } - logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",activecpu_get_previouspc(),mcu_data); + logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",cpu_get_previouspc(machine->activecpu),mcu_data); } static WRITE16_HANDLER( batsugun_snd_cpu_w ) @@ -945,7 +945,7 @@ static WRITE16_HANDLER( batsugun_snd_cpu_w ) mcu_data = data; batsugun_okisnd_w(machine, data); } - logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port %02x\n",activecpu_get_previouspc(),mcu_data,(offset*2)); + logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port %02x\n",cpu_get_previouspc(machine->activecpu),mcu_data,(offset*2)); } static READ16_HANDLER( V25_sharedram_r ) @@ -1262,7 +1262,7 @@ static READ16_HANDLER( bbakraid_nvram_r ) static WRITE16_HANDLER( bbakraid_nvram_w ) { if (data & ~0x001f) - logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC:%06X - Unknown EEPROM data being written %04X\n",cpu_get_pc(machine->activecpu),data); if ( ACCESSING_BITS_0_7 ) { diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c index 1f248e67ded..cb90b967f4e 100644 --- a/src/mame/drivers/topspeed.c +++ b/src/mame/drivers/topspeed.c @@ -284,7 +284,7 @@ static WRITE16_HANDLER( cpua_ctrl_w ) parse_control(machine); - logerror("CPU #0 PC %06x: write %04x to cpu control\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(machine->activecpu),data); } @@ -385,7 +385,7 @@ static READ16_HANDLER( topspeed_motor_r ) return 0x55; /* motor cpu status ? */ default: -logerror("CPU #0 PC %06x: warning - read from motor cpu %03x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - read from motor cpu %03x\n",cpu_get_pc(machine->activecpu),offset); return 0; } } @@ -394,7 +394,7 @@ static WRITE16_HANDLER( topspeed_motor_w ) { /* Writes $900000-25 and $900200-219 */ -logerror("CPU #0 PC %06x: warning - write %04x to motor cpu %03x\n",activecpu_get_pc(),data,offset); +logerror("CPU #0 PC %06x: warning - write %04x to motor cpu %03x\n",cpu_get_pc(machine->activecpu),data,offset); } diff --git a/src/mame/drivers/toratora.c b/src/mame/drivers/toratora.c index c3da8164b49..3d901243074 100644 --- a/src/mame/drivers/toratora.c +++ b/src/mame/drivers/toratora.c @@ -37,7 +37,7 @@ static UINT8 clear_tv; static READ8_HANDLER( port_b_u3_r ) { - logerror("%04x: read DIP\n",activecpu_get_pc()); + logerror("%04x: read DIP\n",cpu_get_pc(machine->activecpu)); return input_port_read(machine, "DSW"); } diff --git a/src/mame/drivers/trvmadns.c b/src/mame/drivers/trvmadns.c index 4656cb15a52..552053d36ab 100644 --- a/src/mame/drivers/trvmadns.c +++ b/src/mame/drivers/trvmadns.c @@ -183,12 +183,12 @@ static WRITE8_HANDLER( trvmadns_tileram_w ) { if(offset==0) { - if(activecpu_get_previouspc()==0x29e9)// || activecpu_get_previouspc()==0x1b3f) //29f5 + if(cpu_get_previouspc(machine->activecpu)==0x29e9)// || cpu_get_previouspc(machine->activecpu)==0x1b3f) //29f5 { cpunum_set_input_line(machine, 0, 0, HOLD_LINE); } // else -// printf("%x \n", activecpu_get_previouspc()); +// printf("%x \n", cpu_get_previouspc(machine->activecpu)); } diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c index 164be536a9b..7ee99e30572 100644 --- a/src/mame/drivers/tumbleb.c +++ b/src/mame/drivers/tumbleb.c @@ -3328,9 +3328,9 @@ static DRIVER_INIT( fncywld ) static READ16_HANDLER( bcstory_1a0_read ) { - //mame_printf_debug("bcstory_io %06x\n",activecpu_get_pc()); + //mame_printf_debug("bcstory_io %06x\n",cpu_get_pc(machine->activecpu)); - if (activecpu_get_pc()==0x0560) return 0x1a0; + if (cpu_get_pc(machine->activecpu)==0x0560) return 0x1a0; else return input_port_read(machine, "SYSTEM"); } diff --git a/src/mame/drivers/tx1.c b/src/mame/drivers/tx1.c index ed552359e40..6829c3a7764 100644 --- a/src/mame/drivers/tx1.c +++ b/src/mame/drivers/tx1.c @@ -99,18 +99,18 @@ static READ16_HANDLER( z80_shared_r ) { UINT16 result = 0xffff; - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); result = program_read_byte(offset); - cpuintrf_pop_context(); + cpu_pop_context(); return result; } static WRITE16_HANDLER( z80_shared_w ) { - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); program_write_byte(offset, data & 0xff); - cpuintrf_pop_context(); + cpu_pop_context(); } diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c index f4b5299e187..1076b5b5477 100644 --- a/src/mame/drivers/ultrsprt.c +++ b/src/mame/drivers/ultrsprt.c @@ -81,20 +81,20 @@ static WRITE32_HANDLER( int_ack_w ) static MACHINE_START( ultrsprt ) { /* set conservative DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_END, 0x0007ffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_PPC_FASTRAM_BASE, vram); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_READONLY, 0); - - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_SELECT, 1); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_START, 0x7f000000); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_END, 0x7f01ffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_PPC_FASTRAM_BASE, workram); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_READONLY, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x0007ffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, vram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); + + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x7f000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x7f01ffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); } static ADDRESS_MAP_START( ultrsprt_map, ADDRESS_SPACE_PROGRAM, 32 ) diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c index 077de8b4d31..b9b95cd0225 100644 --- a/src/mame/drivers/undrfire.c +++ b/src/mame/drivers/undrfire.c @@ -426,7 +426,7 @@ static READ32_HANDLER( undrfire_lightgun_r ) } } -logerror("CPU #0 PC %06x: warning - read unmapped lightgun offset %06x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - read unmapped lightgun offset %06x\n",cpu_get_pc(machine->activecpu),offset); return 0x0; } diff --git a/src/mame/drivers/unico.c b/src/mame/drivers/unico.c index 931b8232b9c..e369d0c4a79 100644 --- a/src/mame/drivers/unico.c +++ b/src/mame/drivers/unico.c @@ -252,7 +252,7 @@ static WRITE32_HANDLER( zeropnt2_leds_w ) static WRITE32_HANDLER( zeropnt2_eeprom_w ) { if (data & ~0xfe00000) - logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",activecpu_get_pc(),data); + logerror("CPU #0 PC: %06X - Unknown EEPROM bit written %04X\n",cpu_get_pc(machine->activecpu),data); if ( ACCESSING_BITS_24_31 ) { diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c index 3aded9a13b2..38456b26589 100644 --- a/src/mame/drivers/vamphalf.c +++ b/src/mame/drivers/vamphalf.c @@ -1136,9 +1136,9 @@ ROM_START( dquizgo2 ) ROM_LOAD( "vrom1", 0x00000, 0x40000, CRC(24d5b55f) SHA1(cb4d3a22440831e37df0a7fe5433bea708d60f31) ) ROM_END -static int irq_active(void) +static int irq_active(running_machine *machine) { - UINT32 FCR = activecpu_get_reg(27); + UINT32 FCR = cpu_get_reg(machine->activecpu, 27); if( !(FCR&(1<<29)) ) // int 2 (irq 4) return 1; else @@ -1147,9 +1147,9 @@ static int irq_active(void) static READ16_HANDLER( vamphalf_speedup_r ) { - if(activecpu_get_pc() == 0x82de) + if(cpu_get_pc(machine->activecpu) == 0x82de) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1160,9 +1160,9 @@ static READ16_HANDLER( vamphalf_speedup_r ) static READ16_HANDLER( misncrft_speedup_r ) { - if(activecpu_get_pc() == 0xecc8) + if(cpu_get_pc(machine->activecpu) == 0xecc8) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1173,9 +1173,9 @@ static READ16_HANDLER( misncrft_speedup_r ) static READ16_HANDLER( coolmini_speedup_r ) { - if(activecpu_get_pc() == 0x75f7a) + if(cpu_get_pc(machine->activecpu) == 0x75f7a) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1186,9 +1186,9 @@ static READ16_HANDLER( coolmini_speedup_r ) static READ16_HANDLER( suplup_speedup_r ) { - if(activecpu_get_pc() == 0xaf18a ) + if(cpu_get_pc(machine->activecpu) == 0xaf18a ) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1199,9 +1199,9 @@ static READ16_HANDLER( suplup_speedup_r ) static READ16_HANDLER( luplup_speedup_r ) { - if(activecpu_get_pc() == 0xaefac ) + if(cpu_get_pc(machine->activecpu) == 0xaefac ) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1212,9 +1212,9 @@ static READ16_HANDLER( luplup_speedup_r ) static READ16_HANDLER( luplup29_speedup_r ) { - if(activecpu_get_pc() == 0xae6c0 ) + if(cpu_get_pc(machine->activecpu) == 0xae6c0 ) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1225,9 +1225,9 @@ static READ16_HANDLER( luplup29_speedup_r ) static READ16_HANDLER( puzlbang_speedup_r ) { - if(activecpu_get_pc() == 0xae6d2 ) + if(cpu_get_pc(machine->activecpu) == 0xae6d2 ) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1238,9 +1238,9 @@ static READ16_HANDLER( puzlbang_speedup_r ) static READ32_HANDLER( wyvernwg_speedup_r ) { - if(activecpu_get_pc() == 0x10758 ) + if(cpu_get_pc(machine->activecpu) == 0x10758 ) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1251,9 +1251,9 @@ static READ32_HANDLER( wyvernwg_speedup_r ) static READ32_HANDLER( finalgdr_speedup_r ) { - if(activecpu_get_pc() == 0x1c212 ) + if(cpu_get_pc(machine->activecpu) == 0x1c212 ) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); @@ -1264,9 +1264,9 @@ static READ32_HANDLER( finalgdr_speedup_r ) static READ16_HANDLER( dquizgo2_speedup_r ) { - if(activecpu_get_pc() == 0xaa622) + if(cpu_get_pc(machine->activecpu) == 0xaa622) { - if(irq_active()) + if(irq_active(machine)) cpu_spinuntil_int(); else activecpu_eat_cycles(50); diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c index 31fa6bfba5b..6cdad70f566 100644 --- a/src/mame/drivers/vball.c +++ b/src/mame/drivers/vball.c @@ -141,7 +141,7 @@ static WRITE8_HANDLER( vb_scrollx_hi_w ) vb_scrollx_hi = (data & 0x02) << 7; vb_bgprombank_w(machine, (data >> 2)&0x07); vb_spprombank_w(machine, (data >> 5)&0x07); - //logerror("%04x: vb_scrollx_hi = %d\n",activecpu_get_previouspc(), vb_scrollx_hi); + //logerror("%04x: vb_scrollx_hi = %d\n",cpu_get_previouspc(machine->activecpu), vb_scrollx_hi); } static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) @@ -173,7 +173,7 @@ ADDRESS_MAP_END static WRITE8_HANDLER(vb_scrollx_lo_w) { vb_scrollx_lo = data; - //logerror("%04x: vb_scrollx_lo =%d\n",activecpu_get_previouspc(), vb_scrollx_lo); + //logerror("%04x: vb_scrollx_lo =%d\n",cpu_get_previouspc(machine->activecpu), vb_scrollx_lo); } //Cheaters note: Scores are stored in ram @ 0x57-0x58 (though the space is used for other things between matches) diff --git a/src/mame/drivers/vegaeo.c b/src/mame/drivers/vegaeo.c index ba0400f0a65..4110c75355a 100644 --- a/src/mame/drivers/vegaeo.c +++ b/src/mame/drivers/vegaeo.c @@ -76,7 +76,7 @@ static WRITE32_HANDLER( vega_misc_w ) static READ32_HANDLER( vegaeo_custom_read ) { - eolith_speedup_read(); + eolith_speedup_read(machine); return input_port_read(machine, "SYSTEM"); } diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c index 5cbb796c2a6..b73a3f2a22d 100644 --- a/src/mame/drivers/vegas.c +++ b/src/mame/drivers/vegas.c @@ -545,20 +545,20 @@ static MACHINE_START( vegas ) dcs_idma_cs = 0; /* set the fastest DRC options, but strict verification */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, ramsize - 1); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); - - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, ramsize - 1); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rambase); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); + + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 1); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x1fc00000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x1fc7ffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rombase); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 1); /* register for save states */ state_save_register_global(nile_irq_state); @@ -627,7 +627,7 @@ static WRITE32_HANDLER( timekeeper_w ) cmos_unlocked = 0; } else - logerror("%08X:timekeeper_w(%04X,%08X & %08X) without CMOS unlocked\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%08X:timekeeper_w(%04X,%08X & %08X) without CMOS unlocked\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } @@ -710,7 +710,7 @@ static READ32_HANDLER( pci_bridge_r ) } if (LOG_PCI) - logerror("%06X:PCI bridge read: reg %d = %08X\n", activecpu_get_pc(), offset, result); + logerror("%06X:PCI bridge read: reg %d = %08X\n", cpu_get_pc(machine->activecpu), offset, result); return result; } @@ -719,7 +719,7 @@ static WRITE32_HANDLER( pci_bridge_w ) { pci_bridge_regs[offset] = data; if (LOG_PCI) - logerror("%06X:PCI bridge write: reg %d = %08X\n", activecpu_get_pc(), offset, data); + logerror("%06X:PCI bridge write: reg %d = %08X\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -748,7 +748,7 @@ static READ32_HANDLER( pci_ide_r ) } if (LOG_PCI) - logerror("%06X:PCI IDE read: reg %d = %08X\n", activecpu_get_pc(), offset, result); + logerror("%06X:PCI IDE read: reg %d = %08X\n", cpu_get_pc(machine->activecpu), offset, result); return result; } @@ -780,7 +780,7 @@ static WRITE32_HANDLER( pci_ide_w ) break; } if (LOG_PCI) - logerror("%06X:PCI IDE write: reg %d = %08X\n", activecpu_get_pc(), offset, data); + logerror("%06X:PCI IDE write: reg %d = %08X\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -819,7 +819,7 @@ static READ32_HANDLER( pci_3dfx_r ) } if (LOG_PCI) - logerror("%06X:PCI 3dfx read: reg %d = %08X\n", activecpu_get_pc(), offset, result); + logerror("%06X:PCI 3dfx read: reg %d = %08X\n", cpu_get_pc(machine->activecpu), offset, result); return result; } @@ -870,7 +870,7 @@ static WRITE32_HANDLER( pci_3dfx_w ) } if (LOG_PCI) - logerror("%06X:PCI 3dfx write: reg %d = %08X\n", activecpu_get_pc(), offset, data); + logerror("%06X:PCI 3dfx write: reg %d = %08X\n", cpu_get_pc(machine->activecpu), offset, data); } @@ -986,37 +986,37 @@ static READ32_HANDLER( nile_r ) { case NREG_CPUSTAT+0: /* CPU status */ case NREG_CPUSTAT+1: /* CPU status */ - if (LOG_NILE) logerror("%08X:NILE READ: CPU status(%03X) = %08X\n", activecpu_get_pc(), offset*4, result); + if (LOG_NILE) logerror("%08X:NILE READ: CPU status(%03X) = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); logit = 0; break; case NREG_INTCTRL+0: /* Interrupt control */ case NREG_INTCTRL+1: /* Interrupt control */ - if (LOG_NILE) logerror("%08X:NILE READ: interrupt control(%03X) = %08X\n", activecpu_get_pc(), offset*4, result); + if (LOG_NILE) logerror("%08X:NILE READ: interrupt control(%03X) = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); logit = 0; break; case NREG_INTSTAT0+0: /* Interrupt status 0 */ case NREG_INTSTAT0+1: /* Interrupt status 0 */ - if (LOG_NILE) logerror("%08X:NILE READ: interrupt status 0(%03X) = %08X\n", activecpu_get_pc(), offset*4, result); + if (LOG_NILE) logerror("%08X:NILE READ: interrupt status 0(%03X) = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); logit = 0; break; case NREG_INTSTAT1+0: /* Interrupt status 1 */ case NREG_INTSTAT1+1: /* Interrupt status 1 */ - if (LOG_NILE) logerror("%08X:NILE READ: interrupt status 1/enable(%03X) = %08X\n", activecpu_get_pc(), offset*4, result); + if (LOG_NILE) logerror("%08X:NILE READ: interrupt status 1/enable(%03X) = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); logit = 0; break; case NREG_INTCLR+0: /* Interrupt clear */ case NREG_INTCLR+1: /* Interrupt clear */ - if (LOG_NILE) logerror("%08X:NILE READ: interrupt clear(%03X) = %08X\n", activecpu_get_pc(), offset*4, result); + if (LOG_NILE) logerror("%08X:NILE READ: interrupt clear(%03X) = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); logit = 0; break; case NREG_INTPPES+0: /* PCI Interrupt control */ case NREG_INTPPES+1: /* PCI Interrupt control */ - if (LOG_NILE) logerror("%08X:NILE READ: PCI interrupt control(%03X) = %08X\n", activecpu_get_pc(), offset*4, result); + if (LOG_NILE) logerror("%08X:NILE READ: PCI interrupt control(%03X) = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); logit = 0; break; @@ -1043,7 +1043,7 @@ static READ32_HANDLER( nile_r ) result = nile_regs[offset + 1] = attotime_to_double(timer_timeleft(timer[which])) * (double)SYSTEM_CLOCK; } - if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", activecpu_get_pc(), which, offset*4, result); + if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", cpu_get_pc(machine->activecpu), which, offset*4, result); logit = 0; break; @@ -1084,7 +1084,7 @@ static READ32_HANDLER( nile_r ) } if (LOG_NILE && logit) - logerror("%06X:nile read from offset %03X = %08X\n", activecpu_get_pc(), offset*4, result); + logerror("%06X:nile read from offset %03X = %08X\n", cpu_get_pc(machine->activecpu), offset*4, result); return result; } @@ -1100,34 +1100,34 @@ static WRITE32_HANDLER( nile_w ) { case NREG_CPUSTAT+0: /* CPU status */ case NREG_CPUSTAT+1: /* CPU status */ - if (LOG_NILE) logerror("%08X:NILE WRITE: CPU status(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + if (LOG_NILE) logerror("%08X:NILE WRITE: CPU status(%03X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); logit = 0; break; case NREG_INTCTRL+0: /* Interrupt control */ case NREG_INTCTRL+1: /* Interrupt control */ - if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt control(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt control(%03X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); logit = 0; update_nile_irqs(machine); break; case NREG_INTSTAT0+0: /* Interrupt status 0 */ case NREG_INTSTAT0+1: /* Interrupt status 0 */ - if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 0(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 0(%03X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); logit = 0; update_nile_irqs(machine); break; case NREG_INTSTAT1+0: /* Interrupt status 1 */ case NREG_INTSTAT1+1: /* Interrupt status 1 */ - if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 1/enable(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt status 1/enable(%03X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); logit = 0; update_nile_irqs(machine); break; case NREG_INTCLR+0: /* Interrupt clear */ case NREG_INTCLR+1: /* Interrupt clear */ - if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); logit = 0; nile_irq_state &= ~(nile_regs[offset] & ~0xf00); update_nile_irqs(machine); @@ -1135,7 +1135,7 @@ static WRITE32_HANDLER( nile_w ) case NREG_INTPPES+0: /* PCI Interrupt control */ case NREG_INTPPES+1: /* PCI Interrupt control */ - if (LOG_NILE) logerror("%08X:NILE WRITE: PCI interrupt control(%03X) = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + if (LOG_NILE) logerror("%08X:NILE WRITE: PCI interrupt control(%03X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); logit = 0; break; @@ -1160,7 +1160,7 @@ static WRITE32_HANDLER( nile_w ) case NREG_T2CTRL+1: /* general purpose timer control (control bits) */ case NREG_T3CTRL+1: /* watchdog timer control (control bits) */ which = (offset - NREG_T0CTRL) / 4; - if (LOG_NILE) logerror("%08X:NILE WRITE: timer %d control(%03X) = %08X & %08X\n", activecpu_get_pc(), which, offset*4, data, mem_mask); + if (LOG_NILE) logerror("%08X:NILE WRITE: timer %d control(%03X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), which, offset*4, data, mem_mask); logit = 0; /* timer just enabled? */ @@ -1189,7 +1189,7 @@ static WRITE32_HANDLER( nile_w ) case NREG_T2CNTR: /* general purpose timer control (counter) */ case NREG_T3CNTR: /* watchdog timer control (counter) */ which = (offset - NREG_T0CTRL) / 4; - if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", activecpu_get_pc(), which, offset*4, data, mem_mask); + if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), which, offset*4, data, mem_mask); logit = 0; if (nile_regs[offset - 1] & 1) @@ -1244,7 +1244,7 @@ static WRITE32_HANDLER( nile_w ) } if (LOG_NILE && logit) - logerror("%06X:nile write to offset %03X = %08X & %08X\n", activecpu_get_pc(), offset*4, data, mem_mask); + logerror("%06X:nile write to offset %03X = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); } @@ -1293,10 +1293,10 @@ static void vblank_assert(running_machine *machine, int state) vblank_state = state; /* if we have stalled DMA, restart */ -// if (dma_pending_on_vblank[0]) { cpuintrf_push_context(0); perform_dma(0); cpuintrf_pop_context(); } -// if (dma_pending_on_vblank[1]) { cpuintrf_push_context(0); perform_dma(1); cpuintrf_pop_context(); } -// if (dma_pending_on_vblank[2]) { cpuintrf_push_context(0); perform_dma(2); cpuintrf_pop_context(); } -// if (dma_pending_on_vblank[3]) { cpuintrf_push_context(0); perform_dma(3); cpuintrf_pop_context(); } +// if (dma_pending_on_vblank[0]) { cpu_push_context(machine->cpu[0]); perform_dma(0); cpu_pop_context(); } +// if (dma_pending_on_vblank[1]) { cpu_push_context(machine->cpu[0]); perform_dma(1); cpu_pop_context(); } +// if (dma_pending_on_vblank[2]) { cpu_push_context(machine->cpu[0]); perform_dma(2); cpu_pop_context(); } +// if (dma_pending_on_vblank[3]) { cpu_push_context(machine->cpu[0]); perform_dma(3); cpu_pop_context(); } } @@ -1404,7 +1404,7 @@ static WRITE32_HANDLER( sio_w ) if (ACCESSING_BITS_16_23) offset += 2; if (ACCESSING_BITS_24_31) offset += 3; if (LOG_SIO && offset != 0) - logerror("%08X:sio write to offset %X = %02X\n", activecpu_get_pc(), offset, data >> (offset*8)); + logerror("%08X:sio write to offset %X = %02X\n", cpu_get_pc(machine->activecpu), offset, data >> (offset*8)); if (offset < 4) sio_data[offset] = data >> (offset*8); if (offset == 1) @@ -1422,7 +1422,7 @@ static READ32_HANDLER( sio_r ) if (offset < 4) result = sio_data[0] | (sio_data[1] << 8) | (sio_data[2] << 16) | (sio_data[3] << 24); if (LOG_SIO && offset != 2) - logerror("%08X:sio read from offset %X = %02X\n", activecpu_get_pc(), offset, result >> (offset*8)); + logerror("%08X:sio read from offset %X = %02X\n", cpu_get_pc(machine->activecpu), offset, result >> (offset*8)); return result; } @@ -1445,7 +1445,7 @@ static WRITE32_HANDLER( analog_port_w ) static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" }; if (data < 8 || data > 15) - logerror("%08X:Unexpected analog port select = %08X\n", activecpu_get_pc(), data); + logerror("%08X:Unexpected analog port select = %08X\n", cpu_get_pc(machine->activecpu), data); pending_analog_read = input_port_read_safe(machine, portnames[data & 7], 0); } @@ -2481,12 +2481,12 @@ static void init_common(running_machine *machine, int ioasic, int serialnum) speedup_index = 0; } -static void add_speedup(offs_t pc, UINT32 op) +static void add_speedup(running_machine *machine, offs_t pc, UINT32 op) { - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_HOTSPOT_SELECT, speedup_index++); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_HOTSPOT_PC, pc); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_HOTSPOT_OPCODE, op); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_HOTSPOT_CYCLES, 250); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_SELECT, speedup_index++); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_PC, pc); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_OPCODE, op); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_HOTSPOT_CYCLES, 250); } @@ -2496,10 +2496,10 @@ static DRIVER_INIT( gauntleg ) init_common(machine, MIDWAY_IOASIC_CALSPEED, 340/* 340=39", 322=27", others? */); /* speedups */ - add_speedup(0x80015430, 0x8CC38060); /* confirmed */ - add_speedup(0x80015464, 0x3C09801E); /* confirmed */ - add_speedup(0x800C8918, 0x8FA2004C); /* confirmed */ - add_speedup(0x800C8890, 0x8FA20024); /* confirmed */ + add_speedup(machine, 0x80015430, 0x8CC38060); /* confirmed */ + add_speedup(machine, 0x80015464, 0x3C09801E); /* confirmed */ + add_speedup(machine, 0x800C8918, 0x8FA2004C); /* confirmed */ + add_speedup(machine, 0x800C8890, 0x8FA20024); /* confirmed */ } @@ -2509,10 +2509,10 @@ static DRIVER_INIT( gauntdl ) init_common(machine, MIDWAY_IOASIC_GAUNTDL, 346/* 347, others? */); /* speedups */ - add_speedup(0x800158B8, 0x8CC3CC40); /* confirmed */ - add_speedup(0x800158EC, 0x3C0C8022); /* confirmed */ - add_speedup(0x800D40C0, 0x8FA2004C); /* confirmed */ - add_speedup(0x800D4038, 0x8FA20024); /* confirmed */ + add_speedup(machine, 0x800158B8, 0x8CC3CC40); /* confirmed */ + add_speedup(machine, 0x800158EC, 0x3C0C8022); /* confirmed */ + add_speedup(machine, 0x800D40C0, 0x8FA2004C); /* confirmed */ + add_speedup(machine, 0x800D4038, 0x8FA20024); /* confirmed */ } @@ -2522,7 +2522,7 @@ static DRIVER_INIT( warfa ) init_common(machine, MIDWAY_IOASIC_MACE, 337/* others? */); /* speedups */ - add_speedup(0x8009436C, 0x0C031663); /* confirmed */ + add_speedup(machine, 0x8009436C, 0x0C031663); /* confirmed */ } @@ -2532,10 +2532,10 @@ static DRIVER_INIT( tenthdeg ) init_common(machine, MIDWAY_IOASIC_GAUNTDL, 330/* others? */); /* speedups */ - add_speedup(0x80051CD8, 0x0C023C15); /* confirmed */ - add_speedup(0x8005E674, 0x3C028017); /* confirmed */ - add_speedup(0x8002DBCC, 0x8FA2002C); /* confirmed */ - add_speedup(0x80015930, 0x8FC20244); /* confirmed */ + add_speedup(machine, 0x80051CD8, 0x0C023C15); /* confirmed */ + add_speedup(machine, 0x8005E674, 0x3C028017); /* confirmed */ + add_speedup(machine, 0x8002DBCC, 0x8FA2002C); /* confirmed */ + add_speedup(machine, 0x80015930, 0x8FC20244); /* confirmed */ } diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c index 9471cd2cab1..4d46cfbe067 100644 --- a/src/mame/drivers/vendetta.c +++ b/src/mame/drivers/vendetta.c @@ -776,7 +776,7 @@ static void vendetta_banking( int lines ) if ( lines >= 0x1c ) { - logerror("PC = %04x : Unknown bank selected %02x\n", activecpu_get_pc(), lines ); + logerror("PC = %04x : Unknown bank selected %02x\n", cpu_get_pc(Machine->activecpu), lines ); } else memory_set_bankptr( 1, &RAM[ 0x10000 + ( lines * 0x2000 ) ] ); @@ -784,7 +784,7 @@ static void vendetta_banking( int lines ) static MACHINE_RESET( vendetta ) { - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)vendetta_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)vendetta_banking); paletteram = &memory_region(machine, "main")[0x48000]; irq_enabled = 0; diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c index 4d823924315..4133a9e0b0a 100644 --- a/src/mame/drivers/viper.c +++ b/src/mame/drivers/viper.c @@ -28,6 +28,7 @@ */ #include "driver.h" +#include "deprecat.h" #include "cpu/powerpc/ppc.h" #include "machine/pci.h" #include "memconv.h" @@ -95,7 +96,7 @@ static READ32_HANDLER( epic_r ) int reg; reg = offset * 4; - //printf("EPIC: read %08X, %08X at %08X\n", reg, mem_mask, activecpu_get_pc()); + //printf("EPIC: read %08X, %08X at %08X\n", reg, mem_mask, cpu_get_pc(machine->activecpu)); switch (reg >> 16) { @@ -120,7 +121,7 @@ static WRITE32_HANDLER( epic_w ) int reg; reg = offset * 4; - //printf("EPIC: write %08X, %08X, %08X at %08X\n", data, reg, mem_mask, activecpu_get_pc()); + //printf("EPIC: write %08X, %08X, %08X at %08X\n", data, reg, mem_mask, cpu_get_pc(machine->activecpu)); switch (reg >> 16) { @@ -179,7 +180,7 @@ static READ64_DEVICE_HANDLER(cf_card_data_r) default: { - fatalerror("cf_card_data_r: IDE reg %02X at %08X\n", offset & 0xf, activecpu_get_pc()); + fatalerror("cf_card_data_r: IDE reg %02X at %08X\n", offset & 0xf, cpu_get_pc(device->machine->activecpu)); } } } @@ -200,7 +201,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_data_w) default: { - fatalerror("cf_card_data_w: IDE reg %02X, %04X at %08X\n", offset & 0xf, (UINT16)(data >> 16), activecpu_get_pc()); + fatalerror("cf_card_data_w: IDE reg %02X, %04X at %08X\n", offset & 0xf, (UINT16)(data >> 16), cpu_get_pc(device->machine->activecpu)); } } } @@ -246,7 +247,7 @@ static READ64_DEVICE_HANDLER(cf_card_r) default: { - printf("compact_flash_r: IDE reg %02X at %08X\n", offset & 0xf, activecpu_get_pc()); + printf("compact_flash_r: IDE reg %02X at %08X\n", offset & 0xf, cpu_get_pc(device->machine->activecpu)); } } } @@ -262,7 +263,7 @@ static READ64_DEVICE_HANDLER(cf_card_r) } else { - fatalerror("compact_flash_r: reg %02X at %08X\n", reg, activecpu_get_pc()); + fatalerror("compact_flash_r: reg %02X at %08X\n", reg, cpu_get_pc(device->machine->activecpu)); } } } @@ -271,7 +272,7 @@ static READ64_DEVICE_HANDLER(cf_card_r) static WRITE64_DEVICE_HANDLER(cf_card_w) { - //printf("compact_flash_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask), activecpu_get_pc()); + //printf("compact_flash_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data>>32), (UINT32)(data), offset, (UINT32)(mem_mask >> 32), (UINT32)(mem_mask), cpu_get_pc(machine->activecpu)); if (ACCESSING_BITS_16_31) { @@ -309,7 +310,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_w) default: { - fatalerror("compact_flash_w: IDE reg %02X, data %04X at %08X\n", offset & 0xf, (UINT16)((data >> 16) & 0xffff), activecpu_get_pc()); + fatalerror("compact_flash_w: IDE reg %02X, data %04X at %08X\n", offset & 0xf, (UINT16)((data >> 16) & 0xffff), cpu_get_pc(device->machine->activecpu)); } } } @@ -335,7 +336,7 @@ static WRITE64_DEVICE_HANDLER(cf_card_w) } default: { - fatalerror("compact_flash_w: reg %02X, data %04X at %08X\n", offset, (UINT16)((data >> 16) & 0xffff), activecpu_get_pc()); + fatalerror("compact_flash_w: reg %02X, data %04X at %08X\n", offset, (UINT16)((data >> 16) & 0xffff), cpu_get_pc(device->machine->activecpu)); } } } @@ -442,7 +443,7 @@ static UINT32 voodoo3_pci_r(int function, int reg, UINT32 mem_mask) } default: - fatalerror("voodoo3_pci_r: %08X at %08X", reg, activecpu_get_pc()); + fatalerror("voodoo3_pci_r: %08X at %08X", reg, cpu_get_pc(Machine->activecpu)); } return 0; } @@ -510,7 +511,7 @@ static void voodoo3_pci_w(int function, int reg, UINT32 data, UINT32 mem_mask) } default: - fatalerror("voodoo3_pci_w: %08X, %08X at %08X", data, reg, activecpu_get_pc()); + fatalerror("voodoo3_pci_w: %08X, %08X at %08X", data, reg, cpu_get_pc(Machine->activecpu)); } } @@ -521,7 +522,7 @@ static READ64_HANDLER(voodoo3_io_r) } static WRITE64_HANDLER(voodoo3_io_w) { -// printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, activecpu_get_pc()); +// printf("voodoo3_io_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(machine->activecpu)); write64be_with_32le_handler(banshee_io_0_w, machine, offset, data, mem_mask); } @@ -531,7 +532,7 @@ static READ64_HANDLER(voodoo3_r) } static WRITE64_HANDLER(voodoo3_w) { -// printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, activecpu_get_pc()); +// printf("voodoo3_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(machine->activecpu)); write64be_with_32le_handler(banshee_0_w, machine, offset, data, mem_mask); } @@ -541,7 +542,7 @@ static READ64_HANDLER(voodoo3_lfb_r) } static WRITE64_HANDLER(voodoo3_lfb_w) { -// printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, activecpu_get_pc()); +// printf("voodoo3_lfb_w: %08X%08X, %08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data), offset, cpu_get_pc(machine->activecpu)); write64be_with_32le_handler(banshee_fb_0_w, machine, offset, data, mem_mask); } #endif diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c index 1591c497162..a41d271d680 100644 --- a/src/mame/drivers/vmetal.c +++ b/src/mame/drivers/vmetal.c @@ -172,7 +172,7 @@ static WRITE16_HANDLER( vmetal_control_w ) es8712_set_bank_base(0, 0x000000); if (data & 0xa0) - logerror("PC:%06x - Writing unknown bits %04x to $200000\n",activecpu_get_previouspc(),data); + logerror("PC:%06x - Writing unknown bits %04x to $200000\n",cpu_get_previouspc(machine->activecpu),data); } static WRITE16_HANDLER( vmetal_es8712_w ) @@ -208,7 +208,7 @@ static WRITE16_HANDLER( vmetal_es8712_w ) */ es8712_data_0_lsb_w(machine, offset, data, mem_mask); - logerror("PC:%06x - Writing %04x to ES8712 offset %02x\n",activecpu_get_previouspc(),data,offset); + logerror("PC:%06x - Writing %04x to ES8712 offset %02x\n",cpu_get_previouspc(machine->activecpu),data,offset); } diff --git a/src/mame/drivers/vsnes.c b/src/mame/drivers/vsnes.c index b75bc01d3cb..c50a9bf3066 100644 --- a/src/mame/drivers/vsnes.c +++ b/src/mame/drivers/vsnes.c @@ -166,7 +166,7 @@ static WRITE8_HANDLER( vsnes_coin_counter_w ) coin = data; if( data & 0xfe ) //"bnglngby" and "cluclu" { - logerror("vsnes_coin_counter_w: pc = 0x%04x - data = 0x%02x\n", activecpu_get_pc(), data); + logerror("vsnes_coin_counter_w: pc = 0x%04x - data = 0x%02x\n", cpu_get_pc(machine->activecpu), data); } } @@ -182,7 +182,7 @@ static WRITE8_HANDLER( vsnes_coin_counter_1_w ) if( data & 0xfe ) //vsbball service mode { //do something? - logerror("vsnes_coin_counter_1_w: pc = 0x%04x - data = 0x%02x\n", activecpu_get_pc(), data); + logerror("vsnes_coin_counter_1_w: pc = 0x%04x - data = 0x%02x\n", cpu_get_pc(machine->activecpu), data); } } diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c index c987b0c49e7..3733419cd65 100644 --- a/src/mame/drivers/wecleman.c +++ b/src/mame/drivers/wecleman.c @@ -368,7 +368,7 @@ static WRITE16_HANDLER( irqctrl_w ) { if (ACCESSING_BITS_0_7) { - // logerror("CPU #0 - PC = %06X - $140005 <- %02X (old value: %02X)\n",activecpu_get_pc(), data&0xFF, old_data&0xFF); + // logerror("CPU #0 - PC = %06X - $140005 <- %02X (old value: %02X)\n",cpu_get_pc(machine->activecpu), data&0xFF, old_data&0xFF); // Bit 0 : SUBINT if ( (wecleman_irqctrl & 1) && (!(data & 1)) ) // 1->0 transition diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c index dc45f026bad..dddb317fa89 100644 --- a/src/mame/drivers/wgp.c +++ b/src/mame/drivers/wgp.c @@ -450,7 +450,7 @@ static WRITE16_HANDLER( cpua_ctrl_w ) /* assumes Z80 sandwiched between 68Ks */ parse_control(machine); - logerror("CPU #0 PC %06x: write %04x to cpu control\n",activecpu_get_pc(),data); + logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(machine->activecpu),data); } @@ -499,7 +499,7 @@ static INTERRUPT_GEN( wgp_cpub_interrupt ) static READ16_HANDLER( lan_status_r ) { - logerror("CPU #2 PC %06x: warning - read lan status\n",activecpu_get_pc()); + logerror("CPU #2 PC %06x: warning - read lan status\n",cpu_get_pc(machine->activecpu)); return (0x4 << 8); /* CPUB expects this in code at $104d0 (Wgp) */ } @@ -526,7 +526,7 @@ static WRITE16_HANDLER( rotate_port_w ) { case 0x00: { -//logerror("CPU #0 PC %06x: warning - port %04x write %04x\n",activecpu_get_pc(),port_sel,data); +//logerror("CPU #0 PC %06x: warning - port %04x write %04x\n",cpu_get_pc(machine->activecpu),port_sel,data); wgp_rotate_ctrl[port_sel] = data; return; @@ -600,7 +600,7 @@ static READ16_HANDLER( wgp_adinput_r ) return input_port_read_safe(machine, UNKNOWN_PORT_TAG, 0x00); /* unknown */ } -logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c index b05c6365d20..5ae136390d9 100644 --- a/src/mame/drivers/witch.c +++ b/src/mame/drivers/witch.c @@ -365,7 +365,7 @@ static WRITE8_HANDLER(write_a00x) break; case 0x08: //A008 - cpunum_set_input_line(machine, cpu_getactivecpu(),0,CLEAR_LINE); + cpunum_set_input_line(machine, cpunum_get_active(),0,CLEAR_LINE); break; } } @@ -382,7 +382,7 @@ static READ8_HANDLER(prot_read_700x) Otherwise later in game some I/O (controls) reads are skipped. */ - switch(activecpu_get_pc()) + switch(cpu_get_pc(machine->activecpu)) { case 0x23f: case 0x246: diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c index b397ca274ad..310117bab87 100644 --- a/src/mame/drivers/xexex.c +++ b/src/mame/drivers/xexex.c @@ -189,7 +189,7 @@ static WRITE16_HANDLER( spriteram16_mirror_w ) static READ16_HANDLER( xexex_waitskip_r ) { - if (activecpu_get_pc() == 0x1158) + if (cpu_get_pc(machine->activecpu) == 0x1158) { cpu_spinuntil_trigger(resume_trigger); suspension_active = 1; diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c index 59869b763cf..9c6e5fbe5aa 100644 --- a/src/mame/drivers/xmen.c +++ b/src/mame/drivers/xmen.c @@ -73,7 +73,7 @@ static READ16_HANDLER( eeprom_r ) { int res; -logerror("%06x eeprom_r\n",activecpu_get_pc()); +logerror("%06x eeprom_r\n",cpu_get_pc(machine->activecpu)); /* bit 6 is EEPROM data */ /* bit 7 is EEPROM ready */ /* bit 14 is service button */ @@ -89,7 +89,7 @@ logerror("%06x eeprom_r\n",activecpu_get_pc()); static WRITE16_HANDLER( eeprom_w ) { -logerror("%06x: write %04x to 108000\n",activecpu_get_pc(),data); +logerror("%06x: write %04x to 108000\n",cpu_get_pc(machine->activecpu),data); if (ACCESSING_BITS_0_7) { /* bit 0 = coin counter */ diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c index 4d3ffcc81eb..df4e5b945c5 100644 --- a/src/mame/drivers/xtheball.c +++ b/src/mame/drivers/xtheball.c @@ -7,6 +7,7 @@ **************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "cpu/tms34010/tms34010.h" #include "video/tlc34076.h" #include "machine/ticket.h" @@ -101,7 +102,7 @@ static void xtheball_to_shiftreg(UINT32 address, UINT16 *shiftreg) else if (address >= 0x02000000 && address <= 0x020fffff) memcpy(shiftreg, &vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000)); else - logerror("%08X:xtheball_to_shiftreg(%08X)\n", activecpu_get_pc(), address); + logerror("%08X:xtheball_to_shiftreg(%08X)\n", cpu_get_pc(Machine->activecpu), address); } @@ -112,7 +113,7 @@ static void xtheball_from_shiftreg(UINT32 address, UINT16 *shiftreg) else if (address >= 0x02000000 && address <= 0x020fffff) memcpy(&vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000)); else - logerror("%08X:xtheball_from_shiftreg(%08X)\n", activecpu_get_pc(), address); + logerror("%08X:xtheball_from_shiftreg(%08X)\n", cpu_get_pc(Machine->activecpu), address); } @@ -143,7 +144,7 @@ static WRITE16_HANDLER( bit_controls_w ) { if (bitvals[offset] != (data & 1)) { - logerror("%08x:bit_controls_w(%x,%d)\n", activecpu_get_pc(), offset, data & 1); + logerror("%08x:bit_controls_w(%x,%d)\n", cpu_get_pc(machine->activecpu), offset, data & 1); switch (offset) { diff --git a/src/mame/drivers/xyonix.c b/src/mame/drivers/xyonix.c index c2e3b3a9453..6c221ea9e65 100644 --- a/src/mame/drivers/xyonix.c +++ b/src/mame/drivers/xyonix.c @@ -82,7 +82,7 @@ static void handle_coins(running_machine *machine, int coin) static READ8_HANDLER ( xyonix_io_r ) { - int regPC = activecpu_get_pc(); + int regPC = cpu_get_pc(machine->activecpu); if (regPC == 0x27ba) return 0x88; @@ -142,7 +142,7 @@ static READ8_HANDLER ( xyonix_io_r ) static WRITE8_HANDLER ( xyonix_io_w ) { -// logerror ("xyonix_port_e0_w %02x - PC = %04x\n", data, activecpu_get_pc()); +// logerror ("xyonix_port_e0_w %02x - PC = %04x\n", data, cpu_get_pc(machine->activecpu)); e0_data = data; } diff --git a/src/mame/drivers/yumefuda.c b/src/mame/drivers/yumefuda.c index b08bd5cfc16..b4aa4a1280f 100644 --- a/src/mame/drivers/yumefuda.c +++ b/src/mame/drivers/yumefuda.c @@ -120,20 +120,20 @@ static WRITE8_HANDLER( yumefuda_cram_w ) /*Custom RAM (Protection)*/ static READ8_HANDLER( custom_ram_r ) { -// logerror("Custom RAM read at %02x PC = %x\n",offset+0xaf80,activecpu_get_pc()); +// logerror("Custom RAM read at %02x PC = %x\n",offset+0xaf80,cpu_get_pc(machine->activecpu)); return cus_ram[offset];// ^ 0x55; } static WRITE8_HANDLER( custom_ram_w ) { -// logerror("Custom RAM write at %02x : %02x PC = %x\n",offset+0xaf80,data,activecpu_get_pc()); +// logerror("Custom RAM write at %02x : %02x PC = %x\n",offset+0xaf80,data,cpu_get_pc(machine->activecpu)); if(prot_lock) { cus_ram[offset] = data; } } /*this might be used as NVRAM commands btw*/ static WRITE8_HANDLER( prot_lock_w ) { -// logerror("PC %04x Prot lock value written %02x\n",activecpu_get_pc(),data); +// logerror("PC %04x Prot lock value written %02x\n",cpu_get_pc(machine->activecpu),data); prot_lock = data; } @@ -146,7 +146,7 @@ static WRITE8_HANDLER( eeprom_w ) static WRITE8_HANDLER( port_c0_w ) { -// logerror("PC %04x (Port $c0) value written %02x\n",activecpu_get_pc(),data); +// logerror("PC %04x (Port $c0) value written %02x\n",cpu_get_pc(machine->activecpu),data); } diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c index 935fbe1ca3e..f0e79a5a08d 100644 --- a/src/mame/drivers/yunsung8.c +++ b/src/mame/drivers/yunsung8.c @@ -79,7 +79,7 @@ static WRITE8_HANDLER( yunsung8_bankswitch_w ) int bank = data & 7; // ROM bank yunsung8_layers_ctrl = data & 0x30; // Layers enable - if (data & ~0x37) logerror("CPU #0 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); + if (data & ~0x37) logerror("CPU #0 - PC %04X: Bank %02X\n",cpu_get_pc(machine->activecpu),data); if (bank < 3) RAM = &RAM[0x4000 * bank]; else RAM = &RAM[0x4000 * (bank-3) + 0x10000]; @@ -134,7 +134,7 @@ static WRITE8_HANDLER( yunsung8_sound_bankswitch_w ) UINT8 *RAM = memory_region(machine, "audio"); int bank = data & 7; - if ( bank != (data&(~0x20)) ) logerror("CPU #1 - PC %04X: Bank %02X\n",activecpu_get_pc(),data); + if ( bank != (data&(~0x20)) ) logerror("CPU #1 - PC %04X: Bank %02X\n",cpu_get_pc(machine->activecpu),data); if (bank < 3) RAM = &RAM[0x4000 * bank]; else RAM = &RAM[0x4000 * (bank-3) + 0x10000]; diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c index 2a68fcb2647..e5806a2f1df 100644 --- a/src/mame/drivers/zaccaria.c +++ b/src/mame/drivers/zaccaria.c @@ -71,7 +71,7 @@ static WRITE8_DEVICE_HANDLER( zaccaria_dsw_sel_w ) break; default: - logerror("PC %04x: portsel = %02x\n", activecpu_get_pc(), data); + logerror("PC %04x: portsel = %02x\n", cpu_get_pc(device->machine->activecpu), data); break; } } diff --git a/src/mame/drivers/zerozone.c b/src/mame/drivers/zerozone.c index 07f00446237..430b126598a 100644 --- a/src/mame/drivers/zerozone.c +++ b/src/mame/drivers/zerozone.c @@ -50,7 +50,7 @@ static READ16_HANDLER( zerozone_input_r ) return input_port_read(machine, "DSWA"); } -logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",activecpu_get_pc(),0x800000+offset); +logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(machine->activecpu),0x800000+offset); return 0x00; } diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c index e6a37cacb1a..91786d9fc05 100644 --- a/src/mame/drivers/zn.c +++ b/src/mame/drivers/zn.c @@ -35,9 +35,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { @@ -1947,7 +1947,7 @@ static WRITE32_HANDLER( bam2_mcu_w ) else if (ACCESSING_BITS_16_31) { bam2_mcu_command = data>>16; - logerror("MCU command: %04x (PC %08x)\n", bam2_mcu_command, activecpu_get_pc()); + logerror("MCU command: %04x (PC %08x)\n", bam2_mcu_command, cpu_get_pc(machine->activecpu)); } } } @@ -1957,11 +1957,11 @@ static READ32_HANDLER( bam2_mcu_r ) switch (offset) { case 0: - logerror("MCU port 0 read @ PC %08x mask %08x\n", activecpu_get_pc(), mem_mask); + logerror("MCU port 0 read @ PC %08x mask %08x\n", cpu_get_pc(machine->activecpu), mem_mask); break; case 1: - logerror("MCU status read @ PC %08x mask %08x\n", activecpu_get_pc(), mem_mask); + logerror("MCU status read @ PC %08x mask %08x\n", cpu_get_pc(machine->activecpu), mem_mask); switch (bam2_mcu_command) { diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c index 4d535cef218..dc511cec6cc 100644 --- a/src/mame/drivers/zr107.c +++ b/src/mame/drivers/zr107.c @@ -237,9 +237,9 @@ static VIDEO_UPDATE( jetwave ) draw_7segment_led(bitmap, 3, 3, led_reg0); draw_7segment_led(bitmap, 9, 3, led_reg1); - cpuintrf_push_context(2); + cpu_push_context(screen->machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); return 0; } @@ -293,9 +293,9 @@ static VIDEO_UPDATE( zr107 ) draw_7segment_led(bitmap, 3, 3, led_reg0); draw_7segment_led(bitmap, 9, 3, led_reg1); - cpuintrf_push_context(2); + cpu_push_context(screen->machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); return 0; } @@ -463,14 +463,14 @@ static UINT32 *workram; static MACHINE_START( zr107 ) { /* set conservative DRC options */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_DRC_OPTIONS, PPCDRC_COMPATIBLE_OPTIONS); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_END, 0x000fffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_PPC_FASTRAM_BASE, workram); - cpunum_set_info_int(0, CPUINFO_INT_PPC_FASTRAM_READONLY, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_END, 0x000fffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_PPC_FASTRAM_BASE, workram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_PPC_FASTRAM_READONLY, 0); } static ADDRESS_MAP_START( zr107_map, ADDRESS_SPACE_PROGRAM, 32 ) diff --git a/src/mame/includes/atari.h b/src/mame/includes/atari.h index 635c552a214..e35d0981ac1 100644 --- a/src/mame/includes/atari.h +++ b/src/mame/includes/atari.h @@ -57,12 +57,6 @@ void a5200_handle_keypads(running_machine *machine); /* video */ -/* Enable this to make the video code use readmem16 to retrieve data */ -/* Otherwise the RAM memory array is accessed and thus, if a display list would */ -/* point to memory mapped IO, the result is different from a real machine */ -#define ACCURATE_ANTIC_READMEM 1 - - #define CYCLES_PER_LINE 114 /* total number of cpu cycles per scanline (incl. hblank) */ #define CYCLES_REFRESH 9 /* number of cycles lost for ANTICs RAM refresh using DMA */ #define CYCLES_HSTART 32 /* where does the ANTIC DMA fetch start */ @@ -315,47 +309,39 @@ typedef struct { UINT8 *uc_g3; /* used colors for gfx GTIA 3 */ } ANTIC; -#if ACCURATE_ANTIC_READMEM -#define RDANTIC() cpunum_read_byte(0, antic.dpage+antic.doffs) -#define RDVIDEO(o) cpunum_read_byte(0, antic.vpage+((antic.voffs+(o))&VOFFS)) -#define RDCHGEN(o) cpunum_read_byte(0, antic.chbase+(o)) -#define RDPMGFXS(o) cpunum_read_byte(0, antic.pmbase_s+(o)+(antic.scanline>>1)) -#define RDPMGFXD(o) cpunum_read_byte(0, antic.pmbase_d+(o)+antic.scanline) -#else -#define RDANTIC() (memory_region(machine, REGION_CPU1))[antic.dpage+antic.doffs] -#define RDVIDEO(o) (memory_region(machine, REGION_CPU1))[antic.vpage+((antic.voffs+(o))&VOFFS)] -#define RDCHGEN(o) (memory_region(machine, REGION_CPU1))[antic.chbase+(o)] -#define RDPMGFXS(o) (memory_region(machine, REGION_CPU1))[antic.pmbase_s+(o)+(antic.scanline>>1)] -#define RDPMGFXD(o) (memory_region(machine, REGION_CPU1))[antic.pmbase_d+(o)+antic.scanline] -#endif +#define RDANTIC(cpu) cpu_read_byte(cpu, antic.dpage+antic.doffs) +#define RDVIDEO(cpu,o) cpu_read_byte(cpu, antic.vpage+((antic.voffs+(o))&VOFFS)) +#define RDCHGEN(cpu,o) cpu_read_byte(cpu, antic.chbase+(o)) +#define RDPMGFXS(cpu,o) cpu_read_byte(cpu, antic.pmbase_s+(o)+(antic.scanline>>1)) +#define RDPMGFXD(cpu,o) cpu_read_byte(cpu, antic.pmbase_d+(o)+antic.scanline) #define PREPARE() \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET] -#define PREPARE_TXT2(width) \ +#define PREPARE_TXT2(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ { \ - UINT16 ch = RDVIDEO(i) << 3; \ + UINT16 ch = RDVIDEO(cpu,i) << 3; \ if( ch & 0x400 ) \ { \ - ch = RDCHGEN((ch & 0x3f8) + antic.w.chbasl); \ + ch = RDCHGEN(cpu,(ch & 0x3f8) + antic.w.chbasl); \ ch = (ch ^ antic.chxor) & antic.chand; \ } \ else \ { \ - ch = RDCHGEN(ch + antic.w.chbasl); \ + ch = RDCHGEN(cpu,ch + antic.w.chbasl); \ } \ video->data[i] = ch; \ } -#define PREPARE_TXT3(width) \ +#define PREPARE_TXT3(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ { \ - UINT16 ch = RDVIDEO(i) << 3; \ + UINT16 ch = RDVIDEO(cpu,i) << 3; \ if( ch & 0x400 ) \ { \ ch &= 0x3f8; \ @@ -364,14 +350,14 @@ typedef struct { if (antic.w.chbasl < 2) /* first two lines empty */ \ ch = 0x00; \ else /* lines 2..7 are standard, 8&9 are 0&1 */ \ - ch = RDCHGEN(ch + (antic.w.chbasl & 7)); \ + ch = RDCHGEN(cpu,ch + (antic.w.chbasl & 7));\ } \ else \ { \ if (antic.w.chbasl > 7) /* last two lines empty */ \ ch = 0x00; \ else /* lines 0..7 are standard */ \ - ch = RDCHGEN(ch + antic.w.chbasl); \ + ch = RDCHGEN(cpu,ch + antic.w.chbasl); \ } \ ch = (ch ^ antic.chxor) & antic.chand; \ } \ @@ -382,87 +368,87 @@ typedef struct { if (antic.w.chbasl < 2) /* first two lines empty */ \ ch = 0x00; \ else /* lines 2..7 are standard, 8&9 are 0&1 */ \ - ch = RDCHGEN(ch + (antic.w.chbasl & 7)); \ + ch = RDCHGEN(cpu,ch + (antic.w.chbasl & 7));\ } \ else \ { \ if (antic.w.chbasl > 7) /* last two lines empty */ \ ch = 0x00; \ else /* lines 0..7 are standard */ \ - ch = RDCHGEN(ch + antic.w.chbasl); \ + ch = RDCHGEN(cpu,ch + antic.w.chbasl); \ } \ } \ video->data[i] = ch; \ } -#define PREPARE_TXT45(width,shift) \ +#define PREPARE_TXT45(cpu,width,shift) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ { \ - UINT16 ch = RDVIDEO(i) << 3; \ - ch = ((ch>>2)&0x100)|RDCHGEN((ch&0x3f8)+(antic.w.chbasl>>shift)); \ + UINT16 ch = RDVIDEO(cpu,i) << 3; \ + ch = ((ch>>2)&0x100)|RDCHGEN(cpu,(ch&0x3f8)+(antic.w.chbasl>>shift)); \ video->data[i] = ch; \ } -#define PREPARE_TXT67(width,shift) \ +#define PREPARE_TXT67(cpu,width,shift) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ { \ - UINT16 ch = RDVIDEO(i) << 3; \ - ch = (ch&0x600)|(RDCHGEN((ch&0x1f8)+(antic.w.chbasl>>shift))<<1); \ + UINT16 ch = RDVIDEO(cpu,i) << 3; \ + ch = (ch&0x600)|(RDCHGEN(cpu,(ch&0x1f8)+(antic.w.chbasl>>shift))<<1); \ video->data[i] = ch; \ } -#define PREPARE_GFX8(width) \ +#define PREPARE_GFX8(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ - video->data[i] = RDVIDEO(i) << 2 + video->data[i] = RDVIDEO(cpu,i) << 2 -#define PREPARE_GFX9BC(width) \ +#define PREPARE_GFX9BC(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ - video->data[i] = RDVIDEO(i) << 1 + video->data[i] = RDVIDEO(cpu,i) << 1 -#define PREPARE_GFXA(width) \ +#define PREPARE_GFXA(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ - video->data[i] = RDVIDEO(i) << 1 + video->data[i] = RDVIDEO(cpu,i) << 1 -#define PREPARE_GFXDE(width) \ +#define PREPARE_GFXDE(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ - video->data[i] = RDVIDEO(i) + video->data[i] = RDVIDEO(cpu,i) -#define PREPARE_GFXF(width) \ +#define PREPARE_GFXF(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ - video->data[i] = RDVIDEO(i) + video->data[i] = RDVIDEO(cpu,i) -#define PREPARE_GFXG1(width) \ +#define PREPARE_GFXG1(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ - video->data[i] = RDVIDEO(i) + video->data[i] = RDVIDEO(cpu,i) -#define PREPARE_GFXG2(width) \ +#define PREPARE_GFXG2(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ - video->data[i] = RDVIDEO(i) + video->data[i] = RDVIDEO(cpu,i) -#define PREPARE_GFXG3(width) \ +#define PREPARE_GFXG3(cpu,width) \ UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]; \ int i; \ for( i = 0; i < width; i++ ) \ - video->data[i] = RDVIDEO(i) + video->data[i] = RDVIDEO(cpu,i) /****************************************************************** * common end of a single antic/gtia mode emulation function diff --git a/src/mame/includes/dc.h b/src/mame/includes/dc.h index ae29af3f714..4e7f72c1f0d 100644 --- a/src/mame/includes/dc.h +++ b/src/mame/includes/dc.h @@ -32,8 +32,8 @@ WRITE32_HANDLER( dc_arm_aica_w ); MACHINE_START( dc ); MACHINE_RESET( dc ); -int compute_interrupt_level(void); -void update_interrupt_status(void); +int dc_compute_interrupt_level(running_machine *machine); +void dc_update_interrupt_status(running_machine *machine); INPUT_CHANGED( dc_coin_slots_callback ); extern UINT32 dc_sysctrl_regs[0x200/4]; diff --git a/src/mame/includes/eolithsp.h b/src/mame/includes/eolithsp.h index fd8dba1b971..74aa3025c8e 100644 --- a/src/mame/includes/eolithsp.h +++ b/src/mame/includes/eolithsp.h @@ -1,6 +1,6 @@ /*----------- defined in drivers/eolithsp.c -----------*/ -void eolith_speedup_read(void); +void eolith_speedup_read(running_machine *machine); void init_eolith_speedup(running_machine *machine); INTERRUPT_GEN( eolith_speedup ); CUSTOM_INPUT( eolith_speedup_getvblank ); diff --git a/src/mame/includes/gaelcrpt.h b/src/mame/includes/gaelcrpt.h index a9971d68dc8..f4b41628fa5 100644 --- a/src/mame/includes/gaelcrpt.h +++ b/src/mame/includes/gaelcrpt.h @@ -1,3 +1,3 @@ /*----------- defined in machine/gaelcrpt.c -----------*/ -UINT16 gaelco_decrypt(int offset, int data, int param1, int param2); +UINT16 gaelco_decrypt(running_machine *machine, int offset, int data, int param1, int param2); diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h index 790e83f186a..30649945a9e 100644 --- a/src/mame/includes/kaneko16.h +++ b/src/mame/includes/kaneko16.h @@ -116,7 +116,7 @@ extern UINT16* galsnew_fg_pixram; /*----------- defined in drivers/galpani2.c -----------*/ -void galpani2_mcu_run(void); +void galpani2_mcu_run(running_machine *machine); /*----------- defined in video/galpani2.c -----------*/ diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h index 18682224fd6..2a5414f4ba9 100644 --- a/src/mame/includes/leland.h +++ b/src/mame/includes/leland.h @@ -19,7 +19,7 @@ #define SERIAL_TYPE_ENCRYPT_XOR 4 extern UINT8 leland_dac_control; -extern void (*leland_update_master_bank)(void); +extern void (*leland_update_master_bank)(running_machine *machine); READ8_HANDLER( cerberus_dial_1_r ); READ8_HANDLER( cerberus_dial_2_r ); @@ -54,14 +54,14 @@ MACHINE_RESET( ataxx ); INTERRUPT_GEN( leland_master_interrupt ); WRITE8_HANDLER( leland_master_alt_bankswitch_w ); -void cerberus_bankswitch(void); -void mayhem_bankswitch(void); -void dangerz_bankswitch(void); -void basebal2_bankswitch(void); -void redline_bankswitch(void); -void viper_bankswitch(void); -void offroad_bankswitch(void); -void ataxx_bankswitch(void); +void cerberus_bankswitch(running_machine *machine); +void mayhem_bankswitch(running_machine *machine); +void dangerz_bankswitch(running_machine *machine); +void basebal2_bankswitch(running_machine *machine); +void redline_bankswitch(running_machine *machine); +void viper_bankswitch(running_machine *machine); +void offroad_bankswitch(running_machine *machine); +void ataxx_bankswitch(running_machine *machine); void leland_init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type); void ataxx_init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offset); diff --git a/src/mame/includes/meadows.h b/src/mame/includes/meadows.h index 12dd9dfa403..ab8e908bad0 100644 --- a/src/mame/includes/meadows.h +++ b/src/mame/includes/meadows.h @@ -8,7 +8,7 @@ void meadows_sh_start(void); void meadows_sh_dac_w(int data); -void meadows_sh_update(void); +void meadows_sh_update(running_machine *machine); extern UINT8 meadows_0c00; extern UINT8 meadows_0c01; extern UINT8 meadows_0c02; diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 7db6db3cb15..82489bd8440 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -31,7 +31,7 @@ /*----------- defined in drivers/neogeo.c -----------*/ void neogeo_set_display_position_interrupt_control(UINT16 data); -void neogeo_set_display_counter_msb(UINT16 data); +void neogeo_set_display_counter_msb(running_machine *machine, UINT16 data); void neogeo_set_display_counter_lsb(running_machine *machine, UINT16 data); void neogeo_acknowledge_interrupt(running_machine *machine, UINT16 data); void neogeo_set_main_cpu_bank_address(running_machine *machine, UINT32 bank_address); diff --git a/src/mame/includes/slapfght.h b/src/mame/includes/slapfght.h index 7c5d29c54b8..95c034b0c0a 100644 --- a/src/mame/includes/slapfght.h +++ b/src/mame/includes/slapfght.h @@ -16,9 +16,9 @@ enum { /* due to code at 0x108d (GUARDIAN) or 0x1152 (GETSTARJ), register C is a unaltered copy of register A */ -# define GS_SAVE_REGS gs_a = activecpu_get_reg(Z80_BC) >> 0; \ - gs_d = activecpu_get_reg(Z80_DE) >> 8; \ - gs_e = activecpu_get_reg(Z80_DE) >> 0; +# define GS_SAVE_REGS gs_a = cpu_get_reg(machine->activecpu, Z80_BC) >> 0; \ + gs_d = cpu_get_reg(machine->activecpu, Z80_DE) >> 8; \ + gs_e = cpu_get_reg(machine->activecpu, Z80_DE) >> 0; # define GS_RESET_REGS gs_a = 0; \ gs_d = 0; \ diff --git a/src/mame/includes/slapstic.h b/src/mame/includes/slapstic.h index 2c9e1e7c972..81ff228e369 100644 --- a/src/mame/includes/slapstic.h +++ b/src/mame/includes/slapstic.h @@ -15,4 +15,4 @@ void slapstic_init(running_machine *machine, int chip); void slapstic_reset(void); int slapstic_bank(void); -int slapstic_tweak(offs_t offset); +int slapstic_tweak(running_machine *machine, offs_t offset); diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c index 2ef1910a75a..2564b8e3551 100644 --- a/src/mame/machine/ajax.c +++ b/src/mame/machine/ajax.c @@ -128,7 +128,7 @@ READ8_HANDLER( ajax_ls138_f10_r ) break; default: - logerror("%04x: (ls138_f10) read from an unknown address %02x\n",activecpu_get_pc(), offset); + logerror("%04x: (ls138_f10) read from an unknown address %02x\n",cpu_get_pc(machine->activecpu), offset); } return data; @@ -159,7 +159,7 @@ WRITE8_HANDLER( ajax_ls138_f10_w ) break; default: - logerror("%04x: (ls138_f10) write %02x to an unknown address %02x\n",activecpu_get_pc(), data, offset); + logerror("%04x: (ls138_f10) write %02x to an unknown address %02x\n",cpu_get_pc(machine->activecpu), data, offset); } } diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index 991f6d4512d..77da2b4f7e4 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -306,7 +306,7 @@ void amiga_machine_config(running_machine *machine, const amiga_machine_interfac static void amiga_m68k_reset(void) { - logerror("Executed RESET at PC=%06x\n", activecpu_get_pc()); + logerror("Executed RESET at PC=%06x\n", cpu_get_pc(Machine->activecpu)); /* Initialize the various chips */ cia_reset(); @@ -323,7 +323,7 @@ static void amiga_m68k_reset(void) amiga_cia_w(Machine, 0x1001/2, 1, 0xffff); } - if (activecpu_get_pc() < 0x80000) + if (cpu_get_pc(Machine->activecpu) < 0x80000) memory_set_opbase(0); } @@ -331,7 +331,7 @@ static void amiga_m68k_reset(void) MACHINE_RESET( amiga ) { /* set m68k reset function */ - cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)amiga_m68k_reset); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_M68K_RESET_CALLBACK, (genf *)amiga_m68k_reset); /* Initialize the various chips */ cia_reset(); @@ -999,7 +999,7 @@ static void blitter_setup(void) /* is there another blitting in progress? */ if (CUSTOM_REG(REG_DMACON) & 0x4000) { - logerror("PC: %08x - This program is playing tricks with the blitter\n", safe_activecpu_get_pc() ); + logerror("PC: %08x - This program is playing tricks with the blitter\n", safe_cpu_get_pc(Machine->activecpu) ); return; } @@ -1079,7 +1079,7 @@ READ16_HANDLER( amiga_cia_r ) data = cia_read(machine, which, offset >> 7); if (LOG_CIA) - logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask); + logerror("%06x:cia_%c_read(%03x) = %04x & %04x\n", safe_cpu_get_pc(machine->activecpu), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data << shift, mem_mask); return data << shift; } @@ -1097,7 +1097,7 @@ WRITE16_HANDLER( amiga_cia_w ) int which; if (LOG_CIA) - logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", safe_activecpu_get_pc(), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask); + logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", safe_cpu_get_pc(machine->activecpu), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask); /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */ if ((offset & 0x0800) == 0) @@ -1263,7 +1263,7 @@ READ16_HANDLER( amiga_custom_r ) } if (LOG_CUSTOM) - logerror("%06X:read from custom %s\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff]); + logerror("%06X:read from custom %s\n", safe_cpu_get_pc(machine->activecpu), amiga_custom_names[offset & 0xff]); return 0xffff; } @@ -1292,7 +1292,7 @@ WRITE16_HANDLER( amiga_custom_w ) offset &= 0xff; if (LOG_CUSTOM) - logerror("%06X:write to custom %s = %04X\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff], data); + logerror("%06X:write to custom %s = %04X\n", safe_cpu_get_pc(machine->activecpu), amiga_custom_names[offset & 0xff], data); switch (offset) { diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c index 18a99f507dd..4dc6a606bde 100644 --- a/src/mame/machine/arkanoid.c +++ b/src/mame/machine/arkanoid.c @@ -184,9 +184,9 @@ TO DO (2006.09.12) : */ -#define LOG_F002_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_cmd,arkanoid_bootleg_val); -#define LOG_D018_W if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n",activecpu_get_pc(),data,arkanoid_bootleg_cmd); -#define LOG_D008_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d008_r - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_d008_val); +#define LOG_F002_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - val = %02x\n",cpu_get_pc(machine->activecpu),arkanoid_bootleg_cmd,arkanoid_bootleg_val); +#define LOG_D018_W if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n",cpu_get_pc(machine->activecpu),data,arkanoid_bootleg_cmd); +#define LOG_D008_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d008_r - val = %02x\n",cpu_get_pc(machine->activecpu),arkanoid_bootleg_d008_val); static UINT8 arkanoid_bootleg_cmd; @@ -270,7 +270,7 @@ READ8_HANDLER( arkanoid_bootleg_f002_r ) LOG_F002_R break; default: - logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - unknown bootleg !\n",activecpu_get_pc(),arkanoid_bootleg_cmd); + logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - unknown bootleg !\n",cpu_get_pc(machine->activecpu),arkanoid_bootleg_cmd); break; } @@ -289,27 +289,27 @@ WRITE8_HANDLER( arkanoid_bootleg_d018_w ) switch (data) { case 0x36: /* unneeded value : no call 0x2050, unused A and overwritten HL (0x0313 -> 0x0340) */ - if (activecpu_get_pc() == 0x7c47) + if (cpu_get_pc(machine->activecpu) == 0x7c47) arkanoid_bootleg_cmd = 0x00; break; case 0x38: /* unneeded value : no call 0x2050, unused A and fixed HL (0x7bd5) */ - if (activecpu_get_pc() == 0x7b87) + if (cpu_get_pc(machine->activecpu) == 0x7b87) arkanoid_bootleg_cmd = 0x00; break; case 0x8a: /* unneeded value : no call 0x2050, unused A and overwritten HL (0x7b77 -> 0x7c1c) */ - if (activecpu_get_pc() == 0x9661) + if (cpu_get_pc(machine->activecpu) == 0x9661) arkanoid_bootleg_cmd = 0x00; break; case 0xe3: /* unneeded value : call 0x2050 but fixed A (0x00) and fixed HL (0xed83) */ - if (activecpu_get_pc() == 0x67e3) + if (cpu_get_pc(machine->activecpu) == 0x67e3) arkanoid_bootleg_cmd = 0x00; break; case 0xf7: /* unneeded value : 3 * 'NOP' at 0x034f + 2 * 'NOP' at 0x35b */ - if (activecpu_get_pc() == 0x0349) + if (cpu_get_pc(machine->activecpu) == 0x0349) arkanoid_bootleg_cmd = 0x00; break; case 0xff: /* unneeded value : no call 0x2050, unused A and overwritten HL (0x7c4f -> 0x7d31) */ - if (activecpu_get_pc() == 0x9670) + if (cpu_get_pc(machine->activecpu) == 0x9670) arkanoid_bootleg_cmd = 0x00; break; default: @@ -322,37 +322,37 @@ WRITE8_HANDLER( arkanoid_bootleg_d018_w ) switch (data) { case 0x36: /* unneeded value : call 0x2050 but fixed A (0x2d) */ - if (activecpu_get_pc() == 0x7c4c) + if (cpu_get_pc(machine->activecpu) == 0x7c4c) arkanoid_bootleg_cmd = 0x00; break; case 0x38: /* unneeded value : call 0x2050 but fixed A (0xf3) */ - if (activecpu_get_pc() == 0x7b87) + if (cpu_get_pc(machine->activecpu) == 0x7b87) arkanoid_bootleg_cmd = 0x00; break; case 0x88: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e3) + if (cpu_get_pc(machine->activecpu) == 0x67e3) arkanoid_bootleg_cmd = 0x00; - if (activecpu_get_pc() == 0x7c47) + if (cpu_get_pc(machine->activecpu) == 0x7c47) arkanoid_bootleg_cmd = 0x00; break; case 0x89: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e5) + if (cpu_get_pc(machine->activecpu) == 0x67e5) arkanoid_bootleg_cmd = 0x00; break; case 0x8a: /* unneeded value : call 0x2050 but fixed A (0xa5) */ - if (activecpu_get_pc() == 0x9661) + if (cpu_get_pc(machine->activecpu) == 0x9661) arkanoid_bootleg_cmd = 0x00; break; case 0xc0: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e7) + if (cpu_get_pc(machine->activecpu) == 0x67e7) arkanoid_bootleg_cmd = 0x00; break; case 0xe3: /* unneeded value : call 0x2050 but fixed A (0x61) */ - if (activecpu_get_pc() == 0x67e9) + if (cpu_get_pc(machine->activecpu) == 0x67e9) arkanoid_bootleg_cmd = 0x00; break; case 0xff: /* unneeded value : call 0x2050 but fixed A (0xe2) */ - if (activecpu_get_pc() == 0x9670) + if (cpu_get_pc(machine->activecpu) == 0x9670) arkanoid_bootleg_cmd = 0x00; break; default: @@ -365,41 +365,41 @@ WRITE8_HANDLER( arkanoid_bootleg_d018_w ) switch (data) { case 0x36: /* unneeded value : call 0x2050 but fixed A (0x2d) */ - if (activecpu_get_pc() == 0x7c4c) + if (cpu_get_pc(machine->activecpu) == 0x7c4c) arkanoid_bootleg_cmd = 0x00; break; case 0x38: /* unneeded value : call 0x2050 but fixed A (0xf3) */ - if (activecpu_get_pc() == 0x7b87) + if (cpu_get_pc(machine->activecpu) == 0x7b87) arkanoid_bootleg_cmd = 0x00; break; case 0x88: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e3) + if (cpu_get_pc(machine->activecpu) == 0x67e3) arkanoid_bootleg_cmd = 0x00; - if (activecpu_get_pc() == 0x7c47) + if (cpu_get_pc(machine->activecpu) == 0x7c47) arkanoid_bootleg_cmd = 0x00; break; case 0x89: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e5) + if (cpu_get_pc(machine->activecpu) == 0x67e5) arkanoid_bootleg_cmd = 0x00; break; case 0x8a: /* unneeded value : call 0x2050 but unused HL and fixed DE (0x7c1c) */ - if (activecpu_get_pc() == 0x9661) + if (cpu_get_pc(machine->activecpu) == 0x9661) arkanoid_bootleg_cmd = 0x00; break; case 0xc0: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e7) + if (cpu_get_pc(machine->activecpu) == 0x67e7) arkanoid_bootleg_cmd = 0x00; break; case 0xe3: /* unneeded value : call 0x2050 but fixed A (0x61) */ - if (activecpu_get_pc() == 0x67e9) + if (cpu_get_pc(machine->activecpu) == 0x67e9) arkanoid_bootleg_cmd = 0x00; break; case 0xf7: /* unneeded value : call 0x2050 but never called (check code at 0x0340) */ - if (activecpu_get_pc() == 0x0349) + if (cpu_get_pc(machine->activecpu) == 0x0349) arkanoid_bootleg_cmd = 0x00; break; case 0xff: /* unneeded value : no call 0x2050, unused A and fixed HL (0x7d31) */ - if (activecpu_get_pc() == 0x9670) + if (cpu_get_pc(machine->activecpu) == 0x9670) arkanoid_bootleg_cmd = 0x00; break; default: @@ -412,40 +412,40 @@ WRITE8_HANDLER( arkanoid_bootleg_d018_w ) switch (data) { case 0x36: /* unneeded value : call 0x2050 but fixed A (0x2d) */ - if (activecpu_get_pc() == 0x7c4c) + if (cpu_get_pc(machine->activecpu) == 0x7c4c) arkanoid_bootleg_cmd = 0x00; break; case 0x38: /* unneeded value : call 0x2050 but fixed A (0xf3) */ - if (activecpu_get_pc() == 0x7b87) + if (cpu_get_pc(machine->activecpu) == 0x7b87) arkanoid_bootleg_cmd = 0x00; break; case 0x88: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e3) + if (cpu_get_pc(machine->activecpu) == 0x67e3) arkanoid_bootleg_cmd = 0x00; - if (activecpu_get_pc() == 0x7c47) + if (cpu_get_pc(machine->activecpu) == 0x7c47) arkanoid_bootleg_cmd = 0x00; case 0x89: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e5) + if (cpu_get_pc(machine->activecpu) == 0x67e5) arkanoid_bootleg_cmd = 0x00; break; case 0x8a: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (activecpu_get_pc() == 0x9661) + if (cpu_get_pc(machine->activecpu) == 0x9661) arkanoid_bootleg_cmd = data; break; case 0xc0: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e7) + if (cpu_get_pc(machine->activecpu) == 0x67e7) arkanoid_bootleg_cmd = 0x00; break; case 0xe3: /* unneeded value : call 0x2050 but fixed A (0x61) */ - if (activecpu_get_pc() == 0x67e9) + if (cpu_get_pc(machine->activecpu) == 0x67e9) arkanoid_bootleg_cmd = 0x00; break; case 0xf7: /* unneeded value : 3 * 'NOP' at 0x034f + 'JR NZ,$035D' at 0x35b */ - if (activecpu_get_pc() == 0x0349) + if (cpu_get_pc(machine->activecpu) == 0x0349) arkanoid_bootleg_cmd = 0x00; break; case 0xff: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (activecpu_get_pc() == 0x9670) + if (cpu_get_pc(machine->activecpu) == 0x9670) arkanoid_bootleg_cmd = data; break; default: @@ -458,48 +458,48 @@ WRITE8_HANDLER( arkanoid_bootleg_d018_w ) switch (data) { case 0x24: /* A read from 0xf002 (expected to be 0x9b) */ - if (activecpu_get_pc() == 0xbd7a) + if (cpu_get_pc(machine->activecpu) == 0xbd7a) arkanoid_bootleg_cmd = data; break; case 0x36: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (activecpu_get_pc() == 0x7c4c) + if (cpu_get_pc(machine->activecpu) == 0x7c4c) arkanoid_bootleg_cmd = data; break; case 0x38: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (activecpu_get_pc() == 0x7b87) + if (cpu_get_pc(machine->activecpu) == 0x7b87) arkanoid_bootleg_cmd = data; break; case 0x88: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e3) + if (cpu_get_pc(machine->activecpu) == 0x67e3) arkanoid_bootleg_cmd = 0x00; - if (activecpu_get_pc() == 0x7c47) + if (cpu_get_pc(machine->activecpu) == 0x7c47) arkanoid_bootleg_cmd = 0x00; case 0x89: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e5) + if (cpu_get_pc(machine->activecpu) == 0x67e5) arkanoid_bootleg_cmd = 0x00; break; case 0x8a: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (activecpu_get_pc() == 0x9661) + if (cpu_get_pc(machine->activecpu) == 0x9661) arkanoid_bootleg_cmd = data; break; case 0xc0: /* unneeded value : no read back */ - if (activecpu_get_pc() == 0x67e7) + if (cpu_get_pc(machine->activecpu) == 0x67e7) arkanoid_bootleg_cmd = 0x00; break; case 0xc3: /* A read from 0xf002 (expected to be 0x1d) */ - if (activecpu_get_pc() == 0xbd8a) + if (cpu_get_pc(machine->activecpu) == 0xbd8a) arkanoid_bootleg_cmd = data; break; case 0xe3: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (activecpu_get_pc() == 0x67e9) + if (cpu_get_pc(machine->activecpu) == 0x67e9) arkanoid_bootleg_cmd = data; break; case 0xf7: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (activecpu_get_pc() == 0x0349) + if (cpu_get_pc(machine->activecpu) == 0x0349) arkanoid_bootleg_cmd = data; break; case 0xff: /* call 0x2050 with A read from 0xf002 and wrong HL */ - if (activecpu_get_pc() == 0x9670) + if (cpu_get_pc(machine->activecpu) == 0x9670) arkanoid_bootleg_cmd = data; break; default: @@ -509,7 +509,7 @@ WRITE8_HANDLER( arkanoid_bootleg_d018_w ) LOG_D018_W break; default: - logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - unknown bootleg !\n",activecpu_get_pc(),data); + logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - unknown bootleg !\n",cpu_get_pc(machine->activecpu),data); break; } } @@ -567,7 +567,7 @@ READ8_HANDLER( arkanoid_bootleg_d008_r ) arkanoid_bootleg_d008_bit[2] = 0; /* untested bit */ arkanoid_bootleg_d008_bit[3] = 0; /* untested bit */ arkanoid_bootleg_d008_bit[5] = 0; /* untested bit */ - logerror("%04x: arkanoid_bootleg_d008_r - unknown bootleg !\n",activecpu_get_pc()); + logerror("%04x: arkanoid_bootleg_d008_r - unknown bootleg !\n",cpu_get_pc(machine->activecpu)); break; } diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c index ed3e98978f3..f22c5ea9002 100644 --- a/src/mame/machine/asic65.c +++ b/src/mame/machine/asic65.c @@ -215,7 +215,7 @@ WRITE16_HANDLER( asic65_data_w ) else { int command = (data < MAX_COMMANDS) ? command_map[asic65.type][data] : OP_UNKNOWN; - if (asic65.log) fprintf(asic65.log, "\n(%06X)%c%04X:", activecpu_get_previouspc(), (command == OP_UNKNOWN) ? '*' : ' ', data); + if (asic65.log) fprintf(asic65.log, "\n(%06X)%c%04X:", cpu_get_previouspc(machine->activecpu), (command == OP_UNKNOWN) ? '*' : ' ', data); /* set the command number and reset the parameter/result indices */ asic65.command = data; diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index e69c27acb98..8244669cef9 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -515,7 +515,7 @@ static OPBASE_HANDLER( atarigen_slapstic_setopbase ) address &= ~atarigen_slapstic_mirror; if (address >= atarigen_slapstic_base && address < atarigen_slapstic_base + 0x8000) { - offs_t pc = activecpu_get_previouspc(); + offs_t pc = cpu_get_previouspc(machine->activecpu); if (pc != atarigen_slapstic_last_pc || address != atarigen_slapstic_last_address) { atarigen_slapstic_last_pc = pc; @@ -588,7 +588,7 @@ void atarigen_slapstic_reset(void) WRITE16_HANDLER( atarigen_slapstic_w ) { - update_bank(slapstic_tweak(offset)); + update_bank(slapstic_tweak(machine, offset)); } @@ -603,7 +603,7 @@ READ16_HANDLER( atarigen_slapstic_r ) int result = atarigen_slapstic[offset & 0xfff]; /* then determine the new one */ - update_bank(slapstic_tweak(offset)); + update_bank(slapstic_tweak(machine, offset)); return result; } diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c index 980bb62c6cd..759cfae8c9d 100644 --- a/src/mame/machine/balsente.c +++ b/src/mame/machine/balsente.c @@ -1077,7 +1077,7 @@ WRITE8_HANDLER( balsente_chip_select_w ) "PULSE_WIDTH", "WAVE_SELECT" }; - logerror("s%04X: CEM#%d:%s=%f\n", activecpu_get_previouspc(), i, names[dac_register], voltage); + logerror("s%04X: CEM#%d:%s=%f\n", cpu_get_previouspc(machine->activecpu), i, names[dac_register], voltage); } #endif } @@ -1204,7 +1204,7 @@ static void update_grudge_steering(running_machine *machine) READ8_HANDLER( grudge_steering_r ) { - logerror("%04X:grudge_steering_r(@%d)\n", activecpu_get_pc(), video_screen_get_vpos(machine->primary_screen)); + logerror("%04X:grudge_steering_r(@%d)\n", cpu_get_pc(machine->activecpu), video_screen_get_vpos(machine->primary_screen)); grudge_steering_result |= 0x80; return grudge_steering_result; } diff --git a/src/mame/machine/bonzeadv.c b/src/mame/machine/bonzeadv.c index 616a55ece5a..f74d66cc4b2 100644 --- a/src/mame/machine/bonzeadv.c +++ b/src/mame/machine/bonzeadv.c @@ -386,8 +386,8 @@ WRITE16_HANDLER( bonzeadv_cchip_bank_w ) WRITE16_HANDLER( bonzeadv_cchip_ram_w ) { -// if (activecpu_get_pc()!=0xa028) -// logerror("%08x: write %04x %04x cchip\n", activecpu_get_pc(), offset, data); +// if (cpu_get_pc(machine->activecpu)!=0xa028) +// logerror("%08x: write %04x %04x cchip\n", cpu_get_pc(machine->activecpu), offset, data); if (current_bank == 0) { @@ -440,7 +440,7 @@ READ16_HANDLER( bonzeadv_cchip_ctrl_r ) READ16_HANDLER( bonzeadv_cchip_ram_r ) { -// logerror("%08x: read %04x cchip\n", activecpu_get_pc(), offset); +// logerror("%08x: read %04x cchip\n", cpu_get_pc(machine->activecpu), offset); if (current_bank == 0) { diff --git a/src/mame/machine/btime.c b/src/mame/machine/btime.c index 95fb23e96c6..30889a60da0 100644 --- a/src/mame/machine/btime.c +++ b/src/mame/machine/btime.c @@ -20,7 +20,7 @@ READ8_HANDLER( mmonkey_protection_r ) if (offset == 0x0000) ret = protection_status; else if (offset == 0x0e00) ret = protection_ret; else if (offset >= 0x0d00 && offset <= 0x0d02) ret = RAM[BASE+offset]; /* addition result */ - else logerror("Unknown protection read. PC=%04X Offset=%04X\n", activecpu_get_pc(), offset); + else logerror("Unknown protection read. PC=%04X Offset=%04X\n", cpu_get_pc(machine->activecpu), offset); return ret; } @@ -78,7 +78,7 @@ WRITE8_HANDLER( mmonkey_protection_w ) break; default: - logerror("Unemulated protection command=%02X. PC=%04X\n", protection_command, activecpu_get_pc()); + logerror("Unemulated protection command=%02X. PC=%04X\n", protection_command, cpu_get_pc(machine->activecpu)); break; } @@ -89,5 +89,5 @@ WRITE8_HANDLER( mmonkey_protection_w ) else if (offset == 0x0e00) protection_value = data; else if (offset >= 0x0f00) RAM[BASE+offset] = data; /* decrypt table */ else if (offset >= 0x0d00 && offset <= 0x0d05) RAM[BASE+offset] = data; /* source table */ - else logerror("Unknown protection write=%02X. PC=%04X Offset=%04X\n", data, activecpu_get_pc(), offset); + else logerror("Unknown protection write=%02X. PC=%04X Offset=%04X\n", data, cpu_get_pc(machine->activecpu), offset); } diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c index 9967f98f2c4..b3d7aba022f 100644 --- a/src/mame/machine/bublbobl.c +++ b/src/mame/machine/bublbobl.c @@ -179,14 +179,14 @@ WRITE8_HANDLER( bublbobl_mcu_ddr4_w ) READ8_HANDLER( bublbobl_mcu_port1_r ) { -//logerror("%04x: 6801U4 port 1 read\n",activecpu_get_pc()); +//logerror("%04x: 6801U4 port 1 read\n",cpu_get_pc(machine->activecpu)); port1_in = input_port_read(machine, "IN0"); return (port1_out & ddr1) | (port1_in & ~ddr1); } WRITE8_HANDLER( bublbobl_mcu_port1_w ) { -//logerror("%04x: 6801U4 port 1 write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 6801U4 port 1 write %02x\n",cpu_get_pc(machine->activecpu),data); // bit 4: coin lockout coin_lockout_global_w(~data & 0x10); @@ -209,13 +209,13 @@ WRITE8_HANDLER( bublbobl_mcu_port1_w ) READ8_HANDLER( bublbobl_mcu_port2_r ) { -//logerror("%04x: 6801U4 port 2 read\n",activecpu_get_pc()); +//logerror("%04x: 6801U4 port 2 read\n",cpu_get_pc(machine->activecpu)); return (port2_out & ddr2) | (port2_in & ~ddr2); } WRITE8_HANDLER( bublbobl_mcu_port2_w ) { -//logerror("%04x: 6801U4 port 2 write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 6801U4 port 2 write %02x\n",cpu_get_pc(machine->activecpu),data); static const char *const portnames[] = { "DSW0", "DSW1", "IN1", "IN2" }; // bits 0-3: bits 8-11 of shared RAM address @@ -249,26 +249,26 @@ WRITE8_HANDLER( bublbobl_mcu_port2_w ) READ8_HANDLER( bublbobl_mcu_port3_r ) { -//logerror("%04x: 6801U4 port 3 read\n",activecpu_get_pc()); +//logerror("%04x: 6801U4 port 3 read\n",cpu_get_pc(machine->activecpu)); return (port3_out & ddr3) | (port3_in & ~ddr3); } WRITE8_HANDLER( bublbobl_mcu_port3_w ) { -//logerror("%04x: 6801U4 port 3 write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 6801U4 port 3 write %02x\n",cpu_get_pc(machine->activecpu),data); port3_out = data; } READ8_HANDLER( bublbobl_mcu_port4_r ) { -//logerror("%04x: 6801U4 port 4 read\n",activecpu_get_pc()); +//logerror("%04x: 6801U4 port 4 read\n",cpu_get_pc(machine->activecpu)); return (port4_out & ddr4) | (port4_in & ~ddr4); } WRITE8_HANDLER( bublbobl_mcu_port4_w ) { -//logerror("%04x: 6801U4 port 4 write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 6801U4 port 4 write %02x\n",cpu_get_pc(machine->activecpu),data); // bits 0-7 of shared RAM address @@ -290,7 +290,7 @@ static int ic43_a,ic43_b; READ8_HANDLER( boblbobl_ic43_a_r ) { // if (offset >= 2) -// logerror("%04x: ic43_a_r (offs %d) res = %02x\n",activecpu_get_pc(),offset,res); +// logerror("%04x: ic43_a_r (offs %d) res = %02x\n",cpu_get_pc(machine->activecpu),offset,res); if (offset == 0) return ic43_a << 4; @@ -340,13 +340,13 @@ WRITE8_HANDLER( boblbobl_ic43_b_w ) { static const int xor[4] = { 4, 1, 8, 2 }; -// logerror("%04x: ic43_b_w (offs %d) %02x\n",activecpu_get_pc(),offset,data); +// logerror("%04x: ic43_b_w (offs %d) %02x\n",cpu_get_pc(machine->activecpu),offset,data); ic43_b = (data >> 4) ^ xor[offset]; } READ8_HANDLER( boblbobl_ic43_b_r ) { -// logerror("%04x: ic43_b_r (offs %d)\n",activecpu_get_pc(),offset); +// logerror("%04x: ic43_b_r (offs %d)\n",cpu_get_pc(machine->activecpu),offset); if (offset == 0) return ic43_b << 4; else @@ -382,13 +382,13 @@ static UINT8 portA_in,portA_out,ddrA; READ8_HANDLER( bublbobl_68705_portA_r ) { -//logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in); return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE8_HANDLER( bublbobl_68705_portA_w ) { -//logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data); portA_out = data; } @@ -429,7 +429,7 @@ static int address,latch; WRITE8_HANDLER( bublbobl_68705_portB_w ) { -//logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data); static const char *const portnames[] = { "DSW0", "DSW1", "IN1", "IN2" }; if ((ddrB & 0x01) && (~data & 0x01) && (portB_out & 0x01)) @@ -439,7 +439,7 @@ WRITE8_HANDLER( bublbobl_68705_portB_w ) if ((ddrB & 0x02) && (data & 0x02) && (~portB_out & 0x02)) /* positive edge trigger */ { address = (address & 0xff00) | portA_out; -//logerror("%04x: 68705 address %02x\n",activecpu_get_pc(),portA_out); +//logerror("%04x: 68705 address %02x\n",cpu_get_pc(machine->activecpu),portA_out); } if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04)) /* positive edge trigger */ { @@ -451,26 +451,26 @@ WRITE8_HANDLER( bublbobl_68705_portB_w ) { if ((address & 0x0800) == 0x0000) { -//logerror("%04x: 68705 read input port %02x\n",activecpu_get_pc(),address); +//logerror("%04x: 68705 read input port %02x\n",cpu_get_pc(machine->activecpu),address); latch = input_port_read(machine, portnames[address & 3]); } else if ((address & 0x0c00) == 0x0c00) { -//logerror("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),bublbobl_mcu_sharedram[address],address); +//logerror("%04x: 68705 read %02x from address %04x\n",cpu_get_pc(machine->activecpu),bublbobl_mcu_sharedram[address],address); latch = bublbobl_mcu_sharedram[address & 0x03ff]; } else -logerror("%04x: 68705 unknown read address %04x\n",activecpu_get_pc(),address); +logerror("%04x: 68705 unknown read address %04x\n",cpu_get_pc(machine->activecpu),address); } else /* write */ { if ((address & 0x0c00) == 0x0c00) { -//logerror("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address); +//logerror("%04x: 68705 write %02x to address %04x\n",cpu_get_pc(machine->activecpu),portA_out,address); bublbobl_mcu_sharedram[address & 0x03ff] = portA_out; } else -logerror("%04x: 68705 unknown write to address %04x\n",activecpu_get_pc(),address); +logerror("%04x: 68705 unknown write to address %04x\n",cpu_get_pc(machine->activecpu),address); } } if ((ddrB & 0x20) && (~data & 0x20) && (portB_out & 0x20)) @@ -483,11 +483,11 @@ logerror("%04x: 68705 unknown write to address %04x\n",activecpu_get_pc(),addres } if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40)) { -logerror("%04x: 68705 unknown port B bit %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 unknown port B bit %02x\n",cpu_get_pc(machine->activecpu),data); } if ((ddrB & 0x80) && (~data & 0x80) && (portB_out & 0x80)) { -logerror("%04x: 68705 unknown port B bit %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 unknown port B bit %02x\n",cpu_get_pc(machine->activecpu),data); } portB_out = data; diff --git a/src/mame/machine/buggychl.c b/src/mame/machine/buggychl.c index 3d76c8c315b..7cf6378fd47 100644 --- a/src/mame/machine/buggychl.c +++ b/src/mame/machine/buggychl.c @@ -26,13 +26,13 @@ static UINT8 portA_in,portA_out,ddrA; READ8_HANDLER( buggychl_68705_portA_r ) { -//logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in); return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE8_HANDLER( buggychl_68705_portA_w ) { -//logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data); portA_out = data; } @@ -70,7 +70,7 @@ READ8_HANDLER( buggychl_68705_portB_r ) WRITE8_HANDLER( buggychl_68705_portB_w ) { -logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data); if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) { @@ -111,13 +111,13 @@ READ8_HANDLER( buggychl_68705_portC_r ) portC_in = 0; if (main_sent) portC_in |= 0x01; if (!mcu_sent) portC_in |= 0x02; -logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),portC_in); +logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(machine->activecpu),portC_in); return (portC_out & ddrC) | (portC_in & ~ddrC); } WRITE8_HANDLER( buggychl_68705_portC_w ) { -logerror("%04x: 68705 port C write %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(machine->activecpu),data); portC_out = data; } @@ -129,7 +129,7 @@ WRITE8_HANDLER( buggychl_68705_ddrC_w ) WRITE8_HANDLER( buggychl_mcu_w ) { -logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); +logerror("%04x: mcu_w %02x\n",cpu_get_pc(machine->activecpu),data); from_main = data; main_sent = 1; cpunum_set_input_line(machine, 2,0,ASSERT_LINE); @@ -137,7 +137,7 @@ logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); READ8_HANDLER( buggychl_mcu_r ) { -logerror("%04x: mcu_r %02x\n",activecpu_get_pc(),from_mcu); +logerror("%04x: mcu_r %02x\n",cpu_get_pc(machine->activecpu),from_mcu); mcu_sent = 0; return from_mcu; } @@ -148,7 +148,7 @@ READ8_HANDLER( buggychl_mcu_status_r ) /* bit 0 = when 1, mcu is ready to receive data from main cpu */ /* bit 1 = when 1, mcu has sent data to the main cpu */ -//logerror("%04x: mcu_status_r\n",activecpu_get_pc()); +//logerror("%04x: mcu_status_r\n",cpu_get_pc(machine->activecpu)); if (!main_sent) res |= 0x01; if (mcu_sent) res |= 0x02; diff --git a/src/mame/machine/cchip.c b/src/mame/machine/cchip.c index 0a013db6c6b..17b3867da9a 100644 --- a/src/mame/machine/cchip.c +++ b/src/mame/machine/cchip.c @@ -98,7 +98,7 @@ WRITE16_HANDLER( cchip1_ram_w ) } else { -logerror("cchip1_w pc: %06x bank %02x offset %04x: %02x\n",activecpu_get_pc(),current_bank,offset,data); +logerror("cchip1_w pc: %06x bank %02x offset %04x: %02x\n",cpu_get_pc(machine->activecpu),current_bank,offset,data); } } @@ -163,7 +163,7 @@ UINT16 *cchip2_ram; WRITE16_HANDLER( cchip2_word_w ) { - logerror("cchip2_w pc: %06x offset %04x: %02x\n", activecpu_get_pc(), offset, data); + logerror("cchip2_w pc: %06x offset %04x: %02x\n", cpu_get_pc(machine->activecpu), offset, data); COMBINE_DATA(&cchip2_ram[offset]); } diff --git a/src/mame/machine/chaknpop.c b/src/mame/machine/chaknpop.c index 17bac0311d5..ddd945fe278 100644 --- a/src/mame/machine/chaknpop.c +++ b/src/mame/machine/chaknpop.c @@ -73,21 +73,21 @@ static void mcu_update_seed(UINT8 data) READ8_HANDLER( chaknpop_mcu_portA_r ) { - //logerror("%04x: MCU portA read\n", activecpu_get_pc()); + //logerror("%04x: MCU portA read\n", cpu_get_pc(machine->activecpu)); return mcu_result; } READ8_HANDLER( chaknpop_mcu_portB_r ) { - //logerror("%04x: MCU portB read\n", activecpu_get_pc()); + //logerror("%04x: MCU portB read\n", cpu_get_pc(machine->activecpu)); return 0xff; } READ8_HANDLER( chaknpop_mcu_portC_r ) { - //logerror("%04x: MCU portC read\n", activecpu_get_pc()); + //logerror("%04x: MCU portC read\n", cpu_get_pc(machine->activecpu)); return 0x00; } @@ -107,7 +107,7 @@ WRITE8_HANDLER( chaknpop_mcu_portA_w ) mcu_update_seed(mcu_result); - logerror("%04x: MCU command 0x%02x, result 0x%02x\n", activecpu_get_pc(), mcu_command, mcu_result); + logerror("%04x: MCU command 0x%02x, result 0x%02x\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_result); } else if (mcu_command >= 0x28 && mcu_command <= 0x2a) { @@ -118,7 +118,7 @@ WRITE8_HANDLER( chaknpop_mcu_portA_w ) mcu_update_seed(mcu_result); - logerror("%04x: MCU command 0x%02x, result 0x%02x\n", activecpu_get_pc(), mcu_command, mcu_result); + logerror("%04x: MCU command 0x%02x, result 0x%02x\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_result); } else if (mcu_command < 0x80) { @@ -128,25 +128,25 @@ WRITE8_HANDLER( chaknpop_mcu_portA_w ) { mcu_select = mcu_command - 0x40; - logerror("%04x: MCU select 0x%02x\n", activecpu_get_pc(), mcu_select); + logerror("%04x: MCU select 0x%02x\n", cpu_get_pc(machine->activecpu), mcu_select); } } else if (mcu_command == 0x9c|| mcu_command == 0xde) { mcu_update_seed(data); - logerror("%04x: MCU command 0x%02x\n", activecpu_get_pc(), mcu_command); + logerror("%04x: MCU command 0x%02x\n", cpu_get_pc(machine->activecpu), mcu_command); } } WRITE8_HANDLER( chaknpop_mcu_portB_w ) { - //logerror("%04x: MCU portB write 0x%02x\n", activecpu_get_pc(), data); + //logerror("%04x: MCU portB write 0x%02x\n", cpu_get_pc(machine->activecpu), data); } WRITE8_HANDLER( chaknpop_mcu_portC_w ) { - //logerror("%04x: MCU portC write 0x%02x\n", activecpu_get_pc(), data); + //logerror("%04x: MCU portC write 0x%02x\n", cpu_get_pc(machine->activecpu), data); } diff --git a/src/mame/machine/cubocd32.c b/src/mame/machine/cubocd32.c index 8816aadfcd0..710ae23c811 100644 --- a/src/mame/machine/cubocd32.c +++ b/src/mame/machine/cubocd32.c @@ -641,7 +641,7 @@ static void akiko_update_cdrom( void ) if ( cmdbuf[7] == 0x80 ) { - if (LOG_AKIKO_CD) logerror( "AKIKO CD: PC:%06x Data read - start lba: %08x - end lba: %08x\n", safe_activecpu_get_pc(), startpos, endpos ); + if (LOG_AKIKO_CD) logerror( "AKIKO CD: PC:%06x Data read - start lba: %08x - end lba: %08x\n", safe_cpu_get_pc(Machine->activecpu), startpos, endpos ); akiko.cdrom_speed = (cmdbuf[8] & 0x40) ? 2 : 1; akiko.cdrom_lba_start = startpos; akiko.cdrom_lba_end = endpos; @@ -751,7 +751,7 @@ READ32_HANDLER(amiga_akiko32_r) if ( LOG_AKIKO && offset < (0x30/4) ) { - logerror( "Reading AKIKO reg %0x [%s] at PC=%06x\n", offset, get_akiko_reg_name(offset), activecpu_get_pc() ); + logerror( "Reading AKIKO reg %0x [%s] at PC=%06x\n", offset, get_akiko_reg_name(offset), cpu_get_pc(machine->activecpu) ); } switch( offset ) @@ -811,7 +811,7 @@ WRITE32_HANDLER(amiga_akiko32_w) { if ( LOG_AKIKO && offset < (0x30/4) ) { - logerror( "Writing AKIKO reg %0x [%s] with %08x at PC=%06x\n", offset, get_akiko_reg_name(offset), data, activecpu_get_pc() ); + logerror( "Writing AKIKO reg %0x [%s] with %08x at PC=%06x\n", offset, get_akiko_reg_name(offset), data, cpu_get_pc(machine->activecpu) ); } switch( offset ) diff --git a/src/mame/machine/daikaiju.c b/src/mame/machine/daikaiju.c index d8eaab3d17a..2e0c4b9f6c8 100644 --- a/src/mame/machine/daikaiju.c +++ b/src/mame/machine/daikaiju.c @@ -175,7 +175,7 @@ WRITE8_HANDLER( daikaiju_mcu_w ) case MCU_ID: SET_COMMAND(MCU_ID_LENGTH); break; default: daikaiju_command=data; - logerror("Unknown MCU command W %x %x \n",data,activecpu_get_pc()); + logerror("Unknown MCU command W %x %x \n",data,cpu_get_pc(machine->activecpu)); } } else @@ -332,7 +332,7 @@ READ8_HANDLER( daikaiju_mcu_r ) return n; } } - logerror("Unknown MCU R %x %x %x %x\n",activecpu_get_pc(), daikaiju_command, daikaiju_length, daikaiju_prev); + logerror("Unknown MCU R %x %x %x %x\n",cpu_get_pc(machine->activecpu), daikaiju_command, daikaiju_length, daikaiju_prev); return 0xff; } diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c index 8e8a3833cdb..04abebded5f 100644 --- a/src/mame/machine/dc.c +++ b/src/mame/machine/dc.c @@ -137,7 +137,7 @@ static const UINT32 maple0x82answer[]= // register decode helpers // this accepts only 32-bit accesses -INLINE int decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) +INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift) { int reg = offset * 2; @@ -146,7 +146,7 @@ INLINE int decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) // non 32-bit accesses have not yet been seen here, we need to know when they are if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff))) { - mame_printf_verbose("Wrong mask! (PC=%x)\n", activecpu_get_pc()); + mame_printf_verbose("Wrong mask! (PC=%x)\n", cpu_get_pc(machine->activecpu)); // debugger_break(Machine); } @@ -160,7 +160,7 @@ INLINE int decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) } // this accepts only 32 and 16 bit accesses -INLINE int decode_reg3216_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) +INLINE int decode_reg3216_64(running_machine *machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift) { int reg = offset * 2; @@ -170,7 +170,7 @@ INLINE int decode_reg3216_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) if ((mem_mask != U64(0x0000ffff00000000)) && (mem_mask != U64(0x000000000000ffff)) && (mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff))) { - mame_printf_verbose("Wrong mask! (PC=%x)\n", activecpu_get_pc()); + mame_printf_verbose("Wrong mask! (PC=%x)\n", cpu_get_pc(machine->activecpu)); // debugger_break(Machine); } @@ -183,7 +183,7 @@ INLINE int decode_reg3216_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift) return reg; } -int compute_interrupt_level(void) +int dc_compute_interrupt_level(running_machine *machine) { UINT32 ln,lx,le; @@ -214,7 +214,7 @@ int compute_interrupt_level(void) return 0; } -void update_interrupt_status(void) +void dc_update_interrupt_status(running_machine *machine) { int level; @@ -236,8 +236,8 @@ int level; dc_sysctrl_regs[SB_ISTNRM] &= ~IST_G1G2EXTSTAT; } - level=compute_interrupt_level(); - cpunum_set_info_int(0, CPUINFO_INT_SH4_IRLn_INPUT, 15-level); + level=dc_compute_interrupt_level(machine); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH4_IRLn_INPUT, 15-level); } READ64_HANDLER( dc_sysctrl_r ) @@ -245,12 +245,12 @@ READ64_HANDLER( dc_sysctrl_r ) int reg; UINT64 shift; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); #if DEBUG_SYSCTRL if ((reg != 0x40) && (reg != 0x41) && (reg != 0x42) && (reg != 0x23) && (reg > 2)) // filter out IRQ status reads { - mame_printf_verbose("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %llx (PC=%x)\n", 0x5f6800+reg*4, dc_sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, activecpu_get_pc()); + mame_printf_verbose("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %llx (PC=%x)\n", 0x5f6800+reg*4, dc_sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, cpu_get_pc(machine->activecpu)); } #endif @@ -265,7 +265,7 @@ WRITE64_HANDLER( dc_sysctrl_w ) UINT32 address; struct sh4_ddt_dma ddtdata; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); dat = (UINT32)(data >> shift); old = dc_sysctrl_regs[reg]; dc_sysctrl_regs[reg] = dat; // 5f6800+off*4=dat @@ -279,7 +279,7 @@ WRITE64_HANDLER( dc_sysctrl_w ) ddtdata.direction=0; ddtdata.channel=2; ddtdata.mode=25; //011001 - cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); + cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); #if DEBUG_SYSCTRL if ((address >= 0x11000000) && (address <= 0x11FFFFFF)) if (dc_sysctrl_regs[SB_LMMODE0]) @@ -321,7 +321,7 @@ WRITE64_HANDLER( dc_sysctrl_w ) #endif break; } - update_interrupt_status(); + dc_update_interrupt_status(machine); #if DEBUG_SYSCTRL if ((reg != 0x40) && (reg != 0x42) && (reg > 2)) // filter out IRQ acks and ch2 dma @@ -336,7 +336,7 @@ READ64_HANDLER( dc_maple_r ) int reg; UINT64 shift; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); #if DEBUG_MAPLE_REGS mame_printf_verbose("MAPLE: Unmapped read %08x\n", 0x5f6c00+reg*4); @@ -358,7 +358,7 @@ WRITE64_HANDLER( dc_maple_w ) int a; int off,len; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); dat = (UINT32)(data >> shift); old = maple_regs[reg]; @@ -386,7 +386,7 @@ WRITE64_HANDLER( dc_maple_w ) ddtdata.direction=0; // 0 source to buffer, 1 buffer to source ddtdata.channel= -1; // not used ddtdata.mode= -1; // copy from/to buffer - cpunum_set_info_ptr(0, CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata); maple_regs[reg] = 0; endflag=buff[0] & 0x80000000; @@ -418,7 +418,7 @@ WRITE64_HANDLER( dc_maple_w ) ddtdata.direction=0; ddtdata.channel= -1; ddtdata.mode=-1; - cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); + cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); chk=0; for (a=1;a < length;a++) { @@ -446,7 +446,7 @@ WRITE64_HANDLER( dc_maple_w ) ddtdata.direction=0; ddtdata.channel= -1; ddtdata.mode=-1; - cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); + cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); subcommand = buff[0] & 0xff; #if DEBUG_MAPLE @@ -656,7 +656,7 @@ WRITE64_HANDLER( dc_maple_w ) ddtdata.destination=destination; ddtdata.buffer=buff; ddtdata.direction=1; - cpunum_set_info_ptr(0,CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); + cpu_set_info_ptr(machine->cpu[0],CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,&ddtdata); if (endflag) { @@ -733,7 +733,7 @@ READ64_HANDLER( dc_g1_ctrl_r ) int reg; UINT64 shift; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); mame_printf_verbose("G1CTRL: Unmapped read %08x\n", 0x5f7400+reg*4); return (UINT64)g1bus_regs[reg] << shift; } @@ -746,7 +746,7 @@ WRITE64_HANDLER( dc_g1_ctrl_w ) struct sh4_ddt_dma ddtdata; UINT8 *ROM = (UINT8 *)memory_region(machine, "user1"); - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); dat = (UINT32)(data >> shift); old = g1bus_regs[reg]; @@ -770,7 +770,7 @@ WRITE64_HANDLER( dc_g1_ctrl_w ) ddtdata.channel= -1; // not used ddtdata.mode= -1; // copy from/to buffer mame_printf_verbose("G1CTRL: transfer %x from ROM %08x to sdram %08x\n", g1bus_regs[SB_GDLEN], dma_offset, g1bus_regs[SB_GDSTAR]); - cpunum_set_info_ptr(0, CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA, &ddtdata); g1bus_regs[SB_GDST]=0; dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_GDROM; } @@ -783,7 +783,7 @@ READ64_HANDLER( dc_g2_ctrl_r ) int reg; UINT64 shift; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); mame_printf_verbose("G2CTRL: Unmapped read %08x\n", 0x5f7800+reg*4); return 0; } @@ -794,7 +794,7 @@ WRITE64_HANDLER( dc_g2_ctrl_w ) UINT64 shift; UINT32 dat; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); dat = (UINT32)(data >> shift); switch (reg) { @@ -813,7 +813,7 @@ READ64_HANDLER( dc_modem_r ) int reg; UINT64 shift; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); // from ElSemi: this makes Atomiswave do it's "verbose boot" with a Sammy logo and diagnostics instead of just running the cart. // our PVR emulation is apparently not good enough for that to work yet though. @@ -832,7 +832,7 @@ WRITE64_HANDLER( dc_modem_w ) UINT64 shift; UINT32 dat; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); dat = (UINT32)(data >> shift); mame_printf_verbose("MODEM: [%08x=%x] write %llx to %x, mask %llx\n", 0x600000+reg*4, dat, data, offset, mem_mask); } @@ -842,7 +842,7 @@ READ64_HANDLER( dc_rtc_r ) int reg; UINT64 shift; - reg = decode_reg3216_64(offset, mem_mask, &shift); + reg = decode_reg3216_64(machine, offset, mem_mask, &shift); mame_printf_verbose("RTC: Unmapped read %08x\n", 0x710000+reg*4); return (UINT64)dc_rtcregister[reg] << shift; } @@ -853,7 +853,7 @@ WRITE64_HANDLER( dc_rtc_w ) UINT64 shift; UINT32 old,dat; - reg = decode_reg3216_64(offset, mem_mask, &shift); + reg = decode_reg3216_64(machine, offset, mem_mask, &shift); dat = (UINT32)(data >> shift); old = dc_rtcregister[reg]; dc_rtcregister[reg] = dat & 0xFFFF; // 5f6c00+off*4=dat @@ -920,7 +920,7 @@ READ64_HANDLER( dc_aica_reg_r ) int reg; UINT64 shift; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); // mame_printf_verbose("AICA REG: [%08x] read %llx, mask %llx\n", 0x700000+reg*4, (UINT64)offset, mem_mask); @@ -933,7 +933,7 @@ WRITE64_HANDLER( dc_aica_reg_w ) UINT64 shift; UINT32 dat; - reg = decode_reg32_64(offset, mem_mask, &shift); + reg = decode_reg32_64(machine, offset, mem_mask, &shift); dat = (UINT32)(data >> shift); if (reg == (0x2c00/4)) diff --git a/src/mame/machine/dec0.c b/src/mame/machine/dec0.c index db81b80fd5e..4b96d5b075b 100644 --- a/src/mame/machine/dec0.c +++ b/src/mame/machine/dec0.c @@ -28,11 +28,11 @@ READ16_HANDLER( dec0_controls_r ) return input_port_read(machine, "DSW"); case 8: /* Intel 8751 mc, Bad Dudes & Heavy Barrel only */ - //logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n", activecpu_get_pc(), 0x30c000+offset); + //logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n", cpu_get_pc(machine->activecpu), 0x30c000+offset); return i8751_return; } - logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n", activecpu_get_pc(), 0x30c000+offset); + logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n", cpu_get_pc(machine->activecpu), 0x30c000+offset); return ~0; } @@ -80,7 +80,7 @@ READ16_HANDLER( midres_controls_r ) return 0; /* ?? watchdog ?? */ } - logerror("PC %06x unknown control read at %02x\n", activecpu_get_pc(), 0x180000+offset); + logerror("PC %06x unknown control read at %02x\n", cpu_get_pc(machine->activecpu), 0x180000+offset); return ~0; } @@ -114,7 +114,7 @@ READ16_HANDLER( slyspy_protection_r ) case 6: return 0x2; } - logerror("%04x, Unknown protection read at 30c000 %d\n", activecpu_get_pc(), offset); + logerror("%04x, Unknown protection read at 30c000 %d\n", cpu_get_pc(machine->activecpu), offset); return 0; } @@ -177,7 +177,7 @@ WRITE16_HANDLER( slyspy_240000_w ) else if (offset<0x10) dec0_pf2_control_1_w(machine,offset-0x8,data,mem_mask); return; } - logerror("Wrote to 240000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); + logerror("Wrote to 240000 %02x at %04x %04x (Trap %02x)\n",offset,cpu_get_pc(machine->activecpu),data,slyspy_state); } WRITE16_HANDLER( slyspy_242000_w ) @@ -191,7 +191,7 @@ WRITE16_HANDLER( slyspy_242000_w ) else if (offset<0x300) COMBINE_DATA(&dec0_pf2_rowscroll[offset-0x200]); return; } - logerror("Wrote to 242000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); + logerror("Wrote to 242000 %02x at %04x %04x (Trap %02x)\n",offset,cpu_get_pc(machine->activecpu),data,slyspy_state); } WRITE16_HANDLER( slyspy_246000_w ) @@ -201,7 +201,7 @@ WRITE16_HANDLER( slyspy_246000_w ) dec0_pf2_data_w(machine,offset,data,mem_mask); return; } - logerror("Wrote to 246000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); + logerror("Wrote to 246000 %02x at %04x %04x (Trap %02x)\n",offset,cpu_get_pc(machine->activecpu),data,slyspy_state); } WRITE16_HANDLER( slyspy_248000_w ) @@ -218,7 +218,7 @@ WRITE16_HANDLER( slyspy_248000_w ) else if (offset<0x10) dec0_pf1_control_1_w(machine,offset-0x8,data,mem_mask); return; } - logerror("Wrote to 248000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); + logerror("Wrote to 248000 %02x at %04x %04x (Trap %02x)\n",offset,cpu_get_pc(machine->activecpu),data,slyspy_state); } WRITE16_HANDLER( slyspy_24c000_w ) @@ -232,7 +232,7 @@ WRITE16_HANDLER( slyspy_24c000_w ) else if (offset<0x300) COMBINE_DATA(&dec0_pf1_rowscroll[offset-0x200]); return; } - logerror("Wrote to 24c000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); + logerror("Wrote to 24c000 %02x at %04x %04x (Trap %02x)\n",offset,cpu_get_pc(machine->activecpu),data,slyspy_state); } WRITE16_HANDLER( slyspy_24e000_w ) @@ -243,7 +243,7 @@ WRITE16_HANDLER( slyspy_24e000_w ) dec0_pf1_data_w(machine,offset,data,mem_mask); return; } - logerror("Wrote to 24e000 %02x at %04x %04x (Trap %02x)\n",offset,activecpu_get_pc(),data,slyspy_state); + logerror("Wrote to 24e000 %02x at %04x %04x (Trap %02x)\n",offset,cpu_get_pc(machine->activecpu),data,slyspy_state); } /******************************************************************************/ @@ -331,7 +331,7 @@ static void hbarrel_i8751_write(int data) break; case 0x06: /* Controls appearance & placement of special weapons */ i8751_return=weapons_table[level][data&0x1f]; - //logerror("CPU #0 PC %06x: warning - write %02x to i8751, returning %04x\n",activecpu_get_pc(),data,i8751_return); + //logerror("CPU #0 PC %06x: warning - write %02x to i8751, returning %04x\n",cpu_get_pc(machine->activecpu),data,i8751_return); break; case 0xb: /* Initialise the variables? */ i8751_return=0; @@ -358,10 +358,10 @@ static void hbarrel_i8751_write(int data) /* We have to use a state as the microcontroller remembers previous commands */ } -//logerror("CPU #0 PC %06x: warning - write %02x to i8751\n",activecpu_get_pc(),data); +//logerror("CPU #0 PC %06x: warning - write %02x to i8751\n",cpu_get_pc(machine->activecpu),data); } -static void baddudes_i8751_write(int data) +static void baddudes_i8751_write(running_machine *machine, int data) { i8751_return=0; @@ -384,10 +384,10 @@ static void baddudes_i8751_write(int data) case 0x75b: i8751_return=0x70f; break; } - if (!i8751_return) logerror("%04x: warning - write unknown command %02x to 8571\n",activecpu_get_pc(),data); + if (!i8751_return) logerror("%04x: warning - write unknown command %02x to 8571\n",cpu_get_pc(machine->activecpu),data); } -static void birdtry_i8751_write(int data) +static void birdtry_i8751_write(running_machine *machine, int data) { static int pwr, hgt; @@ -453,7 +453,7 @@ static void birdtry_i8751_write(int data) /*These are activated after a shot (???)*/ case 0x6ca: i8751_return = 0xff; break; case 0x7ff: i8751_return = 0x200; break; - default: logerror("%04x: warning - write unknown command %02x to 8571\n",activecpu_get_pc(),data); + default: logerror("%04x: warning - write unknown command %02x to 8571\n",cpu_get_pc(machine->activecpu),data); } } @@ -474,8 +474,8 @@ void dec0_i8751_write(running_machine *machine, int data) { /* Writes to this address cause an IRQ to the i8751 microcontroller */ if (GAME==1) hbarrel_i8751_write(data); - if (GAME==2) baddudes_i8751_write(data); - if (GAME==3) birdtry_i8751_write(data); + if (GAME==2) baddudes_i8751_write(machine, data); + if (GAME==3) birdtry_i8751_write(machine, data); cpunum_set_input_line(machine, 0,5,HOLD_LINE); @@ -494,7 +494,7 @@ See the code about 0xb60 (USA version) */ -logerror("CPU #0 PC %06x: warning - write %02x to i8751\n",activecpu_get_pc(),data); +logerror("CPU #0 PC %06x: warning - write %02x to i8751\n",cpu_get_pc(machine->activecpu),data); } @@ -514,14 +514,14 @@ static WRITE16_HANDLER( sprite_mirror_w ) static READ16_HANDLER( robocop_68000_share_r ) { -//logerror("%08x: Share read %04x\n",activecpu_get_pc(),offset); +//logerror("%08x: Share read %04x\n",cpu_get_pc(machine->activecpu),offset); return robocop_shared_ram[offset]; } static WRITE16_HANDLER( robocop_68000_share_w ) { -// logerror("%08x: Share write %04x %04x\n",activecpu_get_pc(),offset,data); +// logerror("%08x: Share write %04x %04x\n",cpu_get_pc(machine->activecpu),offset,data); robocop_shared_ram[offset]=data&0xff; diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c index 1a4bd035a63..ddf9e04ad80 100644 --- a/src/mame/machine/decocass.c +++ b/src/mame/machine/decocass.c @@ -103,7 +103,7 @@ WRITE8_HANDLER( decocass_coin_counter_w ) WRITE8_HANDLER( decocass_sound_command_w ) { - LOG(2,("CPU #%d sound command -> $%02x\n", cpu_getactivecpu(), data)); + LOG(2,("CPU #%d sound command -> $%02x\n", cpunum_get_active(), data)); soundlatch_w(machine,0,data); decocass_sound_ack |= 0x80; /* remove snd cpu data ack bit. i don't see it in the schems, but... */ @@ -114,20 +114,20 @@ WRITE8_HANDLER( decocass_sound_command_w ) READ8_HANDLER( decocass_sound_data_r ) { UINT8 data = soundlatch2_r(machine, 0); - LOG(2,("CPU #%d sound data <- $%02x\n", cpu_getactivecpu(), data)); + LOG(2,("CPU #%d sound data <- $%02x\n", cpunum_get_active(), data)); return data; } READ8_HANDLER( decocass_sound_ack_r ) { UINT8 data = decocass_sound_ack; /* D6+D7 */ - LOG(4,("CPU #%d sound ack <- $%02x\n", cpu_getactivecpu(), data)); + LOG(4,("CPU #%d sound ack <- $%02x\n", cpunum_get_active(), data)); return data; } WRITE8_HANDLER( decocass_sound_data_w ) { - LOG(2,("CPU #%d sound data -> $%02x\n", cpu_getactivecpu(), data)); + LOG(2,("CPU #%d sound data -> $%02x\n", cpunum_get_active(), data)); soundlatch2_w(machine, 0, data); decocass_sound_ack |= 0x40; } @@ -135,7 +135,7 @@ WRITE8_HANDLER( decocass_sound_data_w ) READ8_HANDLER( decocass_sound_command_r ) { UINT8 data = soundlatch_r(machine, 0); - LOG(4,("CPU #%d sound command <- $%02x\n", cpu_getactivecpu(), data)); + LOG(4,("CPU #%d sound command <- $%02x\n", cpunum_get_active(), data)); cpunum_set_input_line(machine, 1, M6502_IRQ_LINE, CLEAR_LINE); decocass_sound_ack &= ~0x80; return data; @@ -148,14 +148,14 @@ static TIMER_CALLBACK( decocass_sound_nmi_pulse ) WRITE8_HANDLER( decocass_sound_nmi_enable_w ) { - LOG(2,("CPU #%d sound NMI enb -> $%02x\n", cpu_getactivecpu(), data)); + LOG(2,("CPU #%d sound NMI enb -> $%02x\n", cpunum_get_active(), data)); timer_adjust_periodic(decocass_sound_timer, ATTOTIME_IN_HZ(256 * 57 / 8 / 2), 0, ATTOTIME_IN_HZ(256 * 57 / 8 / 2)); } READ8_HANDLER( decocass_sound_nmi_enable_r ) { UINT8 data = 0xff; - LOG(2,("CPU #%d sound NMI enb <- $%02x\n", cpu_getactivecpu(), data)); + LOG(2,("CPU #%d sound NMI enb <- $%02x\n", cpunum_get_active(), data)); timer_adjust_periodic(decocass_sound_timer, ATTOTIME_IN_HZ(256 * 57 / 8 / 2), 0, ATTOTIME_IN_HZ(256 * 57 / 8 / 2)); return data; } @@ -163,14 +163,14 @@ READ8_HANDLER( decocass_sound_nmi_enable_r ) READ8_HANDLER( decocass_sound_data_ack_reset_r ) { UINT8 data = 0xff; - LOG(2,("CPU #%d sound ack rst <- $%02x\n", cpu_getactivecpu(), data)); + LOG(2,("CPU #%d sound ack rst <- $%02x\n", cpunum_get_active(), data)); decocass_sound_ack &= ~0x40; return data; } WRITE8_HANDLER( decocass_sound_data_ack_reset_w ) { - LOG(2,("CPU #%d sound ack rst -> $%02x\n", cpu_getactivecpu(), data)); + LOG(2,("CPU #%d sound ack rst -> $%02x\n", cpunum_get_active(), data)); decocass_sound_ack &= ~0x40; } @@ -280,7 +280,7 @@ READ8_HANDLER( decocass_input_r ) WRITE8_HANDLER( decocass_reset_w ) { - LOG(1,("%9.7f 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(1,("%9.7f 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); decocass_reset = data; /* CPU #1 active hight reset */ @@ -593,13 +593,13 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r ) if (1 == (offset & 1)) { if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_STAT); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); else data = 0xff; data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c; LOG(4,("%9.7f 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data & 1) ? "OBF" : "-", (data & 2) ? "IBF" : "-")); } @@ -623,7 +623,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r ) } if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_DATA); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); else data = 0xff; @@ -647,7 +647,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_3_inv_2_r ) (((prom[promaddr] >> 4) & 1) << MAP7(type1_outmap)); LOG(3,("%9.7f 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); latch1 = save; /* latch the data for the next A0 == 0 read */ } @@ -672,13 +672,13 @@ static READ8_HANDLER( decocass_type1_pass_136_r ) if (1 == (offset & 1)) { if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_STAT); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); else data = 0xff; data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c; LOG(4,("%9.7f 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x <- (%s %s)\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data & 1) ? "OBF" : "-", (data & 2) ? "IBF" : "-")); } @@ -702,7 +702,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r ) } if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_DATA); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); else data = 0xff; @@ -726,7 +726,7 @@ static READ8_HANDLER( decocass_type1_pass_136_r ) (((prom[promaddr] >> 4) & 1) << MAP7(type1_outmap)); LOG(3,("%9.7f 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); latch1 = save; /* latch the data for the next A0 == 0 read */ } @@ -751,13 +751,13 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r ) if (1 == (offset & 1)) { if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_STAT); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); else data = 0xff; data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c; LOG(4,("%9.7f 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data & 1) ? "OBF" : "-", (data & 2) ? "IBF" : "-")); } @@ -781,7 +781,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r ) } if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_DATA); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); else data = 0xff; @@ -805,7 +805,7 @@ static READ8_HANDLER( decocass_type1_latch_27_pass_3_inv_2_r ) (((latch1 >> MAP7(type1_inmap)) & 1) << MAP7(type1_outmap)); LOG(3,("%9.7f 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); latch1 = save; /* latch the data for the next A0 == 0 read */ } @@ -830,13 +830,13 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r ) if (1 == (offset & 1)) { if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_STAT); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); else data = 0xff; data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c; LOG(4,("%9.7f 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x <- (%s %s)\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data & 1) ? "OBF" : "-", (data & 2) ? "IBF" : "-")); } @@ -860,7 +860,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r ) } if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_DATA); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); else data = 0xff; @@ -884,7 +884,7 @@ static READ8_HANDLER( decocass_type1_latch_26_pass_5_inv_2_r ) (((prom[promaddr] >> 4) & 1) << MAP7(type1_outmap)); LOG(3,("%9.7f 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); latch1 = save; /* latch the data for the next A0 == 0 read */ } @@ -911,13 +911,13 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r ) if (1 == (offset & 1)) { if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_STAT); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); else data = 0xff; data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c; LOG(4,("%9.7f 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x <- (%s %s)\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data & 1) ? "OBF" : "-", (data & 2) ? "IBF" : "-")); } @@ -941,7 +941,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r ) } if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, I8X41_DATA); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); else data = 0xff; @@ -965,7 +965,7 @@ static READ8_HANDLER( decocass_type1_latch_16_pass_3_inv_1_r ) (((prom[promaddr] >> 4) & 1) << MAP7(type1_outmap)); LOG(3,("%9.7f 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x\n", - attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); latch1 = save; /* latch the data for the next A0 == 0 read */ } @@ -994,7 +994,7 @@ static READ8_HANDLER( decocass_type2_r ) { UINT8 *prom = memory_region(machine, "user1"); data = prom[256 * type2_d2_latch + type2_promaddr]; - LOG(3,("%9.7f 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, 256 * type2_d2_latch + type2_promaddr)); + LOG(3,("%9.7f 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, 256 * type2_d2_latch + type2_promaddr)); } else { @@ -1004,11 +1004,11 @@ static READ8_HANDLER( decocass_type2_r ) else { if (0 == (offset & E5XX_MASK)) - data = cpunum_get_reg(2, offset & 1 ? I8X41_STAT : I8X41_DATA); + data = cpu_get_reg(machine->cpu[2], offset & 1 ? I8X41_STAT : I8X41_DATA); else data = offset & 0xff; - LOG(3,("%9.7f 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, offset & 1 ? "STATUS" : "DATA")); + LOG(3,("%9.7f 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, offset & 1 ? "STATUS" : "DATA")); } return data; } @@ -1019,18 +1019,18 @@ static WRITE8_HANDLER( decocass_type2_w ) { if (1 == (offset & 1)) { - LOG(4,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(4,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } else { type2_promaddr = data; - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, type2_promaddr)); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, type2_promaddr)); return; } } else { - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, offset & 1 ? "8041-CMND" : "8041 DATA")); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, offset & 1 ? "8041-CMND" : "8041 DATA")); } if (1 == (offset & 1)) { @@ -1041,7 +1041,7 @@ static WRITE8_HANDLER( decocass_type2_w ) LOG(3,("PROM:%s D2:%d", type2_xx_latch ? "on" : "off", type2_d2_latch)); } } - cpunum_set_reg(2, offset & 1 ? I8X41_CMND : I8X41_DATA, data); + cpu_set_reg(machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data); #ifdef MAME_DEBUG decocass_fno(offset, data); @@ -1074,7 +1074,7 @@ static READ8_HANDLER( decocass_type3_r ) { UINT8 *prom = memory_region(machine, "user1"); data = prom[type3_ctrs]; - LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, type3_ctrs)); + LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, type3_ctrs)); if (++type3_ctrs == 4096) type3_ctrs = 0; } @@ -1082,13 +1082,13 @@ static READ8_HANDLER( decocass_type3_r ) { if (0 == (offset & E5XX_MASK)) { - data = cpunum_get_reg(2, I8X41_STAT); - LOG(4,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); + LOG(4,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } else { data = 0xff; /* open data bus? */ - LOG(4,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(4,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } } } @@ -1097,13 +1097,13 @@ static READ8_HANDLER( decocass_type3_r ) if (1 == type3_pal_19) { save = data = 0xff; /* open data bus? */ - LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } else { if (0 == (offset & E5XX_MASK)) { - save = cpunum_get_reg(2, I8X41_DATA); + save = cpu_get_reg(machine->cpu[2], I8X41_DATA); switch (type3_swap) { case TYPE3_SWAP_01: @@ -1228,7 +1228,7 @@ static READ8_HANDLER( decocass_type3_r ) (BIT7(save) << 7); } type3_d0_latch = save & 1; - LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, (data >= 32) ? data : '.')); + LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data >= 32) ? data : '.')); } else { @@ -1242,7 +1242,7 @@ static READ8_HANDLER( decocass_type3_r ) (BIT5(save) << 5) | (BIT6(save) << 7) | (BIT7(save) << 6); - LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, (data >= 32) ? data : '.')); + LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data >= 32) ? data : '.')); type3_d0_latch = save & 1; } } @@ -1258,7 +1258,7 @@ static WRITE8_HANDLER( decocass_type3_w ) if (1 == type3_pal_19) { type3_ctrs = data << 4; - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, "LDCTRS")); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, "LDCTRS")); return; } else @@ -1270,12 +1270,12 @@ static WRITE8_HANDLER( decocass_type3_w ) if (1 == type3_pal_19) { /* write nowhere?? */ - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, "nowhere?")); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, "nowhere?")); return; } } - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA")); - cpunum_set_reg(2, offset & 1 ? I8X41_CMND : I8X41_DATA, data); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA")); + cpu_set_reg(machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data); } /*************************************************************************** @@ -1298,13 +1298,13 @@ static READ8_HANDLER( decocass_type4_r ) { if (0 == (offset & E5XX_MASK)) { - data = cpunum_get_reg(2, I8X41_STAT); - LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); + LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } else { data = 0xff; /* open data bus? */ - LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } } else @@ -1314,20 +1314,20 @@ static READ8_HANDLER( decocass_type4_r ) UINT8 *prom = memory_region(machine, "user1"); data = prom[type4_ctrs]; - LOG(3,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, (data >= 32) ? data : '.', type4_ctrs)); + LOG(3,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data >= 32) ? data : '.', type4_ctrs)); type4_ctrs = (type4_ctrs+1) & 0x7fff; } else { if (0 == (offset & E5XX_MASK)) { - data = cpunum_get_reg(2, I8X41_DATA); - LOG(3,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, (data >= 32) ? data : '.')); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); + LOG(3,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data >= 32) ? data : '.')); } else { data = 0xff; /* open data bus? */ - LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } } } @@ -1342,7 +1342,7 @@ static WRITE8_HANDLER( decocass_type4_w ) if (1 == type4_latch) { type4_ctrs = (type4_ctrs & 0x00ff) | ((data & 0x7f) << 8); - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, type4_ctrs)); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, type4_ctrs)); return; } else @@ -1356,12 +1356,12 @@ static WRITE8_HANDLER( decocass_type4_w ) if (type4_latch) { type4_ctrs = (type4_ctrs & 0xff00) | data; - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, type4_ctrs)); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, type4_ctrs)); return; } } - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA")); - cpunum_set_reg(2, offset & 1 ? I8X41_CMND : I8X41_DATA, data); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA")); + cpu_set_reg(machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data); } /*************************************************************************** @@ -1381,13 +1381,13 @@ static READ8_HANDLER( decocass_type5_r ) { if (0 == (offset & E5XX_MASK)) { - data = cpunum_get_reg(2, I8X41_STAT); - LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); + LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } else { data = 0xff; /* open data bus? */ - LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } } else @@ -1395,19 +1395,19 @@ static READ8_HANDLER( decocass_type5_r ) if (type5_latch) { data = 0x55; /* Only a fixed value? It looks like this is all we need to do */ - LOG(3,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, (data >= 32) ? data : '.')); + LOG(3,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data >= 32) ? data : '.')); } else { if (0 == (offset & E5XX_MASK)) { - data = cpunum_get_reg(2, I8X41_DATA); - LOG(3,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, (data >= 32) ? data : '.')); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); + LOG(3,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data >= 32) ? data : '.')); } else { data = 0xff; /* open data bus? */ - LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } } } @@ -1421,7 +1421,7 @@ static WRITE8_HANDLER( decocass_type5_w ) { if (1 == type5_latch) { - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, "latch #2??")); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, "latch #2??")); return; } else @@ -1433,12 +1433,12 @@ static WRITE8_HANDLER( decocass_type5_w ) if (type5_latch) { /* write nowhere?? */ - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, "nowhere?")); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, "nowhere?")); return; } } - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA")); - cpunum_set_reg(2, offset & 1 ? I8X41_CMND : I8X41_DATA, data); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA")); + cpu_set_reg(machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data); } /*************************************************************************** @@ -1457,26 +1457,26 @@ static READ8_HANDLER( decocass_nodong_r ) { if (0 == (offset & E5XX_MASK)) { - data = cpunum_get_reg(2, I8X41_STAT); - LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); + LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } else { data = 0xff; /* open data bus? */ - LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } } else { if (0 == (offset & E5XX_MASK)) { - data = cpunum_get_reg(2, I8X41_DATA); - LOG(3,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, (data >= 32) ? data : '.')); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); + LOG(3,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, (data >= 32) ? data : '.')); } else { data = 0xff; /* open data bus? */ - LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } } @@ -1508,7 +1508,7 @@ READ8_HANDLER( decocass_e5xx_r ) LOG(4,("%9.7f 6502-PC: %04x decocass_e5xx_r(%02x): $%02x <- STATUS (%s%s%s%s%s%s%s%s)\n", attotime_to_double(timer_get_time()), - activecpu_get_previouspc(), + cpu_get_previouspc(machine->activecpu), offset, data, data & 0x01 ? "" : "REQ/", data & 0x02 ? "" : " FNO/", @@ -1539,15 +1539,15 @@ WRITE8_HANDLER( decocass_e5xx_w ) if (0 == (offset & E5XX_MASK)) { - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA")); - cpunum_set_reg(2, offset & 1 ? I8X41_CMND : I8X41_DATA, data); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA")); + cpu_set_reg(machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data); #ifdef MAME_DEBUG decocass_fno(offset, data); #endif } else { - LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), offset, data)); + LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", attotime_to_double(timer_get_time()), cpu_get_previouspc(machine->activecpu), offset, data)); } } @@ -1995,7 +1995,7 @@ WRITE8_HANDLER( i8041_p1_w ) { LOG(4,("%9.7f 8041-PC: %03x i8041_p1_w: $%02x (%s%s%s%s%s%s%s%s)\n", attotime_to_double(timer_get_time()), - activecpu_get_previouspc(), + cpu_get_previouspc(machine->activecpu), data, data & 0x01 ? "" : "DATA-WRT", data & 0x02 ? "" : " DATA-CLK", @@ -2087,7 +2087,7 @@ READ8_HANDLER( i8041_p1_r ) { LOG(4,("%9.7f 8041-PC: %03x i8041_p1_r: $%02x (%s%s%s%s%s%s%s%s)\n", attotime_to_double(timer_get_time()), - activecpu_get_previouspc(), + cpu_get_previouspc(machine->activecpu), data, data & 0x01 ? "" : "DATA-WRT", data & 0x02 ? "" : " DATA-CLK", @@ -2110,7 +2110,7 @@ WRITE8_HANDLER( i8041_p2_w ) { LOG(4,("%9.7f 8041-PC: %03x i8041_p2_w: $%02x (%s%s%s%s%s%s%s%s)\n", attotime_to_double(timer_get_time()), - activecpu_get_previouspc(), + cpu_get_previouspc(machine->activecpu), data, data & 0x01 ? "" : "FNO/", data & 0x02 ? "" : " EOT/", @@ -2138,7 +2138,7 @@ READ8_HANDLER( i8041_p2_r ) { LOG(4,("%9.7f 8041-PC: %03x i8041_p2_r: $%02x (%s%s%s%s%s%s%s%s)\n", attotime_to_double(timer_get_time()), - activecpu_get_previouspc(), + cpu_get_previouspc(machine->activecpu), data, data & 0x01 ? "" : "FNO/", data & 0x02 ? "" : " EOT/", diff --git a/src/mame/machine/decoprot.c b/src/mame/machine/decoprot.c index f589ddc2b9e..c3afe6aa6e2 100644 --- a/src/mame/machine/decoprot.c +++ b/src/mame/machine/decoprot.c @@ -119,7 +119,7 @@ WRITE16_HANDLER( deco16_104_prot_w ) /* Wizard Fire */ && offset!=(0x370>>1) && offset!=(0x3c0>>1) && offset!=(0x430>>1) && offset!=(0x460>>1) && offset!=(0x5a0>>1) && offset!=(0x5b0>>1) && offset!=(0x6e0>>1) && offset!=(0x7d0>>1) ) - logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",activecpu_get_pc(),offset<<1,data); + logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",cpu_get_pc(machine->activecpu),offset<<1,data); COMBINE_DATA(&deco16_prot_ram[offset]); } @@ -218,7 +218,7 @@ READ16_HANDLER( deco16_104_prot_r ) /* Wizard Fire */ return ((deco16_prot_ram[0x460/2]&0x0007)<<13) | ((deco16_prot_ram[0x460/2]&0x0008)<<9); } - logerror("Deco Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset<<1); + logerror("Deco Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return 0; } @@ -245,7 +245,7 @@ if (offset!=0x32 && offset!=0x36/2 && offset!=0x9e/2 && offset!=0x76/2 && offset!=0x40/2 && offset!=0x54/2 && offset!=0x56/2 && offset!=0x58/2 && offset!=0x6a/2 && offset!=0x2c/2 && offset!=0 && offset!=0x34 && offset!=0x8a && offset!=0x8e && offset!=0x92 && offset!=0x96 ) -logerror("Protection PC %06x: warning - write %04x to %04x\n",activecpu_get_pc(),data,offset<<1); +logerror("Protection PC %06x: warning - write %04x to %04x\n",cpu_get_pc(machine->activecpu),data,offset<<1); } @@ -405,7 +405,7 @@ READ16_HANDLER( deco16_60_prot_r ) /* Edward Randy */ return ((deco16_prot_ram[0x32/2]&0x00f0)<<8) | ((deco16_prot_ram[0x32/2]&0x000e)<<7) | ((deco16_prot_ram[0x32/2]&0x0001)<<11); } - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset*2); + logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(machine->activecpu),offset*2); return 0; } @@ -449,7 +449,7 @@ WRITE16_HANDLER( deco16_66_prot_w ) /* Mutant Fighter */ && offset!=0xb6 && offset!=0xfa && offset!=0xe4 && offset!=0x3a && offset!=0x1e && offset!=0x38 && offset!=0x92 && offset!=0xa2 && offset!=0x308 && offset!=0x40e ) - logerror("Protection PC %06x: warning - write %04x to %04x\n",activecpu_get_pc(),data,offset); + logerror("Protection PC %06x: warning - write %04x to %04x\n",cpu_get_pc(machine->activecpu),data,offset); } READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */ @@ -547,7 +547,7 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */ { int ret=mutantf_port_0e_hack; mutantf_port_0e_hack=0x800; - //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",activecpu_get_pc(),offset<<1); + //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return ret; } @@ -555,7 +555,7 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */ { int ret=mutantf_port_6a_hack; mutantf_port_6a_hack=0x2866; - //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",activecpu_get_pc(),offset<<1); + //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return ret; } @@ -563,20 +563,20 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */ { int ret=mutantf_port_e8_hack; mutantf_port_e8_hack=0x2401; - //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",activecpu_get_pc(),offset<<1); + //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return ret; } case 0xaa: /* ??? */ - //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",activecpu_get_pc(),offset<<1); + //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return 0xc080; case 0x42: /* Strange, but consistent */ - //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",activecpu_get_pc(),offset<<1); + //logerror("Protection PC %06x: warning - read unknown memory address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return deco16_prot_ram[0x2c/2]^0x5302; case 0x48: /* Correct for test data, but I wonder if the 0x1800 is from an address, not a constant */ - //logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset<<1); + //logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return (0x1800) & (~deco16_prot_ram[0x36/2]); case 0x52: @@ -593,7 +593,7 @@ READ16_HANDLER( deco16_66_prot_r ) /* Mutant Fighter */ popmessage("Deco66: Read unmapped port %04x\n",offset*2); #endif - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset<<1); + logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return 0; } @@ -653,7 +653,7 @@ READ16_HANDLER( deco16_104_cninja_prot_r ) return input_port_read(machine, "IN0"); } - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",activecpu_get_pc(),offset); + logerror("Protection PC %06x: warning - read unmapped memory address %04x\n",cpu_get_pc(machine->activecpu),offset); return 0; } @@ -747,8 +747,8 @@ READ16_HANDLER( deco16_146_funkyjet_prot_r ) return input_port_read(machine, "DSW"); } - if (activecpu_get_pc()!=0xc0ea) - logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", activecpu_get_pc(), offset<<1, input_port_read(machine, "P1")); + if (cpu_get_pc(machine->activecpu)!=0xc0ea) + logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", cpu_get_pc(machine->activecpu), offset<<1, input_port_read(machine, "P1")); return 0; } @@ -796,11 +796,11 @@ WRITE16_HANDLER( deco16_104_rohga_prot_w ) offset=offset*2; - //logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",activecpu_get_pc(),offset,data); + //logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",cpu_get_pc(machine->activecpu),offset,data); if (offset==0xee || offset==0x42 || offset==0xa8) return; -// logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",activecpu_get_pc(),offset,data); +// logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",cpu_get_pc(machine->activecpu),offset,data); #if 1 // 66 7c 7e 28 58 4a 9e @@ -817,7 +817,7 @@ WRITE16_HANDLER( deco16_104_rohga_prot_w ) return; // if (offset==0x3c) -// logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",activecpu_get_pc(),offset,data); +// logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",cpu_get_pc(machine->activecpu),offset,data); // Actually read: // 22 24 26 2c 2e 30 32 3c 40 44 46 48 60 62 66 6a 6e 76 7e 80 82 84 86 88 8a 8c 90 94 96 98 9a 9c a0 c0 c4 c6 c8 cc ce d6 dc de @@ -845,7 +845,7 @@ WRITE16_HANDLER( deco16_104_rohga_prot_w ) return; #endif - logerror("CONTROL PC %06x: warning - write unmapped protection memory address %04x %04x\n",activecpu_get_pc(),offset,data); + logerror("CONTROL PC %06x: warning - write unmapped protection memory address %04x %04x\n",cpu_get_pc(machine->activecpu),offset,data); } READ16_HANDLER( deco16_104_rohga_prot_r ) @@ -853,7 +853,7 @@ READ16_HANDLER( deco16_104_rohga_prot_r ) const UINT16* prot_ram=decoprot_buffer_ram_selected ? decoprot_buffer_ram : deco16_prot_ram; // if (offset!=0x88/2 && offset!=0x44c/2 && offset!=0x36c/2 && offset!=0x292/2) -// logerror("Protection PC %06x: warning - read prot address %04x\n",activecpu_get_pc(),offset<<1); +// logerror("Protection PC %06x: warning - read prot address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); switch (offset) { case 0x88/2: /* Player 1 & 2 input ports */ @@ -1198,7 +1198,7 @@ READ16_HANDLER( deco16_104_rohga_prot_r ) return DECO_PORT(0x58); } - logerror("Protection PC %06x: warning - read unmapped protection address %04x\n",activecpu_get_pc(),offset<<1); + logerror("Protection PC %06x: warning - read unmapped protection address %04x\n",cpu_get_pc(machine->activecpu),offset<<1); return 0; } @@ -1228,7 +1228,7 @@ static WRITE16_HANDLER( deco16_146_core_prot_w ) COMBINE_DATA(&decoprot_buffer_ram[offset>>1]); // if (offset!=0x5e0 && offset!=0x340 && offset!=0 && offset!=0x3d0 && offset!=0x280) -// logerror("%08x: Write protection port %04x, data %04x (%08x)\n", activecpu_get_pc(), offset, data, mem_mask); +// logerror("%08x: Write protection port %04x, data %04x (%08x)\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } static READ16_HANDLER( deco16_146_core_prot_r ) @@ -1626,7 +1626,7 @@ static READ16_HANDLER( deco16_146_core_prot_r ) return val & (~deco16_mask); } - //logerror("Protection PC %06x: warning - read fully unmapped protection address %04x\n", activecpu_get_pc(), offset); + //logerror("Protection PC %06x: warning - read fully unmapped protection address %04x\n", cpu_get_pc(machine->activecpu), offset); return 0; } @@ -1678,7 +1678,7 @@ READ32_HANDLER( deco16_146_fghthist_prot_r ) && addr!=0x1ae && addr!=0x1d6 && addr!=0x4f8 && addr!=0x614 // cnofirmed && addr!=0x5ae && addr!=0x50a && addr!=0x476 && addr!=0x328 && addr!=0x3e && addr!=0x558 // dbl check these later && addr!=0x444 && addr!=0x46a // confirmed - && activecpu_get_pc()!=0x16448 // hmm + && cpu_get_pc(machine->activecpu)!=0x16448 // hmm && addr!=0x67a && addr!=0x6c2 && addr!=0xac && addr!=0x416 && addr!=0x2c2 // confirmed && addr!=0x3d8 @@ -1701,10 +1701,10 @@ READ32_HANDLER( deco16_146_fghthist_prot_r ) && addr!=0x440 && addr!=0x460 ) { - logerror("Protection PC %06x: warning - read unmapped protection address %04x (ret %04x)\n", activecpu_get_pc(), addr, val); + logerror("Protection PC %06x: warning - read unmapped protection address %04x (ret %04x)\n", cpu_get_pc(machine->activecpu), addr, val); popmessage("Read protection port %04x", addr); } - // logerror("Protection PC %06x: warning - read unmapped protection address %04x (ret %04x)\n", activecpu_get_pc(), addr, val); + // logerror("Protection PC %06x: warning - read unmapped protection address %04x (ret %04x)\n", cpu_get_pc(machine->activecpu), addr, val); return (val<<16)|0xffff; } @@ -1732,7 +1732,7 @@ READ16_HANDLER( dietgo_104_prot_r ) case 0x506: return input_port_read(machine, "DSW"); } - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", activecpu_get_pc(), offset<<1); + logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(machine->activecpu), offset<<1); return 0; } @@ -1744,7 +1744,7 @@ WRITE16_HANDLER( dietgo_104_prot_w ) cpunum_set_input_line(machine, 1,0,HOLD_LINE); return; } - logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",activecpu_get_pc(),offset<<1,data); + logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",cpu_get_pc(machine->activecpu),offset<<1,data); } /**********************************************************************************/ @@ -1762,7 +1762,7 @@ READ16_HANDLER( deco16_104_pktgaldx_prot_r ) case 0x51a: return DECO_PORT(2); } - logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", activecpu_get_pc(), offset<<1); + logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(machine->activecpu), offset<<1); return 0; } @@ -1770,7 +1770,7 @@ READ16_HANDLER( deco16_104_pktgaldx_prot_r ) WRITE16_HANDLER( deco16_104_pktgaldx_prot_w ) { COMBINE_DATA(&deco16_prot_ram[offset]); -// logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",activecpu_get_pc(),offset<<1,data); +// logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",cpu_get_pc(machine->activecpu),offset<<1,data); } /**********************************************************************************/ diff --git a/src/mame/machine/fddebug.c b/src/mame/machine/fddebug.c index a1cc1500361..a599b5664d5 100644 --- a/src/mame/machine/fddebug.c +++ b/src/mame/machine/fddebug.c @@ -438,7 +438,7 @@ INLINE int pc_is_valid(running_machine *machine, UINT32 pc, UINT32 flags) return 0; if (pc & 0xff000000) return 0; - if (memory_get_op_ptr(machine, cpu_getactivecpu(), pc, 0) == NULL) + if (memory_get_op_ptr(machine, cpunum_get_active(), pc, 0) == NULL) return 0; return 1; } @@ -462,7 +462,7 @@ INLINE int addr_is_valid(running_machine *machine, UINT32 addr, UINT32 flags) return 0; /* if we're invalid, fail */ - if (strcmp(memory_get_handler_string(0, cpu_getactivecpu(), ADDRESS_SPACE_PROGRAM, addr), "segaic16_memory_mapper_lsb_r") == 0) + if (strcmp(memory_get_handler_string(0, cpunum_get_active(), ADDRESS_SPACE_PROGRAM, addr), "segaic16_memory_mapper_lsb_r") == 0) return 2; return 1; @@ -896,7 +896,7 @@ static void execute_fdunlock(running_machine *machine, int ref, int params, cons /* support 0 or 1 parameters */ if (params != 1 || !debug_command_parameter_number(param[0], &offset)) - offset = activecpu_get_pc(); + offset = cpu_get_pc(machine->activecpu); keyaddr = addr_to_keyaddr(offset / 2); /* toggle the ignore PC status */ @@ -937,7 +937,7 @@ static void execute_fdignore(running_machine *machine, int ref, int params, cons return; } if (params != 1 || !debug_command_parameter_number(param[0], &offset)) - offset = activecpu_get_pc(); + offset = cpu_get_pc(machine->activecpu); offset /= 2; /* toggle the ignore PC status */ @@ -1035,10 +1035,10 @@ static void execute_fdpc(running_machine *machine, int ref, int params, const ch /* support 0 or 1 parameters */ if (!debug_command_parameter_number(param[0], &newpc)) - newpc = activecpu_get_pc(); + newpc = cpu_get_pc(machine->activecpu); /* set the new PC */ - activecpu_set_reg(REG_PC, newpc); + cpu_set_reg(machine->activecpu, REG_PC, newpc); /* recompute around that */ instruction_hook(newpc); @@ -1052,7 +1052,7 @@ static void execute_fdpc(running_machine *machine, int ref, int params, const ch static void execute_fdsearch(running_machine *machine, int ref, int params, const char **param) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(machine->activecpu); int length, first = TRUE; UINT8 instrdata[2]; UINT16 decoded; @@ -1090,7 +1090,7 @@ static void execute_fdsearch(running_machine *machine, int ref, int params, cons } /* set this as our current PC and run the instruction hook */ - activecpu_set_reg(REG_PC, pc); + cpu_set_reg(machine->activecpu, REG_PC, pc); if (instruction_hook(pc)) break; } diff --git a/src/mame/machine/flstory.c b/src/mame/machine/flstory.c index 6819c01d1dd..57be2a823ea 100644 --- a/src/mame/machine/flstory.c +++ b/src/mame/machine/flstory.c @@ -28,13 +28,13 @@ static UINT8 portA_in,portA_out,ddrA; READ8_HANDLER( flstory_68705_portA_r ) { -//logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in); return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE8_HANDLER( flstory_68705_portA_w ) { -//logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data); portA_out = data; } @@ -63,7 +63,7 @@ READ8_HANDLER( flstory_68705_portB_r ) WRITE8_HANDLER( flstory_68705_portB_w ) { -//logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data); if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) { @@ -95,13 +95,13 @@ READ8_HANDLER( flstory_68705_portC_r ) portC_in = 0; if (main_sent) portC_in |= 0x01; if (!mcu_sent) portC_in |= 0x02; -//logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),portC_in); +//logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(machine->activecpu),portC_in); return (portC_out & ddrC) | (portC_in & ~ddrC); } WRITE8_HANDLER( flstory_68705_portC_w ) { -logerror("%04x: 68705 port C write %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(machine->activecpu),data); portC_out = data; } @@ -112,7 +112,7 @@ WRITE8_HANDLER( flstory_68705_ddrC_w ) WRITE8_HANDLER( flstory_mcu_w ) { -logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); +logerror("%04x: mcu_w %02x\n",cpu_get_pc(machine->activecpu),data); from_main = data; main_sent = 1; cpunum_set_input_line(machine, 2,0,ASSERT_LINE); @@ -120,7 +120,7 @@ logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); READ8_HANDLER( flstory_mcu_r ) { -logerror("%04x: mcu_r %02x\n",activecpu_get_pc(),from_mcu); +logerror("%04x: mcu_r %02x\n",cpu_get_pc(machine->activecpu),from_mcu); mcu_sent = 0; return from_mcu; } @@ -131,7 +131,7 @@ READ8_HANDLER( flstory_mcu_status_r ) /* bit 0 = when 1, mcu is ready to receive data from main cpu */ /* bit 1 = when 1, mcu has sent data to the main cpu */ -//logerror("%04x: mcu_status_r\n",activecpu_get_pc()); +//logerror("%04x: mcu_status_r\n",cpu_get_pc(machine->activecpu)); if (!main_sent) res |= 0x01; if (mcu_sent) res |= 0x02; @@ -258,7 +258,7 @@ WRITE8_HANDLER( victnine_mcu_w ) READ8_HANDLER( victnine_mcu_r ) { - //logerror("%04x: mcu read (0x%02x)\n", activecpu_get_previouspc(), from_mcu); + //logerror("%04x: mcu read (0x%02x)\n", cpu_get_previouspc(machine->activecpu), from_mcu); return from_mcu - VICTNINE_MCU_SEED; } diff --git a/src/mame/machine/gaelco2.c b/src/mame/machine/gaelco2.c index 018916b174c..73284304103 100644 --- a/src/mame/machine/gaelco2.c +++ b/src/mame/machine/gaelco2.c @@ -239,7 +239,7 @@ WRITE16_HANDLER( wrally2_adc_clk ) } } else - logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:analog_port_clock_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } @@ -255,7 +255,7 @@ WRITE16_HANDLER( wrally2_adc_cs ) } } else - logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", activecpu_get_pc(), offset, data, mem_mask); + logerror("%06X:analog_port_latch_w(%02X) = %08X & %08X\n", cpu_get_pc(machine->activecpu), offset, data, mem_mask); } /*************************************************************************** @@ -325,13 +325,13 @@ UINT16 *snowboar_protection; READ16_HANDLER( snowboar_protection_r ) { - logerror("%06x: protection read from %04x\n", activecpu_get_pc(), offset*2); + logerror("%06x: protection read from %04x\n", cpu_get_pc(machine->activecpu), offset*2); return 0x0000; } WRITE16_HANDLER( snowboar_protection_w ) { COMBINE_DATA(&snowboar_protection[offset]); - logerror("%06x: protection write %04x to %04x\n", activecpu_get_pc(), data, offset*2); + logerror("%06x: protection write %04x to %04x\n", cpu_get_pc(machine->activecpu), data, offset*2); } diff --git a/src/mame/machine/gaelcrpt.c b/src/mame/machine/gaelcrpt.c index eccaf8a8689..162350ec08a 100644 --- a/src/mame/machine/gaelcrpt.c +++ b/src/mame/machine/gaelcrpt.c @@ -120,11 +120,11 @@ static int decrypt(int const param1, int const param2, int const enc_prev_word, -UINT16 gaelco_decrypt(int offset, int data, int param1, int param2) +UINT16 gaelco_decrypt(running_machine *machine, int offset, int data, int param1, int param2) { static int lastpc, lastoffset, lastencword, lastdecword; - int thispc = activecpu_get_pc(); + int thispc = cpu_get_pc(machine->activecpu); // int savedata = data; /* check if 2nd half of 32 bit */ @@ -146,7 +146,7 @@ UINT16 gaelco_decrypt(int offset, int data, int param1, int param2) lastdecword = data; -// logerror("%8x : data1 = %4x > %4x @ %8x\n",activecpu_get_pc(),savedata,data,lastoffset); +// logerror("%8x : data1 = %4x > %4x @ %8x\n",cpu_get_pc(machine->activecpu),savedata,data,lastoffset); } return data; } diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c index 9824f09c434..7223a621857 100644 --- a/src/mame/machine/galaxold.c +++ b/src/mame/machine/galaxold.c @@ -125,7 +125,7 @@ WRITE8_HANDLER( galaxold_leds_w ) static READ8_HANDLER( checkmaj_protection_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x0f15: return 0xf5; case 0x0f8f: return 0x7c; @@ -134,7 +134,7 @@ static READ8_HANDLER( checkmaj_protection_r ) case 0x10f1: return 0xaa; case 0x1402: return 0xaa; default: - logerror("Unknown protection read. PC=%04X\n",activecpu_get_pc()); + logerror("Unknown protection read. PC=%04X\n",cpu_get_pc(machine->activecpu)); } return 0; @@ -217,23 +217,23 @@ DRIVER_INIT( dingoe ) READ8_HANDLER( scramblb_protection_1_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x01da: return 0x80; case 0x01e4: return 0x00; default: - logerror("%04x: read protection 1\n",activecpu_get_pc()); + logerror("%04x: read protection 1\n",cpu_get_pc(machine->activecpu)); return 0; } } READ8_HANDLER( scramblb_protection_2_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(machine->activecpu)) { case 0x01ca: return 0x90; default: - logerror("%04x: read protection 2\n",activecpu_get_pc()); + logerror("%04x: read protection 2\n",cpu_get_pc(machine->activecpu)); return 0; } } diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c index 40ef610b30c..c49b9a3e2a3 100644 --- a/src/mame/machine/harddriv.c +++ b/src/mame/machine/harddriv.c @@ -852,12 +852,12 @@ WRITE16_HANDLER( hd68k_adsp_data_w ) /* any write to $1FFF is taken to be a trigger; synchronize the CPUs */ if (offset == 0x1fff) { - logerror("%06X:ADSP sync address written (%04X)\n", activecpu_get_previouspc(), data); + logerror("%06X:ADSP sync address written (%04X)\n", cpu_get_previouspc(machine->activecpu), data); timer_call_after_resynch(NULL, 0, 0); cpu_triggerint(machine, hdcpu_adsp); } else - logerror("%06X:ADSP W@%04X (%04X)\n", activecpu_get_previouspc(), offset, data); + logerror("%06X:ADSP W@%04X (%04X)\n", cpu_get_previouspc(machine->activecpu), offset, data); } @@ -1007,7 +1007,7 @@ WRITE16_HANDLER( hd68k_adsp_control_w ) WRITE16_HANDLER( hd68k_adsp_irq_clear_w ) { - logerror("%06X:68k clears ADSP interrupt\n", activecpu_get_previouspc()); + logerror("%06X:68k clears ADSP interrupt\n", cpu_get_previouspc(machine->activecpu)); adsp_irq_state = 0; atarigen_update_interrupts(machine); } @@ -1018,7 +1018,7 @@ READ16_HANDLER( hd68k_adsp_irq_state_r ) int result = 0xfffd; if (adsp_xflag) result ^= 2; if (adsp_irq_state) result ^= 1; - logerror("%06X:68k reads ADSP interrupt state = %04x\n", activecpu_get_previouspc(), result); + logerror("%06X:68k reads ADSP interrupt state = %04x\n", cpu_get_previouspc(machine->activecpu), result); return result; } @@ -1050,7 +1050,7 @@ READ16_HANDLER( hdadsp_special_r ) break; default: - logerror("%04X:hdadsp_special_r(%04X)\n", activecpu_get_previouspc(), offset); + logerror("%04X:hdadsp_special_r(%04X)\n", cpu_get_previouspc(machine->activecpu), offset); break; } return 0; @@ -1078,7 +1078,7 @@ WRITE16_HANDLER( hdadsp_special_w ) break; case 6: /* /GINT */ - logerror("%04X:ADSP signals interrupt\n", activecpu_get_previouspc()); + logerror("%04X:ADSP signals interrupt\n", cpu_get_previouspc(machine->activecpu)); adsp_irq_state = 1; atarigen_update_interrupts(machine); break; @@ -1088,7 +1088,7 @@ WRITE16_HANDLER( hdadsp_special_w ) break; default: - logerror("%04X:hdadsp_special_w(%04X)=%04X\n", activecpu_get_previouspc(), offset, data); + logerror("%04X:hdadsp_special_w(%04X)=%04X\n", cpu_get_previouspc(machine->activecpu), offset, data); break; } } @@ -1193,25 +1193,25 @@ READ16_HANDLER( hd68k_ds3_girq_state_r ) READ16_HANDLER( hd68k_ds3_gdata_r ) { - offs_t pc = activecpu_get_pc(); + offs_t pc = cpu_get_pc(machine->activecpu); ds3_gflag = 0; update_ds3_irq(); - logerror("%06X:hd68k_ds3_gdata_r(%04X)\n", activecpu_get_previouspc(), ds3_gdata); + logerror("%06X:hd68k_ds3_gdata_r(%04X)\n", cpu_get_previouspc(machine->activecpu), ds3_gdata); /* attempt to optimize the transfer if conditions are right */ - if (cpu_getactivecpu() == 0 && pc == hdds3_transfer_pc && + if (cpunum_get_active() == 0 && pc == hdds3_transfer_pc && !(!ds3_g68flag && ds3_g68irqs) && !(ds3_gflag && ds3_gfirqs)) { - UINT32 destaddr = activecpu_get_reg(M68K_A1); - UINT16 count68k = activecpu_get_reg(M68K_D1); - UINT16 mstat = cpunum_get_reg(hdcpu_adsp, ADSP2100_MSTAT); - UINT16 i6 = cpunum_get_reg(hdcpu_adsp, (mstat & 1) ? ADSP2100_MR0 : ADSP2100_MR0_SEC); - UINT16 l6 = cpunum_get_reg(hdcpu_adsp, ADSP2100_L6) - 1; - UINT16 m7 = cpunum_get_reg(hdcpu_adsp, ADSP2100_M7); + UINT32 destaddr = cpu_get_reg(machine->activecpu, M68K_A1); + UINT16 count68k = cpu_get_reg(machine->activecpu, M68K_D1); + UINT16 mstat = cpu_get_reg(machine->cpu[hdcpu_adsp], ADSP2100_MSTAT); + UINT16 i6 = cpu_get_reg(machine->cpu[hdcpu_adsp], (mstat & 1) ? ADSP2100_MR0 : ADSP2100_MR0_SEC); + UINT16 l6 = cpu_get_reg(machine->cpu[hdcpu_adsp], ADSP2100_L6) - 1; + UINT16 m7 = cpu_get_reg(machine->cpu[hdcpu_adsp], ADSP2100_M7); - logerror("%06X:optimizing 68k transfer, %d words\n", activecpu_get_previouspc(), count68k); + logerror("%06X:optimizing 68k transfer, %d words\n", cpu_get_previouspc(machine->activecpu), count68k); while (count68k > 0 && hdadsp_data_memory[0x16e6] > 0) { @@ -1223,8 +1223,8 @@ READ16_HANDLER( hd68k_ds3_gdata_r ) } count68k--; } - activecpu_set_reg(M68K_D1, count68k); - cpunum_set_reg(hdcpu_adsp, (mstat & 1) ? ADSP2100_MR0 : ADSP2100_MR0_SEC, i6); + cpu_set_reg(machine->activecpu, M68K_D1, count68k); + cpu_set_reg(machine->cpu[hdcpu_adsp], (mstat & 1) ? ADSP2100_MR0 : ADSP2100_MR0_SEC, i6); adsp_speedup_count[1]++; } @@ -1240,7 +1240,7 @@ READ16_HANDLER( hd68k_ds3_gdata_r ) WRITE16_HANDLER( hd68k_ds3_gdata_w ) { - logerror("%06X:hd68k_ds3_gdata_w(%04X)\n", activecpu_get_previouspc(), ds3_gdata); + logerror("%06X:hd68k_ds3_gdata_w(%04X)\n", cpu_get_previouspc(machine->activecpu), ds3_gdata); COMBINE_DATA(&ds3_g68data); ds3_g68flag = 1; @@ -1317,7 +1317,7 @@ WRITE16_HANDLER( hdds3_special_w ) switch (offset & 7) { case 0: - logerror("%04X:ADSP sets gdata to %04X\n", activecpu_get_previouspc(), data); + logerror("%04X:ADSP sets gdata to %04X\n", cpu_get_previouspc(machine->activecpu), data); ds3_gdata = data; ds3_gflag = 1; update_ds3_irq(); @@ -1327,7 +1327,7 @@ WRITE16_HANDLER( hdds3_special_w ) break; case 1: - logerror("%04X:ADSP sets interrupt = %d\n", activecpu_get_previouspc(), (data >> 1) & 1); + logerror("%04X:ADSP sets interrupt = %d\n", cpu_get_previouspc(machine->activecpu), (data >> 1) & 1); adsp_irq_state = (data >> 1) & 1; hd68k_update_interrupts(machine); break; @@ -1617,13 +1617,13 @@ WRITE16_HANDLER( hddspcom_control_w ) WRITE16_HANDLER( rd68k_slapstic_w ) { - slapstic_tweak(offset & 0x3fff); + slapstic_tweak(machine, offset & 0x3fff); } READ16_HANDLER( rd68k_slapstic_r ) { - int bank = slapstic_tweak(offset & 0x3fff) * 0x4000; + int bank = slapstic_tweak(machine, offset & 0x3fff) * 0x4000; return hd68k_slapstic_base[bank + (offset & 0x3fff)]; } @@ -1762,7 +1762,7 @@ READ16_HANDLER( hdgsp_speedup_r ) /* if both this address and the other important address are not $ffff */ /* then we can spin until something gets written */ if (result != 0xffff && hdgsp_speedup_addr[1][0] != 0xffff && - cpu_getactivecpu() == hdcpu_gsp && activecpu_get_pc() == hdgsp_speedup_pc) + cpunum_get_active() == hdcpu_gsp && cpu_get_pc(machine->activecpu) == hdgsp_speedup_pc) { gsp_speedup_count[0]++; cpu_spinuntil_int(); @@ -1806,8 +1806,8 @@ READ16_HANDLER( rdgsp_speedup1_r ) int result = hdgsp_speedup_addr[0][offset]; /* if this address is equal to $f000, spin until something gets written */ - if (cpu_getactivecpu() == hdcpu_gsp && activecpu_get_pc() == hdgsp_speedup_pc && - (result & 0xff) < activecpu_get_reg(TMS34010_A1)) + if (cpunum_get_active() == hdcpu_gsp && cpu_get_pc(machine->activecpu) == hdgsp_speedup_pc && + (result & 0xff) < cpu_get_reg(machine->activecpu, TMS34010_A1)) { gsp_speedup_count[0]++; cpu_spinuntil_int(); @@ -1820,7 +1820,7 @@ READ16_HANDLER( rdgsp_speedup1_r ) WRITE16_HANDLER( rdgsp_speedup1_w ) { COMBINE_DATA(&hdgsp_speedup_addr[0][offset]); - if (cpu_getactivecpu() != hdcpu_gsp) + if (cpunum_get_active() != hdcpu_gsp) cpu_triggerint(machine, hdcpu_gsp); } @@ -1841,7 +1841,7 @@ READ16_HANDLER( hdmsp_speedup_r ) { int data = hdmsp_speedup_addr[offset]; - if (data == 0 && activecpu_get_pc() == hdmsp_speedup_pc && cpu_getactivecpu() == hdcpu_msp) + if (data == 0 && cpu_get_pc(machine->activecpu) == hdmsp_speedup_pc && cpunum_get_active() == hdcpu_msp) { msp_speedup_count[0]++; cpu_spinuntil_int(); @@ -1873,7 +1873,7 @@ READ16_HANDLER( stmsp_speedup_r ) stmsp_sync[2][0] == 0xffff && /* 99d30 */ stmsp_sync[2][1] == 0xffff && /* 99d40 */ stmsp_sync[2][2] == 0 && /* 99d50 */ - activecpu_get_pc() == 0x3c0) + cpu_get_pc(machine->activecpu) == 0x3c0) { msp_speedup_count[0]++; cpu_spinuntil_int(); @@ -1898,7 +1898,7 @@ READ16_HANDLER( hdadsp_speedup_r ) { int data = hdadsp_data_memory[0x1fff]; - if (data == 0xffff && activecpu_get_pc() <= 0x3b && cpu_getactivecpu() == hdcpu_adsp) + if (data == 0xffff && cpu_get_pc(machine->activecpu) <= 0x3b && cpunum_get_active() == hdcpu_adsp) { adsp_speedup_count[0]++; cpu_spinuntil_int(); @@ -1912,7 +1912,7 @@ READ16_HANDLER( hdds3_speedup_r ) { int data = *hdds3_speedup_addr; - if (data != 0 && activecpu_get_pc() == hdds3_speedup_pc && cpu_getactivecpu() == hdcpu_adsp) + if (data != 0 && cpu_get_pc(machine->activecpu) == hdds3_speedup_pc && cpunum_get_active() == hdcpu_adsp) { adsp_speedup_count[2]++; cpu_spinuntil_int(); diff --git a/src/mame/machine/irobot.c b/src/mame/machine/irobot.c index 43d2c0ef354..b6beddf142e 100644 --- a/src/mame/machine/irobot.c +++ b/src/mame/machine/irobot.c @@ -26,7 +26,7 @@ #define IR_CPU_STATE \ logerror(\ - "pc: %4x, scanline: %d\n", activecpu_get_previouspc(), video_screen_get_vpos(machine->primary_screen)) + "pc: %4x, scanline: %d\n", cpu_get_previouspc(machine->activecpu), video_screen_get_vpos(machine->primary_screen)) UINT8 irobot_vg_clear; diff --git a/src/mame/machine/kaneko16.c b/src/mame/machine/kaneko16.c index 4c58fefeb5e..6b4b6468368 100644 --- a/src/mame/machine/kaneko16.c +++ b/src/mame/machine/kaneko16.c @@ -89,7 +89,7 @@ READ16_HANDLER(galpanib_calc_r) /* Simulation of the CALC1 MCU */ return (mame_rand(machine) & 0xffff); default: - logerror("CPU #0 PC %06x: warning - read unmapped calc address %06x\n",activecpu_get_pc(),offset<<1); + logerror("CPU #0 PC %06x: warning - read unmapped calc address %06x\n",cpu_get_pc(machine->activecpu),offset<<1); } return 0; @@ -112,7 +112,7 @@ WRITE16_HANDLER(galpanib_calc_w) case 0x12/2: hit.mult_b = data; break; default: - logerror("CPU #0 PC %06x: warning - write unmapped hit address %06x\n",activecpu_get_pc(),offset<<1); + logerror("CPU #0 PC %06x: warning - write unmapped hit address %06x\n",cpu_get_pc(machine->activecpu),offset<<1); } } @@ -136,7 +136,7 @@ WRITE16_HANDLER(bloodwar_calc_w) case 0x38/2: break; default: - logerror("CPU #0 PC %06x: warning - write unmapped hit address %06x\n",activecpu_get_pc(),offset<<1); + logerror("CPU #0 PC %06x: warning - write unmapped hit address %06x\n",cpu_get_pc(machine->activecpu),offset<<1); } } @@ -230,7 +230,7 @@ READ16_HANDLER(bloodwar_calc_r) case 0x32/2: return hit.y2s; default: - logerror("CPU #0 PC %06x: warning - read unmapped calc address %06x\n",activecpu_get_pc(),offset<<1); + logerror("CPU #0 PC %06x: warning - read unmapped calc address %06x\n",cpu_get_pc(machine->activecpu),offset<<1); } return 0; @@ -322,7 +322,7 @@ static void calc3_mcu_run(running_machine *machine) if (mcu_command == 0) return; logerror("CPU #0 PC %06X : MCU executed command at %04X: %04X\n", - activecpu_get_pc(),calc3_mcu_command_offset*2,mcu_command); + cpu_get_pc(machine->activecpu),calc3_mcu_command_offset*2,mcu_command); switch (mcu_command) { @@ -573,7 +573,7 @@ TOYBOX_MCU_COM_W(3) */ READ16_HANDLER( toybox_mcu_status_r ) { - logerror("CPU #%d (PC=%06X) : read MCU status\n", cpu_getactivecpu(), activecpu_get_previouspc()); + logerror("CPU #%d (PC=%06X) : read MCU status\n", cpunum_get_active(), cpu_get_previouspc(machine->activecpu)); return 0; // most games test bit 0 for failure } @@ -598,7 +598,7 @@ void bloodwar_mcu_run(running_machine *machine) mame_fread(f,&kaneko16_mcu_ram[mcu_offset], 128); mame_fclose(f); } - logerror("PC=%06X : MCU executed command: %04X %04X (load NVRAM settings)\n", activecpu_get_pc(), mcu_command, mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (load NVRAM settings)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2); } break; @@ -610,20 +610,20 @@ void bloodwar_mcu_run(running_machine *machine) mame_fwrite(f,&kaneko16_mcu_ram[mcu_offset], 128); mame_fclose(f); } - logerror("PC=%06X : MCU executed command: %04X %04X (save NVRAM settings)\n", activecpu_get_pc(), mcu_command, mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (save NVRAM settings)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2); } break; case 0x03: // DSW { kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1"); - logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", activecpu_get_pc(), mcu_command, mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2); } break; case 0x04: // Protection { - logerror("PC=%06X : MCU executed command: %04X %04X %04X\n", activecpu_get_pc(), mcu_command, mcu_offset*2, mcu_data); + logerror("PC=%06X : MCU executed command: %04X %04X %04X\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2, mcu_data); switch(mcu_data) { @@ -687,7 +687,7 @@ void bloodwar_mcu_run(running_machine *machine) break; default: - logerror("PC=%06X : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", activecpu_get_pc(), mcu_command, mcu_offset*2, mcu_data); + logerror("PC=%06X : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2, mcu_data); break; } } @@ -713,7 +713,7 @@ void bonkadv_mcu_run(running_machine *machine) mame_fread(f,&kaneko16_mcu_ram[mcu_offset], 128); mame_fclose(f); } - logerror("PC=%06X : MCU executed command: %04X %04X (load NVRAM settings)\n", activecpu_get_pc(), mcu_command, mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (load NVRAM settings)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2); } break; @@ -725,7 +725,7 @@ void bonkadv_mcu_run(running_machine *machine) mame_fwrite(f,&kaneko16_mcu_ram[mcu_offset], 128); mame_fclose(f); } - logerror("PC=%06X : MCU executed command: %04X %04X (save NVRAM settings)\n", activecpu_get_pc(), mcu_command, mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (save NVRAM settings)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2); } break; @@ -737,20 +737,20 @@ void bonkadv_mcu_run(running_machine *machine) mame_fwrite(f, bonkadv_mcu_43, sizeof(bonkadv_mcu_43)); mame_fclose(f); } - logerror("PC=%06X : MCU executed command: %04X %04X (restore default NVRAM settings)\n", activecpu_get_pc(), mcu_command, mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (restore default NVRAM settings)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2); } break; case 0x03: // DSW { kaneko16_mcu_ram[mcu_offset] = input_port_read(machine, "DSW1"); - logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", activecpu_get_pc(), mcu_command, mcu_offset*2); + logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2); } break; case 0x04: // Protection { - logerror("PC=%06X : MCU executed command: %04X %04X %04X\n", activecpu_get_pc(), mcu_command, mcu_offset*2, mcu_data); + logerror("PC=%06X : MCU executed command: %04X %04X %04X\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2, mcu_data); switch(mcu_data) { @@ -799,7 +799,7 @@ void bonkadv_mcu_run(running_machine *machine) break; default: - logerror("PC=%06X : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", activecpu_get_pc(), mcu_command, mcu_offset*2, mcu_data); + logerror("PC=%06X : MCU executed command: %04X %04X %04X (UNKNOWN COMMAND)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2, mcu_data); break; } } @@ -822,7 +822,7 @@ void gtmr_mcu_run(running_machine *machine) UINT16 mcu_offset = kaneko16_mcu_ram[0x0012/2] / 2; UINT16 mcu_data = kaneko16_mcu_ram[0x0014/2]; - logerror("CPU #0 PC %06X : MCU executed command: %04X %04X %04X\n", activecpu_get_pc(), mcu_command, mcu_offset*2, mcu_data); + logerror("CPU #0 PC %06X : MCU executed command: %04X %04X %04X\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2, mcu_data); switch (mcu_command >> 8) { diff --git a/src/mame/machine/konamigx.c b/src/mame/machine/konamigx.c index 6a539797b04..544cc504c61 100644 --- a/src/mame/machine/konamigx.c +++ b/src/mame/machine/konamigx.c @@ -1962,7 +1962,7 @@ WRITE16_HANDLER( K055550_word_w ) break; default: -// logerror("%06x: unknown K055550 command %02x\n", activecpu_get_pc(), data); +// logerror("%06x: unknown K055550 command %02x\n", cpu_get_pc(machine->activecpu), data); break; } } diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c index d1ce8948e1c..5133fe88e26 100644 --- a/src/mame/machine/konppc.c +++ b/src/mame/machine/konppc.c @@ -1,6 +1,7 @@ /* Konami PowerPC-based 3D games common functions */ #include "driver.h" +#include "deprecat.h" #include "cpu/sharc/sharc.h" #include "video/voodoo.h" #include "konppc.h" @@ -132,7 +133,7 @@ READ32_HANDLER( cgboard_dsp_comm_r_ppc ) { if (cgboard_id < MAX_CG_BOARDS) { -// mame_printf_debug("dsp_cmd_r: (board %d) %08X, %08X at %08X\n", cgboard_id, offset, mem_mask, activecpu_get_pc()); +// mame_printf_debug("dsp_cmd_r: (board %d) %08X, %08X at %08X\n", cgboard_id, offset, mem_mask, cpu_get_pc(machine->activecpu)); return dsp_comm_sharc[cgboard_id][offset] | (dsp_state[cgboard_id] << 16); } else @@ -144,7 +145,7 @@ READ32_HANDLER( cgboard_dsp_comm_r_ppc ) WRITE32_HANDLER( cgboard_dsp_comm_w_ppc ) { int dsp = (cgboard_id == 0) ? 2 : 3; -// mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, activecpu_get_pc()); +// mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, cpu_get_pc(machine->activecpu)); if (cgboard_id < MAX_CG_BOARDS) { @@ -224,9 +225,9 @@ static void dsp_comm_sharc_w(running_machine *machine, int board, int offset, UI case CGBOARD_TYPE_GTICLUB: { //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG0, ASSERT_LINE); - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_set_flag_input(0, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); if (offset == 1) { @@ -245,9 +246,9 @@ static void dsp_comm_sharc_w(running_machine *machine, int board, int offset, UI if (data & 0x01 || data & 0x10) { - cpuintrf_push_context((board == 0) ? 2 : 3); + cpu_push_context(machine->cpu[board == 0 ? 2 : 3]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } if (texture_bank[board] != -1) @@ -275,7 +276,7 @@ static void dsp_comm_sharc_w(running_machine *machine, int board, int offset, UI } } -// printf("cgboard_dsp_comm_w_sharc: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); +// printf("cgboard_dsp_comm_w_sharc: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); dsp_comm_sharc[board][offset] = data; } @@ -358,28 +359,28 @@ static UINT32 nwk_fifo_r(int board) if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r) { - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); sharc_set_flag_input(1, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } else { - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } if (nwk_fifo_read_ptr[board] < nwk_fifo_full) { - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); sharc_set_flag_input(2, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } else { - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); sharc_set_flag_input(2, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } data = nwk_fifo[board][nwk_fifo_read_ptr[board]]; @@ -395,20 +396,20 @@ static void nwk_fifo_w(int board, UINT32 data) if (nwk_fifo_write_ptr[board] < nwk_fifo_half_full_w) { - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } else { - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); sharc_set_flag_input(1, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } - cpuintrf_push_context(cpu); + cpu_push_context(Machine->cpu[cpu]); sharc_set_flag_input(2, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); nwk_fifo[board][nwk_fifo_write_ptr[board]] = data; nwk_fifo_write_ptr[board]++; @@ -446,7 +447,7 @@ static UINT32 K033906_r(int chip, int reg) case 0x0f: return K033906_reg[chip][0x0f]; // interrupt_line, interrupt_pin, min_gnt, max_lat default: - fatalerror("K033906_r: %d, %08X at %08X", chip, reg, activecpu_get_pc()); + fatalerror("K033906_r: %d, %08X at %08X", chip, reg, cpu_get_pc(Machine->activecpu)); } return 0; } @@ -495,7 +496,7 @@ static void K033906_w(running_machine *machine, int chip, int reg, UINT32 data) break; default: - fatalerror("K033906_w: %d, %08X, %08X at %08X", chip, data, reg, activecpu_get_pc()); + fatalerror("K033906_w: %d, %08X, %08X at %08X", chip, data, reg, cpu_get_pc(machine->activecpu)); } } diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c index 3f93cf77aaa..a2256311d55 100644 --- a/src/mame/machine/leland.c +++ b/src/mame/machine/leland.c @@ -65,7 +65,7 @@ static UINT8 top_board_bank; static UINT8 sound_port_bank; static UINT8 alternate_bank; static UINT8 master_bank; -void (*leland_update_master_bank)(void); +void (*leland_update_master_bank)(running_machine *machine); static UINT32 xrom1_addr; static UINT32 xrom2_addr; @@ -155,7 +155,7 @@ WRITE8_HANDLER( alleymas_joystick_kludge ) { /* catch the case where they clear this memory location at PC $1827 and change */ /* the value written to be a 1 */ - if (activecpu_get_previouspc() == 0x1827) + if (cpu_get_previouspc(machine->activecpu) == 0x1827) *alleymas_kludge_mem = 1; else *alleymas_kludge_mem = data; @@ -399,7 +399,7 @@ MACHINE_RESET( leland ) /* initialize the master banks */ master_length = memory_region_length(machine, "master"); master_base = memory_region(machine, "master"); - (*leland_update_master_bank)(); + (*leland_update_master_bank)(machine); /* initialize the slave banks */ slave_length = memory_region_length(machine, "slave"); @@ -447,7 +447,7 @@ MACHINE_RESET( ataxx ) /* initialize the master banks */ master_length = memory_region_length(machine, "master"); master_base = memory_region(machine, "master"); - ataxx_bankswitch(); + ataxx_bankswitch(machine); /* initialize the slave banks */ slave_length = memory_region_length(machine, "slave"); @@ -515,9 +515,9 @@ WRITE8_HANDLER( leland_master_alt_bankswitch_w ) /* update any bankswitching */ if (LOG_BANKSWITCHING_M) if ((alternate_bank ^ data) & 0x0f) - logerror("%04X:alternate_bank = %02X\n", safe_activecpu_get_pc(), data & 0x0f); + logerror("%04X:alternate_bank = %02X\n", safe_cpu_get_pc(machine->activecpu), data & 0x0f); alternate_bank = data & 15; - (*leland_update_master_bank)(); + (*leland_update_master_bank)(machine); /* sound control is in the rest */ leland_80186_control_w(machine, offset, data); @@ -525,14 +525,14 @@ WRITE8_HANDLER( leland_master_alt_bankswitch_w ) /* bankswitching for Cerberus */ -void cerberus_bankswitch(void) +void cerberus_bankswitch(running_machine *machine) { /* no bankswitching */ } /* bankswitching for Mayhem 2002, Power Play, World Series Baseball, and Alley Master */ -void mayhem_bankswitch(void) +void mayhem_bankswitch(running_machine *machine) { UINT8 *address; @@ -547,7 +547,7 @@ void mayhem_bankswitch(void) /* bankswitching for Danger Zone */ -void dangerz_bankswitch(void) +void dangerz_bankswitch(running_machine *machine) { UINT8 *address; @@ -562,7 +562,7 @@ void dangerz_bankswitch(void) /* bankswitching for Baseball the Season II, Super Baseball, and Strike Zone */ -void basebal2_bankswitch(void) +void basebal2_bankswitch(running_machine *machine) { UINT8 *address; @@ -580,7 +580,7 @@ void basebal2_bankswitch(void) /* bankswitching for Red Line Racer */ -void redline_bankswitch(void) +void redline_bankswitch(running_machine *machine) { static const UINT32 bank_list[] = { 0x10000, 0x18000, 0x02000, 0x02000 }; UINT8 *address; @@ -596,7 +596,7 @@ void redline_bankswitch(void) /* bankswitching for Viper, Quarterback, Team Quarterback, and All American Football */ -void viper_bankswitch(void) +void viper_bankswitch(running_machine *machine) { static const UINT32 bank_list[] = { 0x02000, 0x10000, 0x18000, 0x02000 }; UINT8 *address; @@ -606,7 +606,7 @@ void viper_bankswitch(void) address = &master_base[bank_list[alternate_bank & 3]]; if (bank_list[alternate_bank & 3] >= master_length) { - logerror("%04X:Master bank %02X out of range!\n", safe_activecpu_get_pc(), alternate_bank & 3); + logerror("%04X:Master bank %02X out of range!\n", safe_cpu_get_pc(machine->activecpu), alternate_bank & 3); address = &master_base[bank_list[0]]; } memory_set_bankptr(1, address); @@ -617,7 +617,7 @@ void viper_bankswitch(void) /* bankswitching for Super Offroad, Super Offroad Track Pack, and Pig Out */ -void offroad_bankswitch(void) +void offroad_bankswitch(running_machine *machine) { static const UINT32 bank_list[] = { 0x02000, 0x02000, 0x10000, 0x18000, 0x20000, 0x28000, 0x30000, 0x38000 }; UINT8 *address; @@ -627,7 +627,7 @@ void offroad_bankswitch(void) address = &master_base[bank_list[alternate_bank & 7]]; if (bank_list[alternate_bank & 7] >= master_length) { - logerror("%04X:Master bank %02X out of range!\n", safe_activecpu_get_pc(), alternate_bank & 7); + logerror("%04X:Master bank %02X out of range!\n", safe_cpu_get_pc(machine->activecpu), alternate_bank & 7); address = &master_base[bank_list[0]]; } memory_set_bankptr(1, address); @@ -638,7 +638,7 @@ void offroad_bankswitch(void) /* bankswitching for Ataxx, WSF, Indy Heat, and Brute Force */ -void ataxx_bankswitch(void) +void ataxx_bankswitch(running_machine *machine) { static const UINT32 bank_list[] = { @@ -652,7 +652,7 @@ void ataxx_bankswitch(void) address = &master_base[bank_list[master_bank & 15]]; if (bank_list[master_bank & 15] >= master_length) { - logerror("%04X:Master bank %02X out of range!\n", safe_activecpu_get_pc(), master_bank & 15); + logerror("%04X:Master bank %02X out of range!\n", safe_cpu_get_pc(machine->activecpu), master_bank & 15); address = &master_base[bank_list[0]]; } memory_set_bankptr(1, address); @@ -850,14 +850,14 @@ void ataxx_init_eeprom(UINT8 default_val, const UINT16 *data, UINT8 serial_offse READ8_HANDLER( ataxx_eeprom_r ) { int port = input_port_read(machine, "IN2"); - if (LOG_EEPROM) logerror("%04X:EE read\n", safe_activecpu_get_pc()); + if (LOG_EEPROM) logerror("%04X:EE read\n", safe_cpu_get_pc(machine->activecpu)); return (port & ~0x01) | eeprom_read_bit(); } WRITE8_HANDLER( ataxx_eeprom_w ) { - if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", safe_activecpu_get_pc(), + if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", safe_cpu_get_pc(machine->activecpu), (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); eeprom_write_bit ((data & 0x10) >> 4); eeprom_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); @@ -876,11 +876,11 @@ WRITE8_HANDLER( leland_battery_ram_w ) { if (battery_ram_enable) { - if (LOG_BATTERY_RAM) logerror("%04X:BatteryW@%04X=%02X\n", safe_activecpu_get_pc(), offset, data); + if (LOG_BATTERY_RAM) logerror("%04X:BatteryW@%04X=%02X\n", safe_cpu_get_pc(machine->activecpu), offset, data); battery_ram[offset] = data; } else - logerror("%04X:BatteryW@%04X (invalid!)\n", safe_activecpu_get_pc(), offset); + logerror("%04X:BatteryW@%04X (invalid!)\n", safe_cpu_get_pc(machine->activecpu), offset); } @@ -888,13 +888,13 @@ WRITE8_HANDLER( ataxx_battery_ram_w ) { if (battery_ram_enable) { - if (LOG_BATTERY_RAM) logerror("%04X:BatteryW@%04X=%02X\n", safe_activecpu_get_pc(), offset, data); + if (LOG_BATTERY_RAM) logerror("%04X:BatteryW@%04X=%02X\n", safe_cpu_get_pc(machine->activecpu), offset, data); battery_ram[offset] = data; } else if ((master_bank & 0x30) == 0x20) ataxx_qram[((master_bank & 0xc0) << 8) + offset] = data; else - logerror("%04X:BatteryW@%04X (invalid!)\n", safe_activecpu_get_pc(), offset); + logerror("%04X:BatteryW@%04X (invalid!)\n", safe_cpu_get_pc(machine->activecpu), offset); } @@ -986,11 +986,11 @@ NVRAM_HANDLER( ataxx ) --------------------------------------------------------------------*/ -static int keycard_r(void) +static int keycard_r(running_machine *machine) { int result = 0; - if (LOG_KEYCARDS_FULL) logerror(" (%04X:keycard_r)\n", safe_activecpu_get_pc()); + if (LOG_KEYCARDS_FULL) logerror(" (%04X:keycard_r)\n", safe_cpu_get_pc(machine->activecpu)); /* if we have a valid keycard read state, we're reading from the keycard */ if (keycard_state & 0x80) @@ -1009,12 +1009,12 @@ static int keycard_r(void) return result; } -static void keycard_w(int data) +static void keycard_w(running_machine *machine, int data) { int new_state = data & 0xb0; int new_clock = data & 0x40; - if (LOG_KEYCARDS_FULL) logerror(" (%04X:keycard_w=%02X)\n", safe_activecpu_get_pc(), data); + if (LOG_KEYCARDS_FULL) logerror(" (%04X:keycard_w=%02X)\n", safe_cpu_get_pc(machine->activecpu), data); /* check for going active */ if (!keycard_state && new_state) @@ -1100,7 +1100,7 @@ READ8_HANDLER( leland_master_analog_key_r ) break; case 0x02: /* FF = keycard serial data read */ - result = keycard_r(); + result = keycard_r(machine); /* bit 7 indicates the analog input is busy for some games */ result &= ~0x80; @@ -1126,13 +1126,13 @@ WRITE8_HANDLER( leland_master_analog_key_w ) /* update top board banking for some games */ if (LOG_BANKSWITCHING_M) if ((top_board_bank ^ data) & 0xc0) - logerror("%04X:top_board_bank = %02X\n", safe_activecpu_get_pc(), data & 0xc0); + logerror("%04X:top_board_bank = %02X\n", safe_cpu_get_pc(machine->activecpu), data & 0xc0); top_board_bank = data & 0xc0; - (*leland_update_master_bank)(); + (*leland_update_master_bank)(machine); break; case 0x02: /* FF = keycard data write */ - keycard_w(data); + keycard_w(machine, data); break; } } @@ -1157,7 +1157,7 @@ READ8_HANDLER( leland_master_input_r ) case 0x01: /* /GIN1 */ result = input_port_read(machine, "IN1"); - if (cpunum_get_reg(1, Z80_HALT)) + if (cpu_get_reg(machine->cpu[1], Z80_HALT)) result ^= 0x01; break; @@ -1177,7 +1177,7 @@ READ8_HANDLER( leland_master_input_r ) case 0x11: /* /GIN1 */ result = input_port_read(machine, "IN3"); - if (LOG_EEPROM) logerror("%04X:EE read\n", safe_activecpu_get_pc()); + if (LOG_EEPROM) logerror("%04X:EE read\n", safe_cpu_get_pc(machine->activecpu)); result = (result & ~0x01) | eeprom_read_bit(); break; @@ -1199,7 +1199,7 @@ WRITE8_HANDLER( leland_master_output_w ) cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); cpunum_set_input_line(machine, 1, 0, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); - if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", safe_activecpu_get_pc(), + if (LOG_EEPROM) logerror("%04X:EE write %d%d%d\n", safe_cpu_get_pc(machine->activecpu), (data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1); eeprom_write_bit ((data & 0x10) >> 4); eeprom_set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); @@ -1240,7 +1240,7 @@ READ8_HANDLER( ataxx_master_input_r ) case 0x07: /* /SLVBLK */ result = input_port_read(machine, "IN1"); - if (cpunum_get_reg(1, Z80_HALT)) + if (cpu_get_reg(machine->cpu[1], Z80_HALT)) result ^= 0x01; break; @@ -1266,9 +1266,9 @@ WRITE8_HANDLER( ataxx_master_output_w ) case 0x04: /* /MBNK */ if (LOG_BANKSWITCHING_M) if ((master_bank ^ data) & 0xff) - logerror("%04X:master_bank = %02X\n", safe_activecpu_get_pc(), data & 0xff); + logerror("%04X:master_bank = %02X\n", safe_cpu_get_pc(machine->activecpu), data & 0xff); master_bank = data; - ataxx_bankswitch(); + ataxx_bankswitch(machine); break; case 0x05: /* /SLV0 */ @@ -1319,22 +1319,22 @@ WRITE8_HANDLER( ataxx_paletteram_and_misc_w ) else if (offset == 0x7fc) { xrom1_addr = (xrom1_addr & 0xff00) | (data & 0x00ff); - if (LOG_XROM) logerror("%04X:XROM1 address low write = %02X (addr=%04X)\n", safe_activecpu_get_pc(), data, xrom1_addr); + if (LOG_XROM) logerror("%04X:XROM1 address low write = %02X (addr=%04X)\n", safe_cpu_get_pc(machine->activecpu), data, xrom1_addr); } else if (offset == 0x7fd) { xrom1_addr = (xrom1_addr & 0x00ff) | ((data << 8) & 0xff00); - if (LOG_XROM) logerror("%04X:XROM1 address high write = %02X (addr=%04X)\n", safe_activecpu_get_pc(), data, xrom1_addr); + if (LOG_XROM) logerror("%04X:XROM1 address high write = %02X (addr=%04X)\n", safe_cpu_get_pc(machine->activecpu), data, xrom1_addr); } else if (offset == 0x7fe) { xrom2_addr = (xrom2_addr & 0xff00) | (data & 0x00ff); - if (LOG_XROM) logerror("%04X:XROM2 address low write = %02X (addr=%04X)\n", safe_activecpu_get_pc(), data, xrom2_addr); + if (LOG_XROM) logerror("%04X:XROM2 address low write = %02X (addr=%04X)\n", safe_cpu_get_pc(machine->activecpu), data, xrom2_addr); } else if (offset == 0x7ff) { xrom2_addr = (xrom2_addr & 0x00ff) | ((data << 8) & 0xff00); - if (LOG_XROM) logerror("%04X:XROM2 address high write = %02X (addr=%04X)\n", safe_activecpu_get_pc(), data, xrom2_addr); + if (LOG_XROM) logerror("%04X:XROM2 address high write = %02X (addr=%04X)\n", safe_cpu_get_pc(machine->activecpu), data, xrom2_addr); } else extra_tram[offset] = data; @@ -1348,13 +1348,13 @@ READ8_HANDLER( ataxx_paletteram_and_misc_r ) else if (offset == 0x7fc || offset == 0x7fd) { int result = xrom_base[0x00000 | xrom1_addr | ((offset & 1) << 16)]; - if (LOG_XROM) logerror("%04X:XROM1 read(%d) = %02X (addr=%04X)\n", safe_activecpu_get_pc(), offset - 0x7fc, result, xrom1_addr); + if (LOG_XROM) logerror("%04X:XROM1 read(%d) = %02X (addr=%04X)\n", safe_cpu_get_pc(machine->activecpu), offset - 0x7fc, result, xrom1_addr); return result; } else if (offset == 0x7fe || offset == 0x7ff) { int result = xrom_base[0x20000 | xrom2_addr | ((offset & 1) << 16)]; - if (LOG_XROM) logerror("%04X:XROM2 read(%d) = %02X (addr=%04X)\n", safe_activecpu_get_pc(), offset - 0x7fc, result, xrom2_addr); + if (LOG_XROM) logerror("%04X:XROM2 read(%d) = %02X (addr=%04X)\n", safe_cpu_get_pc(machine->activecpu), offset - 0x7fc, result, xrom2_addr); return result; } else @@ -1387,9 +1387,9 @@ WRITE8_HANDLER( leland_sound_port_w ) /* some bankswitching occurs here */ if (LOG_BANKSWITCHING_M) if ((sound_port_bank ^ data) & 0x24) - logerror("%04X:sound_port_bank = %02X\n", safe_activecpu_get_pc(), data & 0x24); + logerror("%04X:sound_port_bank = %02X\n", safe_cpu_get_pc(machine->activecpu), data & 0x24); sound_port_bank = data & 0x24; - (*leland_update_master_bank)(); + (*leland_update_master_bank)(machine); } @@ -1406,12 +1406,12 @@ WRITE8_HANDLER( leland_slave_small_banksw_w ) if (bankaddress >= slave_length) { - logerror("%04X:Slave bank %02X out of range!", safe_activecpu_get_pc(), data & 1); + logerror("%04X:Slave bank %02X out of range!", safe_cpu_get_pc(machine->activecpu), data & 1); bankaddress = 0x10000; } memory_set_bankptr(3, &slave_base[bankaddress]); - if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", safe_activecpu_get_pc(), data & 1, bankaddress); + if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", safe_cpu_get_pc(machine->activecpu), data & 1, bankaddress); } @@ -1421,12 +1421,12 @@ WRITE8_HANDLER( leland_slave_large_banksw_w ) if (bankaddress >= slave_length) { - logerror("%04X:Slave bank %02X out of range!", safe_activecpu_get_pc(), data & 15); + logerror("%04X:Slave bank %02X out of range!", safe_cpu_get_pc(machine->activecpu), data & 15); bankaddress = 0x10000; } memory_set_bankptr(3, &slave_base[bankaddress]); - if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", safe_activecpu_get_pc(), data & 15, bankaddress); + if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", safe_cpu_get_pc(machine->activecpu), data & 15, bankaddress); } @@ -1445,12 +1445,12 @@ WRITE8_HANDLER( ataxx_slave_banksw_w ) if (bankaddress >= slave_length) { - logerror("%04X:Slave bank %02X out of range!", safe_activecpu_get_pc(), data & 0x3f); + logerror("%04X:Slave bank %02X out of range!", safe_cpu_get_pc(machine->activecpu), data & 0x3f); bankaddress = 0x2000; } memory_set_bankptr(3, &slave_base[bankaddress]); - if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", safe_activecpu_get_pc(), data, bankaddress); + if (LOG_BANKSWITCHING_S) logerror("%04X:Slave bank = %02X (%05X)\n", safe_cpu_get_pc(machine->activecpu), data, bankaddress); } diff --git a/src/mame/machine/lkage.c b/src/mame/machine/lkage.c index 00f48b635a5..e1288732df1 100644 --- a/src/mame/machine/lkage.c +++ b/src/mame/machine/lkage.c @@ -28,13 +28,13 @@ static UINT8 portA_in,portA_out,ddrA; READ8_HANDLER( lkage_68705_portA_r ) { -//logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in); return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE8_HANDLER( lkage_68705_portA_w ) { -//logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data); portA_out = data; } @@ -63,7 +63,7 @@ READ8_HANDLER( lkage_68705_portB_r ) WRITE8_HANDLER( lkage_68705_portB_w ) { -//logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data); if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) { @@ -95,13 +95,13 @@ READ8_HANDLER( lkage_68705_portC_r ) portC_in = 0; if (main_sent) portC_in |= 0x01; if (!mcu_sent) portC_in |= 0x02; -//logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),portC_in); +//logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(machine->activecpu),portC_in); return (portC_out & ddrC) | (portC_in & ~ddrC); } WRITE8_HANDLER( lkage_68705_portC_w ) { -logerror("%04x: 68705 port C write %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(machine->activecpu),data); portC_out = data; } @@ -113,7 +113,7 @@ WRITE8_HANDLER( lkage_68705_ddrC_w ) WRITE8_HANDLER( lkage_mcu_w ) { -logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); +logerror("%04x: mcu_w %02x\n",cpu_get_pc(machine->activecpu),data); from_main = data; main_sent = 1; cpunum_set_input_line(machine, 2,0,ASSERT_LINE); @@ -121,7 +121,7 @@ logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); READ8_HANDLER( lkage_mcu_r ) { -logerror("%04x: mcu_r %02x\n",activecpu_get_pc(),from_mcu); +logerror("%04x: mcu_r %02x\n",cpu_get_pc(machine->activecpu),from_mcu); mcu_sent = 0; return from_mcu; } @@ -132,7 +132,7 @@ READ8_HANDLER( lkage_mcu_status_r ) /* bit 0 = when 1, mcu is ready to receive data from main cpu */ /* bit 1 = when 1, mcu has sent data to the main cpu */ -//logerror("%04x: mcu_status_r\n",activecpu_get_pc()); +//logerror("%04x: mcu_status_r\n",cpu_get_pc(machine->activecpu)); if (!main_sent) res |= 0x01; if (mcu_sent) res |= 0x02; diff --git a/src/mame/machine/lsasquad.c b/src/mame/machine/lsasquad.c index 3c19fc9e2b3..43a7492e248 100644 --- a/src/mame/machine/lsasquad.c +++ b/src/mame/machine/lsasquad.c @@ -41,28 +41,28 @@ WRITE8_HANDLER( lsasquad_sound_command_w ) { lsasquad_sound_pending |= 0x01; sound_cmd = data; -//logerror("%04x: sound cmd %02x\n",activecpu_get_pc(),data); +//logerror("%04x: sound cmd %02x\n",cpu_get_pc(machine->activecpu),data); timer_call_after_resynch(NULL, data,nmi_callback); } READ8_HANDLER( lsasquad_sh_sound_command_r ) { lsasquad_sound_pending &= ~0x01; -//logerror("%04x: read sound cmd %02x\n",activecpu_get_pc(),sound_cmd); +//logerror("%04x: read sound cmd %02x\n",cpu_get_pc(machine->activecpu),sound_cmd); return sound_cmd; } WRITE8_HANDLER( lsasquad_sh_result_w ) { lsasquad_sound_pending |= 0x02; -//logerror("%04x: sound res %02x\n",activecpu_get_pc(),data); +//logerror("%04x: sound res %02x\n",cpu_get_pc(machine->activecpu),data); sound_result = data; } READ8_HANDLER( lsasquad_sound_result_r ) { lsasquad_sound_pending &= ~0x02; -//logerror("%04x: read sound res %02x\n",activecpu_get_pc(),sound_result); +//logerror("%04x: read sound res %02x\n",cpu_get_pc(machine->activecpu),sound_result); return sound_result; } @@ -78,7 +78,7 @@ READ8_HANDLER( daikaiju_sh_sound_command_r ) { lsasquad_sound_pending &= ~0x01; lsasquad_sound_pending |= 0x02; -//logerror("%04x: read sound cmd %02x\n",activecpu_get_pc(),sound_cmd); +//logerror("%04x: read sound cmd %02x\n",cpu_get_pc(machine->activecpu),sound_cmd); return sound_cmd; } @@ -105,13 +105,13 @@ static UINT8 portA_in,portA_out,ddrA; READ8_HANDLER( lsasquad_68705_portA_r ) { -//logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in); return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE8_HANDLER( lsasquad_68705_portA_w ) { -//logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data); portA_out = data; } @@ -140,7 +140,7 @@ READ8_HANDLER( lsasquad_68705_portB_r ) WRITE8_HANDLER( lsasquad_68705_portB_w ) { -//logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data); if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) { @@ -166,7 +166,7 @@ WRITE8_HANDLER( lsasquad_68705_ddrB_w ) WRITE8_HANDLER( lsasquad_mcu_w ) { -//logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: mcu_w %02x\n",cpu_get_pc(machine->activecpu),data); from_main = data; main_sent = 1; cpunum_set_input_line(machine, 2,0,ASSERT_LINE); @@ -174,7 +174,7 @@ WRITE8_HANDLER( lsasquad_mcu_w ) READ8_HANDLER( lsasquad_mcu_r ) { -//logerror("%04x: mcu_r %02x\n",activecpu_get_pc(),from_mcu); +//logerror("%04x: mcu_r %02x\n",cpu_get_pc(machine->activecpu),from_mcu); mcu_sent = 0; return from_mcu; } @@ -185,7 +185,7 @@ READ8_HANDLER( lsasquad_mcu_status_r ) /* bit 0 = when 1, mcu is ready to receive data from main cpu */ /* bit 1 = when 0, mcu has sent data to the main cpu */ -//logerror("%04x: mcu_status_r\n",activecpu_get_pc()); +//logerror("%04x: mcu_status_r\n",cpu_get_pc(machine->activecpu)); if (!main_sent) res |= 0x01; if (!mcu_sent) res |= 0x02; diff --git a/src/mame/machine/m68kfmly.c b/src/mame/machine/m68kfmly.c index 4d6d47ece56..a64b19a67f3 100644 --- a/src/mame/machine/m68kfmly.c +++ b/src/mame/machine/m68kfmly.c @@ -148,70 +148,70 @@ static UINT16 tmp68301_timer[0x50]; READ16_HANDLER( tmp68301_address_decoder_r ) { - LOG(("PC %08X: TMP68301_address_decoder_r (%08X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)))); + LOG(("PC %08X: TMP68301_address_decoder_r (%08X)\n", cpu_get_pc(machine->activecpu), (0xfffc00 + (offset * 2)))); return tmp68301_address_decoder[offset]; } WRITE16_HANDLER( tmp68301_address_decoder_w ) { - LOG(("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)), data)); + LOG(("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", cpu_get_pc(machine->activecpu), (0xfffc00 + (offset * 2)), data)); tmp68301_address_decoder[offset] = data; } READ16_HANDLER( tmp68301_interrupt_controller_r ) { - LOG(("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)))); + LOG(("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", cpu_get_pc(machine->activecpu), (0xfffc80 + (offset * 2)))); return tmp68301_interrupt_controller[offset]; } WRITE16_HANDLER( tmp68301_interrupt_controller_w ) { - LOG(("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)), data)); + LOG(("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", cpu_get_pc(machine->activecpu), (0xfffc80 + (offset * 2)), data)); tmp68301_interrupt_controller[offset] = data; } READ16_HANDLER( tmp68301_parallel_interface_r ) { - LOG(("PC %08X: TMP68301_parallel_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)))); + LOG(("PC %08X: TMP68301_parallel_interface_r (%08X)\n", cpu_get_pc(machine->activecpu), (0xfffd00 + (offset * 2)))); return tmp68301_parallel_interface[offset]; } WRITE16_HANDLER( tmp68301_parallel_interface_w ) { - LOG(("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)), data)); + LOG(("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", cpu_get_pc(machine->activecpu), (0xfffd00 + (offset * 2)), data)); tmp68301_parallel_interface[offset] = data; } READ16_HANDLER( tmp68301_serial_interface_r ) { - LOG(("PC %08X: TMP68301_serial_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)))); + LOG(("PC %08X: TMP68301_serial_interface_r (%08X)\n", cpu_get_pc(machine->activecpu), (0xfffd80 + (offset * 2)))); return tmp68301_serial_interface[offset]; } WRITE16_HANDLER( tmp68301_serial_interface_w ) { - LOG(("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)), data)); + LOG(("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", cpu_get_pc(machine->activecpu), (0xfffd80 + (offset * 2)), data)); tmp68301_serial_interface[offset] = data; } READ16_HANDLER( tmp68301_timer_r ) { - LOG(("PC %08X: TMP68301_timer_r (%08X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)))); + LOG(("PC %08X: TMP68301_timer_r (%08X)\n", cpu_get_pc(machine->activecpu), (0xfffe00 + (offset * 2)))); return tmp68301_timer[offset]; } WRITE16_HANDLER( tmp68301_timer_w ) { - LOG(("PC %08X: TMP68301_timer_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)), data)); + LOG(("PC %08X: TMP68301_timer_w (%08X = %04X)\n", cpu_get_pc(machine->activecpu), (0xfffe00 + (offset * 2)), data)); tmp68301_timer[offset] = data; } diff --git a/src/mame/machine/maniach.c b/src/mame/machine/maniach.c index 5961aa3ab22..9412b3c4295 100644 --- a/src/mame/machine/maniach.c +++ b/src/mame/machine/maniach.c @@ -27,13 +27,13 @@ static UINT8 portA_in,portA_out,ddrA; READ8_HANDLER( maniach_68705_portA_r ) { -//logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in); return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE8_HANDLER( maniach_68705_portA_w ) { -//logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data); portA_out = data; } @@ -62,7 +62,7 @@ READ8_HANDLER( maniach_68705_portB_r ) WRITE8_HANDLER( maniach_68705_portB_w ) { -//logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data); if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) { @@ -93,13 +93,13 @@ READ8_HANDLER( maniach_68705_portC_r ) portC_in = 0; if (main_sent) portC_in |= 0x01; if (!mcu_sent) portC_in |= 0x02; -//logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),portC_in); +//logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(machine->activecpu),portC_in); return (portC_out & ddrC) | (portC_in & ~ddrC); } WRITE8_HANDLER( maniach_68705_portC_w ) { -//logerror("%04x: 68705 port C write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(machine->activecpu),data); portC_out = data; } @@ -111,14 +111,14 @@ WRITE8_HANDLER( maniach_68705_ddrC_w ) WRITE8_HANDLER( maniach_mcu_w ) { -//logerror("%04x: 3040_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 3040_w %02x\n",cpu_get_pc(machine->activecpu),data); from_main = data; main_sent = 1; } READ8_HANDLER( maniach_mcu_r ) { -//logerror("%04x: 3040_r %02x\n",activecpu_get_pc(),from_mcu); +//logerror("%04x: 3040_r %02x\n",cpu_get_pc(machine->activecpu),from_mcu); mcu_sent = 0; return from_mcu; } @@ -129,7 +129,7 @@ READ8_HANDLER( maniach_mcu_status_r ) /* bit 0 = when 0, mcu has sent data to the main cpu */ /* bit 1 = when 1, mcu is ready to receive data from main cpu */ -//logerror("%04x: 3041_r\n",activecpu_get_pc()); +//logerror("%04x: 3041_r\n",cpu_get_pc(machine->activecpu)); if (!mcu_sent) res |= 0x01; if (!main_sent) res |= 0x02; diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c index 21f3f6ad4fa..57c45427ad3 100644 --- a/src/mame/machine/mcr.c +++ b/src/mame/machine/mcr.c @@ -816,13 +816,13 @@ static WRITE8_HANDLER( mcr68_6840_w_common ) if (diffs & 0x02) reload_count(counter); - LOG(("%06X:Counter %d control = %02X\n", activecpu_get_previouspc(), counter, data)); + LOG(("%06X:Counter %d control = %02X\n", cpu_get_previouspc(machine->activecpu), counter, data)); } /* offsets 2, 4, and 6 are MSB buffer registers */ else if ((offset & 1) == 0) { - LOG(("%06X:MSB = %02X\n", activecpu_get_previouspc(), data)); + LOG(("%06X:MSB = %02X\n", cpu_get_previouspc(machine->activecpu), data)); m6840_msb_buffer = data; } @@ -840,7 +840,7 @@ static WRITE8_HANDLER( mcr68_6840_w_common ) if (!(m6840_state[counter].control & 0x10)) reload_count(counter); - LOG(("%06X:Counter %d latch = %04X\n", activecpu_get_previouspc(), counter, m6840_state[counter].latch)); + LOG(("%06X:Counter %d latch = %04X\n", cpu_get_previouspc(machine->activecpu), counter, m6840_state[counter].latch)); } } @@ -854,7 +854,7 @@ static READ16_HANDLER( mcr68_6840_r_common ) /* offset 1 is the status register */ else if (offset == 1) { - LOG(("%06X:Status read = %04X\n", activecpu_get_previouspc(), m6840_status)); + LOG(("%06X:Status read = %04X\n", cpu_get_previouspc(machine->activecpu), m6840_status)); m6840_status_read_since_int |= m6840_status & 0x07; return m6840_status; } @@ -872,7 +872,7 @@ static READ16_HANDLER( mcr68_6840_r_common ) m6840_lsb_buffer = result & 0xff; - LOG(("%06X:Counter %d read = %04X\n", activecpu_get_previouspc(), counter, result)); + LOG(("%06X:Counter %d read = %04X\n", cpu_get_previouspc(machine->activecpu), counter, result)); return result >> 8; } @@ -949,7 +949,7 @@ WRITE8_HANDLER( mcr_ipu_laserdisk_w ) /* bit 1 enables (1) LD left channel audio */ /* bit 0 enables (1) LD video if PIX SW == 1 */ if (data != 0) - logerror("%04X:mcr_ipu_laserdisk_w(%d) = %02X\n", activecpu_get_pc(), offset, data); + logerror("%04X:mcr_ipu_laserdisk_w(%d) = %02X\n", cpu_get_pc(machine->activecpu), offset, data); } diff --git a/src/mame/machine/mexico86.c b/src/mame/machine/mexico86.c index 64e290f3459..d1aeb6cc82b 100644 --- a/src/mame/machine/mexico86.c +++ b/src/mame/machine/mexico86.c @@ -236,13 +236,13 @@ static UINT8 portA_in,portA_out,ddrA; READ8_HANDLER( mexico86_68705_portA_r ) { -//logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in); return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE8_HANDLER( mexico86_68705_portA_w ) { -//logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data); portA_out = data; } @@ -280,7 +280,7 @@ static int address,latch; WRITE8_HANDLER( mexico86_68705_portB_w ) { -//logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data); if ((ddrB & 0x01) && (~data & 0x01) && (portB_out & 0x01)) { @@ -289,7 +289,7 @@ WRITE8_HANDLER( mexico86_68705_portB_w ) if ((ddrB & 0x02) && (data & 0x02) && (~portB_out & 0x02)) /* positive edge trigger */ { address = portA_out; -//if (address >= 0x80) logerror("%04x: 68705 address %02x\n",activecpu_get_pc(),portA_out); +//if (address >= 0x80) logerror("%04x: 68705 address %02x\n",cpu_get_pc(machine->activecpu),portA_out); } if ((ddrB & 0x08) && (~data & 0x08) && (portB_out & 0x08)) { @@ -297,18 +297,18 @@ WRITE8_HANDLER( mexico86_68705_portB_w ) { if (data & 0x04) { -//logerror("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),shared[0x800+address],address); +//logerror("%04x: 68705 read %02x from address %04x\n",cpu_get_pc(machine->activecpu),shared[0x800+address],address); latch = mexico86_protection_ram[address]; } else { -//logerror("%04x: 68705 read input port %04x\n",activecpu_get_pc(),address); +//logerror("%04x: 68705 read input port %04x\n",cpu_get_pc(machine->activecpu),address); latch = input_port_read(machine, (address & 1) ? "IN2" : "IN1"); } } else /* write */ { -//logerror("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address); +//logerror("%04x: 68705 write %02x to address %04x\n",cpu_get_pc(machine->activecpu),portA_out,address); mexico86_protection_ram[address] = portA_out; } } @@ -320,11 +320,11 @@ WRITE8_HANDLER( mexico86_68705_portB_w ) } if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40)) { -logerror("%04x: 68705 unknown port B bit %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 unknown port B bit %02x\n",cpu_get_pc(machine->activecpu),data); } if ((ddrB & 0x80) && (~data & 0x80) && (portB_out & 0x80)) { -logerror("%04x: 68705 unknown port B bit %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 unknown port B bit %02x\n",cpu_get_pc(machine->activecpu),data); } portB_out = data; diff --git a/src/mame/machine/midtunit.c b/src/mame/machine/midtunit.c index 7f2f8c86ce3..6d58f0cecf8 100644 --- a/src/mame/machine/midtunit.c +++ b/src/mame/machine/midtunit.c @@ -84,7 +84,7 @@ WRITE16_HANDLER( midtunit_cmos_w ) } else { - logerror("%08X:Unexpected CMOS W @ %05X\n", activecpu_get_pc(), offset); + logerror("%08X:Unexpected CMOS W @ %05X\n", cpu_get_pc(machine->activecpu), offset); popmessage("Bad CMOS write"); } } @@ -132,12 +132,12 @@ static const UINT8 mk_prot_values[] = static READ16_HANDLER( mk_prot_r ) { - logerror("%08X:Protection R @ %05X = %04X\n", activecpu_get_pc(), offset, mk_prot_values[mk_prot_index] << 9); + logerror("%08X:Protection R @ %05X = %04X\n", cpu_get_pc(machine->activecpu), offset, mk_prot_values[mk_prot_index] << 9); /* just in case */ if (mk_prot_index >= sizeof(mk_prot_values)) { - logerror("%08X:Unexpected protection R @ %05X\n", activecpu_get_pc(), offset); + logerror("%08X:Unexpected protection R @ %05X\n", cpu_get_pc(machine->activecpu), offset); mk_prot_index = 0; } @@ -162,11 +162,11 @@ static WRITE16_HANDLER( mk_prot_w ) /* just in case */ if (i == sizeof(mk_prot_values)) { - logerror("%08X:Unhandled protection W @ %05X = %04X\n", activecpu_get_pc(), offset, data); + logerror("%08X:Unhandled protection W @ %05X = %04X\n", cpu_get_pc(machine->activecpu), offset, data); mk_prot_index = 0; } - logerror("%08X:Protection W @ %05X = %04X\n", activecpu_get_pc(), offset, data); + logerror("%08X:Protection W @ %05X = %04X\n", cpu_get_pc(machine->activecpu), offset, data); } } @@ -319,7 +319,7 @@ static const UINT8 jdredd_prot_values_80020[] = static WRITE16_HANDLER( jdredd_prot_w ) { - logerror("%08X:jdredd_prot_w(%04X,%04X)\n", activecpu_get_previouspc(), offset*16, data); + logerror("%08X:jdredd_prot_w(%04X,%04X)\n", cpu_get_previouspc(machine->activecpu), offset*16, data); switch (offset) { @@ -367,7 +367,7 @@ static READ16_HANDLER( jdredd_prot_r ) if (jdredd_prot_table && jdredd_prot_index < jdredd_prot_max) result = jdredd_prot_table[jdredd_prot_index++] << 9; - logerror("%08X:jdredd_prot_r(%04X) = %04X\n", activecpu_get_previouspc(), offset*16, result); + logerror("%08X:jdredd_prot_r(%04X) = %04X\n", cpu_get_previouspc(machine->activecpu), offset*16, result); return result; } @@ -376,7 +376,7 @@ static READ16_HANDLER( jdredd_prot_r ) static UINT16 *jdredd_hack; static READ16_HANDLER( jdredd_hack_r ) { - if (activecpu_get_pc() == 0xFFBA7EB0) + if (cpu_get_pc(machine->activecpu) == 0xFFBA7EB0) { fprintf(stderr, "jdredd_hack_r\n"); return 0; @@ -423,7 +423,7 @@ static void init_tunit_generic(running_machine *machine, int sound) break; case SOUND_DCS: - dcs_init(); + dcs_init(machine); break; } @@ -573,7 +573,7 @@ MACHINE_RESET( midtunit ) READ16_HANDLER( midtunit_sound_state_r ) { -/* logerror("%08X:Sound status read\n", activecpu_get_pc());*/ +/* logerror("%08X:Sound status read\n", cpu_get_pc(machine->activecpu));*/ if (chip_type == SOUND_DCS) return dcs_control_r() >> 4; @@ -588,7 +588,7 @@ READ16_HANDLER( midtunit_sound_state_r ) READ16_HANDLER( midtunit_sound_r ) { - logerror("%08X:Sound data read\n", activecpu_get_pc()); + logerror("%08X:Sound data read\n", cpu_get_pc(machine->activecpu)); if (chip_type == SOUND_DCS) return dcs_data_r() & 0xff; @@ -601,7 +601,7 @@ WRITE16_HANDLER( midtunit_sound_w ) /* check for out-of-bounds accesses */ if (!offset) { - logerror("%08X:Unexpected write to sound (lo) = %04X\n", activecpu_get_pc(), data); + logerror("%08X:Unexpected write to sound (lo) = %04X\n", cpu_get_pc(machine->activecpu), data); return; } @@ -619,7 +619,7 @@ WRITE16_HANDLER( midtunit_sound_w ) break; case SOUND_DCS: - logerror("%08X:Sound write = %04X\n", activecpu_get_pc(), data); + logerror("%08X:Sound write = %04X\n", cpu_get_pc(machine->activecpu), data); dcs_reset_w(~data & 0x100); dcs_data_w(data & 0xff); /* the games seem to check for $82 loops, so this should be just barely enough */ diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c index 888a4ee18c6..c216dbc1520 100644 --- a/src/mame/machine/midwayic.c +++ b/src/mame/machine/midwayic.c @@ -208,7 +208,7 @@ UINT8 midway_serial_pic_status_r(void) UINT8 midway_serial_pic_r(void) { - logerror("%08X:security R = %04X\n", safe_activecpu_get_pc(), serial.buffer); + logerror("%08X:security R = %04X\n", safe_cpu_get_pc(Machine->activecpu), serial.buffer); serial.status = 1; return serial.buffer; } @@ -216,7 +216,7 @@ UINT8 midway_serial_pic_r(void) void midway_serial_pic_w(UINT8 data) { - logerror("%08X:security W = %04X\n", safe_activecpu_get_pc(), data); + logerror("%08X:security W = %04X\n", safe_cpu_get_pc(Machine->activecpu), data); /* status seems to reflect the clock bit */ serial.status = (data >> 4) & 1; @@ -308,7 +308,7 @@ UINT8 midway_serial_pic2_status_r(void) result = 1; } - logerror("%06X:PIC status %d\n", safe_activecpu_get_pc(), result); + logerror("%06X:PIC status %d\n", safe_cpu_get_pc(Machine->activecpu), result); return result; } @@ -318,7 +318,7 @@ UINT8 midway_serial_pic2_r(void) UINT8 result = 0; /* PIC data register */ - logerror("%06X:PIC data read (index=%d total=%d latch=%03X) =", safe_activecpu_get_pc(), pic.index, pic.total, pic.latch); + logerror("%06X:PIC data read (index=%d total=%d latch=%03X) =", safe_cpu_get_pc(Machine->activecpu), pic.index, pic.total, pic.latch); /* return the current result */ if (pic.latch & 0xf00) @@ -341,9 +341,9 @@ void midway_serial_pic2_w(running_machine *machine, UINT8 data) /* PIC command register */ if (pic.state == 0) - logerror("%06X:PIC command %02X\n", safe_activecpu_get_pc(), data); + logerror("%06X:PIC command %02X\n", safe_cpu_get_pc(machine->activecpu), data); else - logerror("%06X:PIC data %02X\n", safe_activecpu_get_pc(), data); + logerror("%06X:PIC data %02X\n", safe_cpu_get_pc(machine->activecpu), data); /* store in the latch, along with a bit to indicate we have data */ pic.latch = (data & 0x00f) | 0x480; @@ -745,7 +745,7 @@ static UINT16 ioasic_fifo_r(void) /* main CPU is handling the I/O ASIC interrupt */ if (ioasic.fifo_bytes == 0 && ioasic.has_dcs) { - ioasic.fifo_force_buffer_empty_pc = safe_activecpu_get_pc(); + ioasic.fifo_force_buffer_empty_pc = safe_cpu_get_pc(Machine->activecpu); if (LOG_FIFO) logerror("fifo_r(%04X): FIFO empty, PC = %04X\n", result, ioasic.fifo_force_buffer_empty_pc); } @@ -773,9 +773,9 @@ static UINT16 ioasic_fifo_status_r(void) /* kludge alert: if we're reading this from the DCS CPU itself, and we recently cleared */ /* the FIFO, and we're within 16 instructions of the read that cleared the FIFO, make */ /* sure the FIFO clear bit is set */ - if (ioasic.fifo_force_buffer_empty_pc && cpu_getactivecpu() == ioasic.dcs_cpu) + if (ioasic.fifo_force_buffer_empty_pc && cpunum_get_active() == ioasic.dcs_cpu) { - offs_t currpc = safe_activecpu_get_pc(); + offs_t currpc = safe_cpu_get_pc(Machine->activecpu); if (currpc >= ioasic.fifo_force_buffer_empty_pc && currpc < ioasic.fifo_force_buffer_empty_pc + 0x10) { ioasic.fifo_force_buffer_empty_pc = 0; @@ -801,7 +801,7 @@ void midway_ioasic_fifo_reset_w(running_machine *machine, int state) update_ioasic_irq(machine); } if (LOG_FIFO) - logerror("%08X:fifo_reset(%d)\n", safe_activecpu_get_pc(), state); + logerror("%08X:fifo_reset(%d)\n", safe_cpu_get_pc(machine->activecpu), state); } @@ -933,7 +933,7 @@ READ32_HANDLER( midway_ioasic_r ) } if (LOG_IOASIC && offset != IOASIC_SOUNDSTAT && offset != IOASIC_SOUNDIN) - logerror("%06X:ioasic_r(%d) = %08X\n", safe_activecpu_get_pc(), offset, result); + logerror("%06X:ioasic_r(%d) = %08X\n", safe_cpu_get_pc(machine->activecpu), offset, result); return result; } @@ -958,7 +958,7 @@ WRITE32_HANDLER( midway_ioasic_w ) newreg = ioasic.reg[offset]; if (LOG_IOASIC && offset != IOASIC_SOUNDOUT) - logerror("%06X:ioasic_w(%d) = %08X\n", safe_activecpu_get_pc(), offset, data); + logerror("%06X:ioasic_w(%d) = %08X\n", safe_cpu_get_pc(machine->activecpu), offset, data); switch (offset) { @@ -1001,9 +1001,9 @@ WRITE32_HANDLER( midway_ioasic_w ) { if ((oldreg ^ newreg) & 1) { - cage_control_w(0); + cage_control_w(machine, 0); if (!(~newreg & 1)) - cage_control_w(3); + cage_control_w(machine, 3); } } diff --git a/src/mame/machine/midwunit.c b/src/mame/machine/midwunit.c index 47c305cdf1f..db52ac6fbf5 100644 --- a/src/mame/machine/midwunit.c +++ b/src/mame/machine/midwunit.c @@ -73,7 +73,7 @@ WRITE16_HANDLER( midwunit_cmos_w ) } else { - logerror("%08X:Unexpected CMOS W @ %05X\n", activecpu_get_pc(), offset); + logerror("%08X:Unexpected CMOS W @ %05X\n", cpu_get_pc(machine->activecpu), offset); popmessage("Bad CMOS write"); } } @@ -110,7 +110,7 @@ WRITE16_HANDLER( midwunit_io_w ) switch (offset) { case 1: - logerror("%08X:Control W @ %05X = %04X\n", activecpu_get_pc(), offset, data); + logerror("%08X:Control W @ %05X = %04X\n", cpu_get_pc(machine->activecpu), offset, data); /* bit 4 reset sound CPU */ dcs_reset_w(newword & 0x10); @@ -126,7 +126,7 @@ WRITE16_HANDLER( midwunit_io_w ) break; default: - logerror("%08X:Unknown I/O write to %d = %04X\n", activecpu_get_pc(), offset, data); + logerror("%08X:Unknown I/O write to %d = %04X\n", cpu_get_pc(machine->activecpu), offset, data); break; } iodata[offset] = newword; @@ -150,8 +150,8 @@ WRITE16_HANDLER( midxunit_io_w ) break; default: - logerror("%08X:I/O write to %d = %04X\n", activecpu_get_pc(), offset, data); -// logerror("%08X:Unknown I/O write to %d = %04X\n", activecpu_get_pc(), offset, data); + logerror("%08X:I/O write to %d = %04X\n", cpu_get_pc(machine->activecpu), offset, data); +// logerror("%08X:Unknown I/O write to %d = %04X\n", cpu_get_pc(machine->activecpu), offset, data); break; } iodata[offset] = newword; @@ -166,7 +166,7 @@ WRITE16_HANDLER( midxunit_unknown_w ) dcs_reset_w(data & 2); if (ACCESSING_BITS_0_7 && offset % 0x40000 == 0) - logerror("%08X:midxunit_unknown_w @ %d = %02X\n", activecpu_get_pc(), offs, data & 0xff); + logerror("%08X:midxunit_unknown_w @ %d = %02X\n", cpu_get_pc(machine->activecpu), offs, data & 0xff); } @@ -196,7 +196,7 @@ READ16_HANDLER( midwunit_io_r ) return (midway_serial_pic_status_r() << 12) | midwunit_sound_state_r(machine,0,0xffff); default: - logerror("%08X:Unknown I/O read from %d\n", activecpu_get_pc(), offset); + logerror("%08X:Unknown I/O read from %d\n", cpu_get_pc(machine->activecpu), offset); break; } return ~0; @@ -218,7 +218,7 @@ READ16_HANDLER( midxunit_io_r ) return input_port_read(machine, portnames[offset]); default: - logerror("%08X:Unknown I/O read from %d\n", activecpu_get_pc(), offset); + logerror("%08X:Unknown I/O read from %d\n", cpu_get_pc(machine->activecpu), offset); break; } return ~0; @@ -326,7 +326,7 @@ READ16_HANDLER( midxunit_uart_r ) break; } -/* logerror("%08X:UART R @ %X = %02X\n", activecpu_get_pc(), offset, result);*/ +/* logerror("%08X:UART R @ %X = %02X\n", cpu_get_pc(machine->activecpu), offset, result);*/ return result; } @@ -362,7 +362,7 @@ WRITE16_HANDLER( midxunit_uart_w ) break; } -/* logerror("%08X:UART W @ %X = %02X\n", activecpu_get_pc(), offset, data);*/ +/* logerror("%08X:UART W @ %X = %02X\n", cpu_get_pc(machine->activecpu), offset, data);*/ } @@ -373,7 +373,7 @@ WRITE16_HANDLER( midxunit_uart_w ) * *************************************/ -static void init_wunit_generic(void) +static void init_wunit_generic(running_machine *machine) { UINT8 *base; int i, j, len; @@ -397,7 +397,7 @@ static void init_wunit_generic(void) } /* init sound */ - dcs_init(); + dcs_init(machine); } @@ -443,7 +443,7 @@ static WRITE16_HANDLER( umk3_palette_hack_w ) static void init_mk3_common(running_machine *machine) { /* common init */ - init_wunit_generic(); + init_wunit_generic(machine); /* serial prefixes 439, 528 */ midway_serial_pic_init(machine, 528); @@ -482,7 +482,7 @@ DRIVER_INIT( umk3r11 ) DRIVER_INIT( openice ) { /* common init */ - init_wunit_generic(); + init_wunit_generic(machine); /* serial prefixes 438, 528 */ midway_serial_pic_init(machine, 528); @@ -494,7 +494,7 @@ DRIVER_INIT( openice ) DRIVER_INIT( nbahangt ) { /* common init */ - init_wunit_generic(); + init_wunit_generic(machine); /* serial prefixes 459, 470, 528 */ midway_serial_pic_init(machine, 528); @@ -555,7 +555,7 @@ static WRITE16_HANDLER( wwfmania_io_0_w ) DRIVER_INIT( wwfmania ) { /* common init */ - init_wunit_generic(); + init_wunit_generic(machine); /* enable I/O shuffling */ memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01800000, 0x0180000f, 0, 0, wwfmania_io_0_w); @@ -570,7 +570,7 @@ DRIVER_INIT( wwfmania ) DRIVER_INIT( rmpgwt ) { /* common init */ - init_wunit_generic(); + init_wunit_generic(machine); /* serial prefixes 465, 528 */ midway_serial_pic_init(machine, 528); @@ -603,7 +603,7 @@ DRIVER_INIT( revx ) } /* init sound */ - dcs_init(); + dcs_init(machine); /* serial prefixes 419, 420 */ midway_serial_pic_init(machine, 419); @@ -681,7 +681,7 @@ WRITE16_HANDLER( midxunit_security_clock_w ) READ16_HANDLER( midwunit_sound_r ) { - logerror("%08X:Sound read\n", activecpu_get_pc()); + logerror("%08X:Sound read\n", cpu_get_pc(machine->activecpu)); return dcs_data_r() & 0xff; } @@ -698,14 +698,14 @@ WRITE16_HANDLER( midwunit_sound_w ) /* check for out-of-bounds accesses */ if (offset) { - logerror("%08X:Unexpected write to sound (hi) = %04X\n", activecpu_get_pc(), data); + logerror("%08X:Unexpected write to sound (hi) = %04X\n", cpu_get_pc(machine->activecpu), data); return; } /* call through based on the sound type */ if (ACCESSING_BITS_0_7) { - logerror("%08X:Sound write = %04X\n", activecpu_get_pc(), data); + logerror("%08X:Sound write = %04X\n", cpu_get_pc(machine->activecpu), data); dcs_data_w(data & 0xff); } } diff --git a/src/mame/machine/midyunit.c b/src/mame/machine/midyunit.c index 0a97bb6fe66..22db2aacf6e 100644 --- a/src/mame/machine/midyunit.c +++ b/src/mame/machine/midyunit.c @@ -56,7 +56,7 @@ static UINT16 *t2_hack_mem; WRITE16_HANDLER( midyunit_cmos_w ) { - logerror("%08x:CMOS Write @ %05X\n", activecpu_get_pc(), offset); + logerror("%08x:CMOS Write @ %05X\n", cpu_get_pc(machine->activecpu), offset); COMBINE_DATA(&midyunit_cmos_ram[offset + midyunit_cmos_page]); } @@ -78,7 +78,7 @@ WRITE16_HANDLER( midyunit_cmos_enable_w ) { cmos_w_enable = (~data >> 9) & 1; - logerror("%08x:Protection write = %04X\n", activecpu_get_pc(), data); + logerror("%08x:Protection write = %04X\n", cpu_get_pc(machine->activecpu), data); /* only go down this path if we have a data structure */ if (prot_data) @@ -127,7 +127,7 @@ WRITE16_HANDLER( midyunit_cmos_enable_w ) READ16_HANDLER( midyunit_protection_r ) { /* return the most recently clocked value */ - logerror("%08X:Protection read = %04X\n", activecpu_get_pc(), prot_result); + logerror("%08X:Protection read = %04X\n", cpu_get_pc(machine->activecpu), prot_result); return prot_result; } @@ -190,7 +190,7 @@ static WRITE16_HANDLER( term2_sound_w ) static WRITE16_HANDLER( term2_hack_w ) { - if (offset == 0 && activecpu_get_pc() == 0xffce5230) + if (offset == 0 && cpu_get_pc(machine->activecpu) == 0xffce5230) { t2_hack_mem[offset] = 0; return; @@ -200,7 +200,7 @@ static WRITE16_HANDLER( term2_hack_w ) static WRITE16_HANDLER( term2la2_hack_w ) { - if (offset == 0 && activecpu_get_pc() == 0xffce4b80) + if (offset == 0 && cpu_get_pc(machine->activecpu) == 0xffce4b80) { t2_hack_mem[offset] = 0; return; @@ -210,7 +210,7 @@ static WRITE16_HANDLER( term2la2_hack_w ) static WRITE16_HANDLER( term2la1_hack_w ) { - if (offset == 0 && activecpu_get_pc() == 0xffce33f0) + if (offset == 0 && cpu_get_pc(machine->activecpu) == 0xffce33f0) { t2_hack_mem[offset] = 0; return; @@ -558,7 +558,7 @@ WRITE16_HANDLER( midyunit_sound_w ) /* check for out-of-bounds accesses */ if (offset) { - logerror("%08X:Unexpected write to sound (hi) = %04X\n", activecpu_get_pc(), data); + logerror("%08X:Unexpected write to sound (hi) = %04X\n", cpu_get_pc(machine->activecpu), data); return; } diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c index fe44bad7ec6..f022ff5d538 100644 --- a/src/mame/machine/model1.c +++ b/src/mame/machine/model1.c @@ -40,7 +40,7 @@ static UINT32 fifoout_pop(void) { UINT32 v; if(fifoout_wpos == fifoout_rpos) { - fatalerror("TGP FIFOOUT underflow (%x)", activecpu_get_pc()); + fatalerror("TGP FIFOOUT underflow (%x)", cpu_get_pc(Machine->activecpu)); } v = fifoout_data[fifoout_rpos++]; if(fifoout_rpos == FIFO_SIZE) @@ -84,7 +84,7 @@ static UINT32 fifoin_pop(void) static void fifoin_push(UINT32 data) { - // logerror("TGP FIFOIN write %08x (%x)\n", data, activecpu_get_pc()); + // logerror("TGP FIFOIN write %08x (%x)\n", data, cpu_get_pc(Machine->activecpu)); fifoin_data[fifoin_wpos++] = data; if(fifoin_wpos == FIFO_SIZE) fifoin_wpos = 0; @@ -148,7 +148,7 @@ static void fadd(void) float a = fifoin_pop_f(); float b = fifoin_pop_f(); float r = a+b; - logerror("TGP fadd %f+%f=%f (%x)\n", a, b, r, activecpu_get_pc()); + logerror("TGP fadd %f+%f=%f (%x)\n", a, b, r, cpu_get_pc(Machine->activecpu)); fifoout_push_f(r); next_fn(); } @@ -159,7 +159,7 @@ static void fsub(void) float b = fifoin_pop_f(); float r = a-b; model1_dump = 1; - logerror("TGP fsub %f-%f=%f (%x)\n", a, b, r, activecpu_get_pc()); + logerror("TGP fsub %f-%f=%f (%x)\n", a, b, r, cpu_get_pc(Machine->activecpu)); fifoout_push_f(r); next_fn(); } @@ -169,7 +169,7 @@ static void fmul(void) float a = fifoin_pop_f(); float b = fifoin_pop_f(); float r = a*b; - logerror("TGP fmul %f*%f=%f (%x)\n", a, b, r, activecpu_get_pc()); + logerror("TGP fmul %f*%f=%f (%x)\n", a, b, r, cpu_get_pc(Machine->activecpu)); fifoout_push_f(r); next_fn(); } @@ -180,7 +180,7 @@ static void fdiv(void) float b = fifoin_pop_f(); // float r = !b ? 1e39 : a/b; float r = !b ? 0 : a * (1/b); - logerror("TGP fdiv %f/%f=%f (%x)\n", a, b, r, activecpu_get_pc()); + logerror("TGP fdiv %f/%f=%f (%x)\n", a, b, r, cpu_get_pc(Machine->activecpu)); fifoout_push_f(r); next_fn(); } @@ -191,7 +191,7 @@ static void matrix_push(void) memcpy(mat_stack[mat_stack_pos], cmat, sizeof(cmat)); mat_stack_pos++; } - logerror("TGP matrix_push (depth=%d, pc=%x)\n", mat_stack_pos, activecpu_get_pc()); + logerror("TGP matrix_push (depth=%d, pc=%x)\n", mat_stack_pos, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -201,7 +201,7 @@ static void matrix_pop(void) mat_stack_pos--; memcpy(cmat, mat_stack[mat_stack_pos], sizeof(cmat)); } - logerror("TGP matrix_pop (depth=%d, pc=%x)\n", mat_stack_pos, activecpu_get_pc()); + logerror("TGP matrix_pop (depth=%d, pc=%x)\n", mat_stack_pos, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -212,13 +212,13 @@ static void matrix_write(void) cmat[i] = fifoin_pop_f(); logerror("TGP matrix_write %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f) (%x)\n", cmat[0], cmat[1], cmat[2], cmat[3], cmat[4], cmat[5], cmat[6], cmat[7], cmat[8], cmat[9], cmat[10], cmat[11], - activecpu_get_pc()); + cpu_get_pc(Machine->activecpu)); next_fn(); } static void clear_stack(void) { - logerror("TGP clear_stack (%x)\n", activecpu_get_pc()); + logerror("TGP clear_stack (%x)\n", cpu_get_pc(Machine->activecpu)); mat_stack_pos = 0; next_fn(); } @@ -238,7 +238,7 @@ static void matrix_mul(void) float j = fifoin_pop_f(); float k = fifoin_pop_f(); float l = fifoin_pop_f(); - logerror("TGP matrix_mul %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, j, k, l, activecpu_get_pc()); + logerror("TGP matrix_mul %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, j, k, l, cpu_get_pc(Machine->activecpu)); m[0] = a*cmat[0] + b*cmat[3] + c*cmat[6]; m[1] = a*cmat[1] + b*cmat[4] + c*cmat[7]; m[2] = a*cmat[2] + b*cmat[5] + c*cmat[8]; @@ -260,7 +260,7 @@ static void anglev(void) { float a = fifoin_pop_f(); float b = fifoin_pop_f(); - logerror("TGP anglev %f, %f (%x)\n", a, b, activecpu_get_pc()); + logerror("TGP anglev %f, %f (%x)\n", a, b, cpu_get_pc(Machine->activecpu)); if(!b) { if(a>=0) fifoout_push(0); @@ -296,7 +296,7 @@ static void f11(void) (void)g; (void)h; (void)i; - logerror("TGP f11 %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, activecpu_get_pc()); + logerror("TGP f11 %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, cpu_get_pc(Machine->activecpu)); fifoout_push_f(0); fifoout_push_f(0); fifoout_push_f(0); @@ -309,7 +309,7 @@ static void normalize(void) float b = fifoin_pop_f(); float c = fifoin_pop_f(); float n = (a*a+b*b+c*c) / sqrt(a*a+b*b+c*c); - logerror("TGP normalize %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP normalize %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); fifoout_push_f(a/n); fifoout_push_f(b/n); fifoout_push_f(c/n); @@ -320,7 +320,7 @@ static void acc_seti(void) { INT32 a = fifoin_pop(); model1_dump = 1; - logerror("TGP acc_seti %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP acc_seti %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); acc = a; next_fn(); } @@ -328,7 +328,7 @@ static void acc_seti(void) static void track_select(void) { INT32 a = fifoin_pop(); - logerror("TGP track_select %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP track_select %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); tgp_vr_select = a; next_fn(); } @@ -345,7 +345,7 @@ static void f14(void) static void f15_swa(void) { - logerror("TGP f15_swa (%x)\n", activecpu_get_pc()); + logerror("TGP f15_swa (%x)\n", cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -356,7 +356,7 @@ static void anglep(void) float b = fifoin_pop_f(); float c = fifoin_pop_f(); float d = fifoin_pop_f(); - logerror("TGP anglep %f, %f, %f, %f (%x)\n", a, b, c, d, activecpu_get_pc()); + logerror("TGP anglep %f, %f, %f, %f (%x)\n", a, b, c, d, cpu_get_pc(Machine->activecpu)); c = a - c; d = b - d; if(!d) { @@ -376,7 +376,7 @@ static void anglep(void) static void matrix_ident(void) { - logerror("TGP matrix_ident (%x)\n", activecpu_get_pc()); + logerror("TGP matrix_ident (%x)\n", cpu_get_pc(Machine->activecpu)); memset(cmat, 0, sizeof(cmat)); cmat[0] = 1.0; cmat[4] = 1.0; @@ -388,7 +388,7 @@ static void matrix_read(void) { int i; logerror("TGP matrix_read (%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f) (%x)\n", - cmat[0], cmat[1], cmat[2], cmat[3], cmat[4], cmat[5], cmat[6], cmat[7], cmat[8], cmat[9], cmat[10], cmat[11], activecpu_get_pc()); + cmat[0], cmat[1], cmat[2], cmat[3], cmat[4], cmat[5], cmat[6], cmat[7], cmat[8], cmat[9], cmat[10], cmat[11], cpu_get_pc(Machine->activecpu)); for(i=0; i<12; i++) fifoout_push_f(cmat[i]); next_fn(); @@ -411,7 +411,7 @@ static void matrix_scale(void) float a = fifoin_pop_f(); float b = fifoin_pop_f(); float c = fifoin_pop_f(); - logerror("TGP matrix_scale %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP matrix_scale %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); cmat[0] *= a; cmat[1] *= a; cmat[2] *= a; @@ -430,7 +430,7 @@ static void matrix_rotx(void) float s = tsin(a); float c = tcos(a); float t1, t2; - logerror("TGP matrix_rotx %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP matrix_rotx %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); t1 = cmat[3]; t2 = cmat[6]; cmat[3] = c*t1-s*t2; @@ -453,7 +453,7 @@ static void matrix_roty(void) float c = tcos(a); float t1, t2; - logerror("TGP matrix_roty %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP matrix_roty %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); t1 = cmat[6]; t2 = cmat[0]; cmat[6] = c*t1-s*t2; @@ -476,7 +476,7 @@ static void matrix_rotz(void) float c = tcos(a); float t1, t2; - logerror("TGP matrix_rotz %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP matrix_rotz %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); t1 = cmat[0]; t2 = cmat[3]; cmat[0] = c*t1-s*t2; @@ -498,7 +498,7 @@ static void track_read_quad(void) UINT32 a = fifoin_pop(); int offd; - logerror("TGP track_read_quad %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP track_read_quad %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); offd = tgp_data[0x20+tgp_vr_select] + 16*a; fifoout_push(tgp_data[offd]); @@ -532,7 +532,7 @@ static void f24_swa(void) (void)e; (void)f; (void)g; - logerror("TGP f24_swa %f, %f, %f, %f, %f, %f, %x (%x)\n", a, b, c, d, e, f, g, activecpu_get_pc()); + logerror("TGP f24_swa %f, %f, %f, %f, %f, %f, %x (%x)\n", a, b, c, d, e, f, g, cpu_get_pc(Machine->activecpu)); fifoout_push_f(0); next_fn(); } @@ -542,7 +542,7 @@ static void transform_point(void) float x = fifoin_pop_f(); float y = fifoin_pop_f(); float z = fifoin_pop_f(); - logerror("TGP transform_point %f, %f, %f (%x)\n", x, y, z, activecpu_get_pc()); + logerror("TGP transform_point %f, %f, %f (%x)\n", x, y, z, cpu_get_pc(Machine->activecpu)); fifoout_push_f(cmat[0]*x+cmat[3]*y+cmat[6]*z+cmat[9]); fifoout_push_f(cmat[1]*x+cmat[4]*y+cmat[7]*z+cmat[10]); @@ -553,7 +553,7 @@ static void transform_point(void) static void fcos_m1(void) { INT16 a = fifoin_pop(); - logerror("TGP fcos %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP fcos %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); fifoout_push_f(tcos(a)); next_fn(); } @@ -561,7 +561,7 @@ static void fcos_m1(void) static void fsin_m1(void) { INT16 a = fifoin_pop(); - logerror("TGP fsin %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP fsin %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); fifoout_push_f(tsin(a)); next_fn(); } @@ -570,7 +570,7 @@ static void fcosm_m1(void) { INT16 a = fifoin_pop(); float b = fifoin_pop_f(); - logerror("TGP fcosm %d, %f (%x)\n", a, b, activecpu_get_pc()); + logerror("TGP fcosm %d, %f (%x)\n", a, b, cpu_get_pc(Machine->activecpu)); fifoout_push_f(b*tcos(a)); next_fn(); } @@ -580,7 +580,7 @@ static void fsinm_m1(void) INT16 a = fifoin_pop(); float b = fifoin_pop_f(); model1_dump = 1; - logerror("TGP fsinm %d, %f (%x)\n", a, b, activecpu_get_pc()); + logerror("TGP fsinm %d, %f (%x)\n", a, b, cpu_get_pc(Machine->activecpu)); fifoout_push_f(b*tsin(a)); next_fn(); } @@ -593,7 +593,7 @@ static void distance3(void) float d = fifoin_pop_f(); float e = fifoin_pop_f(); float f = fifoin_pop_f(); - logerror("TGP distance3 (%f, %f, %f), (%f, %f, %f) (%x)\n", a, b, c, d, e, f, activecpu_get_pc()); + logerror("TGP distance3 (%f, %f, %f), (%f, %f, %f) (%x)\n", a, b, c, d, e, f, cpu_get_pc(Machine->activecpu)); a -= d; b -= e; c -= f; @@ -604,7 +604,7 @@ static void distance3(void) static void ftoi(void) { float a = fifoin_pop_f(); - logerror("TGP ftoi %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP ftoi %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); fifoout_push((int)a); next_fn(); } @@ -612,7 +612,7 @@ static void ftoi(void) static void itof(void) { INT32 a = fifoin_pop(); - logerror("TGP itof %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP itof %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); fifoout_push_f(a); next_fn(); } @@ -620,14 +620,14 @@ static void itof(void) static void acc_set(void) { float a = fifoin_pop_f(); - logerror("TGP acc_set %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP acc_set %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); acc = a; next_fn(); } static void acc_get(void) { - logerror("TGP acc_get (%x)\n", activecpu_get_pc()); + logerror("TGP acc_get (%x)\n", cpu_get_pc(Machine->activecpu)); fifoout_push_f(acc); next_fn(); } @@ -635,7 +635,7 @@ static void acc_get(void) static void acc_add(void) { float a = fifoin_pop_f(); - logerror("TGP acc_add %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP acc_add %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); acc += a; next_fn(); } @@ -643,7 +643,7 @@ static void acc_add(void) static void acc_sub(void) { float a = fifoin_pop_f(); - logerror("TGP acc_sub %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP acc_sub %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); acc -= a; next_fn(); } @@ -651,7 +651,7 @@ static void acc_sub(void) static void acc_mul(void) { float a = fifoin_pop_f(); - logerror("TGP acc_mul %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP acc_mul %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); acc *= a; next_fn(); } @@ -659,7 +659,7 @@ static void acc_mul(void) static void acc_div(void) { float a = fifoin_pop_f(); - logerror("TGP acc_div %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP acc_div %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); acc /= a; next_fn(); } @@ -672,7 +672,7 @@ static void f42(void) (void)a; (void)b; (void)c; - logerror("TGP f42 %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP f42 %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); // fifoout_push_f((mame_rand(Machine) % 1000) - 500); fifoout_push_f(0); fifoout_push_f(0); @@ -695,7 +695,7 @@ static void xyz2rqf(void) (void)a; (void)b; (void)c; - logerror("TGP xyz2rqf %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP xyz2rqf %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); fifoout_push_f((a*a+b*b+c*c)/sqrt(a*a+b*b+c*c)); norm = sqrt(a*a+c*c); if(!c) { @@ -738,7 +738,7 @@ static void f43(void) (void)d; (void)e; (void)f; - logerror("TGP f43 %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, activecpu_get_pc()); + logerror("TGP f43 %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, cpu_get_pc(Machine->activecpu)); fifoout_push_f(0); fifoout_push_f(0); fifoout_push_f(0); @@ -754,7 +754,7 @@ static void f43_swa(void) (void)a; (void)b; (void)c; - logerror("TGP f43_swa %f, %d, %d (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP f43_swa %f, %d, %d (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); fifoout_push_f(0); fifoout_push_f(0); fifoout_push_f(0); @@ -765,7 +765,7 @@ static void f44(void) { float a = fifoin_pop_f(); (void)a; - logerror("TGP f44 %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP f44 %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); fifoout_push_f(0); fifoout_push_f(0); fifoout_push_f(0); @@ -779,7 +779,7 @@ static void matrix_sdir(void) float c = fifoin_pop_f(); float norm = sqrt(a*a+b*b+c*c); float t[9], m[9]; - logerror("TGP matrix_sdir %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP matrix_sdir %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); memset(t, 0, sizeof(t)); @@ -826,7 +826,7 @@ static void f45(void) { float a = fifoin_pop_f(); (void)a; - logerror("TGP f45 %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP f45 %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); fifoout_push_f(0); next_fn(); } @@ -836,7 +836,7 @@ static void vlength(void) float a = fifoin_pop_f() - tgp_vr_base[0]; float b = fifoin_pop_f() - tgp_vr_base[1]; float c = fifoin_pop_f() - tgp_vr_base[2]; - logerror("TGP vlength %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP vlength %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); a = (a*a+b*b+c*c); b = 1/sqrt(a); @@ -851,7 +851,7 @@ static void f47(void) float a = fifoin_pop_f(); float b = fifoin_pop_f(); float c = fifoin_pop_f(); - logerror("TGP f47 %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP f47 %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); fifoout_push_f(a+c); fifoout_push_f(b+c); next_fn(); @@ -863,7 +863,7 @@ static void track_read_info(void) UINT16 a = fifoin_pop(); int offd; - logerror("TGP track_read_info %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP track_read_info %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); offd = tgp_data[0x20+tgp_vr_select] + 16*a; fifoout_push(tgp_data[offd+15]); @@ -884,7 +884,7 @@ static void colbox_set(void) float j = fifoin_pop_f(); float k = fifoin_pop_f(); float l = fifoin_pop_f(); - logerror("TGP colbox_set %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, j, k, l, activecpu_get_pc()); + logerror("TGP colbox_set %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, j, k, l, cpu_get_pc(Machine->activecpu)); tgp_vr_cbox[ 0] = a; tgp_vr_cbox[ 1] = b; tgp_vr_cbox[ 2] = c; @@ -908,7 +908,7 @@ static void colbox_test(void) (void)a; (void)b; (void)c; - logerror("TGP colbox_test %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP colbox_test %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); // #### Wrong, need to check with the tgp_vr_cbox coordinates // Game only test sign, negative = collision @@ -930,7 +930,7 @@ static void f49_swa(void) (void)d; (void)e; (void)f; - logerror("TGP f49_swa %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, activecpu_get_pc()); + logerror("TGP f49_swa %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -944,14 +944,14 @@ static void f50_swa(void) (void)b; (void)c; (void)d; - logerror("TGP f50_swa %f, %f, %f, %f (%x)\n", a, b, c, d, activecpu_get_pc()); + logerror("TGP f50_swa %f, %f, %f, %f (%x)\n", a, b, c, d, cpu_get_pc(Machine->activecpu)); fifoout_push_f(d); next_fn(); } static void f52(void) { - logerror("TGP f52 (%x)\n", activecpu_get_pc()); + logerror("TGP f52 (%x)\n", cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -964,7 +964,7 @@ static void matrix_rdir(void) float t1, t2; (void)b; - logerror("TGP matrix_rdir %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP matrix_rdir %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); if(!norm) { c = 1; @@ -1017,7 +1017,7 @@ static void track_lookup(void) UINT32 behaviour, entry; float height; - logerror("TGP track_lookup %f, 0x%x, %f, %f (%x)\n", a, b, c, d, activecpu_get_pc()); + logerror("TGP track_lookup %f, 0x%x, %f, %f (%x)\n", a, b, c, d, cpu_get_pc(Machine->activecpu)); offi = tgp_data[0x10+tgp_vr_select] + b; offd = tgp_data[0x20+tgp_vr_select]; @@ -1079,14 +1079,14 @@ static void f56(void) (void)f; (void)g; - logerror("TGP f56 %f, %f, %f, %f, %f, %f, %d (%x)\n", a, b, c, d, e, f, g, activecpu_get_pc()); + logerror("TGP f56 %f, %f, %f, %f, %f, %f, %d (%x)\n", a, b, c, d, e, f, g, cpu_get_pc(Machine->activecpu)); fifoout_push(0); next_fn(); } static void f57(void) { - logerror("TGP f57 (%x)\n", activecpu_get_pc()); + logerror("TGP f57 (%x)\n", cpu_get_pc(Machine->activecpu)); fifoout_push_f(0); fifoout_push_f(0); fifoout_push_f(0); @@ -1095,7 +1095,7 @@ static void f57(void) static void matrix_readt(void) { - logerror("TGP matrix_readt (%x)\n", activecpu_get_pc()); + logerror("TGP matrix_readt (%x)\n", cpu_get_pc(Machine->activecpu)); fifoout_push_f(cmat[9]); fifoout_push_f(cmat[10]); fifoout_push_f(cmat[11]); @@ -1104,14 +1104,14 @@ static void matrix_readt(void) static void acc_geti(void) { - logerror("TGP acc_geti (%x)\n", activecpu_get_pc()); + logerror("TGP acc_geti (%x)\n", cpu_get_pc(Machine->activecpu)); fifoout_push((int)acc); next_fn(); } static void f60(void) { - logerror("TGP f60 (%x)\n", activecpu_get_pc()); + logerror("TGP f60 (%x)\n", cpu_get_pc(Machine->activecpu)); fifoout_push_f(0); fifoout_push_f(0); fifoout_push_f(0); @@ -1123,7 +1123,7 @@ static void col_setcirc(void) float a = fifoin_pop_f(); float b = fifoin_pop_f(); float c = fifoin_pop_f(); - logerror("TGP col_setcirc %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP col_setcirc %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); tgp_vr_circx = a; tgp_vr_circy = b; tgp_vr_circrad = c; @@ -1135,7 +1135,7 @@ static void col_testpt(void) float x, y; float a = fifoin_pop_f(); float b = fifoin_pop_f(); - logerror("TGP col_testpt %f, %f (%x)\n", a, b, activecpu_get_pc()); + logerror("TGP col_testpt %f, %f (%x)\n", a, b, cpu_get_pc(Machine->activecpu)); x = a - tgp_vr_circx; y = b - tgp_vr_circy; fifoout_push_f(((x*x+y*y)/sqrt(x*x+y*y)) - tgp_vr_circrad); @@ -1148,7 +1148,7 @@ static void push_and_ident(void) memcpy(mat_stack[mat_stack_pos], cmat, sizeof(cmat)); mat_stack_pos++; } - logerror("TGP push_and_ident (depth=%d, pc=%x)\n", mat_stack_pos, activecpu_get_pc()); + logerror("TGP push_and_ident (depth=%d, pc=%x)\n", mat_stack_pos, cpu_get_pc(Machine->activecpu)); memset(cmat, 0, sizeof(cmat)); cmat[0] = 1.0; cmat[4] = 1.0; @@ -1174,7 +1174,7 @@ static void catmull_rom(void) float m2, m3; float w1, w2, w3, w4; - logerror("TGP catmull_rom %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, j, k, l, m, activecpu_get_pc()); + logerror("TGP catmull_rom %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, j, k, l, m, cpu_get_pc(Machine->activecpu)); m2 = m*m; m3 = m*m*m; @@ -1196,7 +1196,7 @@ static void distance(void) float b = fifoin_pop_f(); float c = fifoin_pop_f(); float d = fifoin_pop_f(); - logerror("TGP distance (%f, %f), (%f, %f) (%x)\n", a, b, c, d, activecpu_get_pc()); + logerror("TGP distance (%f, %f), (%f, %f) (%x)\n", a, b, c, d, cpu_get_pc(Machine->activecpu)); c -= a; d -= b; fifoout_push_f((c*c+d*d)/sqrt(c*c+d*d)); @@ -1210,7 +1210,7 @@ static void car_move(void) float c = fifoin_pop_f(); float d = fifoin_pop_f(); float dx, dy; - logerror("TGP car_move (%d, %f), (%f, %f) (%x)\n", a, b, c, d, activecpu_get_pc()); + logerror("TGP car_move (%d, %f), (%f, %f) (%x)\n", a, b, c, d, cpu_get_pc(Machine->activecpu)); dx = b*tsin(a); dy = b*tcos(a); @@ -1238,7 +1238,7 @@ static void cpa(void) float j = fifoin_pop_f(); float k = fifoin_pop_f(); float l = fifoin_pop_f(); - logerror("TGP cpa %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, j, k, l, activecpu_get_pc()); + logerror("TGP cpa %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, h, i, j, k, l, cpu_get_pc(Machine->activecpu)); dv_x = (b-a) - (d-c); dv_y = (f-e) - (h-g); @@ -1273,7 +1273,7 @@ static void vmat_store(void) memcpy(mat_vector[a], cmat, sizeof(cmat)); else logerror("TGP ERROR bad vector index\n"); - logerror("TGP vmat_store %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP vmat_store %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -1284,7 +1284,7 @@ static void vmat_restore(void) memcpy(cmat, mat_vector[a], sizeof(cmat)); else logerror("TGP ERROR bad vector index\n"); - logerror("TGP vmat_restore %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP vmat_restore %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -1307,14 +1307,14 @@ static void vmat_mul(void) mat_vector[b][11] = mat_vector[a][ 9]*cmat[2] + mat_vector[a][10]*cmat[5] + mat_vector[a][11]*cmat[8] + cmat[11]; } else logerror("TGP ERROR bad vector index\n"); - logerror("TGP vmat_mul %d, %d (%x)\n", a, b, activecpu_get_pc()); + logerror("TGP vmat_mul %d, %d (%x)\n", a, b, cpu_get_pc(Machine->activecpu)); next_fn(); } static void vmat_read(void) { UINT32 a = fifoin_pop(); - logerror("TGP vmat_read %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP vmat_read %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); if(a<21) { int i; for(i=0; i<12; i++) @@ -1330,7 +1330,7 @@ static void vmat_read(void) static void matrix_rtrans(void) { - logerror("TGP matrix_rtrans (%x)\n", activecpu_get_pc()); + logerror("TGP matrix_rtrans (%x)\n", cpu_get_pc(Machine->activecpu)); fifoout_push_f(cmat[ 9]); fifoout_push_f(cmat[10]); fifoout_push_f(cmat[11]); @@ -1339,7 +1339,7 @@ static void matrix_rtrans(void) static void matrix_unrot(void) { - logerror("TGP matrix_unrot (%x)\n", activecpu_get_pc()); + logerror("TGP matrix_unrot (%x)\n", cpu_get_pc(Machine->activecpu)); memset(cmat, 0, 9*sizeof(cmat[0])); cmat[0] = 1.0; cmat[4] = 1.0; @@ -1349,7 +1349,7 @@ static void matrix_unrot(void) static void f80(void) { - logerror("TGP f80 (%x)\n", activecpu_get_pc()); + logerror("TGP f80 (%x)\n", cpu_get_pc(Machine->activecpu)); // cmat[9] = cmat[10] = cmat[11] = 0; next_fn(); } @@ -1358,7 +1358,7 @@ static void vmat_save(void) { UINT32 a = fifoin_pop(); int i; - logerror("TGP vmat_save 0x%x (%x)\n", a, activecpu_get_pc()); + logerror("TGP vmat_save 0x%x (%x)\n", a, cpu_get_pc(Machine->activecpu)); for(i=0; i<16; i++) memcpy(ram_data+a+0x10*i, mat_vector[i], sizeof(cmat)); next_fn(); @@ -1368,7 +1368,7 @@ static void vmat_load(void) { UINT32 a = fifoin_pop(); int i; - logerror("TGP vmat_load 0x%x (%x)\n", a, activecpu_get_pc()); + logerror("TGP vmat_load 0x%x (%x)\n", a, cpu_get_pc(Machine->activecpu)); for(i=0; i<16; i++) memcpy(mat_vector[i], ram_data+a+0x10*i, sizeof(cmat)); next_fn(); @@ -1377,7 +1377,7 @@ static void vmat_load(void) static void ram_setadr(void) { ram_scanadr = fifoin_pop() - 0x8000; - logerror("TGP f0 ram_setadr 0x%x (%x)\n", ram_scanadr+0x8000, activecpu_get_pc()); + logerror("TGP f0 ram_setadr 0x%x (%x)\n", ram_scanadr+0x8000, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -1389,7 +1389,7 @@ static void groundbox_test(void) float b = fifoin_pop_f(); float c = fifoin_pop_f(); - logerror("TGP groundbox_test %f, %f, %f (%x)\n", a, b, c, activecpu_get_pc()); + logerror("TGP groundbox_test %f, %f, %f (%x)\n", a, b, c, cpu_get_pc(Machine->activecpu)); x = cmat[0]*a+cmat[3]*b+cmat[6]*c+cmat[9]; y = cmat[1]*a+cmat[4]*b+cmat[7]*c+cmat[10]; z = cmat[2]*a+cmat[5]*b+cmat[8]*c+cmat[11]; @@ -1413,7 +1413,7 @@ static void f89(void) (void)a; (void)b; (void)c; - logerror("TGP list set base 0x%x, 0x%x, %d, length=%d (%x)\n", a, b, c, d, activecpu_get_pc()); + logerror("TGP list set base 0x%x, 0x%x, %d, length=%d (%x)\n", a, b, c, d, cpu_get_pc(Machine->activecpu)); list_length = d; next_fn(); } @@ -1428,7 +1428,7 @@ static void f92(void) (void)b; (void)c; (void)d; - logerror("TGP f92 %f, %f, %f, %f (%x)\n", a, b, c, d, activecpu_get_pc()); + logerror("TGP f92 %f, %f, %f, %f (%x)\n", a, b, c, d, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -1436,7 +1436,7 @@ static void f93(void) { float a = fifoin_pop_f(); (void)a; - logerror("TGP f93 %f (%x)\n", a, activecpu_get_pc()); + logerror("TGP f93 %f (%x)\n", a, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -1444,7 +1444,7 @@ static void f94(void) { UINT32 a = fifoin_pop(); (void)a; - logerror("TGP f94 %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP f94 %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); next_fn(); } @@ -1452,7 +1452,7 @@ static void vmat_flatten(void) { int i; float m[12]; - logerror("TGP vmat_flatten (%x)\n", activecpu_get_pc()); + logerror("TGP vmat_flatten (%x)\n", cpu_get_pc(Machine->activecpu)); for(i=0; i<16; i++) { memcpy(m, mat_vector[i], sizeof(cmat)); @@ -1477,7 +1477,7 @@ static void vmat_flatten(void) static void vmat_load1(void) { UINT32 a = fifoin_pop(); - logerror("TGP vmat_load1 0x%x (%x)\n", a, activecpu_get_pc()); + logerror("TGP vmat_load1 0x%x (%x)\n", a, cpu_get_pc(Machine->activecpu)); memcpy(cmat, ram_data+a, sizeof(cmat)); next_fn(); } @@ -1487,7 +1487,7 @@ static void ram_trans(void) float a = ram_get_f(); float b = ram_get_f(); float c = ram_get_f(); - logerror("TGP ram_trans (%x)\n", activecpu_get_pc()); + logerror("TGP ram_trans (%x)\n", cpu_get_pc(Machine->activecpu)); cmat[ 9] += cmat[0]*a+cmat[3]*b+cmat[6]*c; cmat[10] += cmat[1]*a+cmat[4]*b+cmat[7]*c; cmat[11] += cmat[2]*a+cmat[5]*b+cmat[8]*c; @@ -1500,7 +1500,7 @@ static void f98_load(void) for(i=0; i<list_length; i++) { float f = fifoin_pop_f(); (void)f; - logerror("TGP load list (%2d/%2d) %f (%x)\n", i, list_length, f, activecpu_get_pc()); + logerror("TGP load list (%2d/%2d) %f (%x)\n", i, list_length, f, cpu_get_pc(Machine->activecpu)); } next_fn(); } @@ -1509,21 +1509,21 @@ static void f98(void) { UINT32 a = fifoin_pop(); (void)a; - logerror("TGP load list start %d (%x)\n", a, activecpu_get_pc()); + logerror("TGP load list start %d (%x)\n", a, cpu_get_pc(Machine->activecpu)); fifoin_cbcount = list_length; fifoin_cb = f98_load; } static void f99(void) { - logerror("TGP f99 (%x)\n", activecpu_get_pc()); + logerror("TGP f99 (%x)\n", cpu_get_pc(Machine->activecpu)); next_fn(); } static void f100(void) { int i; - logerror("TGP f100 get list (%x)\n", activecpu_get_pc()); + logerror("TGP f100 get list (%x)\n", cpu_get_pc(Machine->activecpu)); for(i=0; i<list_length; i++) fifoout_push_f((mame_rand(Machine) % 1000)/100.0); next_fn(); @@ -1538,7 +1538,7 @@ static void groundbox_set(void) float e = fifoin_pop_f(); float f = fifoin_pop_f(); float g = fifoin_pop_f(); - logerror("TGP groundbox_set %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, activecpu_get_pc()); + logerror("TGP groundbox_set %f, %f, %f, %f, %f, %f, %f (%x)\n", a, b, c, d, e, f, g, cpu_get_pc(Machine->activecpu)); tgp_vf_xmin = e; tgp_vf_xmax = d; tgp_vf_zmin = g; @@ -1565,7 +1565,7 @@ static void f102(void) ccount++; - logerror("TGP f0 mve_calc %f, %f, %f, %f, %f, %d, %d, %d (%d) (%x)\n", a, b, c, d, e, f, g, h, ccount, activecpu_get_pc()); + logerror("TGP f0 mve_calc %f, %f, %f, %f, %f, %d, %d, %d (%d) (%x)\n", a, b, c, d, e, f, g, h, ccount, cpu_get_pc(Machine->activecpu)); px = u2f(ram_data[ram_scanadr+0x16]); py = u2f(ram_data[ram_scanadr+0x17]); @@ -1606,7 +1606,7 @@ static void f102(void) static void f103(void) { ram_scanadr = fifoin_pop() - 0x8000; - logerror("TGP f0 mve_setadr 0x%x (%x)\n", ram_scanadr, activecpu_get_pc()); + logerror("TGP f0 mve_setadr 0x%x (%x)\n", ram_scanadr, cpu_get_pc(Machine->activecpu)); ram_get_i(); next_fn(); } @@ -1812,7 +1812,7 @@ static const struct function ftab_swa[] = { static void dump(void) { - logerror("TGP FIFOIN write %08x (%x)\n", fifoin_pop(), activecpu_get_pc()); + logerror("TGP FIFOIN write %08x (%x)\n", fifoin_pop(), cpu_get_pc(Machine->activecpu)); fifoin_cbcount = 1; fifoin_cb = dump; } @@ -1834,7 +1834,7 @@ static void function_get_vf(void) if(!fifoin_cbcount) fifoin_cb(); } else { - logerror("TGP function %d unimplemented (%x)\n", f, activecpu_get_pc()); + logerror("TGP function %d unimplemented (%x)\n", f, cpu_get_pc(Machine->activecpu)); fifoin_cbcount = 1; fifoin_cb = dump; } @@ -1857,7 +1857,7 @@ static void function_get_swa(void) if(!fifoin_cbcount) fifoin_cb(); } else { - logerror("TGP function %d unimplemented (%x)\n", f, activecpu_get_pc()); + logerror("TGP function %d unimplemented (%x)\n", f, cpu_get_pc(Machine->activecpu)); fifoin_cbcount = 1; fifoin_cb = dump; } @@ -1896,7 +1896,7 @@ WRITE16_HANDLER( model1_tgp_copro_adr_w ) READ16_HANDLER( model1_tgp_copro_ram_r ) { if(!offset) { - logerror("TGP f0 ram read %04x, %08x (%f) (%x)\n", ram_adr, ram_data[ram_adr], u2f(ram_data[ram_adr]), activecpu_get_pc()); + logerror("TGP f0 ram read %04x, %08x (%f) (%x)\n", ram_adr, ram_data[ram_adr], u2f(ram_data[ram_adr]), cpu_get_pc(Machine->activecpu)); return ram_data[ram_adr]; } else return ram_data[ram_adr++] >> 16; @@ -1907,7 +1907,7 @@ WRITE16_HANDLER( model1_tgp_copro_ram_w ) COMBINE_DATA(ram_latch+offset); if(offset) { UINT32 v = ram_latch[0]|(ram_latch[1]<<16); - logerror("TGP f0 ram write %04x, %08x (%f) (%x)\n", ram_adr, v, u2f(v), activecpu_get_pc()); + logerror("TGP f0 ram write %04x, %08x (%f) (%x)\n", ram_adr, v, u2f(v), cpu_get_pc(Machine->activecpu)); ram_data[ram_adr] = v; ram_adr++; } @@ -2004,7 +2004,7 @@ static void copro_fifoin_push(UINT32 data) { if (copro_fifoin_num == FIFO_SIZE) { - fatalerror("Copro FIFOIN overflow (at %08X)", activecpu_get_pc()); + fatalerror("Copro FIFOIN overflow (at %08X)", cpu_get_pc(Machine->activecpu)); return; } @@ -2049,7 +2049,7 @@ static void copro_fifoout_push(UINT32 data) { if (copro_fifoout_num == FIFO_SIZE) { - fatalerror("Copro FIFOOUT overflow (at %08X)", activecpu_get_pc()); + fatalerror("Copro FIFOOUT overflow (at %08X)", cpu_get_pc(Machine->activecpu)); return; } diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c index 32e50325aa1..cf4155bb896 100644 --- a/src/mame/machine/n64.c +++ b/src/mame/machine/n64.c @@ -61,7 +61,7 @@ READ32_HANDLER( n64_mi_reg_r ) return mi_intr_mask; default: - logerror("mi_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + logerror("mi_reg_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } @@ -101,7 +101,7 @@ WRITE32_HANDLER( n64_mi_reg_w ) } default: - logerror("mi_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + logerror("mi_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } @@ -125,7 +125,7 @@ static void sp_dma(int direction) { UINT8 *src, *dst; int i, c; - //int cpu = cpu_getactivecpu(); + //int cpu = cpunum_get_active(); if (sp_dma_length == 0) { @@ -213,15 +213,15 @@ static void sp_set_status(UINT32 status) //cpu_trigger(Machine, 6789); cpunum_set_input_line(Machine, 1, INPUT_LINE_HALT, ASSERT_LINE); - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_HALT); + cpu_set_reg(Machine->cpu[1], RSP_SR, cpu_get_reg(Machine->cpu[1], RSP_SR) | RSP_STATUS_HALT); //rsp_sp_status |= SP_STATUS_HALT; } if (status & 0x2) { //rsp_sp_status |= SP_STATUS_BROKE; - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_BROKE); + cpu_set_reg(Machine->cpu[1], RSP_SR, cpu_get_reg(Machine->cpu[1], RSP_SR) | RSP_STATUS_BROKE); - if (cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & RSP_STATUS_INTR_BREAK) + if (cpu_get_reg(Machine->cpu[1], RSP_SR) & RSP_STATUS_INTR_BREAK) { signal_rcp_interrupt(Machine, SP_INTERRUPT); } @@ -242,7 +242,7 @@ READ32_HANDLER( n64_sp_reg_r ) return (sp_dma_skip << 20) | (sp_dma_count << 12) | sp_dma_length; case 0x10/4: // SP_STATUS_REG - return cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR); + return cpu_get_reg(machine->cpu[1], RSP_SR); case 0x14/4: // SP_DMA_FULL_REG return 0; @@ -264,10 +264,10 @@ READ32_HANDLER( n64_sp_reg_r ) return 0; case 0x40000/4: // PC - return cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_PC) & 0x00000fff; + return cpu_get_reg(machine->cpu[1], RSP_PC) & 0x00000fff; default: - logerror("sp_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + logerror("sp_reg_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } @@ -313,7 +313,7 @@ WRITE32_HANDLER( n64_sp_reg_w ) // printf( "Clearing RSP_STATUS_HALT\n" ); cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, CLEAR_LINE); - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_HALT ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_HALT ); // RSP_STATUS &= ~RSP_STATUS_HALT; //} //else @@ -325,13 +325,13 @@ WRITE32_HANDLER( n64_sp_reg_w ) { // printf( "Setting RSP_STATUS_HALT\n" ); cpunum_set_input_line(machine, 1, INPUT_LINE_HALT, ASSERT_LINE); - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_HALT ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_HALT ); // RSP_STATUS |= RSP_STATUS_HALT; } if (data & 0x00000004) { //printf( "Clearing RSP_STATUS_BROKE\n" ); - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_BROKE ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_BROKE ); // RSP_STATUS &= ~RSP_STATUS_BROKE; // clear broke } if (data & 0x00000008) // clear interrupt @@ -345,107 +345,107 @@ WRITE32_HANDLER( n64_sp_reg_w ) if (data & 0x00000020) { // printf( "Clearing RSP_STATUS_SSTEP\n" ); - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SSTEP ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SSTEP ); // RSP_STATUS &= ~RSP_STATUS_SSTEP; // clear single step } if (data & 0x00000040) { //printf( "Setting RSP_STATUS_SSTEP\n" ); - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SSTEP ); - if( !( cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ( RSP_STATUS_BROKE | RSP_STATUS_HALT ) ) ) + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SSTEP ); + if( !( cpu_get_reg(machine->cpu[1], RSP_SR) & ( RSP_STATUS_BROKE | RSP_STATUS_HALT ) ) ) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_STEPCNT, 1 ); + cpu_set_reg(machine->cpu[1], RSP_STEPCNT, 1 ); } // RSP_STATUS |= RSP_STATUS_SSTEP; // set single step } if (data & 0x00000080) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_INTR_BREAK ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_INTR_BREAK ); // RSP_STATUS &= ~RSP_STATUS_INTR_BREAK; // clear interrupt on break } if (data & 0x00000100) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_INTR_BREAK ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_INTR_BREAK ); // RSP_STATUS |= RSP_STATUS_INTR_BREAK; // set interrupt on break } if (data & 0x00000200) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SIGNAL0 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SIGNAL0 ); // RSP_STATUS &= ~RSP_STATUS_SIGNAL0; // clear signal 0 } if (data & 0x00000400) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SIGNAL0 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SIGNAL0 ); // RSP_STATUS |= RSP_STATUS_SIGNAL0; // set signal 0 } if (data & 0x00000800) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SIGNAL1 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SIGNAL1 ); // RSP_STATUS &= ~RSP_STATUS_SIGNAL1; // clear signal 1 } if (data & 0x00001000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SIGNAL1 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SIGNAL1 ); // RSP_STATUS |= RSP_STATUS_SIGNAL1; // set signal 1 } if (data & 0x00002000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SIGNAL2 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SIGNAL2 ); // RSP_STATUS &= ~RSP_STATUS_SIGNAL2; // clear signal 2 } if (data & 0x00004000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SIGNAL2 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SIGNAL2 ); // RSP_STATUS |= RSP_STATUS_SIGNAL2; // set signal 2 } if (data & 0x00008000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SIGNAL3 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SIGNAL3 ); // RSP_STATUS &= ~RSP_STATUS_SIGNAL3; // clear signal 3 } if (data & 0x00010000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SIGNAL3 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SIGNAL3 ); // RSP_STATUS |= RSP_STATUS_SIGNAL3; // set signal 3 } if (data & 0x00020000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SIGNAL4 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SIGNAL4 ); // RSP_STATUS &= ~RSP_STATUS_SIGNAL4; // clear signal 4 } if (data & 0x00040000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SIGNAL4 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SIGNAL4 ); // RSP_STATUS |= RSP_STATUS_SIGNAL4; // set signal 4 } if (data & 0x00080000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SIGNAL5 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SIGNAL5 ); // RSP_STATUS &= ~RSP_STATUS_SIGNAL5; // clear signal 5 } if (data & 0x00100000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SIGNAL5 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SIGNAL5 ); // RSP_STATUS |= RSP_STATUS_SIGNAL5; // set signal 5 } if (data & 0x00200000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SIGNAL6 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SIGNAL6 ); // RSP_STATUS &= ~RSP_STATUS_SIGNAL6; // clear signal 6 } if (data & 0x00400000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SIGNAL6 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SIGNAL6 ); // RSP_STATUS |= RSP_STATUS_SIGNAL6; // set signal 6 } if (data & 0x00800000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & ~RSP_STATUS_SIGNAL7 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) & ~RSP_STATUS_SIGNAL7 ); // RSP_STATUS &= ~RSP_STATUS_SIGNAL7; // clear signal 7 } if (data & 0x01000000) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_SIGNAL7 ); + cpu_set_reg(machine->cpu[1], RSP_SR, cpu_get_reg(machine->cpu[1], RSP_SR) | RSP_STATUS_SIGNAL7 ); // RSP_STATUS |= RSP_STATUS_SIGNAL7; // set signal 7 } break; @@ -457,7 +457,7 @@ WRITE32_HANDLER( n64_sp_reg_w ) break; default: - logerror("sp_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + logerror("sp_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } @@ -467,18 +467,18 @@ WRITE32_HANDLER( n64_sp_reg_w ) { case 0x00/4: // SP_PC_REG //printf( "Setting PC to: %08x\n", 0x04001000 | (data & 0xfff ) ); - if( cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_NEXTPC) != 0xffffffff ) + if( cpu_get_info_int(machine->cpu[1], CPUINFO_INT_REGISTER + RSP_NEXTPC) != 0xffffffff ) { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_NEXTPC, 0x04001000 | (data & 0xfff)); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_REGISTER + RSP_NEXTPC, 0x04001000 | (data & 0xfff)); } else { - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_PC, 0x04001000 | (data & 0xfff)); + cpu_set_info_int(machine->cpu[1], CPUINFO_INT_REGISTER + RSP_PC, 0x04001000 | (data & 0xfff)); } break; default: - logerror("sp_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + logerror("sp_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } @@ -513,7 +513,7 @@ READ32_HANDLER( n64_dp_reg_r ) return dp_status; default: - logerror("dp_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + logerror("dp_reg_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } @@ -544,7 +544,7 @@ WRITE32_HANDLER( n64_dp_reg_w ) break; default: - logerror("dp_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + logerror("dp_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } @@ -611,7 +611,7 @@ READ32_HANDLER( n64_vi_reg_r ) return n64_vi_yscale; default: - logerror("vi_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + logerror("vi_reg_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } return 0; @@ -704,7 +704,7 @@ WRITE32_HANDLER( n64_vi_reg_w ) break; default: - logerror("vi_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + logerror("vi_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } @@ -869,7 +869,7 @@ READ32_HANDLER( n64_ai_reg_r ) return ai_status; default: - logerror("ai_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + logerror("ai_reg_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } @@ -883,18 +883,18 @@ WRITE32_HANDLER( n64_ai_reg_w ) switch (offset) { case 0x00/4: // AI_DRAM_ADDR_REG -// mame_printf_debug("ai_dram_addr = %08X at %08X\n", data, activecpu_get_pc()); +// mame_printf_debug("ai_dram_addr = %08X at %08X\n", data, cpu_get_pc(machine->activecpu)); ai_dram_addr = data & 0xffffff; break; case 0x04/4: // AI_LEN_REG -// mame_printf_debug("ai_len = %08X at %08X\n", data, activecpu_get_pc()); +// mame_printf_debug("ai_len = %08X at %08X\n", data, cpu_get_pc(machine->activecpu)); ai_len = data & 0x3ffff; // Hardware v2.0 has 18 bits, v1.0 has 15 bits audio_fifo_push(machine, ai_dram_addr, ai_len); break; case 0x08/4: // AI_CONTROL_REG -// mame_printf_debug("ai_control = %08X at %08X\n", data, activecpu_get_pc()); +// mame_printf_debug("ai_control = %08X at %08X\n", data, cpu_get_pc(machine->activecpu)); ai_control = data; break; @@ -915,7 +915,7 @@ WRITE32_HANDLER( n64_ai_reg_w ) break; default: - logerror("ai_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + logerror("ai_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } @@ -940,7 +940,7 @@ READ32_HANDLER( n64_pi_reg_r ) return 0; default: - logerror("pi_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + logerror("pi_reg_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } return 0; @@ -1039,7 +1039,7 @@ WRITE32_HANDLER( n64_pi_reg_w ) } default: - logerror("pi_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + logerror("pi_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } @@ -1050,7 +1050,7 @@ READ32_HANDLER( n64_ri_reg_r ) switch (offset) { default: - logerror("ri_reg_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + logerror("ri_reg_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } @@ -1062,7 +1062,7 @@ WRITE32_HANDLER( n64_ri_reg_w ) switch (offset) { default: - logerror("ri_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + logerror("ri_reg_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } } @@ -1630,14 +1630,14 @@ void n64_machine_reset(running_machine *machine) cic_status = 0; - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_DRC_OPTIONS, MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); /* configure fast RAM regions for DRC */ - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_END, 0x007fffff); - cpunum_set_info_ptr(0, CPUINFO_PTR_MIPS3_FASTRAM_BASE, rdram); - cpunum_set_info_int(0, CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_SELECT, 0); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_START, 0x00000000); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_END, 0x007fffff); + cpu_set_info_ptr(machine->cpu[0], CPUINFO_PTR_MIPS3_FASTRAM_BASE, rdram); + cpu_set_info_int(machine->cpu[0], CPUINFO_INT_MIPS3_FASTRAM_READONLY, 0); audio_timer = timer_alloc(audio_timer_callback, NULL); timer_adjust_oneshot(audio_timer, attotime_never, 0); diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c index 09a6319aa98..88573ab5e9e 100644 --- a/src/mame/machine/namcoio.c +++ b/src/mame/machine/namcoio.c @@ -187,7 +187,7 @@ static void namcoio_51XX_write(running_machine *machine,int chip,int data) { data &= 0x07; - LOG(("%04x: custom 51XX write %02x\n",activecpu_get_pc(),data)); + LOG(("%04x: custom 51XX write %02x\n",cpu_get_pc(machine->activecpu),data)); if (io[chip].coincred_mode) { @@ -283,7 +283,7 @@ static const int joy_map[16] = static UINT8 namcoio_51XX_read(running_machine *machine, int chip) { - LOG(("%04x: custom 51XX read\n",activecpu_get_pc())); + LOG(("%04x: custom 51XX read\n",cpu_get_pc(machine->activecpu))); if (io[chip].mode == 0) /* switch mode */ { @@ -728,7 +728,7 @@ READ8_HANDLER( namcoio_r ) // RAM is 4-bit wide; Pac & Pal requires the | 0xf0 otherwise Easter egg doesn't work offset &= 0x3f; - LOG(("%04x: I/O read %d: mode %d, offset %d = %02x\n", activecpu_get_pc(), offset / 16, namcoio_ram[(offset & 0x30) + 8], offset & 0x0f, namcoio_ram[offset]&0x0f)); + LOG(("%04x: I/O read %d: mode %d, offset %d = %02x\n", cpu_get_pc(machine->activecpu), offset / 16, namcoio_ram[(offset & 0x30) + 8], offset & 0x0f, namcoio_ram[offset]&0x0f)); return 0xf0 | namcoio_ram[offset]; } @@ -738,7 +738,7 @@ WRITE8_HANDLER( namcoio_w ) offset &= 0x3f; data &= 0x0f; // RAM is 4-bit wide - LOG(("%04x: I/O write %d: offset %d = %02x\n", activecpu_get_pc(), offset / 16, offset & 0x0f, data)); + LOG(("%04x: I/O write %d: offset %d = %02x\n", cpu_get_pc(machine->activecpu), offset / 16, offset & 0x0f, data)); namcoio_ram[offset] = data; } @@ -868,7 +868,7 @@ void namco_06xx_init(int chipnum, int cpu, static UINT8 namcoio_53XX_digdug_read(running_machine *machine, int chip) { - LOG(("%04x: custom 53XX read\n",activecpu_get_pc())); + LOG(("%04x: custom 53XX read\n",cpu_get_pc(machine->activecpu))); switch ((io[chip].in_count++) % 2) { @@ -881,7 +881,7 @@ static UINT8 namcoio_53XX_digdug_read(running_machine *machine, int chip) static UINT8 namcoio_53XX_polepos_read(running_machine *machine,int chip) { - LOG(("%04x: custom 53XX read\n",activecpu_get_pc())); + LOG(("%04x: custom 53XX read\n",cpu_get_pc(machine->activecpu))); switch ((io[chip].in_count++) % 8) { @@ -904,7 +904,7 @@ static UINT8 namco_06xx_data_read(running_machine *machine, int chipnum) case NAMCOIO_53XX_DIGDUG: return namcoio_53XX_digdug_read(machine, chipnum); case NAMCOIO_53XX_POLEPOS: return namcoio_53XX_polepos_read(machine, chipnum); default: - logerror("%04x: custom IO type %d unsupported read\n",activecpu_get_pc(),io[chipnum].type); + logerror("%04x: custom IO type %d unsupported read\n",cpu_get_pc(machine->activecpu),io[chipnum].type); return 0xff; } } @@ -922,7 +922,7 @@ static void namco_06xx_data_write(running_machine *machine,int chipnum,UINT8 dat case NAMCOIO_52XX: namcoio_52xx_write(data); break; case NAMCOIO_54XX: namco_54xx_write(data); break; default: - logerror("%04x: custom IO type %d unsupported write\n",activecpu_get_pc(),io[chipnum].type); + logerror("%04x: custom IO type %d unsupported write\n",cpu_get_pc(machine->activecpu),io[chipnum].type); break; } } @@ -937,7 +937,7 @@ static void namco_06xx_read_request(running_machine *machine, int chipnum) case NAMCOIO_50XX: namco_50xx_read_request(machine); break; case NAMCOIO_50XX_2: namco_50xx_2_read_request(machine); break; default: - logerror("%04x: custom IO type %d read_request unsupported\n",activecpu_get_pc(),io[chipnum].type); + logerror("%04x: custom IO type %d read_request unsupported\n",cpu_get_pc(machine->activecpu),io[chipnum].type); break; } } @@ -945,11 +945,11 @@ static void namco_06xx_read_request(running_machine *machine, int chipnum) static UINT8 namco_06xx_data_r(running_machine *machine,int chip,int offset) { - LOG(("%04x: 06XX #%d read offset %d\n",activecpu_get_pc(),chip,offset)); + LOG(("%04x: 06XX #%d read offset %d\n",cpu_get_pc(machine->activecpu),chip,offset)); if (!(customio_command[chip] & 0x10)) { - logerror("%04x: 06XX #%d read in write mode %02x\n",activecpu_get_pc(),chip,customio_command[chip]); + logerror("%04x: 06XX #%d read in write mode %02x\n",cpu_get_pc(machine->activecpu),chip,customio_command[chip]); return 0; } @@ -960,7 +960,7 @@ static UINT8 namco_06xx_data_r(running_machine *machine,int chip,int offset) case 0x4: return namco_06xx_data_read(machine, 4*chip + 2); break; case 0x8: return namco_06xx_data_read(machine, 4*chip + 3); break; default: - logerror("%04x: 06XX #%d read in unsupported mode %02x\n",activecpu_get_pc(),chip,customio_command[chip]); + logerror("%04x: 06XX #%d read in unsupported mode %02x\n",cpu_get_pc(machine->activecpu),chip,customio_command[chip]); return 0xff; } } @@ -968,11 +968,11 @@ static UINT8 namco_06xx_data_r(running_machine *machine,int chip,int offset) static void namco_06xx_data_w(running_machine *machine,int chip,int offset,int data) { - LOG(("%04x: 06XX #%d write offset %d = %02x\n",activecpu_get_pc(),chip,offset,data)); + LOG(("%04x: 06XX #%d write offset %d = %02x\n",cpu_get_pc(machine->activecpu),chip,offset,data)); if (customio_command[chip] & 0x10) { - logerror("%04x: 06XX #%d write in read mode %02x\n",activecpu_get_pc(),chip,customio_command[chip]); + logerror("%04x: 06XX #%d write in read mode %02x\n",cpu_get_pc(machine->activecpu),chip,customio_command[chip]); return; } @@ -983,21 +983,21 @@ static void namco_06xx_data_w(running_machine *machine,int chip,int offset,int d case 0x4: namco_06xx_data_write(machine,4*chip + 2,data); break; case 0x8: namco_06xx_data_write(machine,4*chip + 3,data); break; default: - logerror("%04x: 06XX #%d write in unsupported mode %02x\n",activecpu_get_pc(),chip,customio_command[chip]); + logerror("%04x: 06XX #%d write in unsupported mode %02x\n",cpu_get_pc(machine->activecpu),chip,customio_command[chip]); break; } } -static UINT8 namco_06xx_ctrl_r(int chip) +static UINT8 namco_06xx_ctrl_r(running_machine *machine, int chip) { - LOG(("%04x: 06XX #%d ctrl_r\n",activecpu_get_pc(),chip)); + LOG(("%04x: 06XX #%d ctrl_r\n",cpu_get_pc(machine->activecpu),chip)); return customio_command[chip]; } static void namco_06xx_ctrl_w(running_machine *machine, int chip,int data) { - LOG(("%04x: 06XX #%d command %02x\n",activecpu_get_pc(),chip,data)); + LOG(("%04x: 06XX #%d command %02x\n",cpu_get_pc(machine->activecpu),chip,data)); customio_command[chip] = data; @@ -1025,7 +1025,7 @@ static void namco_06xx_ctrl_w(running_machine *machine, int chip,int data) case 0x4: namco_06xx_read_request(machine, 4*chip + 2); break; case 0x8: namco_06xx_read_request(machine, 4*chip + 3); break; default: - logerror("%04x: 06XX #%d read in unsupported mode %02x\n",activecpu_get_pc(),chip,customio_command[chip]); + logerror("%04x: 06XX #%d read in unsupported mode %02x\n",cpu_get_pc(machine->activecpu),chip,customio_command[chip]); } } } @@ -1037,7 +1037,7 @@ READ8_HANDLER( namco_06xx_0_data_r ) { return namco_06xx_data_r(machine,0,offse READ8_HANDLER( namco_06xx_1_data_r ) { return namco_06xx_data_r(machine,1,offset); } WRITE8_HANDLER( namco_06xx_0_data_w ) { namco_06xx_data_w(machine,0,offset,data); } WRITE8_HANDLER( namco_06xx_1_data_w ) { namco_06xx_data_w(machine,1,offset,data); } -READ8_HANDLER( namco_06xx_0_ctrl_r ) { return namco_06xx_ctrl_r(0); } -READ8_HANDLER( namco_06xx_1_ctrl_r ) { return namco_06xx_ctrl_r(1); } +READ8_HANDLER( namco_06xx_0_ctrl_r ) { return namco_06xx_ctrl_r(machine,0); } +READ8_HANDLER( namco_06xx_1_ctrl_r ) { return namco_06xx_ctrl_r(machine,1); } WRITE8_HANDLER( namco_06xx_0_ctrl_w ) { namco_06xx_ctrl_w(machine, 0,data); } WRITE8_HANDLER( namco_06xx_1_ctrl_w ) { namco_06xx_ctrl_w(machine, 1,data); } diff --git a/src/mame/machine/namcond1.c b/src/mame/machine/namcond1.c index e5880bceea5..c7103a64f42 100644 --- a/src/mame/machine/namcond1.c +++ b/src/mame/machine/namcond1.c @@ -73,7 +73,7 @@ READ16_HANDLER( namcond1_cuskey_r ) default : logerror( "offset $%X accessed from $%X\n", - offset<<1, activecpu_get_pc() ); + offset<<1, cpu_get_pc(machine->activecpu) ); return( 0 ); } } diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c index df0d31ba961..e876b342107 100644 --- a/src/mame/machine/namcos1.c +++ b/src/mame/machine/namcos1.c @@ -113,13 +113,13 @@ static UINT8 key[8]; static READ8_HANDLER( no_key_r ) { - popmessage("CPU #%d PC %08x: keychip read %04x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); + popmessage("CPU #%d PC %08x: keychip read %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset); return 0; } static WRITE8_HANDLER( no_key_w ) { - popmessage("CPU #%d PC %08x: keychip write %04x=%02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset,data); + popmessage("CPU #%d PC %08x: keychip write %04x=%02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset,data); } @@ -224,7 +224,7 @@ CPU #0 PC e3d4: keychip read 0003 [AND #$37 = key no.] */ static READ8_HANDLER( key_type1_r ) { -// logerror("CPU #%d PC %04x: keychip read %04x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); +// logerror("CPU #%d PC %04x: keychip read %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset); if (offset < 3) { @@ -255,7 +255,7 @@ static READ8_HANDLER( key_type1_r ) static WRITE8_HANDLER( key_type1_w ) { -// logerror("CPU #%d PC %04x: keychip write %04x=%02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset,data); +// logerror("CPU #%d PC %04x: keychip write %04x=%02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset,data); if (offset < 4) key[offset] = data; @@ -407,7 +407,7 @@ CPU #0 PC e574: keychip read 0001 static READ8_HANDLER( key_type2_r ) { -// logerror("CPU #%d PC %04x: keychip read %04x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); +// logerror("CPU #%d PC %04x: keychip read %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset); key_numerator_high_word = 0; @@ -426,7 +426,7 @@ static READ8_HANDLER( key_type2_r ) static WRITE8_HANDLER( key_type2_w ) { -// logerror("CPU #%d PC %04x: keychip write %04x=%02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset,data); +// logerror("CPU #%d PC %04x: keychip write %04x=%02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset,data); if (offset < 5) { @@ -535,7 +535,7 @@ static READ8_HANDLER( key_type3_r ) { int op; -// logerror("CPU #%d PC %04x: keychip read %04x\n",cpu_getactivecpu(),activecpu_get_pc(),offset); +// logerror("CPU #%d PC %04x: keychip read %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset); /* I need to handle blastoff's read from 0858. The game previously writes to 0858, using it as temporary storage, so maybe it expects to act as RAM, however @@ -551,14 +551,14 @@ static READ8_HANDLER( key_type3_r ) if (op == key_bottom4) return (offset << 4) | (key[key_swap4_arg] & 0x0f); if (op == key_top4) return (offset << 4) | (key[key_swap4_arg] >> 4); - popmessage("CPU #%d PC %08x: keychip read %04x",cpu_getactivecpu(),activecpu_get_pc(),offset); + popmessage("CPU #%d PC %08x: keychip read %04x",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset); return 0; } static WRITE8_HANDLER( key_type3_w ) { -// logerror("CPU #%d PC %04x: keychip write %04x=%02x\n",cpu_getactivecpu(),activecpu_get_pc(),offset,data); +// logerror("CPU #%d PC %04x: keychip write %04x=%02x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),offset,data); key[(offset & 0x70) >> 4] = data; } @@ -594,7 +594,7 @@ static int chip[16]; WRITE8_HANDLER( namcos1_cpu_control_w ) { -// logerror("reset control pc=%04x %02x\n",activecpu_get_pc(),data); +// logerror("reset control pc=%04x %02x\n",cpu_get_pc(machine->activecpu),data); if ((data & 1) ^ namcos1_reset) { mcu_patch_data = 0; @@ -610,7 +610,7 @@ WRITE8_HANDLER( namcos1_cpu_control_w ) WRITE8_HANDLER( namcos1_watchdog_w ) { - wdog |= 1 << (cpu_getactivecpu()); + wdog |= 1 << (cpunum_get_active()); if (wdog == 7 || !namcos1_reset) { wdog = 0; @@ -661,21 +661,21 @@ static WRITE8_HANDLER( soundram_w ) static WRITE8_HANDLER( rom_w ) { - logerror("CPU #%d PC %04x: warning - write %02x to rom address %04x\n",cpu_getactivecpu(),activecpu_get_pc(),data,offset); + logerror("CPU #%d PC %04x: warning - write %02x to rom address %04x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,offset); } /* error handlers */ static READ8_HANDLER( unknown_r ) { - logerror("CPU #%d PC %04x: warning - read from unknown chip\n",cpu_getactivecpu(),activecpu_get_pc() ); -// popmessage("CPU #%d PC %04x: read from unknown chip",cpu_getactivecpu(),activecpu_get_pc() ); + logerror("CPU #%d PC %04x: warning - read from unknown chip\n",cpunum_get_active(),cpu_get_pc(machine->activecpu) ); +// popmessage("CPU #%d PC %04x: read from unknown chip",cpunum_get_active(),cpu_get_pc(machine->activecpu) ); return 0; } static WRITE8_HANDLER( unknown_w ) { - logerror("CPU #%d PC %04x: warning - wrote to unknown chip\n",cpu_getactivecpu(),activecpu_get_pc() ); -// popmessage("CPU #%d PC %04x: wrote to unknown chip",cpu_getactivecpu(),activecpu_get_pc() ); + logerror("CPU #%d PC %04x: warning - wrote to unknown chip\n",cpunum_get_active(),cpu_get_pc(machine->activecpu) ); +// popmessage("CPU #%d PC %04x: wrote to unknown chip",cpunum_get_active(),cpu_get_pc(machine->activecpu) ); } /* Main bankswitching routine */ @@ -739,19 +739,19 @@ static void namcos1_bankswitch(running_machine *machine, int cpu, offs_t offset, /* unmapped bank warning */ if( namcos1_active_bank[bank].bank_handler_r == unknown_r) { - logerror("CPU #%d PC %04x:warning unknown chip selected bank %x=$%04x\n", cpu , activecpu_get_pc(), bank , chip[bank] ); -// if (chip) popmessage("CPU #%d PC %04x:unknown chip selected bank %x=$%04x", cpu , activecpu_get_pc(), bank , chip[bank] ); + logerror("CPU #%d PC %04x:warning unknown chip selected bank %x=$%04x\n", cpu , cpu_get_pc(machine->activecpu), bank , chip[bank] ); +// if (chip) popmessage("CPU #%d PC %04x:unknown chip selected bank %x=$%04x", cpu , cpu_get_pc(machine->activecpu), bank , chip[bank] ); } /* renew pc base */ -// change_pc(activecpu_get_pc()); +// change_pc(cpu_get_pc(machine->activecpu)); } WRITE8_HANDLER( namcos1_bankswitch_w ) { -// logerror("cpu %d: namcos1_bankswitch_w offset %04x data %02x\n",cpu_getactivecpu(),offset,data); +// logerror("cpu %d: namcos1_bankswitch_w offset %04x data %02x\n",cpunum_get_active(),offset,data); - namcos1_bankswitch(machine, cpu_getactivecpu(), offset, data); + namcos1_bankswitch(machine, cpunum_get_active(), offset, data); } /* Sub cpu set start bank port */ @@ -943,7 +943,7 @@ WRITE8_HANDLER( namcos1_mcu_bankswitch_w ) WRITE8_HANDLER( namcos1_mcu_patch_w ) { - //logerror("mcu C000 write pc=%04x data=%02x\n",activecpu_get_pc(),data); + //logerror("mcu C000 write pc=%04x data=%02x\n",cpu_get_pc(machine->activecpu),data); if (mcu_patch_data == 0xa6) return; mcu_patch_data = data; namcos1_triram[0] = data; diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c index 637d5f8bfda..4b0a58311c8 100644 --- a/src/mame/machine/namcos2.c +++ b/src/mame/machine/namcos2.c @@ -362,7 +362,7 @@ READ16_HANDLER( namcos2_68k_key_r ) { // case 3: return 0x142; case 4: return 0x142; - // case 3: popmessage("blah %08x",activecpu_get_pc()); + // case 3: popmessage("blah %08x",cpu_get_pc(machine->activecpu)); default: return mame_rand(machine); } break; diff --git a/src/mame/machine/nb1413m3.c b/src/mame/machine/nb1413m3.c index fbb6ba0d43d..0a53f52f60f 100644 --- a/src/mame/machine/nb1413m3.c +++ b/src/mame/machine/nb1413m3.c @@ -243,7 +243,7 @@ READ8_HANDLER( nb1413m3_sndrom_r ) int rombank; /* get top 8 bits of the I/O port address */ - offset = (offset << 8) | (activecpu_get_reg(Z80_BC) >> 8); + offset = (offset << 8) | (cpu_get_reg(machine->activecpu, Z80_BC) >> 8); switch (nb1413m3_type) { diff --git a/src/mame/machine/neoboot.c b/src/mame/machine/neoboot.c index f71189301a2..808a7f7a8ab 100644 --- a/src/mame/machine/neoboot.c +++ b/src/mame/machine/neoboot.c @@ -702,19 +702,19 @@ void lans2004_decrypt_68k( running_machine *machine ) static READ16_HANDLER( mslug5_prot_r ) { - logerror("PC %06x: access protected\n",activecpu_get_pc()); + logerror("PC %06x: access protected\n",cpu_get_pc(machine->activecpu)); return 0xa0; } static WRITE16_HANDLER ( ms5plus_bankswitch_w ) { int bankaddress; - logerror("offset: %06x PC %06x: set banking %04x\n",offset,activecpu_get_pc(),data); + logerror("offset: %06x PC %06x: set banking %04x\n",offset,cpu_get_pc(machine->activecpu),data); if ((offset == 0)&&(data == 0xa0)) { bankaddress=0xa0; neogeo_set_main_cpu_bank_address(machine, bankaddress); - logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,activecpu_get_pc(),bankaddress); + logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,cpu_get_pc(machine->activecpu),bankaddress); } else if(offset == 2) { @@ -722,7 +722,7 @@ static WRITE16_HANDLER ( ms5plus_bankswitch_w ) //data=data&7; bankaddress=data*0x100000; neogeo_set_main_cpu_bank_address(machine, bankaddress); - logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,activecpu_get_pc(),bankaddress); + logerror("offset: %06x PC %06x: set banking %04x\n\n",offset,cpu_get_pc(machine->activecpu),bankaddress); } } diff --git a/src/mame/machine/neoprot.c b/src/mame/machine/neoprot.c index e3a6e5bca31..c025745c470 100644 --- a/src/mame/machine/neoprot.c +++ b/src/mame/machine/neoprot.c @@ -49,7 +49,7 @@ static READ16_HANDLER( fatfury2_protection_16_r ) return ((res & 0xf0) >> 4) | ((res & 0x0f) << 4); default: -logerror("unknown protection read at pc %06x, offset %08x\n",activecpu_get_pc(),offset<<1); +logerror("unknown protection read at pc %06x, offset %08x\n",cpu_get_pc(machine->activecpu),offset<<1); return 0; } } @@ -94,7 +94,7 @@ static WRITE16_HANDLER( fatfury2_protection_16_w ) break; default: - logerror("unknown protection write at pc %06x, offset %08x, data %02x\n",activecpu_get_pc(),offset,data); + logerror("unknown protection write at pc %06x, offset %08x, data %02x\n",cpu_get_pc(machine->activecpu),offset,data); break; } } @@ -125,17 +125,17 @@ static WRITE16_HANDLER ( kof98_prot_w ) switch (data) { case 0x0090: - logerror ("%06x kof98 - protection 0x0090 old %04x %04x\n",activecpu_get_pc(), mem16[0x100/2], mem16[0x102/2]); + logerror ("%06x kof98 - protection 0x0090 old %04x %04x\n",cpu_get_pc(machine->activecpu), mem16[0x100/2], mem16[0x102/2]); mem16[0x100/2] = 0x00c2; mem16[0x102/2] = 0x00fd; break; case 0x00f0: - logerror ("%06x kof98 - protection 0x00f0 old %04x %04x\n",activecpu_get_pc(), mem16[0x100/2], mem16[0x102/2]); + logerror ("%06x kof98 - protection 0x00f0 old %04x %04x\n",cpu_get_pc(machine->activecpu), mem16[0x100/2], mem16[0x102/2]); mem16[0x100/2] = 0x4e45; mem16[0x102/2] = 0x4f2d; break; default: // 00aa is written, but not needed? - logerror ("%06x kof98 - unknown protection write %04x\n",activecpu_get_pc(), data); + logerror ("%06x kof98 - unknown protection write %04x\n",cpu_get_pc(machine->activecpu), data); break; } } diff --git a/src/mame/machine/nmk004.c b/src/mame/machine/nmk004.c index 946a6251fdd..5aacebdac63 100644 --- a/src/mame/machine/nmk004.c +++ b/src/mame/machine/nmk004.c @@ -1058,7 +1058,7 @@ WRITE16_HANDLER( NMK004_w ) { if (ACCESSING_BITS_0_7) { -logerror("%06x: NMK004_w %02x\n",activecpu_get_pc(),data); +logerror("%06x: NMK004_w %02x\n",cpu_get_pc(machine->activecpu),data); NMK004_state.from_main = data & 0xff; } } @@ -1068,7 +1068,7 @@ READ16_HANDLER( NMK004_r ) static int last; int res = NMK004_state.to_main; -if (res != last) logerror("%06x: NMK004_r %02x\n",activecpu_get_pc(),res); +if (res != last) logerror("%06x: NMK004_r %02x\n",cpu_get_pc(machine->activecpu),res); last = res; return res; diff --git a/src/mame/machine/opwolf.c b/src/mame/machine/opwolf.c index 573d630d6d0..cf17e449b2f 100644 --- a/src/mame/machine/opwolf.c +++ b/src/mame/machine/opwolf.c @@ -418,7 +418,7 @@ WRITE16_HANDLER( opwolf_cchip_data_w ) cchip_ram[(current_bank * 0x400) + offset]=data&0xff; // if (offset!=0x64 && offset!=0x65 && offset!=0x66 && offset!=0x67 && offset!=0x68 && offset!=0x69) -// logerror("%08x: opwolf c write %04x %04x\n", activecpu_get_pc(), offset,data); +// logerror("%08x: opwolf c write %04x %04x\n", cpu_get_pc(machine->activecpu), offset,data); if (current_bank == 0) { @@ -518,8 +518,8 @@ READ16_HANDLER( opwolf_cchip_status_r ) READ16_HANDLER( opwolf_cchip_data_r ) { -// if (offset!=0x7f && offset!=0x1c && offset!=0x1d && offset!=0x1e && offset!=0x1f && offset!=0x20 && activecpu_get_pc()!=0xc18 && activecpu_get_pc()!=0xc2e && activecpu_get_pc()!=0xc9e && offset!=0x50 && offset!=0x51 && offset!=0x52 && offset!=0x53 && offset!=0x5 && offset!=0x13 && offset!=0x79 && offset!=0x12 && offset!=0x34) -// logerror("%08x: opwolf c read %04x (bank %04x)\n", activecpu_get_pc(), offset, current_bank); +// if (offset!=0x7f && offset!=0x1c && offset!=0x1d && offset!=0x1e && offset!=0x1f && offset!=0x20 && cpu_get_pc(machine->activecpu)!=0xc18 && cpu_get_pc(machine->activecpu)!=0xc2e && cpu_get_pc(machine->activecpu)!=0xc9e && offset!=0x50 && offset!=0x51 && offset!=0x52 && offset!=0x53 && offset!=0x5 && offset!=0x13 && offset!=0x79 && offset!=0x12 && offset!=0x34) +// logerror("%08x: opwolf c read %04x (bank %04x)\n", cpu_get_pc(machine->activecpu), offset, current_bank); return cchip_ram[(current_bank * 0x400) + offset]; } diff --git a/src/mame/machine/pgmprot.c b/src/mame/machine/pgmprot.c index 6c01abfdaa3..e23ea77eee8 100644 --- a/src/mame/machine/pgmprot.c +++ b/src/mame/machine/pgmprot.c @@ -296,7 +296,7 @@ WRITE16_HANDLER (PSTARS_w16) break; default: PSTARS_VAL=0x890000; - logerror("PSTARS PC(%06x) UNKNOWN %4X %4X\n",activecpu_get_pc(),PSTARSINT[1],PSTARSINT[0]); + logerror("PSTARS PC(%06x) UNKNOWN %4X %4X\n",cpu_get_pc(machine->activecpu),PSTARSINT[1],PSTARSINT[0]); } @@ -525,21 +525,21 @@ READ16_HANDLER (ASIC28_r16) { UINT32 val=(ASIC28REGS[1]<<16)|(ASIC28REGS[0]); -//logerror("Asic28 Read PC = %06x Command = %02x ??\n",activecpu_get_pc(), ASIC28REGS[1]); +//logerror("Asic28 Read PC = %06x Command = %02x ??\n",cpu_get_pc(machine->activecpu), ASIC28REGS[1]); switch(ASIC28REGS[1]&0xff) { case 0x20: // PhotoY2k spritenum conversion 4/4 if(!ASIC28RCNT) - logerror("ASIC28: PhotoY2K spr4 %04x %06x (%06x)\n", val & 0xffff, photoy2k_trf[2], activecpu_get_pc()); + logerror("ASIC28: PhotoY2K spr4 %04x %06x (%06x)\n", val & 0xffff, photoy2k_trf[2], cpu_get_pc(machine->activecpu)); val = photoy2k_soff >> 16; break; case 0x21: // PhotoY2k spritenum conversion 3/4 if(!ASIC28RCNT) { photoy2k_trf[2] = val & 0xffff; - logerror("ASIC28: PhotoY2K spr3 %04x %06x (%06x)\n", val & 0xffff, photoy2k_trf[1], activecpu_get_pc()); + logerror("ASIC28: PhotoY2K spr3 %04x %06x (%06x)\n", val & 0xffff, photoy2k_trf[1], cpu_get_pc(machine->activecpu)); if(photoy2k_trf[0] < 0x3c00) photoy2k_soff = pgmy2ks[photoy2k_trf[0]]; else @@ -552,7 +552,7 @@ READ16_HANDLER (ASIC28_r16) case 0x22: // PhotoY2k spritenum conversion 2/4 if(!ASIC28RCNT) { photoy2k_trf[1] = val & 0xffff; - logerror("ASIC28: PhotoY2K spr2 %04x %06x (%06x)\n", val & 0xffff, photoy2k_trf[0], activecpu_get_pc()); + logerror("ASIC28: PhotoY2K spr2 %04x %06x (%06x)\n", val & 0xffff, photoy2k_trf[0], cpu_get_pc(machine->activecpu)); } val = photoy2k_trf[0] | 0x880000; break; @@ -560,7 +560,7 @@ READ16_HANDLER (ASIC28_r16) case 0x23: // PhotoY2k spritenum conversion 1/4 if(!ASIC28RCNT) { photoy2k_trf[0] = val & 0xffff; - logerror("ASIC28: PhotoY2K spr1 %04x (%06x)\n", val & 0xffff, activecpu_get_pc()); + logerror("ASIC28: PhotoY2K spr1 %04x (%06x)\n", val & 0xffff, cpu_get_pc(machine->activecpu)); } val = 0x880000; break; @@ -570,7 +570,7 @@ READ16_HANDLER (ASIC28_r16) photoy2k_seqpos++; val = photoy2k_spritenum(); if(!ASIC28RCNT) - logerror("ASIC28: PhotoY2K seq_next %05x -> %06x (%06x)\n", photoy2k_seqpos, val, activecpu_get_pc()); + logerror("ASIC28: PhotoY2K seq_next %05x -> %06x (%06x)\n", photoy2k_seqpos, val, cpu_get_pc(machine->activecpu)); break; case 0x32: // PhotoY2k start of sequence @@ -578,7 +578,7 @@ READ16_HANDLER (ASIC28_r16) photoy2k_seqpos = (val & 0xffff) << 4; val = photoy2k_spritenum(); if(!ASIC28RCNT) - logerror("ASIC28: PhotoY2K seq_start %05x -> %06x (%06x)\n", photoy2k_seqpos, val, activecpu_get_pc()); + logerror("ASIC28: PhotoY2K seq_start %05x -> %06x (%06x)\n", photoy2k_seqpos, val, cpu_get_pc(machine->activecpu)); break; case 0x99: diff --git a/src/mame/machine/pitnrun.c b/src/mame/machine/pitnrun.c index 8f90ce5f698..ef343875cf9 100644 --- a/src/mame/machine/pitnrun.c +++ b/src/mame/machine/pitnrun.c @@ -120,15 +120,15 @@ WRITE8_HANDLER( pitnrun_68705_portB_w ) } if (~data & 0x10) { - cpuintrf_push_context(0); + cpu_push_context(machine->cpu[0]); program_write_byte(address, portA_out); - cpuintrf_pop_context(); + cpu_pop_context(); } if (~data & 0x20) { - cpuintrf_push_context(0); + cpu_push_context(machine->cpu[0]); portA_in = program_read_byte(address); - cpuintrf_pop_context(); + cpu_pop_context(); } if (~data & 0x40) { diff --git a/src/mame/machine/psx.c b/src/mame/machine/psx.c index 176a4e85846..69a44f50896 100644 --- a/src/mame/machine/psx.c +++ b/src/mame/machine/psx.c @@ -7,6 +7,7 @@ ***************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "cpu/mips/psx.h" #include "includes/psx.h" @@ -21,9 +22,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/mame/machine/retofinv.c b/src/mame/machine/retofinv.c index c83c790f368..48465a821b8 100644 --- a/src/mame/machine/retofinv.c +++ b/src/mame/machine/retofinv.c @@ -17,13 +17,13 @@ static UINT8 portA_in,portA_out,ddrA; READ8_HANDLER( retofinv_68705_portA_r ) { -//logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); +//logerror("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in); return (portA_out & ddrA) | (portA_in & ~ddrA); } WRITE8_HANDLER( retofinv_68705_portA_w ) { -//logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data); portA_out = data; } @@ -52,7 +52,7 @@ READ8_HANDLER( retofinv_68705_portB_r ) WRITE8_HANDLER( retofinv_68705_portB_w ) { -//logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data); if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) { @@ -93,13 +93,13 @@ READ8_HANDLER( retofinv_68705_portC_r ) portC_in = 0; if (main_sent) portC_in |= 0x01; if (!mcu_sent) portC_in |= 0x02; -//logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),portC_in); +//logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(machine->activecpu),portC_in); return (portC_out & ddrC) | (portC_in & ~ddrC); } WRITE8_HANDLER( retofinv_68705_portC_w ) { -logerror("%04x: 68705 port C write %02x\n",activecpu_get_pc(),data); +logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(machine->activecpu),data); portC_out = data; } @@ -111,7 +111,7 @@ WRITE8_HANDLER( retofinv_68705_ddrC_w ) WRITE8_HANDLER( retofinv_mcu_w ) { -logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); +logerror("%04x: mcu_w %02x\n",cpu_get_pc(machine->activecpu),data); from_main = data; main_sent = 1; cpunum_set_input_line(machine, 3,0,ASSERT_LINE); @@ -119,7 +119,7 @@ logerror("%04x: mcu_w %02x\n",activecpu_get_pc(),data); READ8_HANDLER( retofinv_mcu_r ) { -logerror("%04x: mcu_r %02x\n",activecpu_get_pc(),from_mcu); +logerror("%04x: mcu_r %02x\n",cpu_get_pc(machine->activecpu),from_mcu); mcu_sent = 0; return from_mcu; } @@ -130,7 +130,7 @@ READ8_HANDLER( retofinv_mcu_status_r ) /* bit 4 = when 1, mcu is ready to receive data from main cpu */ /* bit 5 = when 1, mcu has sent data to the main cpu */ -//logerror("%04x: mcu_status_r\n",activecpu_get_pc()); +//logerror("%04x: mcu_status_r\n",cpu_get_pc(machine->activecpu)); if (!main_sent) res |= 0x10; if (mcu_sent) res |= 0x20; diff --git a/src/mame/machine/s16fd.c b/src/mame/machine/s16fd.c index cd5fd880221..e407c53d8d3 100644 --- a/src/mame/machine/s16fd.c +++ b/src/mame/machine/s16fd.c @@ -65,7 +65,7 @@ static void fd1094_setstate_and_decrypt(int state) fd1094_state = state; - cpunum_set_info_int(0, CPUINFO_INT_REGISTER + M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache + cpu_set_reg(Machine->cpu[0], M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache /* set the FD1094 state ready to decrypt.. */ state = fd1094_set_state(fd1094_key,state) & 0xff; @@ -150,8 +150,8 @@ void fd1094_machine_init(void) fd1094_setstate_and_decrypt(FD1094_STATE_RESET); fd1094_kludge_reset_values(); - cpunum_set_info_fct(0, CPUINFO_PTR_M68K_CMPILD_CALLBACK, (genf *)fd1094_cmp_callback); - cpunum_set_info_fct(0, CPUINFO_PTR_M68K_RTE_CALLBACK, (genf *)fd1094_rte_callback); + cpu_set_info_fct(Machine->cpu[0], CPUINFO_PTR_M68K_CMPILD_CALLBACK, (genf *)fd1094_cmp_callback); + cpu_set_info_fct(Machine->cpu[0], CPUINFO_PTR_M68K_RTE_CALLBACK, (genf *)fd1094_rte_callback); cpunum_set_irq_callback(0, fd1094_int_callback); } @@ -188,7 +188,7 @@ static void key_changed(void) fd1094_current_cacheposition = 1; /* flush the prefetch queue */ - cpunum_set_info_int(0, CPUINFO_INT_REGISTER + M68K_PREF_ADDR, 0x0010); + cpu_set_reg(Machine->cpu[0], M68K_PREF_ADDR, 0x0010); } diff --git a/src/mame/machine/s24fd.c b/src/mame/machine/s24fd.c index a4e0ba56d94..69b207a2119 100644 --- a/src/mame/machine/s24fd.c +++ b/src/mame/machine/s24fd.c @@ -45,7 +45,7 @@ static void s24_fd1094_setstate_and_decrypt(int state) fd1094_state = state; - cpunum_set_info_int(1, CPUINFO_INT_REGISTER + M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache + cpu_set_reg(Machine->cpu[1], M68K_PREF_ADDR, 0x0010); // force a flush of the prefetch cache /* set the s24_fd1094 state ready to decrypt.. */ state = fd1094_set_state(s24_fd1094_key,state) & 0xff; @@ -132,8 +132,8 @@ void s24_fd1094_machine_init(void) s24_fd1094_setstate_and_decrypt(FD1094_STATE_RESET); s24_fd1094_kludge_reset_values(); - cpunum_set_info_fct(1, CPUINFO_PTR_M68K_CMPILD_CALLBACK, (genf *)s24_fd1094_cmp_callback); - cpunum_set_info_fct(1, CPUINFO_PTR_M68K_RTE_CALLBACK, (genf *)s24_fd1094_rte_callback); + cpu_set_info_fct(Machine->cpu[1], CPUINFO_PTR_M68K_CMPILD_CALLBACK, (genf *)s24_fd1094_cmp_callback); + cpu_set_info_fct(Machine->cpu[1], CPUINFO_PTR_M68K_RTE_CALLBACK, (genf *)s24_fd1094_rte_callback); cpunum_set_irq_callback(1, s24_fd1094_int_callback); } diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c index 650b874d791..1fcf3138a26 100644 --- a/src/mame/machine/scramble.c +++ b/src/mame/machine/scramble.c @@ -88,7 +88,7 @@ static WRITE8_DEVICE_HANDLER( scramble_protection_w ) static READ8_DEVICE_HANDLER( scramble_protection_r ) { - switch (activecpu_get_pc()) + switch (cpu_get_pc(device->machine->activecpu)) { case 0x00a8: return 0xf0; case 0x00be: return 0xb0; @@ -99,7 +99,7 @@ static READ8_DEVICE_HANDLER( scramble_protection_r ) case 0x1ca2: return 0x00; /* I don't think it's checked */ case 0x1d7e: return 0xb0; default: - logerror("%04x: read protection\n",activecpu_get_pc()); + logerror("%04x: read protection\n",cpu_get_pc(device->machine->activecpu)); return 0; } } @@ -118,16 +118,16 @@ static READ8_HANDLER( mariner_protection_2_r ) READ8_HANDLER( triplep_pip_r ) { - logerror("PC %04x: triplep read port 2\n",activecpu_get_pc()); - if (activecpu_get_pc() == 0x015a) return 0xff; - else if (activecpu_get_pc() == 0x0886) return 0x05; + logerror("PC %04x: triplep read port 2\n",cpu_get_pc(machine->activecpu)); + if (cpu_get_pc(machine->activecpu) == 0x015a) return 0xff; + else if (cpu_get_pc(machine->activecpu) == 0x0886) return 0x05; else return 0; } READ8_HANDLER( triplep_pap_r ) { - logerror("PC %04x: triplep read port 3\n",activecpu_get_pc()); - if (activecpu_get_pc() == 0x015d) return 0x04; + logerror("PC %04x: triplep read port 3\n",cpu_get_pc(machine->activecpu)); + if (cpu_get_pc(machine->activecpu) == 0x015d) return 0x04; else return 0; } diff --git a/src/mame/machine/segaic16.c b/src/mame/machine/segaic16.c index 23a41ddc3f8..e769063efe5 100644 --- a/src/mame/machine/segaic16.c +++ b/src/mame/machine/segaic16.c @@ -111,7 +111,7 @@ READ16_HANDLER( segaic16_open_bus_r ) /* read original encrypted memory at that address */ recurse = 1; - result = program_read_word_16be(activecpu_get_pc()); + result = program_read_word_16be(cpu_get_pc(machine->activecpu)); recurse = 0; return result; } @@ -239,17 +239,17 @@ static void memory_mapper_w(running_machine *machine, struct memory_mapper_chip if (data == 0x01) { offs_t addr = (chip->regs[0x0a] << 17) | (chip->regs[0x0b] << 9) | (chip->regs[0x0c] << 1); - cpuintrf_push_context(mame_find_cpu_index(machine, chip->cpu)); + cpu_push_context(machine->cpu[mame_find_cpu_index(machine, chip->cpu)]); program_write_word_16be(addr, (chip->regs[0x00] << 8) | chip->regs[0x01]); - cpuintrf_pop_context(); + cpu_pop_context(); } else if (data == 0x02) { offs_t addr = (chip->regs[0x07] << 17) | (chip->regs[0x08] << 9) | (chip->regs[0x09] << 1); UINT16 result; - cpuintrf_push_context(mame_find_cpu_index(machine, chip->cpu)); + cpu_push_context(machine->cpu[mame_find_cpu_index(machine, chip->cpu)]); result = program_read_word_16be(addr); - cpuintrf_pop_context(); + cpu_pop_context(); chip->regs[0x00] = result >> 8; chip->regs[0x01] = result; } @@ -545,12 +545,12 @@ static UINT16 divide_r(int which, offs_t offset, UINT16 mem_mask) } -static void divide_w(int which, offs_t offset, UINT16 data, UINT16 mem_mask) +static void divide_w(running_machine *machine, int which, offs_t offset, UINT16 data, UINT16 mem_mask) { int a4 = offset & 8; int a3 = offset & 4; - if (LOG_DIVIDE) logerror("%06X:divide%d_w(%X) = %04X\n", activecpu_get_pc(), which, offset, data); + if (LOG_DIVIDE) logerror("%06X:divide%d_w(%X) = %04X\n", cpu_get_pc(machine->activecpu), which, offset, data); /* only 4 effective write registers */ offset &= 3; @@ -570,9 +570,9 @@ static void divide_w(int which, offs_t offset, UINT16 data, UINT16 mem_mask) READ16_HANDLER( segaic16_divide_0_r ) { return divide_r(0, offset, mem_mask); } READ16_HANDLER( segaic16_divide_1_r ) { return divide_r(1, offset, mem_mask); } READ16_HANDLER( segaic16_divide_2_r ) { return divide_r(2, offset, mem_mask); } -WRITE16_HANDLER( segaic16_divide_0_w ) { divide_w(0, offset, data, mem_mask); } -WRITE16_HANDLER( segaic16_divide_1_w ) { divide_w(1, offset, data, mem_mask); } -WRITE16_HANDLER( segaic16_divide_2_w ) { divide_w(2, offset, data, mem_mask); } +WRITE16_HANDLER( segaic16_divide_0_w ) { divide_w(machine, 0, offset, data, mem_mask); } +WRITE16_HANDLER( segaic16_divide_1_w ) { divide_w(machine, 1, offset, data, mem_mask); } +WRITE16_HANDLER( segaic16_divide_2_w ) { divide_w(machine, 2, offset, data, mem_mask); } @@ -648,7 +648,7 @@ static void timer_interrupt_ack(running_machine *machine, int which) static UINT16 compare_timer_r(running_machine *machine, int which, offs_t offset, UINT16 mem_mask) { offset &= 0xf; - if (LOG_COMPARE) logerror("%06X:compare%d_r(%X) = %04X\n", activecpu_get_pc(), which, offset, compare_timer[which].regs[offset]); + if (LOG_COMPARE) logerror("%06X:compare%d_r(%X) = %04X\n", cpu_get_pc(machine->activecpu), which, offset, compare_timer[which].regs[offset]); switch (offset) { case 0x0: return compare_timer[which].regs[0]; @@ -669,7 +669,7 @@ static UINT16 compare_timer_r(running_machine *machine, int which, offs_t offset static void compare_timer_w(running_machine *machine, int which, offs_t offset, UINT16 data, UINT16 mem_mask) { offset &= 0xf; - if (LOG_COMPARE) logerror("%06X:compare%d_w(%X) = %04X\n", activecpu_get_pc(), which, offset, data); + if (LOG_COMPARE) logerror("%06X:compare%d_w(%X) = %04X\n", cpu_get_pc(machine->activecpu), which, offset, data); switch (offset) { case 0x0: COMBINE_DATA(&compare_timer[which].regs[0]); update_compare(which, 0); break; diff --git a/src/mame/machine/segas24.c b/src/mame/machine/segas24.c index d424f92fcbc..eccf5bcac20 100644 --- a/src/mame/machine/segas24.c +++ b/src/mame/machine/segas24.c @@ -48,7 +48,7 @@ void system24temp_sys16_io_set_callbacks(UINT8 (*io_r)(running_machine *machine, READ16_HANDLER ( system24temp_sys16_io_r ) { - // logerror("IO read %02x (%d:%x)\n", offset, cpu_getactivecpu(), activecpu_get_pc()); + // logerror("IO read %02x (%d:%x)\n", offset, cpunum_get_active(), cpu_get_pc(machine->activecpu)); if(offset < 8) return system24temp_sys16_io_io_r ? system24temp_sys16_io_io_r(machine,offset) : 0xff; else if (offset < 0x20) { @@ -66,7 +66,7 @@ READ16_HANDLER ( system24temp_sys16_io_r ) case 0xf: return system24temp_sys16_io_dir; default: - logerror("IO control read %02x (%d:%x)\n", offset, cpu_getactivecpu(), activecpu_get_pc()); + logerror("IO control read %02x (%d:%x)\n", offset, cpunum_get_active(), cpu_get_pc(machine->activecpu)); return 0xff; } } else @@ -84,7 +84,7 @@ WRITE16_HANDLER( system24temp_sys16_io_w ) if(ACCESSING_BITS_0_7) { if(offset < 8) { if(!(system24temp_sys16_io_dir & (1 << offset))) { - logerror("IO port write on input-only port (%d, [%02x], %02x, %d:%x)\n", offset, system24temp_sys16_io_dir, data & 0xff, cpu_getactivecpu(), activecpu_get_pc()); + logerror("IO port write on input-only port (%d, [%02x], %02x, %d:%x)\n", offset, system24temp_sys16_io_dir, data & 0xff, cpunum_get_active(), cpu_get_pc(machine->activecpu)); return; } if(system24temp_sys16_io_io_w) @@ -100,7 +100,7 @@ WRITE16_HANDLER( system24temp_sys16_io_w ) system24temp_sys16_io_dir = data; break; default: - logerror("IO control write %02x, %02x (%d:%x)\n", offset, data & 0xff, cpu_getactivecpu(), activecpu_get_pc()); + logerror("IO control write %02x, %02x (%d:%x)\n", offset, data & 0xff, cpunum_get_active(), cpu_get_pc(machine->activecpu)); } } } diff --git a/src/mame/machine/segas32.c b/src/mame/machine/segas32.c index 803135ad3fd..eb57d205c62 100644 --- a/src/mame/machine/segas32.c +++ b/src/mame/machine/segas32.c @@ -245,14 +245,14 @@ void darkedge_fd1149_vblank(void) WRITE16_HANDLER( darkedge_protection_w ) { logerror("%06x:darkedge_prot_w(%06X) = %04X & %04X\n", - activecpu_get_pc(), 0xa00000 + 2*offset, data, mem_mask); + cpu_get_pc(machine->activecpu), 0xa00000 + 2*offset, data, mem_mask); } READ16_HANDLER( darkedge_protection_r ) { logerror("%06x:darkedge_prot_r(%06X) & %04X\n", - activecpu_get_pc(), 0xa00000 + 2*offset, mem_mask); + cpu_get_pc(machine->activecpu), 0xa00000 + 2*offset, mem_mask); return 0xffff; } @@ -287,12 +287,12 @@ READ16_HANDLER( dbzvrvs_protection_r ) // protection ram is 8-bits wide and only occupies every other address READ16_HANDLER(arabfgt_protection_r) { - int PC = activecpu_get_pc(); + int PC = cpu_get_pc(machine->activecpu); int cmpVal; if (PC == 0xfe0325 || PC == 0xfe01e5 || PC == 0xfe035e || PC == 0xfe03cc) { - cmpVal = activecpu_get_reg(1); + cmpVal = cpu_get_reg(machine->activecpu, 1); // R0 always contains the value the protection is supposed to return (!) return cmpVal; diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c index de5279dbeb9..7591ab36ca3 100644 --- a/src/mame/machine/seicop.c +++ b/src/mame/machine/seicop.c @@ -756,7 +756,7 @@ READ16_HANDLER( copdxbl_0_r ) { default: { - logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); + logerror("%06x: COPX unhandled read returning %04x from offset %04x\n", cpu_get_pc(machine->activecpu), retvalue, offset*2); return retvalue; } @@ -782,7 +782,7 @@ WRITE16_HANDLER( copdxbl_0_w ) default: { - logerror("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); + logerror("%06x: COPX unhandled write data %04x at offset %04x\n", cpu_get_pc(machine->activecpu), data, offset*2); break; } @@ -990,12 +990,12 @@ WRITE16_HANDLER( raiden2_cop2_w ) /* ----- program upload registers ----- */ case 0x432/2: /* COP program data */ - COP_LOG(("%05X:COP Prog Data = %04X\n", activecpu_get_pc(), data)); + COP_LOG(("%05X:COP Prog Data = %04X\n", cpu_get_pc(machine->activecpu), data)); cop->program[cop_ram_r(cop, 0x434)] = data; break; case 0x434/2: /* COP program address */ - COP_LOG(("%05X:COP Prog Addr = %04X\n", activecpu_get_pc(), data)); + COP_LOG(("%05X:COP Prog Addr = %04X\n", cpu_get_pc(machine->activecpu), data)); assert((data & ~0xff) == 0); temp32 = (data & 0xff) / 8; cop->func_value[temp32] = cop_ram_r(cop, 0x438); @@ -1005,15 +1005,15 @@ WRITE16_HANDLER( raiden2_cop2_w ) break; case 0x438/2: /* COP program entry value (0,4,5,6,7,8,9,F) */ - COP_LOG(("%05X:COP Prog Val = %04X\n", activecpu_get_pc(), data)); + COP_LOG(("%05X:COP Prog Val = %04X\n", cpu_get_pc(machine->activecpu), data)); break; case 0x43a/2: /* COP program entry mask */ - COP_LOG(("%05X:COP Prog Mask = %04X\n", activecpu_get_pc(), data)); + COP_LOG(("%05X:COP Prog Mask = %04X\n", cpu_get_pc(machine->activecpu), data)); break; case 0x43c/2: /* COP program trigger value */ - COP_LOG(("%05X:COP Prog Trig = %04X\n", activecpu_get_pc(), data)); + COP_LOG(("%05X:COP Prog Trig = %04X\n", cpu_get_pc(machine->activecpu), data)); break; /* ----- ???? ----- */ @@ -1023,13 +1023,13 @@ WRITE16_HANDLER( raiden2_cop2_w ) { UINT32 addr = cop_ram_r(cop, 0x478) << 6; int count = (cop_ram_r(cop, 0x47a) + 1) << 5; - COP_LOG(("%05X:COP RAM clear from %05X to %05X\n", activecpu_get_pc(), addr, addr + count)); + COP_LOG(("%05X:COP RAM clear from %05X to %05X\n", cpu_get_pc(machine->activecpu), addr, addr + count)); while (count--) program_write_byte(addr++, 0); } else { - COP_LOG(("%05X:COP Unknown RAM clear(%04X) = %04X\n", activecpu_get_pc(), cop_ram_r(cop, 0x47e), data)); + COP_LOG(("%05X:COP Unknown RAM clear(%04X) = %04X\n", cpu_get_pc(machine->activecpu), cop_ram_r(cop, 0x47e), data)); } break; @@ -1040,7 +1040,7 @@ WRITE16_HANDLER( raiden2_cop2_w ) case 0x4a4/2: /* COP register high word */ case 0x4a6/2: /* COP register high word */ regnum = (offset) % 4; - COP_LOG(("%05X:COP RegHi(%d) = %04X\n", activecpu_get_pc(), regnum, data)); + COP_LOG(("%05X:COP RegHi(%d) = %04X\n", cpu_get_pc(machine->activecpu), regnum, data)); cop->reg[regnum] = (cop->reg[regnum] & 0x0000ffff) | (data << 16); break; @@ -1049,14 +1049,14 @@ WRITE16_HANDLER( raiden2_cop2_w ) case 0x4c4/2: /* COP register low word */ case 0x4c6/2: /* COP register low word */ regnum = (offset) % 4; - COP_LOG(("%05X:COP RegLo(%d) = %04X\n", activecpu_get_pc(), regnum, data)); + COP_LOG(("%05X:COP RegLo(%d) = %04X\n", cpu_get_pc(machine->activecpu), regnum, data)); cop->reg[regnum] = (cop->reg[regnum] & 0xffff0000) | data; break; /* ----- program trigger register ----- */ case 0x500/2: /* COP trigger */ - COP_LOG(("%05X:COP Trigger = %04X\n", activecpu_get_pc(), data)); + COP_LOG(("%05X:COP Trigger = %04X\n", cpu_get_pc(machine->activecpu), data)); for (func = 0; func < ARRAY_LENGTH(cop->func_trigger); func++) if (cop->func_trigger[func] == data) { @@ -1084,13 +1084,13 @@ WRITE16_HANDLER( raiden2_cop2_w ) } break; } - logerror("%05X:COP Warning - can't find command - func != ARRAY_LENGTH(cop->func_trigger)\n", activecpu_get_pc()); + logerror("%05X:COP Warning - can't find command - func != ARRAY_LENGTH(cop->func_trigger)\n", cpu_get_pc(machine->activecpu)); break; /* ----- other stuff ----- */ default: /* unknown */ - COP_LOG(("%05X:COP Unknown(%04X) = %04X\n", activecpu_get_pc(), offset*2 + 0x400, data)); + COP_LOG(("%05X:COP Unknown(%04X) = %04X\n", cpu_get_pc(machine->activecpu), offset*2 + 0x400, data)); break; } } @@ -1099,7 +1099,7 @@ WRITE16_HANDLER( raiden2_cop2_w ) READ16_HANDLER( raiden2_cop2_r ) { cop_state *cop = &cop_data; - COP_LOG(("%05X:COP Read(%04X) = %04X\n", activecpu_get_pc(), offset*2 + 0x400, cop->ram[offset])); + COP_LOG(("%05X:COP Read(%04X) = %04X\n", cpu_get_pc(machine->activecpu), offset*2 + 0x400, cop->ram[offset])); return cop->ram[offset]; } #endif @@ -1123,7 +1123,7 @@ static READ16_HANDLER( generic_cop_r ) switch (offset) { default: - seibu_cop_log("%06x: COPX unhandled read returning %04x from offset %04x\n", activecpu_get_pc(), retvalue, offset*2); + seibu_cop_log("%06x: COPX unhandled read returning %04x from offset %04x\n", cpu_get_pc(machine->activecpu), retvalue, offset*2); return retvalue; break; @@ -1145,7 +1145,7 @@ static WRITE16_HANDLER( generic_cop_w ) switch (offset) { default: - seibu_cop_log("%06x: COPX unhandled write data %04x at offset %04x\n", activecpu_get_pc(), data, offset*2); + seibu_cop_log("%06x: COPX unhandled write data %04x at offset %04x\n", cpu_get_pc(machine->activecpu), data, offset*2); break; /* BCD Protection */ @@ -1164,14 +1164,14 @@ static WRITE16_HANDLER( generic_cop_w ) case (0x078/2): /* clear address */ { cop_clearfill_address[cop_clearfill_lasttrigger] = data; // << 6 to get actual address - seibu_cop_log("%06x: COPX set layer clear address to %04x (actual %08x)\n", activecpu_get_pc(), data, data<<6); + seibu_cop_log("%06x: COPX set layer clear address to %04x (actual %08x)\n", cpu_get_pc(machine->activecpu), data, data<<6); break; } case (0x07a/2): /* clear length */ { cop_clearfill_length[cop_clearfill_lasttrigger] = data; - seibu_cop_log("%06x: COPX set layer clear length to %04x (actual %08x)\n", activecpu_get_pc(), data, data<<5); + seibu_cop_log("%06x: COPX set layer clear length to %04x (actual %08x)\n", cpu_get_pc(machine->activecpu), data, data<<5); break; } @@ -1179,7 +1179,7 @@ static WRITE16_HANDLER( generic_cop_w ) case (0x07c/2): /* clear value? */ { cop_clearfill_value[cop_clearfill_lasttrigger] = data; - seibu_cop_log("%06x: COPX set layer clear value to %04x (actual %08x)\n", activecpu_get_pc(), data, data<<6); + seibu_cop_log("%06x: COPX set layer clear value to %04x (actual %08x)\n", cpu_get_pc(machine->activecpu), data, data<<6); break; } @@ -1187,7 +1187,7 @@ static WRITE16_HANDLER( generic_cop_w ) case (0x07e/2): { cop_clearfill_lasttrigger = data; - seibu_cop_log("%06x: COPX set layer clear trigger? to %04x\n", activecpu_get_pc(), data); + seibu_cop_log("%06x: COPX set layer clear trigger? to %04x\n", cpu_get_pc(machine->activecpu), data); if (data>=0x1ff) { seibu_cop_log("invalid!, >0x1ff\n"); @@ -1219,7 +1219,7 @@ static WRITE16_HANDLER( generic_cop_w ) int i; int command; - seibu_cop_log("%06x: COPX execute table macro command %04x %04x | regs %08x %08x %08x %08x %08x\n", activecpu_get_pc(), data, cop_mcu_ram[offset], cop_register[0], cop_register[1], cop_register[2], cop_register[3], cop_register[4]); + seibu_cop_log("%06x: COPX execute table macro command %04x %04x | regs %08x %08x %08x %08x %08x\n", cpu_get_pc(machine->activecpu), data, cop_mcu_ram[offset], cop_register[0], cop_register[1], cop_register[2], cop_register[3], cop_register[4]); command = -1; /* search the uploaded 'trigger' table for a matching trigger*/ @@ -1258,7 +1258,7 @@ static WRITE16_HANDLER( generic_cop_w ) /* hmm, this would be strange the 6xx range should be video regs?? */ case (0x2fc/2): { - seibu_cop_log("%06x: COPX execute current layer clear??? %04x\n", activecpu_get_pc(), data); + seibu_cop_log("%06x: COPX execute current layer clear??? %04x\n", cpu_get_pc(machine->activecpu), data); // I think the value it writes here must match the other value for anything to happen.. maybe */ //if (data!=cop_clearfill_value[cop_clearfill_lasttrigger]) break; @@ -1370,7 +1370,7 @@ WRITE16_HANDLER( heatbrl_mcu_w ) break; } default: - seibu_cop_log("DMA CMD 0x500 with parameter = %04x PC = %08x\n",cop_mcu_ram[offset],activecpu_get_previouspc()); + seibu_cop_log("DMA CMD 0x500 with parameter = %04x PC = %08x\n",cop_mcu_ram[offset],cpu_get_previouspc(machine->activecpu)); } break; } @@ -1775,7 +1775,7 @@ WRITE16_HANDLER( sdgndmrb_mcu_w ) break; } default: - seibu_cop_log("DMA CMD 0x500 with parameter = %04x PC = %08x\n",cop_mcu_ram[offset],activecpu_get_previouspc()); + seibu_cop_log("DMA CMD 0x500 with parameter = %04x PC = %08x\n",cop_mcu_ram[offset],cpu_get_previouspc(machine->activecpu)); } break; } diff --git a/src/mame/machine/simpsons.c b/src/mame/machine/simpsons.c index 78baed85e58..a96d988e050 100644 --- a/src/mame/machine/simpsons.c +++ b/src/mame/machine/simpsons.c @@ -123,7 +123,7 @@ MACHINE_RESET( simpsons ) { UINT8 *RAM = memory_region(machine, "main"); - cpunum_set_info_fct(0, CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)simpsons_banking); + cpu_set_info_fct(machine->cpu[0], CPUINFO_PTR_KONAMI_SETLINES_CALLBACK, (genf *)simpsons_banking); paletteram = &RAM[0x88000]; simpsons_xtraram = &RAM[0x89000]; diff --git a/src/mame/machine/slapfght.c b/src/mame/machine/slapfght.c index 229a5e18187..e55b216c7c7 100644 --- a/src/mame/machine/slapfght.c +++ b/src/mame/machine/slapfght.c @@ -193,13 +193,13 @@ READ8_HANDLER( getstar_e803_r ) getstar_val = 0x76; break; default: - logerror("%04x: getstar_e803_r - cmd = %02x\n",activecpu_get_pc(),getstar_cmd); + logerror("%04x: getstar_e803_r - cmd = %02x\n",cpu_get_pc(machine->activecpu),getstar_cmd); break; } break; case GTSTARB1: /* value isn't computed by the bootleg but we want to please the "test mode" */ - if (activecpu_get_pc() == 0x6b04) return (lives_lookup_table[gs_a]); + if (cpu_get_pc(machine->activecpu) == 0x6b04) return (lives_lookup_table[gs_a]); break; case GTSTARB2: /* @@ -212,14 +212,14 @@ READ8_HANDLER( getstar_e803_r ) 0576: BE cp (hl) 0577: C2 6E 05 jp nz,$056E */ - if (activecpu_get_pc() == 0x056e) return (getstar_val); - if (activecpu_get_pc() == 0x0570) return (getstar_val+1); - if (activecpu_get_pc() == 0x0577) return ((getstar_val+0x05) ^ 0x56); + if (cpu_get_pc(machine->activecpu) == 0x056e) return (getstar_val); + if (cpu_get_pc(machine->activecpu) == 0x0570) return (getstar_val+1); + if (cpu_get_pc(machine->activecpu) == 0x0577) return ((getstar_val+0x05) ^ 0x56); /* value isn't computed by the bootleg but we want to please the "test mode" */ - if (activecpu_get_pc() == 0x6b04) return (lgsb2_lookup_table[gs_a]); + if (cpu_get_pc(machine->activecpu) == 0x6b04) return (lgsb2_lookup_table[gs_a]); break; default: - logerror("%04x: getstar_e803_r - cmd = %02x - unknown set !\n",activecpu_get_pc(),getstar_cmd); + logerror("%04x: getstar_e803_r - cmd = %02x - unknown set !\n",cpu_get_pc(machine->activecpu),getstar_cmd); break; } return getstar_val; @@ -231,183 +231,183 @@ WRITE8_HANDLER( getstar_e803_w ) { case GETSTAR: /* unknown effect - not read back */ - if (activecpu_get_pc() == 0x00bf) + if (cpu_get_pc(machine->activecpu) == 0x00bf) { getstar_cmd = 0x00; GS_RESET_REGS } /* players inputs */ - if (activecpu_get_pc() == 0x0560) + if (cpu_get_pc(machine->activecpu) == 0x0560) { getstar_cmd = 0x25; GS_RESET_REGS } - if (activecpu_get_pc() == 0x056d) + if (cpu_get_pc(machine->activecpu) == 0x056d) { getstar_cmd = 0x25; GS_SAVE_REGS } /* lose life */ - if (activecpu_get_pc() == 0x0a0a) + if (cpu_get_pc(machine->activecpu) == 0x0a0a) { getstar_cmd = 0x21; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0a17) + if (cpu_get_pc(machine->activecpu) == 0x0a17) { getstar_cmd = 0x21; GS_SAVE_REGS } /* unknown effect */ - if (activecpu_get_pc() == 0x0a51) + if (cpu_get_pc(machine->activecpu) == 0x0a51) { getstar_cmd = 0x29; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0a6e) + if (cpu_get_pc(machine->activecpu) == 0x0a6e) { getstar_cmd = 0x29; GS_SAVE_REGS } /* continue play */ - if (activecpu_get_pc() == 0x0ae3) + if (cpu_get_pc(machine->activecpu) == 0x0ae3) { getstar_cmd = 0x20; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0af0) + if (cpu_get_pc(machine->activecpu) == 0x0af0) { getstar_cmd = 0x20; GS_SAVE_REGS } /* unknown effect - not read back */ - if (activecpu_get_pc() == 0x0b62) + if (cpu_get_pc(machine->activecpu) == 0x0b62) { getstar_cmd = 0x00; /* 0x1f */ GS_RESET_REGS } /* change player (if 2 players game) */ - if (activecpu_get_pc() == 0x0bab) + if (cpu_get_pc(machine->activecpu) == 0x0bab) { getstar_cmd = 0x2a; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0bb8) + if (cpu_get_pc(machine->activecpu) == 0x0bb8) { getstar_cmd = 0x2a; GS_SAVE_REGS } /* game phase */ - if (activecpu_get_pc() == 0x0d37) + if (cpu_get_pc(machine->activecpu) == 0x0d37) { getstar_cmd = 0x24; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0d44) + if (cpu_get_pc(machine->activecpu) == 0x0d44) { getstar_cmd = 0x24; GS_SAVE_REGS } /* starting lives */ - if (activecpu_get_pc() == 0x0d79) + if (cpu_get_pc(machine->activecpu) == 0x0d79) { getstar_cmd = 0x23; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0d8a) + if (cpu_get_pc(machine->activecpu) == 0x0d8a) { getstar_cmd = 0x23; GS_SAVE_REGS } /* starting difficulty */ - if (activecpu_get_pc() == 0x0dc1) + if (cpu_get_pc(machine->activecpu) == 0x0dc1) { getstar_cmd = 0x22; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0dd0) + if (cpu_get_pc(machine->activecpu) == 0x0dd0) { getstar_cmd = 0x22; GS_SAVE_REGS } /* starting lives (again) */ - if (activecpu_get_pc() == 0x1011) + if (cpu_get_pc(machine->activecpu) == 0x1011) { getstar_cmd = 0x23; GS_RESET_REGS } - if (activecpu_get_pc() == 0x101e) + if (cpu_get_pc(machine->activecpu) == 0x101e) { getstar_cmd = 0x23; GS_SAVE_REGS } /* hardware test */ - if (activecpu_get_pc() == 0x107a) + if (cpu_get_pc(machine->activecpu) == 0x107a) { getstar_cmd = 0x73; GS_RESET_REGS } /* game phase (again) */ - if (activecpu_get_pc() == 0x10c6) + if (cpu_get_pc(machine->activecpu) == 0x10c6) { getstar_cmd = 0x24; GS_RESET_REGS } - if (activecpu_get_pc() == 0x10d3) + if (cpu_get_pc(machine->activecpu) == 0x10d3) { getstar_cmd = 0x24; GS_SAVE_REGS } /* background */ - if (activecpu_get_pc() == 0x1910) + if (cpu_get_pc(machine->activecpu) == 0x1910) { getstar_cmd = 0x26; GS_RESET_REGS } - if (activecpu_get_pc() == 0x191d) + if (cpu_get_pc(machine->activecpu) == 0x191d) { getstar_cmd = 0x26; GS_SAVE_REGS } /* foreground */ - if (activecpu_get_pc() == 0x19d5) + if (cpu_get_pc(machine->activecpu) == 0x19d5) { getstar_cmd = 0x37; GS_RESET_REGS } - if (activecpu_get_pc() == 0x19e4) + if (cpu_get_pc(machine->activecpu) == 0x19e4) { getstar_cmd = 0x37; GS_SAVE_REGS } - if (activecpu_get_pc() == 0x19f1) + if (cpu_get_pc(machine->activecpu) == 0x19f1) { getstar_cmd = 0x37; /* do NOT update the registers because there are 2 writes before 2 reads ! */ } /* laser position */ - if (activecpu_get_pc() == 0x26af) + if (cpu_get_pc(machine->activecpu) == 0x26af) { getstar_cmd = 0x38; GS_RESET_REGS } - if (activecpu_get_pc() == 0x26be) + if (cpu_get_pc(machine->activecpu) == 0x26be) { getstar_cmd = 0x38; GS_SAVE_REGS } - if (activecpu_get_pc() == 0x26cb) + if (cpu_get_pc(machine->activecpu) == 0x26cb) { getstar_cmd = 0x38; /* do NOT update the registers because there are 2 writes before 2 reads ! */ } /* starting lives (for "test mode") */ - if (activecpu_get_pc() == 0x6a27) + if (cpu_get_pc(machine->activecpu) == 0x6a27) { getstar_cmd = 0x23; GS_RESET_REGS } - if (activecpu_get_pc() == 0x6a38) + if (cpu_get_pc(machine->activecpu) == 0x6a38) { getstar_cmd = 0x23; GS_SAVE_REGS @@ -415,183 +415,183 @@ WRITE8_HANDLER( getstar_e803_w ) break; case GETSTARJ: /* unknown effect - not read back */ - if (activecpu_get_pc() == 0x00bf) + if (cpu_get_pc(machine->activecpu) == 0x00bf) { getstar_cmd = 0x00; GS_RESET_REGS } /* players inputs */ - if (activecpu_get_pc() == 0x0560) + if (cpu_get_pc(machine->activecpu) == 0x0560) { getstar_cmd = 0x25; GS_RESET_REGS } - if (activecpu_get_pc() == 0x056d) + if (cpu_get_pc(machine->activecpu) == 0x056d) { getstar_cmd = 0x25; GS_SAVE_REGS } /* lose life */ - if (activecpu_get_pc() == 0x0ad5) + if (cpu_get_pc(machine->activecpu) == 0x0ad5) { getstar_cmd = 0x21; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0ae2) + if (cpu_get_pc(machine->activecpu) == 0x0ae2) { getstar_cmd = 0x21; GS_SAVE_REGS } /* unknown effect */ - if (activecpu_get_pc() == 0x0b1c) + if (cpu_get_pc(machine->activecpu) == 0x0b1c) { getstar_cmd = 0x29; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0b29) + if (cpu_get_pc(machine->activecpu) == 0x0b29) { getstar_cmd = 0x29; GS_SAVE_REGS } /* continue play */ - if (activecpu_get_pc() == 0x0bae) + if (cpu_get_pc(machine->activecpu) == 0x0bae) { getstar_cmd = 0x20; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0bbb) + if (cpu_get_pc(machine->activecpu) == 0x0bbb) { getstar_cmd = 0x20; GS_SAVE_REGS } /* unknown effect - not read back */ - if (activecpu_get_pc() == 0x0c2d) + if (cpu_get_pc(machine->activecpu) == 0x0c2d) { getstar_cmd = 0x00; /* 0x1f */ GS_RESET_REGS } /* change player (if 2 players game) */ - if (activecpu_get_pc() == 0x0c76) + if (cpu_get_pc(machine->activecpu) == 0x0c76) { getstar_cmd = 0x2a; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0c83) + if (cpu_get_pc(machine->activecpu) == 0x0c83) { getstar_cmd = 0x2a; GS_SAVE_REGS } /* game phase */ - if (activecpu_get_pc() == 0x0e02) + if (cpu_get_pc(machine->activecpu) == 0x0e02) { getstar_cmd = 0x24; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0e0f) + if (cpu_get_pc(machine->activecpu) == 0x0e0f) { getstar_cmd = 0x24; GS_SAVE_REGS } /* starting lives */ - if (activecpu_get_pc() == 0x0e44) + if (cpu_get_pc(machine->activecpu) == 0x0e44) { getstar_cmd = 0x23; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0e55) + if (cpu_get_pc(machine->activecpu) == 0x0e55) { getstar_cmd = 0x23; GS_SAVE_REGS } /* starting difficulty */ - if (activecpu_get_pc() == 0x0e8c) + if (cpu_get_pc(machine->activecpu) == 0x0e8c) { getstar_cmd = 0x22; GS_RESET_REGS } - if (activecpu_get_pc() == 0x0e9b) + if (cpu_get_pc(machine->activecpu) == 0x0e9b) { getstar_cmd = 0x22; GS_SAVE_REGS } /* starting lives (again) */ - if (activecpu_get_pc() == 0x10d6) + if (cpu_get_pc(machine->activecpu) == 0x10d6) { getstar_cmd = 0x23; GS_RESET_REGS } - if (activecpu_get_pc() == 0x10e3) + if (cpu_get_pc(machine->activecpu) == 0x10e3) { getstar_cmd = 0x23; GS_SAVE_REGS } /* hardware test */ - if (activecpu_get_pc() == 0x113f) + if (cpu_get_pc(machine->activecpu) == 0x113f) { getstar_cmd = 0x73; GS_RESET_REGS } /* game phase (again) */ - if (activecpu_get_pc() == 0x118b) + if (cpu_get_pc(machine->activecpu) == 0x118b) { getstar_cmd = 0x24; GS_RESET_REGS } - if (activecpu_get_pc() == 0x1198) + if (cpu_get_pc(machine->activecpu) == 0x1198) { getstar_cmd = 0x24; GS_SAVE_REGS } /* background */ - if (activecpu_get_pc() == 0x19f8) + if (cpu_get_pc(machine->activecpu) == 0x19f8) { getstar_cmd = 0x26; GS_RESET_REGS } - if (activecpu_get_pc() == 0x1a05) + if (cpu_get_pc(machine->activecpu) == 0x1a05) { getstar_cmd = 0x26; GS_SAVE_REGS } /* foreground */ - if (activecpu_get_pc() == 0x1abd) + if (cpu_get_pc(machine->activecpu) == 0x1abd) { getstar_cmd = 0x37; GS_RESET_REGS } - if (activecpu_get_pc() == 0x1acc) + if (cpu_get_pc(machine->activecpu) == 0x1acc) { getstar_cmd = 0x37; GS_SAVE_REGS } - if (activecpu_get_pc() == 0x1ad9) + if (cpu_get_pc(machine->activecpu) == 0x1ad9) { getstar_cmd = 0x37; /* do NOT update the registers because there are 2 writes before 2 reads ! */ } /* laser position */ - if (activecpu_get_pc() == 0x2792) + if (cpu_get_pc(machine->activecpu) == 0x2792) { getstar_cmd = 0x38; GS_RESET_REGS } - if (activecpu_get_pc() == 0x27a1) + if (cpu_get_pc(machine->activecpu) == 0x27a1) { getstar_cmd = 0x38; GS_SAVE_REGS } - if (activecpu_get_pc() == 0x27ae) + if (cpu_get_pc(machine->activecpu) == 0x27ae) { getstar_cmd = 0x38; /* do NOT update the registers because there are 2 writes before 2 reads ! */ } /* starting lives (for "test mode") */ - if (activecpu_get_pc() == 0x6ae2) + if (cpu_get_pc(machine->activecpu) == 0x6ae2) { getstar_cmd = 0x23; GS_RESET_REGS } - if (activecpu_get_pc() == 0x6af3) + if (cpu_get_pc(machine->activecpu) == 0x6af3) { getstar_cmd = 0x23; GS_SAVE_REGS @@ -623,12 +623,12 @@ WRITE8_HANDLER( getstar_e803_w ) 6B01: 3A 03 E8 ld a,($E803) We save the regs though to hack it in 'getstar_e803_r' read handler. */ - if (activecpu_get_pc() == 0x6ae2) + if (cpu_get_pc(machine->activecpu) == 0x6ae2) { getstar_cmd = 0x00; GS_RESET_REGS } - if (activecpu_get_pc() == 0x6af3) + if (cpu_get_pc(machine->activecpu) == 0x6af3) { getstar_cmd = 0x00; GS_SAVE_REGS @@ -662,19 +662,19 @@ WRITE8_HANDLER( getstar_e803_w ) 6B01: 3A 03 E8 ld a,($E803) We save the regs though to hack it in 'getstar_e803_r' read handler. */ - if (activecpu_get_pc() == 0x6ae2) + if (cpu_get_pc(machine->activecpu) == 0x6ae2) { getstar_cmd = 0x00; GS_RESET_REGS } - if (activecpu_get_pc() == 0x6af3) + if (cpu_get_pc(machine->activecpu) == 0x6af3) { getstar_cmd = 0x00; GS_SAVE_REGS } break; default: - logerror("%04x: getstar_e803_w - data = %02x - unknown set !\n",activecpu_get_pc(),data); + logerror("%04x: getstar_e803_w - data = %02x - unknown set !\n",cpu_get_pc(machine->activecpu),data); break; } } @@ -683,7 +683,7 @@ WRITE8_HANDLER( getstar_e803_w ) WRITE8_HANDLER( getstar_sh_intenable_w ) { getstar_sh_intenabled = 1; - logerror("cpu #1 PC=%d: %d written to a0e0\n",activecpu_get_pc(),data); + logerror("cpu #1 PC=%d: %d written to a0e0\n",cpu_get_pc(machine->activecpu),data); } @@ -807,7 +807,7 @@ READ8_HANDLER( tigerhb_e803_r ) tigerhb_val = 0x83; break; default: - logerror("%04x: tigerhb_e803_r - cmd = %02x\n",activecpu_get_pc(),getstar_cmd); + logerror("%04x: tigerhb_e803_r - cmd = %02x\n",cpu_get_pc(machine->activecpu),getstar_cmd); break; } return tigerhb_val; @@ -822,7 +822,7 @@ WRITE8_HANDLER( tigerhb_e803_w ) tigerhb_cmd = 0x73; break; default: - logerror("%04x: tigerhb_e803_w - data = %02x\n",activecpu_get_pc(),data); + logerror("%04x: tigerhb_e803_w - data = %02x\n",cpu_get_pc(machine->activecpu),data); tigerhb_cmd = 0x00; break; } diff --git a/src/mame/machine/slapstic.c b/src/mame/machine/slapstic.c index 1a3108e8c7e..de89f5a6fe8 100644 --- a/src/mame/machine/slapstic.c +++ b/src/mame/machine/slapstic.c @@ -794,7 +794,7 @@ static UINT8 bit_xor; static struct slapstic_data slapstic; -static void slapstic_log(offs_t offset); +static void slapstic_log(running_machine *machine, offs_t offset); static FILE *slapsticlog; @@ -862,7 +862,7 @@ int slapstic_bank(void) * *************************************/ -static int alt2_kludge(offs_t offset) +static int alt2_kludge(running_machine *machine, offs_t offset) { /* Of the 3 alternate addresses, only the middle one needs to actually hit in the slapstic region; the first and third ones can be anywhere in the @@ -874,15 +874,15 @@ static int alt2_kludge(offs_t offset) if (access_68k) { /* first verify that the prefetched PC matches the first alternate */ - if (MATCHES_MASK_VALUE(activecpu_get_pc() >> 1, slapstic.alt1)) + if (MATCHES_MASK_VALUE(cpu_get_pc(machine->activecpu) >> 1, slapstic.alt1)) { /* now look for a move.w (An),(An) or cmpm.w (An)+,(An)+ */ - UINT16 opcode = cpu_readop16(activecpu_get_previouspc() & 0xffffff); + UINT16 opcode = cpu_readop16(cpu_get_previouspc(machine->activecpu) & 0xffffff); if ((opcode & 0xf1f8) == 0x3090 || (opcode & 0xf1f8) == 0xb148) { /* fetch the value of the register for the second operand, and see */ /* if it matches the third alternate */ - UINT32 regval = activecpu_get_reg(M68K_A0 + ((opcode >> 9) & 7)) >> 1; + UINT32 regval = cpu_get_reg(machine->activecpu, M68K_A0 + ((opcode >> 9) & 7)) >> 1; if (MATCHES_MASK_VALUE(regval, slapstic.alt3)) { alt_bank = (regval >> slapstic.altshift) & 3; @@ -909,7 +909,7 @@ static int alt2_kludge(offs_t offset) * *************************************/ -int slapstic_tweak(offs_t offset) +int slapstic_tweak(running_machine *machine, offs_t offset) { /* reset is universal */ if (offset == 0x0000) @@ -951,7 +951,7 @@ int slapstic_tweak(offs_t offset) /* the first one was missed (since it's usually an opcode fetch) */ else if (MATCHES_MASK_VALUE(offset, slapstic.alt2)) { - state = alt2_kludge(offset); + state = alt2_kludge(machine, offset); } /* check for standard bankswitches */ @@ -1119,7 +1119,7 @@ int slapstic_tweak(offs_t offset) /* log this access */ if (LOG_SLAPSTIC) - slapstic_log(offset); + slapstic_log(machine, offset); /* return the active bank */ return current_bank; @@ -1133,7 +1133,7 @@ int slapstic_tweak(offs_t offset) * *************************************/ -static void slapstic_log(offs_t offset) +static void slapstic_log(running_machine *machine, offs_t offset) { static attotime last_time; @@ -1147,7 +1147,7 @@ static void slapstic_log(offs_t offset) fprintf(slapsticlog, "------------------------------------\n"); last_time = time; - fprintf(slapsticlog, "%06X: %04X B=%d ", activecpu_get_previouspc(), offset, current_bank); + fprintf(slapsticlog, "%06X: %04X B=%d ", cpu_get_previouspc(machine->activecpu), offset, current_bank); switch (state) { case DISABLED: diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c index 6049c086aae..d970de97054 100644 --- a/src/mame/machine/slikshot.c +++ b/src/mame/machine/slikshot.c @@ -506,7 +506,7 @@ static TIMER_CALLBACK( delayed_z80_control_w ) /* this is a big kludge: only allow a reset if the Z80 is stopped */ /* at its endpoint; otherwise, we never get a result from the Z80 */ - if ((data & 0x10) || cpunum_get_reg(2, Z80_PC) == 0x13a) + if ((data & 0x10) || cpu_get_reg(machine->cpu[2], Z80_PC) == 0x13a) { cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c index e015fe952fa..c7ec594c6b1 100644 --- a/src/mame/machine/snes.c +++ b/src/mame/machine/snes.c @@ -107,7 +107,7 @@ static TIMER_CALLBACK( snes_hirq_tick_callback ) static TIMER_CALLBACK( snes_scanline_tick ) { // make sure we're in the 65816's context since we're messing with the OAM and stuff - cpuintrf_push_context(0); + cpu_push_context(machine->cpu[0]); /* Increase current line - we want to latch on this line during it, not after it */ snes_ppu.beam.current_vert = video_screen_get_vpos(machine->primary_screen); @@ -232,7 +232,7 @@ static TIMER_CALLBACK( snes_scanline_tick ) cpunum_set_input_line(machine, 0, G65816_LINE_NMI, CLEAR_LINE ); } - cpuintrf_pop_context(); + cpu_pop_context(); timer_adjust_oneshot(snes_scanline_timer, attotime_never, 0); timer_adjust_oneshot(snes_hblank_timer, video_screen_get_time_until_pos(machine->primary_screen, snes_ppu.beam.current_vert, hblank_offset*snes_htmult), 0); @@ -249,7 +249,7 @@ static TIMER_CALLBACK( snes_hblank_tick ) timer_adjust_oneshot(snes_hblank_timer, attotime_never, 0); // we must guarantee the 65816's context for HDMA to work - cpuintrf_push_context(0); + cpu_push_context(machine->cpu[0]); /* draw a scanline */ if (snes_ppu.beam.current_vert <= snes_ppu.beam.last_visible_line) @@ -264,7 +264,7 @@ static TIMER_CALLBACK( snes_hblank_tick ) } } - cpuintrf_pop_context(); + cpu_pop_context(); // signal hblank snes_ram[HVBJOY] |= 0x40; @@ -571,7 +571,7 @@ READ8_HANDLER( snes_r_io ) // case 0x420c: //PC: 9c7d - 8fab //only nss_ssoc default: - mame_printf_debug("snes_r: offset = %x pc = %x\n",offset,activecpu_get_pc()); + mame_printf_debug("snes_r: offset = %x pc = %x\n",offset,cpu_get_pc(machine->activecpu)); #endif /* MESS */ } @@ -1542,12 +1542,12 @@ static void snes_init_ram(running_machine *machine) /* Init work RAM - 0x55 isn't exactly right but it's close */ /* make sure it happens to the 65816 (CPU 0) */ - cpuintrf_push_context(0); + cpu_push_context(machine->cpu[0]); for (i = 0; i < (128*1024); i++) { program_write_byte(0x7e0000 + i, 0x55); } - cpuintrf_pop_context(); + cpu_pop_context(); /* Inititialize registers/variables */ snes_ppu.update_windows = 1; diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c index 49471626fc3..9f8674fc131 100644 --- a/src/mame/machine/stvcd.c +++ b/src/mame/machine/stvcd.c @@ -380,7 +380,7 @@ static UINT16 cd_readWord(UINT32 addr) hirqreg = rv; -// CDROM_LOG(("RW HIRQ: %04x (PC=%x)\n", rv, activecpu_get_pc())) +// CDROM_LOG(("RW HIRQ: %04x (PC=%x)\n", rv, cpu_get_pc(machine->activecpu))) return rv; break; @@ -453,7 +453,7 @@ static UINT16 cd_readWord(UINT32 addr) break; default: - CDROM_LOG(("CD: RW %08x (PC=%x)\n", addr, activecpu_get_pc())) + CDROM_LOG(("CD: RW %08x (PC=%x)\n", addr, cpu_get_pc(machine->activecpu))) return 0xffff; break; } @@ -529,7 +529,7 @@ static UINT32 cd_readLong(UINT32 addr) break; default: - CDROM_LOG(("CD: RL %08x (PC=%x)\n", addr, activecpu_get_pc())) + CDROM_LOG(("CD: RL %08x (PC=%x)\n", addr, cpu_get_pc(machine->activecpu))) return 0xffff; break; } @@ -543,7 +543,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) { case 0x0008: case 0x000a: -// CDROM_LOG(("WW HIRQ: %04x & %04x => %04x (PC %x)\n", hirqreg, data, hirqreg & data, activecpu_get_pc())) +// CDROM_LOG(("WW HIRQ: %04x & %04x => %04x (PC %x)\n", hirqreg, data, hirqreg & data, cpu_get_pc(machine->activecpu))) hirqreg &= data; return; case 0x000c: @@ -586,7 +586,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) switch (cr1 & 0xff00) { case 0x0000: - CDROM_LOG(("CD: Get Status (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get Status (PC=%x)\n", cpu_get_pc(machine->activecpu))) // values taken from a US saturn with a disc in and the lid closed hirqreg |= CMOK; @@ -598,7 +598,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x0100: - CDROM_LOG(("CD: Get Hardware Info (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get Hardware Info (PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= CMOK; cr1 = cd_stat; cr2 = 0x0201; @@ -607,7 +607,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x200: // Get TOC - CDROM_LOG(("CD: Get TOC (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get TOC (PC=%x)\n", cpu_get_pc(machine->activecpu))) cd_readTOC(); cd_stat = CD_STAT_TRANS|CD_STAT_PAUSE; cr2 = 102*2; // TOC length in words (102 entries @ 2 words/4bytes each) @@ -621,7 +621,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) // bios is interested in returns in cr3 and cr4 // cr3 should be data track # // cr4 must be > 1 and < 100 or bios gets angry. - CDROM_LOG(("CD: Get Session Info (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get Session Info (PC=%x)\n", cpu_get_pc(machine->activecpu))) cd_readTOC(); switch (cr1 & 0xff) { @@ -652,7 +652,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) // CR1 & 4 = don't confirm mode 2 subheader // CR1 & 8 = retry reading mode 2 sectors // CR1 & 10 = force single-speed - CDROM_LOG(("CD: Initialize CD system (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Initialize CD system (PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|DRDY|ESEL); cd_stat = CD_STAT_PAUSE; cd_curfad = 150; @@ -666,7 +666,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) case 0x0600: // end data transfer // returns # of bytes transfered (24 bits) in // low byte of cr1 (MSB) and cr2 (middle byte, LSB) - CDROM_LOG(("CD: End data transfer (PC=%x) (%d bytes xfer'd)\n", activecpu_get_pc(), xferdnum)) + CDROM_LOG(("CD: End data transfer (PC=%x) (%d bytes xfer'd)\n", cpu_get_pc(machine->activecpu), xferdnum)) // clear the "transfer" flag cd_stat &= ~CD_STAT_TRANS; @@ -743,7 +743,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x1000: // Play Disk. FAD is in lowest 7 bits of cr1 and all of cr2. - CDROM_LOG(("CD: Play Disk (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Play Disk (PC=%x)\n", cpu_get_pc(machine->activecpu))) cd_stat = CD_STAT_PLAY; //|0x80; // set "cd-rom" bit? cd_curfad = ((cr1&0xff)<<16) | cr2; fadstoplay = ((cr3&0xff)<<16) | cr4; @@ -781,7 +781,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x1100: // disk seek - CDROM_LOG(("CD: Disk seek (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Disk seek (PC=%x)\n", cpu_get_pc(machine->activecpu))) if (cr1 & 0x80) { temp = (cr1&0x7f)<<16; // get FAD to seek to @@ -827,7 +827,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) // get operation parm = cr3>>8; - CDROM_LOG(("CD: Set CD Device Connection (PC=%x) filter # %x\n", activecpu_get_pc(), parm)) + CDROM_LOG(("CD: Set CD Device Connection (PC=%x) filter # %x\n", cpu_get_pc(machine->activecpu), parm)) cddevicenum = parm; @@ -853,7 +853,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) { UINT8 fnum = (cr3>>8)&0xff; - CDROM_LOG(("CD: Set Filter Range (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Set Filter Range (PC=%x)\n", cpu_get_pc(machine->activecpu))) filters[fnum].fad = ((cr1 & 0xff)<<16) | cr2; filters[fnum].range = ((cr3 & 0xff)<<16) | cr4; @@ -869,7 +869,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) { UINT8 fnum = (cr3>>8)&0xff; - CDROM_LOG(("CD: Set Filter Subheader conditions (PC=%x) %x => chan %x masks %x fid %x vals %x\n", activecpu_get_pc(), fnum, cr1&0xff, cr2, cr3&0xff, cr4)) + CDROM_LOG(("CD: Set Filter Subheader conditions (PC=%x) %x => chan %x masks %x fid %x vals %x\n", cpu_get_pc(machine->activecpu), fnum, cr1&0xff, cr2, cr3&0xff, cr4)) filters[fnum].chan = cr1 & 0xff; filters[fnum].smmask = (cr2>>8)&0xff; @@ -900,7 +900,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) filters[fnum].mode = mode; } - CDROM_LOG(("CD: Set Filter Mode (PC=%x) filt %x mode %x\n", activecpu_get_pc(), fnum, mode)) + CDROM_LOG(("CD: Set Filter Mode (PC=%x) filt %x mode %x\n", cpu_get_pc(machine->activecpu), fnum, mode)) hirqreg |= (CMOK|ESEL|DRDY); cr2 = 0x4101; // ctrl/adr in hi byte, track # in low byte cr3 = 0x0100|((cd_curfad>>16)&0xff); @@ -912,7 +912,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) { UINT8 fnum = (cr3>>8)&0xff; - CDROM_LOG(("CD: Set Filter Connection (PC=%x) %x => mode %x parm %04x\n", activecpu_get_pc(), fnum, cr1 & 0xf, cr2)) + CDROM_LOG(("CD: Set Filter Connection (PC=%x) %x => mode %x parm %04x\n", cpu_get_pc(machine->activecpu), fnum, cr1 & 0xf, cr2)) // set true condition? if (cr1 & 1) @@ -932,7 +932,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x4800: // Reset Selector - CDROM_LOG(("CD: Reset Selector (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Reset Selector (PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|ESEL|DRDY); cr2 = 0x4101; // ctrl/adr in hi byte, track # in low byte cr3 = 0x0100|((cd_curfad>>16)&0xff); @@ -946,7 +946,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) cr3 = 0x1800; cr4 = 200; - CDROM_LOG(("CD: Get Buffer Size = %d (PC=%x)\n", cr2, activecpu_get_pc())) + CDROM_LOG(("CD: Get Buffer Size = %d (PC=%x)\n", cr2, cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|ESEL|DRDY); // DRDY is probably wrong break; @@ -964,7 +964,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) cr4 = partitions[bufnum].numblks; } - CDROM_LOG(("CD: Get Sector Number (PC=%x) (bufno %d) = %d blocks\n", activecpu_get_pc(), bufnum, cr4)) + CDROM_LOG(("CD: Get Sector Number (PC=%x) (bufno %d) = %d blocks\n", cpu_get_pc(machine->activecpu), bufnum, cr4)) cr2 = 0; cr3 = 0; @@ -978,7 +978,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) UINT32 sectoffs = cr2; UINT32 numsect = cr4; - CDROM_LOG(("CD: Calculate actual size: buf %x offs %x numsect %x (PC=%x)\n", bufnum, sectoffs, numsect, activecpu_get_pc())) + CDROM_LOG(("CD: Calculate actual size: buf %x offs %x numsect %x (PC=%x)\n", bufnum, sectoffs, numsect, cpu_get_pc(machine->activecpu))) calcsize = 0; if (partitions[bufnum].size != -1) @@ -1003,7 +1003,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x5300: // get actual block size - CDROM_LOG(("CD: Get actual block size (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get actual block size (PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|ESEL); cr1 = cd_stat | ((calcsize>>16)&0xff); cr2 = (calcsize & 0xffff); @@ -1012,7 +1012,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x6000: // set sector length - CDROM_LOG(("CD: Set sector length (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Set sector length (PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|ESEL|EFLS|SCDQ|DRDY); switch (cr1 & 0xff) @@ -1054,7 +1054,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) UINT32 sectofs = cr2; UINT32 bufnum = cr3>>8; - CDROM_LOG(("CD: Get sector data (PC=%x) (SN %d SO %d BN %d)\n", activecpu_get_pc(), sectnum, sectofs, bufnum)) + CDROM_LOG(("CD: Get sector data (PC=%x) (SN %d SO %d BN %d)\n", cpu_get_pc(machine->activecpu), sectnum, sectofs, bufnum)) if (bufnum >= MAX_FILTERS) { @@ -1094,7 +1094,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) UINT32 bufnum = cr3>>8; INT32 i; - CDROM_LOG(("CD: Delete sector data (PC=%x) (SN %d SO %d BN %d)\n", activecpu_get_pc(), sectnum, sectofs, bufnum)) + CDROM_LOG(("CD: Delete sector data (PC=%x) (SN %d SO %d BN %d)\n", cpu_get_pc(machine->activecpu), sectnum, sectofs, bufnum)) if (bufnum >= MAX_FILTERS) { @@ -1137,7 +1137,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) UINT32 sectofs = cr2; UINT32 bufnum = cr3>>8; - CDROM_LOG(("CD: Get and delete sector data (PC=%x) (SN %d SO %d BN %d)\n", activecpu_get_pc(), sectnum, sectofs, bufnum)) + CDROM_LOG(("CD: Get and delete sector data (PC=%x) (SN %d SO %d BN %d)\n", cpu_get_pc(machine->activecpu), sectnum, sectofs, bufnum)) if (bufnum >= MAX_FILTERS) { @@ -1171,12 +1171,12 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x6700: // get copy error - CDROM_LOG(("CD: Get copy error (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get copy error (PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|ESEL|EFLS|SCDQ|DRDY); break; case 0x7000: // change directory - CDROM_LOG(("CD: Change Directory (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Change Directory (PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|EFLS); temp = (cr3&0xff)<<16; @@ -1185,7 +1185,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x7100: // Read directory entry - CDROM_LOG(("CD: Read Directory Entry (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Read Directory Entry (PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|DRDY); temp = (cr3&0xff)<<16; @@ -1196,7 +1196,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x7200: // Get file system scope - CDROM_LOG(("CD: Get file system scope(PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get file system scope(PC=%x)\n", cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK|DRDY); cr2 = numfiles; // # of files in directory cr3 = 0x0100; // report directory held @@ -1204,7 +1204,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x7300: // Get File Info - CDROM_LOG(("CD: Get File Info (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get File Info (PC=%x)\n", cpu_get_pc(machine->activecpu))) cd_stat |= CD_STAT_TRANS; cd_stat &= 0xff00; // clear top byte of return value hirqreg |= (CMOK|DRDY); @@ -1258,7 +1258,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x7400: // Read File - CDROM_LOG(("CD: Read File (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Read File (PC=%x)\n", cpu_get_pc(machine->activecpu))) temp = (cr3&0xff)<<16; temp |= cr4; @@ -1289,14 +1289,14 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0x7500: - CDROM_LOG(("CD: Abort File (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Abort File (PC=%x)\n", cpu_get_pc(machine->activecpu))) // bios expects "2bc" mask to work against this hirqreg |= (CMOK|EFLS|EHST|ESEL|DCHG|PEND|BFUL|CSCT|DRDY); cd_stat = CD_STAT_PERI|CD_STAT_PAUSE; // force to pause break; case 0xe000: // appears to be copy protection check. needs only to return OK. - CDROM_LOG(("CD: Verify copy protection (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Verify copy protection (PC=%x)\n", cpu_get_pc(machine->activecpu))) cd_stat = CD_STAT_PAUSE; cr1 = cd_stat; // necessary to pass cr2 = 0x4; @@ -1306,7 +1306,7 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; case 0xe100: // get disc region - CDROM_LOG(("CD: Get disc region (PC=%x)\n", activecpu_get_pc())) + CDROM_LOG(("CD: Get disc region (PC=%x)\n", cpu_get_pc(machine->activecpu))) cd_stat = CD_STAT_PAUSE; cr1 = cd_stat; // necessary to pass cr2 = 0x4; // (must return this value to pass bios checks) @@ -1314,14 +1314,14 @@ static void cd_writeWord(UINT32 addr, UINT16 data) break; default: - CDROM_LOG(("CD: Unknown command %04x (PC=%x)\n", cr1, activecpu_get_pc())) + CDROM_LOG(("CD: Unknown command %04x (PC=%x)\n", cr1, cpu_get_pc(machine->activecpu))) hirqreg |= (CMOK); break; } // CDROM_LOG(("ret: %04x %04x %04x %04x %04x\n", hirqreg, cr1, cr2, cr3, cr4)) break; default: - CDROM_LOG(("CD: WW %08x %04x (PC=%x)\n", addr, data, activecpu_get_pc())) + CDROM_LOG(("CD: WW %08x %04x (PC=%x)\n", addr, data, cpu_get_pc(machine->activecpu))) break; } } diff --git a/src/mame/machine/stvprot.c b/src/mame/machine/stvprot.c index d9d78732b5f..a0c2e3b3655 100644 --- a/src/mame/machine/stvprot.c +++ b/src/mame/machine/stvprot.c @@ -145,9 +145,9 @@ static READ32_HANDLER( a_bus_ctrl_r ) { if(offset == 3) { - logerror("A-Bus control protection read at %06x with data = %08x\n",activecpu_get_pc(),a_bus[3]); + logerror("A-Bus control protection read at %06x with data = %08x\n",cpu_get_pc(machine->activecpu),a_bus[3]); #ifdef MAME_DEBUG - popmessage("Prot read at %06x with data = %08x",activecpu_get_pc(),a_bus[3]); + popmessage("Prot read at %06x with data = %08x",cpu_get_pc(machine->activecpu),a_bus[3]); #endif switch(a_bus[3]) { @@ -272,7 +272,7 @@ static READ32_HANDLER( a_bus_ctrl_r ) static WRITE32_HANDLER ( a_bus_ctrl_w ) { COMBINE_DATA(&a_bus[offset]); - logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",activecpu_get_pc(),offset,data); + logerror("A-Bus control protection write at %06x: [%02x] <- %08x\n",cpu_get_pc(machine->activecpu),offset,data); if(offset == 3) { //printf("MAIN : %08x DATA : %08x\n",a_bus[3],a_bus[2]); @@ -391,7 +391,7 @@ static READ32_HANDLER( decathlt_prot_r ) } else { - mame_printf_info("%06x Decathlete prot R offset %04x mask %08x regs %08x, %08x, %08x, %08x\n",activecpu_get_pc(), offset, mem_mask, decathlt_protregs[0], decathlt_protregs[1], decathlt_protregs[2], decathlt_protregs[3]); + mame_printf_info("%06x Decathlete prot R offset %04x mask %08x regs %08x, %08x, %08x, %08x\n",cpu_get_pc(machine->activecpu), offset, mem_mask, decathlt_protregs[0], decathlt_protregs[1], decathlt_protregs[2], decathlt_protregs[3]); } return decathlt_protregs[offset]; @@ -408,7 +408,7 @@ static WRITE32_HANDLER( decathlt_prot_w ) if (decathlt_part==0) mame_printf_info("last count was %06x\n",decathlt_lastcount); decathlt_lastcount = 0; - mame_printf_info("%06x Decathlete prot W offset %04x data %08x, regs %08x, %08x, %08x, %08x\n",activecpu_get_pc(), offset, data, decathlt_protregs[0], decathlt_protregs[1], decathlt_protregs[2], decathlt_protregs[3]); + mame_printf_info("%06x Decathlete prot W offset %04x data %08x, regs %08x, %08x, %08x, %08x\n",cpu_get_pc(machine->activecpu), offset, data, decathlt_protregs[0], decathlt_protregs[1], decathlt_protregs[2], decathlt_protregs[3]); } if (offset==1) // uploads 2 tables... diff --git a/src/mame/machine/tait8741.c b/src/mame/machine/tait8741.c index 5189c159cd9..ea620051dfe 100644 --- a/src/mame/machine/tait8741.c +++ b/src/mame/machine/tait8741.c @@ -275,7 +275,7 @@ static int I8741_status_r(running_machine *machine, int num) { I8741 *st = &taito8741[num]; taito8741_update(machine, num); - LOG(("8741-%d ST Read %02x PC=%04x\n",num,st->status,activecpu_get_pc())); + LOG(("8741-%d ST Read %02x PC=%04x\n",num,st->status,cpu_get_pc(machine->activecpu))); return st->status; } @@ -285,7 +285,7 @@ static int I8741_data_r(running_machine *machine, int num) I8741 *st = &taito8741[num]; int ret = st->toData; st->status &= 0xfe; - LOG(("8741-%d DATA Read %02x PC=%04x\n",num,ret,activecpu_get_pc())); + LOG(("8741-%d DATA Read %02x PC=%04x\n",num,ret,cpu_get_pc(machine->activecpu))); /* update chip */ taito8741_update(machine, num); @@ -303,7 +303,7 @@ static int I8741_data_r(running_machine *machine, int num) static void I8741_data_w(running_machine *machine, int num, int data) { I8741 *st = &taito8741[num]; - LOG(("8741-%d DATA Write %02x PC=%04x\n",num,data,activecpu_get_pc())); + LOG(("8741-%d DATA Write %02x PC=%04x\n",num,data,cpu_get_pc(machine->activecpu))); st->fromData = data; st->status |= 0x02; /* update chip */ @@ -314,7 +314,7 @@ static void I8741_data_w(running_machine *machine, int num, int data) static void I8741_command_w(running_machine *machine, int num, int data) { I8741 *st = &taito8741[num]; - LOG(("8741-%d CMD Write %02x PC=%04x\n",num,data,activecpu_get_pc())); + LOG(("8741-%d CMD Write %02x PC=%04x\n",num,data,cpu_get_pc(machine->activecpu))); st->fromCmd = data; st->status |= 0x04; /* update chip */ @@ -447,7 +447,7 @@ static void josvolly_8741_w(running_machine *machine,int num,int offset,int data if(offset==1) { - LOG(("PC=%04X 8741[%d] CW %02X\n",activecpu_get_pc(),num,data)); + LOG(("PC=%04X 8741[%d] CW %02X\n",cpu_get_pc(machine->activecpu),num,data)); /* read pointer */ mcu->cmd = data; @@ -485,7 +485,7 @@ static void josvolly_8741_w(running_machine *machine,int num,int offset,int data else { /* data */ - LOG(("PC=%04X 8741[%d] DW %02X\n",activecpu_get_pc(),num,data)); + LOG(("PC=%04X 8741[%d] DW %02X\n",cpu_get_pc(machine->activecpu),num,data)); mcu->txd = data^0x40; /* parity reverce ? */ mcu->sts |= 0x02; /* TXD busy */ @@ -514,14 +514,14 @@ static INT8 josvolly_8741_r(running_machine *machine,int num,int offset) if(mcu->rst) mcu->rxd = (mcu->initReadPort)(machine,0); /* port in */ ret = mcu->sts; - LOG(("PC=%04X 8741[%d] SR %02X\n",activecpu_get_pc(),num,ret)); + LOG(("PC=%04X 8741[%d] SR %02X\n",cpu_get_pc(machine->activecpu),num,ret)); } else { /* clear status port */ mcu->sts &= ~0x01; /* RD ready */ ret = mcu->rxd; - LOG(("PC=%04X 8741[%d] DR %02X\n",activecpu_get_pc(),num,ret)); + LOG(("PC=%04X 8741[%d] DR %02X\n",cpu_get_pc(machine->activecpu),num,ret)); mcu->rst = 0; } return ret; diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c index 55c3b9310fb..bdadb8bd082 100644 --- a/src/mame/machine/taitosj.c +++ b/src/mame/machine/taitosj.c @@ -84,18 +84,18 @@ WRITE8_HANDLER( taitosj_bankswitch_w ) ***************************************************************************/ READ8_HANDLER( taitosj_fake_data_r ) { - LOG(("%04x: protection read\n",activecpu_get_pc())); + LOG(("%04x: protection read\n",cpu_get_pc(machine->activecpu))); return 0; } WRITE8_HANDLER( taitosj_fake_data_w ) { - LOG(("%04x: protection write %02x\n",activecpu_get_pc(),data)); + LOG(("%04x: protection write %02x\n",cpu_get_pc(machine->activecpu),data)); } READ8_HANDLER( taitosj_fake_status_r ) { - LOG(("%04x: protection status read\n",activecpu_get_pc())); + LOG(("%04x: protection status read\n",cpu_get_pc(machine->activecpu))); return 0xff; } @@ -103,7 +103,7 @@ READ8_HANDLER( taitosj_fake_status_r ) /* timer callback : */ READ8_HANDLER( taitosj_mcu_data_r ) { - LOG(("%04x: protection read %02x\n",activecpu_get_pc(),toz80)); + LOG(("%04x: protection read %02x\n",cpu_get_pc(machine->activecpu),toz80)); zaccept = 1; return toz80; } @@ -118,7 +118,7 @@ static TIMER_CALLBACK( taitosj_mcu_real_data_w ) WRITE8_HANDLER( taitosj_mcu_data_w ) { - LOG(("%04x: protection write %02x\n",activecpu_get_pc(),data)); + LOG(("%04x: protection write %02x\n",cpu_get_pc(machine->activecpu),data)); timer_call_after_resynch(NULL, data,taitosj_mcu_real_data_w); /* temporarily boost the interleave to sync things up */ cpu_boost_interleave(machine, attotime_zero, ATTOTIME_IN_USEC(10)); @@ -136,13 +136,13 @@ READ8_HANDLER( taitosj_mcu_status_r ) READ8_HANDLER( taitosj_68705_portA_r ) { - LOG(("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in)); + LOG(("%04x: 68705 port A read %02x\n",cpu_get_pc(machine->activecpu),portA_in)); return portA_in; } WRITE8_HANDLER( taitosj_68705_portA_w ) { - LOG(("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data)); + LOG(("%04x: 68705 port A write %02x\n",cpu_get_pc(machine->activecpu),data)); portA_out = data; } @@ -188,11 +188,11 @@ static TIMER_CALLBACK( taitosj_mcu_status_real_w ) WRITE8_HANDLER( taitosj_68705_portB_w ) { - LOG(("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data)); + LOG(("%04x: 68705 port B write %02x\n",cpu_get_pc(machine->activecpu),data)); if (~data & 0x01) { - LOG(("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc())); + LOG(("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",cpu_get_pc(machine->activecpu))); } if (~data & 0x02) { @@ -200,7 +200,7 @@ WRITE8_HANDLER( taitosj_68705_portB_w ) timer_call_after_resynch(NULL, 0,taitosj_mcu_data_real_r); cpunum_set_input_line(machine, 2,0,CLEAR_LINE); portA_in = fromz80; - LOG(("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in)); + LOG(("%04x: 68705 <- Z80 %02x\n",cpu_get_pc(machine->activecpu),portA_in)); } if (~data & 0x08) busreq = 1; @@ -208,37 +208,37 @@ WRITE8_HANDLER( taitosj_68705_portB_w ) busreq = 0; if (~data & 0x04) { - LOG(("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out)); + LOG(("%04x: 68705 -> Z80 %02x\n",cpu_get_pc(machine->activecpu),portA_out)); /* 68705 is writing data for the Z80 */ timer_call_after_resynch(NULL, portA_out,taitosj_mcu_status_real_w); } if (~data & 0x10) { - LOG(("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address)); + LOG(("%04x: 68705 write %02x to address %04x\n",cpu_get_pc(machine->activecpu),portA_out,address)); - cpuintrf_push_context(0); + cpu_push_context(machine->cpu[0]); program_write_byte(address, portA_out); - cpuintrf_pop_context(); + cpu_pop_context(); /* increase low 8 bits of latched address for burst writes */ address = (address & 0xff00) | ((address + 1) & 0xff); } if (~data & 0x20) { - cpuintrf_push_context(0); + cpu_push_context(machine->cpu[0]); portA_in = program_read_byte(address); - cpuintrf_pop_context(); - LOG(("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),portA_in,address)); + cpu_pop_context(); + LOG(("%04x: 68705 read %02x from address %04x\n",cpu_get_pc(machine->activecpu),portA_in,address)); } if (~data & 0x40) { - LOG(("%04x: 68705 address low %02x\n",activecpu_get_pc(),portA_out)); + LOG(("%04x: 68705 address low %02x\n",cpu_get_pc(machine->activecpu),portA_out)); address = (address & 0xff00) | portA_out; } if (~data & 0x80) { - LOG(("%04x: 68705 address high %02x\n",activecpu_get_pc(),portA_out)); + LOG(("%04x: 68705 address high %02x\n",cpu_get_pc(machine->activecpu),portA_out)); address = (address & 0x00ff) | (portA_out << 8); } } @@ -258,7 +258,7 @@ READ8_HANDLER( taitosj_68705_portC_r ) int res; res = (zready << 0) | (zaccept << 1) | ((busreq^1) << 2); - LOG(("%04x: 68705 port C read %02x\n",activecpu_get_pc(),res)); + LOG(("%04x: 68705 port C read %02x\n",cpu_get_pc(machine->activecpu),res)); return res; } @@ -267,7 +267,7 @@ READ8_HANDLER( taitosj_68705_portC_r ) READ8_HANDLER( spacecr_prot_r ) { - int pc = activecpu_get_pc(); + int pc = cpu_get_pc(machine->activecpu); if( pc != 0x368A && pc != 0x36A6 ) logerror("Read protection from an unknown location: %04X\n",pc); diff --git a/src/mame/machine/tatsumi.c b/src/mame/machine/tatsumi.c index 328e788526a..e97adcfcf3f 100644 --- a/src/mame/machine/tatsumi.c +++ b/src/mame/machine/tatsumi.c @@ -96,25 +96,25 @@ READ16_HANDLER( apache3_v30_v20_r ) else if ((tatsumi_control_word&0xe0)==0x80) offset+=0x00000; // main ram else - logerror("%08x: unmapped read z80 rom %08x\n",activecpu_get_pc(),offset); + logerror("%08x: unmapped read z80 rom %08x\n",cpu_get_pc(machine->activecpu),offset); - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); value = program_read_byte(offset); - cpuintrf_pop_context(); + cpu_pop_context(); return value | 0xff00; } WRITE16_HANDLER( apache3_v30_v20_w ) { if ((tatsumi_control_word&0xe0)!=0x80) - logerror("%08x: write unmapped v30 rom %08x\n",activecpu_get_pc(),offset); + logerror("%08x: write unmapped v30 rom %08x\n",cpu_get_pc(machine->activecpu),offset); /* Only 8 bits of the V30 data bus are connected - ignore writes to the other half */ if (ACCESSING_BITS_0_7) { - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); program_write_byte(offset, data&0xff); - cpuintrf_pop_context(); + cpu_pop_context(); } } @@ -160,9 +160,9 @@ READ16_HANDLER( roundup_v30_z80_r ) if (tatsumi_control_word&0x20) offset+=0x8000; /* Upper half */ - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); value = program_read_byte(offset); - cpuintrf_pop_context(); + cpu_pop_context(); return value | 0xff00; } @@ -174,9 +174,9 @@ WRITE16_HANDLER( roundup_v30_z80_w ) if (tatsumi_control_word&0x20) offset+=0x8000; /* Upper half of Z80 address space */ - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); program_write_byte(offset, data&0xff); - cpuintrf_pop_context(); + cpu_pop_context(); } } @@ -196,7 +196,7 @@ WRITE16_HANDLER( roundup5_control_w ) cpunum_set_input_line(machine, 2, INPUT_LINE_HALT, CLEAR_LINE); // if (offset==1 && (tatsumi_control_w&0xfeff)!=(last_bank&0xfeff)) -// logerror("%08x: Changed bank to %04x (%d)\n",activecpu_get_pc(),tatsumi_control_w,offset); +// logerror("%08x: Changed bank to %04x (%d)\n",cpu_get_pc(machine->activecpu),tatsumi_control_w,offset); //todo - watchdog @@ -242,7 +242,7 @@ WRITE16_HANDLER( roundup5_control_w ) WRITE16_HANDLER( roundup5_d0000_w ) { COMBINE_DATA(&roundup5_d0000_ram[offset]); -// logerror("d_68k_d0000_w %06x %04x\n",activecpu_get_pc(),data); +// logerror("d_68k_d0000_w %06x %04x\n",cpu_get_pc(machine->activecpu),data); } WRITE16_HANDLER( roundup5_e0000_w ) @@ -254,14 +254,14 @@ WRITE16_HANDLER( roundup5_e0000_w ) COMBINE_DATA(&roundup5_e0000_ram[offset]); cpunum_set_input_line(machine, 1, INPUT_LINE_IRQ4, CLEAR_LINE); // guess, probably wrong -// logerror("d_68k_e0000_w %06x %04x\n",activecpu_get_pc(),data); +// logerror("d_68k_e0000_w %06x %04x\n",cpu_get_pc(machine->activecpu),data); } /******************************************************************************/ READ16_HANDLER(cyclwarr_control_r) { -// logerror("%08x: control_r\n",activecpu_get_pc()); +// logerror("%08x: control_r\n",cpu_get_pc(machine->activecpu)); return tatsumi_control_word; } @@ -270,7 +270,7 @@ WRITE16_HANDLER(cyclwarr_control_w) COMBINE_DATA(&tatsumi_control_word); // if ((tatsumi_control_word&0xfe)!=(tatsumi_last_control&0xfe)) -// logerror("%08x: control_w %04x\n",activecpu_get_pc(),data); +// logerror("%08x: control_w %04x\n",cpu_get_pc(machine->activecpu),data); /* @@ -293,7 +293,7 @@ WRITE16_HANDLER(cyclwarr_control_w) // hack - if (activecpu_get_pc()==0x2c3c34) { + if (cpu_get_pc(machine->activecpu)==0x2c3c34) { // cpu_set_reset_line(1, CLEAR_LINE); // logerror("hack 68k2 on\n"); } @@ -307,12 +307,12 @@ READ16_HANDLER( tatsumi_v30_68000_r ) { const UINT16* rom=(UINT16*)memory_region(machine, "sub"); -logerror("%05X:68000_r(%04X),cw=%04X\n", activecpu_get_pc(), offset*2, tatsumi_control_word); +logerror("%05X:68000_r(%04X),cw=%04X\n", cpu_get_pc(machine->activecpu), offset*2, tatsumi_control_word); /* Read from 68k RAM */ if ((tatsumi_control_word&0x1f)==0x18) { // hack to make roundup 5 boot - if (activecpu_get_pc()==0xec575) + if (cpu_get_pc(machine->activecpu)==0xec575) { UINT8 *dst = memory_region(machine, "main"); dst[BYTE_XOR_LE(0xec57a)]=0x46; @@ -351,9 +351,9 @@ READ8_HANDLER(tatsumi_hack_ym2151_r) { int r=ym2151_status_port_0_r(machine,0); - if (activecpu_get_pc()==0x2aca || activecpu_get_pc()==0x29fe - || activecpu_get_pc()==0xf9721 - || activecpu_get_pc()==0x1b96 || activecpu_get_pc()==0x1c65) // BigFight + if (cpu_get_pc(machine->activecpu)==0x2aca || cpu_get_pc(machine->activecpu)==0x29fe + || cpu_get_pc(machine->activecpu)==0xf9721 + || cpu_get_pc(machine->activecpu)==0x1b96 || cpu_get_pc(machine->activecpu)==0x1c65) // BigFight return 0x80; return r; } @@ -364,14 +364,14 @@ READ8_HANDLER(tatsumi_hack_oki_r) { int r=okim6295_status_0_r(machine,0); - if (activecpu_get_pc()==0x2b70 || activecpu_get_pc()==0x2bb5 - || activecpu_get_pc()==0x2acc - || activecpu_get_pc()==0x1c79 // BigFight - || activecpu_get_pc()==0x1cbe // BigFight - || activecpu_get_pc()==0xf9881) + if (cpu_get_pc(machine->activecpu)==0x2b70 || cpu_get_pc(machine->activecpu)==0x2bb5 + || cpu_get_pc(machine->activecpu)==0x2acc + || cpu_get_pc(machine->activecpu)==0x1c79 // BigFight + || cpu_get_pc(machine->activecpu)==0x1cbe // BigFight + || cpu_get_pc(machine->activecpu)==0xf9881) return 0xf; - if (activecpu_get_pc()==0x2ba3 || activecpu_get_pc()==0x2a9b || activecpu_get_pc()==0x2adc - || activecpu_get_pc()==0x1cac) // BigFight + if (cpu_get_pc(machine->activecpu)==0x2ba3 || cpu_get_pc(machine->activecpu)==0x2a9b || cpu_get_pc(machine->activecpu)==0x2adc + || cpu_get_pc(machine->activecpu)==0x1cac) // BigFight return 0; return r; } diff --git a/src/mame/machine/ticket.c b/src/mame/machine/ticket.c index cddd8d71e13..61ea5163ff7 100644 --- a/src/mame/machine/ticket.c +++ b/src/mame/machine/ticket.c @@ -71,13 +71,13 @@ READ8_HANDLER( ticket_dispenser_r ) READ8_HANDLER( ticket_dispenser_0_r ) { - LOG(("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), dispenser[0].status)); + LOG(("PC: %04X Ticket Status Read = %02X\n", cpu_get_pc(machine->activecpu), dispenser[0].status)); return dispenser[0].status; } READ8_HANDLER( ticket_dispenser_1_r ) { - LOG(("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), dispenser[1].status)); + LOG(("PC: %04X Ticket Status Read = %02X\n", cpu_get_pc(machine->activecpu), dispenser[1].status)); return dispenser[1].status; } @@ -106,7 +106,7 @@ WRITE8_HANDLER( ticket_dispenser_0_w ) { if (!dispenser[0].power) { - LOG(("PC: %04X Ticket Power On\n", activecpu_get_pc())); + LOG(("PC: %04X Ticket Power On\n", cpu_get_pc(machine->activecpu))); timer_adjust_oneshot(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), 0); dispenser[0].power = 1; @@ -117,7 +117,7 @@ WRITE8_HANDLER( ticket_dispenser_0_w ) { if (dispenser[0].power) { - LOG(("PC: %04X Ticket Power Off\n", activecpu_get_pc())); + LOG(("PC: %04X Ticket Power Off\n", cpu_get_pc(machine->activecpu))); timer_adjust_oneshot(dispenser[0].timer, attotime_never, 0); set_led_status(2,0); dispenser[0].power = 0; @@ -132,7 +132,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w ) { if (!dispenser[1].power) { - LOG(("PC: %04X Ticket Power On\n", activecpu_get_pc())); + LOG(("PC: %04X Ticket Power On\n", cpu_get_pc(machine->activecpu))); timer_adjust_oneshot(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), 0); dispenser[1].power = 1; @@ -143,7 +143,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w ) { if (dispenser[1].power) { - LOG(("PC: %04X Ticket Power Off\n", activecpu_get_pc())); + LOG(("PC: %04X Ticket Power Off\n", cpu_get_pc(machine->activecpu))); timer_adjust_oneshot(dispenser[1].timer, attotime_never, 0); set_led_status(2,0); dispenser[1].power = 0; diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c index bb628c0155f..3908e93df06 100644 --- a/src/mame/machine/tnzs.c +++ b/src/mame/machine/tnzs.c @@ -46,28 +46,28 @@ static READ8_HANDLER( mcu_tnzs_r ) if (offset == 0) { - data = cpunum_get_reg(2, I8X41_DATA); + data = cpu_get_reg(machine->cpu[2], I8X41_DATA); cpu_yield(); } else { - data = cpunum_get_reg(2, I8X41_STAT); + data = cpu_get_reg(machine->cpu[2], I8X41_STAT); cpu_yield(); } -// logerror("PC %04x: read %02x from mcu $c00%01x\n", activecpu_get_previouspc(), data, offset); +// logerror("PC %04x: read %02x from mcu $c00%01x\n", cpu_get_previouspc(machine->activecpu), data, offset); return data; } static WRITE8_HANDLER( mcu_tnzs_w ) { -// logerror("PC %04x: write %02x to mcu $c00%01x\n", activecpu_get_previouspc(), data, offset); +// logerror("PC %04x: write %02x to mcu $c00%01x\n", cpu_get_previouspc(machine->activecpu), data, offset); if (offset == 0) - cpunum_set_reg(2, I8X41_DATA, data); + cpu_set_reg(machine->cpu[2], I8X41_DATA, data); else - cpunum_set_reg(2, I8X41_CMND, data); + cpu_set_reg(machine->cpu[2], I8X41_CMND, data); } @@ -83,7 +83,7 @@ READ8_HANDLER( tnzs_port1_r ) default: data = 0xff; break; } -// logerror("I8742:%04x Read %02x from port 1\n", activecpu_get_previouspc(), data); +// logerror("I8742:%04x Read %02x from port 1\n", cpu_get_previouspc(machine->activecpu), data); return data; } @@ -92,14 +92,14 @@ READ8_HANDLER( tnzs_port2_r ) { int data = input_port_read(machine, "IN2"); -// logerror("I8742:%04x Read %02x from port 2\n", activecpu_get_previouspc(), data); +// logerror("I8742:%04x Read %02x from port 2\n", cpu_get_previouspc(machine->activecpu), data); return data; } WRITE8_HANDLER( tnzs_port2_w ) { -// logerror("I8742:%04x Write %02x to port 2\n", activecpu_get_previouspc(), data); +// logerror("I8742:%04x Write %02x to port 2\n", cpu_get_previouspc(machine->activecpu), data); coin_lockout_w( 0, (data & 0x40) ); coin_lockout_w( 1, (data & 0x80) ); @@ -115,7 +115,7 @@ READ8_HANDLER( arknoid2_sh_f000_r ) { int val; -// logerror("PC %04x: read input %04x\n", activecpu_get_pc(), 0xf000 + offset); +// logerror("PC %04x: read input %04x\n", cpu_get_pc(machine->activecpu), 0xf000 + offset); val = input_port_read_safe(machine, (offset/2) ? "AN2" : "AN1", 0); if (offset & 1) @@ -219,7 +219,7 @@ static READ8_HANDLER( mcu_arknoid2_r ) { static const char mcu_startup[] = "\x55\xaa\x5a"; -// logerror("PC %04x: read mcu %04x\n", activecpu_get_pc(), 0xc000 + offset); +// logerror("PC %04x: read mcu %04x\n", cpu_get_pc(machine->activecpu), 0xc000 + offset); if (offset == 0) { @@ -281,7 +281,7 @@ static WRITE8_HANDLER( mcu_arknoid2_w ) { if (offset == 0) { -// logerror("PC %04x: write %02x to mcu %04x\n", activecpu_get_pc(), data, 0xc000 + offset); +// logerror("PC %04x: write %02x to mcu %04x\n", cpu_get_pc(machine->activecpu), data, 0xc000 + offset); if (mcu_command == 0x41) { mcu_credits = (mcu_credits + data) & 0xff; @@ -298,7 +298,7 @@ static WRITE8_HANDLER( mcu_arknoid2_w ) 0x80: release coin lockout (issued only in test mode) during initialization, a sequence of 4 bytes sets coin/credit settings */ -// logerror("PC %04x: write %02x to mcu %04x\n", activecpu_get_pc(), data, 0xc000 + offset); +// logerror("PC %04x: write %02x to mcu %04x\n", cpu_get_pc(machine->activecpu), data, 0xc000 + offset); if (mcu_initializing) { @@ -324,7 +324,7 @@ static READ8_HANDLER( mcu_extrmatn_r ) { static const char mcu_startup[] = "\x5a\xa5\x55"; -// logerror("PC %04x: read mcu %04x\n", activecpu_get_pc(), 0xc000 + offset); +// logerror("PC %04x: read mcu %04x\n", cpu_get_pc(machine->activecpu), 0xc000 + offset); if (offset == 0) { @@ -409,7 +409,7 @@ static WRITE8_HANDLER( mcu_extrmatn_w ) { if (offset == 0) { -// logerror("PC %04x: write %02x to mcu %04x\n", activecpu_get_pc(), data, 0xc000 + offset); +// logerror("PC %04x: write %02x to mcu %04x\n", cpu_get_pc(machine->activecpu), data, 0xc000 + offset); if (mcu_command == 0x41) { mcu_credits = (mcu_credits + data) & 0xff; @@ -431,7 +431,7 @@ static WRITE8_HANDLER( mcu_extrmatn_w ) during initialization, a sequence of 4 bytes sets coin/credit settings */ -// logerror("PC %04x: write %02x to mcu %04x\n", activecpu_get_pc(), data, 0xc000 + offset); +// logerror("PC %04x: write %02x to mcu %04x\n", cpu_get_pc(machine->activecpu), data, 0xc000 + offset); if (mcu_initializing) { @@ -717,7 +717,7 @@ WRITE8_HANDLER( tnzs_bankswitch_w ) { UINT8 *RAM = memory_region(machine, "main"); -// logerror("PC %04x: writing %02x to bankswitch\n", activecpu_get_pc(),data); +// logerror("PC %04x: writing %02x to bankswitch\n", cpu_get_pc(machine->activecpu),data); /* bit 4 resets the second CPU */ if (data & 0x10) @@ -733,7 +733,7 @@ WRITE8_HANDLER( tnzs_bankswitch1_w ) { UINT8 *RAM = memory_region(machine, "sub"); -// logerror("PC %04x: writing %02x to bankswitch 1\n", activecpu_get_pc(),data); +// logerror("PC %04x: writing %02x to bankswitch 1\n", cpu_get_pc(machine->activecpu),data); switch (mcu_type) { diff --git a/src/mame/machine/toaplan1.c b/src/mame/machine/toaplan1.c index c385c5e509c..dc0eb767b97 100644 --- a/src/mame/machine/toaplan1.c +++ b/src/mame/machine/toaplan1.c @@ -54,7 +54,7 @@ WRITE16_HANDLER( demonwld_dsp_addrsel_w ) main_ram_seg = ((data & 0xe000) << 9); dsp_addr_w = ((data & 0x1fff) << 1); - logerror("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); + logerror("DSP PC:%04x IO write %04x (%08x) at port 0\n",cpu_get_previouspc(machine->activecpu),data,main_ram_seg + dsp_addr_w); } READ16_HANDLER( demonwld_dsp_r ) @@ -63,10 +63,10 @@ READ16_HANDLER( demonwld_dsp_r ) UINT16 input_data = 0; switch (main_ram_seg) { - case 0xc00000: cpuintrf_push_context(0); input_data = program_read_word(main_ram_seg + dsp_addr_w); cpuintrf_pop_context(); break; - default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); + case 0xc00000: cpu_push_context(machine->cpu[0]); input_data = program_read_word(main_ram_seg + dsp_addr_w); cpu_pop_context(); break; + default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),main_ram_seg + dsp_addr_w); } - logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w); + logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),input_data,main_ram_seg + dsp_addr_w); return input_data; } @@ -76,12 +76,12 @@ WRITE16_HANDLER( demonwld_dsp_w ) dsp_execute = 0; switch (main_ram_seg) { case 0xc00000: if ((dsp_addr_w < 3) && (data == 0)) dsp_execute = 1; - cpuintrf_push_context(0); + cpu_push_context(machine->cpu[0]); program_write_word(main_ram_seg + dsp_addr_w, data); - cpuintrf_pop_context(); break; - default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); + cpu_pop_context(); break; + default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),main_ram_seg + dsp_addr_w); } - logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); + logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),data,main_ram_seg + dsp_addr_w); } WRITE16_HANDLER( demonwld_dsp_bio_w ) @@ -91,7 +91,7 @@ WRITE16_HANDLER( demonwld_dsp_bio_w ) /* Actually only DSP data bit 15 controls this */ /* data 0x0000 means set DSP BIO line active and disable */ /* communication to main processor*/ - logerror("DSP PC:%04x IO write %04x at port 3\n",activecpu_get_previouspc(),data); + logerror("DSP PC:%04x IO write %04x at port 3\n",cpu_get_previouspc(machine->activecpu),data); if (data & 0x8000) { demonwld_dsp_BIO = CLEAR_LINE; } @@ -136,7 +136,7 @@ static STATE_POSTLOAD( demonwld_restore_dsp ) WRITE16_HANDLER( demonwld_dsp_ctrl_w ) { #if 0 - logerror("68000:%08x Writing %08x to %08x.\n",activecpu_get_pc() ,data ,0xe0000a + offset); + logerror("68000:%08x Writing %08x to %08x.\n",cpu_get_pc(machine->activecpu) ,data ,0xe0000a + offset); #endif if (ACCESSING_BITS_0_7) @@ -145,12 +145,12 @@ WRITE16_HANDLER( demonwld_dsp_ctrl_w ) { case 0x00: demonwld_dsp(machine, 1); break; /* Enable the INT line to the DSP */ case 0x01: demonwld_dsp(machine, 0); break; /* Inhibit the INT line to the DSP */ - default: logerror("68000:%04x Writing unknown command %08x to %08x\n",activecpu_get_previouspc() ,data ,0xe0000a + offset); break; + default: logerror("68000:%04x Writing unknown command %08x to %08x\n",cpu_get_previouspc(machine->activecpu) ,data ,0xe0000a + offset); break; } } else { - logerror("68000:%04x Writing unknown command %08x to %08x\n",activecpu_get_previouspc() ,data ,0xe0000a + offset); + logerror("68000:%04x Writing unknown command %08x to %08x\n",cpu_get_previouspc(machine->activecpu) ,data ,0xe0000a + offset); } } @@ -158,7 +158,7 @@ WRITE16_HANDLER( demonwld_dsp_ctrl_w ) READ16_HANDLER( samesame_port_6_word_r ) { /* Bit 0x80 is secondary CPU (HD647180) ready signal */ - logerror("PC:%04x Warning !!! IO reading from $14000a\n",activecpu_get_previouspc()); + logerror("PC:%04x Warning !!! IO reading from $14000a\n",cpu_get_previouspc(machine->activecpu)); return (0x80 | input_port_read(machine, "TJUMP")) & 0xff; } @@ -224,7 +224,7 @@ WRITE16_HANDLER( toaplan1_reset_sound ) if (ACCESSING_BITS_0_7 && (data == 0)) { - logerror("PC:%04x Resetting Sound CPU and Sound chip (%08x)\n",activecpu_get_previouspc(),data); + logerror("PC:%04x Resetting Sound CPU and Sound chip (%08x)\n",cpu_get_previouspc(machine->activecpu),data); if (machine->config->sound[0].type == SOUND_YM3812) sndti_reset(SOUND_YM3812, 0); if (machine->config->cpu[1].type == CPU_Z80) @@ -244,7 +244,7 @@ WRITE8_HANDLER( rallybik_coin_w ) case 0x0d: coin_lockout_w(0,0); coin_lockout_w(2,0); break; case 0x0e: coin_lockout_w(1,1); coin_lockout_w(3,1); break; case 0x0f: coin_lockout_w(1,0); coin_lockout_w(3,0); toaplan1_coin_count=1; break; - default: logerror("PC:%04x Writing unknown data (%04x) to coin count/lockout port\n",activecpu_get_previouspc(),data); break; + default: logerror("PC:%04x Writing unknown data (%04x) to coin count/lockout port\n",cpu_get_previouspc(machine->activecpu),data); break; } } @@ -274,7 +274,7 @@ WRITE8_HANDLER( toaplan1_coin_w ) case 0x02: coin_lockout_w(1,1); break; /* Lock coin slot B */ case 0x01: coin_lockout_w(0,1); break; /* Lock coin slot A */ case 0x00: coin_lockout_global_w(1); break; /* Lock all coin slots */ - default: logerror("PC:%04x Writing unknown data (%04x) to coin count/lockout port\n",activecpu_get_previouspc(),data); break; + default: logerror("PC:%04x Writing unknown data (%04x) to coin count/lockout port\n",cpu_get_previouspc(machine->activecpu),data); break; } } @@ -286,7 +286,7 @@ WRITE16_HANDLER( samesame_coin_w ) } if (ACCESSING_BITS_8_15 && (data&0xff00)) { - logerror("PC:%04x Writing unknown MSB data (%04x) to coin count/lockout port\n",activecpu_get_previouspc(),data); + logerror("PC:%04x Writing unknown MSB data (%04x) to coin count/lockout port\n",cpu_get_previouspc(machine->activecpu),data); } } diff --git a/src/mame/machine/twincobr.c b/src/mame/machine/twincobr.c index 8a6e7c898c9..11e0890b688 100644 --- a/src/mame/machine/twincobr.c +++ b/src/mame/machine/twincobr.c @@ -60,7 +60,7 @@ WRITE16_HANDLER( twincobr_dsp_addrsel_w ) main_ram_seg = ((data & 0xe000) << 3); dsp_addr_w = ((data & 0x1fff) << 1); - LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); + LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",cpu_get_previouspc(machine->activecpu),data,main_ram_seg + dsp_addr_w)); } READ16_HANDLER( twincobr_dsp_r ) @@ -71,12 +71,12 @@ READ16_HANDLER( twincobr_dsp_r ) switch (main_ram_seg) { case 0x30000: case 0x40000: - case 0x50000: cpuintrf_push_context(0); + case 0x50000: cpu_push_context(machine->cpu[0]); input_data = program_read_word(main_ram_seg + dsp_addr_w); - cpuintrf_pop_context(); break; - default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); break; + cpu_pop_context(); break; + default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),main_ram_seg + dsp_addr_w); break; } - LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w)); + LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),input_data,main_ram_seg + dsp_addr_w)); return input_data; } @@ -87,12 +87,12 @@ WRITE16_HANDLER( twincobr_dsp_w ) switch (main_ram_seg) { case 0x30000: if ((dsp_addr_w < 3) && (data == 0)) dsp_execute = 1; case 0x40000: - case 0x50000: cpuintrf_push_context(0); + case 0x50000: cpu_push_context(machine->cpu[0]); program_write_word(main_ram_seg + dsp_addr_w, data); - cpuintrf_pop_context(); break; - default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); break; + cpu_pop_context(); break; + default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),main_ram_seg + dsp_addr_w); break; } - LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); + LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),data,main_ram_seg + dsp_addr_w)); } WRITE16_HANDLER( wardner_dsp_addrsel_w ) @@ -107,7 +107,7 @@ WRITE16_HANDLER( wardner_dsp_addrsel_w ) if (main_ram_seg == 0x6000) main_ram_seg = 0x7000; - LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); + LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",cpu_get_previouspc(machine->activecpu),data,main_ram_seg + dsp_addr_w)); } READ16_HANDLER( wardner_dsp_r ) @@ -118,13 +118,13 @@ READ16_HANDLER( wardner_dsp_r ) switch (main_ram_seg) { case 0x7000: case 0x8000: - case 0xa000: cpuintrf_push_context(0); + case 0xa000: cpu_push_context(machine->cpu[0]); input_data = program_read_byte(main_ram_seg + (dsp_addr_w + 0)) | (program_read_byte(main_ram_seg + (dsp_addr_w + 1)) << 8); - cpuintrf_pop_context(); break; - default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); break; + cpu_pop_context(); break; + default: logerror("DSP PC:%04x Warning !!! IO reading from %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),main_ram_seg + dsp_addr_w); break; } - LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w)); + LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),input_data,main_ram_seg + dsp_addr_w)); return input_data; } @@ -135,13 +135,13 @@ WRITE16_HANDLER( wardner_dsp_w ) switch (main_ram_seg) { case 0x7000: if ((dsp_addr_w < 3) && (data == 0)) dsp_execute = 1; case 0x8000: - case 0xa000: cpuintrf_push_context(0); + case 0xa000: cpu_push_context(machine->cpu[0]); program_write_byte(main_ram_seg + (dsp_addr_w + 0), (data & 0xff)); program_write_byte(main_ram_seg + (dsp_addr_w + 1), ((data >> 8) & 0xff)); - cpuintrf_pop_context(); break; - default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",activecpu_get_previouspc(),main_ram_seg + dsp_addr_w); break; + cpu_pop_context(); break; + default: logerror("DSP PC:%04x Warning !!! IO writing to %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),main_ram_seg + dsp_addr_w); break; } - LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); + LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",cpu_get_previouspc(machine->activecpu),data,main_ram_seg + dsp_addr_w)); } WRITE16_HANDLER( twincobr_dsp_bio_w ) @@ -151,7 +151,7 @@ WRITE16_HANDLER( twincobr_dsp_bio_w ) /* Actually only DSP data bit 15 controls this */ /* data 0x0000 means set DSP BIO line active and disable */ /* communication to main processor*/ - LOG(("DSP PC:%04x IO write %04x at port 3\n",activecpu_get_previouspc(),data)); + LOG(("DSP PC:%04x IO write %04x at port 3\n",cpu_get_previouspc(machine->activecpu),data)); if (data & 0x8000) { twincobr_dsp_BIO = CLEAR_LINE; } @@ -172,7 +172,7 @@ READ16_HANDLER( fsharkbt_dsp_r ) /* Port is read three times during startup. First and last data */ /* read must equal, but second data read must be different */ fsharkbt_8741 += 1; - LOG(("DSP PC:%04x IO read %04x from 8741 MCU (port 2)\n",activecpu_get_previouspc(),(fsharkbt_8741 & 0x08))); + LOG(("DSP PC:%04x IO read %04x from 8741 MCU (port 2)\n",cpu_get_previouspc(machine->activecpu),(fsharkbt_8741 & 0x08))); return (fsharkbt_8741 & 1); } @@ -180,7 +180,7 @@ WRITE16_HANDLER( fsharkbt_dsp_w ) { /* Flying Shark bootleg DSP writes data to an extra MCU (8741) at IO port 2 */ #if 0 - logerror("DSP PC:%04x IO write from DSP RAM:%04x to 8741 MCU (port 2)\n",activecpu_get_previouspc(),fsharkbt_8741); + logerror("DSP PC:%04x IO write from DSP RAM:%04x to 8741 MCU (port 2)\n",cpu_get_previouspc(machine->activecpu),fsharkbt_8741); #endif } @@ -214,7 +214,7 @@ static STATE_POSTLOAD( twincobr_restore_dsp ) static void toaplan0_control_w(running_machine *machine, int offset, int data) { - LOG(("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset)); + LOG(("CPU0:%08x Writing %08x to %08x.\n",cpu_get_pc(machine->activecpu),data,toaplan_port_type[toaplan_main_cpu] - offset)); if (toaplan_main_cpu == 1) { if (data == 0x0c) { data = 0x1c; wardner_sprite_hack=0; } /* Z80 ? */ @@ -268,7 +268,7 @@ WRITE16_HANDLER( twincobr_sharedram_w ) static void toaplan0_coin_dsp_w(running_machine *machine, int offset, int data) { if (data > 1) - LOG(("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset)); + LOG(("CPU0:%08x Writing %08x to %08x.\n",cpu_get_pc(machine->activecpu),data,toaplan_port_type[toaplan_main_cpu] - offset)); switch (data) { case 0x08: coin_counter_w(0,0); break; case 0x09: coin_counter_w(0,1); break; diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c index 7a0774e7d9d..791b9086863 100644 --- a/src/mame/machine/tx1.c +++ b/src/mame/machine/tx1.c @@ -4,6 +4,7 @@ ***************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "debugger.h" #include "machine/8255ppi.h" #include "tx1.h" @@ -194,7 +195,7 @@ static void sn_divide(void) if ( SN74S516.X == 0 ) { - mame_printf_debug("SN74S516 tried to divide by zero (PC=%x)\n", activecpu_get_pc()); + mame_printf_debug("SN74S516 tried to divide by zero (PC=%x)\n", cpu_get_pc(Machine->activecpu)); SN74S516.ZW.Z = 0xffff; SN74S516.ZW.W = 0xffff; SN74S516.ZWfl = 0; @@ -336,7 +337,7 @@ static void kick_sn74s516(UINT16 *data, const int ins) if (SN74S516.code == 0x6666) { CLEAR_SEQUENCE; - mame_printf_debug("Code 6666: PROMADDR:%x PC:%x\n", math.promaddr, activecpu_get_pc()); + mame_printf_debug("Code 6666: PROMADDR:%x PC:%x\n", math.promaddr, cpu_get_pc(Machine->activecpu)); } UPDATE_SEQUENCE; @@ -423,7 +424,7 @@ static void kick_sn74s516(UINT16 *data, const int ins) } math.dbgaddr = math.promaddr; - math.dbgpc = activecpu_get_previouspc(); + math.dbgpc = cpu_get_previouspc(Machine->activecpu); } diff --git a/src/mame/machine/volfied.c b/src/mame/machine/volfied.c index 2cc753ae986..c5e83e6c3bc 100644 --- a/src/mame/machine/volfied.c +++ b/src/mame/machine/volfied.c @@ -347,7 +347,7 @@ WRITE16_HANDLER( volfied_cchip_ram_w ) cchip_ram[(current_bank * 0x400) + offset]=data; // if (offset!=0x8) -// logerror("%08x: volfied c write %04x %04x\n", activecpu_get_pc(), offset,data); +// logerror("%08x: volfied c write %04x %04x\n", cpu_get_pc(machine->activecpu), offset,data); if (current_bank == 0) { @@ -446,8 +446,8 @@ READ16_HANDLER( volfied_cchip_ram_r ) } } -// if (activecpu_get_pc()!=0x15ca8 && activecpu_get_pc()!=0x15cd8 && activecpu_get_pc()!=0x15cde) -// logerror("%08x: volfied c read %04x (bank %04x)\n", activecpu_get_pc(), offset, current_bank); +// if (cpu_get_pc(machine->activecpu)!=0x15ca8 && cpu_get_pc(machine->activecpu)!=0x15cd8 && cpu_get_pc(machine->activecpu)!=0x15cde) +// logerror("%08x: volfied c read %04x (bank %04x)\n", cpu_get_pc(machine->activecpu), offset, current_bank); /* Unknown */ if (current_bank == 2 && offset == 0x005) diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c index bff6b28844f..4d62c07006d 100644 --- a/src/mame/machine/vsnes.c +++ b/src/mame/machine/vsnes.c @@ -1266,16 +1266,16 @@ DRIVER_INIT( mightybj ) static WRITE8_HANDLER( vstennis_vrom_banking ) { - int other_cpu = cpu_getactivecpu() ^ 1; + int other_cpu = cpunum_get_active() ^ 1; /* switch vrom */ - ppu2c0x_set_videorom_bank( cpu_getactivecpu(), 0, 8, ( data & 4 ) ? 1 : 0, 512 ); + ppu2c0x_set_videorom_bank( cpunum_get_active(), 0, 8, ( data & 4 ) ? 1 : 0, 512 ); /* bit 1 ( data & 2 ) triggers irq on the other cpu */ cpunum_set_input_line(machine, other_cpu, 0, ( data & 2 ) ? CLEAR_LINE : ASSERT_LINE ); /* move along */ - if ( cpu_getactivecpu() == 0 ) + if ( cpunum_get_active() == 0 ) vsnes_in0_w( machine, offset, data ); else vsnes_in0_1_w( machine, offset, data ); diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c index ba2dee7030c..9f30429e941 100644 --- a/src/mame/machine/williams.c +++ b/src/mame/machine/williams.c @@ -876,7 +876,7 @@ static READ8_HANDLER( tshoot_input_port_0_3_r ) static WRITE8_HANDLER( tshoot_maxvol_w ) { /* something to do with the sound volume */ - logerror("tshoot maxvol = %d (pc:%x)\n", data, activecpu_get_pc()); + logerror("tshoot maxvol = %d (pc:%x)\n", data, cpu_get_pc(machine->activecpu)); } diff --git a/src/mame/machine/wrally.c b/src/mame/machine/wrally.c index cb93d66c40e..fdad3a794e8 100644 --- a/src/mame/machine/wrally.c +++ b/src/mame/machine/wrally.c @@ -20,7 +20,7 @@ WRITE16_HANDLER( wrally_vram_w ) { - data = gaelco_decrypt(offset, data, 0x1f, 0x522a); + data = gaelco_decrypt(machine, offset, data, 0x1f, 0x522a); COMBINE_DATA(&wrally_videoram[offset]); tilemap_mark_tile_dirty(wrally_pant[(offset & 0x1fff) >> 12], ((offset << 1) & 0x1fff) >> 2); diff --git a/src/mame/machine/xevious.c b/src/mame/machine/xevious.c index 165a82aafc4..02f6e636810 100644 --- a/src/mame/machine/xevious.c +++ b/src/mame/machine/xevious.c @@ -62,7 +62,7 @@ static TIMER_CALLBACK( battles_nmi_generate ) READ8_HANDLER( battles_customio0_r ) { - logerror("CPU0 %04x: custom I/O Read = %02x\n",activecpu_get_pc(),battles_customio_command); + logerror("CPU0 %04x: custom I/O Read = %02x\n",cpu_get_pc(machine->activecpu),battles_customio_command); return battles_customio_command; } @@ -70,7 +70,7 @@ READ8_HANDLER( battles_customio3_r ) { int return_data; - if( activecpu_get_pc() == 0xAE ){ + if( cpu_get_pc(machine->activecpu) == 0xAE ){ /* CPU4 0xAA - 0xB9 : waiting for MB8851 ? */ return_data = ( (battles_customio_command & 0x10) << 3) | 0x00 @@ -80,7 +80,7 @@ READ8_HANDLER( battles_customio3_r ) | 0x60 | (battles_customio_prev_command & 0x0f); } - logerror("CPU3 %04x: custom I/O Read = %02x\n",activecpu_get_pc(),return_data); + logerror("CPU3 %04x: custom I/O Read = %02x\n",cpu_get_pc(machine->activecpu),return_data); return return_data; } @@ -88,7 +88,7 @@ READ8_HANDLER( battles_customio3_r ) WRITE8_HANDLER( battles_customio0_w ) { - logerror("CPU0 %04x: custom I/O Write = %02x\n",activecpu_get_pc(),data); + logerror("CPU0 %04x: custom I/O Write = %02x\n",cpu_get_pc(machine->activecpu),data); battles_customio_command = data; battles_customio_command_count = 0; @@ -105,7 +105,7 @@ WRITE8_HANDLER( battles_customio0_w ) WRITE8_HANDLER( battles_customio3_w ) { - logerror("CPU3 %04x: custom I/O Write = %02x\n",activecpu_get_pc(),data); + logerror("CPU3 %04x: custom I/O Write = %02x\n",cpu_get_pc(machine->activecpu),data); battles_customio_command = data; } @@ -114,27 +114,27 @@ WRITE8_HANDLER( battles_customio3_w ) READ8_HANDLER( battles_customio_data0_r ) { - logerror("CPU0 %04x: custom I/O parameter %02x Read = %02x\n",activecpu_get_pc(),offset,battles_customio_data); + logerror("CPU0 %04x: custom I/O parameter %02x Read = %02x\n",cpu_get_pc(machine->activecpu),offset,battles_customio_data); return battles_customio_data; } READ8_HANDLER( battles_customio_data3_r ) { - logerror("CPU3 %04x: custom I/O parameter %02x Read = %02x\n",activecpu_get_pc(),offset,battles_customio_data); + logerror("CPU3 %04x: custom I/O parameter %02x Read = %02x\n",cpu_get_pc(machine->activecpu),offset,battles_customio_data); return battles_customio_data; } WRITE8_HANDLER( battles_customio_data0_w ) { - logerror("CPU0 %04x: custom I/O parameter %02x Write = %02x\n",activecpu_get_pc(),offset,data); + logerror("CPU0 %04x: custom I/O parameter %02x Write = %02x\n",cpu_get_pc(machine->activecpu),offset,data); battles_customio_data = data; } WRITE8_HANDLER( battles_customio_data3_w ) { - logerror("CPU3 %04x: custom I/O parameter %02x Write = %02x\n",activecpu_get_pc(),offset,data); + logerror("CPU3 %04x: custom I/O parameter %02x Write = %02x\n",cpu_get_pc(machine->activecpu),offset,data); battles_customio_data = data; } @@ -152,7 +152,7 @@ WRITE8_HANDLER( battles_CPU4_coin_w ) WRITE8_HANDLER( battles_noise_sound_w ) { - logerror("CPU3 %04x: 50%02x Write = %02x\n",activecpu_get_pc(),offset,data); + logerror("CPU3 %04x: 50%02x Write = %02x\n",cpu_get_pc(machine->activecpu),offset,data); if( (battles_sound_played == 0) && (data == 0xFF) ){ if( customio[0] == 0x40 ){ sample_start (0, 0, 0); diff --git a/src/mame/machine/zs01.c b/src/mame/machine/zs01.c index c8f7689aa4f..dc5c10147d8 100644 --- a/src/mame/machine/zs01.c +++ b/src/mame/machine/zs01.c @@ -8,6 +8,7 @@ */ #include "driver.h" +#include "deprecat.h" #include "machine/zs01.h" #define VERBOSE_LEVEL ( 0 ) @@ -21,9 +22,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/mame/video/airbustr.c b/src/mame/video/airbustr.c index b2a35c81d8f..f934a2aec4c 100644 --- a/src/mame/video/airbustr.c +++ b/src/mame/video/airbustr.c @@ -86,7 +86,7 @@ WRITE8_HANDLER( airbustr_scrollregs_w ) case 0x06: bg_scrollx = data; break; case 0x08: highbits = ~data; break; // complemented high bits - default: logerror("CPU #2 - port %02X written with %02X - PC = %04X\n", offset, data, activecpu_get_pc()); + default: logerror("CPU #2 - port %02X written with %02X - PC = %04X\n", offset, data, cpu_get_pc(machine->activecpu)); } tilemap_set_scrolly(bg_tilemap, 0, ((highbits << 5) & 0x100) + bg_scrolly); diff --git a/src/mame/video/antic.c b/src/mame/video/antic.c index 13c03ddc5dd..3ac47ba95e1 100644 --- a/src/mame/video/antic.c +++ b/src/mame/video/antic.c @@ -7,6 +7,7 @@ ******************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "cpu/m6502/m6502.h" #include "includes/atari.h" @@ -257,19 +258,19 @@ void antic_mode_0_xx(VIDEO *video) void antic_mode_2_32(VIDEO *video) { - PREPARE_TXT2(32); + PREPARE_TXT2(Machine->cpu[0], 32); REP32(MODE2); POST_TXT(32); } void antic_mode_2_40(VIDEO *video) { - PREPARE_TXT2(40); + PREPARE_TXT2(Machine->cpu[0], 40); REP40(MODE2); POST_TXT(40); } void antic_mode_2_48(VIDEO *video) { - PREPARE_TXT2(48); + PREPARE_TXT2(Machine->cpu[0], 48); REP48(MODE2); POST_TXT(48); } @@ -281,19 +282,19 @@ void antic_mode_2_48(VIDEO *video) void antic_mode_3_32(VIDEO *video) { - PREPARE_TXT3(32); + PREPARE_TXT3(Machine->cpu[0], 32); REP32(MODE3); POST_TXT(32); } void antic_mode_3_40(VIDEO *video) { - PREPARE_TXT3(40); + PREPARE_TXT3(Machine->cpu[0], 40); REP40(MODE3); POST_TXT(40); } void antic_mode_3_48(VIDEO *video) { - PREPARE_TXT3(48); + PREPARE_TXT3(Machine->cpu[0], 48); REP48(MODE3); POST_TXT(48); } @@ -305,19 +306,19 @@ void antic_mode_3_48(VIDEO *video) void antic_mode_4_32(VIDEO *video) { - PREPARE_TXT45(32,0); + PREPARE_TXT45(Machine->cpu[0], 32,0); REP32(MODE4); POST_TXT(32); } void antic_mode_4_40(VIDEO *video) { - PREPARE_TXT45(40,0); + PREPARE_TXT45(Machine->cpu[0], 40,0); REP40(MODE4); POST_TXT(40); } void antic_mode_4_48(VIDEO *video) { - PREPARE_TXT45(48,0); + PREPARE_TXT45(Machine->cpu[0], 48,0); REP48(MODE4); POST_TXT(48); } @@ -329,19 +330,19 @@ void antic_mode_4_48(VIDEO *video) void antic_mode_5_32(VIDEO *video) { - PREPARE_TXT45(32,1); + PREPARE_TXT45(Machine->cpu[0], 32,1); REP32(MODE5); POST_TXT(32); } void antic_mode_5_40(VIDEO *video) { - PREPARE_TXT45(40,1); + PREPARE_TXT45(Machine->cpu[0], 40,1); REP40(MODE5); POST_TXT(40); } void antic_mode_5_48(VIDEO *video) { - PREPARE_TXT45(48,1); + PREPARE_TXT45(Machine->cpu[0], 48,1); REP48(MODE5); POST_TXT(48); } @@ -353,19 +354,19 @@ void antic_mode_5_48(VIDEO *video) void antic_mode_6_32(VIDEO *video) { - PREPARE_TXT67(16,0); + PREPARE_TXT67(Machine->cpu[0], 16,0); REP16(MODE6); POST_TXT(16); } void antic_mode_6_40(VIDEO *video) { - PREPARE_TXT67(20,0); + PREPARE_TXT67(Machine->cpu[0], 20,0); REP20(MODE6); POST_TXT(20); } void antic_mode_6_48(VIDEO *video) { - PREPARE_TXT67(24,0); + PREPARE_TXT67(Machine->cpu[0], 24,0); REP24(MODE6); POST_TXT(24); } @@ -377,19 +378,19 @@ void antic_mode_6_48(VIDEO *video) void antic_mode_7_32(VIDEO *video) { - PREPARE_TXT67(16,1); + PREPARE_TXT67(Machine->cpu[0], 16,1); REP16(MODE7); POST_TXT(16); } void antic_mode_7_40(VIDEO *video) { - PREPARE_TXT67(20,1); + PREPARE_TXT67(Machine->cpu[0], 20,1); REP20(MODE7); POST_TXT(20); } void antic_mode_7_48(VIDEO *video) { - PREPARE_TXT67(24,1); + PREPARE_TXT67(Machine->cpu[0], 24,1); REP24(MODE7); POST_TXT(24); } @@ -401,19 +402,19 @@ void antic_mode_7_48(VIDEO *video) void antic_mode_8_32(VIDEO *video) { - PREPARE_GFX8(8); + PREPARE_GFX8(Machine->cpu[0], 8); REP08(MODE8); POST_GFX(8); } void antic_mode_8_40(VIDEO *video) { - PREPARE_GFX8(10); + PREPARE_GFX8(Machine->cpu[0], 10); REP10(MODE8); POST_GFX(10); } void antic_mode_8_48(VIDEO *video) { - PREPARE_GFX8(12); + PREPARE_GFX8(Machine->cpu[0], 12); REP12(MODE8); POST_GFX(12); } @@ -425,19 +426,19 @@ void antic_mode_8_48(VIDEO *video) void antic_mode_9_32(VIDEO *video) { - PREPARE_GFX9BC(16); + PREPARE_GFX9BC(Machine->cpu[0], 16); REP16(MODE9); POST_GFX(16); } void antic_mode_9_40(VIDEO *video) { - PREPARE_GFX9BC(20); + PREPARE_GFX9BC(Machine->cpu[0], 20); REP20(MODE9); POST_GFX(20); } void antic_mode_9_48(VIDEO *video) { - PREPARE_GFX9BC(24); + PREPARE_GFX9BC(Machine->cpu[0], 24); REP24(MODE9); POST_GFX(24); } @@ -449,19 +450,19 @@ void antic_mode_9_48(VIDEO *video) void antic_mode_a_32(VIDEO *video) { - PREPARE_GFXA(16); + PREPARE_GFXA(Machine->cpu[0], 16); REP16(MODEA); POST_GFX(16); } void antic_mode_a_40(VIDEO *video) { - PREPARE_GFXA(20); + PREPARE_GFXA(Machine->cpu[0], 20); REP20(MODEA); POST_GFX(20); } void antic_mode_a_48(VIDEO *video) { - PREPARE_GFXA(24); + PREPARE_GFXA(Machine->cpu[0], 24); REP24(MODEA); POST_GFX(24); } @@ -473,19 +474,19 @@ void antic_mode_a_48(VIDEO *video) void antic_mode_b_32(VIDEO *video) { - PREPARE_GFX9BC(16); + PREPARE_GFX9BC(Machine->cpu[0], 16); REP16(MODEB); POST_GFX(16); } void antic_mode_b_40(VIDEO *video) { - PREPARE_GFX9BC(20); + PREPARE_GFX9BC(Machine->cpu[0], 20); REP20(MODEB); POST_GFX(20); } void antic_mode_b_48(VIDEO *video) { - PREPARE_GFX9BC(24); + PREPARE_GFX9BC(Machine->cpu[0], 24); REP24(MODEB); POST_GFX(24); } @@ -497,19 +498,19 @@ void antic_mode_b_48(VIDEO *video) void antic_mode_c_32(VIDEO *video) { - PREPARE_GFX9BC(16); + PREPARE_GFX9BC(Machine->cpu[0], 16); REP16(MODEC); POST_GFX(16); } void antic_mode_c_40(VIDEO *video) { - PREPARE_GFX9BC(20); + PREPARE_GFX9BC(Machine->cpu[0], 20); REP20(MODEC); POST_GFX(20); } void antic_mode_c_48(VIDEO *video) { - PREPARE_GFX9BC(24); + PREPARE_GFX9BC(Machine->cpu[0], 24); REP24(MODEC); POST_GFX(24); } @@ -521,19 +522,19 @@ void antic_mode_c_48(VIDEO *video) void antic_mode_d_32(VIDEO *video) { - PREPARE_GFXDE(32); + PREPARE_GFXDE(Machine->cpu[0], 32); REP32(MODED); POST_GFX(32); } void antic_mode_d_40(VIDEO *video) { - PREPARE_GFXDE(40); + PREPARE_GFXDE(Machine->cpu[0], 40); REP40(MODED); POST_GFX(40); } void antic_mode_d_48(VIDEO *video) { - PREPARE_GFXDE(48); + PREPARE_GFXDE(Machine->cpu[0], 48); REP48(MODED); POST_GFX(48); } @@ -545,19 +546,19 @@ void antic_mode_d_48(VIDEO *video) void antic_mode_e_32(VIDEO *video) { - PREPARE_GFXDE(32); + PREPARE_GFXDE(Machine->cpu[0], 32); REP32(MODEE); POST_GFX(32); } void antic_mode_e_40(VIDEO *video) { - PREPARE_GFXDE(40); + PREPARE_GFXDE(Machine->cpu[0], 40); REP40(MODEE); POST_GFX(40); } void antic_mode_e_48(VIDEO *video) { - PREPARE_GFXDE(48); + PREPARE_GFXDE(Machine->cpu[0], 48); REP48(MODEE); POST_GFX(48); } @@ -569,19 +570,19 @@ void antic_mode_e_48(VIDEO *video) void antic_mode_f_32(VIDEO *video) { - PREPARE_GFXF(32); + PREPARE_GFXF(Machine->cpu[0], 32); REP32(MODEF); POST_GFX(32); } void antic_mode_f_40(VIDEO *video) { - PREPARE_GFXF(40); + PREPARE_GFXF(Machine->cpu[0], 40); REP40(MODEF); POST_GFX(40); } void antic_mode_f_48(VIDEO *video) { - PREPARE_GFXF(48); + PREPARE_GFXF(Machine->cpu[0], 48); REP48(MODEF); POST_GFX(48); } diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c index 5061a482482..af215d99d5f 100644 --- a/src/mame/video/artmagic.c +++ b/src/mame/video/artmagic.c @@ -114,7 +114,7 @@ static void execute_blit(void) static FILE *f; logerror("%08X:Blit from %06X to (%d,%d) %dx%d -- %04X %04X %04X %04X %04X %04X %04X %04X\n", - activecpu_get_pc(), offset, x, y, w, h, + cpu_get_pc(machine->activecpu), offset, x, y, w, h, blitter_data[0], blitter_data[1], blitter_data[2], blitter_data[3], blitter_data[4], blitter_data[5], @@ -132,7 +132,7 @@ static void execute_blit(void) fprintf(f, "----------------------\n" "%08X:Blit from %06X to (%d,%d) %dx%d -- %04X %04X %04X %04X %04X %04X %04X %04X\n", - activecpu_get_pc(), offset, x, y, w, h, + cpu_get_pc(machine->activecpu), offset, x, y, w, h, blitter_data[0], blitter_data[1], blitter_data[2], blitter_data[3], blitter_data[4], blitter_data[5], diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c index a4551ad533b..626fac3d66d 100644 --- a/src/mame/video/atari.c +++ b/src/mame/video/atari.c @@ -7,6 +7,7 @@ ******************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "includes/atari.h" #include "video/gtia.h" @@ -1197,16 +1198,16 @@ static TIMER_CALLBACK( antic_scanline_render ) if( antic.w.dmactl & DMA_MISSILE ) { antic.steal_cycles += 1; - atari_gtia_w(machine, 0x11, RDPMGFXD(3*256)); + atari_gtia_w(machine, 0x11, RDPMGFXD(machine->cpu[0], 3*256)); } /* transport player data to GTIA ? */ if( antic.w.dmactl & DMA_PLAYER ) { antic.steal_cycles += 4; - atari_gtia_w(machine, 0x0d, RDPMGFXD(4*256)); - atari_gtia_w(machine, 0x0e, RDPMGFXD(5*256)); - atari_gtia_w(machine, 0x0f, RDPMGFXD(6*256)); - atari_gtia_w(machine, 0x10, RDPMGFXD(7*256)); + atari_gtia_w(machine, 0x0d, RDPMGFXD(machine->cpu[0], 4*256)); + atari_gtia_w(machine, 0x0e, RDPMGFXD(machine->cpu[0], 5*256)); + atari_gtia_w(machine, 0x0f, RDPMGFXD(machine->cpu[0], 6*256)); + atari_gtia_w(machine, 0x10, RDPMGFXD(machine->cpu[0], 7*256)); } } else @@ -1216,17 +1217,17 @@ static TIMER_CALLBACK( antic_scanline_render ) { if( (antic.scanline & 1) == 0 ) /* even line ? */ antic.steal_cycles += 1; - atari_gtia_w(machine, 0x11, RDPMGFXS(3*128)); + atari_gtia_w(machine, 0x11, RDPMGFXS(machine->cpu[0], 3*128)); } /* transport player data to GTIA ? */ if( antic.w.dmactl & DMA_PLAYER ) { if( (antic.scanline & 1) == 0 ) /* even line ? */ antic.steal_cycles += 4; - atari_gtia_w(machine, 0x0d, RDPMGFXS(4*128)); - atari_gtia_w(machine, 0x0e, RDPMGFXS(5*128)); - atari_gtia_w(machine, 0x0f, RDPMGFXS(6*128)); - atari_gtia_w(machine, 0x10, RDPMGFXS(7*128)); + atari_gtia_w(machine, 0x0d, RDPMGFXS(machine->cpu[0], 4*128)); + atari_gtia_w(machine, 0x0e, RDPMGFXS(machine->cpu[0], 5*128)); + atari_gtia_w(machine, 0x0f, RDPMGFXS(machine->cpu[0], 6*128)); + atari_gtia_w(machine, 0x10, RDPMGFXS(machine->cpu[0], 7*128)); } } } @@ -1250,9 +1251,9 @@ INLINE void LMS(int new_cmd) **************************************************************/ if( new_cmd & ANTIC_LMS ) { - int addr = RDANTIC(); + int addr = RDANTIC(Machine->cpu[0]); antic.doffs = ++antic.doffs & DOFFS; - addr += 256 * RDANTIC(); + addr += 256 * RDANTIC(Machine->cpu[0]); antic.doffs = ++antic.doffs & DOFFS; antic.vpage = addr & VPAGE; antic.voffs = addr & VOFFS; @@ -1287,7 +1288,7 @@ static void antic_scanline_dma(running_machine *machine, int param) UINT8 vscrol_subtract = 0; UINT8 new_cmd; - new_cmd = RDANTIC(); + new_cmd = RDANTIC(machine->cpu[0]); antic.doffs = ++antic.doffs & DOFFS; /* steal at one clock cycle from the CPU for fetching the command */ antic.steal_cycles += 1; @@ -1350,9 +1351,9 @@ static void antic_scanline_dma(running_machine *machine, int param) /* load memory scan bit set ? */ if( new_cmd & ANTIC_LMS ) { - int addr = RDANTIC(); + int addr = RDANTIC(machine->cpu[0]); antic.doffs = ++antic.doffs & DOFFS; - addr += 256 * RDANTIC(); + addr += 256 * RDANTIC(machine->cpu[0]); antic.dpage = addr & DPAGE; antic.doffs = addr & DOFFS; /* produce empty scanlines until vblank start */ @@ -1363,9 +1364,9 @@ static void antic_scanline_dma(running_machine *machine, int param) } else { - int addr = RDANTIC(); + int addr = RDANTIC(machine->cpu[0]); antic.doffs = ++antic.doffs & DOFFS; - addr += 256 * RDANTIC(); + addr += 256 * RDANTIC(machine->cpu[0]); antic.dpage = addr & DPAGE; antic.doffs = addr & DOFFS; /* produce a single empty scanline */ diff --git a/src/mame/video/atarisy2.c b/src/mame/video/atarisy2.c index 841c4ad168f..8a0bb10c0d9 100644 --- a/src/mame/video/atarisy2.c +++ b/src/mame/video/atarisy2.c @@ -254,20 +254,20 @@ WRITE16_HANDLER( atarisy2_paletteram_w ) READ16_HANDLER( atarisy2_slapstic_r ) { int result = atarisy2_slapstic[offset]; - slapstic_tweak(offset); + slapstic_tweak(machine, offset); /* an extra tweak for the next opcode fetch */ - videobank = slapstic_tweak(0x1234) * 0x1000; + videobank = slapstic_tweak(machine, 0x1234) * 0x1000; return result; } WRITE16_HANDLER( atarisy2_slapstic_w ) { - slapstic_tweak(offset); + slapstic_tweak(machine, offset); /* an extra tweak for the next opcode fetch */ - videobank = slapstic_tweak(0x1234) * 0x1000; + videobank = slapstic_tweak(machine, 0x1234) * 0x1000; } diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c index 54bcaa3ba77..14074e502e5 100644 --- a/src/mame/video/battlera.c +++ b/src/mame/video/battlera.c @@ -167,7 +167,7 @@ WRITE8_HANDLER( HuC6270_data_w ) case 16: case 17: case 18: - logerror("%04x: dma 2 %02x\n",activecpu_get_pc(),data); + logerror("%04x: dma 2 %02x\n",cpu_get_pc(machine->activecpu),data); break; case 19: /* SATB */ @@ -229,7 +229,7 @@ WRITE8_HANDLER( HuC6270_data_w ) case 16: case 17: case 18: - logerror("%04x: dma 2 %02x\n",activecpu_get_pc(),data); + logerror("%04x: dma 2 %02x\n",cpu_get_pc(machine->activecpu),data); break; case 19: /* SATB - Sprites */ @@ -238,7 +238,7 @@ WRITE8_HANDLER( HuC6270_data_w ) } break; } - logerror("%04x: unknown write to VDC_register %02x (%02x) at %02x\n",activecpu_get_pc(),VDC_register,data,offset); + logerror("%04x: unknown write to VDC_register %02x (%02x) at %02x\n",cpu_get_pc(machine->activecpu),VDC_register,data,offset); } /******************************************************************************/ diff --git a/src/mame/video/beathead.c b/src/mame/video/beathead.c index a437ebe4627..cbff5f6a96d 100644 --- a/src/mame/video/beathead.c +++ b/src/mame/video/beathead.c @@ -147,7 +147,7 @@ READ32_HANDLER( beathead_hsync_ram_r ) { /* offset 0 is probably write-only */ if (offset == 0) - logerror("%08X:Unexpected HSYNC RAM read at offset 0\n", activecpu_get_previouspc()); + logerror("%08X:Unexpected HSYNC RAM read at offset 0\n", cpu_get_previouspc(machine->activecpu)); /* offset 1 reads the data */ else diff --git a/src/mame/video/btoads.c b/src/mame/video/btoads.c index 115fdf2049a..199115f0f19 100644 --- a/src/mame/video/btoads.c +++ b/src/mame/video/btoads.c @@ -7,6 +7,7 @@ **************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "cpu/tms34010/tms34010.h" #include "video/tlc34076.h" #include "btoads.h" @@ -307,7 +308,7 @@ void btoads_to_shiftreg(UINT32 address, UINT16 *shiftreg) } else - logerror("%08X:btoads_to_shiftreg(%08X)\n", activecpu_get_pc(), address); + logerror("%08X:btoads_to_shiftreg(%08X)\n", cpu_get_pc(Machine->activecpu), address); } @@ -332,7 +333,7 @@ void btoads_from_shiftreg(UINT32 address, UINT16 *shiftreg) render_sprite_row(shiftreg, address); else - logerror("%08X:btoads_from_shiftreg(%08X)\n", activecpu_get_pc(), address); + logerror("%08X:btoads_from_shiftreg(%08X)\n", cpu_get_pc(Machine->activecpu), address); } diff --git a/src/mame/video/bwing.c b/src/mame/video/bwing.c index 27308f9b95f..a4e5ca9d9c1 100644 --- a/src/mame/video/bwing.c +++ b/src/mame/video/bwing.c @@ -117,7 +117,7 @@ WRITE8_HANDLER( bwing_scrollreg_w ) } #if BW_DEBUG - logerror("(%1d)%04x: w=%02x a=%04x f=%d\n",cpu_getactivecpu(),activecpu_get_pc(),data,0x1b00+offset,video_screen_get_frame_number(machine->primary_screen)); + logerror("(%1d)%04x: w=%02x a=%04x f=%d\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),data,0x1b00+offset,video_screen_get_frame_number(machine->primary_screen)); #endif break; } diff --git a/src/mame/video/capbowl.c b/src/mame/video/capbowl.c index f36e806982a..20fcf74c6bc 100644 --- a/src/mame/video/capbowl.c +++ b/src/mame/video/capbowl.c @@ -110,7 +110,7 @@ WRITE8_HANDLER( bowlrama_blitter_w ) break; default: - logerror("PC=%04X Write to unsupported blitter address %02X Data=%02X\n", activecpu_get_pc(), offset, data); + logerror("PC=%04X Write to unsupported blitter address %02X Data=%02X\n", cpu_get_pc(machine->activecpu), offset, data); break; } } @@ -141,7 +141,7 @@ READ8_HANDLER( bowlrama_blitter_r ) break; default: - logerror("PC=%04X Read from unsupported blitter address %02X\n", activecpu_get_pc(), offset); + logerror("PC=%04X Read from unsupported blitter address %02X\n", cpu_get_pc(machine->activecpu), offset); break; } diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c index d4ab44c61d6..49569989cae 100644 --- a/src/mame/video/cinemat.c +++ b/src/mame/video/cinemat.c @@ -98,7 +98,7 @@ WRITE8_HANDLER(cinemat_vector_control_w) /* X register as the intensity */ if (data != last_control && data) { - int xval = cpunum_get_reg(0, CCPU_X) & 0x0f; + int xval = cpu_get_reg(machine->cpu[0], CCPU_X) & 0x0f; i = (xval + 1) * 255 / 16; vector_color = MAKE_RGB(i,i,i); } @@ -109,7 +109,7 @@ WRITE8_HANDLER(cinemat_vector_control_w) /* X register as the intensity */ if (data != last_control && data) { - int xval = cpunum_get_reg(0, CCPU_X); + int xval = cpu_get_reg(machine->cpu[0], CCPU_X); xval = (~xval >> 2) & 0x3f; i = (xval + 1) * 255 / 64; vector_color = MAKE_RGB(i,i,i); @@ -121,7 +121,7 @@ WRITE8_HANDLER(cinemat_vector_control_w) /* as 4-4-4 BGR values */ if (data != last_control && data) { - int xval = cpunum_get_reg(0, CCPU_X); + int xval = cpu_get_reg(machine->cpu[0], CCPU_X); r = (~xval >> 0) & 0x0f; r = r * 255 / 15; g = (~xval >> 4) & 0x0f; @@ -142,15 +142,15 @@ WRITE8_HANDLER(cinemat_vector_control_w) /* on an IV instruction if data == 0 here */ if (data != last_control && !data) { - lastx = cpunum_get_reg(0, CCPU_X); - lasty = cpunum_get_reg(0, CCPU_Y); + lastx = cpu_get_reg(machine->cpu[0], CCPU_X); + lasty = cpu_get_reg(machine->cpu[0], CCPU_Y); } /* on the rising edge of the data value, latch the Y register */ /* as 2-3-3 BGR values */ if (data != last_control && data) { - int yval = cpunum_get_reg(0, CCPU_Y); + int yval = cpu_get_reg(machine->cpu[0], CCPU_Y); r = (~yval >> 0) & 0x07; r = r * 255 / 7; g = (~yval >> 3) & 0x07; @@ -160,8 +160,8 @@ WRITE8_HANDLER(cinemat_vector_control_w) vector_color = MAKE_RGB(r,g,b); /* restore the original X,Y values */ - cpunum_set_reg(0, CCPU_X, lastx); - cpunum_set_reg(0, CCPU_Y, lasty); + cpu_set_reg(machine->cpu[0], CCPU_X, lastx); + cpu_set_reg(machine->cpu[0], CCPU_Y, lasty); } } break; @@ -226,9 +226,9 @@ VIDEO_UPDATE( cinemat ) VIDEO_UPDATE_CALL(vector); vector_clear_list(); - cpuintrf_push_context(0); + cpu_push_context(screen->machine->cpu[0]); ccpu_wdt_timer_trigger(); - cpuintrf_pop_context(); + cpu_pop_context(); return 0; } diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c index 613ce294a6b..ad800ca6f5a 100644 --- a/src/mame/video/cischeat.c +++ b/src/mame/video/cischeat.c @@ -74,13 +74,13 @@ UINT16 *f1gpstr2_ioready; #define SHOW_READ_ERROR(_format_,_offset_)\ {\ popmessage(_format_,_offset_);\ - logerror("CPU #0 PC %06X : Warning, ",activecpu_get_pc()); \ + logerror("CPU #0 PC %06X : Warning, ",cpu_get_pc(machine->activecpu)); \ logerror(_format_ "\n",_offset_);\ } #define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\ {\ popmessage(_format_,_offset_,_data_);\ - logerror("CPU #0 PC %06X : Warning, ",activecpu_get_pc()); \ + logerror("CPU #0 PC %06X : Warning, ",cpu_get_pc(machine->activecpu)); \ logerror(_format_ "\n",_offset_,_data_); \ } @@ -88,12 +88,12 @@ UINT16 *f1gpstr2_ioready; #define SHOW_READ_ERROR(_format_,_offset_)\ {\ - logerror("CPU #0 PC %06X : Warning, ",activecpu_get_pc()); \ + logerror("CPU #0 PC %06X : Warning, ",cpu_get_pc(machine->activecpu)); \ logerror(_format_ "\n",_offset_);\ } #define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\ {\ - logerror("CPU #0 PC %06X : Warning, ",activecpu_get_pc()); \ + logerror("CPU #0 PC %06X : Warning, ",cpu_get_pc(machine->activecpu)); \ logerror(_format_ "\n",_offset_,_data_); \ } diff --git a/src/mame/video/cvs.c b/src/mame/video/cvs.c index 07c302d3094..5ebac8fc05d 100644 --- a/src/mame/video/cvs.c +++ b/src/mame/video/cvs.c @@ -106,7 +106,7 @@ static void set_pens(colortable_t *colortable) WRITE8_HANDLER( cvs_video_fx_w ) { if (data & 0xce) - logerror("%4x : CVS: Unimplemented CVS video fx = %2x\n",activecpu_get_pc(), data & 0xce); + logerror("%4x : CVS: Unimplemented CVS video fx = %2x\n",cpu_get_pc(machine->activecpu), data & 0xce); stars_on = data & 0x01; diff --git a/src/mame/video/dc.c b/src/mame/video/dc.c index dd9b8061122..d82cb8b4144 100644 --- a/src/mame/video/dc.c +++ b/src/mame/video/dc.c @@ -107,7 +107,7 @@ READ64_HANDLER( pvr_ctrl_r ) reg = decode_reg_64(offset, mem_mask, &shift); #if DEBUG_PVRCTRL - mame_printf_verbose("PVRCTRL: [%08x] read %x @ %x (reg %x), mask %llx (PC=%x)\n", 0x5f7c00+reg*4, pvrctrl_regs[reg], offset, reg, mem_mask, activecpu_get_pc()); + mame_printf_verbose("PVRCTRL: [%08x] read %x @ %x (reg %x), mask %llx (PC=%x)\n", 0x5f7c00+reg*4, pvrctrl_regs[reg], offset, reg, mem_mask, cpu_get_pc(machine->activecpu)); #endif return (UINT64)pvrctrl_regs[reg] << shift; @@ -154,7 +154,7 @@ READ64_HANDLER( pvr_ta_r ) #if DEBUG_PVRTA_REGS if (reg != 0x43) - mame_printf_verbose("PVRTA: [%08x] read %x @ %x (reg %x), mask %llx (PC=%x)\n", 0x5f8000+reg*4, pvrta_regs[reg], offset, reg, mem_mask, activecpu_get_pc()); + mame_printf_verbose("PVRTA: [%08x] read %x @ %x (reg %x), mask %llx (PC=%x)\n", 0x5f8000+reg*4, pvrta_regs[reg], offset, reg, mem_mask, cpu_get_pc(machine->activecpu)); #endif return (UINT64)pvrta_regs[reg] << shift; } @@ -448,7 +448,7 @@ WRITE64_HANDLER( ta_fifo_poly_w ) break; } dc_sysctrl_regs[SB_ISTNRM] |= a; - update_interrupt_status(); + dc_update_interrupt_status(machine); state_ta.tafifo_listtype= -1; // no list being received state_ta.listtype_used |= (2+8); } @@ -1025,7 +1025,7 @@ UINT32 a; a=dc_sysctrl_regs[SB_ISTNRM] | IST_VBL_OUT; dc_sysctrl_regs[SB_ISTNRM] = a; // V Blank-out interrupt - update_interrupt_status(); + dc_update_interrupt_status(machine); timer_adjust_oneshot(vbout_timer, attotime_never, 0); } @@ -1078,7 +1078,7 @@ static int useframebuffer=1; state_ta.start_render_received=0; state_ta.renderselect= -1; dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_TSP; // TSP end of render - update_interrupt_status(); + dc_update_interrupt_status(screen->machine); return 0; } else @@ -1088,7 +1088,7 @@ static int useframebuffer=1; void dc_vblank(running_machine *machine) { dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; // V Blank-in interrupt - update_interrupt_status(); + dc_update_interrupt_status(machine); timer_adjust_oneshot(vbout_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0); } diff --git a/src/mame/video/dcheese.c b/src/mame/video/dcheese.c index 683a94f30e7..3087ed1d1f0 100644 --- a/src/mame/video/dcheese.c +++ b/src/mame/video/dcheese.c @@ -222,7 +222,7 @@ static void do_blit(running_machine *machine) if (blitter_xparam[8] != 0 || blitter_xparam[9] != 0 || blitter_xparam[10] != 0 || blitter_xparam[11] != 0 || blitter_yparam[8] != 0 || blitter_yparam[9] != 0 || blitter_yparam[10] != 0 || blitter_yparam[11] != 0) { - logerror("%06X:blit! (%04X)\n", activecpu_get_pc(), blitter_color[0]); + logerror("%06X:blit! (%04X)\n", cpu_get_pc(machine->activecpu), blitter_color[0]); logerror(" %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X\n", blitter_xparam[0], blitter_xparam[1], blitter_xparam[2], blitter_xparam[3], blitter_xparam[4], blitter_xparam[5], blitter_xparam[6], blitter_xparam[7], @@ -300,7 +300,7 @@ WRITE16_HANDLER( madmax_blitter_vidparam_w ) break; default: - logerror("%06X:write to %06X = %04X & %04x\n", activecpu_get_pc(), 0x2a0000 + 2 * offset, data, mem_mask); + logerror("%06X:write to %06X = %04X & %04x\n", cpu_get_pc(machine->activecpu), 0x2a0000 + 2 * offset, data, mem_mask); break; } } @@ -309,7 +309,7 @@ WRITE16_HANDLER( madmax_blitter_vidparam_w ) WRITE16_HANDLER( madmax_blitter_unknown_w ) { /* written to just before the blitter command register is written */ - logerror("%06X:write to %06X = %04X & %04X\n", activecpu_get_pc(), 0x300000 + 2 * offset, data, mem_mask); + logerror("%06X:write to %06X = %04X & %04X\n", cpu_get_pc(machine->activecpu), 0x300000 + 2 * offset, data, mem_mask); } @@ -326,6 +326,6 @@ READ16_HANDLER( madmax_blitter_vidparam_r ) return 0xffff ^ (1 << 5); /* log everything else */ - logerror("%06X:read from %06X\n", activecpu_get_pc(), 0x2a0000 + 2 * offset); + logerror("%06X:read from %06X\n", cpu_get_pc(machine->activecpu), 0x2a0000 + 2 * offset); return 0xffff; } diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c index 715fdd8e2a0..2dc7037abc9 100644 --- a/src/mame/video/dogfgt.c +++ b/src/mame/video/dogfgt.c @@ -175,7 +175,7 @@ WRITE8_HANDLER( dogfgt_1800_w ) flip_screen_set(data & 0x80); /* other bits unused? */ - logerror("PC %04x: 1800 = %02x\n",activecpu_get_pc(),data); + logerror("PC %04x: 1800 = %02x\n",cpu_get_pc(machine->activecpu),data); } diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c index 7d527cb6aad..ce9169b7470 100644 --- a/src/mame/video/dooyong.c +++ b/src/mame/video/dooyong.c @@ -173,7 +173,7 @@ WRITE8_HANDLER( primella_ctrl_w ) /* bit 5 used but unknown */ -// logerror("%04x: bankswitch = %02x\n",activecpu_get_pc(),data&0xe0); +// logerror("%04x: bankswitch = %02x\n",cpu_get_pc(machine->activecpu),data&0xe0); } WRITE8_HANDLER( flytiger_ctrl_w ) diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index c0afe80e155..07d36f9331c 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -245,7 +245,7 @@ WRITE8_HANDLER( dynax_flipscreen_w ) { flipscreen = data & 1; if (data & ~1) - logerror("CPU#0 PC %06X: Warning, flip screen <- %02X\n", activecpu_get_pc(), data); + logerror("CPU#0 PC %06X: Warning, flip screen <- %02X\n", cpu_get_pc(machine->activecpu), data); LOG(("F=%02X ",data)); } diff --git a/src/mame/video/flstory.c b/src/mame/video/flstory.c index fa1e28b804c..34618c188ca 100644 --- a/src/mame/video/flstory.c +++ b/src/mame/video/flstory.c @@ -104,7 +104,7 @@ WRITE8_HANDLER( flstory_gfxctrl_w ) flip_screen_set(flipscreen); -//popmessage("%04x: gfxctrl = %02x\n",activecpu_get_pc(),data); +//popmessage("%04x: gfxctrl = %02x\n",cpu_get_pc(machine->activecpu),data); } @@ -127,7 +127,7 @@ WRITE8_HANDLER( victnine_gfxctrl_w ) flip_screen_set(flipscreen); } -//popmessage("%04x: gfxctrl = %02x\n",activecpu_get_pc(),data); +//popmessage("%04x: gfxctrl = %02x\n",cpu_get_pc(machine->activecpu),data); } diff --git a/src/mame/video/galivan.c b/src/mame/video/galivan.c index 82e30b992a4..e0b1d22436c 100644 --- a/src/mame/video/galivan.c +++ b/src/mame/video/galivan.c @@ -252,7 +252,7 @@ WRITE8_HANDLER( galivan_gfxbank_w ) /* bit 7 selects one of two ROM banks for c000-dfff */ memory_set_bank(1, (data & 0x80) >> 7); -/* logerror("Address: %04X - port 40 = %02x\n",activecpu_get_pc(),data); */ +/* logerror("Address: %04X - port 40 = %02x\n",cpu_get_pc(machine->activecpu),data); */ } WRITE8_HANDLER( ninjemak_gfxbank_w ) @@ -273,7 +273,7 @@ WRITE8_HANDLER( ninjemak_gfxbank_w ) int offs; -logerror("%04x: write %02x to port 80\n",activecpu_get_pc(),data); +logerror("%04x: write %02x to port 80\n",cpu_get_pc(machine->activecpu),data); for (offs = 0; offs < videoram_size; offs++) { diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c index f91edae446e..3b3877751b8 100644 --- a/src/mame/video/galpani2.c +++ b/src/mame/video/galpani2.c @@ -38,7 +38,7 @@ READ16_HANDLER( galpani2_bg8_regs_##_n_##_r ) \ { \ case 0x16: return mame_rand(machine) & 1; \ default: \ - logerror("CPU #0 PC %06X : Warning, bg8 #%d screen reg %04X read\n",activecpu_get_pc(),_n_,offset*2); \ + logerror("CPU #0 PC %06X : Warning, bg8 #%d screen reg %04X read\n",cpu_get_pc(machine->activecpu),_n_,offset*2); \ } \ return galpani2_bg8_regs_##_n_[offset]; \ } @@ -151,7 +151,7 @@ VIDEO_UPDATE( galpani2 ) { int layers_ctrl = -1; - galpani2_mcu_run(); + galpani2_mcu_run(screen->machine); #ifdef MAME_DEBUG if (input_code_pressed(KEYCODE_Z)) diff --git a/src/mame/video/genesis.c b/src/mame/video/genesis.c index b3513583fd4..f610eeff9b2 100644 --- a/src/mame/video/genesis.c +++ b/src/mame/video/genesis.c @@ -48,7 +48,7 @@ static const device_config *genesis_screen; Function Prototypes ******************************************************************************/ -static int vdp_data_r(void); +static int vdp_data_r(running_machine *machine); static void vdp_data_w(running_machine *machine, int data); static int vdp_control_r(running_machine *machine); static void vdp_control_w(running_machine *machine, int data); @@ -335,7 +335,7 @@ READ16_HANDLER( genesis_vdp_r ) { case 0x00: /* Read Data */ case 0x01: - return vdp_data_r(); + return vdp_data_r(machine); case 0x02: /* Status Register */ case 0x03: @@ -418,7 +418,7 @@ WRITE16_HANDLER( genesis_vdp_w ) ******************************************************************************/ /* Games needing Read to Work .. bloxeed (attract) .. puyo puyo .. probably more */ -static int vdp_data_r(void) +static int vdp_data_r(running_machine *machine) { int read = 0; @@ -437,7 +437,7 @@ static int vdp_data_r(void) break; default: /* Illegal read attempt */ - logerror("%06x: VDP illegal read type %02x\n", activecpu_get_previouspc(), vdp_code); + logerror("%06x: VDP illegal read type %02x\n", cpu_get_previouspc(machine->activecpu), vdp_code); read = 0x00; break; } @@ -498,7 +498,7 @@ static void vdp_data_w(running_machine *machine, int data) break; default: /* Illegal write attempt */ - logerror("PC:%06x: VDP illegal write type %02x data %04x\n", activecpu_get_previouspc(), vdp_code, data); + logerror("PC:%06x: VDP illegal write type %02x data %04x\n", cpu_get_previouspc(machine->activecpu), vdp_code, data); break; } diff --git a/src/mame/video/ginganin.c b/src/mame/video/ginganin.c index 9291a9a384a..fbb09823458 100644 --- a/src/mame/video/ginganin.c +++ b/src/mame/video/ginganin.c @@ -185,7 +185,7 @@ WRITE16_HANDLER( ginganin_vregs16_w ) cpunum_set_input_line(machine, 1, INPUT_LINE_NMI, PULSE_LINE); break; default: - logerror("CPU #0 PC %06X : Warning, videoreg %04X <- %04X\n",activecpu_get_pc(),offset,data); + logerror("CPU #0 PC %06X : Warning, videoreg %04X <- %04X\n",cpu_get_pc(machine->activecpu),offset,data); } } diff --git a/src/mame/video/gtia.c b/src/mame/video/gtia.c index 88113dfbe4f..a9d7c647524 100644 --- a/src/mame/video/gtia.c +++ b/src/mame/video/gtia.c @@ -9,6 +9,7 @@ ***************************************************************************/ #include "driver.h" +#include "deprecat.h" #include "cpu/m6502/m6502.h" #include "includes/atari.h" #include "video/gtia.h" @@ -1068,19 +1069,19 @@ void gtia_render(VIDEO *video) void gtia_mode_1_32(VIDEO *video) { - PREPARE_GFXG1(32); + PREPARE_GFXG1(Machine->cpu[0], 32); REP32(GTIA1); POST_GFX(32); } void gtia_mode_1_40(VIDEO *video) { - PREPARE_GFXG1(40); + PREPARE_GFXG1(Machine->cpu[0], 40); REP40(GTIA1); POST_GFX(40); } void gtia_mode_1_48(VIDEO *video) { - PREPARE_GFXG1(48); + PREPARE_GFXG1(Machine->cpu[0], 48); REP48(GTIA1); POST_GFX(48); } @@ -1092,19 +1093,19 @@ void gtia_mode_1_48(VIDEO *video) void gtia_mode_2_32(VIDEO *video) { - PREPARE_GFXG2(32); + PREPARE_GFXG2(Machine->cpu[0], 32); REP32(GTIA2); POST_GFX(32); } void gtia_mode_2_40(VIDEO *video) { - PREPARE_GFXG2(40); + PREPARE_GFXG2(Machine->cpu[0], 40); REP40(GTIA2); POST_GFX(40); } void gtia_mode_2_48(VIDEO *video) { - PREPARE_GFXG2(48); + PREPARE_GFXG2(Machine->cpu[0], 48); REP48(GTIA2); POST_GFX(48); } @@ -1116,19 +1117,19 @@ void gtia_mode_2_48(VIDEO *video) void gtia_mode_3_32(VIDEO *video) { - PREPARE_GFXG3(32); + PREPARE_GFXG3(Machine->cpu[0], 32); REP32(GTIA3); POST_GFX(32); } void gtia_mode_3_40(VIDEO *video) { - PREPARE_GFXG3(40); + PREPARE_GFXG3(Machine->cpu[0], 40); REP40(GTIA3); POST_GFX(40); } void gtia_mode_3_48(VIDEO *video) { - PREPARE_GFXG3(48); + PREPARE_GFXG3(Machine->cpu[0], 48); REP48(GTIA3); POST_GFX(48); } diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c index 02c06688da5..be2289bdcbd 100644 --- a/src/mame/video/gticlub.c +++ b/src/mame/video/gticlub.c @@ -317,24 +317,24 @@ READ32_HANDLER( K001005_r ) if (K001005_fifo_read_ptr < 0x3ff) { //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE); - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_set_flag_input(1, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } else { //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } } else { //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } K001005_fifo_read_ptr++; @@ -359,7 +359,7 @@ READ32_HANDLER( K001005_r ) } default: - mame_printf_debug("K001005_r: %08X, %08X at %08X\n", offset, mem_mask, activecpu_get_pc()); + mame_printf_debug("K001005_r: %08X, %08X at %08X\n", offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } return 0; @@ -376,27 +376,27 @@ WRITE32_HANDLER( K001005_w ) if (K001005_fifo_write_ptr < 0x400) { //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } else { //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, CLEAR_LINE); - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_set_flag_input(1, CLEAR_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } } else { //cpunum_set_input_line(machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); - cpuintrf_push_context(2); + cpu_push_context(machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); } - // mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, activecpu_get_pc()); + // mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, cpu_get_pc(machine->activecpu)); K001005_fifo[K001005_fifo_write_ptr] = data; K001005_fifo_write_ptr++; K001005_fifo_write_ptr &= 0x7ff; @@ -404,13 +404,13 @@ WRITE32_HANDLER( K001005_w ) K001005_3d_fifo[K001005_3d_fifo_ptr++] = data; // !!! HACK to get past the FIFO B test (GTI Club & Thunder Hurricane) !!! - if (activecpu_get_pc() == 0x201ee) + if (cpu_get_pc(machine->activecpu) == 0x201ee) { // This is used to make the SHARC timeout cpu_spinuntil_trigger(10000); } // !!! HACK to get past the FIFO B test (Winding Heat & Midnight Run) !!! - if (activecpu_get_pc() == 0x201e6) + if (cpu_get_pc(machine->activecpu) == 0x201e6) { // This is used to make the SHARC timeout cpu_spinuntil_trigger(10000); @@ -460,7 +460,7 @@ WRITE32_HANDLER( K001005_w ) break; default: - //mame_printf_debug("K001005_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, activecpu_get_pc()); + //mame_printf_debug("K001005_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu)); break; } @@ -1059,9 +1059,9 @@ VIDEO_UPDATE( gticlub ) draw_7segment_led(bitmap, 9, 3, gticlub_led_reg1); //cpunum_set_input_line(screen->machine, 2, SHARC_INPUT_FLAG1, ASSERT_LINE); - cpuintrf_push_context(2); + cpu_push_context(screen->machine->cpu[2]); sharc_set_flag_input(1, ASSERT_LINE); - cpuintrf_pop_context(); + cpu_pop_context(); return 0; } diff --git a/src/mame/video/hd63484.c b/src/mame/video/hd63484.c index 12694e34ac6..4875ff622bb 100644 --- a/src/mame/video/hd63484.c +++ b/src/mame/video/hd63484.c @@ -951,7 +951,7 @@ static void paint(int sx, int sy, int col) } } -static void HD63484_command_w(UINT16 cmd) +static void HD63484_command_w(running_machine *machine, UINT16 cmd) { int len; @@ -973,7 +973,7 @@ static void HD63484_command_w(UINT16 cmd) { int i; - logerror("PC %05x: HD63484 command %s (%04x) ",activecpu_get_pc(),instruction_name[fifo[0]>>10],fifo[0]); + logerror("PC %05x: HD63484 command %s (%04x) ",cpu_get_pc(machine->activecpu),instruction_name[fifo[0]>>10],fifo[0]); for (i = 1;i < fifo_counter;i++) logerror("%04x ",fifo[i]); logerror("\n"); @@ -1341,7 +1341,7 @@ static int regno; READ16_HANDLER( HD63484_status_r ) { - if (activecpu_get_pc() != 0xfced6 && activecpu_get_pc() != 0xfe1d6) logerror("%05x: HD63484 status read\n",activecpu_get_pc()); + if (cpu_get_pc(machine->activecpu) != 0xfced6 && cpu_get_pc(machine->activecpu) != 0xfe1d6) logerror("%05x: HD63484 status read\n",cpu_get_pc(machine->activecpu)); return 0xff22|(mame_rand(machine) & 0x0004); /* write FIFO ready + command end + (read FIFO ready or read FIFO not ready) */ } @@ -1356,9 +1356,9 @@ WRITE16_HANDLER( HD63484_data_w ) { COMBINE_DATA(&HD63484_reg[regno/2]); if (regno & 0x80) regno += 2; /* autoincrement */ -logerror("PC %05x: HD63484 register %02x write %04x\n",activecpu_get_pc(),regno,HD63484_reg[regno/2]); +logerror("PC %05x: HD63484 register %02x write %04x\n",cpu_get_pc(machine->activecpu),regno,HD63484_reg[regno/2]); if (regno == 0) /* FIFO */ - HD63484_command_w(HD63484_reg[0]); + HD63484_command_w(machine, HD63484_reg[0]); } READ16_HANDLER( HD63484_data_r ) @@ -1369,12 +1369,12 @@ READ16_HANDLER( HD63484_data_r ) res = video_screen_get_vpos(machine->primary_screen); else if (regno == 0) { -logerror("%05x: HD63484 read FIFO\n",activecpu_get_pc()); +logerror("%05x: HD63484 read FIFO\n",cpu_get_pc(machine->activecpu)); res = readfifo; } else { -logerror("%05x: HD63484 read register %02x\n",activecpu_get_pc(),regno); +logerror("%05x: HD63484 read register %02x\n",cpu_get_pc(machine->activecpu),regno); res = 0; } diff --git a/src/mame/video/hexion.c b/src/mame/video/hexion.c index 3866be2d1ba..a9faa5f6b45 100644 --- a/src/mame/video/hexion.c +++ b/src/mame/video/hexion.c @@ -84,7 +84,7 @@ WRITE8_HANDLER( hexion_bankswitch_w ) if (data & 0x30) popmessage("bankswitch %02x",data&0xf0); -//logerror("%04x: bankswitch_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: bankswitch_w %02x\n",cpu_get_pc(machine->activecpu),data); } READ8_HANDLER( hexion_bankedram_r ) @@ -103,7 +103,7 @@ READ8_HANDLER( hexion_bankedram_r ) } else { -//logerror("%04x: bankedram_r offset %04x, bankctrl = %02x\n",activecpu_get_pc(),offset,bankctrl); +//logerror("%04x: bankedram_r offset %04x, bankctrl = %02x\n",cpu_get_pc(machine->activecpu),offset,bankctrl); return 0; } } @@ -112,43 +112,43 @@ WRITE8_HANDLER( hexion_bankedram_w ) { if (bankctrl == 3 && offset == 0 && (data & 0xfe) == 0) { -//logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",activecpu_get_pc(),offset,data,bankctrl); +//logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",cpu_get_pc(machine->activecpu),offset,data,bankctrl); rambank = data & 1; } else if (bankctrl == 0) { if (pmcbank) { -//logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",activecpu_get_pc(),offset,data,bankctrl); +//logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",cpu_get_pc(machine->activecpu),offset,data,bankctrl); vram[rambank][offset] = data; tilemap_mark_tile_dirty(bg_tilemap[rambank],offset/4); } else - logerror("%04x pmc internal ram %04x = %02x\n",activecpu_get_pc(),offset,data); + logerror("%04x pmc internal ram %04x = %02x\n",cpu_get_pc(machine->activecpu),offset,data); } else if (bankctrl == 2 && offset < 0x800) { if (pmcbank) { -//logerror("%04x: unkram_w offset %04x, data %02x, bankctrl = %02x\n",activecpu_get_pc(),offset,data,bankctrl); +//logerror("%04x: unkram_w offset %04x, data %02x, bankctrl = %02x\n",cpu_get_pc(machine->activecpu),offset,data,bankctrl); unkram[offset] = data; } else - logerror("%04x pmc internal ram %04x = %02x\n",activecpu_get_pc(),offset,data); + logerror("%04x pmc internal ram %04x = %02x\n",cpu_get_pc(machine->activecpu),offset,data); } else -logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",activecpu_get_pc(),offset,data,bankctrl); +logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",cpu_get_pc(machine->activecpu),offset,data,bankctrl); } WRITE8_HANDLER( hexion_bankctrl_w ) { -//logerror("%04x: bankctrl_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: bankctrl_w %02x\n",cpu_get_pc(machine->activecpu),data); bankctrl = data; } WRITE8_HANDLER( hexion_gfxrom_select_w ) { -//logerror("%04x: gfxrom_select_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: gfxrom_select_w %02x\n",cpu_get_pc(machine->activecpu),data); gfxrom_select = data; } diff --git a/src/mame/video/homedata.c b/src/mame/video/homedata.c index 1e7b7e67d8d..41ac733cf7f 100644 --- a/src/mame/video/homedata.c +++ b/src/mame/video/homedata.c @@ -583,7 +583,7 @@ WRITE8_HANDLER( pteacher_videoram_w ) WRITE8_HANDLER( reikaids_gfx_bank_w ) { -//logerror( "%04x: [setbank %02x]\n",activecpu_get_pc(),data); +//logerror( "%04x: [setbank %02x]\n",cpu_get_pc(machine->activecpu),data); if (reikaids_gfx_bank[reikaids_which] != data) { @@ -596,7 +596,7 @@ WRITE8_HANDLER( reikaids_gfx_bank_w ) WRITE8_HANDLER( pteacher_gfx_bank_w ) { -// logerror( "%04x: gfxbank:=%02x\n", activecpu_get_pc(), data ); +// logerror( "%04x: gfxbank:=%02x\n", cpu_get_pc(machine->activecpu), data ); if (pteacher_gfx_bank != data) { pteacher_gfx_bank = data; @@ -606,7 +606,7 @@ WRITE8_HANDLER( pteacher_gfx_bank_w ) WRITE8_HANDLER( homedata_blitter_param_w ) { -//logerror("%04x: blitter_param_w %02x\n",activecpu_get_pc(),data); +//logerror("%04x: blitter_param_w %02x\n",cpu_get_pc(machine->activecpu),data); blitter_param[blitter_param_count] = data; blitter_param_count++; blitter_param_count&=3; diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c index 6cb4f1d115e..bb3233b2cee 100644 --- a/src/mame/video/itech8.c +++ b/src/mame/video/itech8.c @@ -230,7 +230,7 @@ WRITE8_HANDLER( itech8_palette_w ) WRITE8_HANDLER( itech8_page_w ) { video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen)); - logerror("%04x:display_page = %02X (%d)\n", activecpu_get_pc(), data, video_screen_get_vpos(machine->primary_screen)); + logerror("%04x:display_page = %02X (%d)\n", cpu_get_pc(machine->activecpu), data, video_screen_get_vpos(machine->primary_screen)); page_select = data; } @@ -467,7 +467,7 @@ READ8_HANDLER( itech8_blitter_r ) static const char *const portnames[] = { "AN_C", "AN_D", "AN_E", "AN_F" }; /* debugging */ - if (FULL_LOGGING) logerror("%04x:blitter_r(%02x)\n", activecpu_get_previouspc(), offset / 2); + if (FULL_LOGGING) logerror("%04x:blitter_r(%02x)\n", cpu_get_previouspc(machine->activecpu), offset / 2); /* low bit seems to be ignored */ offset /= 2; @@ -527,7 +527,7 @@ WRITE8_HANDLER( itech8_blitter_w ) } /* debugging */ - if (FULL_LOGGING) logerror("%04x:blitter_w(%02x)=%02x\n", activecpu_get_previouspc(), offset, data); + if (FULL_LOGGING) logerror("%04x:blitter_w(%02x)=%02x\n", cpu_get_previouspc(machine->activecpu), offset, data); } diff --git a/src/mame/video/jagblit.c b/src/mame/video/jagblit.c index d1d15bb7f26..3c91e43f70d 100644 --- a/src/mame/video/jagblit.c +++ b/src/mame/video/jagblit.c @@ -195,7 +195,7 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags) { if (LOG_BAD_BLITS) { - logerror("%08X:Blit!\n", activecpu_get_previouspc()); + logerror("%08X:Blit!\n", cpu_get_previouspc(Machine->activecpu)); logerror(" a1_base = %08X\n", a1_base); logerror(" a2_base = %08X\n", a2_base); } @@ -275,7 +275,7 @@ static void FUNCNAME(UINT32 command, UINT32 a1flags, UINT32 a2flags) if (LOG_BLITS) { - logerror("%08X:Blit!\n", activecpu_get_previouspc()); + logerror("%08X:Blit!\n", cpu_get_previouspc(Machine->activecpu)); logerror(" a1_base = %08X\n", a1_base); logerror(" a1_pitch = %d\n", a1_pitch); logerror(" a1_psize = %d\n", 1 << ((A1FIXED >> 3) & 7)); diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c index 12cd3c1c84e..38e046e38b7 100644 --- a/src/mame/video/jaguar.c +++ b/src/mame/video/jaguar.c @@ -598,7 +598,7 @@ READ32_HANDLER( jaguar_blitter_r ) return 0x00000001; default: - logerror("%08X:Blitter read register @ F022%02X\n", activecpu_get_previouspc(), offset * 4); + logerror("%08X:Blitter read register @ F022%02X\n", cpu_get_previouspc(machine->activecpu), offset * 4); return 0; } } @@ -611,7 +611,7 @@ WRITE32_HANDLER( jaguar_blitter_w ) blitter_run(); if (LOG_BLITTER_WRITE) - logerror("%08X:Blitter write register @ F022%02X = %08X\n", activecpu_get_previouspc(), offset * 4, data); + logerror("%08X:Blitter write register @ F022%02X = %08X\n", cpu_get_previouspc(machine->activecpu), offset * 4, data); } @@ -625,7 +625,7 @@ WRITE32_HANDLER( jaguar_blitter_w ) READ16_HANDLER( jaguar_tom_regs_r ) { if (offset != INT1 && offset != INT2 && offset != HC && offset != VC) - logerror("%08X:TOM read register @ F00%03X\n", activecpu_get_previouspc(), offset * 2); + logerror("%08X:TOM read register @ F00%03X\n", cpu_get_previouspc(machine->activecpu), offset * 2); switch (offset) { @@ -696,7 +696,7 @@ WRITE16_HANDLER( jaguar_tom_regs_w ) } if (offset != INT2 && offset != VI) - logerror("%08X:TOM write register @ F00%03X = %04X\n", activecpu_get_previouspc(), offset * 2, data); + logerror("%08X:TOM write register @ F00%03X = %04X\n", cpu_get_previouspc(machine->activecpu), offset * 2, data); } diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c index aa9c2418d12..500458e2dde 100644 --- a/src/mame/video/kaneko16.c +++ b/src/mame/video/kaneko16.c @@ -736,7 +736,7 @@ WRITE16_HANDLER( kaneko16_sprites_regs_w ) break; } -// logerror("CPU #0 PC %06X : Warning, sprites reg %04X <- %04X\n",activecpu_get_pc(),offset*2,data); +// logerror("CPU #0 PC %06X : Warning, sprites reg %04X <- %04X\n",cpu_get_pc(machine->activecpu),offset*2,data); } diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c index 23c7bd76bfe..16f4f72ee33 100644 --- a/src/mame/video/konamiic.c +++ b/src/mame/video/konamiic.c @@ -2100,7 +2100,7 @@ READ8_HANDLER( K052109_r ) else if (offset >= 0x3a00 && offset < 0x3c00) { /* B x scroll */ } // else -//logerror("%04x: read from unknown 052109 address %04x\n",activecpu_get_pc(),offset); +//logerror("%04x: read from unknown 052109 address %04x\n",cpu_get_pc(machine->activecpu),offset); } return K052109_ram[offset]; @@ -2123,7 +2123,7 @@ else addr = (code << 5) + (offset & 0x1f); addr &= memory_region_length(machine, K052109_memory_region)-1; -// logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n",activecpu_get_pc(),offset,K052109_romsubbank,bank,addr); +// logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n",cpu_get_pc(machine->activecpu),offset,K052109_romsubbank,bank,addr); return memory_region(machine, K052109_memory_region)[addr]; } @@ -2150,13 +2150,13 @@ WRITE8_HANDLER( K052109_w ) if (K052109_scrollctrl != data) { //popmessage("scrollcontrol = %02x",data); -//logerror("%04x: rowscrollcontrol = %02x\n",activecpu_get_pc(),data); +//logerror("%04x: rowscrollcontrol = %02x\n",cpu_get_pc(machine->activecpu),data); K052109_scrollctrl = data; } } else if (offset == 0x1d00) { -//logerror("%04x: 052109 register 1d00 = %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 052109 register 1d00 = %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 2 = irq enable */ /* the custom chip can also generate NMI and FIRQ, for use with a 6809 */ K052109_irq_enabled = data & 0x04; @@ -2186,12 +2186,12 @@ WRITE8_HANDLER( K052109_w ) } else if (offset == 0x1e00 || offset == 0x3e00) // Surprise Attack uses offset 0x3e00 { -//logerror("%04x: 052109 register 1e00 = %02x\n",activecpu_get_pc(),data); +//logerror("%04x: 052109 register 1e00 = %02x\n",cpu_get_pc(machine->activecpu),data); K052109_romsubbank = data; } else if (offset == 0x1e80) { -//if ((data & 0xfe)) logerror("%04x: 052109 register 1e80 = %02x\n",activecpu_get_pc(),data); +//if ((data & 0xfe)) logerror("%04x: 052109 register 1e80 = %02x\n",cpu_get_pc(machine->activecpu),data); tilemap_set_flip(K052109_tilemap[0],(data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); tilemap_set_flip(K052109_tilemap[1],(data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); tilemap_set_flip(K052109_tilemap[2],(data & 1) ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); @@ -2242,7 +2242,7 @@ WRITE8_HANDLER( K052109_w ) K052109_charrombank_2[3] = (data >> 4) & 0x0f; } // else -// logerror("%04x: write %02x to unknown 052109 address %04x\n",activecpu_get_pc(),data,offset); +// logerror("%04x: write %02x to unknown 052109 address %04x\n",cpu_get_pc(machine->activecpu),data,offset); } } @@ -2590,7 +2590,7 @@ static int K051960_fetchromdata(running_machine *machine, int byte) addr = (code << 7) | (off1 << 2) | byte; addr &= memory_region_length(machine, K051960_memory_region)-1; -// popmessage("%04x: addr %06x",activecpu_get_pc(),addr); +// popmessage("%04x: addr %06x",cpu_get_pc(machine->activecpu),addr); return memory_region(machine, K051960_memory_region)[addr]; } @@ -2640,7 +2640,7 @@ READ8_HANDLER( K051937_r ) /* some games need bit 0 to pulse */ return (counter++) & 1; } -//logerror("%04x: read unknown 051937 address %x\n",activecpu_get_pc(),offset); +//logerror("%04x: read unknown 051937 address %x\n",cpu_get_pc(machine->activecpu),offset); return 0; } } @@ -2667,12 +2667,12 @@ WRITE8_HANDLER( K051937_w ) /* bit 5 = enable gfx ROM reading */ K051960_readroms = data & 0x20; -//logerror("%04x: write %02x to 051937 address %x\n",activecpu_get_pc(),data,offset); +//logerror("%04x: write %02x to 051937 address %x\n",cpu_get_pc(machine->activecpu),data,offset); } else if (offset == 1) { -// popmessage("%04x: write %02x to 051937 address %x",activecpu_get_pc(),data,offset); -//logerror("%04x: write %02x to unknown 051937 address %x\n",activecpu_get_pc(),data,offset); +// popmessage("%04x: write %02x to 051937 address %x",cpu_get_pc(machine->activecpu),data,offset); +//logerror("%04x: write %02x to unknown 051937 address %x\n",cpu_get_pc(machine->activecpu),data,offset); } else if (offset >= 2 && offset < 5) { @@ -2680,8 +2680,8 @@ WRITE8_HANDLER( K051937_w ) } else { -// popmessage("%04x: write %02x to 051937 address %x",activecpu_get_pc(),data,offset); -//logerror("%04x: write %02x to unknown 051937 address %x\n",activecpu_get_pc(),data,offset); +// popmessage("%04x: write %02x to 051937 address %x",cpu_get_pc(machine->activecpu),data,offset); +//logerror("%04x: write %02x to unknown 051937 address %x\n",cpu_get_pc(machine->activecpu),data,offset); } } @@ -3136,7 +3136,7 @@ static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset) | ((offset & 3) ^ 1); addr &= memory_region_length(machine, K053245_memory_region[chip])-1; -// popmessage("%04x: offset %02x addr %06x",activecpu_get_pc(),offset&3,addr); +// popmessage("%04x: offset %02x addr %06x",cpu_get_pc(machine->activecpu),offset&3,addr); return memory_region(machine, K053245_memory_region[chip])[addr]; } @@ -3147,7 +3147,7 @@ static UINT8 K053244_chip_r (running_machine *machine, int chip, int offset) } else { -//logerror("%04x: read from unknown 053244 address %x\n",activecpu_get_pc(),offset); +//logerror("%04x: read from unknown 053244 address %x\n",cpu_get_pc(machine->activecpu),offset); return 0; } } @@ -3167,7 +3167,7 @@ static void K053244_chip_w(int chip, int offset, int data) // popmessage("053244 reg 05 = %02x",data); /* bit 2 = unknown, Parodius uses it */ /* bit 5 = unknown, Rollergames uses it */ -// logerror("%04x: write %02x to 053244 address 5\n",activecpu_get_pc(),data); +// logerror("%04x: write %02x to 053244 address 5\n",cpu_get_pc(machine->activecpu),data); break; } case 0x06: @@ -4097,7 +4097,7 @@ READ16_HANDLER( K055673_GX6bpp_rom_word_r ) return ROM[romofs+2]; break; default: - LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, activecpu_get_pc())); + LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, cpu_get_pc(machine->activecpu))); break; } @@ -4113,12 +4113,12 @@ READ8_HANDLER( K053246_r ) addr = (K053246_regs[6] << 17) | (K053246_regs[7] << 9) | (K053246_regs[4] << 1) | ((offset & 1) ^ 1); addr &= memory_region_length(machine, K053247_memory_region)-1; if (VERBOSE) - popmessage("%04x: offset %02x addr %06x",activecpu_get_pc(),offset,addr); + popmessage("%04x: offset %02x addr %06x",cpu_get_pc(machine->activecpu),offset,addr); return memory_region(machine, K053247_memory_region)[addr]; } else { - LOG(("%04x: read from unknown 053246 address %x\n",activecpu_get_pc(),offset)); + LOG(("%04x: read from unknown 053246 address %x\n",cpu_get_pc(machine->activecpu),offset)); return 0; } } @@ -4799,13 +4799,13 @@ static int K051316_rom_r(running_machine *machine, int chip, int offset) if (K051316_bpp[chip] <= 4) addr /= 2; addr &= memory_region_length(machine, K051316_memory_region[chip])-1; -// popmessage("%04x: offset %04x addr %04x",activecpu_get_pc(),offset,addr); +// popmessage("%04x: offset %04x addr %04x",cpu_get_pc(machine->activecpu),offset,addr); return memory_region(machine, K051316_memory_region[chip])[addr]; } else { -//logerror("%04x: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n",activecpu_get_pc(),offset); +//logerror("%04x: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n",cpu_get_pc(machine->activecpu),offset); return 0; } } @@ -4830,7 +4830,7 @@ READ8_HANDLER( K051316_rom_2_r ) static void K051316_ctrl_w(int chip,int offset,int data) { K051316_ctrlram[chip][offset] = data; -//if (offset >= 0x0c) logerror("%04x: write %02x to 051316 reg %x\n",activecpu_get_pc(),data,offset); +//if (offset >= 0x0c) logerror("%04x: write %02x to 051316 reg %x\n",cpu_get_pc(machine->activecpu),data,offset); } WRITE8_HANDLER( K051316_ctrl_0_w ) @@ -5189,7 +5189,7 @@ static UINT8 K054000_ram[0x20]; WRITE8_HANDLER( K054000_w ) { -//logerror("%04x: write %02x to 054000 address %02x\n",activecpu_get_pc(),data,offset); +//logerror("%04x: write %02x to 054000 address %02x\n",cpu_get_pc(machine->activecpu),data,offset); K054000_ram[offset] = data; } @@ -5199,7 +5199,7 @@ READ8_HANDLER( K054000_r ) int Acx,Acy,Aax,Aay; int Bcx,Bcy,Bax,Bay; -//logerror("%04x: read 054000 address %02x\n",activecpu_get_pc(),offset); +//logerror("%04x: read 054000 address %02x\n",cpu_get_pc(machine->activecpu),offset); if (offset != 0x18) return 0; @@ -5254,7 +5254,7 @@ static UINT8 K051733_ram[0x20]; WRITE8_HANDLER( K051733_w ) { -//logerror("%04x: write %02x to 051733 address %02x\n",activecpu_get_pc(),data,offset); +//logerror("%04x: write %02x to 051733 address %02x\n",cpu_get_pc(machine->activecpu),data,offset); K051733_ram[offset] = data; } @@ -5288,7 +5288,7 @@ READ8_HANDLER( K051733_r ) int yobj2c = (K051733_ram[0x0c] << 8) | K051733_ram[0x0d]; int xobj2c = (K051733_ram[0x0e] << 8) | K051733_ram[0x0f]; -//logerror("%04x: read 051733 address %02x\n",activecpu_get_pc(),offset); +//logerror("%04x: read 051733 address %02x\n",cpu_get_pc(machine->activecpu),offset); switch(offset){ case 0x00: @@ -5893,7 +5893,7 @@ READ16_HANDLER( K056832_5bpp_rom_word_r ) } else { - LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask)); + LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", cpu_get_pc(machine->activecpu), mem_mask)); } return 0; } @@ -5918,7 +5918,7 @@ READ32_HANDLER( K056832_5bpp_rom_long_r ) } else { - LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask)); + LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", cpu_get_pc(machine->activecpu), mem_mask)); } return 0; } @@ -5943,7 +5943,7 @@ READ32_HANDLER( K056832_6bpp_rom_long_r ) } else { - LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", activecpu_get_pc(), mem_mask)); + LOG(("Non-byte read of tilemap ROM, PC=%x (mask=%x)\n", cpu_get_pc(machine->activecpu), mem_mask)); } return 0; } diff --git a/src/mame/video/ladybug.c b/src/mame/video/ladybug.c index 7d179c4d41c..5d3accf95be 100644 --- a/src/mame/video/ladybug.c +++ b/src/mame/video/ladybug.c @@ -234,7 +234,7 @@ WRITE8_HANDLER( sraider_misc_w ) sraider_0x38 = data&0x3f; break; default: - mame_printf_debug("(%04X) write to %02X\n",activecpu_get_pc(),offset); + mame_printf_debug("(%04X) write to %02X\n",cpu_get_pc(machine->activecpu),offset); break; } } diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c index 1f6f12677e9..e9a1ba1528b 100644 --- a/src/mame/video/leland.c +++ b/src/mame/video/leland.c @@ -182,7 +182,7 @@ static void leland_video_addr_w(int offset, int data, int num) * *************************************/ -static int leland_vram_port_r(int offset, int num) +static int leland_vram_port_r(running_machine *machine, int offset, int num) { struct vram_state_data *state = vram_state + num; int addr = state->addr; @@ -209,14 +209,14 @@ static int leland_vram_port_r(int offset, int num) default: logerror("CPU #%d %04x Warning: Unknown video port %02x read (address=%04x)\n", - cpu_getactivecpu(),activecpu_get_pc(), offset, addr); + cpunum_get_active(),cpu_get_pc(machine->activecpu), offset, addr); ret = 0; break; } state->addr = addr; if (LOG_COMM && addr >= 0xf000) - logerror("%04X:%s comm read %04X = %02X\n", activecpu_get_previouspc(), num ? "slave" : "master", addr, ret); + logerror("%04X:%s comm read %04X = %02X\n", cpu_get_previouspc(machine->activecpu), num ? "slave" : "master", addr, ret); return ret; } @@ -243,7 +243,7 @@ static void leland_vram_port_w(running_machine *machine, int offset, int data, i video_screen_update_partial(machine->primary_screen, scanline - 1); if (LOG_COMM && addr >= 0xf000) - logerror("%04X:%s comm write %04X = %02X\n", activecpu_get_previouspc(), num ? "slave" : "master", addr, data); + logerror("%04X:%s comm write %04X = %02X\n", cpu_get_previouspc(machine->activecpu), num ? "slave" : "master", addr, data); /* based on the low 3 bits of the offset, update the destination */ switch (offset & 7) @@ -295,7 +295,7 @@ static void leland_vram_port_w(running_machine *machine, int offset, int data, i default: logerror("CPU #%d %04x Warning: Unknown video port write (address=%04x value=%02x)\n", - cpu_getactivecpu(),activecpu_get_pc(), offset, addr); + cpunum_get_active(),cpu_get_pc(machine->activecpu), offset, addr); break; } @@ -334,7 +334,7 @@ WRITE8_HANDLER( leland_mvram_port_w ) READ8_HANDLER( leland_mvram_port_r ) { - return leland_vram_port_r(offset, 0); + return leland_vram_port_r(machine, offset, 0); } @@ -359,7 +359,7 @@ WRITE8_HANDLER( leland_svram_port_w ) READ8_HANDLER( leland_svram_port_r ) { - return leland_vram_port_r(offset, 1); + return leland_vram_port_r(machine, offset, 1); } @@ -394,14 +394,14 @@ WRITE8_HANDLER( ataxx_svram_port_w ) READ8_HANDLER( ataxx_mvram_port_r ) { offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); - return leland_vram_port_r(offset, 0); + return leland_vram_port_r(machine, offset, 0); } READ8_HANDLER( ataxx_svram_port_r ) { offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); - return leland_vram_port_r(offset, 1); + return leland_vram_port_r(machine, offset, 1); } diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c index 0ab12fb80cf..9c62dfd25ef 100644 --- a/src/mame/video/lethalj.c +++ b/src/mame/video/lethalj.c @@ -76,7 +76,7 @@ READ16_HANDLER( lethalj_gun_r ) result = guny + 4; break; } -/* logerror("%08X:lethalj_gun_r(%d) = %04X\n", activecpu_get_pc(), offset, result); */ +/* logerror("%08X:lethalj_gun_r(%d) = %04X\n", cpu_get_pc(machine->activecpu), offset, result); */ return result; } diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c index 70aa5b333f7..4577a25dc5a 100644 --- a/src/mame/video/m107.c +++ b/src/mame/video/m107.c @@ -304,7 +304,7 @@ static void m107_screenrefresh(running_machine *machine, bitmap_t *bitmap, const WRITE16_HANDLER( m107_spritebuffer_w ) { if (ACCESSING_BITS_0_7) { -// logerror("%04x: buffered spriteram\n",activecpu_get_pc()); +// logerror("%04x: buffered spriteram\n",cpu_get_pc(machine->activecpu)); memcpy(m107_spriteram,spriteram16,0x1000); } } diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c index 5f673f609d0..9a36149ff28 100644 --- a/src/mame/video/m92.c +++ b/src/mame/video/m92.c @@ -101,7 +101,7 @@ WRITE16_HANDLER( m92_spritecontrol_w ) word can be copied per clock.*/ timer_set(attotime_mul(ATTOTIME_IN_HZ(26666000), 0x400), NULL, 0, spritebuffer_callback); } -// logerror("%04x: m92_spritecontrol_w %08x %08x\n",activecpu_get_pc(),offset,data); +// logerror("%04x: m92_spritecontrol_w %08x %08x\n",cpu_get_pc(machine->activecpu),offset,data); } WRITE16_HANDLER( m92_videocontrol_w ) @@ -124,7 +124,7 @@ WRITE16_HANDLER( m92_videocontrol_w ) /* Access to upper palette bank */ m92_palette_bank = (data >> 1) & 1; } -// logerror("%04x: m92_videocontrol_w %d = %02x\n",activecpu_get_pc(),offset,data); +// logerror("%04x: m92_videocontrol_w %d = %02x\n",cpu_get_pc(machine->activecpu),offset,data); } READ16_HANDLER( m92_paletteram_r ) diff --git a/src/mame/video/megasys1.c b/src/mame/video/megasys1.c index a166a9148c6..2e01fb21e5c 100644 --- a/src/mame/video/megasys1.c +++ b/src/mame/video/megasys1.c @@ -223,7 +223,7 @@ static void create_tilemaps(void); #define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\ { \ popmessage(_format_,_offset_,_data_);\ - logerror("CPU #0 PC %06X : Warning, ",activecpu_get_pc()); \ + logerror("CPU #0 PC %06X : Warning, ",cpu_get_pc(machine->activecpu)); \ logerror(_format_,_offset_,_data_);\ logerror("\n");\ } @@ -232,7 +232,7 @@ static void create_tilemaps(void); #define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\ {\ - logerror("CPU #0 PC %06X : Warning, ",activecpu_get_pc()); \ + logerror("CPU #0 PC %06X : Warning, ",cpu_get_pc(machine->activecpu)); \ logerror(_format_,_offset_,_data_); \ logerror("\n");\ } diff --git a/src/mame/video/midvunit.c b/src/mame/video/midvunit.c index 0c7623f9cd3..8518f57e13d 100644 --- a/src/mame/video/midvunit.c +++ b/src/mame/video/midvunit.c @@ -379,7 +379,7 @@ static void process_dma_queue(running_machine *machine) WRITE32_HANDLER( midvunit_dma_queue_w ) { if (LOG_DMA && input_code_pressed(KEYCODE_L)) - logerror("%06X:queue(%X) = %08X\n", activecpu_get_pc(), dma_data_index, data); + logerror("%06X:queue(%X) = %08X\n", cpu_get_pc(machine->activecpu), dma_data_index, data); if (dma_data_index < 16) dma_data[dma_data_index++] = data; } @@ -397,7 +397,7 @@ READ32_HANDLER( midvunit_dma_trigger_r ) if (offset) { if (LOG_DMA && input_code_pressed(KEYCODE_L)) - logerror("%06X:trigger\n", activecpu_get_pc()); + logerror("%06X:trigger\n", cpu_get_pc(machine->activecpu)); process_dma_queue(machine); dma_data_index = 0; } diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c index e35bb79388b..4db9b4a09bf 100644 --- a/src/mame/video/midzeus.c +++ b/src/mame/video/midzeus.c @@ -405,11 +405,11 @@ READ32_HANDLER( zeus_r ) if (logit) { if (offset & 1) - logerror("%06X:zeus32_r(%02X) = %08X -- unexpected in 32-bit mode\n", activecpu_get_pc(), offset, result); + logerror("%06X:zeus32_r(%02X) = %08X -- unexpected in 32-bit mode\n", cpu_get_pc(machine->activecpu), offset, result); else if (offset != 0xe0) - logerror("%06X:zeus32_r(%02X) = %08X\n", activecpu_get_pc(), offset, result); + logerror("%06X:zeus32_r(%02X) = %08X\n", cpu_get_pc(machine->activecpu), offset, result); else - logerror("%06X:zeus32_r(%02X) = %08X\n", activecpu_get_pc(), offset, result); + logerror("%06X:zeus32_r(%02X) = %08X\n", cpu_get_pc(machine->activecpu), offset, result); } } @@ -421,7 +421,7 @@ READ32_HANDLER( zeus_r ) else result &= 0xffff; if (logit) - logerror("%06X:zeus16_r(%02X) = %04X\n", activecpu_get_pc(), offset, result); + logerror("%06X:zeus16_r(%02X) = %04X\n", cpu_get_pc(machine->activecpu), offset, result); } return result; } @@ -439,7 +439,7 @@ WRITE32_HANDLER( zeus_w ) int logit = zeus_enable_logging || ((offset < 0xb0 || offset > 0xb7) && (offset < 0xe0 || offset > 0xe1)); if (logit) - logerror("%06X:zeus_w", activecpu_get_pc()); + logerror("%06X:zeus_w", cpu_get_pc(machine->activecpu)); /* 32-bit mode */ if (zeusbase[0x80] & 0x00020000) diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c index b663376a634..449ed00ca99 100644 --- a/src/mame/video/midzeus2.c +++ b/src/mame/video/midzeus2.c @@ -425,7 +425,7 @@ READ32_HANDLER( zeus2_r ) #endif if (logit) - logerror("%06X:zeus2_r(%02X)\n", activecpu_get_pc(), offset); + logerror("%06X:zeus2_r(%02X)\n", cpu_get_pc(machine->activecpu), offset); switch (offset) { @@ -471,7 +471,7 @@ WRITE32_HANDLER( zeus2_w ) offset != 0x40 && offset != 0x41 && offset != 0x48 && offset != 0x49 && offset != 0x4e && offset != 0x50 && offset != 0x51 && offset != 0x57 && offset != 0x58 && offset != 0x59 && offset != 0x5a && offset != 0x5e); if (logit) - logerror("%06X:zeus2_w", activecpu_get_pc()); + logerror("%06X:zeus2_w", cpu_get_pc(machine->activecpu)); zeus_register32_w(machine, offset, data, logit); } diff --git a/src/mame/video/mitchell.c b/src/mame/video/mitchell.c index 11d6a812165..ba668cc11fe 100644 --- a/src/mame/video/mitchell.c +++ b/src/mame/video/mitchell.c @@ -152,7 +152,7 @@ static int paletteram_bank; WRITE8_HANDLER( pang_gfxctrl_w ) { -logerror("PC %04x: pang_gfxctrl_w %02x\n",activecpu_get_pc(),data); +logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(machine->activecpu),data); { #if 0 char baf[40]; @@ -189,7 +189,7 @@ logerror("PC %04x: pang_gfxctrl_w %02x\n",activecpu_get_pc(),data); WRITE8_HANDLER( mstworld_gfxctrl_w ) { -logerror("PC %04x: pang_gfxctrl_w %02x\n",activecpu_get_pc(),data); +logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(machine->activecpu),data); { char baf[40]; sprintf(baf,"%02x",data); diff --git a/src/mame/video/mjkjidai.c b/src/mame/video/mjkjidai.c index f40bccc2f2c..8ef5b23ba75 100644 --- a/src/mame/video/mjkjidai.c +++ b/src/mame/video/mjkjidai.c @@ -53,7 +53,7 @@ WRITE8_HANDLER( mjkjidai_ctrl_w ) { UINT8 *rom = memory_region(machine, "main"); -// logerror("%04x: port c0 = %02x\n",activecpu_get_pc(),data); +// logerror("%04x: port c0 = %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 0 = NMI enable */ interrupt_enable_w(machine,0,data & 1); diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c index e0cf1734e19..1651f7a9785 100644 --- a/src/mame/video/namcos22.c +++ b/src/mame/video/namcos22.c @@ -2420,7 +2420,7 @@ Dump( FILE *f, unsigned addr1, unsigned addr2, const char *name ) int i; for( i=0; i<16; i++ ) { - data[i] = cpunum_read_byte( 0, addr+i ); + data[i] = cpu_read_byte(Machine->cpu[0], addr+i ); if( data[i] ) { bHasNonZero = 1; @@ -2481,7 +2481,7 @@ WRITE32_HANDLER(namcos22_port800000_w) { /* 00000011011111110000100011111111001001111110111110110001 */ UINT16 word = data>>16; - logerror( "%x: C304/C399: 0x%04x\n", activecpu_get_previouspc(), word ); + logerror( "%x: C304/C399: 0x%04x\n", cpu_get_previouspc(machine->activecpu), word ); if( word == 0x4038 ) { mbSpotlightEnable = 1; diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c index 8f376a637b6..fd8463ce14a 100644 --- a/src/mame/video/neogeo.c +++ b/src/mame/video/neogeo.c @@ -783,16 +783,16 @@ static UINT16 get_video_control(running_machine *machine) ret = (v_counter << 7) | (neogeo_get_auto_animation_counter() & 0x0007); - if (VERBOSE) logerror("PC %06x: video_control read (%04x)\n", activecpu_get_pc(), ret); + if (VERBOSE) logerror("PC %06x: video_control read (%04x)\n", cpu_get_pc(machine->activecpu), ret); return ret; } -static void set_video_control(UINT16 data) +static void set_video_control(running_machine *machine, UINT16 data) { /* this does much more than this, but I'm not sure exactly what */ - if (VERBOSE) logerror("%06x: video control write %04x\n", activecpu_get_pc(), data); + if (VERBOSE) logerror("%06x: video control write %04x\n", cpu_get_pc(machine->activecpu), data); set_auto_animation_speed(data >> 8); set_auto_animation_disabled(data & 0x0008); @@ -838,8 +838,8 @@ WRITE16_HANDLER( neogeo_video_register_w ) case 0x00: set_videoram_offset(data); break; case 0x01: set_videoram_data(data); break; case 0x02: set_videoram_modulo(data); break; - case 0x03: set_video_control(data); break; - case 0x04: neogeo_set_display_counter_msb(data); break; + case 0x03: set_video_control(machine, data); break; + case 0x04: neogeo_set_display_counter_msb(machine, data); break; case 0x05: neogeo_set_display_counter_lsb(machine, data); break; case 0x06: neogeo_acknowledge_interrupt(machine, data); break; case 0x07: break; /* unknown, see get_video_control */ diff --git a/src/mame/video/ojankohs.c b/src/mame/video/ojankohs.c index 108d757f3b6..7f1372787b4 100644 --- a/src/mame/video/ojankohs.c +++ b/src/mame/video/ojankohs.c @@ -86,7 +86,7 @@ WRITE8_HANDLER( ccasino_palette_w ) int r, g, b; /* get top 8 bits of the I/O port address */ - offset = (offset << 8) | (activecpu_get_reg(Z80_BC) >> 8); + offset = (offset << 8) | (cpu_get_reg(machine->activecpu, Z80_BC) >> 8); ojankohs_paletteram[offset] = data; diff --git a/src/mame/video/othldrby.c b/src/mame/video/othldrby.c index 7ce686c78b5..97f61e8486b 100644 --- a/src/mame/video/othldrby.c +++ b/src/mame/video/othldrby.c @@ -121,7 +121,7 @@ WRITE16_HANDLER( othldrby_vreg_w ) if (vreg_addr < VREG_SIZE) vreg[vreg_addr++] = data; else - popmessage("%06x: VREG OUT OF BOUNDS %04x",activecpu_get_pc(),vreg_addr); + popmessage("%06x: VREG OUT OF BOUNDS %04x",cpu_get_pc(machine->activecpu),vreg_addr); } diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c index 40696d464be..2290ccbec7a 100644 --- a/src/mame/video/phoenix.c +++ b/src/mame/video/phoenix.c @@ -334,7 +334,7 @@ CUSTOM_INPUT( pleiads_protection_r ) return 1; break; default: - logerror("Unknown protection question %02X at %04X\n", pleiads_protection_question, safe_activecpu_get_pc()); + logerror("Unknown protection question %02X at %04X\n", pleiads_protection_question, safe_cpu_get_pc(field->port->machine->activecpu)); return 0; } } diff --git a/src/mame/video/policetr.c b/src/mame/video/policetr.c index 94493fd2bdd..497e674c442 100644 --- a/src/mame/video/policetr.c +++ b/src/mame/video/policetr.c @@ -158,7 +158,7 @@ WRITE32_HANDLER( policetr_video_w ) { /* we assume 4-byte accesses */ if (mem_mask) - logerror("%08X: policetr_video_w access with mask %08X\n", activecpu_get_previouspc(), mem_mask); + logerror("%08X: policetr_video_w access with mask %08X\n", cpu_get_previouspc(machine->activecpu), mem_mask); /* 4 offsets */ switch (offset) @@ -208,7 +208,7 @@ WRITE32_HANDLER( policetr_video_w ) /* log anything else */ default: - logerror("%08X: policetr_video_w(2) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch); + logerror("%08X: policetr_video_w(2) = %08X & %08X with latch %02X\n", cpu_get_previouspc(machine->activecpu), data, mem_mask, video_latch); break; } break; @@ -222,7 +222,7 @@ WRITE32_HANDLER( policetr_video_w ) /* latch 0x00 is unknown; 0, 1, and 2 get written into the upper 12 bits before rendering */ case 0x00: if (data != (0 << 20) && data != (1 << 20) && data != (2 << 20)) - logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch); + logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", cpu_get_previouspc(machine->activecpu), data, mem_mask, video_latch); break; /* latch 0x10 specifies destination bitmap X and Y offsets */ @@ -234,13 +234,13 @@ WRITE32_HANDLER( policetr_video_w ) /* latch 0x20 is unknown; either 0xef or 0x100 is written every IRQ4 */ case 0x20: if (data != (0x100 << 12) && data != (0xef << 12)) - logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch); + logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", cpu_get_previouspc(machine->activecpu), data, mem_mask, video_latch); break; /* latch 0x40 is unknown; a 0 is written every IRQ4 */ case 0x40: if (data != 0) - logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch); + logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", cpu_get_previouspc(machine->activecpu), data, mem_mask, video_latch); break; /* latch 0x50 clears IRQ4 */ @@ -255,7 +255,7 @@ WRITE32_HANDLER( policetr_video_w ) /* log anything else */ default: - logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", activecpu_get_previouspc(), data, mem_mask, video_latch); + logerror("%08X: policetr_video_w(3) = %08X & %08X with latch %02X\n", cpu_get_previouspc(machine->activecpu), data, mem_mask, video_latch); break; } break; @@ -315,7 +315,7 @@ READ32_HANDLER( policetr_video_r ) } /* log anything else */ - logerror("%08X: policetr_video_r with latch %02X\n", activecpu_get_previouspc(), video_latch); + logerror("%08X: policetr_video_r with latch %02X\n", cpu_get_previouspc(machine->activecpu), video_latch); return 0; } diff --git a/src/mame/video/psx.c b/src/mame/video/psx.c index f2db29a70f2..c8f1f34adeb 100644 --- a/src/mame/video/psx.c +++ b/src/mame/video/psx.c @@ -34,9 +34,9 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) va_start( v, s_fmt ); vsprintf( buf, s_fmt, v ); va_end( v ); - if( cpu_getactivecpu() != -1 ) + if( cpunum_get_active() != -1 ) { - logerror( "%08x: %s", activecpu_get_pc(), buf ); + logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf ); } else { diff --git a/src/mame/video/segag80r.c b/src/mame/video/segag80r.c index 33f97585b34..4cfc2eec198 100644 --- a/src/mame/video/segag80r.c +++ b/src/mame/video/segag80r.c @@ -303,7 +303,7 @@ READ8_HANDLER( segag80r_video_port_r ) { if (offset == 0) { - logerror("%04X:segag80r_video_port_r(%d)\n", activecpu_get_pc(), offset); + logerror("%04X:segag80r_video_port_r(%d)\n", cpu_get_pc(machine->activecpu), offset); return 0xff; } else @@ -323,7 +323,7 @@ WRITE8_HANDLER( segag80r_video_port_w ) { if (offset == 0) { - logerror("%04X:segag80r_video_port_w(%d) = %02X\n", activecpu_get_pc(), offset, data); + logerror("%04X:segag80r_video_port_w(%d) = %02X\n", cpu_get_pc(machine->activecpu), offset, data); } else { diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index 036a310459e..335eb53f9a2 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -318,7 +318,7 @@ WRITE16_HANDLER( seta_vregs_w ) if ( (samples_len > 0x100000) && ((addr+0x40000) <= samples_len) ) memcpy(&rom[0xc0000],&rom[addr],0x40000); else - logerror("PC %06X - Invalid samples bank %02X !\n", activecpu_get_pc(), new_bank); + logerror("PC %06X - Invalid samples bank %02X !\n", cpu_get_pc(machine->activecpu), new_bank); } else if (samples_len == 0x480000) /* zombraid */ { diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c index fd4f9b44f04..8710622c5b6 100644 --- a/src/mame/video/seta2.c +++ b/src/mame/video/seta2.c @@ -129,23 +129,23 @@ WRITE16_HANDLER( seta2_vregs_w ) { case 0x1c: // FLIP SCREEN (myangel) <- this is actually zoom flip_screen_set( data & 1 ); - if (data & ~1) logerror("CPU #0 PC %06X: flip screen unknown bits %04X\n",activecpu_get_pc(),data); + if (data & ~1) logerror("CPU #0 PC %06X: flip screen unknown bits %04X\n",cpu_get_pc(machine->activecpu),data); break; case 0x2a: // FLIP X (pzlbowl) flip_screen_x_set( data & 1 ); - if (data & ~1) logerror("CPU #0 PC %06X: flipx unknown bits %04X\n",activecpu_get_pc(),data); + if (data & ~1) logerror("CPU #0 PC %06X: flipx unknown bits %04X\n",cpu_get_pc(machine->activecpu),data); break; case 0x2c: // FLIP Y (pzlbowl) flip_screen_y_set( data & 1 ); - if (data & ~1) logerror("CPU #0 PC %06X: flipy unknown bits %04X\n",activecpu_get_pc(),data); + if (data & ~1) logerror("CPU #0 PC %06X: flipy unknown bits %04X\n",cpu_get_pc(machine->activecpu),data); break; case 0x30: // BLANK SCREEN (pzlbowl, myangel) - if (data & ~1) logerror("CPU #0 PC %06X: blank unknown bits %04X\n",activecpu_get_pc(),data); + if (data & ~1) logerror("CPU #0 PC %06X: blank unknown bits %04X\n",cpu_get_pc(machine->activecpu),data); break; default: - logerror("CPU #0 PC %06X: Video Reg %02X <- %04X\n",activecpu_get_pc(),offset*2,data); + logerror("CPU #0 PC %06X: Video Reg %02X <- %04X\n",cpu_get_pc(machine->activecpu),offset*2,data); } } diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c index 24c2c12192a..f53d51e0f42 100644 --- a/src/mame/video/st0016.c +++ b/src/mame/video/st0016.c @@ -205,7 +205,7 @@ WRITE8_HANDLER(st0016_vregs_w) { /* samples ? sound dma ? */ // speaglsht: unknown DMA copy : src - 2B6740, dst - 4400, len - 1E400 - logerror("unknown DMA copy : src - %X, dst - %X, len - %X, PC - %X\n",srcadr,dstadr,length,activecpu_get_previouspc()); + logerror("unknown DMA copy : src - %X, dst - %X, len - %X, PC - %X\n",srcadr,dstadr,length,cpu_get_previouspc(machine->activecpu)); break; } } diff --git a/src/mame/video/stvvdp1.c b/src/mame/video/stvvdp1.c index ee17e937e4b..b140dbc5f01 100644 --- a/src/mame/video/stvvdp1.c +++ b/src/mame/video/stvvdp1.c @@ -193,7 +193,7 @@ READ32_HANDLER( stv_vdp1_regs_r ) // x ^= 0x00020000; - logerror ("cpu #%d (PC=%08X) VDP1: Read from Registers, Offset %04x\n",cpu_getactivecpu(), activecpu_get_pc(), offset); + logerror ("cpu #%d (PC=%08X) VDP1: Read from Registers, Offset %04x\n",cpunum_get_active(), cpu_get_pc(machine->activecpu), offset); // if (offset == 0x04) return x; return stv_vdp1_regs[offset]; @@ -355,7 +355,7 @@ WRITE32_HANDLER ( stv_vdp1_vram_w ) // if (((offset * 4) > 0xdf) && ((offset * 4) < 0x140)) // { -// logerror("cpu #%d (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", cpu_getactivecpu(), activecpu_get_pc(), offset*4, data, mem_mask); +// logerror("cpu #%d (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", cpunum_get_active(), cpu_get_pc(machine->activecpu), offset*4, data, mem_mask); // } data = stv_vdp1_vram[offset]; diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c index abbcecc7e70..c3eb49c217d 100644 --- a/src/mame/video/stvvdp2.c +++ b/src/mame/video/stvvdp2.c @@ -5275,7 +5275,7 @@ READ32_HANDLER ( stv_vdp2_regs_r ) /*H/V Counter Register*/ /*H-Counter V-Counter */ stv_vdp2_regs[offset] = (((video_screen_get_visible_area(machine->primary_screen)->max_x - 1)<<16)&0x3ff0000)|(((video_screen_get_visible_area(machine->primary_screen)->max_y - 1)<<0)& ((STV_VDP2_LSMD == 3) ? 0x7ff : 0x3ff)); - if(LOG_VDP2) logerror("CPU #%d PC(%08x) = VDP2: H/V counter read : %08x\n",cpu_getactivecpu(),activecpu_get_pc(),stv_vdp2_regs[offset]); + if(LOG_VDP2) logerror("CPU #%d PC(%08x) = VDP2: H/V counter read : %08x\n",cpunum_get_active(),cpu_get_pc(machine->activecpu),stv_vdp2_regs[offset]); stv_vdp2_regs[offset] = 0; break; } diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c index 8ccf22e5fc0..4d34c9e5b46 100644 --- a/src/mame/video/suna16.c +++ b/src/mame/video/suna16.c @@ -68,7 +68,7 @@ WRITE16_HANDLER( suna16_flipscreen_w ) flip_screen_set( data & 1 ); color_bank = ( data & 4 ) >> 2; } - if (data & ~(1|4)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", activecpu_get_pc(), data); + if (data & ~(1|4)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(machine->activecpu), data); } WRITE16_HANDLER( bestbest_flipscreen_w ) @@ -78,7 +78,7 @@ WRITE16_HANDLER( bestbest_flipscreen_w ) flip_screen_set( data & 0x10 ); // color_bank = ( data & 0x07 ); } - if (data & ~(0x10)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", activecpu_get_pc(), data); + if (data & ~(0x10)) logerror("CPU#0 PC %06X - Flip screen unknown bits: %04X\n", cpu_get_pc(machine->activecpu), data); } diff --git a/src/mame/video/tagteam.c b/src/mame/video/tagteam.c index f971023d795..8a67cd52483 100644 --- a/src/mame/video/tagteam.c +++ b/src/mame/video/tagteam.c @@ -104,7 +104,7 @@ WRITE8_HANDLER( tagteam_mirrorcolorram_w ) WRITE8_HANDLER( tagteam_control_w ) { -logerror("%04x: control = %02x\n",activecpu_get_pc(),data); +logerror("%04x: control = %02x\n",cpu_get_pc(machine->activecpu),data); /* bit 7 is the palette bank */ palettebank = (data & 0x80) >> 7; diff --git a/src/mame/video/taito_l.c b/src/mame/video/taito_l.c index 4a45fa76715..1d0cf6664eb 100644 --- a/src/mame/video/taito_l.c +++ b/src/mame/video/taito_l.c @@ -119,7 +119,7 @@ WRITE8_HANDLER( taitol_bankc_w ) if (bankc[offset] != data) { bankc[offset] = data; -// logerror("Bankc %d, %02x (%04x)\n", offset, data, activecpu_get_pc()); +// logerror("Bankc %d, %02x (%04x)\n", offset, data, cpu_get_pc(machine->activecpu)); tilemap_mark_all_tiles_dirty(bg18_tilemap); tilemap_mark_all_tiles_dirty(bg19_tilemap); @@ -134,7 +134,7 @@ READ8_HANDLER( taitol_bankc_r ) WRITE8_HANDLER( taitol_control_w ) { -// logerror("Control Write %02x (%04x)\n", data, activecpu_get_pc()); +// logerror("Control Write %02x (%04x)\n", data, cpu_get_pc(machine->activecpu)); cur_ctrl = data; //popmessage("%02x",data); @@ -154,7 +154,7 @@ WRITE8_HANDLER( taitol_control_w ) READ8_HANDLER( taitol_control_r ) { -// logerror("Control Read %02x (%04x)\n", cur_ctrl, activecpu_get_pc()); +// logerror("Control Read %02x (%04x)\n", cur_ctrl, cpu_get_pc(machine->activecpu)); return cur_ctrl; } diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c index dbacb7f3c9d..940b4b0c3ae 100644 --- a/src/mame/video/taitoic.c +++ b/src/mame/video/taitoic.c @@ -2923,9 +2923,9 @@ WRITE16_HANDLER( TC0360PRI_halfword_w ) TC0360PRI_w(machine,offset,data & 0xff); #if 0 if (data & 0xff00) -{ logerror("CPU #0 PC %06x: warning - write %02x to MSB of TC0360PRI address %02x\n",activecpu_get_pc(),data,offset); } +{ logerror("CPU #0 PC %06x: warning - write %02x to MSB of TC0360PRI address %02x\n",cpu_get_pc(machine->activecpu),data,offset); } else -{ logerror("CPU #0 PC %06x: warning - write %02x to MSB of TC0360PRI address %02x\n",activecpu_get_pc(),data,offset); } +{ logerror("CPU #0 PC %06x: warning - write %02x to MSB of TC0360PRI address %02x\n",cpu_get_pc(machine->activecpu),data,offset); } #endif } } @@ -2937,9 +2937,9 @@ WRITE16_HANDLER( TC0360PRI_halfword_swap_w ) TC0360PRI_w(machine,offset,(data >> 8) & 0xff); #if 0 if (data & 0xff) -{ logerror("CPU #0 PC %06x: warning - write %02x to LSB of TC0360PRI address %02x\n",activecpu_get_pc(),data,offset); } +{ logerror("CPU #0 PC %06x: warning - write %02x to LSB of TC0360PRI address %02x\n",cpu_get_pc(machine->activecpu),data,offset); } else -{ logerror("CPU #0 PC %06x: warning - write %02x to LSB of TC0360PRI address %02x\n",activecpu_get_pc(),data,offset); } +{ logerror("CPU #0 PC %06x: warning - write %02x to LSB of TC0360PRI address %02x\n",cpu_get_pc(machine->activecpu),data,offset); } #endif } } @@ -4770,7 +4770,7 @@ READ16_HANDLER( TC0110PCR_word_r ) return TC0110PCR_ram[0][(TC0110PCR_addr[0])]; default: -logerror("PC %06x: warning - read TC0110PCR address %02x\n",activecpu_get_pc(),offset); +logerror("PC %06x: warning - read TC0110PCR address %02x\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } } @@ -4783,7 +4783,7 @@ READ16_HANDLER( TC0110PCR_word_1_r ) return TC0110PCR_ram[1][(TC0110PCR_addr[1])]; default: -logerror("PC %06x: warning - read second TC0110PCR address %02x\n",activecpu_get_pc(),offset); +logerror("PC %06x: warning - read second TC0110PCR address %02x\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } } @@ -4796,7 +4796,7 @@ READ16_HANDLER( TC0110PCR_word_2_r ) return TC0110PCR_ram[2][(TC0110PCR_addr[2])]; default: -logerror("PC %06x: warning - read third TC0110PCR address %02x\n",activecpu_get_pc(),offset); +logerror("PC %06x: warning - read third TC0110PCR address %02x\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } } @@ -4819,7 +4819,7 @@ WRITE16_HANDLER( TC0110PCR_word_w ) } default: -logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -4841,7 +4841,7 @@ WRITE16_HANDLER( TC0110PCR_step1_word_w ) } default: -logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -4864,7 +4864,7 @@ WRITE16_HANDLER( TC0110PCR_step1_word_1_w ) } default: -logerror("PC %06x: warning - write %04x to second TC0110PCR offset %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %04x to second TC0110PCR offset %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -4887,7 +4887,7 @@ WRITE16_HANDLER( TC0110PCR_step1_word_2_w ) } default: -logerror("PC %06x: warning - write %04x to third TC0110PCR offset %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %04x to third TC0110PCR offset %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -4911,7 +4911,7 @@ WRITE16_HANDLER( TC0110PCR_step1_rbswap_word_w ) } default: -logerror("PC %06x: warning - write %04x to TC0110PCR offset %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %04x to TC0110PCR offset %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -4935,7 +4935,7 @@ WRITE16_HANDLER( TC0110PCR_step1_4bpg_word_w ) } default: -logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %04x to TC0110PCR address %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -4969,7 +4969,7 @@ READ8_HANDLER( TC0220IOC_r ) return input_port_read(machine, "IN2"); default: -logerror("PC %06x: warning - read TC0220IOC address %02x\n",activecpu_get_pc(),offset); +logerror("PC %06x: warning - read TC0220IOC address %02x\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } } @@ -4991,12 +4991,12 @@ WRITE8_HANDLER( TC0220IOC_w ) coin_counter_w(1,data & 0x08); //if (data &0xf0) -//logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",activecpu_get_pc(),data,offset); +//logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; default: -logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -5080,7 +5080,7 @@ WRITE16_HANDLER( TC0220IOC_halfword_w ) TC0220IOC_w(machine,offset,(data >> 8) & 0xff); if (offset) /* ainferno writes watchdog in msb */ -logerror("CPU #0 PC %06x: warning - write to MSB of TC0220IOC address %02x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - write to MSB of TC0220IOC address %02x\n",cpu_get_pc(machine->activecpu),offset); } } @@ -5097,7 +5097,7 @@ WRITE16_HANDLER( TC0220IOC_halfword_byteswap_w ) { TC0220IOC_w(machine,offset,data & 0xff); -logerror("CPU #0 PC %06x: warning - write to LSB of TC0220IOC address %02x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - write to LSB of TC0220IOC address %02x\n",cpu_get_pc(machine->activecpu),offset); } } @@ -5130,7 +5130,7 @@ READ8_HANDLER( TC0510NIO_r ) return input_port_read(machine, "IN2"); default: -logerror("PC %06x: warning - read TC0510NIO address %02x\n",activecpu_get_pc(),offset); +logerror("PC %06x: warning - read TC0510NIO address %02x\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } } @@ -5153,7 +5153,7 @@ WRITE8_HANDLER( TC0510NIO_w ) break; default: -logerror("PC %06x: warning - write %02x to TC0510NIO address %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %02x to TC0510NIO address %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -5170,7 +5170,7 @@ WRITE16_HANDLER( TC0510NIO_halfword_w ) else { /* driftout writes the coin counters here - bug? */ -logerror("CPU #0 PC %06x: warning - write to MSB of TC0510NIO address %02x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - write to MSB of TC0510NIO address %02x\n",cpu_get_pc(machine->activecpu),offset); TC0510NIO_w(machine,offset,(data >> 8) & 0xff); } } @@ -5213,7 +5213,7 @@ READ8_HANDLER( TC0640FIO_r ) return input_port_read(machine, "IN2"); default: -logerror("PC %06x: warning - read TC0640FIO address %02x\n",activecpu_get_pc(),offset); +logerror("PC %06x: warning - read TC0640FIO address %02x\n",cpu_get_pc(machine->activecpu),offset); return 0xff; } } @@ -5236,7 +5236,7 @@ WRITE8_HANDLER( TC0640FIO_w ) break; default: -logerror("PC %06x: warning - write %02x to TC0640FIO address %02x\n",activecpu_get_pc(),data,offset); +logerror("PC %06x: warning - write %02x to TC0640FIO address %02x\n",cpu_get_pc(machine->activecpu),data,offset); break; } } @@ -5253,7 +5253,7 @@ WRITE16_HANDLER( TC0640FIO_halfword_w ) else { TC0640FIO_w(machine,offset,(data >> 8) & 0xff); -logerror("CPU #0 PC %06x: warning - write to MSB of TC0640FIO address %02x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - write to MSB of TC0640FIO address %02x\n",cpu_get_pc(machine->activecpu),offset); } } @@ -5269,7 +5269,7 @@ WRITE16_HANDLER( TC0640FIO_halfword_byteswap_w ) else { TC0640FIO_w(machine,offset,data & 0xff); -logerror("CPU #0 PC %06x: warning - write to LSB of TC0640FIO address %02x\n",activecpu_get_pc(),offset); +logerror("CPU #0 PC %06x: warning - write to LSB of TC0640FIO address %02x\n",cpu_get_pc(machine->activecpu),offset); } } diff --git a/src/mame/video/tatsumi.c b/src/mame/video/tatsumi.c index 613234ac1b2..9431561e85a 100644 --- a/src/mame/video/tatsumi.c +++ b/src/mame/video/tatsumi.c @@ -26,7 +26,7 @@ WRITE16_HANDLER(tatsumi_sprite_control_w) /* 0xe0 is bank switch, others unknown */ // if ((offset==0xe0 && data&0xefff) || offset!=0xe0) -// logerror("%08x: Tatsumi TZB215 sprite control %04x %08x\n", activecpu_get_pc(), offset, data); +// logerror("%08x: Tatsumi TZB215 sprite control %04x %08x\n", cpu_get_pc(machine->activecpu), offset, data); } /******************************************************************************/ @@ -157,7 +157,7 @@ WRITE16_HANDLER( roundup5_crt_w ) if (offset==1 && ACCESSING_BITS_0_7) { roundupt_crt_reg[roundupt_crt_selected_reg]=data; // if (roundupt_crt_selected_reg!=0xa && roundupt_crt_selected_reg!=0xb && roundupt_crt_selected_reg!=29) -// logerror("%08x: Crt write %02x %02x\n",activecpu_get_pc(),roundupt_crt_selected_reg,data); +// logerror("%08x: Crt write %02x %02x\n",cpu_get_pc(machine->activecpu),roundupt_crt_selected_reg,data); } } diff --git a/src/mame/video/victory.c b/src/mame/video/victory.c index ad137fa47b6..95485303548 100644 --- a/src/mame/video/victory.c +++ b/src/mame/video/victory.c @@ -158,7 +158,7 @@ READ8_HANDLER( victory_video_control_r ) { case 0x00: /* 5XFIQ */ result = fgcollx; - if (LOG_COLLISION) logerror("%04X:5XFIQ read = %02X\n", activecpu_get_previouspc(), result); + if (LOG_COLLISION) logerror("%04X:5XFIQ read = %02X\n", cpu_get_previouspc(machine->activecpu), result); return result; case 0x01: /* 5CLFIQ */ @@ -168,12 +168,12 @@ READ8_HANDLER( victory_video_control_r ) fgcoll = 0; victory_update_irq(machine); } - if (LOG_COLLISION) logerror("%04X:5CLFIQ read = %02X\n", activecpu_get_previouspc(), result); + if (LOG_COLLISION) logerror("%04X:5CLFIQ read = %02X\n", cpu_get_previouspc(machine->activecpu), result); return result; case 0x02: /* 5BACKX */ result = bgcollx & 0xfc; - if (LOG_COLLISION) logerror("%04X:5BACKX read = %02X\n", activecpu_get_previouspc(), result); + if (LOG_COLLISION) logerror("%04X:5BACKX read = %02X\n", cpu_get_previouspc(machine->activecpu), result); return result; case 0x03: /* 5BACKY */ @@ -183,7 +183,7 @@ READ8_HANDLER( victory_video_control_r ) bgcoll = 0; victory_update_irq(machine); } - if (LOG_COLLISION) logerror("%04X:5BACKY read = %02X\n", activecpu_get_previouspc(), result); + if (LOG_COLLISION) logerror("%04X:5BACKY read = %02X\n", cpu_get_previouspc(machine->activecpu), result); return result; case 0x04: /* 5STAT */ @@ -198,11 +198,11 @@ READ8_HANDLER( victory_video_control_r ) result |= (~vblank_irq & 1) << 5; result |= (~bgcoll & 1) << 4; result |= (video_screen_get_vpos(machine->primary_screen) & 0x100) >> 5; - if (LOG_COLLISION) logerror("%04X:5STAT read = %02X\n", activecpu_get_previouspc(), result); + if (LOG_COLLISION) logerror("%04X:5STAT read = %02X\n", cpu_get_previouspc(machine->activecpu), result); return result; default: - logerror("%04X:victory_video_control_r(%02X)\n", activecpu_get_previouspc(), offset); + logerror("%04X:victory_video_control_r(%02X)\n", cpu_get_previouspc(machine->activecpu), offset); break; } return 0; @@ -221,12 +221,12 @@ WRITE8_HANDLER( victory_video_control_w ) switch (offset) { case 0x00: /* LOAD IL */ - if (LOG_MICROCODE) logerror("%04X:IL=%02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:IL=%02X\n", cpu_get_previouspc(machine->activecpu), data); micro.i = (micro.i & 0xff00) | (data & 0x00ff); break; case 0x01: /* LOAD IH */ - if (LOG_MICROCODE) logerror("%04X:IH=%02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:IH=%02X\n", cpu_get_previouspc(machine->activecpu), data); micro.i = (micro.i & 0x00ff) | ((data << 8) & 0xff00); if (micro.cmdlo == 5) { @@ -236,7 +236,7 @@ WRITE8_HANDLER( victory_video_control_w ) break; case 0x02: /* LOAD CMD */ - if (LOG_MICROCODE) logerror("%04X:CMD=%02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:CMD=%02X\n", cpu_get_previouspc(machine->activecpu), data); micro.cmd = data; micro.cmdlo = data & 7; if (micro.cmdlo == 0) @@ -251,12 +251,12 @@ WRITE8_HANDLER( victory_video_control_w ) break; case 0x03: /* LOAD G */ - if (LOG_MICROCODE) logerror("%04X:G=%02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:G=%02X\n", cpu_get_previouspc(machine->activecpu), data); micro.g = data; break; case 0x04: /* LOAD X */ - if (LOG_MICROCODE) logerror("%04X:X=%02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:X=%02X\n", cpu_get_previouspc(machine->activecpu), data); micro.xp = data; if (micro.cmdlo == 3) { @@ -266,7 +266,7 @@ WRITE8_HANDLER( victory_video_control_w ) break; case 0x05: /* LOAD Y */ - if (LOG_MICROCODE) logerror("%04X:Y=%02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:Y=%02X\n", cpu_get_previouspc(machine->activecpu), data); micro.yp = data; if (micro.cmdlo == 4) { @@ -276,12 +276,12 @@ WRITE8_HANDLER( victory_video_control_w ) break; case 0x06: /* LOAD R */ - if (LOG_MICROCODE) logerror("%04X:R=%02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:R=%02X\n", cpu_get_previouspc(machine->activecpu), data); micro.r = data; break; case 0x07: /* LOAD B */ - if (LOG_MICROCODE) logerror("%04X:B=%02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:B=%02X\n", cpu_get_previouspc(machine->activecpu), data); micro.b = data; if (micro.cmdlo == 2) { @@ -296,12 +296,12 @@ WRITE8_HANDLER( victory_video_control_w ) break; case 0x08: /* SCROLLX */ - if (LOG_MICROCODE) logerror("%04X:SCROLLX write = %02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:SCROLLX write = %02X\n", cpu_get_previouspc(machine->activecpu), data); scrollx = data; break; case 0x09: /* SCROLLY */ - if (LOG_MICROCODE) logerror("%04X:SCROLLY write = %02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:SCROLLY write = %02X\n", cpu_get_previouspc(machine->activecpu), data); scrolly = data; break; @@ -313,18 +313,18 @@ WRITE8_HANDLER( victory_video_control_w ) // D3 = SINVERT // D2 = BIR12 // D1 = SELOVER - if (LOG_MICROCODE) logerror("%04X:CONTROL write = %02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:CONTROL write = %02X\n", cpu_get_previouspc(machine->activecpu), data); video_control = data; break; case 0x0b: /* CLRVIRQ */ - if (LOG_MICROCODE) logerror("%04X:CLRVIRQ write = %02X\n", activecpu_get_previouspc(), data); + if (LOG_MICROCODE) logerror("%04X:CLRVIRQ write = %02X\n", cpu_get_previouspc(machine->activecpu), data); vblank_irq = 0; victory_update_irq(machine); break; default: - if (LOG_MICROCODE) logerror("%04X:victory_video_control_w(%02X) = %02X\n", activecpu_get_previouspc(), offset, data); + if (LOG_MICROCODE) logerror("%04X:victory_video_control_w(%02X) = %02X\n", cpu_get_previouspc(machine->activecpu), offset, data); break; } } diff --git a/src/mame/video/williams.c b/src/mame/video/williams.c index 6b158c8187c..cdadf1a4383 100644 --- a/src/mame/video/williams.c +++ b/src/mame/video/williams.c @@ -581,7 +581,7 @@ WRITE8_HANDLER( williams_blitter_w ) /* Log blits */ logerror("%04X:Blit @ %3d : %02X%02X -> %02X%02X, %3dx%3d, mask=%02X, flags=%02X, icount=%d, win=%d\n", - activecpu_get_pc(), video_screen_get_vpos(machine->primary_screen), + cpu_get_pc(machine->activecpu), video_screen_get_vpos(machine->primary_screen), blitterram[2], blitterram[3], blitterram[4], blitterram[5], blitterram[6], blitterram[7], diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c index 041a4dc039d..886d672e2c7 100644 --- a/src/mame/video/ygv608.c +++ b/src/mame/video/ygv608.c @@ -1432,7 +1432,7 @@ static void SetPostShortcuts( int reg ) if (yTile >= ygv608.page_y) logerror ("setting pny(%d) >= page_y(%d) @ $%X\n", - yTile, ygv608.page_y, activecpu_get_pc() ); + yTile, ygv608.page_y, cpu_get_pc(Machine->activecpu) ); yTile &= (ygv608.page_y - 1); ygv608.regs.s.r0 &= ~r0_pny; ygv608.regs.s.r0 |= yTile; @@ -1445,7 +1445,7 @@ static void SetPostShortcuts( int reg ) if (xTile >= ygv608.page_x) logerror ("setting pnx(%d) >= page_x(%d) @ $%X\n", - xTile, ygv608.page_x, activecpu_get_pc() ); + xTile, ygv608.page_x, cpu_get_pc(Machine->activecpu) ); xTile &= (ygv608.page_x - 1); ygv608.regs.s.r1 &= ~r1_pnx; ygv608.regs.s.r1 |= xTile; diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c index 50093ad115e..c03e9f5093f 100644 --- a/src/osd/windows/debugwin.c +++ b/src/osd/windows/debugwin.c @@ -225,13 +225,13 @@ static void memory_update_menu(debugwin_info *info); static int memory_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam); static int memory_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam); -static void disasm_create_window(void); +static void disasm_create_window(running_machine *machine); static void disasm_recompute_children(debugwin_info *info); static void disasm_process_string(debugwin_info *info, const char *string); static void disasm_update_menu(debugwin_info *info); static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam); static int disasm_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam); -static void disasm_update_caption(HWND wnd); +static void disasm_update_caption(running_machine *machine, HWND wnd); static void console_create_window(running_machine *machine); static void console_recompute_children(debugwin_info *info); @@ -261,7 +261,7 @@ void osd_wait_for_debugger(running_machine *machine, int firststop) // update the views in the console to reflect the current CPU if (main_console != NULL) - console_set_cpunum(machine, cpu_getactivecpu()); + console_set_cpunum(machine, cpunum_get_active()); // when we are first stopped, adjust focus to us if (firststop && main_console != NULL) @@ -1780,7 +1780,7 @@ static void memory_determine_combo_items(running_machine *machine) ci->prefsize = MIN(cpuinfo->space[spacenum].databytes, 8); t_tag = tstring_from_utf8(machine->config->cpu[cpunum].tag); - t_name = tstring_from_utf8(cpunum_name(cpunum)); + t_name = tstring_from_utf8(cpu_get_name(machine->cpu[cpunum])); t_space = tstring_from_utf8(address_space_names[spacenum]); _sntprintf(ci->name, ARRAY_LENGTH(ci->name), TEXT("CPU #%d \"%s\" (%s) %s memory"), cpunum, t_tag, t_name, t_space); free(t_space), @@ -1874,7 +1874,7 @@ static void memory_update_selection(debugwin_info *info, memorycombo_item *ci) static void memory_create_window(running_machine *machine) { - int curcpu = cpu_getactivecpu(), cursel = 0; + int curcpu = cpunum_get_active(), cursel = 0; memorycombo_item *ci, *selci = NULL; debugwin_info *info; HMENU optionsmenu; @@ -2204,9 +2204,9 @@ static int memory_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam) // disasm_create_window //============================================================ -static void disasm_create_window(void) +static void disasm_create_window(running_machine *machine) { - int curcpu = cpu_getactivecpu(), cursel = 0; + int curcpu = cpunum_get_active(), cursel = 0; debugwin_info *info; HMENU optionsmenu; UINT32 cpunum; @@ -2265,7 +2265,7 @@ static void disasm_create_window(void) { TCHAR name[100]; int item; - t_cpunum_name = tstring_from_utf8(cpunum_name(cpunum)); + t_cpunum_name = tstring_from_utf8(cpu_get_name(machine->cpu[cpunum])); _sntprintf(name, ARRAY_LENGTH(name), TEXT("CPU #%d (%s)"), cpunum, t_cpunum_name); free(t_cpunum_name); t_cpunum_name = NULL; @@ -2284,7 +2284,7 @@ static void disasm_create_window(void) debug_view_set_property_UINT32(info->view[0].view, DVP_DASM_CPUNUM, (curcpu == -1) ? 0 : curcpu); // set the caption - disasm_update_caption(info->wnd); + disasm_update_caption(machine, info->wnd); // recompute the children once to get the maxwidth disasm_recompute_children(info); @@ -2412,7 +2412,7 @@ static int disasm_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar debug_view_begin_update(info->view[0].view); debug_view_set_property_UINT32(info->view[0].view, DVP_DASM_CPUNUM, cpunum); debug_view_end_update(info->view[0].view); - disasm_update_caption(info->wnd); + disasm_update_caption(Machine, info->wnd); } } @@ -2558,7 +2558,7 @@ static int disasm_handle_key(debugwin_info *info, WPARAM wparam, LPARAM lparam) // disasm_update_caption //============================================================ -static void disasm_update_caption(HWND wnd) +static void disasm_update_caption(running_machine *machine, HWND wnd) { debugwin_info *info = (debugwin_info *)(FPTR)GetWindowLongPtr(wnd, GWLP_USERDATA); char title[100]; @@ -2568,7 +2568,7 @@ static void disasm_update_caption(HWND wnd) cpunum = debug_view_get_property_UINT32(info->view[0].view, DVP_DASM_CPUNUM); // then update the caption - sprintf(title, "Disassembly: CPU #%d \"%s\" (%s)", cpunum, Machine->config->cpu[cpunum].tag, cpunum_name(cpunum)); + sprintf(title, "Disassembly: CPU #%d \"%s\" (%s)", cpunum, Machine->config->cpu[cpunum].tag, cpu_get_name(machine->cpu[cpunum])); win_set_window_text_utf8(wnd, title); } @@ -2791,7 +2791,7 @@ static void console_set_cpunum(running_machine *machine, int cpunum) debug_view_set_property_UINT32(main_console->view[1].view, DVP_REGS_CPUNUM, cpunum); // then update the caption - snprintf(title, ARRAY_LENGTH(title), "Debug: %s - CPU #%d \"%s\" (%s)", machine->gamedrv->name, cpu_getactivecpu(), Machine->config->cpu[cpu_getactivecpu()].tag, activecpu_name()); + snprintf(title, ARRAY_LENGTH(title), "Debug: %s - CPU #%d \"%s\" (%s)", machine->gamedrv->name, cpunum_get_active(), Machine->config->cpu[cpunum_get_active()].tag, cpu_get_name(machine->activecpu)); win_get_window_text_utf8(main_console->wnd, curtitle, ARRAY_LENGTH(curtitle)); if (strcmp(title, curtitle)) win_set_window_text_utf8(main_console->wnd, title); @@ -2857,7 +2857,7 @@ static int global_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lpar return 1; case ID_NEW_DISASM_WND: - disasm_create_window(); + disasm_create_window(Machine); return 1; case ID_NEW_LOG_WND: |