]> git.sur5r.net Git - cc65/commitdiff
sim65: Fix "$2C: BIT abs" to access the correct address. 712/head
authorPatrick Pelletier <code@funwithsoftware.org>
Fri, 10 Aug 2018 19:58:48 +0000 (12:58 -0700)
committerPatrick Pelletier <code@funwithsoftware.org>
Fri, 10 Aug 2018 19:58:48 +0000 (12:58 -0700)
Bug is documented here:
http://forum.6502.org/viewtopic.php?f=2&t=5242

src/sim65/6502.c

index 0d0adbf8b540e9c59c46e880ef4a2076b94bf240..bfbfbd78ce8b15e3475e5401e25ea5566c25d214 100644 (file)
@@ -739,7 +739,7 @@ static void OPC_6502_2C (void)
     unsigned Addr;
     unsigned char Val;
     Cycles = 4;
-    Addr = MemReadByte (Regs.PC+1);
+    Addr = MemReadWord (Regs.PC+1);
     Val = MemReadByte (Addr);
     SET_SF (Val & 0x80);
     SET_OF (Val & 0x40);