--- nono/vm/printer.cpp 2026/04/29 17:05:25 1.1.1.9 +++ nono/vm/printer.cpp 2026/04/29 17:05:29 1.1.1.10 @@ -9,7 +9,7 @@ // #include "printer.h" -#include "mpu.h" +#include "event.h" // InsideOut p.135 static const busdata wait = busdata::Wait(7 * 40_nsec); @@ -26,27 +26,17 @@ PrinterDevice::~PrinterDevice() } busdata -PrinterDevice::Read8(uint32 addr) +PrinterDevice::ReadPort(uint32 offset) { // 書き込み専用 - busdata data = busdata::BusErr; + busdata data = BusData::BusErr; data |= wait; return data; } busdata -PrinterDevice::Read16(uint32 addr) +PrinterDevice::WritePort(uint32 offset, uint32 data) { - // 書き込み専用 - busdata data = busdata::BusErr; - data |= wait; - return data; -} - -busdata -PrinterDevice::Write8(uint32 addr, uint32 data) -{ - uint32 offset = addr - baseaddr; busdata r; switch (offset) { @@ -55,7 +45,7 @@ PrinterDevice::Write8(uint32 addr, uint3 putlog(0, "Write Data (NOT IMPLEMENTED)"); r.SetBusErr(); break; - case 3: + case 1: // ストローブ書き込み putlog(0, "Write Strobe (NOT IMPLEMENTED)"); r = 0; @@ -65,18 +55,19 @@ PrinterDevice::Write8(uint32 addr, uint3 } r |= wait; + r |= BusData::Size1; return r; } busdata -PrinterDevice::Write16(uint32 addr, uint32 data) +PrinterDevice::PeekPort(uint32 offset) { - return Write8(addr + 1, data); + // XXX + return 0xff; } -busdata -PrinterDevice::Peek8(uint32 addr) +bool +PrinterDevice::PokePort(uint32 offset, uint32 data) { - // XXX - return 0xff; + return false; }