Skip to content

Commit

Permalink
Using the exposed registers.
Browse files Browse the repository at this point in the history
  • Loading branch information
nacnud-sco committed May 8, 2024
1 parent ce938a7 commit 3d91757
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Src/BeebWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5464,10 +5464,25 @@ void _6502SimControl::removeBreakpoint(unsigned addr) {
// Register access
uint32_t _6502SimControl::readReg(std::size_t num) {

if (isValidRegIndex(static_cast<uint8_t>(num))) {
return localRegisters[num];
} else {
return 0xff;
if (isValidRegIndex(num)) {
REG_INDEX request = static_cast<REG_INDEX>(num);

switch (request) {
case REG_INDEX::REG_A:
return Accumulator;
case REG_INDEX::REG_X:
return XReg;
case REG_INDEX::REG_Y:
return YReg;
case REG_INDEX::REG_PC:
return ProgramCounter;
case REG_INDEX::REG_SR:
return PSR;
case REG_INDEX::REG_SP:
return StackReg;
default:
return 0xdd;
}
}
}

Expand Down

0 comments on commit 3d91757

Please sign in to comment.