1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 08:49:37 +00:00

Corrects PLB, PLD, PLP.

This commit is contained in:
Thomas Harte 2020-10-07 20:23:53 -04:00
parent b510b9d337
commit 1ba0a117e7
2 changed files with 4 additions and 3 deletions

View File

@ -45,6 +45,7 @@ class KlausDormannTests: XCTestCase {
case 0x3399: return nil // success! case 0x3399: return nil // success!
case 0x052a: return "TAX, DEX or LDA did not correctly set flags, or BEQ did not branch correctly" case 0x052a: return "TAX, DEX or LDA did not correctly set flags, or BEQ did not branch correctly"
case 0x05db: return "PLP did not affect N flag correctly"
case 0x33a7: return "Decimal ADC result has wrong value" case 0x33a7: return "Decimal ADC result has wrong value"
case 0x3502: return "Binary SBC result has wrong value" case 0x3502: return "Binary SBC result has wrong value"
case 0x33b9: return "Decimal SBC result has wrong value" case 0x33b9: return "Decimal SBC result has wrong value"

View File

@ -329,17 +329,17 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
break; break;
case PLB: case PLB:
data_bank_ = (instruction_buffer_.value & 0xff) << 16; data_bank_ = (data_buffer_.value & 0xff) << 16;
flags_.set_nz(instruction_buffer_.value); flags_.set_nz(instruction_buffer_.value);
break; break;
case PLD: case PLD:
direct_ = instruction_buffer_.value; direct_ = data_buffer_.value;
flags_.set_nz(instruction_buffer_.value); flags_.set_nz(instruction_buffer_.value);
break; break;
case PLP: case PLP:
flags_.set(instruction_buffer_.value); flags_.set(data_buffer_.value);
if(!emulation_flag_) { if(!emulation_flag_) {
assert(false); // TODO: M and X. assert(false); // TODO: M and X.