@@ -55,9 +55,6 @@ public class Cpu implements InstructionTable {
5555 public static final int IRQ_VECTOR_L = 0xfffe ;
5656 public static final int IRQ_VECTOR_H = 0xffff ;
5757
58- /* Simulated behavior */
59- private CpuBehavior behavior ;
60-
6158 /* The Bus */
6259 private Bus bus ;
6360
@@ -67,17 +64,6 @@ public class Cpu implements InstructionTable {
6764 /* CPU Cycles available */
6865 private int cycles = 0 ;
6966
70- /**
71- * Construct a new CPU.
72- */
73- public Cpu () {
74- this (CpuBehavior .NMOS_WITH_INDIRECT_JMP_BUG );
75- }
76-
77- public Cpu (CpuBehavior behavior ) {
78- this .behavior = behavior ;
79- }
80-
8167 /**
8268 * Set the bus reference for this CPU.
8369 */
@@ -92,14 +78,6 @@ public Bus getBus() {
9278 return bus ;
9379 }
9480
95- public void setBehavior (CpuBehavior behavior ) {
96- this .behavior = behavior ;
97- }
98-
99- public CpuBehavior getBehavior () {
100- return behavior ;
101- }
102-
10381 /**
10482 * Reset the CPU to known initial values.
10583 */
@@ -406,24 +384,13 @@ public void step() throws MemoryAccessException {
406384 case 0x6c : // JMP - Indirect
407385 lo = Utils .address (state .args [0 ], state .args [1 ]); // Address of low byte
408386
409- if (state .args [0 ] == 0xff && ( behavior == CpuBehavior . NMOS_WITH_INDIRECT_JMP_BUG || behavior == CpuBehavior . NMOS_WITH_ROR_BUG ) ) {
387+ if (state .args [0 ] == 0xff ) {
410388 hi = Utils .address (0x00 , state .args [1 ]);
411389 } else {
412390 hi = lo + 1 ;
413391 }
414392
415393 state .pc = Utils .address (bus .read (lo ), bus .read (hi ));
416- /* TODO: For accuracy, allow a flag to enable broken behavior of early 6502s:
417- *
418- * "An original 6502 has does not correctly fetch the target
419- * address if the indirect vector falls on a page boundary
420- * (e.g. $xxFF where xx is and value from $00 to $FF). In this
421- * case fetches the LSB from $xxFF as expected but takes the MSB
422- * from $xx00. This is fixed in some later chips like the 65SC02
423- * so for compatibility always ensure the indirect vector is not
424- * at the end of the page."
425- * (http://www.obelisk.demon.co.uk/6502/reference.html#JMP)
426- */
427394 break ;
428395
429396 /** ORA - Logical Inclusive Or ******************************************/
0 commit comments