mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-03 22:33:29 +00:00
Fixes AND, EOR, ORA. Takes an unsuccessful shot at ROL.
This commit is contained in:
parent
536c4d45c1
commit
6efe4e1753
@ -228,12 +228,9 @@ class WolfgangLorenzTests: XCTestCase, CSTestMachineTrapHandler {
|
||||
// MARK: - Collections
|
||||
|
||||
func testTransfers(processor: CSTestMachine6502Processor) {
|
||||
self.runTest("taxn", processor: processor)
|
||||
self.runTest("tayn", processor: processor)
|
||||
self.runTest("txan", processor: processor)
|
||||
self.runTest("tyan", processor: processor)
|
||||
self.runTest("tsxn", processor: processor)
|
||||
self.runTest("txsn", processor: processor)
|
||||
for test in ["taxn", "tayn", "txan", "tyan", "tsxn", "txsn"] {
|
||||
runTest(test, processor: processor)
|
||||
}
|
||||
}
|
||||
func testStack(processor: CSTestMachine6502Processor) {
|
||||
self.runTest("phan", processor: processor)
|
||||
@ -255,6 +252,15 @@ class WolfgangLorenzTests: XCTestCase, CSTestMachineTrapHandler {
|
||||
self.runTest("deca", processor: processor)
|
||||
self.runTest("decax", processor: processor)
|
||||
}
|
||||
func testFlagManipulation(processor: CSTestMachine6502Processor) {
|
||||
self.runTest("clcn", processor: processor)
|
||||
self.runTest("secn", processor: processor)
|
||||
self.runTest("cldn", processor: processor)
|
||||
self.runTest("sedn", processor: processor)
|
||||
self.runTest("clin", processor: processor)
|
||||
self.runTest("sein", processor: processor)
|
||||
self.runTest("clvn", processor: processor)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Test Running
|
||||
|
@ -614,17 +614,17 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
|
||||
//
|
||||
|
||||
case AND:
|
||||
a_.full &= instruction_buffer_.value | m_masks_[0];
|
||||
a_.full &= data_buffer_.value | m_masks_[0];
|
||||
flags_.set_nz(a_.full, m_shift_);
|
||||
break;
|
||||
|
||||
case EOR:
|
||||
a_.full ^= instruction_buffer_.value;
|
||||
a_.full ^= data_buffer_.value;
|
||||
flags_.set_nz(a_.full, m_shift_);
|
||||
break;
|
||||
|
||||
case ORA:
|
||||
a_.full |= instruction_buffer_.value;
|
||||
a_.full |= data_buffer_.value;
|
||||
flags_.set_nz(a_.full, m_shift_);
|
||||
break;
|
||||
|
||||
@ -674,7 +674,7 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
|
||||
//
|
||||
|
||||
case ASL:
|
||||
flags_.carry = (data_buffer_.value >> (7 + m_shift_)) & 1;
|
||||
flags_.carry = data_buffer_.value >> (7 + m_shift_);
|
||||
data_buffer_.value <<= 1;
|
||||
flags_.set_nz(data_buffer_.value, m_shift_);
|
||||
break;
|
||||
@ -687,7 +687,7 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
|
||||
|
||||
case ROL:
|
||||
data_buffer_.value = (data_buffer_.value << 1) | flags_.carry;
|
||||
flags_.carry = (data_buffer_.value >> (7 + m_shift_)) & 1;
|
||||
flags_.carry = data_buffer_.value >> (8 + m_shift_);
|
||||
flags_.set_nz(data_buffer_.value, m_shift_);
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user