diff --git a/bus.cpp b/bus.cpp index 4e8630f..a15ffd3 100644 --- a/bus.cpp +++ b/bus.cpp @@ -429,6 +429,9 @@ memory_addresses_t bus::calculate_physical_address(const int run_mode, const uin { const uint8_t apf = a >> 13; // active page field + if ((MMR0 & 1) == 0) + return { a, apf, a, a }; + uint32_t physical_instruction = pages[run_mode][0][apf].par * 64; uint32_t physical_data = pages[run_mode][1][apf].par * 64; @@ -437,11 +440,9 @@ memory_addresses_t bus::calculate_physical_address(const int run_mode, const uin physical_instruction += p_offset; physical_data += p_offset; - if (MMR0 & 1) { // MMU enabled? - if ((MMR3 & 16) == 0) { // offset is 18bit - physical_instruction &= 0x3ffff; - physical_data &= 0x3ffff; - } + if ((MMR3 & 16) == 0) { // offset is 18bit + physical_instruction &= 0x3ffff; + physical_data &= 0x3ffff; } return { a, apf, physical_instruction, physical_data }; diff --git a/cpu.cpp b/cpu.cpp index 2c0fc8b..35d5d26 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -1276,13 +1276,7 @@ bool cpu::single_operand_instructions(const uint16_t instr) int run_mode = (getPSW() >> 12) & 3; auto phys = b->calculate_physical_address(run_mode, a.addr.value()); - DOLOG(debug, true, "MTPI/D %06o -> %o / %o", a, phys.physical_instruction, phys.physical_data); - -// FILE *fh = fopen("og2-kek.dat", "a+"); -// fprintf(fh, "%lu %06o MTPI %06o: %06o\n", mtpi_count, oldpc, a, v); -// fclose(fh); - DOLOG(debug, true, "%lu %06o MTPI %06o: %06o", mtpi_count, pc-2, a.addr.value(), v); - + DOLOG(debug, true, "%lu %06o MTP%c %06o: %06o", mtpi_count, pc-2, word_mode ? 'D' : 'I', a.addr.value(), v); mtpi_count++; uint32_t a = word_mode ? phys.physical_data : phys.physical_instruction;