--- nono/vm/mk48t02.cpp 2026/04/29 17:05:29 1.1.1.15 +++ nono/vm/mk48t02.cpp 2026/04/29 17:06:01 1.1.1.17 @@ -20,7 +20,8 @@ #include "bitops.h" #include "config.h" #include "mainapp.h" -#include "mpu.h" +#include "mainbus.h" +#include "monitor.h" #include #include #include @@ -38,9 +39,9 @@ MK48T02Device::MK48T02Device() // 今の所 UTC として使うケースだけのようだ。 use_localtime = false; - monitor.func = ToMonitorCallback(&MK48T02Device::MonitorUpdate); - monitor.SetSize(40, 13); - monitor.Regist(ID_MONITOR_MK48T02); + monitor = gMonitorManager->Regist(ID_MONITOR_MK48T02, this); + monitor->SetCallback(&MK48T02Device::MonitorScreen); + monitor->SetSize(40, 13); } // デストラクタ @@ -91,7 +92,7 @@ MK48T02Device::Init() // たぶんこのバグはもう修正されることはないだろうから、こちらで補正する // スイッチを用意した。 if (gMainApp.Has(VMCap::LUNA)) { - if (gConfig->Find("luna-adjust-misused-epoch").AsInt()) { + if (gConfig->Find("luna-adjust-misused-epoch").AsBool()) { // エポック年のうるう年カウンタ相当を補正項として持つ adjust_leap = year_epoch % 4; } else { @@ -130,6 +131,7 @@ MK48T02Device::Init() file.SetDispname(dispname); mem = file.OpenCreate(2048); if (mem == NULL) { + // エラーメッセージは表示済み。 return false; } @@ -165,7 +167,7 @@ MK48T02Device::ReadPort(uint32 offset) busdata data; data = mem[offset]; - putlog(3, "$%08x -> $%02x", mpu->GetPaddr(), data.Data()); + putlog(3, "$%08x -> $%02x", GetMainbusDevice()->GetPaddr(), data.Data()); // XXX wait? data |= BusData::Size1; @@ -175,7 +177,7 @@ MK48T02Device::ReadPort(uint32 offset) busdata MK48T02Device::WritePort(uint32 offset, uint32 data) { - putlog(3, "$%08x <- $%02x", mpu->GetPaddr(), data); + putlog(3, "$%08x <- $%02x", GetMainbusDevice()->GetPaddr(), data); switch (offset - 2040) { case 0: // コントロール @@ -236,7 +238,7 @@ MK48T02Device::PokePort(uint32 offset, u } void -MK48T02Device::MonitorUpdate(Monitor *, TextScreen& screen) +MK48T02Device::MonitorScreen(Monitor *, TextScreen& screen) { uint32 addr; uint32 v;