mirror of
https://github.com/holub/mame
synced 2025-07-03 00:56:03 +03:00
Cleaned up serial, matrix keyboard and TI-8x link protocol interfaces:
* Switched to delegate timers - Frees implementations from having to call timer method - Eliminates risk of ID conflicts with implementations/other interfaces * Moved save state registration to interface post start - Plays nicely with device_missing_dependencies exceptions - Frees implementation from having to call save state registration method - Improves save state support in devices that neglected to call method
This commit is contained in:
parent
7d98022797
commit
c5c3012634
@ -224,7 +224,6 @@ apricot_keyboard_hle_device::apricot_keyboard_hle_device(const machine_config &m
|
||||
|
||||
void apricot_keyboard_hle_device::device_start()
|
||||
{
|
||||
device_buffered_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -348,13 +347,3 @@ void apricot_keyboard_hle_device::out_w(int state)
|
||||
{
|
||||
device_buffered_serial_interface::rx_w(state);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_timer - device-specific timer
|
||||
//-------------------------------------------------
|
||||
|
||||
void apricot_keyboard_hle_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
device_buffered_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
@ -49,8 +49,6 @@ protected:
|
||||
virtual void key_make(uint8_t row, uint8_t column) override;
|
||||
virtual void key_break(uint8_t row, uint8_t column) override;
|
||||
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
private:
|
||||
enum {
|
||||
CMD_REQ_TIME_AND_DATE = 0xe1,
|
||||
|
@ -277,16 +277,6 @@ void hle_device_base::device_reset()
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
hle_device_base::device_timer
|
||||
handle timed events
|
||||
--------------------------------------------------*/
|
||||
|
||||
void hle_device_base::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
void hle_device_base::hil_write(uint16_t data)
|
||||
{
|
||||
int frames = 0;
|
||||
|
@ -26,7 +26,6 @@ protected:
|
||||
// device overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// device_matrix_keyboard_interface overrides
|
||||
virtual void key_make(uint8_t row, uint8_t column) override;
|
||||
@ -36,9 +35,6 @@ protected:
|
||||
virtual void hil_write(uint16_t data) override;
|
||||
|
||||
private:
|
||||
// device_serial_interface uses 10'000 range
|
||||
// device_matrix_keyboard_interface uses 20'000 range
|
||||
|
||||
void transmit_byte(uint8_t byte);
|
||||
|
||||
util::fifo<uint8_t, 8> m_fifo;
|
||||
|
@ -20,17 +20,40 @@ namespace bus { namespace intellec4 {
|
||||
univ_slot_device::univ_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, INTELLEC4_UNIV_SLOT, tag, owner, clock)
|
||||
, device_slot_interface(mconfig, *this)
|
||||
, m_bus(*this, finder_base::DUMMY_TAG)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------
|
||||
configuration helpers
|
||||
----------------------------------*/
|
||||
|
||||
void univ_slot_device::set_bus_tag(device_t &device, char const *tag)
|
||||
{
|
||||
downcast<univ_slot_device &>(device).m_bus.set_tag(tag);
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------
|
||||
device_t implementation
|
||||
----------------------------------*/
|
||||
|
||||
void univ_slot_device::device_validity_check(validity_checker &valid) const
|
||||
{
|
||||
device_t *const card(get_card_device());
|
||||
if (card && !dynamic_cast<device_univ_card_interface *>(card))
|
||||
osd_printf_error("Card device %s (%s) does not implement device_univ_card_interface\n", card->tag(), card->name());
|
||||
}
|
||||
|
||||
void univ_slot_device::device_start()
|
||||
{
|
||||
device_t *const card_device(get_card_device());
|
||||
device_univ_card_interface *const univ_card(dynamic_cast<device_univ_card_interface *>(card_device));
|
||||
if (card_device && !univ_card)
|
||||
throw emu_fatalerror("univ_slot_device: card device %s (%s) does not implement device_univ_card_interface\n", card_device->tag(), card_device->name());
|
||||
if (univ_card)
|
||||
univ_card->set_bus(*m_bus);
|
||||
}
|
||||
|
||||
|
||||
@ -39,6 +62,31 @@ void univ_slot_device::device_start()
|
||||
BUS DEVICE
|
||||
***********************************************************************/
|
||||
|
||||
univ_bus_device::univ_bus_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, INTELLEC4_UNIV_BUS, tag, owner, clock)
|
||||
, m_rom_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_rom_ports_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_memory_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_status_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_ram_ports_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_rom_space(-1)
|
||||
, m_rom_ports_space(-1)
|
||||
, m_memory_space(-1)
|
||||
, m_status_space(-1)
|
||||
, m_ram_ports_space(-1)
|
||||
, m_stop_out_cb(*this)
|
||||
, m_test_out_cb(*this)
|
||||
, m_reset_4002_out_cb(*this)
|
||||
, m_user_reset_out_cb(*this)
|
||||
, m_stop(0U)
|
||||
, m_test(0U)
|
||||
, m_reset_4002(0U)
|
||||
, m_user_reset(0U)
|
||||
{
|
||||
std::fill(std::begin(m_cards), std::end(m_cards), nullptr);
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------
|
||||
address space configuration
|
||||
----------------------------------*/
|
||||
@ -79,31 +127,6 @@ void univ_bus_device::set_ram_ports_space(device_t &device, char const *tag, int
|
||||
}
|
||||
|
||||
|
||||
univ_bus_device::univ_bus_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, INTELLEC4_UNIV_BUS, tag, owner, clock)
|
||||
, m_rom_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_rom_ports_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_memory_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_status_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_ram_ports_device(*this, finder_base::DUMMY_TAG)
|
||||
, m_rom_space(-1)
|
||||
, m_rom_ports_space(-1)
|
||||
, m_memory_space(-1)
|
||||
, m_status_space(-1)
|
||||
, m_ram_ports_space(-1)
|
||||
, m_stop_out_cb(*this)
|
||||
, m_test_out_cb(*this)
|
||||
, m_reset_4002_out_cb(*this)
|
||||
, m_user_reset_out_cb(*this)
|
||||
, m_stop(0U)
|
||||
, m_test(0U)
|
||||
, m_reset_4002(0U)
|
||||
, m_user_reset(0U)
|
||||
{
|
||||
std::fill(std::begin(m_cards), std::end(m_cards), nullptr);
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------
|
||||
input lines
|
||||
----------------------------------*/
|
||||
@ -177,6 +200,50 @@ void univ_bus_device::device_start()
|
||||
m_user_reset_out_cb.resolve_safe();
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------
|
||||
helpers for cards
|
||||
----------------------------------*/
|
||||
|
||||
unsigned univ_bus_device::add_card(device_univ_card_interface &card)
|
||||
{
|
||||
for (unsigned i = 0; ARRAY_LENGTH(m_cards) > i; ++i)
|
||||
{
|
||||
if (!m_cards[i])
|
||||
{
|
||||
m_cards[i] = &card;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
throw emu_fatalerror("univ_bus_device: maximum number of cards (%u) exceeded\n", unsigned(ARRAY_LENGTH(m_cards)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
CARD INTERFACE
|
||||
***********************************************************************/
|
||||
|
||||
device_univ_card_interface::device_univ_card_interface(const machine_config &mconfig, device_t &device)
|
||||
: device_slot_card_interface(mconfig, device)
|
||||
, m_bus(nullptr)
|
||||
, m_index(~unsigned(0))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void device_univ_card_interface::interface_pre_start()
|
||||
{
|
||||
if (!m_bus)
|
||||
throw device_missing_dependencies();
|
||||
}
|
||||
|
||||
|
||||
void device_univ_card_interface::set_bus(univ_bus_device &bus)
|
||||
{
|
||||
m_index = (m_bus = &bus)->add_card(*this);
|
||||
}
|
||||
|
||||
} } // namespace bus::intellec4
|
||||
|
||||
|
||||
|
@ -117,7 +117,7 @@ to implement the card in both systems.
|
||||
#define MCFG_INTELLEC4_UNIV_SLOT_ADD(bus_tag, slot_tag, clock, slot_intf, def_slot) \
|
||||
MCFG_DEVICE_ADD(slot_tag, INTELLEC4_UNIV_SLOT, clock) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(slot_intf, def_slot, false) \
|
||||
bus::intellec4::univ_slot_device::set_bus_tag(*device, bus_tag);
|
||||
bus::intellec4::univ_slot_device::set_bus_tag(*device, "^" bus_tag);
|
||||
|
||||
#define MCFG_INTELLEC4_UNIV_SLOT_REMOVE(slot_tag) \
|
||||
MCFG_DEVICE_REMOVE(slot_tag)
|
||||
@ -168,13 +168,19 @@ public:
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual void device_validity_check(validity_checker &valid) const override ATTR_COLD;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
required_device<univ_bus_device> m_bus;
|
||||
};
|
||||
|
||||
|
||||
class univ_bus_device : public device_t
|
||||
{
|
||||
public:
|
||||
friend class device_univ_card_interface;
|
||||
|
||||
// address space configuration
|
||||
static void set_rom_space(device_t &device, char const *tag, int space);
|
||||
static void set_rom_ports_space(device_t &device, char const *tag, int space);
|
||||
@ -214,6 +220,9 @@ protected:
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
// helpers for cards
|
||||
unsigned add_card(device_univ_card_interface &card);
|
||||
|
||||
// finding address spaces
|
||||
required_device<device_memory_interface> m_rom_device, m_rom_ports_device;
|
||||
required_device<device_memory_interface> m_memory_device, m_status_device, m_ram_ports_device;
|
||||
@ -236,6 +245,20 @@ private:
|
||||
|
||||
class device_univ_card_interface : public device_slot_card_interface
|
||||
{
|
||||
protected:
|
||||
friend class univ_slot_device;
|
||||
friend class univ_bus_device;
|
||||
|
||||
device_univ_card_interface(const machine_config &mconfig, device_t &device);
|
||||
|
||||
// device_interface implementation
|
||||
void interface_pre_start() override;
|
||||
|
||||
private:
|
||||
void set_bus(univ_bus_device &bus);
|
||||
|
||||
univ_bus_device *m_bus;
|
||||
unsigned m_index;
|
||||
};
|
||||
|
||||
} } // namespace bus::intellec4
|
||||
|
@ -1568,13 +1568,10 @@ void sb_device::dack_w(int line, uint8_t data)
|
||||
|
||||
void sb_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
|
||||
{
|
||||
// printf("DMA timer expire\n");
|
||||
if (tid)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, tid, param, ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
// printf("DMA timer expire\n");
|
||||
uint16_t lsample, rsample;
|
||||
switch (m_dsp.flags) {
|
||||
case 0: // 8-bit unsigned mono
|
||||
|
@ -40,10 +40,6 @@ void nes_miracle_device::device_timer(emu_timer &timer, device_timer_id id, int
|
||||
{
|
||||
m_strobe_clock++;
|
||||
}
|
||||
else
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
|
@ -47,12 +47,6 @@ WRITE_LINE_MEMBER( serial_keyboard_device::update_serial )
|
||||
reset();
|
||||
}
|
||||
|
||||
void serial_keyboard_device::device_start()
|
||||
{
|
||||
generic_keyboard_device::device_start();
|
||||
device_buffered_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
void serial_keyboard_device::device_reset()
|
||||
{
|
||||
generic_keyboard_device::device_reset();
|
||||
@ -79,13 +73,6 @@ void serial_keyboard_device::device_reset()
|
||||
transmit_register_reset();
|
||||
}
|
||||
|
||||
void serial_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
// give both bases a chance to handle it
|
||||
device_buffered_serial_interface::device_timer(timer, id, param, ptr);
|
||||
generic_keyboard_device::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
void serial_keyboard_device::tra_callback()
|
||||
{
|
||||
output_rxd(transmit_register_get_data_bit());
|
||||
|
@ -27,9 +27,7 @@ public:
|
||||
protected:
|
||||
serial_keyboard_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void tra_callback() override;
|
||||
virtual void send_key(uint8_t code) override;
|
||||
|
||||
|
@ -89,7 +89,7 @@ void null_modem_device::device_timer(emu_timer &timer, device_timer_id id, int p
|
||||
break;
|
||||
|
||||
default:
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,11 +67,6 @@ WRITE_LINE_MEMBER(serial_printer_device::printer_online)
|
||||
/// TODO: ?
|
||||
}
|
||||
|
||||
void serial_printer_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
void serial_printer_device::rcv_complete()
|
||||
{
|
||||
receive_register_extract();
|
||||
|
@ -24,7 +24,6 @@ protected:
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
virtual void rcv_complete() override;
|
||||
|
||||
|
@ -90,7 +90,7 @@ void pseudo_terminal_device::device_timer(emu_timer &timer, device_timer_id id,
|
||||
break;
|
||||
|
||||
default:
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,15 +276,12 @@ protected:
|
||||
|
||||
virtual void device_start() override
|
||||
{
|
||||
device_buffered_serial_interface<FIFO_LENGTH>::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
virtual void tra_callback() override
|
||||
{
|
||||
output_rxd(this->transmit_register_get_data_bit());
|
||||
}
|
||||
|
||||
using device_buffered_serial_interface<FIFO_LENGTH>::device_timer;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(RS232_PORT, rs232_port_device)
|
||||
|
@ -86,46 +86,42 @@ void serial_mouse_device::tra_callback()
|
||||
**************************************************************************/
|
||||
void serial_mouse_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if (id)
|
||||
if (!id)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
return;
|
||||
static int ox = 0, oy = 0;
|
||||
int nx,ny;
|
||||
int dx, dy, nb;
|
||||
int mbc;
|
||||
|
||||
/* Do not get deltas or send packets if queue is not empty (Prevents drifting) */
|
||||
if (m_head==m_tail)
|
||||
{
|
||||
nx = m_x->read();
|
||||
|
||||
dx = nx - ox;
|
||||
if (dx<=-0x800) dx = nx + 0x1000 - ox; /* Prevent jumping */
|
||||
if (dx>=0x800) dx = nx - 0x1000 - ox;
|
||||
ox = nx;
|
||||
|
||||
ny = m_y->read();
|
||||
|
||||
dy = ny - oy;
|
||||
if (dy<=-0x800) dy = ny + 0x1000 - oy;
|
||||
if (dy>=0x800) dy = ny - 0x1000 - oy;
|
||||
oy = ny;
|
||||
|
||||
nb = m_btn->read();
|
||||
mbc = nb^m_mb;
|
||||
m_mb = nb;
|
||||
|
||||
/* check if there is any delta or mouse buttons changed */
|
||||
if ( (dx!=0) || (dy!=0) || (mbc!=0) )
|
||||
mouse_trans(dx, dy, nb, mbc);
|
||||
}
|
||||
|
||||
if(m_tail != m_head && is_transmit_register_empty())
|
||||
transmit_register_setup(unqueue_data());
|
||||
}
|
||||
|
||||
static int ox = 0, oy = 0;
|
||||
int nx,ny;
|
||||
int dx, dy, nb;
|
||||
int mbc;
|
||||
|
||||
/* Do not get deltas or send packets if queue is not empty (Prevents drifting) */
|
||||
if (m_head==m_tail)
|
||||
{
|
||||
nx = m_x->read();
|
||||
|
||||
dx = nx - ox;
|
||||
if (dx<=-0x800) dx = nx + 0x1000 - ox; /* Prevent jumping */
|
||||
if (dx>=0x800) dx = nx - 0x1000 - ox;
|
||||
ox = nx;
|
||||
|
||||
ny = m_y->read();
|
||||
|
||||
dy = ny - oy;
|
||||
if (dy<=-0x800) dy = ny + 0x1000 - oy;
|
||||
if (dy>=0x800) dy = ny - 0x1000 - oy;
|
||||
oy = ny;
|
||||
|
||||
nb = m_btn->read();
|
||||
mbc = nb^m_mb;
|
||||
m_mb = nb;
|
||||
|
||||
/* check if there is any delta or mouse buttons changed */
|
||||
if ( (dx!=0) || (dy!=0) || (mbc!=0) )
|
||||
mouse_trans(dx, dy, nb, mbc);
|
||||
}
|
||||
|
||||
|
||||
if(m_tail != m_head && is_transmit_register_empty())
|
||||
transmit_register_setup(unqueue_data());
|
||||
}
|
||||
|
||||
void microsoft_mouse_device::mouse_trans(int dx, int dy, int nb, int mbc)
|
||||
|
@ -32,12 +32,6 @@ ioport_constructor serial_terminal_device::device_input_ports() const
|
||||
return INPUT_PORTS_NAME(serial_terminal);
|
||||
}
|
||||
|
||||
void serial_terminal_device::device_start()
|
||||
{
|
||||
generic_terminal_device::device_start();
|
||||
device_buffered_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(serial_terminal_device::update_serial)
|
||||
{
|
||||
clear_fifo();
|
||||
@ -72,12 +66,6 @@ void serial_terminal_device::device_reset()
|
||||
update_serial(0);
|
||||
}
|
||||
|
||||
void serial_terminal_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
generic_terminal_device::device_timer(timer, id, param, ptr);
|
||||
device_buffered_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
void serial_terminal_device::send_key(uint8_t code)
|
||||
{
|
||||
transmit_byte(code);
|
||||
|
@ -20,9 +20,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
virtual void tra_callback() override;
|
||||
virtual void send_key(uint8_t code) override;
|
||||
|
@ -65,7 +65,7 @@ void jvc_xvd701_device::device_timer(emu_timer &timer, device_timer_id id, int p
|
||||
break;
|
||||
|
||||
default:
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,10 +41,6 @@ void snes_miracle_device::device_timer(emu_timer &timer, device_timer_id id, int
|
||||
{
|
||||
m_strobe_clock++;
|
||||
}
|
||||
else
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
|
@ -802,8 +802,6 @@ MACHINE_CONFIG_END
|
||||
|
||||
void hle_device_base::device_start()
|
||||
{
|
||||
device_buffered_serial_interface::register_save_state(machine().save(), this);
|
||||
|
||||
m_click_timer = timer_alloc(CLICK_TIMER_ID);
|
||||
|
||||
save_item(NAME(m_make_count));
|
||||
@ -874,8 +872,7 @@ void hle_device_base::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
break;
|
||||
|
||||
default:
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
device_buffered_serial_interface::device_timer(timer, id, param, ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,8 +52,6 @@ protected:
|
||||
required_ioport m_dips;
|
||||
|
||||
private:
|
||||
// device_serial_interface uses 10'000 range
|
||||
// device_matrix_keyboard_interface uses 20'000 range
|
||||
enum {
|
||||
CLICK_TIMER_ID = 30'000
|
||||
};
|
||||
|
@ -30,8 +30,6 @@ graph_link_hle_device::graph_link_hle_device(
|
||||
|
||||
void graph_link_hle_device::device_start()
|
||||
{
|
||||
device_serial_interface::register_save_state(machine().save(), this);
|
||||
|
||||
m_buffer = std::make_unique<u8 []>(BUFLEN);
|
||||
|
||||
save_pointer(NAME(m_buffer.get()), BUFLEN);
|
||||
@ -51,13 +49,6 @@ void graph_link_hle_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
void graph_link_hle_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_ti8x_link_port_byte_interface::device_timer(timer, id, param, ptr);
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
MACHINE_CONFIG_MEMBER(graph_link_hle_device::device_add_mconfig)
|
||||
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, nullptr)
|
||||
MCFG_RS232_RXD_HANDLER(WRITELINE(graph_link_hle_device, rx_w))
|
||||
|
@ -37,7 +37,6 @@ protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
virtual void byte_collision() override;
|
||||
virtual void byte_send_timeout() override;
|
||||
|
@ -120,16 +120,23 @@ void device_ti8x_link_port_bit_interface::interface_pre_start()
|
||||
{
|
||||
device_ti8x_link_port_interface::interface_pre_start();
|
||||
|
||||
m_error_timer = device().timer_alloc(TIMER_ID_BIT_TIMEOUT);
|
||||
if (!m_error_timer)
|
||||
m_error_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_ti8x_link_port_bit_interface::bit_timeout), this));
|
||||
|
||||
m_bit_phase = IDLE;
|
||||
m_tx_bit_buffer = EMPTY;
|
||||
m_tip_in = m_ring_in = true;
|
||||
}
|
||||
|
||||
|
||||
void device_ti8x_link_port_bit_interface::interface_post_start()
|
||||
{
|
||||
device_ti8x_link_port_interface::interface_post_start();
|
||||
|
||||
device().save_item(NAME(m_bit_phase));
|
||||
device().save_item(NAME(m_tx_bit_buffer));
|
||||
device().save_item(NAME(m_tip_in));
|
||||
device().save_item(NAME(m_ring_in));
|
||||
|
||||
m_bit_phase = IDLE;
|
||||
m_tx_bit_buffer = EMPTY;
|
||||
m_tip_in = m_ring_in = true;
|
||||
}
|
||||
|
||||
|
||||
@ -146,66 +153,6 @@ void device_ti8x_link_port_bit_interface::interface_pre_reset()
|
||||
}
|
||||
|
||||
|
||||
void device_ti8x_link_port_bit_interface::device_timer(
|
||||
emu_timer &timer,
|
||||
device_timer_id id,
|
||||
int param, void *ptr)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_ID_BIT_TIMEOUT:
|
||||
switch (m_bit_phase)
|
||||
{
|
||||
// something very bad happened (heap smash?)
|
||||
case IDLE:
|
||||
case HOLD_0:
|
||||
case HOLD_1:
|
||||
default:
|
||||
throw false;
|
||||
|
||||
// receive timeout
|
||||
case ACK_0:
|
||||
case ACK_1:
|
||||
LOGBITPROTO("timeout acknowledging %d bit\n", (ACK_0 == m_bit_phase) ? 0 : 1);
|
||||
output_tip(1);
|
||||
output_ring(1);
|
||||
if (m_tip_in && m_ring_in)
|
||||
{
|
||||
check_tx_bit_buffer();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGBITPROTO("waiting for bus idle\n");
|
||||
m_error_timer->reset((EMPTY == m_tx_bit_buffer) ? attotime::never : attotime(1, 0)); // TODO: configurable timeout
|
||||
m_bit_phase = WAIT_IDLE;
|
||||
}
|
||||
bit_receive_timeout();
|
||||
break;
|
||||
|
||||
// send timeout:
|
||||
case WAIT_IDLE:
|
||||
assert(EMPTY != m_tx_bit_buffer);
|
||||
case WAIT_ACK_0:
|
||||
case WAIT_ACK_1:
|
||||
case WAIT_REL_0:
|
||||
case WAIT_REL_1:
|
||||
LOGBITPROTO("timeout sending bit\n");
|
||||
m_error_timer->reset();
|
||||
m_bit_phase = (m_tip_in && m_ring_in) ? IDLE : WAIT_IDLE;
|
||||
m_tx_bit_buffer = EMPTY;
|
||||
output_tip(1);
|
||||
output_ring(1);
|
||||
bit_send_timeout();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void device_ti8x_link_port_bit_interface::send_bit(bool data)
|
||||
{
|
||||
LOGBITPROTO("queue %d bit\n", data ? 1 : 0);
|
||||
@ -452,6 +399,55 @@ WRITE_LINE_MEMBER(device_ti8x_link_port_bit_interface::input_ring)
|
||||
}
|
||||
|
||||
|
||||
TIMER_CALLBACK_MEMBER(device_ti8x_link_port_bit_interface::bit_timeout)
|
||||
{
|
||||
switch (m_bit_phase)
|
||||
{
|
||||
// something very bad happened (heap smash?)
|
||||
case IDLE:
|
||||
case HOLD_0:
|
||||
case HOLD_1:
|
||||
default:
|
||||
throw false;
|
||||
|
||||
// receive timeout
|
||||
case ACK_0:
|
||||
case ACK_1:
|
||||
LOGBITPROTO("timeout acknowledging %d bit\n", (ACK_0 == m_bit_phase) ? 0 : 1);
|
||||
output_tip(1);
|
||||
output_ring(1);
|
||||
if (m_tip_in && m_ring_in)
|
||||
{
|
||||
check_tx_bit_buffer();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGBITPROTO("waiting for bus idle\n");
|
||||
m_error_timer->reset((EMPTY == m_tx_bit_buffer) ? attotime::never : attotime(1, 0)); // TODO: configurable timeout
|
||||
m_bit_phase = WAIT_IDLE;
|
||||
}
|
||||
bit_receive_timeout();
|
||||
break;
|
||||
|
||||
// send timeout:
|
||||
case WAIT_IDLE:
|
||||
assert(EMPTY != m_tx_bit_buffer);
|
||||
case WAIT_ACK_0:
|
||||
case WAIT_ACK_1:
|
||||
case WAIT_REL_0:
|
||||
case WAIT_REL_1:
|
||||
LOGBITPROTO("timeout sending bit\n");
|
||||
m_error_timer->reset();
|
||||
m_bit_phase = (m_tip_in && m_ring_in) ? IDLE : WAIT_IDLE;
|
||||
m_tx_bit_buffer = EMPTY;
|
||||
output_tip(1);
|
||||
output_ring(1);
|
||||
bit_send_timeout();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void device_ti8x_link_port_bit_interface::check_tx_bit_buffer()
|
||||
{
|
||||
assert(m_tip_in);
|
||||
@ -506,10 +502,16 @@ void device_ti8x_link_port_byte_interface::interface_pre_start()
|
||||
{
|
||||
device_ti8x_link_port_bit_interface::interface_pre_start();
|
||||
|
||||
m_tx_byte_buffer = m_rx_byte_buffer = 0U;
|
||||
}
|
||||
|
||||
|
||||
void device_ti8x_link_port_byte_interface::interface_post_start()
|
||||
{
|
||||
device_ti8x_link_port_bit_interface::interface_post_start();
|
||||
|
||||
device().save_item(NAME(m_tx_byte_buffer));
|
||||
device().save_item(NAME(m_rx_byte_buffer));
|
||||
|
||||
m_tx_byte_buffer = m_rx_byte_buffer = 0U;
|
||||
}
|
||||
|
||||
|
||||
|
@ -125,19 +125,13 @@ protected:
|
||||
device_ti8x_link_port_bit_interface(machine_config const &mconfig, device_t &device);
|
||||
|
||||
virtual void interface_pre_start() override;
|
||||
virtual void interface_post_start() override;
|
||||
virtual void interface_pre_reset() override;
|
||||
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
void send_bit(bool data);
|
||||
void accept_bit();
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
TIMER_ID_BIT_TIMEOUT = 20000 // ensure this doesn't clash with device_serial_interface
|
||||
};
|
||||
|
||||
enum bit_phase
|
||||
{
|
||||
IDLE,
|
||||
@ -168,6 +162,8 @@ private:
|
||||
virtual void bit_sent() = 0;
|
||||
virtual void bit_received(bool data) = 0;
|
||||
|
||||
TIMER_CALLBACK_MEMBER(bit_timeout);
|
||||
|
||||
void check_tx_bit_buffer();
|
||||
|
||||
emu_timer * m_error_timer;
|
||||
@ -183,6 +179,7 @@ protected:
|
||||
device_ti8x_link_port_byte_interface(machine_config const &mconfig, device_t &device);
|
||||
|
||||
virtual void interface_pre_start() override;
|
||||
virtual void interface_post_start() override;
|
||||
virtual void interface_pre_reset() override;
|
||||
|
||||
void send_byte(u8 data);
|
||||
|
@ -64,27 +64,24 @@ void midiin_device::device_reset()
|
||||
|
||||
void midiin_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if (id) {
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
return;
|
||||
}
|
||||
if (!id) {
|
||||
uint8_t buf[8192*4];
|
||||
int bytesRead;
|
||||
|
||||
uint8_t buf[8192*4];
|
||||
int bytesRead;
|
||||
if (m_midi == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_midi == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (m_midi->poll())
|
||||
{
|
||||
bytesRead = m_midi->read(buf);
|
||||
|
||||
if (bytesRead > 0)
|
||||
while (m_midi->poll())
|
||||
{
|
||||
for (int i = 0; i < bytesRead; i++)
|
||||
bytesRead = m_midi->read(buf);
|
||||
|
||||
if (bytesRead > 0)
|
||||
{
|
||||
xmit_char(buf[i]);
|
||||
for (int i = 0; i < bytesRead; i++)
|
||||
{
|
||||
xmit_char(buf[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,11 +47,6 @@ void midiout_device::device_reset()
|
||||
set_tra_rate(0);
|
||||
}
|
||||
|
||||
void midiout_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
call_load
|
||||
-------------------------------------------------*/
|
||||
|
@ -53,7 +53,6 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// serial overrides
|
||||
virtual void rcv_complete() override; // Rx completed receiving byte
|
||||
|
@ -205,8 +205,6 @@ void mpcc_device::device_start()
|
||||
save_item(NAME(m_ccr));
|
||||
save_item(NAME(m_ecr));
|
||||
LOG(" - MPCC variant %02x\n", m_variant);
|
||||
|
||||
device_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -259,11 +257,6 @@ void mpcc_device::device_reset()
|
||||
/*
|
||||
* Serial device implementation
|
||||
*/
|
||||
void mpcc_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mpcc_device::cts_w)
|
||||
{
|
||||
if (state == CLEAR_LINE)
|
||||
|
@ -130,7 +130,6 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// device_serial_interface overrides
|
||||
virtual void tra_callback() override;
|
||||
|
@ -97,7 +97,6 @@ void i8251_device::device_start()
|
||||
save_item(NAME(m_br_factor));
|
||||
save_item(NAME(m_rx_data));
|
||||
save_item(NAME(m_tx_data));
|
||||
device_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
|
||||
@ -678,12 +677,6 @@ READ8_MEMBER(i8251_device::data_r)
|
||||
}
|
||||
|
||||
|
||||
void i8251_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
WRITE_LINE_MEMBER(i8251_device::write_rxd)
|
||||
{
|
||||
m_rxd = state;
|
||||
|
@ -91,7 +91,6 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
void command_w(uint8_t data);
|
||||
void mode_w(uint8_t data);
|
||||
|
@ -208,8 +208,6 @@ READ8_MEMBER(ie15_device::kb_s_lin_r)
|
||||
|
||||
void ie15_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_HBLANK:
|
||||
|
@ -151,16 +151,6 @@ void im6402_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_timer - handler timer events
|
||||
//-------------------------------------------------
|
||||
|
||||
void im6402_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// tra_callback -
|
||||
//-------------------------------------------------
|
||||
|
@ -114,7 +114,6 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// device_serial_interface overrides
|
||||
virtual void tra_callback() override;
|
||||
|
@ -560,7 +560,6 @@ void ins8250_uart_device::device_start()
|
||||
set_tra_rate(0);
|
||||
set_rcv_rate(0);
|
||||
|
||||
device_serial_interface::register_save_state(machine().save(), this);
|
||||
save_item(NAME(m_regs.thr));
|
||||
save_item(NAME(m_regs.rbr));
|
||||
save_item(NAME(m_regs.ier));
|
||||
@ -602,11 +601,6 @@ void ins8250_uart_device::device_reset()
|
||||
m_out_out2_cb(1);
|
||||
}
|
||||
|
||||
void ins8250_uart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
void ns16550_device::device_start()
|
||||
{
|
||||
m_timeout = timer_alloc();
|
||||
@ -633,9 +627,7 @@ void ns16550_device::device_reset()
|
||||
|
||||
void ns16550_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if(id)
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
else
|
||||
if(!id)
|
||||
{
|
||||
trigger_int(COM_INT_PENDING_CHAR_TIMEOUT);
|
||||
m_timeout->adjust(attotime::never);
|
||||
|
@ -51,7 +51,6 @@ protected:
|
||||
virtual void rcv_complete() override;
|
||||
virtual void tra_complete() override;
|
||||
virtual void tra_callback() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
virtual void set_fcr(uint8_t data) { }
|
||||
virtual void push_tx(uint8_t data) { }
|
||||
|
@ -288,12 +288,6 @@ void generic_keyboard_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
void generic_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
void generic_keyboard_device::key_make(u8 row, u8 column)
|
||||
{
|
||||
send_translated((row << 4) | column);
|
||||
|
@ -47,7 +47,6 @@ protected:
|
||||
|
||||
virtual void interface_pre_start() override;
|
||||
virtual void interface_post_start() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
void start_processing(const attotime &period);
|
||||
void stop_processing();
|
||||
@ -66,13 +65,8 @@ protected:
|
||||
bool are_all_keys_up();
|
||||
|
||||
private:
|
||||
// device_serial_interface uses 10'000 range
|
||||
enum {
|
||||
TIMER_ID_SCAN = 20'000,
|
||||
TIMER_ID_TYPEMATIC
|
||||
};
|
||||
|
||||
void scan_row();
|
||||
TIMER_CALLBACK_MEMBER(scan_row);
|
||||
TIMER_CALLBACK_MEMBER(typematic);
|
||||
|
||||
emu_timer *m_scan_timer;
|
||||
emu_timer *m_typematic_timer;
|
||||
@ -109,7 +103,6 @@ protected:
|
||||
u32 clock);
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void key_make(u8 row, u8 column) override;
|
||||
virtual void key_repeat(u8 row, u8 column) override;
|
||||
virtual void send_key(u8 code);
|
||||
|
@ -33,8 +33,10 @@ device_matrix_keyboard_interface<ROW_COUNT>::device_matrix_keyboard_interface(ma
|
||||
template <uint8_t ROW_COUNT>
|
||||
void device_matrix_keyboard_interface<ROW_COUNT>::interface_pre_start()
|
||||
{
|
||||
m_scan_timer = device().timer_alloc(TIMER_ID_SCAN);
|
||||
m_typematic_timer = device().timer_alloc(TIMER_ID_TYPEMATIC);
|
||||
if (!m_scan_timer)
|
||||
m_scan_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_matrix_keyboard_interface<ROW_COUNT>::scan_row), this));
|
||||
if (!m_typematic_timer)
|
||||
m_typematic_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_matrix_keyboard_interface<ROW_COUNT>::typematic), this));
|
||||
reset_key_state();
|
||||
typematic_stop();
|
||||
}
|
||||
@ -51,22 +53,6 @@ void device_matrix_keyboard_interface<ROW_COUNT>::interface_post_start()
|
||||
}
|
||||
|
||||
|
||||
template <uint8_t ROW_COUNT>
|
||||
void device_matrix_keyboard_interface<ROW_COUNT>::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_ID_SCAN:
|
||||
scan_row();
|
||||
break;
|
||||
case TIMER_ID_TYPEMATIC:
|
||||
assert((m_typematic_row != uint8_t(~0U)) || (m_typematic_column != uint8_t(~0U)));
|
||||
key_repeat(m_typematic_row, m_typematic_column);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <uint8_t ROW_COUNT>
|
||||
void device_matrix_keyboard_interface<ROW_COUNT>::start_processing(const attotime &period)
|
||||
{
|
||||
@ -118,7 +104,7 @@ void device_matrix_keyboard_interface<ROW_COUNT>::typematic_stop()
|
||||
|
||||
|
||||
template <uint8_t ROW_COUNT>
|
||||
void device_matrix_keyboard_interface<ROW_COUNT>::scan_row()
|
||||
TIMER_CALLBACK_MEMBER(device_matrix_keyboard_interface<ROW_COUNT>::scan_row)
|
||||
{
|
||||
assert(m_next_row < ARRAY_LENGTH(m_key_rows));
|
||||
assert(m_next_row < ARRAY_LENGTH(m_key_states));
|
||||
@ -146,6 +132,14 @@ void device_matrix_keyboard_interface<ROW_COUNT>::scan_row()
|
||||
}
|
||||
|
||||
|
||||
template <uint8_t ROW_COUNT>
|
||||
TIMER_CALLBACK_MEMBER(device_matrix_keyboard_interface<ROW_COUNT>::typematic)
|
||||
{
|
||||
assert((m_typematic_row != uint8_t(~0U)) || (m_typematic_column != uint8_t(~0U)));
|
||||
key_repeat(m_typematic_row, m_typematic_column);
|
||||
}
|
||||
|
||||
|
||||
template <uint8_t ROW_COUNT>
|
||||
void device_matrix_keyboard_interface<ROW_COUNT>::key_repeat(uint8_t row, uint8_t column)
|
||||
{
|
||||
|
@ -492,9 +492,3 @@ READ_LINE_MEMBER( mc2661_device::txemt_r )
|
||||
{
|
||||
return (m_sr & STATUS_TXEMT) ? ASSERT_LINE : CLEAR_LINE;
|
||||
}
|
||||
|
||||
|
||||
void mc2661_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
@ -108,7 +108,6 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// device_serial_interface overrides
|
||||
virtual void tra_callback() override;
|
||||
|
@ -113,16 +113,6 @@ void mc6852_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_timer - handler timer events
|
||||
//-------------------------------------------------
|
||||
|
||||
void mc6852_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// tra_callback -
|
||||
//-------------------------------------------------
|
||||
|
@ -90,7 +90,6 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int m_param, void *ptr) override;
|
||||
|
||||
// device_serial_interface overrides
|
||||
virtual void tra_callback() override;
|
||||
|
@ -805,11 +805,6 @@ void mc68681_channel::device_reset()
|
||||
CSR = 0;
|
||||
}
|
||||
|
||||
void mc68681_channel::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
// serial device virtual overrides
|
||||
void mc68681_channel::rcv_complete()
|
||||
{
|
||||
|
@ -55,7 +55,6 @@ public:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// device_serial overrides
|
||||
virtual void rcv_complete() override; // Rx completed receiving byte
|
||||
|
@ -472,8 +472,6 @@ void mc68901_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
{
|
||||
if(id >= TIMER_A && id <= TIMER_D)
|
||||
timer_count(id);
|
||||
else
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,55 +118,52 @@ void microtouch_device::send_touch_packet()
|
||||
|
||||
void microtouch_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if(id)
|
||||
if (!id)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( m_tx_buffer_ptr < m_tx_buffer_num )
|
||||
{
|
||||
if(is_transmit_register_empty())
|
||||
if ( m_tx_buffer_ptr < m_tx_buffer_num )
|
||||
{
|
||||
m_output = m_tx_buffer[m_tx_buffer_ptr++];
|
||||
m_output_valid = true;
|
||||
tra_complete();
|
||||
}
|
||||
|
||||
if ( m_tx_buffer_ptr == m_tx_buffer_num )
|
||||
{
|
||||
m_tx_buffer_ptr = m_tx_buffer_num = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (m_reset_done == 0) ||
|
||||
(m_format == FORMAT_UNKNOWN) ||
|
||||
(m_mode != MODE_STREAM))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// send format tablet packet
|
||||
if (m_touch->read())
|
||||
{
|
||||
send_touch_packet();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_last_touch_state == 1 )
|
||||
{
|
||||
m_last_touch_state = 0;
|
||||
switch( m_format )
|
||||
if(is_transmit_register_empty())
|
||||
{
|
||||
case FORMAT_TABLET:
|
||||
send_format_table_packet(0x88, m_last_x, m_last_y);
|
||||
break;
|
||||
case FORMAT_DECIMAL:
|
||||
send_format_decimal_packet(m_last_x, m_last_y);
|
||||
break;
|
||||
case FORMAT_UNKNOWN:
|
||||
break;
|
||||
m_output = m_tx_buffer[m_tx_buffer_ptr++];
|
||||
m_output_valid = true;
|
||||
tra_complete();
|
||||
}
|
||||
|
||||
if ( m_tx_buffer_ptr == m_tx_buffer_num )
|
||||
{
|
||||
m_tx_buffer_ptr = m_tx_buffer_num = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (m_reset_done == 0) ||
|
||||
(m_format == FORMAT_UNKNOWN) ||
|
||||
(m_mode != MODE_STREAM))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// send format tablet packet
|
||||
if (m_touch->read())
|
||||
{
|
||||
send_touch_packet();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_last_touch_state == 1 )
|
||||
{
|
||||
m_last_touch_state = 0;
|
||||
switch( m_format )
|
||||
{
|
||||
case FORMAT_TABLET:
|
||||
send_format_table_packet(0x88, m_last_x, m_last_y);
|
||||
break;
|
||||
case FORMAT_DECIMAL:
|
||||
send_format_decimal_packet(m_last_x, m_last_y);
|
||||
break;
|
||||
case FORMAT_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -808,8 +808,7 @@ void duscc_channel::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
m_uart->m_out_trxcb_cb(m_trxc);
|
||||
break;
|
||||
default:
|
||||
LOGR("Unhandled Timer ID passed to device_serial_interface%d\n", id);
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
LOGR("Unhandled Timer ID %d\n", id);
|
||||
break;
|
||||
}
|
||||
// LOG("%s %d\n", FUNCNAME, id);
|
||||
|
@ -152,7 +152,7 @@ void tms5501_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
break;
|
||||
|
||||
default:
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -513,7 +513,6 @@ void z80dart_channel::device_start()
|
||||
save_item(NAME(m_dtr));
|
||||
save_item(NAME(m_rts));
|
||||
save_item(NAME(m_sync));
|
||||
device_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
|
||||
@ -545,11 +544,6 @@ void z80dart_channel::device_reset()
|
||||
}
|
||||
}
|
||||
|
||||
void z80dart_channel::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// tra_callback -
|
||||
|
@ -289,7 +289,6 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// device_serial_interface overrides
|
||||
virtual void tra_callback() override;
|
||||
|
@ -969,8 +969,6 @@ void z80scc_channel::device_start()
|
||||
save_item(NAME(m_rts));
|
||||
save_item(NAME(m_tx_int_disarm));
|
||||
save_item(NAME(m_sync_pattern));
|
||||
|
||||
device_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
|
||||
@ -1050,10 +1048,6 @@ void z80scc_channel::device_timer(emu_timer &timer, device_timer_id id, int para
|
||||
default:
|
||||
logerror("Spurious timer %d event\n", id);
|
||||
}
|
||||
#else
|
||||
// TODO: Hmmm, either the above default clause is called OR the bellow call is not needed since we handled our local event anyway...?!
|
||||
// and the above default is not called unless we implement the BRG timer using diserial timer interfaces...
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -569,7 +569,6 @@ void z80sio_channel::device_start()
|
||||
save_item(NAME(m_rts));
|
||||
save_item(NAME(m_sync));
|
||||
save_item(NAME(m_variant));
|
||||
device_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
|
||||
@ -603,11 +602,6 @@ void z80sio_channel::device_reset()
|
||||
}
|
||||
}
|
||||
|
||||
void z80sio_channel::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// tra_callback -
|
||||
//-------------------------------------------------
|
||||
|
@ -152,7 +152,6 @@ public:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// device_serial_interface overrides
|
||||
virtual void tra_callback() override;
|
||||
|
@ -56,40 +56,40 @@ device_serial_interface::~device_serial_interface()
|
||||
{
|
||||
}
|
||||
|
||||
void device_serial_interface::register_save_state(save_manager &save, device_t *device)
|
||||
{
|
||||
const char *module = device->name();
|
||||
const char *tag = device->tag();
|
||||
save.save_item(device, module, tag, 0, NAME(m_df_start_bit_count));
|
||||
save.save_item(device, module, tag, 0, NAME(m_df_word_length));
|
||||
save.save_item(device, module, tag, 0, NAME(m_df_parity));
|
||||
save.save_item(device, module, tag, 0, NAME(m_df_stop_bit_count));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_register_data));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_flags));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_bit_count_received));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_bit_count));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_byte_received));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_framing_error));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_parity_error));
|
||||
save.save_item(device, module, tag, 0, NAME(m_tra_register_data));
|
||||
save.save_item(device, module, tag, 0, NAME(m_tra_flags));
|
||||
save.save_item(device, module, tag, 0, NAME(m_tra_bit_count_transmitted));
|
||||
save.save_item(device, module, tag, 0, NAME(m_tra_bit_count));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_rate));
|
||||
save.save_item(device, module, tag, 0, NAME(m_tra_rate));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_line));
|
||||
save.save_item(device, module, tag, 0, NAME(m_tra_clock_state));
|
||||
save.save_item(device, module, tag, 0, NAME(m_rcv_clock_state));
|
||||
}
|
||||
|
||||
void device_serial_interface::interface_pre_start()
|
||||
{
|
||||
m_rcv_clock = device().timer_alloc(RCV_TIMER_ID);
|
||||
m_tra_clock = device().timer_alloc(TRA_TIMER_ID);
|
||||
if (!m_rcv_clock)
|
||||
m_rcv_clock = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_serial_interface::rcv_clock), this));
|
||||
if (!m_tra_clock)
|
||||
m_tra_clock = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(device_serial_interface::tra_clock), this));
|
||||
m_rcv_clock_state = false;
|
||||
m_tra_clock_state = false;
|
||||
}
|
||||
|
||||
void device_serial_interface::interface_post_start()
|
||||
{
|
||||
device().save_item(NAME(m_df_start_bit_count));
|
||||
device().save_item(NAME(m_df_word_length));
|
||||
device().save_item(NAME(m_df_parity));
|
||||
device().save_item(NAME(m_df_stop_bit_count));
|
||||
device().save_item(NAME(m_rcv_register_data));
|
||||
device().save_item(NAME(m_rcv_flags));
|
||||
device().save_item(NAME(m_rcv_bit_count_received));
|
||||
device().save_item(NAME(m_rcv_bit_count));
|
||||
device().save_item(NAME(m_rcv_byte_received));
|
||||
device().save_item(NAME(m_rcv_framing_error));
|
||||
device().save_item(NAME(m_rcv_parity_error));
|
||||
device().save_item(NAME(m_tra_register_data));
|
||||
device().save_item(NAME(m_tra_flags));
|
||||
device().save_item(NAME(m_tra_bit_count_transmitted));
|
||||
device().save_item(NAME(m_tra_bit_count));
|
||||
device().save_item(NAME(m_rcv_rate));
|
||||
device().save_item(NAME(m_tra_rate));
|
||||
device().save_item(NAME(m_rcv_line));
|
||||
device().save_item(NAME(m_tra_clock_state));
|
||||
device().save_item(NAME(m_rcv_clock_state));
|
||||
}
|
||||
|
||||
void device_serial_interface::set_rcv_rate(const attotime &rate)
|
||||
{
|
||||
m_rcv_rate = rate/2;
|
||||
@ -153,14 +153,6 @@ WRITE_LINE_MEMBER(device_serial_interface::clock_w)
|
||||
rx_clock_w(state);
|
||||
}
|
||||
|
||||
void device_serial_interface::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
switch(id) {
|
||||
case TRA_TIMER_ID: tx_clock_w(!m_tra_clock_state); break;
|
||||
case RCV_TIMER_ID: rx_clock_w(!m_rcv_clock_state); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void device_serial_interface::set_data_frame(int start_bit_count, int data_bit_count, parity_t parity, stop_bits_t stop_bits)
|
||||
{
|
||||
|
@ -123,19 +123,16 @@ protected:
|
||||
|
||||
// interface-level overrides
|
||||
virtual void interface_pre_start() override;
|
||||
|
||||
// Must be called from device_timer in the underlying device
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
virtual void interface_post_start() override;
|
||||
|
||||
bool m_start_bit_hack_for_external_clocks;
|
||||
|
||||
const char *parity_tostring(parity_t stop_bits);
|
||||
const char *stop_bits_tostring(stop_bits_t stop_bits);
|
||||
|
||||
void register_save_state(save_manager &save, device_t *device);
|
||||
|
||||
private:
|
||||
enum { TRA_TIMER_ID = 10000, RCV_TIMER_ID };
|
||||
TIMER_CALLBACK_MEMBER(rcv_clock) { rx_clock_w(!m_rcv_clock_state); }
|
||||
TIMER_CALLBACK_MEMBER(tra_clock) { tx_clock_w(!m_tra_clock_state); }
|
||||
|
||||
u8 m_serial_parity_table[256];
|
||||
|
||||
@ -246,17 +243,15 @@ protected:
|
||||
return !m_empty && (m_head == m_tail);
|
||||
}
|
||||
|
||||
void register_save_state(save_manager &save, device_t *device)
|
||||
protected:
|
||||
void interface_post_start() override
|
||||
{
|
||||
device_serial_interface::register_save_state(save, device);
|
||||
device_serial_interface::interface_post_start();
|
||||
|
||||
char const *const module(device->name());
|
||||
char const *const tag(device->tag());
|
||||
|
||||
save.save_item(device, module, tag, 0, NAME(m_fifo));
|
||||
save.save_item(device, module, tag, 0, NAME(m_head));
|
||||
save.save_item(device, module, tag, 0, NAME(m_tail));
|
||||
save.save_item(device, module, tag, 0, NAME(m_empty));
|
||||
device().save_item(NAME(m_fifo));
|
||||
device().save_item(NAME(m_head));
|
||||
device().save_item(NAME(m_tail));
|
||||
device().save_item(NAME(m_empty));
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -143,7 +143,7 @@ public:
|
||||
const std::unordered_map<std::string, std::unique_ptr<device_slot_option>> &option_list() const { return m_options; }
|
||||
device_slot_option *option(const char *name) const;
|
||||
virtual std::string get_default_card_software(get_default_card_software_hook &hook) const { return std::string(); }
|
||||
device_t *get_card_device() { return m_card_device; }
|
||||
device_t *get_card_device() const { return m_card_device; }
|
||||
void set_card_device(device_t *dev) { m_card_device = dev; }
|
||||
const char *slot_name() const { return device().tag() + 1; }
|
||||
|
||||
|
@ -56,30 +56,30 @@ class px4_state : public driver_device, public device_serial_interface
|
||||
{
|
||||
public:
|
||||
px4_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
device_serial_interface(mconfig, *this),
|
||||
m_z80(*this, "maincpu"),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_nvram(*this, "nvram"),
|
||||
m_centronics(*this, "centronics"),
|
||||
m_ext_cas(*this, "extcas"),
|
||||
m_ext_cas_timer(*this, "extcas_timer"),
|
||||
m_speaker(*this, "speaker"),
|
||||
m_sio(*this, "sio"),
|
||||
m_rs232(*this, "rs232"),
|
||||
m_caps1(*this, "capsule1"), m_caps2(*this, "capsule2"),
|
||||
m_caps1_rom(nullptr), m_caps2_rom(nullptr),
|
||||
m_ctrl1(0), m_icrb(0), m_bankr(0),
|
||||
m_isr(0), m_ier(0), m_sior(0xbf),
|
||||
m_frc_value(0), m_frc_latch(0),
|
||||
m_vadr(0), m_yoff(0),
|
||||
m_artdir(0xff), m_artdor(0xff), m_artsr(0), m_artcr(0),
|
||||
m_one_sec_int_enabled(true),
|
||||
m_key_status(0), m_interrupt_status(0),
|
||||
m_time(), m_clock_state(0),
|
||||
m_ear_last_state(0),
|
||||
m_sio_pin(0), m_serial_rx(0), m_rs232_dcd(0), m_rs232_cts(0),
|
||||
m_centronics_busy(0), m_centronics_perror(0)
|
||||
driver_device(mconfig, type, tag),
|
||||
device_serial_interface(mconfig, *this),
|
||||
m_z80(*this, "maincpu"),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_nvram(*this, "nvram"),
|
||||
m_centronics(*this, "centronics"),
|
||||
m_ext_cas(*this, "extcas"),
|
||||
m_ext_cas_timer(*this, "extcas_timer"),
|
||||
m_speaker(*this, "speaker"),
|
||||
m_sio(*this, "sio"),
|
||||
m_rs232(*this, "rs232"),
|
||||
m_caps1(*this, "capsule1"), m_caps2(*this, "capsule2"),
|
||||
m_caps1_rom(nullptr), m_caps2_rom(nullptr),
|
||||
m_ctrl1(0), m_icrb(0), m_bankr(0),
|
||||
m_isr(0), m_ier(0), m_sior(0xbf),
|
||||
m_frc_value(0), m_frc_latch(0),
|
||||
m_vadr(0), m_yoff(0),
|
||||
m_artdir(0xff), m_artdor(0xff), m_artsr(0), m_artcr(0),
|
||||
m_one_sec_int_enabled(true),
|
||||
m_key_status(0), m_interrupt_status(0),
|
||||
m_time(), m_clock_state(0),
|
||||
m_ear_last_state(0),
|
||||
m_sio_pin(0), m_serial_rx(0), m_rs232_dcd(0), m_rs232_cts(0),
|
||||
m_centronics_busy(0), m_centronics_perror(0)
|
||||
{ }
|
||||
|
||||
DECLARE_DRIVER_INIT( px4 );
|
||||
@ -144,8 +144,6 @@ protected:
|
||||
virtual void rcv_callback() override;
|
||||
virtual void rcv_complete() override;
|
||||
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
private:
|
||||
// z80 interrupt sources
|
||||
enum
|
||||
@ -827,11 +825,6 @@ WRITE_LINE_MEMBER( px4_state::rs232_cts_w )
|
||||
m_rs232_cts = state;
|
||||
}
|
||||
|
||||
void px4_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
void px4_state::tra_callback()
|
||||
{
|
||||
if (ART_TX_ENABLED)
|
||||
|
@ -705,7 +705,6 @@ void funcube_touchscreen_device::device_start()
|
||||
save_item(NAME(m_button_state));
|
||||
save_item(NAME(m_serial_pos));
|
||||
save_item(NAME(m_serial));
|
||||
device_serial_interface::register_save_state(machine().save(), this);
|
||||
}
|
||||
|
||||
void funcube_touchscreen_device::device_reset()
|
||||
@ -717,20 +716,17 @@ void funcube_touchscreen_device::device_reset()
|
||||
|
||||
void funcube_touchscreen_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if(id) {
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t button_state = m_btn->read();
|
||||
if(m_button_state != button_state) {
|
||||
m_button_state = button_state;
|
||||
m_serial[0] = button_state ? 0xfe : 0xfd;
|
||||
m_serial[1] = m_x->read();
|
||||
m_serial[2] = m_y->read();
|
||||
m_serial[3] = 0xff;
|
||||
m_serial_pos = 0;
|
||||
transmit_register_setup(m_serial[m_serial_pos++]);
|
||||
if(!id) {
|
||||
uint8_t button_state = m_btn->read();
|
||||
if(m_button_state != button_state) {
|
||||
m_button_state = button_state;
|
||||
m_serial[0] = button_state ? 0xfe : 0xfd;
|
||||
m_serial[1] = m_x->read();
|
||||
m_serial[2] = m_y->read();
|
||||
m_serial[3] = 0xff;
|
||||
m_serial_pos = 0;
|
||||
transmit_register_setup(m_serial[m_serial_pos++]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,12 +28,6 @@
|
||||
class osborne1_state : public driver_device
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
TIMER_VIDEO,
|
||||
TIMER_ACIA_RXC_TXC
|
||||
};
|
||||
|
||||
osborne1_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
@ -102,8 +96,8 @@ public:
|
||||
required_device<floppy_connector> m_floppy1;
|
||||
|
||||
protected:
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
TIMER_CALLBACK_MEMBER(video_callback);
|
||||
TIMER_CALLBACK_MEMBER(acia_rxc_txc_callback);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
|
||||
|
@ -127,11 +127,6 @@ void apollo_kbd_device::device_reset()
|
||||
m_xmit_read = m_xmit_write = 0;
|
||||
}
|
||||
|
||||
void apollo_kbd_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
cpu_context - return a string describing the current CPU context
|
||||
***************************************************************************/
|
||||
|
@ -58,7 +58,6 @@ private:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// serial overrides
|
||||
virtual void rcv_complete() override; // Rx completed receiving byte
|
||||
|
@ -589,8 +589,8 @@ void lk201_device::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
break;
|
||||
|
||||
default:
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -483,10 +483,6 @@ void esqpanel_device::device_timer(emu_timer &timer, device_timer_id id, int par
|
||||
{
|
||||
check_external_panel_server();
|
||||
}
|
||||
else
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void esqpanel_device::rcv_complete() // Rx completed receiving byte
|
||||
|
@ -241,12 +241,6 @@ void grid_keyboard_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
void grid_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
void grid_keyboard_device::key_make(u8 row, u8 column)
|
||||
{
|
||||
send_translated((row << 4) | column);
|
||||
|
@ -65,7 +65,6 @@ protected:
|
||||
u32 clock);
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void key_make(u8 row, u8 column) override;
|
||||
virtual void key_repeat(u8 row, u8 column) override;
|
||||
virtual void send_key(u16 code);
|
||||
|
@ -189,13 +189,6 @@ void m20_keyboard_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
void m20_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
buffered_rs232_device::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
void m20_keyboard_device::key_make(uint8_t row, uint8_t column)
|
||||
{
|
||||
uint8_t const row_code(((row < 6U) ? row : (0x18U | (row - 6U))) << 3);
|
||||
|
@ -14,7 +14,6 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void key_make(uint8_t row, uint8_t column) override;
|
||||
|
||||
private:
|
||||
|
@ -15,11 +15,7 @@ midi_keyboard_device::midi_keyboard_device(const machine_config &mconfig, const
|
||||
|
||||
void midi_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if(id)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
else
|
||||
if(!id)
|
||||
{
|
||||
const int keyboard_notes[24] =
|
||||
{
|
||||
|
@ -253,11 +253,5 @@ void octopus_keyboard_device::device_reset()
|
||||
start_processing(attotime::from_hz(9600));
|
||||
}
|
||||
|
||||
void octopus_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
buffered_rs232_device::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(OCTOPUS_KEYBOARD, octopus_keyboard_device, "octopus_kb", "Octopus Keyboard")
|
||||
|
@ -16,7 +16,6 @@ public:
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void key_make(uint8_t row, uint8_t column) override;
|
||||
virtual void key_repeat(uint8_t row, uint8_t column) override;
|
||||
virtual void key_break(uint8_t row, uint8_t column) override;
|
||||
|
@ -267,13 +267,13 @@ DRIVER_INIT_MEMBER( osborne1_state, osborne1 )
|
||||
m_bank_fxxx->configure_entries(0, 1, m_ram->pointer() + 0xF000, 0);
|
||||
m_bank_fxxx->configure_entries(1, 1, m_ram->pointer() + 0x10000, 0);
|
||||
|
||||
m_video_timer = timer_alloc(TIMER_VIDEO);
|
||||
m_video_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(osborne1_state::video_callback), this));
|
||||
m_tilemap = &machine().tilemap().create(
|
||||
*m_gfxdecode,
|
||||
tilemap_get_info_delegate(FUNC(osborne1_state::get_tile_info), this), TILEMAP_SCAN_ROWS,
|
||||
8, 10, 128, 32);
|
||||
|
||||
m_acia_rxc_txc_timer = timer_alloc(TIMER_ACIA_RXC_TXC);
|
||||
m_acia_rxc_txc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(osborne1_state::acia_rxc_txc_callback), this));
|
||||
|
||||
save_item(NAME(m_screen_pac));
|
||||
save_item(NAME(m_acia_rxc_txc_div));
|
||||
@ -357,22 +357,6 @@ uint32_t osborne1_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
|
||||
}
|
||||
|
||||
|
||||
void osborne1_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TIMER_VIDEO:
|
||||
video_callback(ptr, param);
|
||||
break;
|
||||
case TIMER_ACIA_RXC_TXC:
|
||||
m_acia_rxc_txc_state = m_acia_rxc_txc_state ? 0 : 1;
|
||||
update_acia_rxc_txc();
|
||||
break;
|
||||
default:
|
||||
assert_always(false, "Unknown id in osborne1_state::device_timer");
|
||||
}
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(osborne1_state::video_callback)
|
||||
{
|
||||
int const y = machine().first_screen()->vpos();
|
||||
@ -451,6 +435,12 @@ TIMER_CALLBACK_MEMBER(osborne1_state::video_callback)
|
||||
m_video_timer->adjust(machine().first_screen()->time_until_pos(y + 1, 0));
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(osborne1_state::acia_rxc_txc_callback)
|
||||
{
|
||||
m_acia_rxc_txc_state = m_acia_rxc_txc_state ? 0 : 1;
|
||||
update_acia_rxc_txc();
|
||||
}
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(osborne1_state::get_tile_info)
|
||||
{
|
||||
|
@ -36,13 +36,6 @@ void qx10_keyboard_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
void qx10_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
buffered_rs232_device::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
void qx10_keyboard_device::key_make(uint8_t row, uint8_t column)
|
||||
{
|
||||
transmit_byte((column << 4) | row);
|
||||
|
@ -17,7 +17,6 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void key_make(uint8_t row, uint8_t column) override;
|
||||
|
||||
private:
|
||||
|
@ -153,13 +153,6 @@ void rmnimbus_keyboard_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
void rmnimbus_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
buffered_rs232_device::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
void rmnimbus_keyboard_device::key_make(uint8_t row, uint8_t column)
|
||||
{
|
||||
transmit_byte((row << 3) | column);
|
||||
|
@ -14,7 +14,6 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void key_make(uint8_t row, uint8_t column) override;
|
||||
virtual void key_break(uint8_t row, uint8_t column) override;
|
||||
|
||||
|
@ -406,16 +406,6 @@ void wangpc_keyboard_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_timer - handler timer events
|
||||
//-------------------------------------------------
|
||||
|
||||
void wangpc_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// tra_callback -
|
||||
//-------------------------------------------------
|
||||
|
@ -63,7 +63,6 @@ protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// optional information overrides
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
|
@ -295,12 +295,6 @@ void x68k_keyboard_device::device_reset()
|
||||
output_rxd(1);
|
||||
}
|
||||
|
||||
void x68k_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_matrix_keyboard_interface::device_timer(timer, id, param, ptr);
|
||||
buffered_rs232_device::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(X68K_KEYBOARD, x68k_keyboard_device, "x68k_keyboard", "Sharp X68000 Keyboard")
|
||||
|
||||
|
@ -14,7 +14,6 @@ public:
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
virtual void key_make(uint8_t row, uint8_t column) override;
|
||||
virtual void key_repeat(uint8_t row, uint8_t column) override;
|
||||
virtual void key_break(uint8_t row, uint8_t column) override;
|
||||
|
@ -238,7 +238,6 @@ void zx8302_device::device_timer(emu_timer &timer, device_timer_id id, int param
|
||||
break;
|
||||
|
||||
default:
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -468,8 +468,3 @@ void pcx_video_device::rcv_complete()
|
||||
m_mcu->set_input_line(MCS51_RX_LINE, ASSERT_LINE);
|
||||
m_mcu->set_input_line(MCS51_RX_LINE, CLEAR_LINE);
|
||||
}
|
||||
|
||||
void pcx_video_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
@ -100,7 +100,6 @@ protected:
|
||||
void device_reset() override;
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
void tra_callback() override;
|
||||
void rcv_complete() override;
|
||||
|
Loading…
Reference in New Issue
Block a user