pdp1: More cleanups and fixes

This commit is contained in:
AJR 2020-09-14 08:50:49 -04:00
parent d109811e3c
commit f660270ce6
4 changed files with 16 additions and 26 deletions

View File

@ -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;

View File

@ -38,7 +38,6 @@ class pdp1_device : public cpu_device
{
public:
typedef device_delegate<void (int op2, int nac, int mb, int &io, int ac)> iot_delegate;
typedef device_delegate<void ()> read_binary_word_delegate;
typedef device_delegate<void ()> 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 <int I, typename... T> void set_iot_callback(T &&... args) { m_extern_iot[I].set(std::forward<T>(args)...); }
template <typename... T> void set_read_binary_word(T &&... args) { m_read_binary_word.set(std::forward<T>(args)...); }
template <typename... T> void set_io_sc_callback(T &&... args) { m_io_sc_callback.set(std::forward<T>(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<iot_delegate> 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;

View File

@ -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));

View File

@ -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;