The RISC OS screen-mode chooser — the iconbar Display icon and its mode /
colours / resolution / frame-rate dialogue. This is a from-scratch port of the
module from ARM assembler to C, behaviour-for-behaviour faithful to the
original Acorn module.
- Module name:
DisplayManager(ROM targetDisplay) - Current version: 0.56 (see
VersionNum) - Hardware-verified: Raspberry Pi 4 / CM4 (Titanium-class RISC OS 5 ROM)
- Licence: MIT (the 2026 port); derived from the original Acorn Computers
source, which remains under Apache-2.0 — see
NOTICEandLICENSE-Apache
The original module was ~4,300 lines of ARM assembler (s/Module, s/Front,
s/Mode, …). This repository is the C rewrite: the same SWIs, services,
messages, window/menu layout and mode-enumeration logic, expressed in C with the
poll loop, mode tables and menu builders ported one-for-one. The assembler
original is unchanged upstream; this is a parallel, faithful reimplementation.
c/ C sources (module, msgtrans, icon, window, mode, menu, mouse, message)
h/ Private headers (display, modedefs, options, wimpdefs)
cmhg/ CMHG module header (modhead)
s/ veneer — the application-entry assembler veneer (see "Stack" below)
Resources/ UK + Germany Messages & Templates, iconbar Sprite
Doc/ Acorn technical documentation for the module
Makefile RISC OS shared-makefile (CModule) build
VersionNum
This is a ROM C module built with the RISC OS DDE (amu) inside a RISC OS
source tree — it is not standalone-buildable without the build environment
(BuildSys, RISC_OSLib, the C library stubs, etc.).
- Drop the tree in at
Sources/Video/UserI/Displayof a RISC OS build. - In
BuildSys/ModuleDB, type theDisplayManagercomponent asC(notASM) so the ROM phase usesrom_linkagainstRISC_OSLib:o.c_abssym. amu rom/amu install_romfor the ROM, oramuwithMkRamfor a standalonerm.Displayrelocatable module.
The cmhg header is processed by stock CMHG (not CMunge).
- Runnable Wimp-task module + stack. A runnable C module entered via
OS_Module Entergets no valid C stack limit from the default C-library entry, so it aborts in the C kernel the momentWimp_Initialisetouches the stack machinery.cmhg/modheadtherefore useslibrary-enter-code:to installs/veneer(display_entermodule), which claims a private RMA stack and sets bothspandslbefore entering C atdisplay_enter()— the same approachDesktop.ShellCLIuses, and what the original assembler did with its own workspace stack. - Service / IRQ context is kept trivial. The service-call handler only sets poll-word flags; the deep work (menu rebuild, palette scan, Wimp calls) is deferred to the USR-mode poll loop, never run in the SVC service context.
- Path variable. Resources resolve through
DisplayManager$Path(one$); the assembler wrote$$because ObjAsm escapes$$→$, which does not apply in C.
Boots and runs on hardware: iconbar icon, mode/colours/resolution/rate menus and the mode dialogue all work. Known minor item: the entry veneer does not yet free its private stack on task quit (negligible; recovered on reset).
Original module © Acorn Computers Ltd; C port © 2026 RISCOS Technologies.
The C port is licensed under the MIT Licence — see LICENSE. The original
Acorn material remains under the Apache License 2.0 — see NOTICE and
LICENSE-Apache.