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

1.1       root        1: //
                      2: // nono
1.1.1.2   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
                      7: // MPU (m88xx0)
                      8: 
                      9: #pragma once
                     10: 
                     11: #include "mpu.h"
                     12: #include "m88100.h"
                     13: 
                     14: class MPU88xx0Device : public MPUDevice
                     15: {
1.1.1.2   root       16:        using inherited = MPUDevice;
1.1       root       17:  public:
1.1.1.8   root       18:        MPU88xx0Device();
1.1.1.5   root       19:        virtual ~MPU88xx0Device() override;
                     20: 
                     21:        bool Init() override;
1.1.1.8   root       22:        bool PowerOn() override;
                     23:        void ResetHard() override;
1.1       root       24: 
1.1.1.5   root       25:        // MPU を vtime [nsec] 分実行する
                     26:        uint32 Run(uint32 vtime) override { return cpu->Run(vtime); }
1.1       root       27: 
1.1.1.5   root       28:        // 現在の仮想時刻 [nsec] を取得する
1.1.1.6   root       29:        uint64 GetVirtTime() const override { return cpu->GetVTime(); }
1.1       root       30: 
                     31:        // MPU の処理をこの命令で中断させる。
1.1.1.2   root       32:        void Release() override { cpu->Release(); }
1.1       root       33: 
                     34:        // 現在実行中の命令の PC を取得
1.1.1.4   root       35:        uint32 GetPPC() const override { return cpu->GetXIP(); }
1.1       root       36: 
                     37:        // 現在アクセス中の論理アドレス、物理アドレスを取得。
1.1.1.7   root       38:        uint32 GetLaddr() const override;
                     39:        uint32 GetPaddr() const override;
1.1       root       40: 
1.1.1.4   root       41:        // アクセスウェイトを加算
1.1.1.5   root       42:        void AddCycle(int32 cycle) override;
1.1.1.4   root       43: 
1.1       root       44:        // 割り込み発生を MPU に通知
1.1.1.5   root       45:        void Interrupt(int level) override;
1.1       root       46: 
1.1.1.10! root       47:        // DOS call エミュレーションのコールバックを指定する
        !            48:        void SetFLineCallback(bool (*callback)(m88kcpu *, void *), void *arg);
        !            49: 
1.1       root       50:        // CPU コアを取得 (主にデバッグ用途)
                     51:        m88kcpu *GetCPU() const { return cpu.get(); }
                     52: 
1.1.1.10! root       53:        // MPU からのアクセスをエミュレートする。
        !            54:        // アドレスは論理アドレス。
        !            55:        // 空間は現在のデータ空間。
        !            56:        // ミスアラインドアクセスも可能。
        !            57:        // アクセスエラーは -1 を返す。
        !            58:        uint64 Read8(uint32 addr) override;
        !            59:        uint64 Read16(uint32 addr) override;
        !            60:        uint64 Read32(uint32 addr) override;
        !            61:        uint64 Write8(uint32 addr, uint32 data) override;
        !            62:        uint64 Write16(uint32 addr, uint32 data) override;
        !            63:        uint64 Write32(uint32 addr, uint32 data) override;
        !            64: 
1.1       root       65:  private:
1.1.1.9   root       66:        // レジスタモニター
                     67:        DECLARE_MONITOR_CALLBACK(MonitorUpdate);
                     68:        Monitor monitor { this };
1.1.1.2   root       69: 
1.1.1.9   root       70:        std::unique_ptr<m88kcpu> cpu {};
1.1.1.2   root       71: };
                     72: 
1.1       root       73: #define gMPU88xx0      (dynamic_cast<MPU88xx0Device *>(gMPU.get()))

unix.superglobalmegacorp.com

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