--- nono/vm/bt45x.cpp 2026/04/29 17:05:28 1.1.1.4 +++ nono/vm/bt45x.cpp 2026/04/29 17:05:59 1.1.1.8 @@ -28,9 +28,10 @@ #include "bt45x.h" #include "config.h" +#include "lunafb.h" #include "mainapp.h" +#include "monitor.h" #include "prom.h" -#include "renderer.h" #include "uimessage.h" // @@ -42,7 +43,7 @@ BT45xDevice::BT45xDevice() : inherited(OBJ_BT45x) { // func, size は継承先で決まる - monitor.Regist(ID_MONITOR_BT45x); + monitor = gMonitorManager->Regist(ID_MONITOR_BT45x, this); } // デストラクタ @@ -75,16 +76,13 @@ BT45xDevice::GetConfigPlaneCount() bool BT45xDevice::Init() { - if (inherited::Init() == false) { - return false; - } - int n = GetConfigPlaneCount(); // ここに来ているということはエラーは起きなかったはず。 assert(n >= 0); nplane = n; - renderer = GetRenderer(); + lunafb = GetLunafbDevice(); + uimessage = gMainApp.GetUIMessage(); // 継承先のコンストラクタでセットしている。 assert(palettes != 0); @@ -333,26 +331,15 @@ BT45xDevice::MakeHostColor(uint idx_) // 通知が必要なら別途行うこと。 } -// ゲストパレットを uint32 形式にしたものの一覧を返す。(GUI 用) -const std::vector -BT45xDevice::GetIntPalette() const -{ - std::vector ipal; - for (uint n = 0; n < palettes; n++) { - ipal.push_back(PaletteToInt(n)); - } - return ipal; -} - // 通知 void BT45xDevice::Notify() { // パレット変更が起きたことをレンダラに通知 - renderer->Invalidate2(); + lunafb->Invalidate2(); // UI にも通知 - UIMessage::Post(UIMessage::PALETTE); + uimessage->Post(UIMessage::PALETTE); } /*static*/ const char @@ -374,8 +361,8 @@ BT454Device::BT454Device() // 使わないけど一応 readmask = 0x0f; - monitor.func = ToMonitorCallback(&BT454Device::MonitorUpdate); - monitor.SetSize(63, 3); + monitor->SetCallback(&BT454Device::MonitorScreen); + monitor->SetSize(63, 3); } // デストラクタ @@ -384,7 +371,7 @@ BT454Device::~BT454Device() } void -BT454Device::MonitorUpdate(Monitor *, TextScreen& screen) +BT454Device::MonitorScreen(Monitor *, TextScreen& screen) { screen.Clear(); screen.Puts(0, 0, "Model: Bt454"); @@ -451,8 +438,8 @@ BT458Device::BT458Device() // 初期化されないそうなのでゴミを入れておく readmask = 0xcc; - monitor.func = ToMonitorCallback(&BT458Device::MonitorUpdate); - monitor.SetSize(116, 18); + monitor->SetCallback(&BT458Device::MonitorScreen); + monitor->SetSize(116, 18); } // デストラクタ @@ -486,7 +473,7 @@ BT458Device::Init() } void -BT458Device::MonitorUpdate(Monitor *, TextScreen& screen) +BT458Device::MonitorScreen(Monitor *, TextScreen& screen) { screen.Clear(); screen.Puts(0, 0, "Model: Bt458");