From ddfc46292776cbb1d9b157c68b31d0c65510a3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Izaguirre?= Date: Thu, 25 Jan 2024 18:41:26 +0100 Subject: [PATCH] Card Disk II softswitches are active also on writes. CP/M 85 relies on that. --- cardDisk2.go | 12 ++++++------ cardDisk2Sequencer.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cardDisk2.go b/cardDisk2.go index 6e45fd6..cac9ef9 100644 --- a/cardDisk2.go +++ b/cardDisk2.go @@ -124,7 +124,7 @@ func (c *CardDisk2) assign(a *Apple2, slot int) { // Q1, Q2, Q3 and Q4 phase control soft switches, for i := uint8(0); i < 4; i++ { phase := i - c.addCardSoftSwitchR(phase<<1, func() uint8 { + c.addCardSoftSwitchRW(phase<<1, func() uint8 { // Update magnets and position drive := &c.drive[c.selected] drive.phases &^= (1 << phase) @@ -137,7 +137,7 @@ func (c *CardDisk2) assign(a *Apple2, slot int) { return c.dataLatch // All even addresses return the last dataLatch }, fmt.Sprintf("PHASE%vOFF", phase)) - c.addCardSoftSwitchR((phase<<1)+1, func() uint8 { // Update magnets and position + c.addCardSoftSwitchRW((phase<<1)+1, func() uint8 { // Update magnets and position drive := &c.drive[c.selected] drive.phases |= (1 << phase) drive.trackStep = moveDriveStepper(drive.phases, drive.trackStep) @@ -151,21 +151,21 @@ func (c *CardDisk2) assign(a *Apple2, slot int) { } // Q4, power switch - c.addCardSoftSwitchR(0x8, func() uint8 { + c.addCardSoftSwitchRW(0x8, func() uint8 { c.softSwitchQ4(false) return c.dataLatch }, "Q4DRIVEOFF") - c.addCardSoftSwitchR(0x9, func() uint8 { + c.addCardSoftSwitchRW(0x9, func() uint8 { c.softSwitchQ4(true) return 0 }, "Q4DRIVEON") // Q5, drive selecion - c.addCardSoftSwitchR(0xA, func() uint8 { + c.addCardSoftSwitchRW(0xA, func() uint8 { c.softSwitchQ5(0) return c.dataLatch }, "Q5SELECT1") - c.addCardSoftSwitchR(0xB, func() uint8 { + c.addCardSoftSwitchRW(0xB, func() uint8 { c.softSwitchQ5(1) return 0 }, "Q5SELECT2") diff --git a/cardDisk2Sequencer.go b/cardDisk2Sequencer.go index 91cdb59..ee3083f 100644 --- a/cardDisk2Sequencer.go +++ b/cardDisk2Sequencer.go @@ -121,7 +121,7 @@ func (c *CardDisk2Sequencer) assign(a *Apple2, slot int) { a.registerRemovableMediaDrive(&c.drive[0]) a.registerRemovableMediaDrive(&c.drive[1]) - c.addCardSoftSwitches(func(address uint8, data uint8, write bool) uint8 { + c.addCardSoftSwitches(func(address uint8, data uint8, _ bool) uint8 { /* Slot card pins to SN74LS259 latch mapping: slot_address[3,2,1] => latch_address[2,1,0]