--- nono/vm/bitmap.cpp 2026/04/29 17:04:31 1.1.1.3 +++ nono/vm/bitmap.cpp 2026/04/29 17:04:38 1.1.1.5 @@ -1,6 +1,7 @@ // // nono -// Copyright (C) 2018 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #include "bitmap.h" @@ -48,7 +49,7 @@ BitmapDevice::BitmapDevice() logname = "bitmap"; devname = "Bitmap"; devaddr = 0xb1000000; - monitor.Init(42, 11); + monitor_size = nnSize(42, 11); // XXX とりあえず。実際は設定による nplane = 1; @@ -318,8 +319,8 @@ BitmapDevice::Peek8(uint32 addr) return 0xff; } -bool -BitmapDevice::MonitorUpdate() +void +BitmapDevice::MonitorUpdate(TextScreen& monitor) { int i; @@ -349,8 +350,8 @@ BitmapDevice::MonitorUpdate() // 012345 // $0:RGB const uint8 *pal = gBT454->reg.color; - monitor.Print(29, 1, ""); - monitor.Print(32, 2, "RGB RGB"); + monitor.Puts(29, 1, ""); + monitor.Puts(32, 2, "RGB RGB"); for (i = 0; i < 16; i++) { uint rgb = ((pal[i * 3 + 0] & 0xf0) << 4) + @@ -358,8 +359,6 @@ BitmapDevice::MonitorUpdate() ((pal[i * 3 + 2] & 0xf0) >> 4); monitor.Print(29 + (i / 8) * 7, (i % 8) + 3, "$%x:%03x", i, rgb); } - - return true; } // 全画面の更新フラグを立てる @@ -646,8 +645,8 @@ BitmapDevice::EmuConsoleUpdate() uint32 ch0 = text[y * screen_w + x]; uint32 ch1 = text[y * screen_w + x + 1]; // その文字のフォントデータ上でのオフセット - uint32 fo0 = 0x3d000 + (ch0 & 0xff) * 48; - uint32 fo1 = 0x3d000 + (ch1 & 0xff) * 48; + const uint8 * const fo0 = BuiltinCGROM::Get12x24(ch0 & 0xff); + const uint8 * const fo1 = BuiltinCGROM::Get12x24(ch1 & 0xff); // 1,2文字目なら true、3,4文字目なら false bool evenpair = ((x & 2) == 0); @@ -659,8 +658,8 @@ BitmapDevice::EmuConsoleUpdate() for (int i = 0; i < 24; i++) { // その文字のフォントデータ - uint32 fdat0 = be16toh(*(uint16*)(&builtin_cgrom[fo0 + i * 2])); - uint32 fdat1 = be16toh(*(uint16*)(&builtin_cgrom[fo1 + i * 2])); + uint32 fdat0 = be16toh(*(const uint16*)(fo0 + i * 2)); + uint32 fdat1 = be16toh(*(const uint16*)(fo1 + i * 2)); // 属性はとりあえず反転のみサポート if ((ch0 & TA::On)) {