1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-02 20:30:00 +00:00

Ensures M and X are exposed to the public interface.

This commit is contained in:
Thomas Harte 2020-10-10 21:33:56 -04:00
parent 28c8ba70c1
commit ae87728770
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ uint16_t ProcessorBase::get_value_of_register(Register r) const {
case Register::ProgramCounter: return pc_;
case Register::LastOperationAddress: return last_operation_pc_;
case Register::StackPointer: return s_.full;
case Register::Flags: return flags_.get(); // TODO: include additional flags (and below).
case Register::Flags: return get_flags();
case Register::A: return a_.full;
case Register::X: return x_.full;
case Register::Y: return y_.full;
@ -27,7 +27,7 @@ void ProcessorBase::set_value_of_register(Register r, uint16_t value) {
switch (r) {
case Register::ProgramCounter: pc_ = value; break;
case Register::StackPointer: s_.full = value; break;
case Register::Flags: flags_.set(uint8_t(value)); break;
case Register::Flags: set_flags(uint8_t(value)); break;
case Register::A: a_.full = value; break;
case Register::X: x_.full = value; break;
case Register::Y: y_.full = value; break;

View File

@ -1064,7 +1064,7 @@ void ProcessorStorage::set_m_x_flags(bool m, bool x) {
x_shift_ = x ? 0 : 8;
}
uint8_t ProcessorStorage::get_flags() {
uint8_t ProcessorStorage::get_flags() const {
uint8_t result = flags_.get();
if(!emulation_flag_) {

View File

@ -316,6 +316,6 @@ struct ProcessorStorage {
void set_reset_state();
void set_emulation_mode(bool);
void set_m_x_flags(bool m, bool x);
uint8_t get_flags();
uint8_t get_flags() const;
void set_flags(uint8_t);
};