From 7605c934c26a222204f9e92f30c080aafbc3c12a Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sat, 18 Jun 2022 09:10:51 +0200 Subject: [PATCH] throw 3/4: add run mode --- bus.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bus.cpp b/bus.cpp index e3cb197..c31a944 100644 --- a/bus.cpp +++ b/bus.cpp @@ -419,8 +419,11 @@ uint32_t bus::calculate_physical_address(const int run_mode, const uint16_t a, c MMR0 &= ~14; // add current page MMR0 |= apf << 1; + MMR0 &= ~(3 << 5); + MMR0 |= run_mode << 5; + pages[run_mode][0][apf].pdr |= 1 << 7; // TODO: D/I - // + c->schedule_trap(04); throw 3; @@ -437,6 +440,9 @@ uint32_t bus::calculate_physical_address(const int run_mode, const uint16_t a, c MMR0 &= ~14; // add current page MMR0 |= apf << 1; + MMR0 &= ~(3 << 5); + MMR0 |= run_mode << 5; + pages[run_mode][0][apf].pdr |= 1 << 7; // TODO: D/I throw 4;