Better register definitions for the 6502

Signed-off-by: Adrian.Conlon <adrian.conlon@gmail.com>
This commit is contained in:
Adrian.Conlon 2017-07-07 09:24:58 +01:00
parent f970c45005
commit 7cd0f324de
2 changed files with 10 additions and 10 deletions

View File

@ -31,12 +31,12 @@ namespace EightBit {
ProcessorType getLevel() const { return level; } ProcessorType getLevel() const { return level; }
uint8_t getX() const { return x; } uint8_t& X() { return x; }
uint8_t getY() const { return y; } uint8_t& Y() { return y; }
uint8_t getA() const { return a; } uint8_t& A() { return a; }
uint8_t getS() const { return s; } uint8_t& S() { return s; }
const StatusFlags& getP() const { return p; } StatusFlags& P() { return p; }
const Instruction& getInstruction(uint8_t code) const { const Instruction& getInstruction(uint8_t code) const {
return instructions[code]; return instructions[code];

View File

@ -70,12 +70,12 @@ void Board::Cpu_ExecutingInstruction_Debug(const EightBit::MOS6502& cpu) {
std::cout << std::hex; std::cout << std::hex;
std::cout << "PC=" << std::setw(4) << std::setfill('0') << address << ":"; std::cout << "PC=" << std::setw(4) << std::setfill('0') << address << ":";
std::cout << "P=" << (std::string)m_cpu.getP() << ", "; std::cout << "P=" << (std::string)m_cpu.P() << ", ";
std::cout << std::setw(2) << std::setfill('0'); std::cout << std::setw(2) << std::setfill('0');
std::cout << "A=" << (int)m_cpu.getA() << ", "; std::cout << "A=" << (int)m_cpu.A() << ", ";
std::cout << "X=" << (int)m_cpu.getX() << ", "; std::cout << "X=" << (int)m_cpu.X() << ", ";
std::cout << "Y=" << (int)m_cpu.getY() << ", "; std::cout << "Y=" << (int)m_cpu.Y() << ", ";
std::cout << "S=" << (int)m_cpu.getS() << "\t"; std::cout << "S=" << (int)m_cpu.S() << "\t";
std::cout << m_disassembler.Dump_ByteValue(cell); std::cout << m_disassembler.Dump_ByteValue(cell);
std::cout << m_disassembler.DumpBytes(mode, address + 1); std::cout << m_disassembler.DumpBytes(mode, address + 1);