--- nono/vm/printer.cpp 2026/04/29 17:05:18 1.1.1.8 +++ nono/vm/printer.cpp 2026/04/29 17:05:51 1.1.1.11 @@ -9,7 +9,11 @@ // #include "printer.h" -#include "mpu.h" +#include "event.h" + +// InsideOut p.135 +/*static*/ const busdata +PrinterDevice::wait = busdata::Wait(7 * 40_nsec); // コンストラクタ PrinterDevice::PrinterDevice() @@ -22,52 +26,49 @@ PrinterDevice::~PrinterDevice() { } -uint64 -PrinterDevice::Read8(uint32 addr) -{ - // 書き込み専用 - mpu->AddCycle(7); // InsideOut p.135 - return (uint64)-1; -} - -uint64 -PrinterDevice::Read16(uint32 addr) +busdata +PrinterDevice::ReadPort(uint32 offset) { // 書き込み専用 - mpu->AddCycle(7); // InsideOut p.135 - return (uint64)-1; + busdata data = BusData::BusErr; + data |= wait; + return data; } -uint64 -PrinterDevice::Write8(uint32 addr, uint32 data) +busdata +PrinterDevice::WritePort(uint32 offset, uint32 data) { - mpu->AddCycle(7); // InsideOut p.135 + busdata r; - uint32 offset = addr - baseaddr; switch (offset) { case 0: // データ書き込み putlog(0, "Write Data (NOT IMPLEMENTED)"); + r.SetBusErr(); break; - case 3: + case 1: // ストローブ書き込み putlog(0, "Write Strobe (NOT IMPLEMENTED)"); - return 0; + r = 0; + break; default: break; } - return (uint64)-1; -} -uint64 -PrinterDevice::Write16(uint32 addr, uint32 data) -{ - return Write8(addr + 1, data); + r |= wait; + r |= BusData::Size1; + return r; } -uint64 -PrinterDevice::Peek8(uint32 addr) +busdata +PrinterDevice::PeekPort(uint32 offset) { // XXX return 0xff; } + +bool +PrinterDevice::PokePort(uint32 offset, uint32 data) +{ + return false; +}