Skip to main content

Module menus

Module menus 

Source
Expand description

The built-in menus, read from the ROM image: which commands each menu number offers and which keys lead to submenus.

Where the definitions are (wiki: protocols/rpl-libraries, “Built-in menus”): MENU’s own code names them, either as a list whose element n is menu n (48SX), or as a library whose command n is menu n (48GX and 49G: a library number in MENU’s code whose commands carry no names and are menu definitions). A definition is a list of keys, an array of XLIB names (one per key), or a program that builds the list. A key is a command (its name is the label), a { label action } list whose action runs commands or switches to another menu, or a unit name.

Nothing ROM-specific is compiled in: the reader finds the definitions from MENU’s code in the loaded image. Work is bounded: at most MAX_STEPS objects are visited, nesting at most MAX_NESTING.

Structs§

MenuDef
What one menu offers.
MenuKey
One key of a menu as its definition gives it.
Menus
The built-in menus of one ROM, by menu number.

Constants§

MAX_NESTING
Deepest nesting followed inside one definition.
MAX_STEPS
Most objects one read visits (the 49G’s menu library holds about 440 definitions of a few dozen keys each).

Functions§

read
The menus of the ROM image rom (one nibble per element), named through names, the table built from the same image for its model (which also knows whether the image is banked). None when MENU or its definitions cannot be found (also for models whose name table is empty: the 38G, 39G, 40G and 42S).