From 1d8288f57ae6d1bc537231d0d1a9ef8b81fa256c Mon Sep 17 00:00:00 2001 From: arbee Date: Sat, 16 Mar 2019 11:19:12 -0400 Subject: apple2: TransWarp card now slows down during joystick reads [R. Belmont] --- src/devices/bus/a2bus/transwarp.cpp | 22 ++++++++++++++++++++++ src/devices/bus/a2bus/transwarp.h | 1 + 2 files changed, 23 insertions(+) diff --git a/src/devices/bus/a2bus/transwarp.cpp b/src/devices/bus/a2bus/transwarp.cpp index 04774a986fe..97e02eb8b4e 100644 --- a/src/devices/bus/a2bus/transwarp.cpp +++ b/src/devices/bus/a2bus/transwarp.cpp @@ -190,6 +190,11 @@ void a2bus_transwarp_device::device_timer(emu_timer &timer, device_timer_id id, READ8_MEMBER( a2bus_transwarp_device::dma_r ) { + if (offset == 0xc070) + { + hit_slot_joy(); + } + if ((offset >= 0xc090) && (offset <= 0xc0ff)) { hit_slot(((offset >> 4) & 0xf) - 8); @@ -212,6 +217,11 @@ WRITE8_MEMBER( a2bus_transwarp_device::dma_w ) { //if ((offset >= 0xc070) && (offset <= 0xc07f)) printf("%02x to %04x\n", data, offset); + if (offset == 0xc070) + { + hit_slot_joy(); + } + if (offset == 0xc072) { m_bReadA2ROM = true; @@ -244,3 +254,15 @@ void a2bus_transwarp_device::hit_slot(int slot) } } } + +void a2bus_transwarp_device::hit_slot_joy() +{ + // only do slot slowdown if acceleration is enabled + if (!(m_dsw2->read() & 0x80)) + { + // accleration's on + m_ourcpu->set_unscaled_clock(1021800); + // PREAD main loop counts up to 11*256 uSec, add 1 to cover the setup + m_timer->adjust(attotime::from_usec(11*257)); + } +} diff --git a/src/devices/bus/a2bus/transwarp.h b/src/devices/bus/a2bus/transwarp.h index 8b42aefa7e5..e687ae6d350 100644 --- a/src/devices/bus/a2bus/transwarp.h +++ b/src/devices/bus/a2bus/transwarp.h @@ -54,6 +54,7 @@ private: void m65c02_mem(address_map &map); void hit_slot(int slot); + void hit_slot_joy(); }; // device type definition -- cgit v1.2.3