mirror of
https://github.com/badvision/jace.git
synced 2024-11-24 15:30:51 +00:00
Inhibit fake reads from afecting any cards
This commit is contained in:
parent
5444f40bd4
commit
4db3cca98d
@ -17,6 +17,7 @@
|
||||
package jace.core;
|
||||
|
||||
import jace.apple2e.SoftSwitches;
|
||||
import jace.core.RAMEvent.TYPE;
|
||||
|
||||
/**
|
||||
* Card is an abstraction of an Apple ][ hardware module which can carry its own
|
||||
@ -113,6 +114,9 @@ public abstract class Card extends TimedDevice {
|
||||
int baseIO = 0x0c080 + slot * 16;
|
||||
int baseRom = 0x0c000 + slot * 256;
|
||||
ioListener = getMemory().observe("Slot " + getSlot() + " " + getDeviceName() + " IO access", RAMEvent.TYPE.ANY, baseIO, baseIO + 15, (e) -> {
|
||||
if (e.getType() == TYPE.READ_FAKE) {
|
||||
return;
|
||||
}
|
||||
int address = e.getAddress() & 0x0f;
|
||||
handleIOAccess(address, e.getType(), e.getNewValue(), e);
|
||||
});
|
||||
@ -121,6 +125,9 @@ public abstract class Card extends TimedDevice {
|
||||
getMemory().setActiveCard(slot);
|
||||
// Sather 6-4: Writes will still go through even when CXROM inhibits slot ROM
|
||||
if (SoftSwitches.CXROM.isOff() || !e.getType().isRead()) {
|
||||
if (e.getType() == TYPE.READ_FAKE) {
|
||||
return;
|
||||
}
|
||||
handleFirmwareAccess(e.getAddress() & 0x0ff, e.getType(), e.getNewValue(), e);
|
||||
}
|
||||
});
|
||||
|
@ -86,9 +86,6 @@ public class CardDiskII extends Card implements MediaConsumerParent {
|
||||
|
||||
@Override
|
||||
protected void handleIOAccess(int register, RAMEvent.TYPE type, int value, RAMEvent e) {
|
||||
if (type == TYPE.READ_FAKE) {
|
||||
return;
|
||||
}
|
||||
// handle Disk ][ registers
|
||||
switch (register) {
|
||||
case 0x0:
|
||||
|
@ -140,9 +140,6 @@ public class CardMockingboard extends Card {
|
||||
|
||||
@Override
|
||||
protected void handleFirmwareAccess(int register, TYPE type, int value, RAMEvent e) {
|
||||
if (type == TYPE.READ_FAKE) {
|
||||
return;
|
||||
}
|
||||
if (chips == null) {
|
||||
reconfigure();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user