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

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: 
1.1.1.11! root       15: class CGROMDevice;
        !            16: class IPLROM1Device;
        !            17: class Keyboard;
        !            18: class MainRAMDevice;
        !            19: class NMIDevice;
        !            20: class ROMDevice;
        !            21: class SRAMDevice;
        !            22: 
1.1       root       23: struct SYSPORT
                     24: {
                     25:        static const int CONTRAST       = 0;    // $E8E001
                     26:        static const int SCOPE3D        = 1;    // $E8E003
                     27:        static const int IMAGEUNIT      = 2;    // $E8E005
                     28:        static const int KEY            = 3;    // $E8E007
                     29:        static const int WAIT           = 4;    // $E8E009
                     30:        static const int MPU            = 5;    // $E8E00B
                     31:        static const int SRAMWP         = 6;    // $E8E00D
                     32:        static const int POWEROFF       = 7;    // $E8E00F
                     33: 
                     34:        int contrast;
                     35:        int rom_wait;   // 設定値。ウェイトにする時には +2 する
1.1.1.4   root       36:        int ram_wait;   // 設定値。
1.1.1.7   root       37:        bool key_ctrl;
1.1.1.10  root       38:        uint pwoff_count;
1.1       root       39: };
                     40: 
1.1.1.8   root       41: class SysportDevice : public IODevice
1.1       root       42: {
1.1.1.3   root       43:        using inherited = IODevice;
1.1.1.9   root       44: 
1.1       root       45:        static const uint32 baseaddr = 0xe8e000;
                     46: 
                     47:  public:
                     48:        SysportDevice();
1.1.1.5   root       49:        virtual ~SysportDevice() override;
1.1       root       50: 
1.1.1.11! root       51:        bool Init() override;
1.1.1.9   root       52:        void ResetHard(bool poweron) override;
1.1.1.4   root       53: 
1.1.1.7   root       54:        // KEYCTRL の状態を取得する
                     55:        bool GetKeyCtrl() const {
                     56:                return sysport.key_ctrl;
                     57:        }
                     58: 
1.1.1.3   root       59:  protected:
                     60:        // BusIO インタフェース
                     61:        static const uint32 NPORT = 8;
1.1.1.6   root       62:        uint64 Read(uint32 offset);
                     63:        uint64 Write(uint32 offset, uint32 data);
                     64:        uint64 Peek(uint32 offset);
1.1       root       65: 
                     66:  private:
                     67:        struct SYSPORT sysport {};
1.1.1.11! root       68: 
        !            69:        CGROMDevice *cgrom {};
        !            70:        IPLROM1Device *iplrom1 {};
        !            71:        ROMDevice *iplrom2 {};
        !            72:        Keyboard *keyboard {};
        !            73:        MainRAMDevice *mainram {};
        !            74:        NMIDevice *nmi {};
        !            75:        SRAMDevice *sram {};
1.1       root       76: };
1.1.1.6   root       77: 
1.1.1.11! root       78: static inline SysportDevice *GetSysportDevice() {
        !            79:        return Object::GetObject<SysportDevice>(OBJ_SYSPORT);
        !            80: }

unix.superglobalmegacorp.com

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