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

1.1       root        1: //
                      2: // nono
1.1.1.3   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
                      7: #pragma once
                      8: 
                      9: #include "device.h"
                     10: 
                     11: struct SYSPORT
                     12: {
                     13:        static const int CONTRAST       = 0;    // $E8E001
                     14:        static const int SCOPE3D        = 1;    // $E8E003
                     15:        static const int IMAGEUNIT      = 2;    // $E8E005
                     16:        static const int KEY            = 3;    // $E8E007
                     17:        static const int WAIT           = 4;    // $E8E009
                     18:        static const int MPU            = 5;    // $E8E00B
                     19:        static const int SRAMWP         = 6;    // $E8E00D
                     20:        static const int POWEROFF       = 7;    // $E8E00F
                     21: 
                     22:        int contrast;
                     23:        int rom_wait;   // 設定値。ウェイトにする時には +2 する
1.1.1.4   root       24:        int ram_wait;   // 設定値。
1.1.1.7 ! root       25:        bool key_ctrl;
1.1       root       26: };
                     27: 
                     28: class SysportDevice
                     29:        : public IODevice
                     30: {
1.1.1.3   root       31:        using inherited = IODevice;
1.1       root       32:  private:
                     33:        static const uint32 baseaddr = 0xe8e000;
                     34: 
                     35:  public:
                     36:        SysportDevice();
1.1.1.5   root       37:        virtual ~SysportDevice() override;
1.1       root       38: 
1.1.1.4   root       39:        void ResetHard() override;
                     40: 
1.1.1.7 ! root       41:        // KEYCTRL の状態を取得する
        !            42:        bool GetKeyCtrl() const {
        !            43:                return sysport.key_ctrl;
        !            44:        }
        !            45: 
1.1.1.3   root       46:  protected:
                     47:        // BusIO インタフェース
                     48:        static const uint32 NPORT = 8;
1.1.1.6   root       49:        uint64 Read(uint32 offset);
                     50:        uint64 Write(uint32 offset, uint32 data);
                     51:        uint64 Peek(uint32 offset);
1.1       root       52: 
                     53:  private:
                     54:        struct SYSPORT sysport {};
                     55: };
1.1.1.6   root       56: 
                     57: extern std::unique_ptr<SysportDevice> gSysport;

unix.superglobalmegacorp.com

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