--- nono/vm/syncer.h 2026/04/29 17:05:42 1.1.1.6 +++ nono/vm/syncer.h 2026/04/29 17:05:50 1.1.1.7 @@ -10,7 +10,6 @@ #pragma once -#include "event.h" #include "fixedqueue.h" #include "message.h" #include "stopwatch.h" @@ -27,13 +26,12 @@ class Syncer : public Device // ビットがすべて %0 なら高速モード、どれかでも %1 なら通常モードになる。 // // | b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | - // mode | |POFF|KEY |BOOT|SYNC|HALT|IDLE| - // | | | | | +---- CPU & DMAC アイドル - // | | | | +--------- CPU HALT - // | | | +-------------- 高速モード抑制 - // | | +------------------- ブートページ実行中 - // | +------------------------ キー入力中 - // +----------------------------- 電源オフ + // mode | |POFF|KEY |SYNC|HALT|IDLE| + // | | | | +---- CPU & DMAC アイドル + // | | | +--------- CPU HALT + // | | +-------------- 高速モード抑制 + // | +------------------- キー入力中 + // +------------------------ 電源オフ // // bit1,0 は CPU から来るが、このうち bit0 だけ DMAC からのアイドル // ビットとの積(AND) になっているので、mode 中の bit0 は CPU も DMAC も @@ -47,9 +45,8 @@ class Syncer : public Device static const uint32 SYNCMODE_IDLE = 0x0001; // CPU & DMAC アイドル static const uint32 SYNCMODE_CPU_HALT = 0x0002; // CPU が HALT 状態 static const uint32 SYNCMODE_SYNC = 0x0004; // 等速モード指示(UI) - static const uint32 SYNCMODE_BOOT = 0x0008; // ブートページ実行中 - static const uint32 SYNCMODE_KEY = 0x0010; // キー入力中 - static const uint32 SYNCMODE_POWEROFF = 0x0020; // 電源オフ + static const uint32 SYNCMODE_KEY = 0x0008; // キー入力中 + static const uint32 SYNCMODE_POWEROFF = 0x0010; // 電源オフ // 便宜上用意しておく static const uint32 SYNCMODE_CPU_NORMAL = 0x0000; // CPU が通常状態 @@ -89,9 +86,6 @@ class Syncer : public Device // true なら高速モード、false なら同期モード。 void RequestFullSpeed(bool enable); - // ブートページモードの変更を指示する。 - void RequestBootPageMode(bool isrom); - // キー入力状態の変更を指示する。 void RequestKeyPressed(bool pressed); @@ -111,7 +105,7 @@ class Syncer : public Device void ChangeMode(uint32 newmode); // 同期イベント - void SyncCallback(Event& ev); + void SyncCallback(Event *); // 動作モード変更メッセージ void ChangeModeMessage(MessageID, uint32); @@ -157,11 +151,12 @@ class Syncer : public Device uint64 next_perf_rtime {}; // 次回測定予定の実経過時間 uint64 last_perf_rtime {}; // 前回測定時の実経過時間 uint64 last_perf_vtime {}; // 前回測定時の仮想経過時間 + uint clock_khz {}; // MHz 表示用の定格クロック数 MPU680x0Device *mpu680x0 {}; // 同期イベント - Event sync_event { this }; + Event *sync_event {}; }; static inline Syncer *GetSyncer() {