#1640·v86

use_graphical_text draws most text rows wrong since 0.5.431

Author: jannschuCreated Sep 24, 2026Updated Sep 24, 2026

With screen: { use_graphical_text: true }, the canvas shows the first row correctly, then each following row keeps only the pixels it shares with the rows above, so most rows end up blank. get_text_screen() and VGA memory are correct. The SeaBIOS boot messages with no disk attached show it too.

Regression from 6eda8ff5 ("don't raise on 0 column text render"). The early return 0 makes Closure (v20210601) inline render_changed_rows differently and hoist fg_rgba out of the row loop, so it is no longer undefined at the start of each row. From row 2 on, fg_x stays unset and the final fillRect(fg_x, ...) draws nothing. In libv86.js 0.5.462: let Ia,Pa,Qa;for(let ta=0; (3 vars, fg_rgba is the outer L).

  • npm 0.5.430: OK, 0.5.431 to 0.5.462: broken
  • built from source: 6eda8ff5~1 OK, 6eda8ff5 broken, HEAD (5f9a90f2) broken and identical to npm 0.5.462

Fix, tested: move the check to the caller.

diff
-        if(gfx_width === 0)
-        {
-            return 0;
-        }
-
...
-            if(render_changed_rows())
+            if(text_mode_width * font_width !== 0 && render_changed_rows())

let fg_rgba = undefined, fg_x, bg_rgba = undefined, bg_x; also works.

Chrome, macOS.