Start moving towards reset being just another style of interrupt.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2018-08-25 01:34:30 +01:00
parent bca7977a23
commit 6d4223c368
17 changed files with 189 additions and 136 deletions
+12 -5
View File
@@ -18,7 +18,6 @@ void Board::initialise() {
m_ram.load(romDirectory + "/8080EX1.COM", 0x100); // Cringle/Bartholomew
//m_ram.load(romDirectory + "/CPUTEST.COM", 0x100); // SuperSoft diagnostics
poke(5, 0xc9); // ret
m_cpu.ExecutingInstruction.connect(std::bind(&Board::Cpu_ExecutingInstruction_Cpm, this, std::placeholders::_1));
if (m_configuration.isProfileMode()) {
@@ -30,15 +29,23 @@ void Board::initialise() {
}
CPU().powerOn();
CPU().PC() = m_configuration.getStartAddress();
CPU().reset();
poke(0, 0xc3); // JMP
poke(1, m_configuration.getStartAddress().low);
poke(2, m_configuration.getStartAddress().high);
poke(5, 0xc9); // ret
}
void Board::Cpu_ExecutingInstruction_Cpm(EightBit::Intel8080& cpu) {
switch (cpu.PC().word) {
case 0x0: // CP/M warm start
CPU().powerOff();
if (m_configuration.isProfileMode()) {
m_profiler.dump();
if (++m_warmstartCount == 3) {
CPU().powerOff();
if (m_configuration.isProfileMode()) {
m_profiler.dump();
}
}
break;
case 0x5: // BDOS