Annotation of nono/vm/sram.h, revision 1.1.1.7

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.3   root       10: #include "mappedfile.h"
1.1       root       11: 
1.1.1.7 ! root       12: class SRAMDevice : public IODevice
1.1       root       13: {
1.1.1.3   root       14:        using inherited = IODevice;
1.1       root       15:  private:
                     16:        static const uint32 baseaddr = 0xed0000;
                     17: 
1.1.1.3   root       18:        // Pluto-X によるホストファイル起動アドレス
                     19:        static const uint32 plutoaddr = 0xeac000;
                     20: 
1.1       root       21:  public:
                     22:        SRAMDevice();
1.1.1.5   root       23:        virtual ~SRAMDevice() override;
1.1       root       24: 
1.1.1.3   root       25:        bool Init() override;
1.1.1.6   root       26:        void ResetHard() override;
1.1       root       27: 
1.1.1.3   root       28:        uint64 Read8(uint32 addr) override;
                     29:        uint64 Read16(uint32 addr) override;
                     30:        uint64 Write8(uint32 addr, uint32 data) override;
                     31:        uint64 Write16(uint32 addr, uint32 data) override;
                     32:        uint64 Peek8(uint32 addr) override;
1.1       root       33: 
                     34:        void write_enable(bool value);
                     35: 
                     36:  private:
1.1.1.2   root       37:        // アドレスデコーダ
                     38:        uint64 Decoder(uint32 addr) const;
                     39: 
1.1.1.3   root       40:        // ファイル
                     41:        std::string filename {};
                     42:        MappedFile file {};
                     43:        uint8 *mem {};
1.1       root       44: 
1.1.1.4   root       45:        bool writeable {};
1.1.1.3   root       46: 
                     47:        // ホストファイル起動用の読み出し値を返す
                     48:        uint32 PeekHostBoot(uint32 offset) const;
1.1       root       49: };
                     50: 
1.1.1.2   root       51: extern std::unique_ptr<SRAMDevice> gSRAM;

unix.superglobalmegacorp.com

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