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

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

unix.superglobalmegacorp.com

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