diff options
Diffstat (limited to 'src/devices/cpu/pdp1/pdp1.cpp')
-rw-r--r-- | src/devices/cpu/pdp1/pdp1.cpp | 83 |
1 files changed, 25 insertions, 58 deletions
diff --git a/src/devices/cpu/pdp1/pdp1.cpp b/src/devices/cpu/pdp1/pdp1.cpp index be313bbbe24..5fda5e79699 100644 --- a/src/devices/cpu/pdp1/pdp1.cpp +++ b/src/devices/cpu/pdp1/pdp1.cpp @@ -6,7 +6,7 @@ * Barry Silverman mailto:barry@disus.com or mailto:bss@media.mit.edu * Vadim Gerasimov mailto:vadim@media.mit.edu * - * MESS driver by Chris Salomon and Raphael Nabet. + * MAME driver by Chris Salomon and Raphael Nabet. * * Basically, it has been rewritten entirely in order to perform cycle-level simulation * (with only a few flip-flops being set one cycle too early or too late). I don't know if @@ -340,13 +340,13 @@ #include "emu.h" -#include "debugger.h" #include "pdp1.h" #include "pdp1dasm.h" -#define LOG 0 -#define LOG_EXTRA 0 -#define LOG_IOT_EXTRA 0 +#define LOG_EXTRA (1U << 1) +#define LOG_IOT_EXTRA (1U << 2) +#define VERBOSE (0) +#include "logmacro.h" #define READ_PDP_18BIT(A) ((signed)m_program->read_dword(A)) #define WRITE_PDP_18BIT(A,V) (m_program->write_dword((A),(V))) @@ -819,8 +819,7 @@ void pdp1_device::execute_run() else { /* what the heck? */ - if (LOG) - logerror("It seems this tape should not be operated in read-in mode\n"); + LOG("It seems this tape should not be operated in read-in mode\n"); m_rim = 0; /* exit read-in mode (right???) */ m_rim_step = 0; @@ -1475,8 +1474,7 @@ void pdp1_device::execute_instruction() } break; default: - if (LOG) - logerror("Undefined shift: 0%06o at 0%06o\n", MB, PREVIOUS_PC); + LOG("Undefined shift: 0%06o at 0%06o\n", MB, PREVIOUS_PC); break; } break; @@ -1585,16 +1583,14 @@ void pdp1_device::execute_instruction() AC ^= 0777777; if (MB & 00400) /* Halt */ { - if (LOG_EXTRA) - logerror("PDP1 Program executed HALT: at 0%06o\n", PREVIOUS_PC); + LOGMASKED(LOG_EXTRA, "PDP1 Program executed HALT: at 0%06o\n", PREVIOUS_PC); m_run = 0; } break; } default: - if (LOG) - logerror("Illegal instruction: 0%06o at 0%06o\n", MB, PREVIOUS_PC); + LOG("Illegal instruction: 0%06o at 0%06o\n", MB, PREVIOUS_PC); /* let us stop the CPU, like a real pdp-1 */ m_run = 0; @@ -1614,16 +1610,10 @@ void pdp1_device::null_iot(int op2, int nac, int mb, int &io, int ac) { /* Note that the dummy IOT 0 is used to wait for the completion pulse generated by the a pending IOT (IOT with completion pulse but no IO wait) */ - if (LOG_IOT_EXTRA) - { - if (op2 == 000) - logerror("IOT sync instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) m_pc); - } - if (LOG) - { - if (op2 != 000) - logerror("Not supported IOT command (no external IOT function given) 0%06o at 0%06o\n", mb, m_pc); - } + if (op2 == 000) + LOGMASKED(LOG_IOT_EXTRA, "IOT sync instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) m_pc); + if (op2 != 000) + LOG("Not supported IOT command (no external IOT function given) 0%06o at 0%06o\n", mb, m_pc); } @@ -1636,14 +1626,10 @@ void pdp1_device::lem_eem_iot(int op2, int nac, int mb, int &io, int ac) { if (! m_extend_support) /* extend mode supported? */ { - if (LOG) - logerror("Ignoring internal error in file " __FILE__ " line %d.\n", __LINE__); + LOG("Ignoring internal error in file " __FILE__ " line %d.\n", __LINE__); return; } - if (LOG_EXTRA) - { - logerror("EEM/LEM instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); - } + LOGMASKED(LOG_EXTRA, "EEM/LEM instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); EXD = (mb & 0004000) ? 1 : 0; } @@ -1660,31 +1646,23 @@ void pdp1_device::sbs_iot(int op2, int nac, int mb, int &io, int ac) switch (op2) { case 054: /* LSM */ - if (LOG_EXTRA) - logerror("LSM instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); - + LOGMASKED(LOG_EXTRA, "LSM instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); m_sbm = 0; field_interrupt(); break; case 055: /* ESM */ - if (LOG_EXTRA) - logerror("ESM instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); - + LOGMASKED(LOG_EXTRA, "ESM instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); m_sbm = 1; field_interrupt(); break; case 056: /* CBS */ - if (LOG_EXTRA) - logerror("CBS instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); - + LOGMASKED(LOG_EXTRA, "CBS instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); /*m_b3 = 0;*/ m_b4 = 0; field_interrupt(); break; default: - if (LOG) - logerror("Ignoring internal error in file " __FILE__ " line %d.\n", __LINE__); - + LOG("Ignoring internal error in file " __FILE__ " line %d.\n", __LINE__); break; } } @@ -1703,8 +1681,7 @@ void pdp1_device::type_20_sbs_iot(int op2, int nac, int mb, int &io, int ac) int channel, mask; if (! m_type_20_sbs) /* type 20 sequence break system supported? */ { - if (LOG) - logerror("Ignoring internal error in file " __FILE__ " line %d.\n", __LINE__); + LOG("Ignoring internal error in file " __FILE__ " line %d.\n", __LINE__); return; } channel = (mb >> 6) & 017; @@ -1712,37 +1689,27 @@ void pdp1_device::type_20_sbs_iot(int op2, int nac, int mb, int &io, int ac) switch (op2) { case 050: /* DSC */ - if (LOG_EXTRA) - logerror("DSC instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); - + LOGMASKED(LOG_EXTRA, "DSC instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); m_b1 &= ~mask; field_interrupt(); break; case 051: /* ASC */ - if (LOG_EXTRA) - logerror("ASC instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); - + LOGMASKED(LOG_EXTRA, "ASC instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); m_b1 |= mask; field_interrupt(); break; case 052: /* ISB */ - if (LOG_EXTRA) - logerror("ISB instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); - + LOGMASKED(LOG_EXTRA, "ISB instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); m_b2 |= mask; field_interrupt(); break; case 053: /* CAC */ - if (LOG_EXTRA) - logerror("CAC instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); - + LOGMASKED(LOG_EXTRA, "CAC instruction: mb=0%06o, pc=0%06o\n", mb, m_pc); m_b1 = 0; field_interrupt(); break; default: - if (LOG) - logerror("Ignoring internal error in file " __FILE__ " line %d.\n", __LINE__); - + LOG("Ignoring internal error in file " __FILE__ " line %d.\n", __LINE__); break; } |