--- nono/vm/rom.h 2026/04/29 17:04:59 1.1.1.7 +++ nono/vm/rom.h 2026/04/29 17:05:17 1.1.1.10 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// ROM の基本クラス +// + #pragma once #include "device.h" @@ -12,7 +16,7 @@ class ROMDevice : public IODevice { using inherited = IODevice; public: - ROMDevice(const std::string& objname_); + ROMDevice(int objid_); virtual ~ROMDevice() override; uint64 Read8(uint32 addr) override; @@ -23,6 +27,9 @@ class ROMDevice : public IODevice uint64 Write32(uint32 addr, uint32 data) override; uint64 Peek8(uint32 addr) override; + // ファイル名を取得。なければ NULL。 + const char *GetFilename() const; + // アクセスウェイトを設定 void SetWait(uint32 wait_) { wait = wait_; } @@ -30,7 +37,7 @@ class ROMDevice : public IODevice bool LoadROM(const char *name, int size); // Read*()/Peek8() がアクセスするメモリ領域をさすポインタ。 - uint8 *mem {}; + const uint8 *mem {}; // アクセスマスク。 // LUNA の PROM のように、この ROM の折り返しミラーが見える構造なら