From 25c43cbaaa610019437c8ebd60684f0f36138d0b Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 24 Aug 2023 23:46:17 -0400 Subject: [PATCH] housekeeping --- src/app/core/constants.h | 2 -- src/app/emu/cpu.cc | 16 ++++++++-------- src/app/emu/cpu.h | 6 +++--- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/app/core/constants.h b/src/app/core/constants.h index 2f0de137..5d10d9ab 100644 --- a/src/app/core/constants.h +++ b/src/app/core/constants.h @@ -167,7 +167,6 @@ class VersionConstants { static constexpr uint32_t overworldTilesType = 0x7FD94; }; - // ============================================================================ // Magic numbers // ============================================================================ @@ -669,7 +668,6 @@ static const absl::string_view SecretItemNames[] = { "Hole", "Warp", "Staircase", "Bombable", "Switch"}; - static const absl::string_view TileTypeNames[] = { "$00 Nothing (standard floor)", "$01 Collision", diff --git a/src/app/emu/cpu.cc b/src/app/emu/cpu.cc index 727fa634..4f2b105a 100644 --- a/src/app/emu/cpu.cc +++ b/src/app/emu/cpu.cc @@ -1342,7 +1342,7 @@ void CPU::CLV() { status &= ~0x40; } // n Set if MSB of result is set; else cleared // z Set if result is zero; else cleared // c Set if no borrow; else cleared -void CPU::CMP(uint8_t value, bool isImmediate = false) { +void CPU::CMP(uint16_t value, bool isImmediate) { if (GetAccumulatorSize()) { // 8-bit uint8_t result = isImmediate ? A - value : A - memory.ReadByte(value); SetZeroFlag(result == 0); @@ -1371,7 +1371,7 @@ void CPU::COP() { } // CPX: Compare X register -void CPU::CPX(uint16_t value, bool isImmediate = false) { +void CPU::CPX(uint16_t value, bool isImmediate) { if (GetIndexSize()) { // 8-bit uint8_t memory_value = isImmediate ? value : memory.ReadByte(value); compare(X, memory_value); @@ -1382,7 +1382,7 @@ void CPU::CPX(uint16_t value, bool isImmediate = false) { } // CPY: Compare Y register -void CPU::CPY(uint16_t value, bool isImmediate = false) { +void CPU::CPY(uint16_t value, bool isImmediate) { if (GetIndexSize()) { // 8-bit uint8_t memory_value = isImmediate ? value : memory.ReadByte(value); compare(Y, memory_value); @@ -1436,7 +1436,7 @@ void CPU::DEY() { } // EOR: Exclusive OR TESTMEs -void CPU::EOR(uint16_t address, bool isImmediate = false) { +void CPU::EOR(uint16_t address, bool isImmediate) { if (GetAccumulatorSize()) { A ^= isImmediate ? address : memory.ReadByte(address); SetZeroFlag(A == 0); @@ -1520,7 +1520,7 @@ void CPU::JSL(uint32_t address) { } // LDA: Load accumulator -void CPU::LDA(uint16_t address, bool isImmediate = false) { +void CPU::LDA(uint16_t address, bool isImmediate ) { if (GetAccumulatorSize()) { A = isImmediate ? address : memory.ReadByte(address); SetZeroFlag(A == 0); @@ -1533,7 +1533,7 @@ void CPU::LDA(uint16_t address, bool isImmediate = false) { } // LDX: Load X register -void CPU::LDX(uint16_t address, bool isImmediate = false) { +void CPU::LDX(uint16_t address, bool isImmediate ) { if (GetIndexSize()) { X = isImmediate ? address : memory.ReadByte(address); SetZeroFlag(X == 0); @@ -1546,7 +1546,7 @@ void CPU::LDX(uint16_t address, bool isImmediate = false) { } // LDY: Load Y register -void CPU::LDY(uint16_t address, bool isImmediate = false) { +void CPU::LDY(uint16_t address, bool isImmediate ) { if (GetIndexSize()) { Y = isImmediate ? address : memory.ReadByte(address); SetZeroFlag(Y == 0); @@ -1577,7 +1577,7 @@ void CPU::NOP() { } // ORA: Logical OR -void CPU::ORA(uint16_t address, bool isImmediate = false) { +void CPU::ORA(uint16_t address, bool isImmediate ) { if (GetAccumulatorSize()) { A |= isImmediate ? address : memory.ReadByte(address); SetZeroFlag(A == 0); diff --git a/src/app/emu/cpu.h b/src/app/emu/cpu.h index 1375d86c..477f077d 100644 --- a/src/app/emu/cpu.h +++ b/src/app/emu/cpu.h @@ -492,13 +492,13 @@ class CPU : public Memory, public Loggable { void ORA(uint16_t address, bool isImmediate = false); // PEA: Push effective absolute address - void PEA(uint16_t address); + void PEA(); // PEI: Push effective indirect address - void PEI(uint16_t address); + void PEI(); // PER: Push effective relative address - void PER(uint16_t address); + void PER(); // PHA: Push accumulator void PHA();