Skip to content

macpato82/DisplayManager

Repository files navigation

DisplayManager

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 target Display)
  • 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 NOTICE and LICENSE-Apache

Why this exists

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.

Layout

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

Building

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.).

  1. Drop the tree in at Sources/Video/UserI/Display of a RISC OS build.
  2. In BuildSys/ModuleDB, type the DisplayManager component as C (not ASM) so the ROM phase uses rom_link against RISC_OSLib:o.c_abssym.
  3. amu rom / amu install_rom for the ROM, or amu with MkRam for a standalone rm.Display relocatable module.

The cmhg header is processed by stock CMHG (not CMunge).

Technical notes (the things that made this non-trivial)

  • Runnable Wimp-task module + stack. A runnable C module entered via OS_Module Enter gets no valid C stack limit from the default C-library entry, so it aborts in the C kernel the moment Wimp_Initialise touches the stack machinery. cmhg/modhead therefore uses library-enter-code: to install s/veneer (display_entermodule), which claims a private RMA stack and sets both sp and sl before entering C at display_enter() — the same approach Desktop.ShellCLI uses, 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.

Status

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.

About

Converted RISC OS ASM Display Manager

Resources

License

Unknown, Apache-2.0 licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE-Apache

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors