From cd9c4e2b41b764df89232a454f4e1641cf9e3a32 Mon Sep 17 00:00:00 2001 From: Ivan Izaguirre Date: Wed, 23 Sep 2020 18:11:47 +0200 Subject: [PATCH] Double read on INC to pass a2audit tests --- core6502/operations.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core6502/operations.go b/core6502/operations.go index 4bdf917..0c8f5d9 100644 --- a/core6502/operations.go +++ b/core6502/operations.go @@ -13,6 +13,10 @@ func buildOpTransfer(regSrc int, regDst int) opFunc { func buildOpIncDec(inc bool) opFunc { return func(s *State, line []uint8, opcode opcode) { value := resolveValue(s, line, opcode) + if opcode.addressMode == modeAbsoluteX || opcode.addressMode == modeAbsoluteY { + // Double read, needed to pass A2Audit for the Language Card + value = resolveValue(s, line, opcode) + } if inc { value++ } else {