--- nono/vm/pio.h 2026/04/29 17:04:50 1.1.1.6 +++ nono/vm/pio.h 2026/04/29 17:04:55 1.1.1.7 @@ -12,13 +12,12 @@ // Intel 82C55 の仕様書にはコントロールポートからの読み出しは明記してある。 // NEC uPD8255 の仕様書にはコントロールポートからの読み出しについての記載が // ない (禁止とも書いてない)。 -class i8255Device - : public IODevice +class i8255Device : public IODevice { using inherited = IODevice; public: - i8255Device(); + i8255Device(const std::string& objname_); virtual ~i8255Device() override; void ResetHard() override; @@ -54,8 +53,7 @@ class i8255Device }; -class PPIDevice - : public i8255Device +class PPIDevice : public i8255Device { using inherited = i8255Device; private: @@ -73,8 +71,7 @@ class PPIDevice uint64 Peek(uint32 offset); }; -class PIO0Device - : public i8255Device +class PIO0Device : public i8255Device { using inherited = i8255Device; public: @@ -83,8 +80,6 @@ class PIO0Device bool Init() override; - void MonitorUpdate(TextScreen&) override; - // DIP-SW1 の状態を取得 (ROM エミュレーション用) // // b7 b6 b5 b4 b3 b2 b1 b0 @@ -107,6 +102,8 @@ class PIO0Device uint32 GetPC() const; void SetPC(int, int) override; + DECLARE_MONITOR_CALLBACK(MonitorUpdate); + bool dipsw1[8] {}; bool dipsw2[8] {}; bool int1rq {}; // $01 INT1 割り込み要求 @@ -115,10 +112,11 @@ class PIO0Device bool int5en {}; // $10 INT5 割り込み許可 bool parity {}; // $40 パリティ有効/無効 bool xp_reset {}; // $80 XP リセット + + Monitor monitor { this }; }; -class PIO1Device - : public i8255Device +class PIO1Device : public i8255Device { using inherited = i8255Device; public: @@ -140,7 +138,9 @@ class PIO1Device bool power {}; // パワーダウン (false で電源オフ指示) bool xp_intreq {}; // XP 割り込み要求。あり(true)なら %0 - Event poffevent {}; // 電源オフイベント + + // 電源オフイベント + Event poffevent { this }; }; extern std::unique_ptr gPPI;