--- nono/vm/gvram.cpp 2026/04/29 17:05:18 1.1.1.7 +++ nono/vm/gvram.cpp 2026/04/29 17:05:25 1.1.1.8 @@ -15,6 +15,9 @@ #include "mpu.h" #include "videoctlr.h" +// InsideOut p.135 +static const busdata wait = busdata::Wait(9 * 40_nsec); + // コンストラクタ GVRAMDevice::GVRAMDevice() : inherited(OBJ_GVRAM) @@ -29,41 +32,43 @@ GVRAMDevice::~GVRAMDevice() { } -uint64 +busdata GVRAMDevice::Read8(uint32 addr) { - mpu->AddCycle(9); // Inside/Out p.135 + busdata data; uint32 offset = addr - baseaddr; - return mem[HB(offset)]; + data = mem[HB(offset)]; + data |= wait; + return data; } -uint64 +busdata GVRAMDevice::Read16(uint32 addr) { - mpu->AddCycle(9); // Inside/Out p.135 + busdata data; uint32 offset = addr - baseaddr; - return *(uint16 *)&mem[offset]; + data = *(uint16 *)&mem[offset]; + data |= wait; + return data; } -uint64 +busdata GVRAMDevice::Write8(uint32 addr, uint32 data) { - mpu->AddCycle(9); // Inside/Out p.135 uint32 offset = addr - baseaddr; mem[HB(offset)] = data; - return 0; + return wait; } -uint64 +busdata GVRAMDevice::Write16(uint32 addr, uint32 data) { - mpu->AddCycle(9); // Inside/Out p.135 uint32 offset = addr - baseaddr; *(uint16 *)&mem[offset] = data; - return 0; + return wait; } -uint64 +busdata GVRAMDevice::Peek8(uint32 addr) { return mem[HB(addr - baseaddr)];