
MSXの互換BIOSを持つ超軽量エミュレーター「MIX」に画面をくっつけるためにWebGLを使ったパフォーマンスが良いスクリーンを実装しました。

「MIX SCREEN 1 DEMO by WebGL」 src on GitHub
8x8のフォントデータ2048byteと、32x24のテキストVRAM768byteを変更すると、WebGLを使って高速画面描画する拡張タグ mix-screen1 ができました!
import { MIXScreen1 } from "https://ichigojam.github.io/MIX/MIXScreen1.js";
import { rnd } from "https://js.sabae.cc/rnd.js";
const scr1 = await MIXScreen1.create();
main.appendChild(scr1);
const draw = () => {
const fontROM = scr1.fontROM;
const textVRAM = scr1.textVRAM;
const n = 10;
for (let i = 0; i < n; i++) {
textVRAM[rnd(textVRAM.length)] = rnd(256);
}
const m = rnd(256);
for (let i = 0; i < 8; i++) {
fontROM[m * 8 + i] ^= 0xff;
}
scr1.draw();
requestAnimationFrame(draw);
};
draw();
RUN on ES-Jam
シンプルに書けていい感じ!

IchigoJamFONTをPNGやバイナリ化して、対応。他、いろいろとご活用ください!
続いて、Z80とBIOSと接続していきます!
links
- MIX - 超軽量MSXエミュレーター with Z80.js