--- nono/vm/pedec.cpp 2026/04/29 17:05:14 1.1.1.6 +++ nono/vm/pedec.cpp 2026/04/29 17:05:17 1.1.1.7 @@ -21,28 +21,37 @@ // +--| PEDECDevice | (X68030 の Lv1 担当コントローラ) // | +-------------+ // | -// +-- SysCtlrDevice (LUNA88K の割り込みコントローラ) +// +-- SysCtlrDevice (LUNA-88K の割り込みコントローラ) #include "pedec.h" #include "fdc.h" #include "fdd.h" #include "spc.h" -// グローバル参照用 -PEDECDevice *gPEDEC; - // コンストラクタ PEDECDevice::PEDECDevice() - : inherited("PEDEC") + : inherited(OBJ_PEDEC) { - devaddr = baseaddr; - devlen = 0x2000; } // デストラクタ PEDECDevice::~PEDECDevice() { - gPEDEC = NULL; +} + +// 初期化 +bool +PEDECDevice::Init() +{ + if (inherited::Init() == false) { + return false; + } + + fdc = GetFDCDevice(); + interrupt = GetInterruptDevice(); + spc = GetSPCDevice(); + + return true; } // リセット @@ -132,12 +141,11 @@ PEDECDevice::MonitorUpdate(TextScreen& s for (int i = 0; i < countof(table); i++) { uint32 map = table[i].map; int clz = __builtin_clz(map); - screen.Puts(3, y, TA::OnOff(intmap & map), table[i].name); - screen.Print(8, y, "%11" PRIu64, counter[clz]); - + screen.Puts(4, y, TA::OnOff(intmap & map), table[i].name); if (intr_level >= 1 || (intmap_enabled & map) == 0) { - screen.Puts(21, y, "Mask"); + screen.Puts(10, y, "Mask"); } + screen.Print(14, y, "%26s", format_number(counter[clz]).c_str()); y++; } } @@ -173,7 +181,7 @@ PEDECDevice::ChangeInterrupt() #endif uint32 stat = (intmap & intmap_enabled); - gInterrupt->ChangeINT(this, stat); + interrupt->ChangeINT(this, stat); } // 割り込みアクノリッジ @@ -202,10 +210,10 @@ PEDECDevice::InterruptAcknowledge(int lv uint32 PEDECDevice::GetIntmap(Device *source) const { - if (__predict_true(source == gSPC)) { + if (__predict_true(source == spc)) { return IntmapSPC; } - if (__predict_true(source == gFDC)) { + if (__predict_true(source == fdc)) { return IntmapFDC; } if (dynamic_cast(source)) {