(MESS) changed logging to use machine().describe_context(). (nw)

This commit is contained in:
smf- 2013-04-13 20:09:09 +00:00
parent 7bf57783e7
commit e01e0d1687
2 changed files with 34 additions and 34 deletions

View File

@ -160,8 +160,8 @@ static void hp48_rs232_send_byte( running_machine &machine )
hp48_state *state = machine.driver_data<hp48_state>(); hp48_state *state = machine.driver_data<hp48_state>();
UINT8 data = HP48_IO_8(0x16); /* byte to send */ UINT8 data = HP48_IO_8(0x16); /* byte to send */
LOG_SERIAL(( "%05x %f hp48_rs232_send_byte: start sending, data=%02x\n", LOG_SERIAL(( "%s %f hp48_rs232_send_byte: start sending, data=%02x\n",
machine.device("maincpu")->safe_pcbase(), machine.time().as_double(), data )); machine.describe_context(), machine.time().as_double(), data ));
/* set byte sending and send buffer full */ /* set byte sending and send buffer full */
state->m_io[0x12] |= 3; state->m_io[0x12] |= 3;
@ -237,8 +237,8 @@ static const chardev_interface hp48_chardev_iface =
void hp48_reg_out( device_t *device, int out ) void hp48_reg_out( device_t *device, int out )
{ {
hp48_state *state = device->machine().driver_data<hp48_state>(); hp48_state *state = device->machine().driver_data<hp48_state>();
LOG(( "%05x %f hp48_reg_out: %03x\n", LOG(( "%s %f hp48_reg_out: %03x\n",
device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), out )); device->machine().describe_context(), device->machine().time().as_double(), out ));
/* bits 0-8: keyboard lines */ /* bits 0-8: keyboard lines */
state->m_out = out & 0x1ff; state->m_out = out & 0x1ff;
@ -275,8 +275,8 @@ static int hp48_get_in( running_machine &machine )
int hp48_reg_in( device_t *device ) int hp48_reg_in( device_t *device )
{ {
int in = hp48_get_in(device->machine()); int in = hp48_get_in(device->machine());
LOG(( "%05x %f hp48_reg_in: %04x\n", LOG(( "%s %f hp48_reg_in: %04x\n",
device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), in )); device->machine().describe_context(), device->machine().time().as_double(), in ));
return in; return in;
} }
@ -320,7 +320,7 @@ TIMER_CALLBACK_MEMBER(hp48_state::hp48_kbd_cb)
void hp48_rsi( device_t *device ) void hp48_rsi( device_t *device )
{ {
hp48_state *state = device->machine().driver_data<hp48_state>(); hp48_state *state = device->machine().driver_data<hp48_state>();
LOG(( "%05x %f hp48_rsi\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double() )); LOG(( "%s %f hp48_rsi\n", device->machine().describe_context(), device->machine().time().as_double() ));
/* enables interrupts on key repeat /* enables interrupts on key repeat
(normally, there is only one interrupt, when the key is pressed) (normally, there is only one interrupt, when the key is pressed)
@ -362,8 +362,8 @@ void hp48_state::hp48_update_annunciators()
WRITE8_MEMBER(hp48_state::hp48_io_w) WRITE8_MEMBER(hp48_state::hp48_io_w)
{ {
LOG(( "%05x %f hp48_io_w: off=%02x data=%x\n", LOG(( "%s %f hp48_io_w: off=%02x data=%x\n",
space.device().safe_pcbase(), space.machine().time().as_double(), offset, data )); space.machine().describe_context(), space.machine().time().as_double(), offset, data ));
switch( offset ) switch( offset )
{ {
@ -405,7 +405,7 @@ WRITE8_MEMBER(hp48_state::hp48_io_w)
/* cards */ /* cards */
case 0x0e: case 0x0e:
LOG(( "%05x: card control write %02x\n", space.device().safe_pcbase(), data )); LOG(( "%s: card control write %02x\n", space.machine().describe_context(), data ));
/* bit 0: software interrupt */ /* bit 0: software interrupt */
if ( data & 1 ) if ( data & 1 )
@ -424,7 +424,7 @@ WRITE8_MEMBER(hp48_state::hp48_io_w)
break; break;
case 0x0f: case 0x0f:
LOG(( "%05x: card info write %02x\n", space.device().safe_pcbase(), data )); LOG(( "%s: card info write %02x\n", space.machine().describe_context(), data ));
m_io[0x0f] = data; m_io[0x0f] = data;
break; break;
@ -554,7 +554,7 @@ READ8_MEMBER(hp48_state::hp48_io_r)
/* cards */ /* cards */
case 0x0e: /* detection */ case 0x0e: /* detection */
data = m_io[0x0e]; data = m_io[0x0e];
LOG(( "%05x: card control read %02x\n", space.device().safe_pcbase(), data )); LOG(( "%s: card control read %02x\n", space.machine().describe_context(), data ));
break; break;
case 0x0f: /* card info */ case 0x0f: /* card info */
data = 0; data = 0;
@ -572,15 +572,15 @@ READ8_MEMBER(hp48_state::hp48_io_r)
if ( m_port_size[0] && m_port_write[0] ) data |= 4; if ( m_port_size[0] && m_port_write[0] ) data |= 4;
if ( m_port_size[1] && m_port_write[1] ) data |= 8; if ( m_port_size[1] && m_port_write[1] ) data |= 8;
} }
LOG(( "%05x: card info read %02x\n", space.device().safe_pcbase(), data )); LOG(( "%s: card info read %02x\n", space.machine().describe_context(), data ));
break; break;
default: data = m_io[offset]; default: data = m_io[offset];
} }
LOG(( "%05x %f hp48_io_r: off=%02x data=%x\n", LOG(( "%s %f hp48_io_r: off=%02x data=%x\n",
space.device().safe_pcbase(), space.machine().time().as_double(), offset, data )); space.machine().describe_context(), space.machine().time().as_double(), offset, data ));
return data; return data;
} }
@ -593,7 +593,7 @@ READ8_MEMBER(hp48_state::hp48_bank_r)
offset &= 0x7e; offset &= 0x7e;
if ( m_bank_switch != offset ) if ( m_bank_switch != offset )
{ {
LOG(( "%05x %f hp48_bank_r: off=%03x\n", space.device().safe_pcbase(), space.machine().time().as_double(), offset )); LOG(( "%s %f hp48_bank_r: off=%03x\n", space.machine().describe_context(), space.machine().time().as_double(), offset ));
m_bank_switch = offset; m_bank_switch = offset;
hp48_apply_modules(); hp48_apply_modules();
} }
@ -823,7 +823,7 @@ static void hp48_reset_modules( running_machine &machine )
/* RESET opcode */ /* RESET opcode */
void hp48_mem_reset( device_t *device ) void hp48_mem_reset( device_t *device )
{ {
LOG(( "%05x %f hp48_mem_reset\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double() )); LOG(( "%s %f hp48_mem_reset\n", device->machine().describe_context(), device->machine().time().as_double() ));
hp48_reset_modules(device->machine()); hp48_reset_modules(device->machine());
} }
@ -834,7 +834,7 @@ void hp48_mem_config( device_t *device, int v )
hp48_state *state = device->machine().driver_data<hp48_state>(); hp48_state *state = device->machine().driver_data<hp48_state>();
int i; int i;
LOG(( "%05x %f hp48_mem_config: %05x\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), v )); LOG(( "%s %f hp48_mem_config: %05x\n", device->machine().describe_context(), device->machine().time().as_double(), v ));
/* find the highest priority unconfigured module (except non-configurable NCE1)... */ /* find the highest priority unconfigured module (except non-configurable NCE1)... */
for ( i = 0; i < 5; i++ ) for ( i = 0; i < 5; i++ )
@ -866,7 +866,7 @@ void hp48_mem_unconfig( device_t *device, int v )
{ {
hp48_state *state = device->machine().driver_data<hp48_state>(); hp48_state *state = device->machine().driver_data<hp48_state>();
int i; int i;
LOG(( "%05x %f hp48_mem_unconfig: %05x\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), v )); LOG(( "%s %f hp48_mem_unconfig: %05x\n", device->machine().describe_context(), device->machine().time().as_double(), v ));
/* find the highest priority fully configured module at address v (except NCE1)... */ /* find the highest priority fully configured module at address v (except NCE1)... */
for ( i = 0; i < 5; i++ ) for ( i = 0; i < 5; i++ )
@ -909,8 +909,8 @@ int hp48_mem_id( device_t *device )
} }
} }
LOG(( "%05x %f hp48_mem_id = %02x\n", LOG(( "%s %f hp48_mem_id = %02x\n",
device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data )); device->machine().describe_context(), device->machine().time().as_double(), data ));
return data; /* everything is configured */ return data; /* everything is configured */
} }

View File

@ -684,7 +684,7 @@ WRITE8_MEMBER( to7_io_line_device::porta_out )
int tx = data & 1; int tx = data & 1;
int dtr = ( data & 2 ) ? 1 : 0; int dtr = ( data & 2 ) ? 1 : 0;
LOG_IO(( "$%04x %f to7_io_porta_out: tx=%i, dtr=%i\n", machine().device("maincpu")->safe_pcbase(), machine().time().as_double(), tx, dtr )); LOG_IO(( "%s %f to7_io_porta_out: tx=%i, dtr=%i\n", machine().describe_context(), machine().time().as_double(), tx, dtr ));
if ( dtr ) if ( dtr )
m_connection_state |= SERIAL_STATE_DTR; m_connection_state |= SERIAL_STATE_DTR;
else else
@ -708,7 +708,7 @@ READ8_MEMBER( to7_io_line_device::porta_in )
else else
cts = !printer->busy_r(); cts = !printer->busy_r();
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(), machine().driver_data<thomson_state>()->to7_io_mode(), cts, dsr, rd )); LOG_IO(( "%s %f to7_io_porta_in: mode=%i cts=%i, dsr=%i, rd=%i\n", machine().describe_context(), machine().time().as_double(), machine().driver_data<thomson_state>()->to7_io_mode(), cts, dsr, rd ));
return (dsr ? 0x20 : 0) | (cts ? 0x40 : 0) | (rd ? 0x80: 0); return (dsr ? 0x20 : 0) | (cts ? 0x40 : 0) | (rd ? 0x80: 0);
} }
@ -1204,8 +1204,8 @@ READ8_HANDLER ( to7_midi_r )
/* bit 5: overrun */ /* bit 5: overrun */
/* bit 6: parity error (ignored) */ /* bit 6: parity error (ignored) */
/* bit 7: interrupt */ /* bit 7: interrupt */
LOG_MIDI(( "$%04x %f to7_midi_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, irq=%i)\n", LOG_MIDI(( "%s %f to7_midi_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, irq=%i)\n",
space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), to7_midi_status, space.machine().describe_context(), space.machine().time().as_double(), to7_midi_status,
(to7_midi_status & ACIA_6850_RDRF) ? 1 : 0, (to7_midi_status & ACIA_6850_RDRF) ? 1 : 0,
(to7_midi_status & ACIA_6850_TDRE) ? 1 : 0, (to7_midi_status & ACIA_6850_TDRE) ? 1 : 0,
(to7_midi_status & ACIA_6850_OVRN) ? 1 : 0, (to7_midi_status & ACIA_6850_OVRN) ? 1 : 0,
@ -1224,8 +1224,8 @@ READ8_HANDLER ( to7_midi_r )
else else
to7_midi_status &= ~ACIA_6850_OVRN; to7_midi_status &= ~ACIA_6850_OVRN;
to7_midi_overrun = 0; to7_midi_overrun = 0;
LOG_MIDI(( "$%04x %f to7_midi_r: read data $%02X\n", LOG_MIDI(( "%s %f to7_midi_r: read data $%02X\n",
space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data )); space.machine().describe_context(), space.machine().time().as_double(), data ));
to7_midi_update_irq( space.machine() ); to7_midi_update_irq( space.machine() );
} }
return data; return data;
@ -1233,8 +1233,8 @@ READ8_HANDLER ( to7_midi_r )
default: default:
logerror( "$%04x to7_midi_r: invalid offset %i\n", logerror( "%s to7_midi_r: invalid offset %i\n",
space.machine().device("maincpu")->safe_pcbase(), offset ); space.machine().describe_context(), offset );
return 0; return 0;
} }
} }
@ -1252,7 +1252,7 @@ WRITE8_HANDLER ( to7_midi_w )
if ( (data & 3) == 3 ) if ( (data & 3) == 3 )
{ {
/* reset */ /* reset */
LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data )); LOG_MIDI(( "%s %f to7_midi_w: reset (data=$%02X)\n", space.machine().describe_context(), space.machine().time().as_double(), data ));
to7_midi_overrun = 0; to7_midi_overrun = 0;
to7_midi_status = 2; to7_midi_status = 2;
to7_midi_intr = 0; to7_midi_intr = 0;
@ -1268,8 +1268,8 @@ WRITE8_HANDLER ( to7_midi_w )
static const int bits[8] = { 7,7,7,7,8,8,8,8 }; static const int bits[8] = { 7,7,7,7,8,8,8,8 };
static const int stop[8] = { 2,2,1,1,2,1,1,1 }; static const int stop[8] = { 2,2,1,1,2,1,1,1 };
static const char parity[8] = { 'e','o','e','o','-','-','e','o' }; 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", LOG_MIDI(( "%s %f to7_midi_w: set control to $%02X (bits=%i, stop=%i, parity=%c, intr in=%i out=%i)\n",
space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), space.machine().describe_context(), space.machine().time().as_double(),
data, data,
bits[ (data >> 2) & 7 ], bits[ (data >> 2) & 7 ],
stop[ (data >> 2) & 7 ], stop[ (data >> 2) & 7 ],
@ -1283,7 +1283,7 @@ WRITE8_HANDLER ( to7_midi_w )
case 1: /* output data */ case 1: /* output data */
LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data )); LOG_MIDI(( "%s %f to7_midi_w: write data $%02X\n", space.machine().describe_context(), space.machine().time().as_double(), data ));
if ( data == 0x55 ) if ( data == 0x55 )
/* cable-detect: shortcut */ /* cable-detect: shortcut */
chardev_fake_in( to7_midi_chardev, 0x55 ); chardev_fake_in( to7_midi_chardev, 0x55 );
@ -1297,7 +1297,7 @@ WRITE8_HANDLER ( to7_midi_w )
default: default:
logerror( "$%04x to7_midi_w: invalid offset %i (data=$%02X) \n", space.machine().device("maincpu")->safe_pcbase(), offset, data ); logerror( "%s to7_midi_w: invalid offset %i (data=$%02X) \n", space.machine().describe_context(), offset, data );
} }
} }