--- nono/vm/newsctlr.h 2026/04/29 17:05:29 1.1.1.4 +++ nono/vm/newsctlr.h 2026/04/29 17:06:00 1.1.1.7 @@ -11,7 +11,6 @@ #pragma once #include "device.h" -#include "event.h" #include class DipswDevice; @@ -22,6 +21,9 @@ class NewsCtlrDevice : public IODevice { using inherited = IODevice; + // システムタイマーの周期 + static const uint64 TIMER_PERIOD = 10_msec; + public: // LED 種別 static const uint LED_GREEN = 0x01; @@ -40,14 +42,14 @@ class NewsCtlrDevice : public IODevice uint GetLED() const { return led; } - void MonitorUpdateNewsCtlr(TextScreen& screen, int y); + void MonitorScreenNewsCtlr(TextScreen& screen, int y); private: uint8 GetIDROM(uint32 addr) const; uint8 GetDIPSW() const; void WriteLED(uint32 data); void WriteTimer(uint32 data); - void TimerCallback(Event&); + void TimerCallback(Event *); void ChangeInterrupt(); // 割り込みコントローラ @@ -61,11 +63,17 @@ class NewsCtlrDevice : public IODevice bool timer_intr {}; bool timer_enable {}; + // システムタイマーが刻んている時刻。 + uint64 stime {}; + + // システムタイマーを実時間に同期する場合 true + bool sync_rt {}; + DipswDevice *dipsw {}; - Event timer_event { this }; + Event *timer_event {}; }; -static inline NewsCtlrDevice *GetNewsCtlrDevice() { +inline NewsCtlrDevice *GetNewsCtlrDevice() { return Object::GetObject(OBJ_NEWSCTLR); }