--- nono/vm/scc.h 2026/04/29 17:05:17 1.1.1.10 +++ nono/vm/scc.h 2026/04/29 17:05:59 1.1.1.13 @@ -10,7 +10,6 @@ #pragma once -#include "device.h" #include "mpscc.h" class Keyboard; @@ -21,28 +20,27 @@ class SCCDevice : public MPSCCDevice public: SCCDevice(); - virtual ~SCCDevice() override; + ~SCCDevice() override; bool Init() override; void ResetHard(bool poweron) override; // 割り込みアクノリッジ - int InterruptAcknowledge(); + busdata InterruptAcknowledge(); protected: // BusIO インタフェース - static const uint32 NPORT = 4; - uint64 Read(uint32 offset); - uint64 Write(uint32 offset, uint32 data); - uint64 Peek(uint32 offset); + busdata ReadPort(uint32 offset); + busdata WritePort(uint32 offset, uint32 data); + busdata PeekPort(uint32 offset); void Tx(int ch, uint32 data) override; uint GetHighestInt() const override; private: // 指定のレジスタ名を返す - const char *CRName(const MPSCCChan&, int n) const override; - const char *SRName(const MPSCCChan&, int n) const override; + const char *CRName(const MPSCCChan&, uint n) const override; + const char *SRName(const MPSCCChan&, uint n) const override; // WR, RR のほうが通りがいいので結局用意する const char *WRName(const MPSCCChan& chan, int n) const { @@ -84,11 +82,11 @@ class SCCDevice : public MPSCCDevice void SetXC(MPSCCChan&); - DECLARE_MONITOR_CALLBACK(MonitorUpdate); - void MonitorUpdateCh(TextScreen&, int ch, int xbase, int ybase); + DECLARE_MONITOR_SCREEN(MonitorScreen); + void MonitorScreenCh(TextScreen&, int ch, int xbase, int ybase); - // PCLK (入力クロック) の時間表現 - uint64 pclk_ns {}; + // PCLK (入力クロック) の時間表現 [tsec] + uint64 pclk_tsec {}; Keyboard *keyboard {}; @@ -96,6 +94,6 @@ class SCCDevice : public MPSCCDevice static const char * const rrnames[32]; }; -static inline SCCDevice *GetSCCDevice() { +inline SCCDevice *GetSCCDevice() { return Object::GetObject(OBJ_MPSCC); }