--- nono/vm/sysport.h 2026/04/29 17:04:50 1.1.1.6 +++ nono/vm/sysport.h 2026/04/29 17:05:14 1.1.1.10 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// システムポート +// + #pragma once #include "device.h" @@ -22,20 +26,26 @@ struct SYSPORT int contrast; int rom_wait; // 設定値。ウェイトにする時には +2 する int ram_wait; // 設定値。 + bool key_ctrl; + uint pwoff_count; }; -class SysportDevice - : public IODevice +class SysportDevice : public IODevice { using inherited = IODevice; - private: + static const uint32 baseaddr = 0xe8e000; public: SysportDevice(); virtual ~SysportDevice() override; - void ResetHard() override; + void ResetHard(bool poweron) override; + + // KEYCTRL の状態を取得する + bool GetKeyCtrl() const { + return sysport.key_ctrl; + } protected: // BusIO インタフェース @@ -48,4 +58,4 @@ class SysportDevice struct SYSPORT sysport {}; }; -extern std::unique_ptr gSysport; +extern SysportDevice *gSysport;