--- nono/vm/mainbus.h 2026/04/29 17:05:50 1.1.1.6 +++ nono/vm/mainbus.h 2026/04/29 17:06:00 1.1.1.7 @@ -138,8 +138,17 @@ class MainbusDevice : public MainbusBase uint64 Peek4(uint32 addr); + // 直近のアクセスアドレスを返す。 + // アクセス中のデバイスからは、自分へのアクセスとなったバスマスタでの + // 物理アドレス。 + uint32 GetPaddr() const { return lastaddr; } + protected: - DECLARE_MONITOR_CALLBACK(MonitorUpdateAccStat); + DECLARE_MONITOR_SCREEN(MonitorScreenAccStat); + + // 直近の (バスマスタからの) アクセスアドレス。 + // HV* アクセスでは更新しない。 + uint32 lastaddr; // アクセス状況は 32bit 空間全域を 2048 * 2MB ずつ。 // (NEWS は読み出し時にマージする) @@ -177,7 +186,7 @@ class Mainbus24Device : public MainbusDe bool Poke1(uint32 addr, uint32 data) override; protected: - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); void InitAccStat(); @@ -189,6 +198,6 @@ class Mainbus24Device : public MainbusDe inline IODevice *Decoder(uint32 addr) const; }; -static inline MainbusDevice *GetMainbusDevice() { +inline MainbusDevice *GetMainbusDevice() { return Object::GetObject(OBJ_MAINBUS); }