Annotation of nono/vm/videoctlr.h, revision 1.1.1.1

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: #pragma once
                      8: 
                      9: #include "device.h"
                     10: 
                     11: class VideoCtlrDevice
                     12:        : public IODevice
                     13: {
                     14:        using inherited = IODevice;
                     15:  private:
                     16:        static const int baseaddr = 0xe82000;
                     17: 
                     18:        struct videoctlr {
                     19:                uint16 r0;
                     20:                uint16 r1;
                     21:                uint16 r2;
                     22:        };
                     23: 
                     24:  public:
                     25:        VideoCtlrDevice();
                     26:        ~VideoCtlrDevice() override;
                     27: 
                     28:        // パレットのバッファアドレスを取得
                     29:        // レンダラとかからの参照用?
                     30:        const uint16 *GetPalette() const { return &palette.w[0]; }
                     31: 
                     32:  protected:
                     33:        // BusIO インタフェース
                     34:        static const uint NPORT = 4096;
                     35:        uint64 Read(uint32 addr);
                     36:        uint64 Write(uint32 addr, uint32 data);
                     37:        uint64 Peek(uint32 addr);
                     38: 
                     39:  private:
                     40:        void SetR0(uint32 data);
                     41:        void SetR1(uint32 data);
                     42:        void SetR2(uint32 data);
                     43: 
                     44:        struct videoctlr videoctlr {};
                     45:        union {
                     46:                uint8 b[1024];
                     47:                uint16 w[512];
                     48:        } palette {};
                     49: };
                     50: 
                     51: extern std::unique_ptr<VideoCtlrDevice> gVideoCtlr;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.