--- nono/vm/interrupt.cpp 2026/04/29 17:04:47 1.1.1.2 +++ nono/vm/interrupt.cpp 2026/04/29 17:04:55 1.1.1.4 @@ -38,11 +38,16 @@ std::unique_ptr gInterr // 仮想割り込みコントローラ (共通部) // -// コンストラクタ +// コンストラクタ(オブジェクト名指定あり) +InterruptDevice::InterruptDevice(const std::string& objname_) + : inherited(objname_) +{ +} + +// コンストラクタ(オブジェクト名指定なし) InterruptDevice::InterruptDevice() + : InterruptDevice("Interrupt") { - logname = "interrupt"; - devname = "Interrupt"; } // デストラクタ @@ -108,7 +113,7 @@ M680x0Interrupt::AssertINT(Device *sourc } } -// 小デバイスが割り込み信号線をネゲートした (m680x0 共通) +// 子デバイスが割り込み信号線をネゲートした (m680x0 共通) void M680x0Interrupt::NegateINT(Device *source) { @@ -134,7 +139,9 @@ M680x0Interrupt::NegateINT(Device *sourc // コンストラクタ X68030Interrupt::X68030Interrupt() { - monitor_size = nnSize(24, 11); + monitor.func = (MonitorCallback_t)&X68030Interrupt::MonitorUpdate; + monitor.SetSize(24, 11); + monitor.Regist(ID_MONITOR_INTERRUPT); } // デストラクタ @@ -189,7 +196,7 @@ X68030Interrupt::InterruptAcknowledge(in } void -X68030Interrupt::MonitorUpdate(TextScreen& monitor) +X68030Interrupt::MonitorUpdate(Monitor *, TextScreen& screen) { int y; struct { @@ -214,19 +221,19 @@ X68030Interrupt::MonitorUpdate(TextScree // PEDEC 分も一緒に表示したい uint32 pintr = gPEDEC->GetInt(); - monitor.Clear(); + screen.Clear(); y = 0; - monitor.Print(0, y++, "Lv Device Count IM=%d", intr_level); + screen.Print(0, y++, "Lv Device Count IM=%d", intr_level); for (int i = 0; i < countof(table); i++) { uint32 map = table[i].map; int clz = __builtin_clz(map); int lv = (31 - clz) / 4; - monitor.Print(0, y, "%d", lv); - monitor.Print(2, y, TA::OnOff(intmap & map), "%s", table[i].name); - monitor.Print(8, y, "%10u", counter[clz]); + screen.Print(0, y, "%d", lv); + screen.Print(2, y, TA::OnOff(intmap & map), "%s", table[i].name); + screen.Print(8, y, "%10u", counter[clz]); if (lv <= intr_level) { - monitor.Puts(20, y, "Mask"); + screen.Puts(20, y, "Mask"); } y++; } @@ -235,10 +242,10 @@ X68030Interrupt::MonitorUpdate(TextScree uint32 pmask = pintr >> 16; for (int i = 0; i < countof(tablePEDEC); i++) { uint32 map = tablePEDEC[i].map; - monitor.Puts(3, y, TA::OnOff(pintr & map), tablePEDEC[i].name); + screen.Puts(3, y, TA::OnOff(pintr & map), tablePEDEC[i].name); // XXX カウンタはまだない if (intr_level >= 1 || (pmask & map) == 0) { - monitor.Puts(20, y, "Mask"); + screen.Puts(20, y, "Mask"); } y++; } @@ -251,7 +258,9 @@ X68030Interrupt::MonitorUpdate(TextScree // コンストラクタ LunaInterrupt::LunaInterrupt() { - monitor_size = nnSize(24, 5); + monitor.func = (MonitorCallback_t)&LunaInterrupt::MonitorUpdate; + monitor.SetSize(24, 5); + monitor.Regist(ID_MONITOR_INTERRUPT); } // デストラクタ @@ -288,7 +297,7 @@ LunaInterrupt::InterruptAcknowledge(int } void -LunaInterrupt::MonitorUpdate(TextScreen& monitor) +LunaInterrupt::MonitorUpdate(Monitor *, TextScreen& screen) { int y; struct { @@ -304,19 +313,19 @@ LunaInterrupt::MonitorUpdate(TextScreen& // CPU の割り込み可否は本当は関係ないけど、便宜的に一緒に表示したい uint intr_level = gMPU680x0->GetCPU()->reg.intr_level; - monitor.Clear(); + screen.Clear(); y = 0; - monitor.Print(0, y++, "Lv Device Count IM=%d", intr_level); + screen.Print(0, y++, "Lv Device Count IM=%d", intr_level); for (int i = 0; i < countof(table); i++) { uint32 map = table[i].map; int clz = __builtin_clz(map); int lv = (31 - clz) / 4; - monitor.Print(0, y, "%d", lv); - monitor.Print(2, y, TA::OnOff(intmap & map), "%s", table[i].name); - monitor.Print(8, y, "%10u", counter[clz]); + screen.Print(0, y, "%d", lv); + screen.Print(2, y, TA::OnOff(intmap & map), "%s", table[i].name); + screen.Print(8, y, "%10u", counter[clz]); if (lv <= intr_level) { - monitor.Puts(20, y, "Mask"); + screen.Puts(20, y, "Mask"); } y++; }