--- nono/vm/mpu680x0.cpp 2026/04/29 17:05:09 1.1.1.13 +++ nono/vm/mpu680x0.cpp 2026/04/29 17:05:13 1.1.1.14 @@ -75,14 +75,18 @@ MPU680x0Device::Init() intr_event.time = 3 * clock_nsec; // FPU (6888x) - if (gMainApp.GetVMType() == VMTYPE_LUNA1) { + if (gMainApp.GetVMType() == VMType::LUNA1) { // LUNA は 68881 固定 (設定は見ない) cpu->has_fpu = 1; } else { // X68k は設定による - const ConfigItem& item = gConfig->Find("mpu-has-fpu"); - cpu->has_fpu = item.AsInt(); - if (cpu->has_fpu < 0 || cpu->has_fpu > 2) { + const ConfigItem& item = gConfig->Find("fpu-type"); + std::string type = item.AsString(); + if (type == "none" || type == "0") { + cpu->has_fpu = 0; + } else if (type == "68881" || type == "1") { + cpu->has_fpu = 1; + } else { item.Err(); return false; } @@ -103,6 +107,7 @@ MPU680x0Device::ResetHard(bool poweron) if (poweron) { m68030_power_on(cpu); } + resetting = true; // リセット例外を 520 クロック後に起こす。 // 520 は、電源オン時、Vcc が最小動作規定値に達してから最低 520 クロック @@ -123,6 +128,7 @@ MPU680x0Device::ResetHard(bool poweron) void MPU680x0Device::ResetCallback(Event& ev) { + resetting = false; intr_pending = false; // リセット例外を実行 @@ -137,7 +143,7 @@ MPU680x0Device::ResetCallback(Event& ev) exec_event.func = exec_short; exec_event.time = cycle * clock_nsec; exec_event.SetName("MPU Execute"); - gScheduler->StartEvent(exec_event); + gScheduler->RestartEvent(exec_event); } else { // リセット例外でダブルバスフォールトならここで停止。 } @@ -161,6 +167,8 @@ MPU680x0Device::ExecShort(Event& ev) void MPU680x0Device::ExecFull(Event& ev) { + intr_pending |= m68030_check_interrupt(cpu); + if (intr_pending) { // 割り込み処理を起動。 @@ -253,7 +261,6 @@ void MPU680x0Device::CheckIntr() { MakeNextFull(); - intr_pending |= m68030_check_interrupt(cpu); } // 次の命令境界は Full にする。