--- nono/vm/xiospace.cpp 2026/04/29 17:04:45 1.1.1.5 +++ nono/vm/xiospace.cpp 2026/04/29 17:04:50 1.1.1.6 @@ -34,14 +34,6 @@ // X68030 のメイン空間 ($000000-$FFFFFF) 担当。 // -// デバイス -static std::unique_ptr areaset; -static std::unique_ptr pluto; -static std::unique_ptr ppi; -static std::unique_ptr printer; -static std::unique_ptr sprite; -static std::unique_ptr sysport; - // 1つの 8KB ブロックを複数のデバイスで共有する場合 class MuxDevice : public IODevice @@ -148,6 +140,8 @@ MuxDevice::Peek8(uint32 addr) } +std::unique_ptr gXIOSpace; + // コンストラクタ XIOSpaceDevice::XIOSpaceDevice() { @@ -160,7 +154,7 @@ XIOSpaceDevice::XIOSpaceDevice() } while (0) // デバイスクラス作成 (順序に注意) - ADD_DEVICE(areaset, AreaSetDevice()); + ADD_DEVICE(gAreaSet, AreaSetDevice()); ADD_DEVICE(gCGROM, CGROMDevice()); ADD_DEVICE(gCRTC, BusIO_W()); ADD_DEVICE(gDMAC, BusIO_B()); @@ -170,15 +164,15 @@ XIOSpaceDevice::XIOSpaceDevice() ADD_DEVICE(gIPLROM1, IPLROM1Device()); ADD_DEVICE(gIPLROM2, IPLROM2Device()); ADD_DEVICE(gMFP, BusIO_EB()); - ADD_DEVICE(pluto, PlutoDevice()); - ADD_DEVICE(ppi, BusIO_EB()); - ADD_DEVICE(printer, PrinterDevice()); + ADD_DEVICE(gPluto, PlutoDevice()); + ADD_DEVICE(gPPI, BusIO_EB()); + ADD_DEVICE(gPrinter, PrinterDevice()); ADD_DEVICE(gRTC, BusIO_EB()); ADD_DEVICE(gSCC, BusIO_EB()); ADD_DEVICE(gSRAM, SRAMDevice()); // Required by SPC ADD_DEVICE(gSPC, BusIO_X68kSPC()); - ADD_DEVICE(sprite, SpriteDevice()); - ADD_DEVICE(sysport, BusIO_FB()); + ADD_DEVICE(gSprite, SpriteDevice()); + ADD_DEVICE(gSysport, BusIO_FB()); ADD_DEVICE(gTVRAM, TVRAMDevice()); ADD_DEVICE(gVideoCtlr, BusIO_W()); ADD_DEVICE(gOPM, BusIO_EB()); @@ -193,6 +187,7 @@ bool XIOSpaceDevice::Init() { // RAM のみ RamDevice::Init() で ram_size が決定してから行う。 + int ram_size = gRAM->GetSize(); for (int i = 0; i < ram_size / 8192; i++) { table[i] = gRAM.get(); }