diff options
author | Aaron Giles <aaron@aarongiles.com> | 2007-12-31 02:04:39 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2007-12-31 02:04:39 +0000 |
commit | 460437f8d13a49302d5ce11cf5ba613083e4780a (patch) | |
tree | fcc6a7819ef6078d7ba6925e368438e33d62d06e /src/mame/machine | |
parent | 3f6e8e1abfc478371e1e6f1a9cd317fbf5460424 (diff) |
(From Atari Ace)
The attached patch adjusts most conditional logging in MAME to use the
idiom "do { if (VERBOSE) logerror x; } while (0)". This has the
benefit that the compiler checks the syntax of the logging even in the
case it will be eliminated, and in fact a number of cases here needed
adjustments to compile because of this.
Diffstat (limited to 'src/mame/machine')
-rw-r--r-- | src/mame/machine/amiga.c | 20 | ||||
-rw-r--r-- | src/mame/machine/arkanoid.c | 12 | ||||
-rw-r--r-- | src/mame/machine/atari.c | 15 | ||||
-rw-r--r-- | src/mame/machine/decocass.c | 2 | ||||
-rw-r--r-- | src/mame/machine/decocass.h | 4 | ||||
-rw-r--r-- | src/mame/machine/konamigx.c | 5 | ||||
-rw-r--r-- | src/mame/machine/m68kfmly.c | 43 | ||||
-rw-r--r-- | src/mame/machine/mathbox.c | 16 | ||||
-rw-r--r-- | src/mame/machine/mcr.c | 4 | ||||
-rw-r--r-- | src/mame/machine/namcoio.c | 82 | ||||
-rw-r--r-- | src/mame/machine/pcshare.c | 10 | ||||
-rw-r--r-- | src/mame/machine/tait8741.c | 56 | ||||
-rw-r--r-- | src/mame/machine/taitosj.c | 69 | ||||
-rw-r--r-- | src/mame/machine/ticket.c | 35 | ||||
-rw-r--r-- | src/mame/machine/twincobr.c | 63 |
15 files changed, 130 insertions, 306 deletions
diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index e1979afdd15..a5854c89adb 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -1065,9 +1065,8 @@ READ16_HANDLER( amiga_cia_r ) /* handle the reads */ data = cia_read(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 ^ 0xffff); -#endif + 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 ^ 0xffff); return data << shift; } @@ -1084,9 +1083,8 @@ 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 ^ 0xffff); -#endif + 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 ^ 0xffff); /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */ if ((offset & 0x0800) == 0) @@ -1251,9 +1249,8 @@ READ16_HANDLER( amiga_custom_r ) break; } -#if LOG_CUSTOM - logerror("%06X:read from custom %s\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff]); -#endif + if (LOG_CUSTOM) + logerror("%06X:read from custom %s\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff]); return 0xffff; } @@ -1281,9 +1278,8 @@ WRITE16_HANDLER( amiga_custom_w ) UINT16 temp; offset &= 0xff; -#if LOG_CUSTOM - logerror("%06X:write to custom %s = %04X\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff], data); -#endif + if (LOG_CUSTOM) + logerror("%06X:write to custom %s = %04X\n", safe_activecpu_get_pc(), amiga_custom_names[offset & 0xff], data); switch (offset) { diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c index 7219739021d..4d27facdefa 100644 --- a/src/mame/machine/arkanoid.c +++ b/src/mame/machine/arkanoid.c @@ -194,15 +194,9 @@ TO DO (2006.09.12) : */ -#if ARKANOID_BOOTLEG_VERBOSE -#define LOG_F002_R logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_cmd,arkanoid_bootleg_val); -#define LOG_D018_W logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n",activecpu_get_pc(),data,arkanoid_bootleg_cmd); -#define LOG_D008_R logerror("%04x: arkanoid_bootleg_d008_r - val = %02x\n",activecpu_get_pc(),arkanoid_bootleg_d008_val); -#else -#define LOG_F002_R -#define LOG_D018_W -#define LOG_D008_R -#endif +#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); static UINT8 arkanoid_bootleg_cmd; diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c index 47c92e0415f..ff1a4e248b6 100644 --- a/src/mame/machine/atari.c +++ b/src/mame/machine/atari.c @@ -42,28 +42,31 @@ static void pokey_reset(running_machine *machine); void atari_interrupt_cb(int mask) { -#if VERBOSE_POKEY + if (VERBOSE_POKEY) + { if (mask & 0x80) logerror("atari interrupt_cb BREAK\n"); if (mask & 0x40) logerror("atari interrupt_cb KBCOD\n"); -#endif -#if VERBOSE_SERIAL + } + if (VERBOSE_SERIAL) + { if (mask & 0x20) logerror("atari interrupt_cb SERIN\n"); if (mask & 0x10) logerror("atari interrupt_cb SEROR\n"); if (mask & 0x08) logerror("atari interrupt_cb SEROC\n"); -#endif -#if VERBOSE_TIMERS + } + if (VERBOSE_TIMERS) + { if (mask & 0x04) logerror("atari interrupt_cb TIMR4\n"); if (mask & 0x02) logerror("atari interrupt_cb TIMR2\n"); if (mask & 0x01) logerror("atari interrupt_cb TIMR1\n"); -#endif + } cpunum_set_input_line(0, 0, HOLD_LINE); } diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c index 141629de08c..fc266ed6c2e 100644 --- a/src/mame/machine/decocass.c +++ b/src/mame/machine/decocass.c @@ -291,7 +291,6 @@ WRITE8_HANDLER( decocass_reset_w ) cpunum_set_input_line(2, INPUT_LINE_RESET, (data & 0x08) ^ 0x08 ); } -#ifdef MAME_DEBUG static const char *dirnm(int speed) { if (speed < -1) return "fast rewind"; @@ -300,7 +299,6 @@ static const char *dirnm(int speed) if (speed == 1) return "forward"; return "fast forward"; } -#endif static void tape_crc16(UINT8 data) { diff --git a/src/mame/machine/decocass.h b/src/mame/machine/decocass.h index d6429e8a22e..fad121318d2 100644 --- a/src/mame/machine/decocass.h +++ b/src/mame/machine/decocass.h @@ -3,10 +3,10 @@ #ifdef MAME_DEBUG #define LOGLEVEL 3 -#define LOG(n,x) if (LOGLEVEL >= n) logerror x #else -#define LOG(n,x) +#define LOGLEVEL 0 #endif +#define LOG(n,x) do { if (LOGLEVEL >= n) logerror x; } while (0) extern WRITE8_HANDLER( decocass_coin_counter_w ); extern WRITE8_HANDLER( decocass_sound_command_w ); diff --git a/src/mame/machine/konamigx.c b/src/mame/machine/konamigx.c index 8781f534d23..bd97ede682c 100644 --- a/src/mame/machine/konamigx.c +++ b/src/mame/machine/konamigx.c @@ -1,6 +1,3 @@ -#define VERBOSE 0 -#define GX_DEBUG 0 - /************************************************************************** * * machine/konamigx.c - contains various System GX hardware abstractions @@ -14,6 +11,8 @@ #include "machine/konamigx.h" #include <math.h> +#define GX_DEBUG 0 + static struct { diff --git a/src/mame/machine/m68kfmly.c b/src/mame/machine/m68kfmly.c index ce980e328fc..4d6d47ece56 100644 --- a/src/mame/machine/m68kfmly.c +++ b/src/mame/machine/m68kfmly.c @@ -15,7 +15,8 @@ Memo: #include "cpu/m68000/m68000.h" -#define TMP68301_DEBUG 0 +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) // TMP68301 System Memory Map @@ -147,90 +148,70 @@ static UINT16 tmp68301_timer[0x50]; READ16_HANDLER( tmp68301_address_decoder_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_address_decoder_r (%08X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_address_decoder_r (%08X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)))); return tmp68301_address_decoder[offset]; } WRITE16_HANDLER( tmp68301_address_decoder_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_address_decoder_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc00 + (offset * 2)), data)); tmp68301_address_decoder[offset] = data; } READ16_HANDLER( tmp68301_interrupt_controller_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_interrupt_controller_r (%08X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)))); return tmp68301_interrupt_controller[offset]; } WRITE16_HANDLER( tmp68301_interrupt_controller_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_interrupt_controller_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffc80 + (offset * 2)), data)); tmp68301_interrupt_controller[offset] = data; } READ16_HANDLER( tmp68301_parallel_interface_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_parallel_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_parallel_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)))); return tmp68301_parallel_interface[offset]; } WRITE16_HANDLER( tmp68301_parallel_interface_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_parallel_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd00 + (offset * 2)), data)); tmp68301_parallel_interface[offset] = data; } READ16_HANDLER( tmp68301_serial_interface_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_serial_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_serial_interface_r (%08X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)))); return tmp68301_serial_interface[offset]; } WRITE16_HANDLER( tmp68301_serial_interface_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_serial_interface_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffd80 + (offset * 2)), data)); tmp68301_serial_interface[offset] = data; } READ16_HANDLER( tmp68301_timer_r ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_timer_r (%08X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2))); -#endif + LOG(("PC %08X: TMP68301_timer_r (%08X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)))); return tmp68301_timer[offset]; } WRITE16_HANDLER( tmp68301_timer_w ) { -#if TMP68301_DEBUG - logerror("PC %08X: TMP68301_timer_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)), data); -#endif + LOG(("PC %08X: TMP68301_timer_w (%08X = %04X)\n", activecpu_get_pc(), (0xfffe00 + (offset * 2)), data)); tmp68301_timer[offset] = data; } diff --git a/src/mame/machine/mathbox.c b/src/mame/machine/mathbox.c index ada570c25ea..4eaf9c3c22d 100644 --- a/src/mame/machine/mathbox.c +++ b/src/mame/machine/mathbox.c @@ -35,7 +35,9 @@ static s16 mb_result = 0; #define REGf mb_reg [0x0f] -/*define MB_TEST*/ +#define MB_TEST 0 +#define LOG(x) do { if (MB_TEST) logerror x; } while (0) + WRITE8_HANDLER( mb_go_w ) { @@ -43,9 +45,7 @@ WRITE8_HANDLER( mb_go_w ) s16 mb_q; /* temp used in division */ int msb; -#ifdef MB_TEST - logerror("math box command %02x data %02x ", offset, data); -#endif + LOG(("math box command %02x data %02x ", offset, data)); switch (offset) { @@ -149,9 +149,7 @@ WRITE8_HANDLER( mb_go_w ) /* fall into command 13 */ case 0x13: -#ifdef MB_TEST - logerror("\nR7: %04x R8: %04x R9: %04x\n", REG7, REG8, REG9); -#endif + LOG(("\nR7: %04x R8: %04x R9: %04x\n", REG7, REG8, REG9)); REGc = REG9; mb_q = REG8; @@ -258,9 +256,7 @@ WRITE8_HANDLER( mb_go_w ) break; } -#ifdef MB_TEST - logerror(" result %04x\n", mb_result & 0xffff); -#endif + LOG((" result %04x\n", mb_result & 0xffff)); } READ8_HANDLER( mb_status_r ) diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c index 5e2b20dca3a..91b91f09c1b 100644 --- a/src/mame/machine/mcr.c +++ b/src/mame/machine/mcr.c @@ -15,8 +15,8 @@ #include "cpu/z80/z80daisy.h" #include "mcr.h" - -#define LOG(x) logerror x +#define VERBOSE 1 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /************************************* diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c index 5f6c3fe7748..dee4e3a4dc4 100644 --- a/src/mame/machine/namcoio.c +++ b/src/mame/machine/namcoio.c @@ -140,6 +140,7 @@ TODO: #define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) struct namcoio { @@ -186,9 +187,7 @@ static void namcoio_51XX_write(int chip,int data) { data &= 0x07; -#if VERBOSE - logerror("%04x: custom 51XX write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: custom 51XX write %02x\n",activecpu_get_pc(),data)); if (io[chip].coincred_mode) { @@ -284,9 +283,7 @@ static const int joy_map[16] = static UINT8 namcoio_51XX_read(int chip) { -#if VERBOSE - logerror("%04x: custom 51XX read\n",activecpu_get_pc()); -#endif + LOG(("%04x: custom 51XX read\n",activecpu_get_pc())); if (io[chip].mode == 0) /* switch mode */ { @@ -518,9 +515,7 @@ static void handle_coins(int chip,int swap) static void namco_customio_56XX_run(int chip) { -#if VERBOSE - logerror("execute 56XX %d mode %d\n",chip,IORAM_READ(8)); -#endif + LOG(("execute 56XX %d mode %d\n",chip,IORAM_READ(8))); switch (IORAM_READ(8)) { @@ -600,9 +595,7 @@ static void namco_customio_56XX_run(int chip) static void namco_customio_59XX_run(int chip) { -#if VERBOSE - logerror("execute 59XX %d mode %d\n",chip,IORAM_READ(8)); -#endif + LOG(("execute 59XX %d mode %d\n",chip,IORAM_READ(8))); switch (IORAM_READ(8)) { @@ -625,9 +618,7 @@ static void namco_customio_59XX_run(int chip) static void namco_customio_58XX_run(int chip) { -#if VERBOSE - logerror("execute 58XX %d mode %d\n",chip,IORAM_READ(8)); -#endif + LOG(("execute 58XX %d mode %d\n",chip,IORAM_READ(8))); switch (IORAM_READ(8)) { @@ -737,9 +728,7 @@ READ8_HANDLER( namcoio_r ) // RAM is 4-bit wide; Pac & Pal requires the | 0xf0 otherwise Easter egg doesn't work offset &= 0x3f; -#if VERBOSE - logerror("%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); -#endif + 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)); return 0xf0 | namcoio_ram[offset]; } @@ -749,9 +738,7 @@ WRITE8_HANDLER( namcoio_w ) offset &= 0x3f; data &= 0x0f; // RAM is 4-bit wide -#if VERBOSE - logerror("%04x: I/O write %d: offset %d = %02x\n", activecpu_get_pc(), offset / 16, offset & 0x0f, data); -#endif + LOG(("%04x: I/O write %d: offset %d = %02x\n", activecpu_get_pc(), offset / 16, offset & 0x0f, data)); namcoio_ram[offset] = data; } @@ -841,16 +828,12 @@ static TIMER_CALLBACK( nmi_generate ) { if (!cpunum_is_suspended(param, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) { -#if VERBOSE - logerror("NMI cpu %d\n",nmi_cpu[param]); -#endif + LOG(("NMI cpu %d\n",nmi_cpu[param])); cpunum_set_input_line(nmi_cpu[param], INPUT_LINE_NMI, PULSE_LINE); } -#if VERBOSE else - logerror("NMI not generated because cpu %d is suspended\n",nmi_cpu[param]); -#endif + LOG(("NMI not generated because cpu %d is suspended\n",nmi_cpu[param])); } static UINT8 customio_command[MAX_06XX]; @@ -885,9 +868,7 @@ void namco_06xx_init(int chipnum, int cpu, static UINT8 namcoio_53XX_digdug_read(int chip) { -#if VERBOSE - logerror("%04x: custom 53XX read\n",activecpu_get_pc()); -#endif + LOG(("%04x: custom 53XX read\n",activecpu_get_pc())); switch ((io[chip].in_count++) % 2) { @@ -900,9 +881,7 @@ static UINT8 namcoio_53XX_digdug_read(int chip) static UINT8 namcoio_53XX_polepos_read(int chip) { -#if VERBOSE - logerror("%04x: custom 53XX read\n",activecpu_get_pc()); -#endif + LOG(("%04x: custom 53XX read\n",activecpu_get_pc())); switch ((io[chip].in_count++) % 8) { @@ -915,9 +894,7 @@ static UINT8 namcoio_53XX_polepos_read(int chip) static UINT8 namco_06xx_data_read(int chipnum) { -#if VERBOSE - logerror("forwarding read to chip %d\n",chipnum%3); -#endif + LOG(("forwarding read to chip %d\n",chipnum%3)); switch (io[chipnum].type) { @@ -935,9 +912,7 @@ static UINT8 namco_06xx_data_read(int chipnum) static void namco_06xx_data_write(int chipnum,UINT8 data) { -#if VERBOSE - logerror("forwarding write to chip %d\n",chipnum%3); -#endif + LOG(("forwarding write to chip %d\n",chipnum%3)); switch (io[chipnum].type) { @@ -955,9 +930,7 @@ static void namco_06xx_data_write(int chipnum,UINT8 data) static void namco_06xx_read_request(int chipnum) { -#if VERBOSE - logerror("requesting read to chip %d\n",chipnum%3); -#endif + LOG(("requesting read to chip %d\n",chipnum%3)); switch (io[chipnum].type) { @@ -972,9 +945,7 @@ static void namco_06xx_read_request(int chipnum) static UINT8 namco_06xx_data_r(int chip,int offset) { -#if VERBOSE - logerror("%04x: 06XX #%d read offset %d\n",activecpu_get_pc(),chip,offset); -#endif + LOG(("%04x: 06XX #%d read offset %d\n",activecpu_get_pc(),chip,offset)); if (!(customio_command[chip] & 0x10)) { @@ -997,9 +968,7 @@ static UINT8 namco_06xx_data_r(int chip,int offset) static void namco_06xx_data_w(int chip,int offset,int data) { -#if VERBOSE - logerror("%04x: 06XX #%d write offset %d = %02x\n",activecpu_get_pc(),chip,offset,data); -#endif + LOG(("%04x: 06XX #%d write offset %d = %02x\n",activecpu_get_pc(),chip,offset,data)); if (customio_command[chip] & 0x10) { @@ -1022,32 +991,25 @@ static void namco_06xx_data_w(int chip,int offset,int data) static UINT8 namco_06xx_ctrl_r(int chip) { -#if VERBOSE - logerror("%04x: 06XX #%d ctrl_r\n",activecpu_get_pc(),chip); -#endif + LOG(("%04x: 06XX #%d ctrl_r\n",activecpu_get_pc(),chip)); return customio_command[chip]; } static void namco_06xx_ctrl_w(int chip,int data) { -#if VERBOSE - logerror("%04x: 06XX #%d command %02x\n",activecpu_get_pc(),chip,data); -#endif + LOG(("%04x: 06XX #%d command %02x\n",activecpu_get_pc(),chip,data)); customio_command[chip] = data; if ((customio_command[chip] & 0x0f) == 0) { -#if VERBOSE - logerror("disabling nmi generate timer\n"); -#endif + LOG(("disabling nmi generate timer\n")); timer_adjust(nmi_timer[chip], attotime_never, chip, attotime_never); } else { -#if VERBOSE - logerror("setting nmi generate timer to 200us\n"); -#endif + LOG(("setting nmi generate timer to 200us\n")); + // this timing is critical. Due to a bug, Bosconian will stop responding to // inputs if a transfer terminates at the wrong time. // On the other hand, the time cannot be too short otherwise the 54XX will diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c index c0f91d84d0f..80ded0754de 100644 --- a/src/mame/machine/pcshare.c +++ b/src/mame/machine/pcshare.c @@ -53,22 +53,12 @@ #endif /* MESS */ #define VERBOSE_DBG 0 /* general debug messages */ -#if VERBOSE_DBG #define DBG_LOG(N,M,A) \ if(VERBOSE_DBG>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time()),(char*)M ); logerror A; } -#else -#define DBG_LOG(n,m,a) -#endif #define VERBOSE_JOY 0 /* JOY (joystick port) */ - -#if VERBOSE_JOY -#define LOG(LEVEL,N,M,A) \ #define JOY_LOG(N,M,A) \ if(VERBOSE_JOY>=N){ if( M )logerror("%11.6f: %-24s",attotime_to_double(timer_get_time()),(char*)M ); logerror A; } -#else -#define JOY_LOG(n,m,a) -#endif #define FDC_DMA 2 diff --git a/src/mame/machine/tait8741.c b/src/mame/machine/tait8741.c index 87537278b72..f12cbfad355 100644 --- a/src/mame/machine/tait8741.c +++ b/src/mame/machine/tait8741.c @@ -10,7 +10,8 @@ Taito 8741 emulation #include "driver.h" #include "tait8741.h" -#define __log__ 0 +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) /**************************************************************************** @@ -99,9 +100,7 @@ static TIMER_CALLBACK( taito8741_serial_tx ) sst = &taito8741[st->connect]; /* transfer data */ taito8741_serial_rx(sst,st->txd); -#if __log__ - logerror("8741-%d Serial data TX to %d\n",num,st->connect); -#endif + LOG(("8741-%d Serial data TX to %d\n",num,st->connect)); if( sst->mode==TAITO8741_SLAVE) sst->serial_out = 1; } @@ -276,9 +275,7 @@ static int I8741_status_r(int num) { I8741 *st = &taito8741[num]; taito8741_update(num); -#if __log__ - logerror("8741-%d ST Read %02x PC=%04x\n",num,st->status,activecpu_get_pc()); -#endif + LOG(("8741-%d ST Read %02x PC=%04x\n",num,st->status,activecpu_get_pc())); return st->status; } @@ -288,9 +285,8 @@ static int I8741_data_r(int num) I8741 *st = &taito8741[num]; int ret = st->toData; st->status &= 0xfe; -#if __log__ - logerror("8741-%d DATA Read %02x PC=%04x\n",num,ret,activecpu_get_pc()); -#endif + LOG(("8741-%d DATA Read %02x PC=%04x\n",num,ret,activecpu_get_pc())); + /* update chip */ taito8741_update(num); @@ -307,9 +303,7 @@ static int I8741_data_r(int num) static void I8741_data_w(int num, int data) { I8741 *st = &taito8741[num]; -#if __log__ - logerror("8741-%d DATA Write %02x PC=%04x\n",num,data,activecpu_get_pc()); -#endif + LOG(("8741-%d DATA Write %02x PC=%04x\n",num,data,activecpu_get_pc())); st->fromData = data; st->status |= 0x02; /* update chip */ @@ -320,9 +314,7 @@ static void I8741_data_w(int num, int data) static void I8741_command_w(int num, int data) { I8741 *st = &taito8741[num]; -#if __log__ - logerror("8741-%d CMD Write %02x PC=%04x\n",num,data,activecpu_get_pc()); -#endif + LOG(("8741-%d CMD Write %02x PC=%04x\n",num,data,activecpu_get_pc())); st->fromCmd = data; st->status |= 0x04; /* update chip */ @@ -449,16 +441,13 @@ static void josvolly_8741_do(int num) } } -static void josvolly_8741_w(int num,int offset,int data,int log) +static void josvolly_8741_w(int num,int offset,int data) { JV8741 *mcu = &i8741[num]; if(offset==1) { -#if __log__ -if(log) - logerror("PC=%04X 8741[%d] CW %02X\n",activecpu_get_pc(),num,data); -#endif + LOG(("PC=%04X 8741[%d] CW %02X\n",activecpu_get_pc(),num,data)); /* read pointer */ mcu->cmd = data; @@ -496,10 +485,7 @@ if(log) else { /* data */ -#if __log__ -if(log) - logerror("PC=%04X 8741[%d] DW %02X\n",activecpu_get_pc(),num,data); -#endif + LOG(("PC=%04X 8741[%d] DW %02X\n",activecpu_get_pc(),num,data)); mcu->txd = data^0x40; /* parity reverce ? */ mcu->sts |= 0x02; /* TXD busy */ @@ -518,7 +504,7 @@ if(log) josvolly_8741_do(num); } -static INT8 josvolly_8741_r(int num,int offset,int log) +static INT8 josvolly_8741_r(int num,int offset) { JV8741 *mcu = &i8741[num]; int ret; @@ -528,26 +514,20 @@ static INT8 josvolly_8741_r(int num,int offset,int log) if(mcu->rst) mcu->rxd = (mcu->initReadPort)(0); /* port in */ ret = mcu->sts; -#if __log__ -if(log) - logerror("PC=%04X 8741[%d] SR %02X\n",activecpu_get_pc(),num,ret); -#endif + LOG(("PC=%04X 8741[%d] SR %02X\n",activecpu_get_pc(),num,ret)); } else { /* clear status port */ mcu->sts &= ~0x01; /* RD ready */ ret = mcu->rxd; -#if __log__ -if(log) - logerror("PC=%04X 8741[%d] DR %02X\n",activecpu_get_pc(),num,ret); -#endif + LOG(("PC=%04X 8741[%d] DR %02X\n",activecpu_get_pc(),num,ret)); mcu->rst = 0; } return ret; } -WRITE8_HANDLER( josvolly_8741_0_w ){ josvolly_8741_w(0,offset,data,1); } -READ8_HANDLER( josvolly_8741_0_r ) { return josvolly_8741_r(0,offset,1); } -WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(1,offset,data,1); } -READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(1,offset,1); } +WRITE8_HANDLER( josvolly_8741_0_w ){ josvolly_8741_w(0,offset,data); } +READ8_HANDLER( josvolly_8741_0_r ) { return josvolly_8741_r(0,offset); } +WRITE8_HANDLER( josvolly_8741_1_w ) { josvolly_8741_w(1,offset,data); } +READ8_HANDLER( josvolly_8741_1_r ) { return josvolly_8741_r(1,offset); } diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c index 5940061dc6b..814e6a72546 100644 --- a/src/mame/machine/taitosj.c +++ b/src/mame/machine/taitosj.c @@ -11,7 +11,8 @@ #include "cpu/m6805/m6805.h" -#define DEBUG_MCU 1 +#define VERBOSE 1 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) static UINT8 fromz80,toz80; @@ -87,24 +88,18 @@ WRITE8_HANDLER( taitosj_bankswitch_w ) ***************************************************************************/ READ8_HANDLER( taitosj_fake_data_r ) { -#if DEBUG_MCU -logerror("%04x: protection read\n",activecpu_get_pc()); -#endif + LOG(("%04x: protection read\n",activecpu_get_pc())); return 0; } WRITE8_HANDLER( taitosj_fake_data_w ) { -#if DEBUG_MCU -logerror("%04x: protection write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: protection write %02x\n",activecpu_get_pc(),data)); } READ8_HANDLER( taitosj_fake_status_r ) { -#if DEBUG_MCU -logerror("%04x: protection status read\n",activecpu_get_pc()); -#endif + LOG(("%04x: protection status read\n",activecpu_get_pc())); return 0xff; } @@ -112,9 +107,7 @@ logerror("%04x: protection status read\n",activecpu_get_pc()); /* timer callback : */ READ8_HANDLER( taitosj_mcu_data_r ) { -#if DEBUG_MCU -logerror("%04x: protection read %02x\n",activecpu_get_pc(),toz80); -#endif + LOG(("%04x: protection read %02x\n",activecpu_get_pc(),toz80)); zaccept = 1; return toz80; } @@ -129,9 +122,7 @@ static TIMER_CALLBACK( taitosj_mcu_real_data_w ) WRITE8_HANDLER( taitosj_mcu_data_w ) { -#if DEBUG_MCU -logerror("%04x: protection write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: protection write %02x\n",activecpu_get_pc(),data)); timer_call_after_resynch(NULL, data,taitosj_mcu_real_data_w); /* temporarily boost the interleave to sync things up */ cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(10)); @@ -149,17 +140,13 @@ READ8_HANDLER( taitosj_mcu_status_r ) READ8_HANDLER( taitosj_68705_portA_r ) { -#if DEBUG_MCU -logerror("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in); -#endif + LOG(("%04x: 68705 port A read %02x\n",activecpu_get_pc(),portA_in)); return portA_in; } WRITE8_HANDLER( taitosj_68705_portA_w ) { -#if DEBUG_MCU -logerror("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: 68705 port A write %02x\n",activecpu_get_pc(),data)); portA_out = data; } @@ -205,15 +192,11 @@ static TIMER_CALLBACK( taitosj_mcu_status_real_w ) WRITE8_HANDLER( taitosj_68705_portB_w ) { -#if DEBUG_MCU -logerror("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data); -#endif + LOG(("%04x: 68705 port B write %02x\n",activecpu_get_pc(),data)); if (~data & 0x01) { -#if DEBUG_MCU -logerror("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc()); -#endif + LOG(("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc())); } if (~data & 0x02) { @@ -221,9 +204,7 @@ logerror("%04x: 68705 68INTRQ **NOT SUPPORTED**!\n",activecpu_get_pc()); timer_call_after_resynch(NULL, 0,taitosj_mcu_data_real_r); cpunum_set_input_line(2,0,CLEAR_LINE); portA_in = fromz80; -#if DEBUG_MCU -logerror("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in); -#endif + LOG(("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in)); } if (~data & 0x08) busreq = 1; @@ -231,17 +212,15 @@ logerror("%04x: 68705 <- Z80 %02x\n",activecpu_get_pc(),portA_in); busreq = 0; if (~data & 0x04) { -#if DEBUG_MCU -logerror("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out); -#endif + LOG(("%04x: 68705 -> Z80 %02x\n",activecpu_get_pc(),portA_out)); + /* 68705 is writing data for the Z80 */ timer_call_after_resynch(NULL, portA_out,taitosj_mcu_status_real_w); } if (~data & 0x10) { -#if DEBUG_MCU -logerror("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address); -#endif + LOG(("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out,address)); + memory_set_context(0); program_write_byte(address, portA_out); memory_set_context(2); @@ -254,22 +233,16 @@ logerror("%04x: 68705 write %02x to address %04x\n",activecpu_get_pc(),portA_out memory_set_context(0); portA_in = program_read_byte(address); memory_set_context(2); -#if DEBUG_MCU -logerror("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),portA_in,address); -#endif + LOG(("%04x: 68705 read %02x from address %04x\n",activecpu_get_pc(),portA_in,address)); } if (~data & 0x40) { -#if DEBUG_MCU -logerror("%04x: 68705 address low %02x\n",activecpu_get_pc(),portA_out); -#endif + LOG(("%04x: 68705 address low %02x\n",activecpu_get_pc(),portA_out)); address = (address & 0xff00) | portA_out; } if (~data & 0x80) { -#if DEBUG_MCU -logerror("%04x: 68705 address high %02x\n",activecpu_get_pc(),portA_out); -#endif + LOG(("%04x: 68705 address high %02x\n",activecpu_get_pc(),portA_out)); address = (address & 0x00ff) | (portA_out << 8); } } @@ -289,9 +262,7 @@ READ8_HANDLER( taitosj_68705_portC_r ) int res; res = (zready << 0) | (zaccept << 1) | ((busreq^1) << 2); -#if DEBUG_MCU -logerror("%04x: 68705 port C read %02x\n",activecpu_get_pc(),res); -#endif + LOG(("%04x: 68705 port C read %02x\n",activecpu_get_pc(),res)); return res; } diff --git a/src/mame/machine/ticket.c b/src/mame/machine/ticket.c index ed26aa703f3..12c798c231e 100644 --- a/src/mame/machine/ticket.c +++ b/src/mame/machine/ticket.c @@ -13,7 +13,8 @@ #include "driver.h" #include "machine/ticket.h" -/*#define DEBUG_TICKET*/ +#define DEBUG_TICKET 0 +#define LOG(x) do { if (DEBUG_TICKET) logerror x; } while (0) #define MAX_DISPENSERS 2 @@ -70,17 +71,13 @@ READ8_HANDLER( ticket_dispenser_r ) READ8_HANDLER( ticket_dispenser_0_r ) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), status); -#endif + LOG(("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), dispenser[0].status)); return dispenser[0].status; } READ8_HANDLER( ticket_dispenser_1_r ) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), status); -#endif + LOG(("PC: %04X Ticket Status Read = %02X\n", activecpu_get_pc(), dispenser[1].status)); return dispenser[1].status; } @@ -99,9 +96,7 @@ WRITE8_HANDLER( ticket_dispenser_0_w ) { if (!dispenser[0].power) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Power On\n", activecpu_get_pc()); -#endif + LOG(("PC: %04X Ticket Power On\n", activecpu_get_pc())); timer_adjust(dispenser[0].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); dispenser[0].power = 1; @@ -112,9 +107,7 @@ WRITE8_HANDLER( ticket_dispenser_0_w ) { if (dispenser[0].power) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Power Off\n", activecpu_get_pc()); -#endif + LOG(("PC: %04X Ticket Power Off\n", activecpu_get_pc())); timer_adjust(dispenser[0].timer, attotime_never, 0, attotime_never); set_led_status(2,0); dispenser[0].power = 0; @@ -129,9 +122,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w ) { if (!dispenser[1].power) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Power On\n", activecpu_get_pc()); -#endif + LOG(("PC: %04X Ticket Power On\n", activecpu_get_pc())); timer_adjust(dispenser[1].timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); dispenser[1].power = 1; @@ -142,9 +133,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w ) { if (dispenser[1].power) { -#ifdef DEBUG_TICKET - logerror("PC: %04X Ticket Power Off\n", activecpu_get_pc()); -#endif + LOG(("PC: %04X Ticket Power Off\n", activecpu_get_pc())); timer_adjust(dispenser[1].timer, attotime_never, 0, attotime_never); set_led_status(2,0); dispenser[1].power = 0; @@ -168,9 +157,7 @@ static TIMER_CALLBACK( ticket_dispenser_toggle ) if (dispenser->power) { dispenser->status ^= active_bit; -#ifdef DEBUG_TICKET - logerror("Ticket Status Changed to %02X\n", status); -#endif + LOG(("Ticket Status Changed to %02X\n", dispenser->status)); timer_adjust(dispenser->timer, ATTOTIME_IN_MSEC(time_msec), 0, attotime_zero); } @@ -179,9 +166,7 @@ static TIMER_CALLBACK( ticket_dispenser_toggle ) set_led_status(2,1); dispensed_tickets++; -#ifdef DEBUG_TICKET - logerror("Ticket Dispensed\n"); -#endif + LOG(("Ticket Dispensed\n")); } else { diff --git a/src/mame/machine/twincobr.c b/src/mame/machine/twincobr.c index 50c45396e44..fb32a6f5791 100644 --- a/src/mame/machine/twincobr.c +++ b/src/mame/machine/twincobr.c @@ -10,6 +10,7 @@ #define LOG_DSP_CALLS 0 +#define LOG(x) do { if (LOG_DSP_CALLS) logerror x; } while (0) #define CLEAR 0 #define ASSERT 1 @@ -23,9 +24,7 @@ static int fsharkbt_8741; static int dsp_execute; static UINT32 dsp_addr_w, main_ram_seg; -#if LOG_DSP_CALLS static const int toaplan_port_type[2] = { 0x7800c, 0x5c }; -#endif UINT8 *twincobr_sharedram; @@ -61,9 +60,7 @@ WRITE16_HANDLER( twincobr_dsp_addrsel_w ) main_ram_seg = ((data & 0xe000) << 3); dsp_addr_w = ((data & 0x1fff) << 1); -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); } READ16_HANDLER( twincobr_dsp_r ) @@ -79,9 +76,7 @@ READ16_HANDLER( twincobr_dsp_r ) 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; } -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w)); return input_data; } @@ -97,9 +92,7 @@ WRITE16_HANDLER( twincobr_dsp_w ) 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; } -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); } WRITE16_HANDLER( wardner_dsp_addrsel_w ) @@ -114,9 +107,7 @@ WRITE16_HANDLER( wardner_dsp_addrsel_w ) if (main_ram_seg == 0x6000) main_ram_seg = 0x7000; -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO write %04x (%08x) at port 0\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); } READ16_HANDLER( wardner_dsp_r ) @@ -133,9 +124,7 @@ READ16_HANDLER( wardner_dsp_r ) 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; } -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO read %04x at %08x (port 1)\n",activecpu_get_previouspc(),input_data,main_ram_seg + dsp_addr_w)); return input_data; } @@ -152,9 +141,7 @@ WRITE16_HANDLER( wardner_dsp_w ) 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; } -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w); -#endif + LOG(("DSP PC:%04x IO write %04x at %08x (port 1)\n",activecpu_get_previouspc(),data,main_ram_seg + dsp_addr_w)); } WRITE16_HANDLER( twincobr_dsp_bio_w ) @@ -164,17 +151,13 @@ 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*/ -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO write %04x at port 3\n",activecpu_get_previouspc(),data); -#endif + LOG(("DSP PC:%04x IO write %04x at port 3\n",activecpu_get_previouspc(),data)); if (data & 0x8000) { twincobr_dsp_BIO = CLEAR_LINE; } if (data == 0) { if (dsp_execute) { -#if LOG_DSP_CALLS - logerror("Turning the main CPU on\n"); -#endif + LOG(("Turning the main CPU on\n")); cpunum_set_input_line(0, INPUT_LINE_HALT, CLEAR_LINE); dsp_execute = 0; } @@ -189,9 +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; -#if LOG_DSP_CALLS - logerror("DSP PC:%04x IO read %04x from 8741 MCU (port 2)\n",activecpu_get_previouspc(),(fsharkbt_8741 & 0x08)); -#endif + LOG(("DSP PC:%04x IO read %04x from 8741 MCU (port 2)\n",activecpu_get_previouspc(),(fsharkbt_8741 & 0x08))); return (fsharkbt_8741 & 1); } @@ -213,17 +194,13 @@ static void twincobr_dsp(int enable) { twincobr_dsp_on = enable; if (enable) { -#if LOG_DSP_CALLS - logerror("Turning DSP on and main CPU off\n"); -#endif + LOG(("Turning DSP on and main CPU off\n")); cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); } else { -#if LOG_DSP_CALLS - logerror("Turning DSP off\n"); -#endif + LOG(("Turning DSP off\n")); cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); } @@ -237,9 +214,7 @@ static void twincobr_restore_dsp(void) static void toaplan0_control_w(int offset, int data) { -#if LOG_DSP_CALLS - logerror("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset); -#endif + LOG(("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset)); if (toaplan_main_cpu == 1) { if (data == 0x0c) { data = 0x1c; wardner_sprite_hack=0; } /* Z80 ? */ @@ -292,10 +267,8 @@ WRITE16_HANDLER( twincobr_sharedram_w ) static void toaplan0_coin_dsp_w(int offset, int data) { -#if LOG_DSP_CALLS if (data > 1) - logerror("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),data,toaplan_port_type[toaplan_main_cpu] - offset); -#endif + LOG(("CPU0:%08x Writing %08x to %08x.\n",activecpu_get_pc(),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; @@ -307,17 +280,13 @@ static void toaplan0_coin_dsp_w(int offset, int data) case 0x0f: coin_lockout_w(1,0); break; /****** The following apply to Flying Shark/Wardner only ******/ case 0x00: /* This means assert the INT line to the DSP */ -#if LOG_DSP_CALLS - logerror("Turning DSP on and main CPU off\n"); -#endif + LOG(("Turning DSP on and main CPU off\n")); cpunum_set_input_line(2, INPUT_LINE_HALT, CLEAR_LINE); cpunum_set_input_line(2, 0, ASSERT_LINE); /* TMS32010 INT */ cpunum_set_input_line(0, INPUT_LINE_HALT, ASSERT_LINE); break; case 0x01: /* This means inhibit the INT line to the DSP */ -#if LOG_DSP_CALLS - logerror("Turning DSP off\n"); -#endif + LOG(("Turning DSP off\n")); cpunum_set_input_line(2, 0, CLEAR_LINE); /* TMS32010 INT */ cpunum_set_input_line(2, INPUT_LINE_HALT, ASSERT_LINE); break; |