--- nono/vm/interrupt.h 2026/04/29 17:05:24 1.1.1.7 +++ nono/vm/interrupt.h 2026/04/29 17:05:59 1.1.1.11 @@ -11,14 +11,13 @@ #pragma once #include "device.h" -#include "monitor.h" #include #include // XP からの割り込み用。 // これだけ1デバイスで2本あるので、仕方なく識別子を用意。 -#define DEVICE_XPINT_HIGH ((Device *)(intptr_t)1) -#define DEVICE_XPINT_LOW ((Device *)(intptr_t)2) +#define DEVICE_XPINT_HIGH (reinterpret_cast((intptr_t)1)) +#define DEVICE_XPINT_LOW (reinterpret_cast((intptr_t)2)) class DMACDevice; class GFPICDevice; @@ -52,7 +51,7 @@ class InterruptDevice : public IODevice public: InterruptDevice(); - InterruptDevice(int objid_); + InterruptDevice(uint objid_); ~InterruptDevice() override; // リセットで割り込みを下げるのは各割り込み送出デバイスの責任。 @@ -154,6 +153,8 @@ class InterruptDevice : public IODevice // [0] が Intmap の bit31 割り込みのカウント。 // [27] が Intmap の bit 4 割り込みのカウント。 uint64 counter[32] {}; + + Monitor *monitor {}; }; // m680x0 仮想割り込みコントローラ (共通部) @@ -170,7 +171,6 @@ class M680x0Interrupt : public Interrupt ~M680x0Interrupt() override; bool Init() override; - void ResetHard(bool poweron) override; protected: void ChangeInterrupt() override; @@ -217,7 +217,7 @@ class X68030Interrupt : public M680x0Int busdata InterruptAcknowledge(int lv) override; private: - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); DMACDevice *dmac {}; MFPDevice *mfp {}; @@ -225,8 +225,6 @@ class X68030Interrupt : public M680x0Int PEDECDevice *pedec {}; std::array net {}; SCCDevice *scc {}; - - Monitor monitor { this }; }; // LUNA-I 仮想割り込みコントローラ @@ -261,9 +259,7 @@ class LunaInterrupt : public M680x0Inter busdata InterruptAcknowledge(int lv) override; private: - DECLARE_MONITOR_CALLBACK(MonitorUpdate); - - Monitor monitor { this }; + DECLARE_MONITOR_SCREEN(MonitorScreen); }; // NEWS 仮想割り込みコントローラ @@ -299,14 +295,12 @@ class NewsInterrupt : public M680x0Inter uint8 PeekStatus() const; private: - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); SCCDevice *scc {}; - - Monitor monitor { this }; }; -// virt68k 仮想割り込みコントローラ +// virt-m68k 仮想割り込みコントローラ // // Level // 7 @@ -340,15 +334,13 @@ class Virt68kInterrupt : public M680x0In void IncMonitorHeight(); private: - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); std::array gfpic {}; - - Monitor monitor { this }; }; // LUNA-88K は sysctlr.cpp 参照。 -static inline InterruptDevice *GetInterruptDevice() { +inline InterruptDevice *GetInterruptDevice() { return Object::GetObject(OBJ_INTERRUPT); }