From 848103f5e42797500d7e1ad185981221098b3a2b Mon Sep 17 00:00:00 2001 From: Anachronaut Date: Sun, 30 Aug 2026 17:46:49 -0400 Subject: [PATCH] Grid: ask the screen how wide it is It said forty and filled exactly half of an eighty column screen. CosmOS asks for the wide mode when it starts, because its own help text is seventy-four characters across. So a program that assumes the shape the MACHINE wakes up in is wrong about the shape the SYSTEM is running in - and the Programming Manual says as much where it describes the columns and rows registers: how big the screen is, is asked for rather than assumed. Port 0x32 says. One instruction, and the program now fills whatever it is given. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW --- Programs/CosmOS/Apps/Grid.asm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Programs/CosmOS/Apps/Grid.asm b/Programs/CosmOS/Apps/Grid.asm index 217f9a2..06589fa 100644 --- a/Programs/CosmOS/Apps/Grid.asm +++ b/Programs/CosmOS/Apps/Grid.asm @@ -329,7 +329,13 @@ everyRow: SETD.0 RowAttribute STQ.0 - INIA 0d40 + ; ---- How wide the screen is, asked rather than assumed ---- + ; + ; This said forty, and filled exactly half of an eighty column screen. CosmOS asks for the + ; wide mode when it starts, because its own help text is seventy-four characters across - + ; so a program that assumes the shape the MACHINE wakes up in is wrong about the shape the + ; SYSTEM is running in. The screen will say if it is asked. + INA 0x32 SETD.0 RowCells STA.0