--- nono/vm/sysctlr.h 2026/04/29 17:04:45 1.1.1.3 +++ nono/vm/sysctlr.h 2026/04/29 17:05:10 1.1.1.6 @@ -4,15 +4,15 @@ // Licensed under nono-license.txt // +// // LUNA88K のシステムコントローラのような何か +// #pragma once -#include "device.h" #include "interrupt.h" -class SysCtlrDevice - : public InterruptDevice +class SysCtlrDevice : public InterruptDevice { using inherited = InterruptDevice; @@ -31,36 +31,26 @@ class SysCtlrDevice SysCtlrDevice(); virtual ~SysCtlrDevice() override; - void ResetHard() override; - - void MonitorUpdate(TextScreen&) override; + void ResetHard(bool poweron) override; uint64 Read32(uint32 addr) override; uint64 Write32(uint32 addr, uint32 data) override; uint64 Peek8(uint32 addr) override; // InterruptDevice インタフェース - void AssertINT(Device *soruce) override; - void NegateINT(Device *source) override; int InterruptAcknowledge(int lv) override; private: // デバイスから Intmap 値を引く - uint32 GetIntmap(Device *source) const; + uint32 GetIntmap(Device *source) const override; // 割り込み状態を更新 - void ChangeInterrupt(); + void ChangeInterrupt() override; // マスク設定レジスタの書き込み値から内部用マスクを作成 static uint32 MakeIntMask(uint32 data, int n); - // 割り込みマップ (M680x0Interrupt::intmap と同じ構造) - uint32 intmap {}; - - // 割り込み回数 (アサートのエッジでカウントアップする) - // [0] が Intmap の bit31 割り込みのカウント。 - // [27] が Intmap の bit 4 割り込みのカウント。 - uint32 counter[28] {}; + DECLARE_MONITOR_CALLBACK(MonitorUpdate); // CPU ごとのパラメータ struct { @@ -74,6 +64,8 @@ class SysCtlrDevice // 現在の最高位の割り込みレベル int ipl; } cpu[4] {}; + + Monitor monitor { this }; }; // グローバルインスタンスはここではなく gInterrupt を使用する