Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions core/pitfalls/lowres-8-planes-ecsena-blank.md
Original file line number Diff line number Diff line change
@@ -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 |
82 changes: 82 additions & 0 deletions os/pitfalls/locale-preflanguages-native-names.md
Original file line number Diff line number Diff line change
@@ -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:<language>/` or `PROGDIR:docs/<language>/`, 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 |