console switches: debug-mode in -d
This commit is contained in:
parent
b8c7d78ed6
commit
4bf488212b
3 changed files with 15 additions and 8 deletions
3
bus.cpp
3
bus.cpp
|
@ -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
|
||||||
|
|
18
bus.h
18
bus.h
|
@ -21,27 +21,31 @@ typedef struct
|
||||||
class bus
|
class bus
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
cpu *c { nullptr };
|
cpu *c { nullptr };
|
||||||
tm_11 *tm11 { nullptr };
|
tm_11 *tm11 { nullptr };
|
||||||
rk05 *rk05_ { nullptr };
|
rk05 *rk05_ { nullptr };
|
||||||
rx02 *rx02_ { nullptr };
|
rx02 *rx02_ { nullptr };
|
||||||
tty *tty_ { nullptr };
|
tty *tty_ { nullptr };
|
||||||
|
|
||||||
memory *m { nullptr };
|
memory *m { nullptr };
|
||||||
|
|
||||||
// 8 pages, D/I, 3 modes and 1 invalid mode
|
// 8 pages, D/I, 3 modes and 1 invalid mode
|
||||||
page_t pages[4][2][8];
|
page_t pages[4][2][8];
|
||||||
|
|
||||||
uint16_t MMR0 { 0 }, MMR1 { 0 }, MMR2 { 0 }, MMR3 { 0 }, CPUERR { 0 }, PIR { 0 }, CSR { 0 };
|
uint16_t MMR0 { 0 }, MMR1 { 0 }, MMR2 { 0 }, MMR3 { 0 }, CPUERR { 0 }, PIR { 0 }, CSR { 0 };
|
||||||
|
|
||||||
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_; }
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue