--- nono/vm/pedec.h 2026/04/29 17:05:06 1.1.1.5 +++ nono/vm/pedec.h 2026/04/29 17:05:20 1.1.1.8 @@ -4,15 +4,22 @@ // Licensed under nono-license.txt // +// +// PEDEC +// + #pragma once #include "device.h" #include "interrupt.h" +class FDCDevice; +class SPCDevice; + class PEDECDevice : public InterruptDevice { using inherited = InterruptDevice; - private: + static const int baseaddr = 0xe9c000; public: @@ -31,7 +38,8 @@ class PEDECDevice : public InterruptDevi PEDECDevice(); virtual ~PEDECDevice() override; - void ResetHard() override; + bool Init() override; + void ResetHard(bool poweron) override; // InterruptDevice インタフェース int InterruptAcknowledge(int lv) override; @@ -47,7 +55,7 @@ class PEDECDevice : public InterruptDevi uint64 Peek(uint32 offset); private: - uint32 GetIntmap(Device *source) const override; + uint32 GetIntmap(const Device *source) const override; // 割り込みステータスレジスタの値を取得 uint32 GetStat() const; @@ -57,6 +65,12 @@ class PEDECDevice : public InterruptDevi uint32 intmap_enabled {}; uint8 vector {}; + + FDCDevice *fdc {}; + InterruptDevice *interrupt {}; + SPCDevice *spc {}; }; -extern std::unique_ptr gPEDEC; +static inline PEDECDevice *GetPEDECDevice() { + return Object::GetObject(OBJ_PEDEC); +}