From caf07d060313e6050a0ceca7ace67ad58ff173aa Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Thu, 18 Apr 2024 21:06:20 +0200 Subject: [PATCH] DAR from read-command is valid as well --- rl02.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rl02.cpp b/rl02.cpp index 5c10a6d..001c8d8 100644 --- a/rl02.cpp +++ b/rl02.cpp @@ -181,6 +181,8 @@ void rl02::writeWord(const uint16_t addr, uint16_t v) mpr[1] = 0; // zero mpr[2] = 0; // TODO: CRC + DOLOG(debug, false, "RL02 read header [cylinder: %d, head: %d, sector: %d] %06o", track, head, sector, mpr[0]); + do_int = true; } else if (command == 6 || command == 7) { // read data / read data without header check @@ -190,6 +192,11 @@ void rl02::writeWord(const uint16_t addr, uint16_t v) uint32_t count = (65536l - registers[(RL02_MPR - RL02_BASE) / 2]) * 2; + uint16_t temp = registers[(RL02_DAR - RL02_BASE) / 2]; + + sector = temp & 63; + head = (temp >> 6) & 1; + track = temp >> 7; DOLOG(debug, false, "RL02 read %d bytes (dec) from %d (dec) to %06o (oct) [cylinder: %d, head: %d, sector: %d]", count, temp_disk_offset, memory_address, track, head, sector); update_dar();