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

1.1     ! root        1: //
        !             2: // nono
        !             3: // Copyright (C) 2017 [email protected]
        !             4: //
        !             5: 
        !             6: #pragma once
        !             7: 
        !             8: #include "device.h"
        !             9: 
        !            10: class SRAMDevice
        !            11:        : public IODevice
        !            12: {
        !            13:        typedef IODevice inherited;
        !            14:  private:
        !            15:        static const uint32 baseaddr = 0xed0000;
        !            16: 
        !            17:  public:
        !            18:        SRAMDevice();
        !            19:        virtual ~SRAMDevice();
        !            20: 
        !            21:        virtual bool Init();
        !            22: 
        !            23:        virtual uint64 Read8(uint32 addr);
        !            24:        virtual uint64 Read16(uint32 addr);
        !            25:        virtual uint64 Write8(uint32 addr, uint32 data);
        !            26:        virtual uint64 Write16(uint32 addr, uint32 data);
        !            27:        virtual uint64 Peek8(uint32 addr);
        !            28: 
        !            29:        void write_enable(bool value);
        !            30: 
        !            31:  private:
        !            32:        std::string filename;
        !            33:        int fd = 0;
        !            34: 
        !            35:        // バイト順はファイルイメージそのまま
        !            36:        uint8 *mem = NULL;
        !            37: 
        !            38:        // mmap する長さ
        !            39:        int memlen = 0;
        !            40: 
        !            41:        bool writeable = false;
        !            42: };
        !            43: 
        !            44: extern SRAMDevice *gSRAM;

unix.superglobalmegacorp.com

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