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

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
1.1.1.7 ! root        7: //
        !             8: // ビデオコントローラ
        !             9: //
        !            10: 
1.1       root       11: #pragma once
                     12: 
                     13: #include "device.h"
1.1.1.7 ! root       14: #include "color.h"
1.1       root       15: 
1.1.1.6   root       16: class VideoCtlrDevice : public IODevice
1.1       root       17: {
                     18:        using inherited = IODevice;
1.1.1.7 ! root       19: 
1.1       root       20:        static const int baseaddr = 0xe82000;
                     21: 
                     22:        struct videoctlr {
                     23:                uint16 r0;
                     24:                uint16 r1;
                     25:                uint16 r2;
                     26:        };
                     27: 
                     28:  public:
                     29:        VideoCtlrDevice();
1.1.1.4   root       30:        virtual ~VideoCtlrDevice() override;
1.1       root       31: 
1.1.1.7 ! root       32:        void ResetHard(bool poweron) override;
1.1.1.3   root       33: 
1.1.1.2   root       34:        // 加工済みテキストパレットの先頭アドレスを取得
                     35:        // レンダラとかからの参照用
1.1.1.7 ! root       36:        const ColorXBGR *GetHostPalette() const { return cooked_palette; }
1.1       root       37: 
                     38:  protected:
                     39:        // BusIO インタフェース
                     40:        static const uint NPORT = 4096;
1.1.1.5   root       41:        uint64 Read(uint32 offset);
                     42:        uint64 Write(uint32 offset, uint32 data);
                     43:        uint64 Peek(uint32 offset);
1.1       root       44: 
                     45:  private:
                     46:        void SetR0(uint32 data);
                     47:        void SetR1(uint32 data);
                     48:        void SetR2(uint32 data);
1.1.1.2   root       49:        void MakePalette();
1.1       root       50: 
                     51:        struct videoctlr videoctlr {};
                     52:        union {
                     53:                uint8 b[1024];
                     54:                uint16 w[512];
                     55:        } palette {};
1.1.1.2   root       56: 
1.1.1.7 ! root       57:        // ホスト形式のテキストパレット (レンダラ用に加工したもの)
        !            58:        ColorXBGR cooked_palette[16] {};
1.1       root       59: };
                     60: 
1.1.1.7 ! root       61: extern VideoCtlrDevice *gVideoCtlr;

unix.superglobalmegacorp.com

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