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

1.1       root        1: //
                      2: // nono
                      3: // Copyright (C) 2022 nono project
                      4: // Licensed under nono-license.txt
                      5: //
                      6: 
                      7: //
                      8: // XP プロセッサの物理バス
                      9: //
                     10: 
                     11: #pragma once
                     12: 
1.1.1.2   root       13: #include "mainbus.h"
1.1       root       14: #include <array>
                     15: 
1.1.1.3   root       16: class SubRAMDevice;
1.1       root       17: class SubRAM2Device;
                     18: class XPRAMDevice;
                     19: 
1.1.1.4 ! root       20: // XP 物理バス
1.1.1.2   root       21: class XPbusDevice : public IODevice
1.1       root       22: {
1.1.1.2   root       23:        using inherited = IODevice;
1.1       root       24:  public:
                     25:        XPbusDevice();
                     26:        ~XPbusDevice() override;
                     27: 
                     28:        bool Init() override;
                     29:        void ResetHard(bool poweron) override;
                     30: 
1.1.1.3   root       31:        busdata Read1(uint32 addr) override;
                     32:        busdata Write1(uint32 addr, uint32 data) override;
                     33:        busdata Peek1(uint32 addr) override;
                     34:        bool Poke1(uint32 addr, uint32 data) override;
1.1       root       35: 
                     36:        // RAM Control Register (RMCR) を設定/取得
                     37:        uint32 GetRMCR() const;
                     38:        void SetRMCR(uint32);
                     39:        // 内蔵 RAM の先頭番地を取得 (モニタ用)
                     40:        uint32 GetXPRAMAddr() const { return ram_addr; }
                     41: 
                     42:  private:
                     43:        inline IODevice *SearchDevice(uint32 addr) const;
                     44: 
                     45:        // 3port RAM (非共有部)
                     46:        std::unique_ptr<SubRAM2Device> pSubRAM2 /*{}*/;
                     47:        // XP 内蔵 512 バイト RAM
                     48:        std::unique_ptr<XPRAMDevice> pXPRAM /*{}*/;
                     49: 
                     50:        // XP 内蔵 512 バイト RAM の位置
                     51:        uint32 ram_addr {};
                     52: 
1.1.1.3   root       53:        SubRAMDevice *subram {};        // 共有 SRAM
                     54:        NopIODevice *nopio {};
1.1       root       55: };
                     56: 
                     57: // XP 内蔵 RAM
                     58: class XPRAMDevice : public IODevice
                     59: {
                     60:        using inherited = IODevice;
                     61:  public:
                     62:        XPRAMDevice();
                     63:        ~XPRAMDevice() override;
                     64: 
1.1.1.3   root       65:        busdata Read1(uint32 addr) override;
                     66:        busdata Write1(uint32 addr, uint32 data) override;
                     67:        busdata Peek1(uint32 addr) override;
                     68:        bool Poke1(uint32 addr, uint32 data) override;
1.1       root       69: 
                     70:  private:
                     71:        std::array<uint8, 512> ram {};
                     72: };
                     73: 
                     74: static inline XPbusDevice *GetXPbusDevice() {
                     75:        return Object::GetObject<XPbusDevice>(OBJ_XPBUS);
                     76: }

unix.superglobalmegacorp.com

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