diff options
Diffstat (limited to 'src/devices/bus/a2bus/agat840k_hle.cpp')
-rw-r--r-- | src/devices/bus/a2bus/agat840k_hle.cpp | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/src/devices/bus/a2bus/agat840k_hle.cpp b/src/devices/bus/a2bus/agat840k_hle.cpp index f46d9ae7251..0a0fd511a95 100644 --- a/src/devices/bus/a2bus/agat840k_hle.cpp +++ b/src/devices/bus/a2bus/agat840k_hle.cpp @@ -89,6 +89,8 @@ a2bus_agat840k_hle_device::a2bus_agat840k_hle_device(const machine_config &mconf , m_floppy_image(*this, "floppy%u", 0U) , m_d14(*this, "d14") , m_d15(*this, "d15") + , m_timer_wait(nullptr) + , m_timer_seek(nullptr) , m_rom(nullptr) { } @@ -98,12 +100,12 @@ a2bus_agat840k_hle_device::a2bus_agat840k_hle_device(const machine_config &mconf { } -WRITE_LINE_MEMBER(a2bus_agat840k_hle_device::index_0_w) +void a2bus_agat840k_hle_device::index_0_w(int state) { index_callback(0, state); } -WRITE_LINE_MEMBER(a2bus_agat840k_hle_device::index_1_w) +void a2bus_agat840k_hle_device::index_1_w(int state) { index_callback(1, state); } @@ -137,8 +139,8 @@ void a2bus_agat840k_hle_device::device_start() m_mxcs = MXCSR_SYNC; - m_timer_wait = timer_alloc(TIMER_ID_WAIT); - m_timer_seek = timer_alloc(TIMER_ID_SEEK); + m_timer_wait = timer_alloc(FUNC(a2bus_agat840k_hle_device::timer_wait_tick), this); + m_timer_seek = timer_alloc(FUNC(a2bus_agat840k_hle_device::timer_seek_tick), this); m_seektime = 6000; // 6 ms, per es5323.txt m_waittime = 32; // 16 bits x 2 us @@ -150,12 +152,9 @@ void a2bus_agat840k_hle_device::device_reset() for (auto &img : m_floppy_image) { - if (img.found()) - { - img->floppy_drive_set_ready_state(FLOPPY_DRIVE_READY, 0); - img->floppy_drive_set_rpm(300.); - img->floppy_drive_seek(-img->floppy_drive_get_current_track()); - } + img->floppy_drive_set_ready_state(FLOPPY_DRIVE_READY, 0); + img->floppy_drive_set_rpm(300.); + img->floppy_drive_seek(-img->floppy_drive_get_current_track()); } m_floppy = m_floppy_image[0].target(); @@ -229,29 +228,24 @@ void a2bus_agat840k_hle_device::device_reset() m_mxcs &= ~MXCSR_TR; } -void a2bus_agat840k_hle_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +TIMER_CALLBACK_MEMBER(a2bus_agat840k_hle_device::timer_wait_tick) { - switch (id) - { - case TIMER_ID_WAIT: - { - m_count_read++; - m_count_read %= 6250; - m_d15->pc4_w(0); - m_d15->pc4_w(1); - if (BIT(m_tracks[(2 * m_floppy->floppy_drive_get_current_track()) + m_side][m_count_read], 15)) - m_mxcs &= ~MXCSR_SYNC; - } - break; + m_count_read++; + m_count_read %= 6250; + m_d15->pc4_w(0); + m_d15->pc4_w(1); + if (BIT(m_tracks[(2 * m_floppy->floppy_drive_get_current_track()) + m_side][m_count_read], 15)) + m_mxcs &= ~MXCSR_SYNC; +} - case TIMER_ID_SEEK: - m_floppy->floppy_stp_w(1); - m_floppy->floppy_stp_w(0); - break; - } +TIMER_CALLBACK_MEMBER(a2bus_agat840k_hle_device::timer_seek_tick) +{ + m_floppy->floppy_stp_w(1); + m_floppy->floppy_stp_w(0); } + /*------------------------------------------------- read_c0nx - called for reads from this card's c0nx space -------------------------------------------------*/ |