diff options
Diffstat (limited to 'src/mess/machine/thomson.c')
-rw-r--r-- | src/mess/machine/thomson.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/mess/machine/thomson.c b/src/mess/machine/thomson.c index 10ac5d13c67..98af0fe6e76 100644 --- a/src/mess/machine/thomson.c +++ b/src/mess/machine/thomson.c @@ -103,7 +103,7 @@ static int to7_get_cassette ( running_machine &machine ) if ( bitpos >= to7_k7_bitsize ) bitpos = to7_k7_bitsize -1; VLOG (( "$%04x %f to7_get_cassette: state=$%X pos=%f samppos=%i bit=%i\n", - cpu_get_previouspc(machine.device("maincpu")), machine.time().as_double(), state, pos, bitpos, + machine.device("maincpu")->safe_pcbase(), machine.time().as_double(), state, pos, bitpos, to7_k7_bits[ bitpos ] )); return to7_k7_bits[ bitpos ]; } @@ -124,7 +124,7 @@ static int to7_get_cassette ( running_machine &machine ) } k = ( chg >= 13 ) ? 1 : 0; VLOG (( "$%04x %f to7_get_cassette: state=$%X pos=%f samppos=%i bit=%i (%i)\n", - cpu_get_previouspc(machine.device("maincpu")), machine.time().as_double(), state, pos, bitpos, + machine.device("maincpu")->safe_pcbase(), machine.time().as_double(), state, pos, bitpos, k, chg )); return k; } @@ -152,7 +152,7 @@ static WRITE8_DEVICE_HANDLER ( to7_set_cassette_motor ) double pos = img->get_position(); LOG (( "$%04x %f to7_set_cassette_motor: cassette motor %s bitpos=%i\n", - cpu_get_previouspc(device->machine().device("maincpu")), img->machine().time().as_double(), data ? "off" : "on", + device->machine().device("maincpu")->safe_pcbase(), img->machine().time().as_double(), data ? "off" : "on", (int) (pos / TO7_BIT_LENGTH) )); if ( (state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED && !data && pos > 0.3 ) @@ -203,7 +203,7 @@ static int mo5_get_cassette ( running_machine &machine ) hbit = hbit >= 0; VLOG (( "$%04x %f mo5_get_cassette: state=$%X pos=%f hbitpos=%i hbit=%i\n", - cpu_get_previouspc(machine.device("maincpu")), machine.time().as_double(), state, pos, + machine.device("maincpu")->safe_pcbase(), machine.time().as_double(), state, pos, (int) (pos / MO5_HBIT_LENGTH), hbit )); return hbit; } @@ -228,7 +228,7 @@ static WRITE8_DEVICE_HANDLER ( mo5_set_cassette_motor ) double pos = img->get_position(); LOG (( "$%04x %f mo5_set_cassette_motor: cassette motor %s hbitpos=%i\n", - cpu_get_previouspc(device->machine().device("maincpu")), device->machine().time().as_double(), data ? "off" : "on", + device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data ? "off" : "on", (int) (pos / MO5_HBIT_LENGTH) )); if ( (state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED && !data && pos > 0.3 ) @@ -734,7 +734,7 @@ WRITE8_MEMBER( to7_io_line_device::porta_out ) int tx = data & 1; int dtr = ( data & 2 ) ? 1 : 0; - LOG_IO(( "$%04x %f to7_io_porta_out: tx=%i, dtr=%i\n", cpu_get_previouspc(machine().device("maincpu")), machine().time().as_double(), tx, dtr )); + LOG_IO(( "$%04x %f to7_io_porta_out: tx=%i, dtr=%i\n", machine().device("maincpu")->safe_pcbase(), machine().time().as_double(), tx, dtr )); if ( dtr ) m_connection_state |= SERIAL_STATE_DTR; else @@ -758,7 +758,7 @@ READ8_MEMBER( to7_io_line_device::porta_in ) else cts = !printer->busy_r(); - LOG_IO(( "$%04x %f to7_io_porta_in: mode=%i cts=%i, dsr=%i, rd=%i\n", cpu_get_previouspc(machine().device("maincpu")), machine().time().as_double(), to7_io_mode(machine()), cts, dsr, rd )); + LOG_IO(( "$%04x %f to7_io_porta_in: mode=%i cts=%i, dsr=%i, rd=%i\n", machine().device("maincpu")->safe_pcbase(), machine().time().as_double(), to7_io_mode(machine()), cts, dsr, rd )); return (dsr ? 0x20 : 0) | (cts ? 0x40 : 0) | (rd ? 0x80: 0); } @@ -769,7 +769,7 @@ static WRITE8_DEVICE_HANDLER( to7_io_portb_out ) { centronics_device *printer = device->machine().device<centronics_device>("centronics"); - LOG_IO(( "$%04x %f to7_io_portb_out: CENTRONICS set data=$%02X\n", cpu_get_previouspc(device->machine().device("maincpu")), device->machine().time().as_double(), data )); + LOG_IO(( "$%04x %f to7_io_portb_out: CENTRONICS set data=$%02X\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data )); /* set 8-bit data */ printer->write( *device->machine().memory().first_space(), 0, data); @@ -781,7 +781,7 @@ static WRITE8_DEVICE_HANDLER( to7_io_cb2_out ) { centronics_device *printer = device->machine().device<centronics_device>("centronics"); - LOG_IO(( "$%04x %f to7_io_cb2_out: CENTRONICS set strobe=%i\n", cpu_get_previouspc(device->machine().device("maincpu")), device->machine().time().as_double(), data )); + LOG_IO(( "$%04x %f to7_io_cb2_out: CENTRONICS set strobe=%i\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data )); /* send STROBE to printer */ printer->strobe_w(data); @@ -1283,7 +1283,7 @@ READ8_HANDLER ( to7_midi_r ) /* bit 6: parity error (ignored) */ /* bit 7: interrupt */ LOG_MIDI(( "$%04x %f to7_midi_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, irq=%i)\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), to7_midi_status, + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to7_midi_status, (to7_midi_status & ACIA_6850_RDRF) ? 1 : 0, (to7_midi_status & ACIA_6850_TDRE) ? 1 : 0, (to7_midi_status & ACIA_6850_OVRN) ? 1 : 0, @@ -1303,7 +1303,7 @@ READ8_HANDLER ( to7_midi_r ) to7_midi_status &= ~ACIA_6850_OVRN; to7_midi_overrun = 0; LOG_MIDI(( "$%04x %f to7_midi_r: read data $%02X\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), data )); + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data )); to7_midi_update_irq( space->machine() ); } return data; @@ -1312,7 +1312,7 @@ READ8_HANDLER ( to7_midi_r ) default: logerror( "$%04x to7_midi_r: invalid offset %i\n", - cpu_get_previouspc(space->machine().device("maincpu")), offset ); + space->machine().device("maincpu")->safe_pcbase(), offset ); return 0; } } @@ -1331,7 +1331,7 @@ WRITE8_HANDLER ( to7_midi_w ) if ( (data & 3) == 3 ) { /* reset */ - LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), data )); + LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data )); to7_midi_overrun = 0; to7_midi_status = 2; to7_midi_intr = 0; @@ -1348,7 +1348,7 @@ WRITE8_HANDLER ( to7_midi_w ) static const int stop[8] = { 2,2,1,1,2,1,1,1 }; static const char parity[8] = { 'e','o','e','o','-','-','e','o' }; LOG_MIDI(( "$%04x %f to7_midi_w: set control to $%02X (bits=%i, stop=%i, parity=%c, intr in=%i out=%i)\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, bits[ (data >> 2) & 7 ], stop[ (data >> 2) & 7 ], @@ -1362,7 +1362,7 @@ WRITE8_HANDLER ( to7_midi_w ) case 1: /* output data */ - LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), data )); + LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data )); if ( data == 0x55 ) /* cable-detect: shortcut */ chardev_fake_in( to7_midi_chardev, 0x55 ); @@ -1376,7 +1376,7 @@ WRITE8_HANDLER ( to7_midi_w ) default: - logerror( "$%04x to7_midi_w: invalid offset %i (data=$%02X) \n", cpu_get_previouspc(space->machine().device("maincpu")), offset, data ); + logerror( "$%04x to7_midi_w: invalid offset %i (data=$%02X) \n", space->machine().device("maincpu")->safe_pcbase(), offset, data ); } } @@ -1546,7 +1546,7 @@ MACHINE_START ( to7 ) static WRITE8_DEVICE_HANDLER ( to770_sys_cb2_out ) { /* video overlay: black pixels are transparent and show TV image underneath */ - LOG(( "$%04x to770_sys_cb2_out: video overlay %i\n", cpu_get_previouspc(device->machine().device("maincpu")), data )); + LOG(( "$%04x to770_sys_cb2_out: video overlay %i\n", device->machine().device("maincpu")->safe_pcbase(), data )); } @@ -1690,7 +1690,7 @@ READ8_HANDLER ( to770_gatearray_r ) case 2: return (lt3 << 7) | (inil << 6); case 3: return (init << 7); default: - logerror( "$%04x to770_gatearray_r: invalid offset %i\n", cpu_get_previouspc(space->machine().device("maincpu")), offset ); + logerror( "$%04x to770_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset ); return 0; } } @@ -1921,7 +1921,7 @@ READ8_HANDLER ( mo5_gatearray_r ) case 2: return (lt3 << 7) | (inil << 6); case 3: return (init << 7); default: - logerror( "$%04x mo5_gatearray_r: invalid offset %i\n", cpu_get_previouspc(space->machine().device("maincpu")), offset ); + logerror( "$%04x mo5_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset ); return 0; } } @@ -2203,14 +2203,14 @@ MACHINE_START ( mo5 ) WRITE8_HANDLER ( to9_ieee_w ) { - logerror( "$%04x %f to9_ieee_w: unhandled write $%02X to register %i\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), data, offset ); + logerror( "$%04x %f to9_ieee_w: unhandled write $%02X to register %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, offset ); } READ8_HANDLER ( to9_ieee_r ) { - logerror( "$%04x %f to9_ieee_r: unhandled read from register %i\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), offset ); + logerror( "$%04x %f to9_ieee_r: unhandled read from register %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset ); return 0; } @@ -2241,7 +2241,7 @@ READ8_HANDLER ( to9_gatearray_r ) case 2: return (lt3 << 7) | (inil << 6); case 3: return (v.init << 7) | (init << 6); /* != TO7/70 */ default: - logerror( "$%04x to9_gatearray_r: invalid offset %i\n", cpu_get_previouspc(space->machine().device("maincpu")), offset ); + logerror( "$%04x to9_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset ); return 0; } } @@ -2339,7 +2339,7 @@ READ8_HANDLER ( to9_vreg_r ) WRITE8_HANDLER ( to9_vreg_w ) { - LOG_VIDEO(( "$%04x %f to9_vreg_w: off=%i ($%04X) data=$%02X\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), offset, 0xe7da + offset, data )); + LOG_VIDEO(( "$%04x %f to9_vreg_w: off=%i ($%04X) data=$%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xe7da + offset, data )); switch ( offset ) { @@ -2668,7 +2668,7 @@ READ8_HANDLER ( to9_kbd_r ) /* bit 7: interrupt */ LOG_KBD(( "$%04x %f to9_kbd_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, pe=%i, irq=%i)\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), to9_kbd_status, + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to9_kbd_status, (to9_kbd_status & ACIA_6850_RDRF) ? 1 : 0, (to9_kbd_status & ACIA_6850_TDRE) ? 1 : 0, (to9_kbd_status & ACIA_6850_OVRN) ? 1 : 0, @@ -2685,13 +2685,13 @@ READ8_HANDLER ( to9_kbd_r ) else to9_kbd_status &= ~(ACIA_6850_OVRN | ACIA_6850_RDRF); to9_kbd_overrun = 0; - LOG_KBD(( "$%04x %f to9_kbd_r: read data $%02X\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), to9_kbd_in )); + LOG_KBD(( "$%04x %f to9_kbd_r: read data $%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to9_kbd_in )); to9_kbd_update_irq(space->machine()); } return to9_kbd_in; default: - logerror( "$%04x to9_kbd_r: invalid offset %i\n", cpu_get_previouspc(space->machine().device("maincpu")), offset ); + logerror( "$%04x to9_kbd_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset ); return 0; } } @@ -2713,7 +2713,7 @@ WRITE8_HANDLER ( to9_kbd_w ) to9_kbd_overrun = 0; to9_kbd_status = ACIA_6850_TDRE; to9_kbd_intr = 0; - LOG_KBD(( "$%04x %f to9_kbd_w: reset (data=$%02X)\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), data )); + LOG_KBD(( "$%04x %f to9_kbd_w: reset (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data )); } else { @@ -2727,7 +2727,7 @@ WRITE8_HANDLER ( to9_kbd_w ) to9_kbd_intr = data >> 5; LOG_KBD(( "$%04x %f to9_kbd_w: set control to $%02X (parity=%i, intr in=%i out=%i)\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, to9_kbd_parity, to9_kbd_intr >> 2, (to9_kbd_intr & 3) ? 1 : 0 )); } @@ -2758,19 +2758,19 @@ WRITE8_HANDLER ( to9_kbd_w ) case 0xFE: to9_kbd_periph = 0; break; default: - logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), data ); + logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ); } thom_set_caps_led( space->machine(), !to9_kbd_caps ); LOG(( "$%04x %f to9_kbd_w: kbd command %02X (caps=%i, pad=%i, periph=%i)\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), data, + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, to9_kbd_caps, to9_kbd_pad, to9_kbd_periph )); break; default: - logerror( "$%04x to9_kbd_w: invalid offset %i (data=$%02X) \n", cpu_get_previouspc(space->machine().device("maincpu")), offset, data ); + logerror( "$%04x to9_kbd_w: invalid offset %i (data=$%02X) \n", space->machine().device("maincpu")->safe_pcbase(), offset, data ); } } @@ -3916,12 +3916,12 @@ READ8_HANDLER ( to8_gatearray_r ) break; default: - logerror( "$%04x to8_gatearray_r: invalid offset %i\n", cpu_get_previouspc(space->machine().device("maincpu")), offset ); + logerror( "$%04x to8_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset ); res = 0; } LOG_VIDEO(( "$%04x %f to8_gatearray_r: off=%i ($%04X) res=$%02X lightpen=%i\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xe7e4 + offset, res, to7_lightpen )); return res; @@ -3932,7 +3932,7 @@ READ8_HANDLER ( to8_gatearray_r ) WRITE8_HANDLER ( to8_gatearray_w ) { LOG_VIDEO(( "$%04x %f to8_gatearray_w: off=%i ($%04X) data=$%02X\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xe7e4 + offset, data )); switch ( offset ) @@ -3964,7 +3964,7 @@ WRITE8_HANDLER ( to8_gatearray_w ) default: logerror( "$%04x to8_gatearray_w: invalid offset %i (data=$%02X)\n", - cpu_get_previouspc(space->machine().device("maincpu")), offset, data ); + space->machine().device("maincpu")->safe_pcbase(), offset, data ); } } @@ -4019,7 +4019,7 @@ READ8_HANDLER ( to8_vreg_r ) WRITE8_HANDLER ( to8_vreg_w ) { LOG_VIDEO(( "$%04x %f to8_vreg_w: off=%i ($%04X) data=$%02X\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xe7da + offset, data )); switch ( offset ) @@ -4075,7 +4075,7 @@ static READ8_DEVICE_HANDLER ( to8_sys_porta_in ) { int ktest = to8_kbd_ktest (device->machine()); - LOG_KBD(( "$%04x %f: to8_sys_porta_in ktest=%i\n", cpu_get_previouspc(device->machine().device("maincpu")), device->machine().time().as_double(), ktest )); + LOG_KBD(( "$%04x %f: to8_sys_porta_in ktest=%i\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), ktest )); return ktest; } @@ -4757,7 +4757,7 @@ static WRITE8_DEVICE_HANDLER ( mo6_game_porta_out ) { centronics_device *printer = device->machine().device<centronics_device>("centronics"); - LOG (( "$%04x %f mo6_game_porta_out: CENTRONICS set data=$%02X\n", cpu_get_previouspc(device->machine().device("maincpu")), device->machine().time().as_double(), data )); + LOG (( "$%04x %f mo6_game_porta_out: CENTRONICS set data=$%02X\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data )); /* centronics data */ printer->write( *device->machine().memory().first_space(), 0, data); @@ -4769,7 +4769,7 @@ static WRITE8_DEVICE_HANDLER ( mo6_game_cb2_out ) { centronics_device *printer = device->machine().device<centronics_device>("centronics"); - LOG (( "$%04x %f mo6_game_cb2_out: CENTRONICS set strobe=%i\n", cpu_get_previouspc(device->machine().device("maincpu")), device->machine().time().as_double(), data )); + LOG (( "$%04x %f mo6_game_cb2_out: CENTRONICS set strobe=%i\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data )); /* centronics strobe */ printer->strobe_w(data); @@ -4975,12 +4975,12 @@ READ8_HANDLER ( mo6_gatearray_r ) break; default: - logerror( "$%04x mo6_gatearray_r: invalid offset %i\n", cpu_get_previouspc(space->machine().device("maincpu")), offset ); + logerror( "$%04x mo6_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset ); res = 0; } LOG_VIDEO(( "$%04x %f mo6_gatearray_r: off=%i ($%04X) res=$%02X lightpen=%i\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xa7e4 + offset, res, to7_lightpen )); return res; @@ -4991,7 +4991,7 @@ READ8_HANDLER ( mo6_gatearray_r ) WRITE8_HANDLER ( mo6_gatearray_w ) { LOG_VIDEO(( "$%04x %f mo6_gatearray_w: off=%i ($%04X) data=$%02X\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xa7e4 + offset, data )); switch ( offset ) @@ -5021,7 +5021,7 @@ WRITE8_HANDLER ( mo6_gatearray_w ) break; default: - logerror( "$%04x mo6_gatearray_w: invalid offset %i (data=$%02X)\n", cpu_get_previouspc(space->machine().device("maincpu")), offset, data ); + logerror( "$%04x mo6_gatearray_w: invalid offset %i (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), offset, data ); } } @@ -5061,7 +5061,7 @@ READ8_HANDLER ( mo6_vreg_r ) WRITE8_HANDLER ( mo6_vreg_w ) { LOG_VIDEO(( "$%04x %f mo6_vreg_w: off=%i ($%04X) data=$%02X\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xa7da + offset, data )); switch ( offset ) @@ -5219,7 +5219,7 @@ READ8_HANDLER ( mo5nr_net_r ) if ( to7_controller_type ) return to7_floppy_r ( space, offset ); - logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), offset ); + logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset ); return 0; } @@ -5232,7 +5232,7 @@ WRITE8_HANDLER ( mo5nr_net_w ) to7_floppy_w ( space, offset, data ); else logerror( "$%04x %f mo5nr_net_w: write $%02X to reg %i\n", - cpu_get_previouspc(space->machine().device("maincpu")), space->machine().time().as_double(), data, offset ); + space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, offset ); } |