diff --git a/OSBindings/Mac/Clock SignalTests/KlausDormannTests.swift b/OSBindings/Mac/Clock SignalTests/KlausDormannTests.swift index 6a614019c..17dfda582 100644 --- a/OSBindings/Mac/Clock SignalTests/KlausDormannTests.swift +++ b/OSBindings/Mac/Clock SignalTests/KlausDormannTests.swift @@ -87,6 +87,10 @@ class KlausDormannTests: XCTestCase { case 0x183a: return "STA (zp) acted as JAM" case 0x1849: return "LDA/STA (zp) left flags in incorrect state" + case 0x1983: return "STZ didn't store zero" + + case 0x1b03: return "BIT didn't set flags correctly" + case 0: return "Didn't find tests" default: return "Unknown error at \(String(format:"%04x", address))" } diff --git a/Processors/6502/Implementation/6502Implementation.hpp b/Processors/6502/Implementation/6502Implementation.hpp index ca0a371c6..d9888d29b 100644 --- a/Processors/6502/Implementation/6502Implementation.hpp +++ b/Processors/6502/Implementation/6502Implementation.hpp @@ -201,6 +201,7 @@ if(number_of_cycles <= Cycles(0)) break; case OperationSTA: operand_ = a_; continue; case OperationSTX: operand_ = x_; continue; case OperationSTY: operand_ = y_; continue; + case OperationSTZ: operand_ = 0; continue; case OperationSAX: operand_ = a_ & x_; continue; case OperationSHA: operand_ = a_ & x_ & (address_.bytes.high+1); continue; case OperationSHX: operand_ = x_ & (address_.bytes.high+1); continue; diff --git a/Processors/6502/Implementation/6502Storage.cpp b/Processors/6502/Implementation/6502Storage.cpp index 786394d45..49292b030 100644 --- a/Processors/6502/Implementation/6502Storage.cpp +++ b/Processors/6502/Implementation/6502Storage.cpp @@ -286,6 +286,12 @@ ProcessorStorage::ProcessorStorage(Personality personality) { Install(0xb2, ZeroIndirectRead(OperationLDA)); Install(0xd2, ZeroIndirectRead(OperationCMP)); Install(0xd2, ZeroIndirectRead(OperationSBC)); + + // Add STZ. + Install(0x9c, AbsoluteWrite(OperationSTZ)); + Install(0x9e, AbsoluteXWrite(OperationSTZ)); + Install(0x64, ZeroWrite(OperationSTZ)); + Install(0x74, ZeroXWrite(OperationSTZ)); } #undef Install } diff --git a/Processors/6502/Implementation/6502Storage.hpp b/Processors/6502/Implementation/6502Storage.hpp index 50d24727b..cde267786 100644 --- a/Processors/6502/Implementation/6502Storage.hpp +++ b/Processors/6502/Implementation/6502Storage.hpp @@ -49,7 +49,8 @@ class ProcessorStorage { OperationIncrementOperand, OperationORA, OperationAND, OperationEOR, OperationINS, OperationADC, OperationSBC, OperationLDA, OperationLDX, OperationLDY, OperationLAX, OperationSTA, - OperationSTX, OperationSTY, OperationSAX, OperationSHA, + OperationSTX, OperationSTY, OperationSTZ, + OperationSAX, OperationSHA, OperationSHX, OperationSHY, OperationSHS, OperationCMP, OperationCPX, OperationCPY, OperationBIT, OperationASL, OperationASO, OperationROL, OperationRLA, OperationLSR,