Const some more bus/processor usage, and ensure the data bus is a member, not a reference to memory.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2018-06-10 00:40:56 +01:00
parent 7531f8a24a
commit 3e854c7c49
28 changed files with 358 additions and 151 deletions
+7 -9
View File
@@ -33,9 +33,8 @@ void Board::initialise() {
CPU().PC() = m_configuration.getStartAddress();
}
void Board::Cpu_ExecutingInstruction_Cpm(const EightBit::Intel8080&) {
auto pc = CPU().PC();
switch (pc.word) {
void Board::Cpu_ExecutingInstruction_Cpm(const EightBit::Intel8080& cpu) {
switch (cpu.PC().word) {
case 0x0: // CP/M warm start
CPU().powerOff();
if (m_configuration.isProfileMode()) {
@@ -50,11 +49,10 @@ void Board::Cpu_ExecutingInstruction_Cpm(const EightBit::Intel8080&) {
}
}
void Board::bdos() {
auto c = CPU().C();
switch (c) {
void Board::bdos() const {
switch (CPU().C()) {
case 0x2: {
auto character = CPU().E();
const auto character = CPU().E();
std::cout << character;
break;
}
@@ -68,13 +66,13 @@ void Board::bdos() {
void Board::Cpu_ExecutingInstruction_Profile(const EightBit::Intel8080& cpu) {
const auto pc = CPU().PC();
const auto pc = cpu.PC();
m_profiler.addAddress(pc.word);
m_profiler.addInstruction(peek(pc.word));
}
void Board::Cpu_ExecutingInstruction_Debug(const EightBit::Intel8080&) {
void Board::Cpu_ExecutingInstruction_Debug(const EightBit::Intel8080& cpu) {
std::cerr
<< EightBit::Disassembler::state(CPU())