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

1.1       root        1: //
                      2: // nono
1.1.1.2   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
1.1.1.7 ! root        7: //
        !             8: // CRTC
        !             9: //
        !            10: 
1.1       root       11: #pragma once
                     12: 
1.1.1.7 ! root       13: #include "event.h"
        !            14: #include "monitor.h"
1.1       root       15: 
                     16: struct CRTC
                     17: {
1.1.1.7 ! root       18:        //      15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
        !            19:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            20:        // R00 |               -               |         水平トータル          |
        !            21:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            22:        // R01 |               -               |       水平同期終了位置        |
        !            23:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            24:        // R02 |               -               |       水平表示開始位置        |
        !            25:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            26:        // R03 |               -               |       水平表示終了位置        |
        !            27:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            28:        //
        !            29:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            30:        // R04 |           -           |              垂直トータル             |
        !            31:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            32:        // R05 |           -           |            垂直同期終了位置           |
        !            33:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            34:        // R06 |           -           |            垂直表示開始位置           |
        !            35:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            36:        // R07 |           -           |            垂直表示終了位置           |
        !            37:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            38:        //
        !            39:        //      15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
        !            40:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            41:        // R08 |               -               |     外部同期水平アジャスト    |
        !            42:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            43:        // R09 |           -           |              ラスタ番号               |
        !            44:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            45:        // R10 |           -           |    テキスト画面スクロール X位置       |
        !            46:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            47:        // R11 |           -           |    テキスト画面スクロール Y位置       |
        !            48:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            49:        //
        !            50:        //      15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
        !            51:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            52:        // R12 |           -           |     グラフィック画面スクロール X0     |
        !            53:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            54:        // R13 |           -           |     グラフィック画面スクロール Y0     |
        !            55:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            56:        // R14 |               -           |   グラフィック画面スクロール X1   |
        !            57:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            58:        // R15 |               -           |   グラフィック画面スクロール Y1   |
        !            59:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            60:        // R16 |               -           |   グラフィック画面スクロール X2   |
        !            61:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            62:        // R17 |               -           |   グラフィック画面スクロール Y2   |
        !            63:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            64:        // R18 |               -           |   グラフィック画面スクロール X3   |
        !            65:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            66:        // R19 |               -           |   グラフィック画面スクロール Y3   |
        !            67:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            68:        //
        !            69:        //      15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
        !            70:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            71:        // R20 |         -         |SIZ|  COL  |     -     |HF |  VD   |   HD  |
        !            72:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            73:        // R21 |           -           |MEN|SA |       AP      |       CP      |
        !            74:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            75:        // R22 |          ソースラスタ         |   デスティネーションラスタ    |
        !            76:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            77:        // R23 |                          マスクパターン                       |
        !            78:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            79:        // R24 |                       -                       |RC | 0 |FC |VI |
        !            80:        //     +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
        !            81: 
1.1       root       82:        uint16 r[24];
                     83:        uint16 op;
                     84: 
                     85:        static const uint32 R00         = 0x00;         // $E80000
                     86:        static const uint32 R01         = 0x01;         // $E80002
                     87:        static const uint32 R02         = 0x02;         // $E80004
                     88:        static const uint32 R03         = 0x03;         // $E80006
                     89:        static const uint32 R04         = 0x04;         // $E80008
                     90:        static const uint32 R05         = 0x05;         // $E8000A
                     91:        static const uint32 R06         = 0x06;         // $E8000C
                     92:        static const uint32 R07         = 0x07;         // $E8000E
                     93:        static const uint32 R08         = 0x08;         // $E80010
                     94:        static const uint32 R09         = 0x09;         // $E80012
                     95:        static const uint32 R10         = 0x0a;         // $E80014
                     96:        static const uint32 R11         = 0x0b;         // $E80016
                     97:        static const uint32 R12         = 0x0c;         // $E80018
                     98:        static const uint32 R13         = 0x0d;         // $E8001A
                     99:        static const uint32 R14         = 0x0e;         // $E8001C
                    100:        static const uint32 R15         = 0x0f;         // $E8001E
                    101:        static const uint32 R16         = 0x10;         // $E80020
                    102:        static const uint32 R17         = 0x11;         // $E80022
                    103:        static const uint32 R18         = 0x12;         // $E80024
                    104:        static const uint32 R19         = 0x13;         // $E80026
                    105:        static const uint32 R20         = 0x14;         // $E80028
                    106:        static const uint32 R21         = 0x15;         // $E8002A
                    107:        static const uint32 R22         = 0x16;         // $E8002C
                    108:        static const uint32 R23         = 0x17;         // $E8002E
                    109:        static const uint32 REG_END     = 0x18;
1.1.1.5   root      110:        static const uint32 REG_OP      = 0x240;        // $E80480
1.1.1.7 ! root      111: 
        !           112:        // 動作ポート
        !           113:        static const uint32 OP_RC       = 0x08;         // ラスターコピー開始(%1)
        !           114:        static const uint32 OP_FC       = 0x02;         // 高速クリア開始(%1)
        !           115:        static const uint32 OP_VI       = 0x01;         // 画像取り込み開始(%1)
1.1       root      116: };
                    117: 
1.1.1.6   root      118: class CRTCDevice : public IODevice
1.1       root      119: {
1.1.1.2   root      120:        using inherited = IODevice;
1.1       root      121:  public:
                    122:        CRTCDevice();
1.1.1.4   root      123:        virtual ~CRTCDevice() override;
1.1       root      124: 
1.1.1.7 ! root      125:        void ResetHard(bool poweron) override;
1.1       root      126: 
1.1.1.2   root      127:  protected:
                    128:        // BusIO インタフェース
                    129:        static const uint NPORT = 0x800;
1.1.1.5   root      130:        uint64 Read(uint32 offset);
                    131:        uint64 Write(uint32 offset, uint32 data);
                    132:        uint64 Peek(uint32 offset);
1.1       root      133: 
                    134:  private:
1.1.1.7 ! root      135:        // レジスタへの書き込み
1.1.1.2   root      136:        void SetReg(uint32 offset, uint32 data);
1.1.1.7 ! root      137:        // 動作ポートへの書き込み
        !           138:        void WriteOp(uint32 data);
        !           139: 
        !           140:        // テキスト画面のラスターコピー
        !           141:        void StartRasterCopy();
        !           142: 
        !           143:        // 水平同期信号イベント
        !           144:        void HSyncCallback(Event& ev);
1.1       root      145: 
                    146:        // 垂直表示期間イベント
1.1.1.3   root      147:        void VDispCallback(Event& ev);
1.1       root      148: 
1.1.1.7 ! root      149:        DECLARE_MONITOR_CALLBACK(MonitorUpdate);
        !           150: 
1.1       root      151:        struct CRTC crtc {};
                    152: 
1.1.1.7 ! root      153:        Event hsync_event { this };
1.1.1.6   root      154:        Event vdisp_event { this };
1.1.1.7 ! root      155: 
        !           156:        Monitor monitor { this };
1.1       root      157: };
1.1.1.2   root      158: 
1.1.1.7 ! root      159: extern CRTCDevice *gCRTC;

unix.superglobalmegacorp.com

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