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

1.1       root        1: //
                      2: // nono
1.1.1.4   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: // SIO (uPD7201)
                      9: //
                     10: 
1.1       root       11: #pragma once
                     12: 
                     13: #include "device.h"
1.1.1.9   root       14: #include "mpscc.h"
1.1       root       15: 
1.1.1.10! root       16: class Keyboard;
        !            17: 
1.1.1.9   root       18: class SIODevice : public MPSCCDevice
1.1       root       19: {
1.1.1.9   root       20:        using inherited = MPSCCDevice;
1.1       root       21:  public:
                     22:        SIODevice();
1.1.1.5   root       23:        virtual ~SIODevice() override;
1.1       root       24: 
1.1.1.10! root       25:        bool Init() override;
1.1.1.9   root       26:        void ResetHard(bool poweron) override;
                     27: 
1.1.1.6   root       28:        // BusIO インタフェース
                     29:        // (内蔵 ROM からのアクセス用に特別に public にしてある)
                     30:        uint64 Read(uint32 offset);
                     31:        uint64 Write(uint32 offset, uint32 data);
1.1       root       32: 
1.1.1.3   root       33:  protected:
                     34:        // BusIO インタフェース
                     35:        static const uint32 NPORT = 4;
1.1.1.6   root       36:        uint64 Peek(uint32 offset);
1.1       root       37: 
1.1.1.8   root       38:        void Tx(int ch, uint32 data) override;
1.1.1.9   root       39:        uint GetHighestInt() const override;
1.1.1.8   root       40: 
1.1       root       41:  private:
1.1.1.9   root       42:        // 指定のレジスタ名を返す
                     43:        const char *CRName(const MPSCCChan&, int n) const override;
                     44:        const char *SRName(const MPSCCChan&, int n) const override;
                     45:        // 現在のレジスタ名を返す
                     46:        const char *CRName(const MPSCCChan& chan) const {
                     47:                return CRName(chan, chan.ptr);
                     48:        }
                     49:        const char *SRName(const MPSCCChan& chan) const {
                     50:                return SRName(chan, chan.ptr);
                     51:        }
                     52: 
                     53:        void ResetChannel(MPSCCChan&);
                     54: 
                     55:        uint8 ReadCtrl(MPSCCChan&);
                     56:        void WriteCtrl(MPSCCChan&, uint32 data);
                     57:        uint8 PeekCtrl(const MPSCCChan&) const;
                     58: 
                     59:        uint8 GetCR1(const MPSCCChan&) const;
                     60:        uint8 GetCR2A() const;
                     61:        uint8 GetCR2B() const;
                     62:        uint8 GetSR0(const MPSCCChan&) const;
                     63: 
                     64:        void WriteCR0(MPSCCChan&, uint32 data);
                     65:        void WriteCR1(MPSCCChan&, uint32 data);
                     66:        void WriteCR2(MPSCCChan&, uint32 data);
                     67: 
                     68:        // VIS モードを更新
                     69:        void SetVIS();
                     70: 
                     71:        DECLARE_MONITOR_CALLBACK(MonitorUpdate);
                     72:        void MonitorUpdateCh(TextScreen&, int ch, int xbase, int ybase);
                     73: 
1.1.1.10! root       74:        Keyboard *keyboard {};
        !            75: 
1.1.1.9   root       76:        static const char * const crnames[16];
                     77:        static const char * const srnames[16];
1.1       root       78: };
                     79: 
1.1.1.10! root       80: static inline SIODevice *GetSIODevice() {
        !            81:        return Object::GetObject<SIODevice>(OBJ_MPSCC);
        !            82: }

unix.superglobalmegacorp.com

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