--- nono/vm/planevram.h 2026/04/29 17:05:11 1.1.1.1 +++ nono/vm/planevram.h 2026/04/29 17:05:18 1.1.1.2 @@ -19,13 +19,8 @@ class PlaneVRAMDevice : public IODevice { using inherited = IODevice; - protected: - // ショートカット - static const int BLKX = Renderer::BLKX; - static const int BLKY = Renderer::BLKY; - public: - PlaneVRAMDevice(const std::string& objname_, int width_, int height_); + PlaneVRAMDevice(int width_, int height_); virtual ~PlaneVRAMDevice() override; void ResetHard(bool poweron) override; @@ -48,10 +43,8 @@ class PlaneVRAMDevice : public IODevice // 合成ビットマップを取得する const BitmapI8& GetComposite() const { return composite; } -#if defined(PERF_HIT) - // ブロックのヒット効率(?)を調べる - std::array dirty_word {}; -#endif + // 座標位置の情報を出力 (GUI 用) + virtual void UpdateInfo(TextScreen&, int x, int y) const = 0; protected: // 全画面の更新フラグを立てる @@ -63,6 +56,9 @@ class PlaneVRAMDevice : public IODevice // BitmapI8 バッファから BitmapRGB を作成する。 void RenderCompositeToRGB(BitmapRGB& dst, const ModifyInfo& modify); + // X 方向にはみ出したときに対応する仮想画面の Y 座標を返す。 + virtual int GetWrapY(int) const = 0; + // ビットマッププレーン。 // メモリを確保する時のサイズ計算のため型を uint8 にしているが、 // 運用はロングワードでホストバイトオーダー。 @@ -75,14 +71,10 @@ class PlaneVRAMDevice : public IODevice // テキスト画面の合成ビットマップ BitmapI8 composite {}; - // 更新フラグ。 - // Lunafb では 1024、TVRAM では 512個。 + // 仮想画面の更新フラグ。仮想 Y 座標に対応するので + // Lunafb も TVRAM も 1024個。 std::vector dirty {}; - // ModifyInfo.bits に対するマスク。横方向のブロック数によって決まり、 - // Lunafb では 0xffff、TVRAM では 0xff00。 - uint16 modify_mask {}; - // レンダリング時に使う変換テーブル std::unique_ptr deptable {}; @@ -94,4 +86,6 @@ class PlaneVRAMDevice : public IODevice int yscroll {}; }; -extern PlaneVRAMDevice *gPlaneVRAM; +static inline PlaneVRAMDevice *GetPlaneVRAMDevice() { + return Object::GetObject(OBJ_PLANEVRAM); +}