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

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: 
1.1.1.6 ! root       11: class VideoCtlrDevice : public IODevice
1.1       root       12: {
                     13:        using inherited = IODevice;
                     14:  private:
                     15:        static const int baseaddr = 0xe82000;
                     16: 
                     17:        struct videoctlr {
                     18:                uint16 r0;
                     19:                uint16 r1;
                     20:                uint16 r2;
                     21:        };
                     22: 
                     23:  public:
                     24:        VideoCtlrDevice();
1.1.1.4   root       25:        virtual ~VideoCtlrDevice() override;
1.1       root       26: 
1.1.1.3   root       27:        void ResetHard() override;
                     28: 
1.1.1.2   root       29:        // 加工済みテキストパレットの先頭アドレスを取得
                     30:        // レンダラとかからの参照用
                     31:        const uint32 *GetCookedPalette() const { return cooked_palette; }
1.1       root       32: 
                     33:  protected:
                     34:        // BusIO インタフェース
                     35:        static const uint NPORT = 4096;
1.1.1.5   root       36:        uint64 Read(uint32 offset);
                     37:        uint64 Write(uint32 offset, uint32 data);
                     38:        uint64 Peek(uint32 offset);
1.1       root       39: 
                     40:  private:
                     41:        void SetR0(uint32 data);
                     42:        void SetR1(uint32 data);
                     43:        void SetR2(uint32 data);
1.1.1.2   root       44:        void MakePalette();
1.1       root       45: 
                     46:        struct videoctlr videoctlr {};
                     47:        union {
                     48:                uint8 b[1024];
                     49:                uint16 w[512];
                     50:        } palette {};
1.1.1.2   root       51: 
                     52:        // xBGR32 形式のテキストパレット (レンダラ用に加工したもの)
1.1.1.3   root       53:        uint32 cooked_palette[16] {};
1.1       root       54: };
                     55: 
                     56: 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.