Simplify the usage of the register16_t union.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2018-06-16 00:55:32 +01:00
parent 89632774a7
commit 67487b5b6e
17 changed files with 71 additions and 96 deletions
+4 -6
View File
@@ -51,11 +51,10 @@ void EightBit::MOS6502::reset() {
}
EightBit::register16_t EightBit::MOS6502::getWordPaged(uint8_t page, uint8_t offset) {
EightBit::register16_t returned;
returned.low = getBytePaged(page, offset);
const auto low = getBytePaged(page, offset);
++BUS().ADDRESS().low;
returned.high = BUS().read();
return returned;
const auto high = BUS().read();
return register16_t(low, high);
}
uint8_t EightBit::MOS6502::getBytePaged(uint8_t page, uint8_t offset) {
@@ -442,8 +441,7 @@ uint8_t EightBit::MOS6502::SUB_d(const uint8_t operand, const uint8_t data, cons
}
void EightBit::MOS6502::CMP(uint8_t first, uint8_t second) {
register16_t result;
result.word = first - second;
const register16_t result = first - second;
adjustNZ(result.low);
clearFlag(P(), CF, result.high);
}