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

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

unix.superglobalmegacorp.com

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