--- nono/vm/newsctlr.h 2026/04/29 17:05:18 1.1.1.1 +++ nono/vm/newsctlr.h 2026/04/29 17:05:43 1.1.1.5 @@ -16,11 +16,15 @@ class DipswDevice; class NewsInterrupt; +class TextScreen; class NewsCtlrDevice : public IODevice { using inherited = IODevice; + // システムタイマーの周期 + static const uint64 TIMER_PERIOD = 10_msec; + public: // LED 種別 static const uint LED_GREEN = 0x01; @@ -33,11 +37,13 @@ class NewsCtlrDevice : public IODevice bool Init() override; void ResetHard(bool poweron) override; - uint64 Read8(uint32 addr) override; - uint64 Write8(uint32 addr, uint32 data) override; - uint64 Peek8(uint32 addr) override; + busdata Read(busaddr addr) override; + busdata Write(busaddr addr, uint32 data) override; + busdata Peek1(uint32 addr) override; + + uint GetLED() const { return led; } - int GetLED() const { return led; } + void MonitorUpdateNewsCtlr(TextScreen& screen, int y); private: uint8 GetIDROM(uint32 addr) const; @@ -53,11 +59,17 @@ class NewsCtlrDevice : public IODevice // 256 x 4bit ROM (ここではデータをバイト単位で保持する) std::array oidrom {}; - int led {}; + uint led {}; // タイマー bool timer_intr {}; bool timer_enable {}; + // システムタイマーが刻んている時刻。 + uint64 stime {}; + + // システムタイマーを実時間に同期する場合 true + bool sync_rt {}; + DipswDevice *dipsw {}; Event timer_event { this };