--- nono/vm/crtc.h 2026/04/29 17:05:24 1.1.1.10 +++ nono/vm/crtc.h 2026/04/29 17:05:33 1.1.1.12 @@ -12,11 +12,10 @@ #include "device.h" #include "event.h" -#include "monitor.h" class MFPDevice; -class Renderer; class TVRAMDevice; +class VideoCtlrDevice; struct CRTC { @@ -81,7 +80,10 @@ struct CRTC // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ // R23 | マスクパターン | // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - // R24 | - |RC | 0 |FC |VI | + // + // 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 + // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ + // OP | - |RC | 0 |FC |VI | // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ uint16 r[24]; @@ -138,15 +140,15 @@ class CRTCDevice : public IODevice bool Init() override; void ResetHard(bool poweron) override; - busdata Read8(uint32 offset) override; - busdata Read16(uint32 offset) override; - busdata Write8(uint32 offset, uint32 data) override; - busdata Write16(uint32 offset, uint32 data) override; - busdata Peek8(uint32 offset) override; + busdata Read(busaddr addr) override; + busdata Write(busaddr addr, uint32 data) override; + busdata Peek1(uint32 offset) override; private: + static inline uint32 Decoder(uint32 addr); + // ワード読み出し - busdata Peek16(uint32 addr) const; + busdata Peek2(uint32 addr) const; // レジスタへの書き込み void SetReg(uint32 offset, uint32 data); // 動作ポートへの書き込み @@ -169,12 +171,12 @@ class CRTCDevice : public IODevice bool raster_copy {}; MFPDevice *mfp {}; - Renderer *renderer {}; TVRAMDevice *tvram {}; + VideoCtlrDevice *videoctlr {}; Event hsync_event { this }; Event vdisp_event { this }; Event raster_event { this }; - Monitor monitor { this }; + Monitor *monitor {}; };