--- nono/vm/opm.cpp 2026/04/29 17:05:28 1.1.1.8 +++ nono/vm/opm.cpp 2026/04/29 17:05:59 1.1.1.11 @@ -10,7 +10,9 @@ #include "opm.h" #include "adpcm.h" +#include "event.h" #include "fdc.h" +#include "mainbus.h" #include "mpu.h" #include "scheduler.h" @@ -29,10 +31,6 @@ OPMDevice::~OPMDevice() bool OPMDevice::Init() { - if (inherited::Init() == false) { - return false; - } - adpcm = GetADPCMDevice(); fdc = GetFDCDevice(); @@ -57,7 +55,8 @@ OPMDevice::ReadPort(uint32 offset) switch (offset) { case 0: - putlog(0, "Read $%06x (NOT IMPLEMENTED)", mpu->GetPaddr()); + putlog(0, "Read $%06x (NOT IMPLEMENTED)", + GetMainbusDevice()->GetPaddr()); data = 0; break; case 1: @@ -118,7 +117,7 @@ OPMDevice::WritePort(uint32 offset, uint // 時刻の起点は CPU 側の命令によって異なるはずだが // わからないので命令のぶんは無視しておく。 // 53 クロックのウェイトのほうは足す。 - busy_origin = now + 53 * mpu->GetClock_nsec(); + busy_origin = now + 53 * mpu->GetClock_tsec(); // busy_start のほうはとりあえず 10 クロックにしておく。 busy_start = busy_origin + 10 * clk; @@ -132,7 +131,7 @@ OPMDevice::WritePort(uint32 offset, uint break; default: putlog(0, "Write $%06x <- $%02x (NOT IMPLEMENTED)", - mpu->GetPaddr(), data); + GetMainbusDevice()->GetPaddr(), data); break; } break;