console switches: debug-mode in -d

This commit is contained in:
folkert van heusden 2022-04-13 11:18:56 +02:00
parent b8c7d78ed6
commit 4bf488212b
3 changed files with 15 additions and 8 deletions

View file

@ -64,7 +64,8 @@ uint16_t bus::read(const uint16_t a, const bool word_mode, const bool use_prev,
if (a == 0177570) { // console switch & display register if (a == 0177570) { // console switch & display register
D(fprintf(stderr, "read console switch\n");) D(fprintf(stderr, "read console switch\n");)
return 128; // educated guess
return debug_mode ? 128 : 0;
} }
if (a == 0172540) { // KW11P programmable clock if (a == 0172540) { // KW11P programmable clock

4
bus.h
View file

@ -36,12 +36,16 @@ private:
uint16_t switch_register { 0 }; uint16_t switch_register { 0 };
bool debug_mode { false };
public: public:
bus(); bus();
~bus(); ~bus();
void clearmem(); void clearmem();
void set_debug_mode(const bool state) { debug_mode = state; }
void add_cpu(cpu *const c) { this -> c = c; } void add_cpu(cpu *const c) { this -> c = c; }
void add_tm11(tm_11 *tm11) { this -> tm11 = tm11; } void add_tm11(tm_11 *tm11) { this -> tm11 = tm11; }
void add_rk05(rk05 *rk05_) { this -> rk05_ = rk05_; } void add_rk05(rk05 *rk05_) { this -> rk05_ = rk05_; }

View file

@ -76,6 +76,8 @@ void debugger(console *const cnsl, bus *const b, std::atomic_bool *const interru
{ {
cpu *const c = b->getCpu(); cpu *const c = b->getCpu();
b->set_debug_mode(true);
bool single_step = false; bool single_step = false;
while(!terminate) { while(!terminate) {