--- nono/vm/sysport.cpp 2026/04/29 17:04:36 1.1.1.3 +++ nono/vm/sysport.cpp 2026/04/29 17:04:42 1.1.1.4 @@ -6,6 +6,8 @@ #include "sysport.h" #include "mfp.h" +#include "ram.h" +#include "romimg_x68k.h" #include "sram.h" SysportDevice::SysportDevice() @@ -20,6 +22,13 @@ SysportDevice::~SysportDevice() { } +void +SysportDevice::ResetHard() +{ + sysport.ram_wait = 0; + sysport.rom_wait = 0; +} + uint64 SysportDevice::Read(uint32 addr) { @@ -81,10 +90,22 @@ SysportDevice::Write(uint32 addr, uint32 break; case SYSPORT::WAIT: + { // 設定値で保持 sysport.rom_wait = data >> 4; sysport.ram_wait = data; + + // ROM に指示。常に設定値 + 2 でよい + gIPLROM1->SetWait(sysport.rom_wait + 2); + gIPLROM2->SetWait(sysport.rom_wait + 2); + gCGROM->SetWait(sysport.rom_wait + 2); + // RAM に指示。InsideOut p.124 + int wait = sysport.ram_wait; + if (wait > 0) + wait += 2; + gRAM->SetWait(wait); break; + } case SYSPORT::MPU: break;