mirror of
https://github.com/badvision/jace.git
synced 2024-12-29 17:30:03 +00:00
Fix fake reads so DiskII doesn't break
This commit is contained in:
parent
519c561537
commit
2304eaab30
@ -415,7 +415,7 @@ public class MOS65C02 extends CPU {
|
||||
int address2 = cpu.getMemory().readWord(cpu.getProgramCounter() + 1, TYPE.READ_OPERAND, cpu.readAddressTriggersEvent, false);
|
||||
int address = 0x0FFFF & (address2 + cpu.X);
|
||||
// False read
|
||||
cpu.getMemory().read(address, TYPE.READ_DATA, true, false);
|
||||
cpu.getMemory().read(address, TYPE.READ_FAKE, true, false);
|
||||
cpu.setPageBoundaryPenalty((address & 0x00ff00) != (address2 & 0x00ff00));
|
||||
cpu.setPageBoundaryApplied(true);
|
||||
return address;
|
||||
@ -424,7 +424,7 @@ public class MOS65C02 extends CPU {
|
||||
int address2 = cpu.getMemory().readWord(cpu.getProgramCounter() + 1, TYPE.READ_OPERAND, cpu.readAddressTriggersEvent, false);
|
||||
int address = 0x0FFFF & (address2 + cpu.Y);
|
||||
// False read
|
||||
cpu.getMemory().read(address, TYPE.READ_DATA, true, false);
|
||||
cpu.getMemory().read(address, TYPE.READ_FAKE, true, false);
|
||||
cpu.setPageBoundaryPenalty((address & 0x00ff00) != (address2 & 0x00ff00));
|
||||
cpu.setPageBoundaryApplied(true);
|
||||
return address;
|
||||
|
@ -40,6 +40,7 @@ public class RAMEvent {
|
||||
READ(true),
|
||||
READ_DATA(true),
|
||||
READ_OPERAND(true),
|
||||
READ_FAKE(true),
|
||||
EXECUTE(true),
|
||||
WRITE(false),
|
||||
ANY(false);
|
||||
|
@ -86,6 +86,9 @@ 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:
|
||||
|
@ -333,6 +333,8 @@ public class CardSSC extends Card {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case READ_FAKE:
|
||||
return;
|
||||
}
|
||||
if (newValue > -1) {
|
||||
e.setNewValue(newValue);
|
||||
|
Loading…
Reference in New Issue
Block a user