Bug Fixes and Copyright Date Change

The simulator now passes Klaus Dormann's 6502 Functional Test suite for
the first time.

Bug Fixes:

- PHP was not correctly setting the Break bit on the stack copy of the
  processor status, so subsequent PLA's would not set the Break status
  flag.

- The CPU had swapped NMI and IRQ reset vectors, so RTI was failing.

- BRK was pushing PC + 2 onto the stack, instead of PC + 1

- (Zero Page,X) addressing mode did not correctly wrap on zero page
  boundaries.

- The instruction table used for disassembly had addressing modes
  of LDA $B9 and $BD reversed. This did not affect behavior, only
  disassembly of these instructions.

Other:

- Updated copyright date for 2013.

- Started migrating old JUnit 3 style tests to JUnit 4 annotations.
This commit is contained in:
Seth Morabito committed 2013-01-01 17:03:16 -08:00
1 parent 92b61e4839
commit da8250778e
25 files changed
+323 -130

No files matched your search

+12 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2012 Seth J. Morabito <sethm@loomcom.com>
* Copyright (c) 2008-2013 Seth J. Morabito <sethm@loomcom.com>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -451,9 +451,9 @@ public class Simulator implements Observer {
});
try {
while (isRunning && !(preferences.getHaltOnBreak() && cpu.getBreakFlag())) {
do {
step();
}
} while (shouldContinue());
} catch (SymonException ex) {
logger.log(Level.SEVERE, "Exception in main simulator run thread. Exiting run.");
ex.printStackTrace();
@@ -475,6 +475,15 @@ public class Simulator implements Observer {
isRunning = false;
}
/**
* Returns true if the run loop should proceed to the next step.
*
* @return True if the run loop should proceed to the next step.
*/
private boolean shouldContinue() {
return isRunning && !(preferences.getHaltOnBreak() && cpu.getInstruction() == 0x00);
}
}
class LoadProgramAction extends AbstractAction {