--- nono/vm/sysclk.h 2026/04/29 17:04:28 1.1 +++ nono/vm/sysclk.h 2026/04/29 17:04:42 1.1.1.4 @@ -1,6 +1,7 @@ // // nono -// Copyright (C) 2018 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #pragma once @@ -11,22 +12,30 @@ class SysClkDevice : public IODevice { - typedef IODevice inherited; + using inherited = IODevice; public: SysClkDevice(); - virtual ~SysClkDevice(); + ~SysClkDevice() override; - virtual bool PowerOn(); + bool Init() override; + bool PowerOn() override; - virtual uint64 Read8(uint32); - virtual uint64 Write8(uint32, uint32); + protected: + // BusIO インタフェース + static const uint32 NPORT = 1; + uint64 Read(uint32); + uint64 Write(uint32, uint32); + uint64 Peek(uint32); private: // イベントコールバック - void Callback(int); + void Callback(Event& ev); + + // 割り込み状態をレジスタイメージにして返す + uint8 GetInt() const; // システムクロック割り込み有りなら true。 - bool sysint = false; + bool sysint {}; // 割り込みイベント Event event {};