--- nono/vm/cgrom.h 2026/04/29 17:04:28 1.1.1.1 +++ nono/vm/cgrom.h 2026/04/29 17:04:35 1.1.1.2 @@ -1,10 +1,43 @@ // // nono -// Copyright (C) 2018 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #pragma once #include "header.h" -extern uint8 builtin_cgrom[]; +// 内蔵 CGROM データへのポインタ +class BuiltinCGROM +{ + public: + static const uint8 * Get8x8(uint ch = 0) { + return &data[0x3a000 + ch * 8]; + } + static const uint8 * Get12x12(uint ch = 0) { + return &data[0x3b800 + ch * 24]; + } + + // 1バイト半角文字 + static const uint8 * Get6x12(uint ch = 0) { + return &data[0xbf400 + ch * 12]; + } + static const uint8 * Get8x16(uint ch = 0) { + return &data[0x3a800 + ch * 16]; + } + static const uint8 * Get12x24(uint ch = 0) { + return &data[0x3d000 + ch * 48]; + } + + // 2バイト全角文字 + static const uint8 * Get16x16(uint ch = 0) { + return &data[0x00000 + ch * 32]; + } + static const uint8 * Get24x24(uint ch = 0) { + return &data[0x40000 + ch * 72]; + } + + private: + static uint8 const data[]; +};