--- nono/vm/mainbus.cpp 2026/04/29 17:05:32 1.1.1.5 +++ nono/vm/mainbus.cpp 2026/04/29 17:05:59 1.1.1.8 @@ -17,7 +17,7 @@ // ResetByMPU o o o *1 x (*1:どっちでもいい) // // Access Map o o o x x -// HV access o o o o ? +// HV access o o o x ? // Peek4 o o o x x // Singleton o o o x x // @@ -57,7 +57,6 @@ #include "mainbus.h" #include "monitor.h" -#include "syncer.h" // // メインバスの素質を持つ基本クラス @@ -91,9 +90,6 @@ MainbusBaseDevice::SwitchBootPage(bool i } else { putlog(1, "SwitchBootPage RAM (Normal)"); } - - // 同期モード指示 - GetSyncer()->RequestBootPageMode(isrom); } // モニタ表示用にデバイス名を整形。 @@ -127,8 +123,7 @@ MainbusDevice::MainbusDevice(uint objid_ : inherited(objid_) { accstat_monitor = gMonitorManager->Regist(ID_MONITOR_ACCSTAT, this); - accstat_monitor->func = - ToMonitorCallback(&MainbusDevice::MonitorUpdateAccStat); + accstat_monitor->SetCallback(&MainbusDevice::MonitorScreenAccStat); // 表示行数が機種ごとに異なるので継承側でセットしている。 // 通常は 32bit 空間全体 (そうでない機種はコンストラクタで上書きする) @@ -145,10 +140,6 @@ MainbusDevice::~MainbusDevice() bool MainbusDevice::Init() { - if (inherited::Init() == false) { - return false; - } - // アクセス状況の表示用配列。 accstat_rw.resize(AccStat::MAINLEN >> (32 - accstat_bitlen)); @@ -253,14 +244,12 @@ MainbusDevice::HVWrite4(uint32 paddr, ui return HVWriteN(addr, data); } +// 連続する4バイトを Peek する。(ミスアライン可) uint64 MainbusDevice::Peek4(uint32 addr) { uint64 data; - if (__predict_false((addr & 3) != 0)) - VMPANIC("unaligned access $%08x", addr); - data = Peek1(addr++) << 24; data |= Peek1(addr++) << 16; data |= Peek1(addr++) << 8; @@ -269,7 +258,7 @@ MainbusDevice::Peek4(uint32 addr) } void -MainbusDevice::MonitorUpdateAccStat(Monitor *, TextScreen& screen) +MainbusDevice::MonitorScreenAccStat(Monitor *, TextScreen& screen) { std::array buf; @@ -358,7 +347,7 @@ Mainbus24Device::Mainbus24Device() : MainbusDevice(OBJ_MAINBUS) { monitor = gMonitorManager->Regist(ID_MONITOR_MAINBUS, this); - monitor->func = ToMonitorCallback(&Mainbus24Device::MonitorUpdate); + monitor->SetCallback(&Mainbus24Device::MonitorScreen); monitor->SetSize(75, 33); } @@ -412,6 +401,7 @@ busdata Mainbus24Device::Read(busaddr addr) { uint32 pa = addr.Addr(); + lastaddr = pa; accstat_read[pa >> AccStat::SHIFT] = AccStat::READ; IODevice *dev = Decoder(pa); return dev->Read(addr); @@ -421,6 +411,7 @@ busdata Mainbus24Device::Write(busaddr addr, uint32 data) { uint32 pa = addr.Addr(); + lastaddr = pa; accstat_write[pa >> AccStat::SHIFT] = AccStat::WRITE; IODevice *dev = Decoder(pa); return dev->Write(addr, data); @@ -430,6 +421,7 @@ busdata Mainbus24Device::ReadBurst16(busaddr addr, uint32 *dst) { uint32 pa = addr.Addr(); + lastaddr = pa; // 開始アドレスしか残らない… IODevice *dev = Decoder(pa); busdata r = dev->ReadBurst16(addr, dst); if (__predict_true(r.IsBusErr() == false)) { @@ -442,6 +434,7 @@ busdata Mainbus24Device::WriteBurst16(busaddr addr, const uint32 *src) { uint32 pa = addr.Addr(); + lastaddr = pa; // 開始アドレスしか残らない… IODevice *dev = Decoder(pa); busdata r = dev->WriteBurst16(addr, src); if (__predict_true(r.IsBusErr() == false)) { @@ -465,7 +458,7 @@ Mainbus24Device::Poke1(uint32 addr, uint } void -Mainbus24Device::MonitorUpdate(Monitor *, TextScreen& screen) +Mainbus24Device::MonitorScreen(Monitor *, TextScreen& screen) { screen.Clear();