From 3eb4dd74a23749f13a08de8c2618d92ac105cc91 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 14 Jun 2021 21:45:12 -0400 Subject: [PATCH] Exposes memory control. Machine now runs as far as trying to interact with Nick. --- Machines/Enterprise/Enterprise.cpp | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Machines/Enterprise/Enterprise.cpp b/Machines/Enterprise/Enterprise.cpp index 6b08963fd..1b818068c 100644 --- a/Machines/Enterprise/Enterprise.cpp +++ b/Machines/Enterprise/Enterprise.cpp @@ -56,13 +56,35 @@ class ConcreteMachine: default: break; case CPU::Z80::PartialMachineCycle::Input: - printf("Unhandled input: %04x\n", address); - assert(false); + switch(address & 0xff) { + default: + printf("Unhandled input: %04x\n", address); + assert(false); + break; + + case 0xb0: *cycle.value = pages_[0]; break; + case 0xb1: *cycle.value = pages_[1]; break; + case 0xb2: *cycle.value = pages_[2]; break; + case 0xb3: *cycle.value = pages_[3]; break; + } break; case CPU::Z80::PartialMachineCycle::Output: - printf("Unhandled output: %04x\n", address); - assert(false); + switch(address & 0xff) { + default: + printf("Unhandled output: %04x\n", address); + assert(false); + break; + + case 0xb0: page<0>(*cycle.value); break; + case 0xb1: page<1>(*cycle.value); break; + case 0xb2: page<2>(*cycle.value); break; + case 0xb3: page<3>(*cycle.value); break; + + case 0xbf: + printf("TODO: Dave sysconfig %02x\n", *cycle.value); + break; + } break; case CPU::Z80::PartialMachineCycle::Read: