--- nono/vm/opm.cpp 2026/04/29 17:05:24 1.1.1.7 +++ nono/vm/opm.cpp 2026/04/29 17:05:37 1.1.1.9 @@ -29,10 +29,6 @@ OPMDevice::~OPMDevice() bool OPMDevice::Init() { - if (inherited::Init() == false) { - return false; - } - adpcm = GetADPCMDevice(); fdc = GetFDCDevice(); @@ -51,7 +47,7 @@ OPMDevice::ResetHard(bool poweron) } busdata -OPMDevice::Read(uint32 offset) +OPMDevice::ReadPort(uint32 offset) { busdata data; @@ -71,20 +67,21 @@ OPMDevice::Read(uint32 offset) putlog(1, "STAT -> $%02x", data.Data()); break; default: - VMPANIC("corrupted offset=%d", offset); + VMPANIC("corrupted offset=%u", offset); data = 0xff; break; } // InsideOut p.135 - const busdata read_wait = busdata::Wait(19 * 40_usec); + const busdata read_wait = busdata::Wait(19 * 40_nsec); data |= read_wait; + data |= BusData::Size1; return data; } busdata -OPMDevice::Write(uint32 offset, uint32 data) +OPMDevice::WritePort(uint32 offset, uint32 data) { uint64 now = scheduler->GetVirtTime(); @@ -136,23 +133,31 @@ OPMDevice::Write(uint32 offset, uint32 d } break; default: - VMPANIC("corrupted offset=%d", offset); + VMPANIC("corrupted offset=%u", offset); break; } // InsideOut p.135 const busdata write_wait = busdata::Wait(53 * 40_nsec); - return write_wait; + busdata r = write_wait; + r |= BusData::Size1; + return r; } busdata -OPMDevice::Peek(uint32 offset) +OPMDevice::PeekPort(uint32 offset) { // XXX 未実装 return 0xff; } +bool +OPMDevice::PokePort(uint32 offset, uint32 data) +{ + return false; +} + // OPM ステータスレジスタの B (BUSY) ビット bool OPMDevice::IsBusy() const