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

View File

@ -13,7 +13,7 @@ EightBit::Disassembler::Disassembler() {
m_formatter.exceptions(boost::io::all_error_bits ^ boost::io::too_many_args_bit);
}
std::string EightBit::Disassembler::state(Intel8080& cpu) {
std::string EightBit::Disassembler::state(const Intel8080& cpu) {
auto pc = cpu.PC();
auto sp = cpu.SP();
@ -160,13 +160,13 @@ std::string EightBit::Disassembler::alu2(int which) {
throw std::logic_error("Unhandled alu operation");
}
std::string EightBit::Disassembler::disassemble(Intel8080& cpu) {
std::string EightBit::Disassembler::disassemble(const Intel8080& cpu) {
std::ostringstream output;
disassemble(output, cpu, cpu.PC().word);
return output.str();
}
void EightBit::Disassembler::disassemble(std::ostringstream& output, Intel8080& cpu, uint16_t pc) {
void EightBit::Disassembler::disassemble(std::ostringstream& output, const Intel8080& cpu, uint16_t pc) {
auto& bus = cpu.BUS();
auto opcode = bus.peek(pc);