diff options
Diffstat (limited to 'src/devices/machine/ie15.cpp')
-rw-r--r-- | src/devices/machine/ie15.cpp | 54 |
1 files changed, 21 insertions, 33 deletions
diff --git a/src/devices/machine/ie15.cpp b/src/devices/machine/ie15.cpp index 4d9d17a3afc..bf8c9294878 100644 --- a/src/devices/machine/ie15.cpp +++ b/src/devices/machine/ie15.cpp @@ -12,14 +12,13 @@ ****************************************************************************/ #include "emu.h" -#include "machine/ie15.h" +#include "ie15.h" #include "emupal.h" #include "ie15.lh" -//#define LOG_GENERAL (1U << 0) //defined in logmacro.h already #define LOG_RAM (1U << 1) #define LOG_CPU (1U << 2) #define LOG_KBD (1U << 3) @@ -166,7 +165,7 @@ void ie15_device::beep_w(uint8_t data) { LOG("beep (%s)\n", m_long_beep ? "short" : "long"); } - machine().scheduler().timer_set(attotime::from_msec(length), timer_expired_delegate(FUNC(ie15_device::ie15_beepoff),this)); + m_beepoff_timer->adjust(attotime::from_msec(length)); m_beeper->set_state(1); } @@ -229,29 +228,24 @@ uint8_t ie15_device::kb_s_lin_r() return m_io_keyboard->read() & ie15_keyboard_device::IE_KB_LIN ? IE_TRUE : 0; } -/* serial port */ - -void ie15_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +TIMER_CALLBACK_MEMBER(ie15_device::hblank_onoff_tick) { - switch (id) + if (m_hblank) // Transitioning from in blanking to out of blanking { - case TIMER_HBLANK: - if (m_hblank) // Transitioning from in blanking to out of blanking - { - m_hblank = 0; - m_hblank_timer->adjust(m_screen->time_until_pos((m_vpos + 1) % IE15_TOTAL_VERT, 0)); - scanline_callback(); - } - else // Transitioning from out of blanking to in blanking - { - m_hblank = 1; - m_hblank_timer->adjust(m_screen->time_until_pos(m_vpos, IE15_HORZ_START)); - } - break; + m_hblank = 0; + m_hblank_timer->adjust(m_screen->time_until_pos((m_vpos + 1) % IE15_TOTAL_VERT, 0)); + scanline_callback(); + } + else // Transitioning from out of blanking to in blanking + { + m_hblank = 1; + m_hblank_timer->adjust(m_screen->time_until_pos(m_vpos, IE15_HORZ_START)); } } -WRITE_LINE_MEMBER(ie15_device::rs232_conn_rxd_w) +/* serial port */ + +void ie15_device::rs232_conn_rxd_w(int state) { device_serial_interface::rx_w(state); } @@ -307,7 +301,7 @@ void ie15_device::serial_speed_w(uint8_t data) return; } -WRITE_LINE_MEMBER(ie15_device::update_serial) +void ie15_device::update_serial(int state) { int startbits = 1; int databits = m_rs232_databits->read(); @@ -471,18 +465,11 @@ void ie15_device::kbd_put(uint16_t data) } } -WRITE_LINE_MEMBER( ie15_device::kbd_sdv ) +void ie15_device::kbd_sdv(int state) { m_kbd_sdv = state; } -void ie15_device::device_resolve_objects() -{ - m_rs232_conn_dtr_handler.resolve_safe(); - m_rs232_conn_rts_handler.resolve_safe(); - m_rs232_conn_txd_handler.resolve_safe(); -} - void ie15_device::device_start() { m_lat_led.resolve(); @@ -494,9 +481,10 @@ void ie15_device::device_start() m_sdv_led.resolve(); m_prd_led.resolve(); - m_hblank_timer = timer_alloc(TIMER_HBLANK); + m_hblank_timer = timer_alloc(FUNC(ie15_device::hblank_onoff_tick), this); m_hblank_timer->adjust(attotime::never); + m_beepoff_timer = timer_alloc(FUNC(ie15_device::ie15_beepoff), this); m_video.ptr1 = m_video.ptr2 = m_latch = 0; m_tmpbmp = std::make_unique<uint32_t[]>(IE15_TOTAL_HORZ * IE15_TOTAL_VERT); @@ -506,7 +494,7 @@ void ie15_device::device_reset() { update_serial(0); - memset(&m_video, 0, sizeof(m_video)); + m_video = decltype(m_video)(); m_kb_ruslat = m_long_beep = m_kb_control = m_kb_data = m_kb_flag0 = 0; m_kb_flag = IE_TRUE; m_kbd_sdv = false; @@ -677,7 +665,7 @@ GFXDECODE_END void ie15_device::ie15core(machine_config &config) { /* Basic machine hardware */ - IE15_CPU(config, m_maincpu, XTAL(30'800'000)/10); + IE15_CPU(config, m_maincpu, XTAL(30'800'000) / 10); m_maincpu->set_addrmap(AS_PROGRAM, &ie15_device::ie15_mem); m_maincpu->set_addrmap(AS_IO, &ie15_device::ie15_io); |