const SCRW = 560 const SCRH = 448 const CHARW = 7 const CHARH = 16 const ROWS = 28 const COLS = 80 const TITLEBAR_COL = 254 const TOOLBAR_COL = 64 const TOOLBAR_COL2 = 69 let isFileThere = filesystem.open("A", "/tvdos/bin/gfont.gz", "R") if (isFileThere != 0) { printerrln("Main Font file not found") return isFileThere } const fontMainTexBytes = gzip.decomp(filesystem.readAll("A")) const fontMainTex = new GL.Texture(CHARW*16, CHARH*16, fontMainTexBytes) const fontMain = new GL.SpriteSheet(CHARW, CHARH, fontMainTex) function drawInit() { con.reset_graphics();con.curs_set(0);con.clear(); graphics.clearPixels(255);graphics.resetPalette();graphics.setFramebufferScroll(0,0); for(let i=0;i 0) { let scrollY = graphics.getFramebufferScroll()[1] let cp = unicode.utf8toCodepoints(str) for (let i = 0; i < cp.length; i++) { let c = cp[i] if (10 == c || 13 == c) { curs = ((curs / COLS)|0) * COLS + COLS } else { paintGlyph(c, 1+(curs % COLS), 1+(curs / COLS), ttyBack, ttyFore, scrollY) curs += 1 } } } } // TODO basically port the GraphicsAdapter.kt into here