--- nono/vm/console.h 2026/04/29 17:05:46 1.1.1.2 +++ nono/vm/console.h 2026/04/29 17:05:50 1.1.1.3 @@ -11,9 +11,9 @@ #pragma once #include "device.h" -#include "event.h" #include "keyboard.h" #include "renderer.h" +#include #include class BitmapRGBX; @@ -29,6 +29,8 @@ class ConsoleDevice : public Device static const uint font_width = 8; static const uint font_height = 16; + using bitsetH = std::bitset; + // 1文字 32ビットのうち下位8ビットが文字コード、上位24ビットが各種属性。 // // @@ -70,7 +72,7 @@ class ConsoleDevice : public Device bool Render(BitmapRGBX& dst); private: - void VSyncCallback(Event&); + void VSyncCallback(Event *); void SetPalette(bool console_is_active); void ResetTerminal(); void ResetState(); @@ -119,10 +121,10 @@ class ConsoleDevice : public Device int cur_y {}; // VM スレッド内での行ごとの更新情報。 - std::vector dirty {}; + bitsetH dirty {}; // レンダラスレッドで未処理の行。 // VM スレッドからレンダラスレッドへの連絡用なので mtx で保護する。 - std::vector pending {}; + bitsetH pending {}; std::mutex mtx {}; // 画面初期化。 @@ -154,7 +156,7 @@ class ConsoleDevice : public Device FILE *log {}; bool log_newline {}; - Event vsync_event { this }; + Event *vsync_event {}; Renderer *renderer {}; COMDriver *comdriver {};