--- nono/vm/pedec.cpp 2026/04/29 17:05:06 1.1.1.4 +++ nono/vm/pedec.cpp 2026/04/29 17:05:10 1.1.1.5 @@ -4,12 +4,33 @@ // Licensed under nono-license.txt // +// +// PEDEC +// + +// IODevice +// | +// +-- InterruptDevice (割り込みコントローラの共通部) +// | +// +-- M680x0Interrupt (m68k 割り込みコントローラの共通部) +// | | +// | +-- X68030Interrupt (X68030 の割り込みコントローラ) +// | +-- LunaInterrupt (LUNA-I の割り込みコントローラ) +// | +// | +-------------+ +// +--| PEDECDevice | (X68030 の Lv1 担当コントローラ) +// | +-------------+ +// | +// +-- SysCtlrDevice (LUNA88K の割り込みコントローラ) + #include "pedec.h" #include "fdc.h" #include "spc.h" -std::unique_ptr gPEDEC; +// グローバル参照用 +PEDECDevice *gPEDEC; +// コンストラクタ PEDECDevice::PEDECDevice() : inherited("PEDEC") { @@ -17,14 +38,17 @@ PEDECDevice::PEDECDevice() devlen = 0x2000; } +// デストラクタ PEDECDevice::~PEDECDevice() { + gPEDEC = NULL; } +// リセット void -PEDECDevice::ResetHard() +PEDECDevice::ResetHard(bool poweron) { - inherited::ResetHard(); + inherited::ResetHard(poweron); intmap_enabled = IntmapSPC; // XXX vector @@ -167,7 +191,7 @@ PEDECDevice::InterruptAcknowledge(int lv if ((stat & IntmapFDC)) { return vector + 0; } else { - PANIC("Unknown interrupt acknowledge"); + VMPANIC("Unknown interrupt acknowledge"); } } @@ -175,11 +199,11 @@ PEDECDevice::InterruptAcknowledge(int lv uint32 PEDECDevice::GetIntmap(Device *source) const { - if (__predict_true(source == gSPC.get())) { + if (__predict_true(source == gSPC)) { return IntmapSPC; } - if (__predict_true(source == gFDC.get())) { + if (__predict_true(source == gFDC)) { return IntmapFDC; } - PANIC("Unsupported interrupt device"); + VMPANIC("Unsupported interrupt device"); }