--- nono/vm/pio.h 2026/04/29 17:04:32 1.1 +++ nono/vm/pio.h 2026/04/29 17:04:45 1.1.1.5 @@ -1,6 +1,7 @@ // // nono -// Copyright (C) 2017 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #pragma once @@ -14,11 +15,13 @@ class i8255Device : public IODevice { - typedef IODevice inherited; + using inherited = IODevice; public: i8255Device(); - virtual ~i8255Device(); + virtual ~i8255Device() override; + + void ResetHard() override; protected: // コントロールポートの読み出し @@ -54,13 +57,13 @@ class i8255Device class PPIDevice : public i8255Device { - typedef i8255Device inherited; + using inherited = i8255Device; private: static const int baseaddr = 0xe9a000; public: PPIDevice(); - virtual ~PPIDevice(); + virtual ~PPIDevice() override; protected: // BusIO インタフェース @@ -73,12 +76,14 @@ class PPIDevice class PIO0Device : public i8255Device { - typedef i8255Device inherited; + using inherited = i8255Device; public: PIO0Device(); - virtual ~PIO0Device(); + virtual ~PIO0Device() override; + + bool Init() override; - virtual bool Init(); + void MonitorUpdate(TextScreen&) override; // DIP-SW1 の状態を取得 (ROM エミュレーション用) // @@ -100,25 +105,27 @@ class PIO0Device uint32 GetPA() const; uint32 GetPB() const; uint32 GetPC() const; - virtual void SetPC(int, int); + void SetPC(int, int) override; bool dipsw1[8] {}; bool dipsw2[8] {}; - bool int1rq = false; // $01 INT1 割り込み要求 - bool int1en = false; // $04 INT1 割り込み許可 - bool int5rq = false; // $08 INT5 割り込み要求 - bool int5en = false; // $10 INT5 割り込み許可 - bool parity = false; // $40 パリティ有効/無効 - bool xp_reset = false; // $80 XP リセット + bool int1rq {}; // $01 INT1 割り込み要求 + bool int1en {}; // $04 INT1 割り込み許可 + bool int5rq {}; // $08 INT5 割り込み要求 + bool int5en {}; // $10 INT5 割り込み許可 + bool parity {}; // $40 パリティ有効/無効 + bool xp_reset {}; // $80 XP リセット }; class PIO1Device : public i8255Device { - typedef i8255Device inherited; + using inherited = i8255Device; public: PIO1Device(); - virtual ~PIO1Device(); + virtual ~PIO1Device() override; + + void ResetHard() override; protected: // BusIO インタフェース @@ -128,11 +135,11 @@ class PIO1Device uint64 Peek(uint32 addr); private: - virtual void SetPC(int, int); - void PowerOffCallback(int); + void SetPC(int, int) override; + void PowerOffCallback(Event& ev); - bool power = false; // パワーダウン (false で電源オフ指示) - bool xp_intreq = false; // XP 割り込み要求。あり(true)なら %0 + bool power {}; // パワーダウン (false で電源オフ指示) + bool xp_intreq {}; // XP 割り込み要求。あり(true)なら %0 Event poffevent {}; // 電源オフイベント };