From f660270ce6babec6486111fb88edf226a114d349 Mon Sep 17 00:00:00 2001 From: AJR Date: Mon, 14 Sep 2020 08:50:49 -0400 Subject: [PATCH] pdp1: More cleanups and fixes --- src/devices/cpu/pdp1/pdp1.cpp | 17 ++++++++++------- src/devices/cpu/pdp1/pdp1.h | 6 +----- src/mame/drivers/pdp1.cpp | 15 ++++----------- src/mame/includes/pdp1.h | 4 +--- 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/devices/cpu/pdp1/pdp1.cpp b/src/devices/cpu/pdp1/pdp1.cpp index 389c2fa75e3..2d04709a4a9 100644 --- a/src/devices/cpu/pdp1/pdp1.cpp +++ b/src/devices/cpu/pdp1/pdp1.cpp @@ -384,8 +384,7 @@ DEFINE_DEVICE_TYPE(PDP1, pdp1_device, "pdp1_cpu", "DEC PDP-1 Central Processor") pdp1_device::pdp1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, PDP1, tag, owner, clock) , m_program_config("program", ENDIANNESS_BIG, 32, 18, -2) // data is actually 18 bits wide - , m_extern_iot(64, iot_delegate(*this)) - , m_read_binary_word(*this) + , m_extern_iot(*this) , m_io_sc_callback(*this) { m_program_config.m_is_octal = true; @@ -541,7 +540,6 @@ void pdp1_device::device_start() if (m_extern_iot[i].isnull()) m_extern_iot[i] = iot_delegate(*this, FUNC(pdp1_device::null_iot)); } - m_read_binary_word.resolve(); m_io_sc_callback.resolve(); m_extend_support = extend_support; m_hw_mul_div = hw_mul_div; @@ -773,15 +771,19 @@ void pdp1_device::execute_run() if ((! m_run) && (! m_rim)) + { + debugger_instruction_hook(PC); m_icount = 0; /* if processor is stopped, just burn cycles */ + } else if (m_rim) { switch (m_rim_step) { case 0: /* read first word as instruction */ - if (!m_read_binary_word.isnull()) - m_read_binary_word(); /* data will be transferred to IO register */ + MB = 0; + /* data will be transferred to IO register in response to RPB */ + m_extern_iot[2](2, 0, 1, IO, AC); m_rim_step = 1; m_ios = 0; break; @@ -825,8 +827,9 @@ void pdp1_device::execute_run() case 2: /* read second word as data */ - if (!m_read_binary_word.isnull()) - m_read_binary_word(); /* data will be transferred to IO register */ + MB = 0; + /* data will be transferred to IO register in response to RPB */ + m_extern_iot[2](2, 0, 1, IO, AC); m_rim_step = 3; m_ios = 0; break; diff --git a/src/devices/cpu/pdp1/pdp1.h b/src/devices/cpu/pdp1/pdp1.h index 570f8afab4d..0a81c8177d4 100644 --- a/src/devices/cpu/pdp1/pdp1.h +++ b/src/devices/cpu/pdp1/pdp1.h @@ -38,7 +38,6 @@ class pdp1_device : public cpu_device { public: typedef device_delegate iot_delegate; - typedef device_delegate read_binary_word_delegate; typedef device_delegate io_sc_delegate; enum opcode @@ -76,7 +75,6 @@ public: pdp1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template void set_iot_callback(T &&... args) { m_extern_iot[I].set(std::forward(args)...); } - template void set_read_binary_word(T &&... args) { m_read_binary_word.set(std::forward(args)...); } template void set_io_sc_callback(T &&... args) { m_io_sc_callback.set(std::forward(args)...); } void set_reset_param(const pdp1_reset_param_t *param) { m_reset_param = param; } @@ -162,9 +160,7 @@ private: int m_no_sequence_break; /* disable sequence break recognition for one cycle */ /* callbacks for iot instructions (required for any I/O) */ - std::vector m_extern_iot; - /* read a word from the perforated tape reader (required for read-in mode) */ - read_binary_word_delegate m_read_binary_word; + iot_delegate::array<64> m_extern_iot; /* callback called when sc is pulsed: IO devices should reset */ io_sc_delegate m_io_sc_callback; diff --git a/src/mame/drivers/pdp1.cpp b/src/mame/drivers/pdp1.cpp index 5be34e9984b..a659ee9ed8f 100644 --- a/src/mame/drivers/pdp1.cpp +++ b/src/mame/drivers/pdp1.cpp @@ -817,14 +817,6 @@ TIMER_CALLBACK_MEMBER(pdp1_readtape_image_device::reader_callback) } } -/* - Initiate read of a 18-bit word in binary format from tape (used in read-in mode) -*/ -void pdp1_readtape_image_device::tape_read_binary() -{ - begin_tape_read(1, 1); -} - /* perforated tape reader iot callbacks */ @@ -888,6 +880,8 @@ void pdp1_readtape_image_device::iot_rpa(int op2, int nac, int mb, int &io, int * to the IO Register, Status Register Bit 1 is set to one. If bits 5 and 6 are * different (730002 or 724002) the 18-bit word read from tape is automatically * transferred to the IO Register via the Reader Buffer. + * + * The rpb command pulse is also asserted for each word transfer in read-in mode. */ void pdp1_readtape_image_device::iot_rpb(int op2, int nac, int mb, int &io, int ac) { @@ -1506,7 +1500,7 @@ WRITE_LINE_MEMBER(pdp1_state::io_status_w) IO devices should reset */ -void pdp1_state::io_state_clear() +void pdp1_state::io_start_clear() { m_tape_reader->m_rcl = m_tape_reader->m_rc = 0; if (m_tape_reader->m_timer) @@ -1796,8 +1790,7 @@ void pdp1_state::pdp1(machine_config &config) m_maincpu->set_iot_callback<062>(m_parallel_drum, FUNC(pdp1_cylinder_image_device::iot_dba)); m_maincpu->set_iot_callback<063>(m_parallel_drum, FUNC(pdp1_cylinder_image_device::iot_dcc)); m_maincpu->set_iot_callback<064>(m_parallel_drum, FUNC(pdp1_cylinder_image_device::iot_dra)); - m_maincpu->set_read_binary_word(m_tape_reader, FUNC(pdp1_readtape_image_device::tape_read_binary)); - m_maincpu->set_io_sc_callback(FUNC(pdp1_state::io_state_clear)); + m_maincpu->set_io_sc_callback(FUNC(pdp1_state::io_start_clear)); /* video hardware (includes the control panel and typewriter output) */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/includes/pdp1.h b/src/mame/includes/pdp1.h index 2d237290b81..cf7338f18ac 100644 --- a/src/mame/includes/pdp1.h +++ b/src/mame/includes/pdp1.h @@ -184,8 +184,6 @@ public: void iot_rpb(int op2, int nac, int mb, int &io, int ac); void iot_rrb(int op2, int nac, int mb, int &io, int ac); - void tape_read_binary(); - protected: // device-level overrides virtual void device_resolve_objects() override; @@ -460,7 +458,7 @@ private: void iot_cks(int op2, int nac, int mb, int &io, int ac); - void io_state_clear(); + void io_start_clear(); pdp1_reset_param_t m_reset_param; int m_old_lightpen;