RESET
This commit is contained in:
parent
cabf912e66
commit
3248df3e87
4 changed files with 9 additions and 4 deletions
5
bus.cpp
5
bus.cpp
|
@ -50,6 +50,11 @@ void bus::clearmem()
|
||||||
m -> reset();
|
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 bus::read(const uint16_t a, const bool word_mode, const bool use_prev)
|
||||||
{
|
{
|
||||||
uint16_t temp = 0;
|
uint16_t temp = 0;
|
||||||
|
|
2
bus.h
2
bus.h
|
@ -51,6 +51,8 @@ public:
|
||||||
|
|
||||||
tty *getTty() { return this->tty_; }
|
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 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 readByte(const uint16_t a) { return read(a, true); }
|
||||||
uint16_t readWord(const uint16_t a);
|
uint16_t readWord(const uint16_t a);
|
||||||
|
|
4
cpu.cpp
4
cpu.cpp
|
@ -30,7 +30,7 @@ void cpu::reset()
|
||||||
pc = 0;
|
pc = 0;
|
||||||
psw = 7 << 5;
|
psw = 7 << 5;
|
||||||
fpsr = 0;
|
fpsr = 0;
|
||||||
runMode = resetFlag = false;
|
runMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu::setDisassemble(const bool state)
|
void cpu::setDisassemble(const bool state)
|
||||||
|
@ -1145,7 +1145,7 @@ bool cpu::misc_operations(const uint16_t instr)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 0b0000000000000101: // RESET
|
case 0b0000000000000101: // RESET
|
||||||
resetFlag = true;
|
b->init();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
cpu.h
2
cpu.h
|
@ -19,7 +19,6 @@ private:
|
||||||
uint16_t psw { 0 };
|
uint16_t psw { 0 };
|
||||||
uint16_t fpsr { 0 };
|
uint16_t fpsr { 0 };
|
||||||
uint16_t stackLimitRegister { 0 };
|
uint16_t stackLimitRegister { 0 };
|
||||||
bool resetFlag { false };
|
|
||||||
bool runMode { false };
|
bool runMode { false };
|
||||||
bool emulateMFPT { false };
|
bool emulateMFPT { false };
|
||||||
|
|
||||||
|
@ -61,7 +60,6 @@ public:
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
void step();
|
void step();
|
||||||
void resetReset() { resetFlag = false; }
|
|
||||||
|
|
||||||
void pushStack(const uint16_t v);
|
void pushStack(const uint16_t v);
|
||||||
uint16_t popStack();
|
uint16_t popStack();
|
||||||
|
|
Loading…
Add table
Reference in a new issue