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