Annotation of nono/vm/cmmu.h, revision 1.1.1.5

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
1.1.1.4   root        7: //
1.1       root        8: // M88200 CMMU の I/O デバイス部分
1.1.1.4   root        9: //
1.1       root       10: 
                     11: #pragma once
                     12: 
                     13: #include "device.h"
1.1.1.5 ! root       14: #include <array>
        !            15: 
        !            16: class m88200;
1.1       root       17: 
1.1.1.3   root       18: class CMMUDevice : public IODevice
1.1       root       19: {
                     20:        using inherited = IODevice;
                     21: 
                     22:        // レジスタオフセット
                     23:        static const uint32 IDR         = 0x000;
                     24:        static const uint32 SCR         = 0x004;
                     25:        static const uint32 SSR         = 0x008;
                     26:        static const uint32 SAR         = 0x00c;
                     27:        static const uint32 SCTR        = 0x104;
                     28:        static const uint32 PFSR        = 0x108;
                     29:        static const uint32 PFAR        = 0x10c;
                     30: 
                     31:        static const uint32 SAPR        = 0x200;
                     32:        static const uint32 UAPR        = 0x204;
                     33: 
                     34:        static const uint32 BWP0        = 0x400;
                     35:        static const uint32 BWP7        = 0x41c;
                     36:        static const uint32 CDP0        = 0x800;
                     37:        static const uint32 CDP3        = 0x80c;
                     38:        static const uint32 CTP0        = 0x840;
                     39:        static const uint32 CTP3        = 0x84c;
                     40: 
                     41:        static const uint32 CSSP        = 0x880;
                     42: 
                     43:  public:
                     44:        CMMUDevice();
1.1.1.2   root       45:        virtual ~CMMUDevice() override;
1.1       root       46: 
                     47:        bool Init() override;
                     48: 
                     49:        uint64 Read32(uint32 addr) override;
                     50:        uint64 Write32(uint32 addr, uint32 data) override;
                     51:        uint64 Peek8(uint32 addr) override;
                     52: 
                     53:  private:
                     54:        // アドレスデコーダ
                     55:        static uint32 Decoder(uint32 addr);
                     56: 
1.1.1.5 ! root       57:        // Peek8() の下請け
        !            58:        uint32 Peek32(uint32 addr) const;
        !            59: 
1.1       root       60:        // 指定された ID の CMMU(m88200) を返す。なければ NULL を返す。
                     61:        m88200 *GetCMMU(uint id) const {
1.1.1.5 ! root       62:                if (id >= cmmus.size()) {
1.1       root       63:                        return NULL;
                     64:                }
                     65:                return cmmus[id];
                     66:        }
                     67: 
1.1.1.5 ! root       68:        // CMMU へのリンク (最大 4 MPU)
        !            69:        std::array<m88200*, 8> cmmus {};
1.1       root       70: };
                     71: 
1.1.1.5 ! root       72: static inline CMMUDevice *GetCMMUDevice() {
        !            73:        return Object::GetObject<CMMUDevice>(OBJ_CMMUIO);
        !            74: }

unix.superglobalmegacorp.com

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