This commit is contained in:
folkert van heusden 2022-03-25 09:59:40 +01:00
parent cabf912e66
commit 3248df3e87
4 changed files with 9 additions and 4 deletions

View file

@ -50,6 +50,11 @@ void bus::clearmem()
m -> reset();
}
void bus::init()
{
MMR0 = 0;
}
uint16_t bus::read(const uint16_t a, const bool word_mode, const bool use_prev)
{
uint16_t temp = 0;

2
bus.h
View file

@ -51,6 +51,8 @@ public:
tty *getTty() { return this->tty_; }
void init(); // invoked by 'RESET' command
uint16_t read(const uint16_t a, const bool word_mode, const bool use_prev=false);
uint16_t readByte(const uint16_t a) { return read(a, true); }
uint16_t readWord(const uint16_t a);

View file

@ -30,7 +30,7 @@ void cpu::reset()
pc = 0;
psw = 7 << 5;
fpsr = 0;
runMode = resetFlag = false;
runMode = false;
}
void cpu::setDisassemble(const bool state)
@ -1145,7 +1145,7 @@ bool cpu::misc_operations(const uint16_t instr)
return true;
case 0b0000000000000101: // RESET
resetFlag = true;
b->init();
return true;
}

2
cpu.h
View file

@ -19,7 +19,6 @@ private:
uint16_t psw { 0 };
uint16_t fpsr { 0 };
uint16_t stackLimitRegister { 0 };
bool resetFlag { false };
bool runMode { false };
bool emulateMFPT { false };
@ -61,7 +60,6 @@ public:
void reset();
void step();
void resetReset() { resetFlag = false; }
void pushStack(const uint16_t v);
uint16_t popStack();