--- nono/vm/sysctlr.h 2026/04/29 17:05:21 1.1.1.8 +++ nono/vm/sysctlr.h 2026/04/29 17:05:29 1.1.1.10 @@ -12,12 +12,7 @@ #include "interrupt.h" -class LanceDevice; class MPU88xx0Device; -class NMIDevice; -class SIODevice; -class SPCDevice; -class SysClkDevice; class SysCtlrDevice : public InterruptDevice { @@ -26,39 +21,36 @@ class SysCtlrDevice : public InterruptDe // 割り込みマップ 76543210 static const uint32 IntmapNMI = 0x80000000; static const uint32 IntmapSysClk = 0x08000000; - static const uint32 IntmapXPHigh = 0x04000000; static const uint32 IntmapSIO = 0x00800000; + static const uint32 IntmapXPHigh = 0x00400000; static const uint32 IntmapLance = 0x00080000; static const uint32 IntmapSPC = 0x00008000; - static const uint32 IntmapXPLow = 0x00000800; - static const uint32 IntmapSoft3 = 0x00000080; - static const uint32 IntmapSoft2 = 0x00000040; - static const uint32 IntmapSoft1 = 0x00000020; - static const uint32 IntmapSoft0 = 0x00000010; + static const uint32 IntmapXPLow = 0x00000080; + static const uint32 IntmapSoft = 0x00000040; public: SysCtlrDevice(); - virtual ~SysCtlrDevice() override; + ~SysCtlrDevice() override; bool Init() override; void ResetHard(bool poweron) override; - uint64 Read32(uint32 addr) override; - uint64 Write32(uint32 addr, uint32 data) override; - uint64 Peek8(uint32 addr) override; + busdata Read(busaddr addr) override; + busdata Write(busaddr addr, uint32 data) override; + busdata Peek1(uint32 addr) override; + + // 割り込みマスク設定 + void WriteIntMask(uint32 n, uint32 data); // InterruptDevice インタフェース - int InterruptAcknowledge(int lv) override; + busdata InterruptAcknowledge(int lv) override; private: - // デバイスから Intmap 値を引く - uint32 GetIntmap(const Device *source) const override; - // 割り込み状態を更新 void ChangeInterrupt() override; // マスク設定レジスタの書き込み値から内部用マスクを作成 - static uint32 MakeIntMask(uint32 data, int n); + static uint32 MakeIntMask(uint32 data, uint n); DECLARE_MONITOR_CALLBACK(MonitorUpdate); @@ -73,14 +65,15 @@ class SysCtlrDevice : public InterruptDe // 現在の最高位の割り込みレベル int ipl; + + // ソフトウェア割り込みの Intmap (アサート中なら IntmapSoft) + uint32 softint; + + // ソフトウェア割り込み回数 + uint64 softint_count; } cpu[4] {}; - LanceDevice *lance {}; MPU88xx0Device *mpu88xx0 {}; - NMIDevice *nmi {}; - SIODevice *sio {}; - SPCDevice *spc {}; - SysClkDevice *sysclk {}; Monitor monitor { this }; };