diff options
author | Aaron Giles <aaron@aarongiles.com> | 2011-04-01 06:50:56 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2011-04-01 06:50:56 +0000 |
commit | 8409f7d3233f0dd5d211f68e564ca4ebb662f8bf (patch) | |
tree | 3edea78fc971015d4b0799f6c5999657685df573 /src/mame/drivers/superqix.c | |
parent | 86afc9b913dd13338a8888f27bb13d1548ef8f33 (diff) |
Final bulk rename for 0.142: ensure that all members of
driver_device classes have an m_ prefix on them. When we
eventually move functions using these into member functions,
we will be able to remove the state-> pointers, and having
the member variables prefixed will allow them to be
distinguished from local variables.
Some regex'es used (plus manually fixing the remaining stuff):
In src/mame/...
state->([a-zA-Z_][^_][a-zA-Z0-9_]*)
state->m_\1
state->([^m]_[a-zA-Z0-9_]*)
state->m_\1
state->m_save_item
state->save_item
state->m_save_pointer
state->save_pointer
(AM_BASE_MEMBER *\( *[a-zA-Z0-9_]+ *, *)([a-zA-Z_][^_])
\1m_\2
(AM_BASE_SIZE_MEMBER *\( *[a-zA-Z0-9_]+ *, *)([a-zA-Z_][^_][a-zA-Z0-9_]* *, *)([a-zA-Z_][^_])
\1m_\2m_\3
(AM_SIZE_MEMBER *\( *[a-zA-Z0-9_]+ *, *)([a-zA-Z_][^_])
\1m_\2
m__
m_
In src/mame/includes/...
(\t[a-zA-Z0-9_<>]+[ \t]+[&*]*[ \t]*)([a-zA-Z_][^_][][a-zA-Z0-9_]*;)$
\1m_\2
(\t[a-zA-Z0-9_<>]+[ \t]*[&*]*[ \t]+)([a-zA-Z_][^_][][a-zA-Z0-9_]*;)$
\1m_\2
Diffstat (limited to 'src/mame/drivers/superqix.c')
-rw-r--r-- | src/mame/drivers/superqix.c | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c index 98b5b01d299..0c7434a0f8e 100644 --- a/src/mame/drivers/superqix.c +++ b/src/mame/drivers/superqix.c @@ -122,9 +122,9 @@ static SAMPLES_START( pbillian_sh_start ) int i, len = machine.region("samples")->bytes(); /* convert 8-bit unsigned samples to 8-bit signed */ - state->samplebuf = auto_alloc_array(machine, INT16, len); + state->m_samplebuf = auto_alloc_array(machine, INT16, len); for (i = 0;i < len;i++) - state->samplebuf[i] = (INT8)(src[i] ^ 0x80) * 256; + state->m_samplebuf[i] = (INT8)(src[i] ^ 0x80) * 256; } static WRITE8_HANDLER( pbillian_sample_trigger_w ) @@ -141,7 +141,7 @@ static WRITE8_HANDLER( pbillian_sample_trigger_w ) while (end < len && src[end] != 0xff) end++; - sample_start_raw(samples, 0, state->samplebuf + start, end - start, 5000, 0); // 5khz ? + sample_start_raw(samples, 0, state->m_samplebuf + start, end - start, 5000, 0); // 5khz ? } @@ -181,22 +181,22 @@ static READ8_DEVICE_HANDLER( in4_mcu_r ) { superqix_state *state = device->machine().driver_data<superqix_state>(); // logerror("%04x: in4_mcu_r\n",cpu_get_pc(&space->device())); - return input_port_read(device->machine(), "P2") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7); + return input_port_read(device->machine(), "P2") | (state->m_from_mcu_pending << 6) | (state->m_from_z80_pending << 7); } static READ8_DEVICE_HANDLER( sqix_from_mcu_r ) { superqix_state *state = device->machine().driver_data<superqix_state>(); -// logerror("%04x: read mcu answer (%02x)\n",cpu_get_pc(&space->device()),state->from_mcu); - return state->from_mcu; +// logerror("%04x: read mcu answer (%02x)\n",cpu_get_pc(&space->device()),state->m_from_mcu); + return state->m_from_mcu; } static TIMER_CALLBACK( mcu_acknowledge_callback ) { superqix_state *state = machine.driver_data<superqix_state>(); - state->from_z80_pending = 1; - state->from_z80 = state->portb; -// logerror("Z80->MCU %02x\n",state->from_z80); + state->m_from_z80_pending = 1; + state->m_from_z80 = state->m_portb; +// logerror("Z80->MCU %02x\n",state->m_from_z80); } static READ8_HANDLER( mcu_acknowledge_r ) @@ -209,7 +209,7 @@ static WRITE8_DEVICE_HANDLER( sqix_z80_mcu_w ) { superqix_state *state = device->machine().driver_data<superqix_state>(); // logerror("%04x: sqix_z80_mcu_w %02x\n",cpu_get_pc(&space->device()),data); - state->portb = data; + state->m_portb = data; } static WRITE8_HANDLER( bootleg_mcu_p1_w ) @@ -227,28 +227,28 @@ static WRITE8_HANDLER( bootleg_mcu_p1_w ) coin_counter_w(space->machine(), 1,data & 1); break; case 3: - coin_lockout_global_w(space->machine(), (data & 1) ^ state->invert_coin_lockout); + coin_lockout_global_w(space->machine(), (data & 1) ^ state->m_invert_coin_lockout); break; case 4: flip_screen_set(space->machine(), data & 1); break; case 5: - state->port1 = data; - if ((state->port1 & 0x80) == 0) + state->m_port1 = data; + if ((state->m_port1 & 0x80) == 0) { - state->port3_latch = state->port3; + state->m_port3_latch = state->m_port3; } break; case 6: - state->from_mcu_pending = 0; // ???? + state->m_from_mcu_pending = 0; // ???? break; case 7: if ((data & 1) == 0) { -// logerror("%04x: MCU -> Z80 %02x\n",cpu_get_pc(&space->device()),state->port3); - state->from_mcu = state->port3_latch; - state->from_mcu_pending = 1; - state->from_z80_pending = 0; // ???? +// logerror("%04x: MCU -> Z80 %02x\n",cpu_get_pc(&space->device()),state->m_port3); + state->m_from_mcu = state->m_port3_latch; + state->m_from_mcu_pending = 1; + state->m_from_z80_pending = 0; // ???? } break; } @@ -257,25 +257,25 @@ static WRITE8_HANDLER( bootleg_mcu_p1_w ) static WRITE8_HANDLER( mcu_p3_w ) { superqix_state *state = space->machine().driver_data<superqix_state>(); - state->port3 = data; + state->m_port3 = data; } static READ8_HANDLER( bootleg_mcu_p3_r ) { superqix_state *state = space->machine().driver_data<superqix_state>(); - if ((state->port1 & 0x10) == 0) + if ((state->m_port1 & 0x10) == 0) { return input_port_read(space->machine(), "DSW1"); } - else if ((state->port1 & 0x20) == 0) + else if ((state->m_port1 & 0x20) == 0) { - return input_port_read(space->machine(), "SYSTEM") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7); + return input_port_read(space->machine(), "SYSTEM") | (state->m_from_mcu_pending << 6) | (state->m_from_z80_pending << 7); } - else if ((state->port1 & 0x40) == 0) + else if ((state->m_port1 & 0x40) == 0) { -// logerror("%04x: read Z80 command %02x\n",cpu_get_pc(&space->device()),state->from_z80); - state->from_z80_pending = 0; - return state->from_z80; +// logerror("%04x: read Z80 command %02x\n",cpu_get_pc(&space->device()),state->m_from_z80); + state->m_from_z80_pending = 0; + return state->m_from_z80; } return 0; } @@ -283,7 +283,7 @@ static READ8_HANDLER( bootleg_mcu_p3_r ) static READ8_HANDLER( sqixu_mcu_p0_r ) { superqix_state *state = space->machine().driver_data<superqix_state>(); - return input_port_read(space->machine(), "SYSTEM") | (state->from_mcu_pending << 6) | (state->from_z80_pending << 7); + return input_port_read(space->machine(), "SYSTEM") | (state->m_from_mcu_pending << 6) | (state->m_from_z80_pending << 7); } static WRITE8_HANDLER( sqixu_mcu_p2_w ) @@ -307,26 +307,26 @@ static WRITE8_HANDLER( sqixu_mcu_p2_w ) // bit 6 = unknown if ((data & 0x40) == 0) - state->from_mcu_pending = 0; // ???? + state->m_from_mcu_pending = 0; // ???? // bit 7 = clock latch from port 3 to Z80 - if ((state->port2 & 0x80) != 0 && (data & 0x80) == 0) + if ((state->m_port2 & 0x80) != 0 && (data & 0x80) == 0) { -// logerror("%04x: MCU -> Z80 %02x\n",cpu_get_pc(&space->device()),state->port3); - state->from_mcu = state->port3; - state->from_mcu_pending = 1; - state->from_z80_pending = 0; // ???? +// logerror("%04x: MCU -> Z80 %02x\n",cpu_get_pc(&space->device()),state->m_port3); + state->m_from_mcu = state->m_port3; + state->m_from_mcu_pending = 1; + state->m_from_z80_pending = 0; // ???? } - state->port2 = data; + state->m_port2 = data; } static READ8_HANDLER( sqixu_mcu_p3_r ) { superqix_state *state = space->machine().driver_data<superqix_state>(); -// logerror("%04x: read Z80 command %02x\n",cpu_get_pc(&space->device()),state->from_z80); - state->from_z80_pending = 0; - return state->from_z80; +// logerror("%04x: read Z80 command %02x\n",cpu_get_pc(&space->device()),state->m_from_z80); + state->m_from_z80_pending = 0; + return state->m_from_z80; } @@ -366,16 +366,16 @@ static int read_dial(running_machine &machine, int player) /* get the new position and adjust the result */ newpos = input_port_read(machine, player ? "DIAL2" : "DIAL1"); - if (newpos != state->oldpos[player]) + if (newpos != state->m_oldpos[player]) { - state->sign[player] = ((newpos - state->oldpos[player]) & 0x80) >> 7; - state->oldpos[player] = newpos; + state->m_sign[player] = ((newpos - state->m_oldpos[player]) & 0x80) >> 7; + state->m_oldpos[player] = newpos; } if (player == 0) - return ((state->oldpos[player] & 1) << 2) | (state->sign[player] << 3); + return ((state->m_oldpos[player] & 1) << 2) | (state->m_sign[player] << 3); else // player == 1 - return ((state->oldpos[player] & 1) << 3) | (state->sign[player] << 2); + return ((state->m_oldpos[player] & 1) << 3) | (state->m_sign[player] << 2); } @@ -384,8 +384,8 @@ static TIMER_CALLBACK( delayed_z80_mcu_w ) { superqix_state *state = machine.driver_data<superqix_state>(); logerror("Z80 sends command %02x\n",param); - state->from_z80 = param; - state->from_mcu_pending = 0; + state->m_from_z80 = param; + state->m_from_mcu_pending = 0; cputag_set_input_line(machine, "mcu", 0, HOLD_LINE); machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); } @@ -394,8 +394,8 @@ static TIMER_CALLBACK( delayed_mcu_z80_w ) { superqix_state *state = machine.driver_data<superqix_state>(); logerror("68705 sends answer %02x\n",param); - state->from_mcu = param; - state->from_mcu_pending = 1; + state->m_from_mcu = param; + state->m_from_mcu_pending = 1; } @@ -420,60 +420,60 @@ logerror("68705 sends answer %02x\n",param); static READ8_HANDLER( hotsmash_68705_portA_r ) { superqix_state *state = space->machine().driver_data<superqix_state>(); -//logerror("%04x: 68705 reads port A = %02x\n",cpu_get_pc(&space->device()),state->portA_in); - return state->portA_in; +//logerror("%04x: 68705 reads port A = %02x\n",cpu_get_pc(&space->device()),state->m_portA_in); + return state->m_portA_in; } static WRITE8_HANDLER( hotsmash_68705_portB_w ) { superqix_state *state = space->machine().driver_data<superqix_state>(); - state->portB_out = data; + state->m_portB_out = data; } static READ8_HANDLER( hotsmash_68705_portC_r ) { superqix_state *state = space->machine().driver_data<superqix_state>(); - return state->portC; + return state->m_portC; } static WRITE8_HANDLER( hotsmash_68705_portC_w ) { superqix_state *state = space->machine().driver_data<superqix_state>(); - state->portC = data; + state->m_portC = data; if ((data & 0x08) == 0) { switch (data & 0x07) { case 0x0: // dsw A - state->portA_in = input_port_read(space->machine(), "DSW1"); + state->m_portA_in = input_port_read(space->machine(), "DSW1"); break; case 0x1: // dsw B - state->portA_in = input_port_read(space->machine(), "DSW2"); + state->m_portA_in = input_port_read(space->machine(), "DSW2"); break; case 0x2: break; case 0x3: // command from Z80 - state->portA_in = state->from_z80; -logerror("%04x: z80 reads command %02x\n",cpu_get_pc(&space->device()),state->from_z80); + state->m_portA_in = state->m_from_z80; +logerror("%04x: z80 reads command %02x\n",cpu_get_pc(&space->device()),state->m_from_z80); break; case 0x4: break; case 0x5: // answer to Z80 - space->machine().scheduler().synchronize(FUNC(delayed_mcu_z80_w), state->portB_out); + space->machine().scheduler().synchronize(FUNC(delayed_mcu_z80_w), state->m_portB_out); break; case 0x6: - state->portA_in = read_dial(space->machine(), 0); + state->m_portA_in = read_dial(space->machine(), 0); break; case 0x7: - state->portA_in = read_dial(space->machine(), 1); + state->m_portA_in = read_dial(space->machine(), 1); break; } } @@ -487,16 +487,16 @@ static WRITE8_HANDLER( hotsmash_z80_mcu_w ) static READ8_HANDLER(hotsmash_from_mcu_r) { superqix_state *state = space->machine().driver_data<superqix_state>(); -logerror("%04x: z80 reads answer %02x\n",cpu_get_pc(&space->device()),state->from_mcu); - state->from_mcu_pending = 0; - return state->from_mcu; +logerror("%04x: z80 reads answer %02x\n",cpu_get_pc(&space->device()),state->m_from_mcu); + state->m_from_mcu_pending = 0; + return state->m_from_mcu; } static READ8_DEVICE_HANDLER(hotsmash_ay_port_a_r) { superqix_state *state = device->machine().driver_data<superqix_state>(); -//logerror("%04x: ay_port_a_r and mcu_pending is %d\n",cpu_get_pc(&space->device()),state->from_mcu_pending); - return input_port_read(device->machine(), "SYSTEM") | ((state->from_mcu_pending^1) << 7); +//logerror("%04x: ay_port_a_r and mcu_pending is %d\n",cpu_get_pc(&space->device()),state->m_from_mcu_pending); + return input_port_read(device->machine(), "SYSTEM") | ((state->m_from_mcu_pending^1) << 7); } /************************************************************************** @@ -508,24 +508,24 @@ pbillian MCU simulation static WRITE8_HANDLER( pbillian_z80_mcu_w ) { superqix_state *state = space->machine().driver_data<superqix_state>(); - state->from_z80 = data; + state->m_from_z80 = data; } static READ8_HANDLER(pbillian_from_mcu_r) { superqix_state *state = space->machine().driver_data<superqix_state>(); - switch (state->from_z80) + switch (state->m_from_z80) { - case 0x01: return input_port_read(space->machine(), state->curr_player ? "PADDLE2" : "PADDLE1"); - case 0x02: return input_port_read(space->machine(), state->curr_player ? "DIAL2" : "DIAL1"); + case 0x01: return input_port_read(space->machine(), state->m_curr_player ? "PADDLE2" : "PADDLE1"); + case 0x02: return input_port_read(space->machine(), state->m_curr_player ? "DIAL2" : "DIAL1"); case 0x04: return input_port_read(space->machine(), "DSW1"); case 0x08: return input_port_read(space->machine(), "DSW2"); - case 0x80: state->curr_player = 0; return 0; - case 0x81: state->curr_player = 1; return 0; + case 0x80: state->m_curr_player = 0; return 0; + case 0x81: state->m_curr_player = 1; return 0; } - logerror("408[%x] r at %x\n",state->from_z80,cpu_get_pc(&space->device())); + logerror("408[%x] r at %x\n",state->m_from_z80,cpu_get_pc(&space->device())); return 0; } @@ -540,21 +540,21 @@ static READ8_DEVICE_HANDLER(pbillian_ay_port_a_r) static void machine_init_common(running_machine &machine) { superqix_state *state = machine.driver_data<superqix_state>(); - state->save_item(NAME(state->invert_coin_lockout)); - state->save_item(NAME(state->from_mcu_pending)); - state->save_item(NAME(state->from_z80_pending)); - state->save_item(NAME(state->port1)); - state->save_item(NAME(state->port2)); - state->save_item(NAME(state->port3)); - state->save_item(NAME(state->port3_latch)); - state->save_item(NAME(state->from_mcu)); - state->save_item(NAME(state->from_z80)); - state->save_item(NAME(state->portb)); + state->save_item(NAME(state->m_invert_coin_lockout)); + state->save_item(NAME(state->m_from_mcu_pending)); + state->save_item(NAME(state->m_from_z80_pending)); + state->save_item(NAME(state->m_port1)); + state->save_item(NAME(state->m_port2)); + state->save_item(NAME(state->m_port3)); + state->save_item(NAME(state->m_port3_latch)); + state->save_item(NAME(state->m_from_mcu)); + state->save_item(NAME(state->m_from_z80)); + state->save_item(NAME(state->m_portb)); // hotsmash ??? - state->save_item(NAME(state->portA_in)); - state->save_item(NAME(state->portB_out)); - state->save_item(NAME(state->portC)); + state->save_item(NAME(state->m_portA_in)); + state->save_item(NAME(state->m_portB_out)); + state->save_item(NAME(state->m_portC)); } static MACHINE_START( superqix ) @@ -577,9 +577,9 @@ static MACHINE_START( pbillian ) static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") - AM_RANGE(0xe000, 0xe0ff) AM_RAM AM_BASE_SIZE_MEMBER(superqix_state, spriteram, spriteram_size) + AM_RANGE(0xe000, 0xe0ff) AM_RAM AM_BASE_SIZE_MEMBER(superqix_state, m_spriteram, m_spriteram_size) AM_RANGE(0xe100, 0xe7ff) AM_RAM - AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(superqix_videoram_w) AM_BASE_MEMBER(superqix_state, videoram) + AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(superqix_videoram_w) AM_BASE_MEMBER(superqix_state, m_videoram) AM_RANGE(0xf000, 0xffff) AM_RAM ADDRESS_MAP_END @@ -618,8 +618,8 @@ static ADDRESS_MAP_START( sqix_port_map, AS_IO, 8 ) AM_RANGE(0x0408, 0x0408) AM_READ(mcu_acknowledge_r) AM_RANGE(0x0410, 0x0410) AM_WRITE(superqix_0410_w) /* ROM bank, NMI enable, tile bank */ AM_RANGE(0x0418, 0x0418) AM_READ(nmi_ack_r) - AM_RANGE(0x0800, 0x77ff) AM_RAM_WRITE(superqix_bitmapram_w) AM_BASE_MEMBER(superqix_state, bitmapram) - AM_RANGE(0x8800, 0xf7ff) AM_RAM_WRITE(superqix_bitmapram2_w) AM_BASE_MEMBER(superqix_state, bitmapram2) + AM_RANGE(0x0800, 0x77ff) AM_RAM_WRITE(superqix_bitmapram_w) AM_BASE_MEMBER(superqix_state, m_bitmapram) + AM_RANGE(0x8800, 0xf7ff) AM_RAM_WRITE(superqix_bitmapram2_w) AM_BASE_MEMBER(superqix_state, m_bitmapram2) ADDRESS_MAP_END static ADDRESS_MAP_START( bootleg_port_map, AS_IO, 8 ) @@ -631,8 +631,8 @@ static ADDRESS_MAP_START( bootleg_port_map, AS_IO, 8 ) AM_RANGE(0x0408, 0x0408) AM_WRITE(bootleg_flipscreen_w) AM_RANGE(0x0410, 0x0410) AM_WRITE(superqix_0410_w) /* ROM bank, NMI enable, tile bank */ AM_RANGE(0x0418, 0x0418) AM_READ_PORT("SYSTEM") - AM_RANGE(0x0800, 0x77ff) AM_RAM_WRITE(superqix_bitmapram_w) AM_BASE_MEMBER(superqix_state, bitmapram) - AM_RANGE(0x8800, 0xf7ff) AM_RAM_WRITE(superqix_bitmapram2_w) AM_BASE_MEMBER(superqix_state, bitmapram2) + AM_RANGE(0x0800, 0x77ff) AM_RAM_WRITE(superqix_bitmapram_w) AM_BASE_MEMBER(superqix_state, m_bitmapram) + AM_RANGE(0x8800, 0xf7ff) AM_RAM_WRITE(superqix_bitmapram2_w) AM_BASE_MEMBER(superqix_state, m_bitmapram2) ADDRESS_MAP_END @@ -1352,25 +1352,25 @@ ROM_END static DRIVER_INIT( pbillian ) { superqix_state *state = machine.driver_data<superqix_state>(); - state->pbillian_show_power = 1; + state->m_pbillian_show_power = 1; } static DRIVER_INIT( hotsmash ) { superqix_state *state = machine.driver_data<superqix_state>(); - state->pbillian_show_power = 0; + state->m_pbillian_show_power = 0; } static DRIVER_INIT( sqix ) { superqix_state *state = machine.driver_data<superqix_state>(); - state->invert_coin_lockout = 1; + state->m_invert_coin_lockout = 1; } static DRIVER_INIT( sqixa ) { superqix_state *state = machine.driver_data<superqix_state>(); - state->invert_coin_lockout = 0; + state->m_invert_coin_lockout = 0; } static DRIVER_INIT( perestro ) |