--- nono/vm/mk48t02.cpp 2026/04/29 17:05:33 1.1.1.16 +++ nono/vm/mk48t02.cpp 2026/04/29 17:06:01 1.1.1.17 @@ -20,8 +20,8 @@ #include "bitops.h" #include "config.h" #include "mainapp.h" +#include "mainbus.h" #include "monitor.h" -#include "mpu.h" #include #include #include @@ -40,7 +40,7 @@ MK48T02Device::MK48T02Device() use_localtime = false; monitor = gMonitorManager->Regist(ID_MONITOR_MK48T02, this); - monitor->func = ToMonitorCallback(&MK48T02Device::MonitorUpdate); + monitor->SetCallback(&MK48T02Device::MonitorScreen); monitor->SetSize(40, 13); } @@ -92,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 { @@ -131,6 +131,7 @@ MK48T02Device::Init() file.SetDispname(dispname); mem = file.OpenCreate(2048); if (mem == NULL) { + // エラーメッセージは表示済み。 return false; } @@ -166,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; @@ -176,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: // コントロール @@ -237,7 +238,7 @@ MK48T02Device::PokePort(uint32 offset, u } void -MK48T02Device::MonitorUpdate(Monitor *, TextScreen& screen) +MK48T02Device::MonitorScreen(Monitor *, TextScreen& screen) { uint32 addr; uint32 v;