--- nono/vm/lcd.h 2026/04/29 17:05:10 1.1.1.9 +++ nono/vm/lcd.h 2026/04/29 17:05:33 1.1.1.13 @@ -11,14 +11,13 @@ #pragma once #include "device.h" -#include "monitor.h" class LCDDevice : public Device { using inherited = Device; public: LCDDevice(); - virtual ~LCDDevice() override; + ~LCDDevice() override; void ResetHard(bool poweron) override; void PowerOff() override; @@ -53,7 +52,7 @@ class LCDDevice : public Device const uint8 *GetDDRAM() const { return ddram; } // フォントを取得 - const uint8 *GetFont(int ch) const; + const uint8 *GetFont(uint ch) const; private: DECLARE_MONITOR_CALLBACK(MonitorUpdate); @@ -61,7 +60,7 @@ class LCDDevice : public Device // 現在のアドレスでデータレジスタにラッチ void LatchData(); // アドレスカウンタ設定 - void SetAddr(int addr, bool is_cgram); + void SetAddr(uint addr, bool is_cgram); // アドレスカウンタを次へ進める void NextAddr(); @@ -77,15 +76,17 @@ class LCDDevice : public Device uint8 data_reg {}; // アドレスカウンタ - int addr_counter {}; + uint addr_counter {}; bool addr_is_cgram {}; // addr が CGRAM アドレスなら true uint8 ddram[0x80] {}; uint8 cgram[0x40] {}; - Monitor monitor { this }; + Monitor *monitor {}; static const uint8 CGROM[12 * 16 * 8]; }; -extern LCDDevice *gLCD; +static inline LCDDevice *GetLCDDevice() { + return Object::GetObject(OBJ_LCD); +}