Double read on INC to pass a2audit tests

This commit is contained in:
Ivan Izaguirre 2020-09-23 18:11:47 +02:00
parent 696038fa30
commit cd9c4e2b41

View File

@ -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 {