From ce42b55a58e9959938a14f7a64de5eb7446b6094 Mon Sep 17 00:00:00 2001 From: WDrijver Date: Tue, 24 Nov 2026 21:52:51 +0100 Subject: [PATCH] Pitfalls: LowRes 8 planes blank with ECSENA (Core 12856); loc_PrefLanguages native names Co-Authored-By: Claude Opus 5.5 --- core/pitfalls/lowres-8-planes-ecsena-blank.md | 71 ++++++++++++++++ .../locale-preflanguages-native-names.md | 82 +++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 core/pitfalls/lowres-8-planes-ecsena-blank.md create mode 100644 os/pitfalls/locale-preflanguages-native-names.md diff --git a/core/pitfalls/lowres-8-planes-ecsena-blank.md b/core/pitfalls/lowres-8-planes-ecsena-blank.md new file mode 100644 index 0000000..8117503 --- /dev/null +++ b/core/pitfalls/lowres-8-planes-ecsena-blank.md @@ -0,0 +1,71 @@ +--- +title: LowRes with 8 bitplanes stays blank while BPLCON0 ECSENA is set +type: pitfall +owner: WDrijver +status: draft +origin: ai-assisted +basis: [measured] +components: [saga-video-isabelle] +applies_to: + core: "Core 12856" + os: [any] + mode: [any] + board: [v4-unicorn] +last_verified: 2026-11-24 +tags: [aga, bplcon0, ecsena, lowres, 256-colours, ham8, copper, planar] +related: + - core/saga-registers/chunky-plane.md +sources: + - "ApolloOS-Port, arch/m68k-amiga/hidd/amigavideo/amigavideo_chipset.c, commit f93703c1 (2026-11-24)" + - "Hardware test on a V4 Unicorn, Core 12856: BPLCON0 patched in the live copper list" +--- + +## Symptom + +An AGA LowRes screen with 8 bitplanes (256 colours or HAM8) shows only the +border colour: the whole display window is one flat colour (colour 0), +although the copper list, the bitplane pointers and the bitmap data are +right. The system keeps running. The same screen in HiRes or SuperHiRes +with 8 planes shows, and LowRes with 1 to 7 planes shows. + +## Cause + +On this core, BPLCON0 bit 0 (ECSENA, "enable BPLCON3 features") together +with BPU3 (bit 4, 8 planes) and HIRES/SHRES clear blanks the bitplane +display. The same value with ECSENA clear shows the picture. Classic AGA +(Lisa) shows both. The SAGA register documentation lists only the OCS bits +of BPLCON0 (no ECSENA, no BPU3), so this is not documented behaviour. + +The AROS-derived `amigavideo.hidd` sets ECSENA in every copper list +(`bplcon0_null = system_bplcon0 | 1`), which runs into this. + +## Wrong + +```c +/* copper list: LowRes, 8 planes, ECSENA set */ +COPPEROUT(c, 0x0100, 0x0211); /* BPU3 | COLOR | ECSENA: blank display */ +``` + +## Right + +```c +/* LowRes with 8 planes: leave ECSENA out of BPLCON0 */ +UWORD bplcon0 = 0x0210; /* BPU3 | COLOR: 256 colours show */ +if (depth > 7 && lowres) + bplcon0 &= ~0x0001; +``` + +## Detection + +A LowRes 256-colour or HAM8 screen that comes up as one flat colour while +`info screens` / the screen list shows it open with depth 8. Read the +copper list (GfxBase->LOFlist) and check BPLCON0 for `0x0211` (or +`0x0215` interlaced). + +## Evidence + +| Claim | Source | Core | Method | +|---|---|---|---| +| LowRes 8 planes with BPLCON0 `0x0211` shows only colour 0; the same copper list with `0x0210` shows the 256-colour Workbench | (M) 2026-11-24 | Core 12856 | Workbench on PAL:LowRes depth 8; one word of the live copper list in chip RAM poked with rxnet, screen captured after each value | +| LowRes 2, 6, 7 planes and HiRes 2, 8 planes show with ECSENA set | (M) 2026-11-24 | Core 12856 | Same Workbench, screen mode switched through ENV:Sys/screenmode.prefs | +| SAGA BPLCON0 documentation lists no ECSENA and no BPU3 | (official) sagadoc bplcon0.htm | any | Read | diff --git a/os/pitfalls/locale-preflanguages-native-names.md b/os/pitfalls/locale-preflanguages-native-names.md new file mode 100644 index 0000000..d6fdf44 --- /dev/null +++ b/os/pitfalls/locale-preflanguages-native-names.md @@ -0,0 +1,82 @@ +--- +title: loc_PrefLanguages holds native names, not the LOCALE:Catalogs directory names +type: pitfall +owner: WDrijver +status: draft +origin: ai-assisted +basis: [source-code, measured] +components: [libraries] +applies_to: + core: "any" + os: [apolloos-r10] + mode: [os-friendly] +tags: [locale, localisation, catalogs, languages, help] +related: [] +sources: + - "ApolloOS-Port, workbench/libs/locale/initlocale.c (BuildPreferredLanguages, LanguagesOnDiskNames)" + - "ApolloOS-Port, workbench/utilities/Help/main.c, commit b3765aa1 (2026-11-24)" +--- + +## Symptom + +A program builds its own per-language path from the user's language, for +example `HELP:/` or `PROGDIR:docs//`, next to the +catalogs in `LOCALE:Catalogs/german/`. Catalogs come up in the user's +language, but the program's own files are never found and it falls back +to English. + +## Cause + +On ApolloOS (AROS locale.library), `struct Locale` `loc_PrefLanguages[]` +holds the **native** language names that the `.language` files report: +`deutsch`, `nederlands`, `français`, `italiano`, `español`, `polski`, +`português`. Prefs/Locale stores the **on-disk** names (`german`, `dutch`, +`french`, ...) and `OpenCatalog()` maps native to on-disk internally +(`LanguagesOnDiskNames`), which is not public. Code that puts +`loc_PrefLanguages[i]` into a path therefore looks for `HELP:deutsch` +while the directories, like `LOCALE:Catalogs/`, are named `german`. +Several native names are not ASCII. + +## Wrong + +```c +struct Locale *loc = OpenLocale(NULL); +snprintf(path, sizeof(path), "HELP:%s/%s.guide", + loc->loc_PrefLanguages[0], name); /* HELP:deutsch/... */ +``` + +## Right + +```c +/* map the native names of the languages you ship files for */ +static const char *const map[][2] = { + { "deutsch", "german" }, { "nederlands", "dutch" }, + { "fran\xe7" "ais", "french" }, { "italiano", "italian" }, + { "espa\xf1ol", "spanish" }, { "polski", "polish" }, + { "portugu\xea" "s", "portuguese" }, { NULL, NULL } }; + +static CONST_STRPTR disk_name(CONST_STRPTR native) +{ + int i; + for (i = 0; map[i][0]; i++) + if (Stricmp(native, map[i][0]) == 0) + return map[i][1]; + return native; /* try it as it is */ +} +``` + +Split hex escapes before a following hex letter (`"fran\xe7" "ais"`): +`"fran\xe7ais"` is one out-of-range escape. + +## Detection + +Set a language in Prefs/Locale, reboot, and check that the program's own +per-language files (not only its catalog) appear. Print +`loc_PrefLanguages[0]` from a test program. + +## Evidence + +| Claim | Source | Core | Method | +|---|---|---|---| +| `loc_PrefLanguages` is built from the native names; catalogs use `LanguagesOnDiskNames` | (SRC) workbench/libs/locale/initlocale.c | any | Read | +| Utilities/Help opened the English guide with German set, the German guide after mapping `deutsch` to `german`; same for the six other languages | (M) 2026-11-24 | Core 12856 | ApolloOS R9.9 dev card, locale.prefs per language, reboot, Help Copy, screen captured |