cosmac: Added WAIT/CLEAR input lines. [Curt Coder]

This commit is contained in:
Curt Coder 2017-11-11 14:01:07 +02:00
parent 009917fa77
commit 818cb0f6bb
2 changed files with 20 additions and 6 deletions

View File

@ -324,8 +324,8 @@ cdp1802_device::cdp1802_device(const machine_config &mconfig, const char *tag, d
void cosmac_device::device_start() void cosmac_device::device_start()
{ {
// resolve callbacks // resolve callbacks
m_read_wait.resolve_safe(0); m_read_wait.resolve();
m_read_clear.resolve_safe(0); m_read_clear.resolve();
m_read_ef1.resolve(); m_read_ef1.resolve();
m_read_ef2.resolve(); m_read_ef2.resolve();
m_read_ef3.resolve(); m_read_ef3.resolve();
@ -648,6 +648,14 @@ void cosmac_device::execute_set_input(int inputnum, int state)
case COSMAC_INPUT_LINE_EF4: case COSMAC_INPUT_LINE_EF4:
EF[inputnum - COSMAC_INPUT_LINE_EF1] = state; EF[inputnum - COSMAC_INPUT_LINE_EF1] = state;
break; break;
case COSMAC_INPUT_LINE_CLEAR:
m_clear = state;
break;
case COSMAC_INPUT_LINE_WAIT:
m_wait = state;
break;
} }
} }
@ -792,11 +800,11 @@ inline void cosmac_device::debug()
inline void cosmac_device::sample_wait_clear() inline void cosmac_device::sample_wait_clear()
{ {
int wait = m_read_wait(); if (!m_read_wait.isnull()) m_wait = m_read_wait();
int clear = m_read_clear(); if (!m_read_clear.isnull()) m_clear = m_read_clear();
m_pmode = m_mode; m_pmode = m_mode;
m_mode = (cosmac_mode) ((clear << 1) | wait); m_mode = (cosmac_mode) ((m_clear << 1) | m_wait);
} }

View File

@ -126,7 +126,9 @@
// input lines // input lines
enum enum
{ {
COSMAC_INPUT_LINE_INT = 0, COSMAC_INPUT_LINE_WAIT = 0,
COSMAC_INPUT_LINE_CLEAR,
COSMAC_INPUT_LINE_INT,
COSMAC_INPUT_LINE_DMAIN, COSMAC_INPUT_LINE_DMAIN,
COSMAC_INPUT_LINE_DMAOUT, COSMAC_INPUT_LINE_DMAOUT,
COSMAC_INPUT_LINE_EF1, COSMAC_INPUT_LINE_EF1,
@ -205,6 +207,8 @@ public:
// public interfaces // public interfaces
offs_t get_memory_address(); offs_t get_memory_address();
DECLARE_WRITE_LINE_MEMBER( wait_w ) { set_input_line(COSMAC_INPUT_LINE_WAIT, state); }
DECLARE_WRITE_LINE_MEMBER( clear_w ) { set_input_line(COSMAC_INPUT_LINE_CLEAR, state); }
DECLARE_WRITE_LINE_MEMBER( int_w ) { set_input_line(COSMAC_INPUT_LINE_INT, state); } DECLARE_WRITE_LINE_MEMBER( int_w ) { set_input_line(COSMAC_INPUT_LINE_INT, state); }
DECLARE_WRITE_LINE_MEMBER( dma_in_w ) { set_input_line(COSMAC_INPUT_LINE_DMAIN, state); } DECLARE_WRITE_LINE_MEMBER( dma_in_w ) { set_input_line(COSMAC_INPUT_LINE_DMAIN, state); }
DECLARE_WRITE_LINE_MEMBER( dma_out_w ) { set_input_line(COSMAC_INPUT_LINE_DMAOUT, state); } DECLARE_WRITE_LINE_MEMBER( dma_out_w ) { set_input_line(COSMAC_INPUT_LINE_DMAOUT, state); }
@ -411,6 +415,8 @@ protected:
cosmac_state m_state; // state cosmac_state m_state; // state
cosmac_mode m_mode; // control mode cosmac_mode m_mode; // control mode
cosmac_mode m_pmode; // previous control mode cosmac_mode m_pmode; // previous control mode
bool m_wait;
bool m_clear;
int m_irq; // interrupt request int m_irq; // interrupt request
int m_dmain; // DMA input request int m_dmain; // DMA input request
int m_dmaout; // DMA output request int m_dmaout; // DMA output request