--- nono/vm/gvram.cpp 2026/04/29 17:05:29 1.1.1.9 +++ nono/vm/gvram.cpp 2026/04/29 17:05:43 1.1.1.10 @@ -21,9 +21,6 @@ static const busdata wait = busdata::Wai GVRAMDevice::GVRAMDevice() : inherited(OBJ_GVRAM) { - uint devlen = 0x20'0000; // XXX とりあえず - - mem.reset(new uint8[devlen]); } // デストラクタ @@ -31,6 +28,20 @@ GVRAMDevice::~GVRAMDevice() { } +// 初期化 +bool +GVRAMDevice::Init() +{ + uint devlen = 0x20'0000; // XXX とりあえず + mem.reset(new(std::nothrow) uint8[devlen]); + if ((bool)mem == false) { + warnx("Cannot allocate %u bytes at %s", devlen, __method__); + return false; + } + + return true; +} + inline uint32 GVRAMDevice::Decoder(uint32 addr) const {