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

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.1.10! root       30:        uint pwoff_count;
1.1       root       31: };
                     32: 
1.1.1.8   root       33: class SysportDevice : public IODevice
1.1       root       34: {
1.1.1.3   root       35:        using inherited = IODevice;
1.1.1.9   root       36: 
1.1       root       37:        static const uint32 baseaddr = 0xe8e000;
                     38: 
                     39:  public:
                     40:        SysportDevice();
1.1.1.5   root       41:        virtual ~SysportDevice() override;
1.1       root       42: 
1.1.1.9   root       43:        void ResetHard(bool poweron) override;
1.1.1.4   root       44: 
1.1.1.7   root       45:        // KEYCTRL の状態を取得する
                     46:        bool GetKeyCtrl() const {
                     47:                return sysport.key_ctrl;
                     48:        }
                     49: 
1.1.1.3   root       50:  protected:
                     51:        // BusIO インタフェース
                     52:        static const uint32 NPORT = 8;
1.1.1.6   root       53:        uint64 Read(uint32 offset);
                     54:        uint64 Write(uint32 offset, uint32 data);
                     55:        uint64 Peek(uint32 offset);
1.1       root       56: 
                     57:  private:
                     58:        struct SYSPORT sysport {};
                     59: };
1.1.1.6   root       60: 
1.1.1.9   root       61: 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.