Annotation of nono/vm/rom.h, revision 1.1.1.2

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: #pragma once
                      8: 
                      9: #include "device.h"
1.1.1.2 ! root       10: #include "mappedfile.h"
1.1       root       11: 
                     12: class ROMDevice
                     13:        : public IODevice
                     14: {
1.1.1.2 ! root       15:        using inherited = IODevice;
1.1       root       16:  public:
                     17:        ROMDevice();
1.1.1.2 ! root       18:        ~ROMDevice() override;
1.1       root       19: 
1.1.1.2 ! root       20:        uint64 Read8(uint32 addr) override;
        !            21:        uint64 Read16(uint32 addr) override;
        !            22:        uint64 Read32(uint32 addr) override;
        !            23:        uint64 Write8(uint32 addr, uint32 data) override;
        !            24:        uint64 Write16(uint32 addr, uint32 data) override;
        !            25:        uint64 Write32(uint32 addr, uint32 data) override;
        !            26:        uint64 Peek8(uint32 addr) override;
1.1       root       27: 
                     28:  protected:
                     29:        bool LoadROM(const char *name, int size);
                     30: 
                     31:        // アドレスマスク
                     32:        uint32 mask = 0;
                     33: 
1.1.1.2 ! root       34:        // オープンしているファイル
        !            35:        std::string filename {};
        !            36:        MappedFile file {};
1.1       root       37: 
                     38:        // メモリ領域をさすポインタ。
1.1.1.2 ! root       39:        // 通常は ROM イメージファイルを読み込むだけなので
        !            40:        // mem = file.GetPtr() となる。
1.1       root       41:        // ROM イメージを自分で用意したい場合はこれを適当なところにむけてどうぞ。
                     42:        uint8 *mem = NULL;
                     43: };

unix.superglobalmegacorp.com

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