mirror of
https://github.com/holub/mame
synced 2025-10-05 16:50:57 +03:00
changed poly88 driver to use callbacks instead of diserial connect() [smf]
This commit is contained in:
parent
c7121ecccb
commit
bb022a9dae
@ -197,7 +197,6 @@ static MACHINE_CONFIG_START( poly88, poly88_state )
|
||||
|
||||
/* uart */
|
||||
MCFG_I8251_ADD("uart", poly88_usart_interface)
|
||||
MCFG_SERIAL_SOURCE_ADD("sercas")
|
||||
|
||||
/* snapshot */
|
||||
MCFG_SNAPSHOT_ADD("snapshot", poly88_state, poly88, "img", 0)
|
||||
|
@ -18,8 +18,7 @@ public:
|
||||
{
|
||||
TIMER_USART,
|
||||
TIMER_KEYBOARD,
|
||||
TIMER_CASSETTE,
|
||||
TIMER_SETUP_MACHINE_STATE
|
||||
TIMER_CASSETTE
|
||||
};
|
||||
|
||||
poly88_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
@ -27,7 +26,6 @@ public:
|
||||
m_video_ram(*this, "video_ram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_uart(*this, "uart"),
|
||||
m_sercas(*this, "sercas"),
|
||||
m_cassette(*this, "cassette"),
|
||||
m_linec(*this, "LINEC"),
|
||||
m_line0(*this, "LINE0"),
|
||||
@ -59,7 +57,7 @@ public:
|
||||
TIMER_CALLBACK_MEMBER(poly88_usart_timer_callback);
|
||||
TIMER_CALLBACK_MEMBER(keyboard_callback);
|
||||
TIMER_CALLBACK_MEMBER(poly88_cassette_timer_callback);
|
||||
TIMER_CALLBACK_MEMBER(setup_machine_state);
|
||||
DECLARE_WRITE_LINE_MEMBER(write_cas_tx);
|
||||
DECLARE_WRITE_LINE_MEMBER(poly88_usart_rxready);
|
||||
IRQ_CALLBACK_MEMBER(poly88_irq_callback);
|
||||
DECLARE_SNAPSHOT_LOAD_MEMBER( poly88 );
|
||||
@ -67,7 +65,6 @@ public:
|
||||
protected:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<i8251_device> m_uart;
|
||||
required_device<serial_source_device> m_sercas;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_ioport m_linec;
|
||||
required_ioport m_line0;
|
||||
@ -79,6 +76,8 @@ protected:
|
||||
required_ioport m_line6;
|
||||
UINT8 row_number(UINT8 code);
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
int m_cas_tx;
|
||||
};
|
||||
|
||||
|
||||
|
@ -25,9 +25,6 @@ void poly88_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
case TIMER_CASSETTE:
|
||||
poly88_cassette_timer_callback(ptr, param);
|
||||
break;
|
||||
case TIMER_SETUP_MACHINE_STATE:
|
||||
setup_machine_state(ptr, param);
|
||||
break;
|
||||
default:
|
||||
assert_always(FALSE, "Unknown id in poly88_state::device_timer");
|
||||
}
|
||||
@ -159,6 +156,11 @@ IRQ_CALLBACK_MEMBER(poly88_state::poly88_irq_callback)
|
||||
return m_int_vector;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(poly88_state::write_cas_tx)
|
||||
{
|
||||
m_cas_tx = state;
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(poly88_state::poly88_cassette_timer_callback)
|
||||
{
|
||||
int data;
|
||||
@ -182,7 +184,7 @@ TIMER_CALLBACK_MEMBER(poly88_state::poly88_cassette_timer_callback)
|
||||
{
|
||||
data = (!m_previous_level && current_level) ? 1 : 0;
|
||||
//data = current_level;
|
||||
m_sercas->send_bit(data);
|
||||
m_uart->write_rx(data);
|
||||
m_uart->receive_clock();
|
||||
|
||||
m_clk_level_tape = 1;
|
||||
@ -193,7 +195,7 @@ TIMER_CALLBACK_MEMBER(poly88_state::poly88_cassette_timer_callback)
|
||||
/* tape writing */
|
||||
if (m_cassette->get_state()&CASSETTE_RECORD)
|
||||
{
|
||||
data = m_sercas->get_in_data_bit();
|
||||
data = m_cas_tx;
|
||||
data ^= m_clk_level_tape;
|
||||
m_cassette->output(data&0x01 ? 1 : -1);
|
||||
|
||||
@ -214,11 +216,6 @@ TIMER_CALLBACK_MEMBER(poly88_state::poly88_cassette_timer_callback)
|
||||
}
|
||||
|
||||
|
||||
TIMER_CALLBACK_MEMBER(poly88_state::setup_machine_state)
|
||||
{
|
||||
m_uart->connect(m_sercas);
|
||||
}
|
||||
|
||||
DRIVER_INIT_MEMBER(poly88_state,poly88)
|
||||
{
|
||||
m_previous_level = 0;
|
||||
@ -234,8 +231,6 @@ void poly88_state::machine_reset()
|
||||
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(poly88_state::poly88_irq_callback),this));
|
||||
m_intr = 0;
|
||||
m_last_code = 0;
|
||||
|
||||
timer_set(attotime::zero, TIMER_SETUP_MACHINE_STATE);
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(poly88_state::poly88_interrupt)
|
||||
@ -252,7 +247,7 @@ WRITE_LINE_MEMBER(poly88_state::poly88_usart_rxready)
|
||||
|
||||
const i8251_interface poly88_usart_interface=
|
||||
{
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_LINE_MEMBER(poly88_state,write_cas_tx),
|
||||
DEVCB_NULL,
|
||||
DEVCB_NULL,
|
||||
DEVCB_DRIVER_LINE_MEMBER(poly88_state,poly88_usart_rxready),
|
||||
|
Loading…
Reference in New Issue
Block a user