mirror of
https://github.com/badvision/jace.git
synced 2024-12-29 02:31:15 +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 address2 = cpu.getMemory().readWord(cpu.getProgramCounter() + 1, TYPE.READ_OPERAND, cpu.readAddressTriggersEvent, false);
|
||||||
int address = 0x0FFFF & (address2 + cpu.X);
|
int address = 0x0FFFF & (address2 + cpu.X);
|
||||||
// False read
|
// 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.setPageBoundaryPenalty((address & 0x00ff00) != (address2 & 0x00ff00));
|
||||||
cpu.setPageBoundaryApplied(true);
|
cpu.setPageBoundaryApplied(true);
|
||||||
return address;
|
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 address2 = cpu.getMemory().readWord(cpu.getProgramCounter() + 1, TYPE.READ_OPERAND, cpu.readAddressTriggersEvent, false);
|
||||||
int address = 0x0FFFF & (address2 + cpu.Y);
|
int address = 0x0FFFF & (address2 + cpu.Y);
|
||||||
// False read
|
// 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.setPageBoundaryPenalty((address & 0x00ff00) != (address2 & 0x00ff00));
|
||||||
cpu.setPageBoundaryApplied(true);
|
cpu.setPageBoundaryApplied(true);
|
||||||
return address;
|
return address;
|
||||||
|
@ -40,6 +40,7 @@ public class RAMEvent {
|
|||||||
READ(true),
|
READ(true),
|
||||||
READ_DATA(true),
|
READ_DATA(true),
|
||||||
READ_OPERAND(true),
|
READ_OPERAND(true),
|
||||||
|
READ_FAKE(true),
|
||||||
EXECUTE(true),
|
EXECUTE(true),
|
||||||
WRITE(false),
|
WRITE(false),
|
||||||
ANY(false);
|
ANY(false);
|
||||||
|
@ -86,6 +86,9 @@ 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:
|
||||||
|
@ -333,6 +333,8 @@ public class CardSSC extends Card {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case READ_FAKE:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (newValue > -1) {
|
if (newValue > -1) {
|
||||||
e.setNewValue(newValue);
|
e.setNewValue(newValue);
|
||||||
|
Loading…
Reference in New Issue
Block a user