Annotation of nono/vm/xiospace.h, revision 1.1.1.8

1.1       root        1: //
                      2: // nono
1.1.1.3   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
                      7: #pragma once
                      8: 
                      9: #include "device.h"
1.1.1.4   root       10: #include <array>
1.1       root       11: 
1.1.1.8 ! root       12: class XIOSpaceDevice : public IODevice
1.1       root       13: {
1.1.1.3   root       14:        using inherited = IODevice;
1.1       root       15:  public:
                     16:        XIOSpaceDevice();
1.1.1.5   root       17:        virtual ~XIOSpaceDevice() override;
1.1       root       18: 
1.1.1.4   root       19:        bool Init() override;
                     20: 
1.1.1.3   root       21:        uint64 Read8(uint32 addr) override;
                     22:        uint64 Read16(uint32 addr) override;
                     23:        uint64 Read32(uint32 addr) override;
                     24:        uint64 Write8(uint32 addr, uint32 data) override;
                     25:        uint64 Write16(uint32 addr, uint32 data) override;
                     26:        uint64 Write32(uint32 addr, uint32 data) override;
                     27:        uint64 Peek8(uint32 addr) override;
1.1       root       28: 
1.1.1.7   root       29:        // ブートページを切り替える。
                     30:        void SwitchBootPage(bool isrom);
                     31: 
1.1       root       32:  private:
                     33:        // アドレス addr に対応する IODevice* を返す。
                     34:        // addr は 24bit マスクされていること。
1.1.1.2   root       35:        inline IODevice *SearchDevice(uint32 addr) const
1.1       root       36:        {
                     37:                uint idx = addr / 8192;
                     38:                __assume(idx < 2048);
                     39:                return table[idx];
                     40:        }
                     41: 
                     42:        void AddDevice(IODevice *dev);
                     43: 
1.1.1.4   root       44:        std::array<IODevice*, 2048> table {};
1.1       root       45: };
1.1.1.6   root       46: 
                     47: extern std::unique_ptr<XIOSpaceDevice> gXIOSpace;

unix.superglobalmegacorp.com

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