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

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

unix.superglobalmegacorp.com

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