14
14
15
15
#include " main.h"
16
16
17
- // **************************************************************************
18
- // External panel support
19
- // **************************************************************************
17
+ #define VERBOSE 0
18
+ #include " logmacro.h"
20
19
21
20
#include < list>
22
21
#include < mutex>
@@ -123,16 +122,16 @@ void esqpanel_device::rcv_complete() // Rx completed receiving byte
123
122
receive_register_extract ();
124
123
uint8_t data = get_received_char ();
125
124
126
- // if (data >= 0xe0) prinosd_printf_debugtf ("Got %02x from motherboard (second %s)\n", data, m_expect_calibration_second_byte ? "yes" : "no");
125
+ // if (data >= 0xe0) LOG ("Got %02x from motherboard (second %s)\n", data, m_expect_calibration_second_byte ? "yes" : "no");
127
126
128
127
send_to_display (data);
129
128
130
129
if (m_expect_calibration_second_byte)
131
130
{
132
- // osd_printf_debug ("second byte is %02x\n", data);
131
+ // LOG ("second byte is %02x\n", data);
133
132
if (data == 0xfd ) // calibration request
134
133
{
135
- // osd_printf_debug ("let's send reply!\n");
134
+ // LOG ("let's send reply!\n");
136
135
xmit_char (0xff ); // this is the correct response for "calibration OK"
137
136
}
138
137
m_expect_calibration_second_byte = false ;
@@ -198,7 +197,7 @@ void esqpanel_device::rcv_complete() // Rx completed receiving byte
198
197
199
198
void esqpanel_device::tra_complete () // Tx completed sending byte
200
199
{
201
- // osd_printf_debug ("panel Tx complete\n");
200
+ // LOG ("panel Tx complete\n");
202
201
// is there more waiting to send?
203
202
if (m_xmit_read != m_xmit_write)
204
203
{
@@ -221,7 +220,7 @@ void esqpanel_device::tra_callback() // Tx send bit
221
220
222
221
void esqpanel_device::xmit_char (uint8_t data)
223
222
{
224
- // osd_printf_debug ("Panel: xmit %02x\n", data);
223
+ // LOG ("Panel: xmit %02x\n", data);
225
224
226
225
// if tx is busy it'll pick this up automatically when it completes
227
226
if (!m_tx_busy)
@@ -252,16 +251,16 @@ uint16_t esqpanel_device::get_analog_value(offs_t offset)
252
251
253
252
void esqpanel_device::set_button (uint8_t button, bool pressed)
254
253
{
255
- // osd_printf_debug("esqpanel. set_button(%d, %d)\r\n", button, pressed);
254
+ LOG ( " set_button(%d, %d)\r\n " , button, pressed);
256
255
bool current = m_pressed_buttons.find (button) != m_pressed_buttons.end ();
257
256
if (pressed == current)
258
257
{
259
- // osd_printf_debug ("- button %d already %d, skipping\r\n", button, pressed);
258
+ LOG (" - button %d already %d, skipping\r\n " , button, pressed);
260
259
return ;
261
260
}
262
261
263
262
uint8_t sendme = (pressed ? 0x80 : 0 ) | (button & 0xff );
264
- // osd_printf_debug ("button %d %s : sending char to mainboard: %02x\n", button, down ? "down" : "up", sendme);
263
+ // LOG ("button %d %s : sending char to mainboard: %02x\n", button, pressed ? "down" : "up", sendme);
265
264
xmit_char (sendme);
266
265
xmit_char (0x00 );
267
266
if (pressed)
@@ -280,7 +279,7 @@ TIMER_CALLBACK_MEMBER(esqpanel_device::check_external_panel_server) {
280
279
{
281
280
switch (c.kind ) {
282
281
case esq_external_panel_device::Command::ButtonKind:
283
- // osd_printf_debug ("Panel Handling button event from external panel\r\n");
282
+ LOG (" Panel Handling button event from external panel\r\n " );
284
283
set_button (c.button , c.pressed );
285
284
break ;
286
285
@@ -361,14 +360,14 @@ void esqpanel2x40_vfx_device::rcv_complete() // Rx completed receiving byte
361
360
receive_register_extract ();
362
361
uint8_t data = get_received_char ();
363
362
364
- // if (data >= 0xe0) osd_printf_debug ("Got %02x from motherboard (second %s)\n", data, m_expect_calibration_second_byte ? "yes" : "no");
363
+ // if (data >= 0xe0) LOG ("Got %02x from motherboard (second %s)\n", data, m_expect_calibration_second_byte ? "yes" : "no");
365
364
366
365
if (m_expect_calibration_second_byte)
367
366
{
368
- // osd_printf_debug ("second byte is %02x\n", data);
367
+ // LOG ("second byte is %02x\n", data);
369
368
if (data == 0xfd ) // calibration request
370
369
{
371
- // osd_printf_debug ("let's send reply!\n");
370
+ // LOG ("let's send reply!\n");
372
371
xmit_char (0xff ); // this is the correct response for "calibration OK"
373
372
}
374
373
m_expect_calibration_second_byte = false ;
@@ -471,7 +470,7 @@ void esqpanel2x40_vfx_device::rcv_complete() // Rx completed receiving byte
471
470
break ;
472
471
473
472
default :
474
- // osd_printf_debug ("Unknown control code %02x\n", data);
473
+ // LOG ("Unknown control code %02x\n", data);
475
474
break ;
476
475
}
477
476
}
@@ -668,15 +667,15 @@ INPUT_CHANGED_MEMBER(esqpanel2x40_vfx_device::analog_value_change)
668
667
if (oldval == 255 )
669
668
{
670
669
// This is the initial write from the layout. Skip this.
671
- osd_printf_debug (" skipping initial write from internal panel to channnel %d\r\n " , param);
670
+ LOG (" skipping initial write from internal panel to channnel %d\r\n " , param);
672
671
return ;
673
672
}
674
673
675
674
int channel = param;
676
675
int clamped = std::max (0 , std::min (100 , (int )newval));
677
676
int value = (1023 << 6 ) * clamped / 100 ;
678
677
esqpanel_device::set_analog_value (channel, value);
679
- osd_printf_debug (" sending analog channel %d value %d to external panel\r\n " , channel, value);
678
+ LOG (" sending analog channel %d value %d to external panel\r\n " , channel, value);
680
679
m_external_panel->set_analog_value (channel, value);
681
680
}
682
681
@@ -692,12 +691,12 @@ void esqpanel2x40_vfx_device::set_analog_value(offs_t offset, uint16_t value)
692
691
if (offset == 3 )
693
692
{
694
693
set_adjuster_value (m_analog_data_entry, intvalue);
695
- osd_printf_debug (" Setting data entry io port to %d\r\n " , intvalue);
694
+ LOG (" Setting data entry io port to %d\r\n " , intvalue);
696
695
}
697
696
else if (offset == 5 )
698
697
{
699
698
set_adjuster_value (m_analog_volume, intvalue);
700
- osd_printf_debug (" Setting volume io port to %d\r\n " , intvalue);
699
+ LOG (" Setting volume io port to %d\r\n " , intvalue);
701
700
}
702
701
}
703
702
0 commit comments