Start-up and start menu
Overlay 249 · image 0x46760–0x474b9 (3,418 bytes) · 11 stub entries
All overlays · ← 248 · Resting · 250 · Loading a level →
In brief
Overlay 249 prepares a game session. Its routines load the item icons and set the mouse pointer, load ITEM.DAT, ITEMTYPE.DAT and the item, thrown-object and decoration shapes, reset the start-up tables and set the interface colours; it also holds the start menu screen, the start menu and the copy-protection check. The start menu is entered once, from the resident program start-up, before the game loop.
Every address on this page is a file offset in START.EXE; calls into resident code are given as analysis addresses. See how addresses are written.
How it fits together
The start menu first runs five set-up routines, then a small state machine that starts in state 4. Each choice leads to another overlay; dashed boxes are outside this overlay.
Entry points
Stub entries whose target is resolved, from the stub bytes or another independent anchor, or through the portal reading.
| Encoded entry | Target | Role |
|---|---|---|
| entries 0–10 | 0x4703b, 0x46875, 0x467c2, 0x47086, 0x46b46, 0x468d7, 0x47181, 0x46760, 0x46fcd, 0x46c27, 0x46eef | See the routines |
Only entries 3 and 9 are called from resident code, at 0x18c55 and
0x18c50, and entry 6 from overlay 252 (0x4b1ea); the others are reached
only from inside the overlay.
Routines at a glance
| Routine | Address |
|---|---|
| Load the item icons and set the pointer | 0x46760 |
Load ITEM.DAT | 0x467c2 |
Load ITEMTYPE.DAT | 0x46875 |
| Load the item and thrown shapes | 0x468d7 |
| Reset start-up tables | 0x46b46 |
| Load decoration shapes | 0x46c27 |
| Set the interface colours | 0x4703b |
| Show the start menu screen | 0x46eef |
| Start menu | 0x47086, 0x46fcd |
| Copy-protection check | 0x47181 |
Routines
Load the item icons and set the pointer
| Address | Range | Status |
|---|---|---|
0x46760 | 0x46760–0x467c1 | — |
The first step of the start-up (0x4708a). It decodes
ITEMICN.CPS into page 3 through the CPS image loader,
cuts its first 16 × 16 icon with the shape encoder
into item icon 0 (DS:0xcee6, also kept in DS:0xcc14) and passes it, with
hot spot (0, 0), to resident 0x337d0, which stores it as the mouse pointer
when a mouse is in use. The other 111 icons are cut later by
0x468d7.
Used by: How it fits together, How input works › The pointer and the item it carries
Load ITEM.DAT
| Address | Range |
|---|---|
0x467c2 | — |
Loads the 14-byte item records and 35-byte names of
ITEM.DAT, with separate
counts, neither of them compared with the storage. The
record loop (test at 0x46827, signed jl against DS:0xd1c8) writes
DS:0x71ca + 14 × i, whose 600 entries end at
DS:0x929a. The name loop (test at 0x46863, signed jl against DS:0xe5a0)
writes the far segment fixed up from operand 0x698: its segment-table entry,
at file offset 0x2dbb8, gives paragraph 0x27da and the size word 0x11c6,
4,550 bytes or 130 × 35; the next entry's paragraph is 0x28f7.
Used by: Initial items (ITEM.DAT) › Reading the file, Item entry › In brief, Item properties in conditions › Name tests, Items › Where item data comes from, The item types, Transfer: spells and items
Load ITEMTYPE.DAT
| Address | Range |
|---|---|
0x46875 | — |
Loads the counted 16-byte entries of
ITEMTYPE.DAT.
Used by: Item entry › Layout, Item type entry › In brief, Item types (ITEMTYPE.DAT) › Reading the file, Items › Where item data comes from, The item types
Load the item and thrown shapes
| Address | Range |
|---|---|
0x468d7 | 0x468d7–0x46b45 |
Cuts with the shape encoder 11 large item shapes
from ITEML1.CPS and 26 small ones from ITEMS1.CPS into the item shapes
used through the item shape by icon, the 13
thrown shapes from THROWN.CPS, five more shapes of
that image (three Burning Hands flames, the background of a portrait's
damage number and that of the hand result label), and 112 icons from ITEMICN.CPS.
Comparative source: REF-SCUMM-016,
drawFlyingObjects (_largeItemShapes, _smallItemShapes,
_thrownItemShapes).
Used by: Spots and wall decorations › Where objects are drawn, Images, palettes and fonts, Compressed containers (CPS), Decoration, door and monster images, Dungeon graphics, Scenes and sequence pictures
Reset start-up tables
| Address | Range |
|---|---|
0x46b46 | 0x46b46–0x46c26 |
Called by the start-up function 0x47086.
Sets the swap selection to 0xff, clears
several tables of far pointers and, for characters 1 to 5
(0x46bdc–0x46c21), writes the character's number into byte 0 of its
record (0x46bf0) and stores in
face_image the pointer returned by an allocation of 0x578 bytes
(0xc8:0xb).
Used by: Character record › Unused bytes
Load decoration shapes
| Address | Range |
|---|---|
0x46c27 | — |
The other shapes it grabs are not listed.
First calls the item and thrown shape loader. Loads
DECORATE (at 0x46c3a) and grabs shapes from it: at 0x46c46–0x46cbd
the six temporary-wall shapes and at 0x46cbe–0x46d33 the six sparkle
shapes, at the rectangles of the data segment, into the
teleporter and temporary-wall tables; the
lightning column shape at 0x46e64; and, at
0x46e72–0x46ee4, the twelve compass shapes: three parts
for each direction, taken three columns apart with the
compass part sizes. In DECORATE.CPS the main parts read
N, E, S and W.
Used by: Directions, Blocks, directions and positions › Directions and coordinates, Run a special event › Lightning (event 0), Spots and wall decorations › Where objects are drawn, Images, palettes and fonts, Compressed containers (CPS), Decoration, door and monster images, Dungeon graphics, Scenes and sequence pictures
Set the interface colours
| Address | Range | Status |
|---|---|---|
0x4703b | 0x4703b–0x47085 | — |
The last set-up step of the start-up (0x4709b). It stores
fourteen constant palette indices into bytes of the data segment, the only
writes to them found: among them the window and button background
DS:0xe606 (0xb7) and the two box-edge colours DS:0xeef0 (0xb5) and
DS:0xe5c2 (0xba), which the box drawing, the dialogue buttons, the
copy-protection check and the camp menu
use. The others colour the spell book (unselected
tabs DS:0xe444, 0xdf32, 0xdf44; the bottom-row boxes DS:0x9364,
0x929a, 0x6d81, also the text background of the book and of the
character sheet), the empty part of the
hit-point and food bars (DS:0x6d80) and the box
of the hand result label (DS:0x92d8, 0x71ae,
0x71bf). It also writes 0x85 to DS:0xe5c3 (0x4704d), which nothing reads.
Used by: How it fits together
Show the start menu screen
| Address | Range |
|---|---|
0x46eef | 0x46eef–0x46fcc |
Loads MENU.CPS with its palette through
load a picture with its palette into page 3; in
display mode 5 it replaces that palette with the 768 bytes of MENU.EGA.
It sets the palette, copies page 3 to page 2, writes the version string
"V 1.1" at (234, 160) in colour 13, and copies the whole page to the
screen. The start menu calls it before showing its items, and again after
a failed load and after a transfer that returned without a party
(0x470b2, 0x470e2, 0x47140).
Used by: Start menu, The start menu, questions and text › The start menu, Images, palettes and fonts, Texts, Palettes (PAL, EGA, COL)
Start menu
| Address | Range |
|---|---|
0x47086, 0x46fcd | 0x47086–0x47174, 0x46fcd–0x4703a |
Caller: the program start-up only, once, at
0x18c55 (call 0x2add:0x2f), before the game loop.
A state machine with a jump table at 0x47175, starting in
state 4. 0x46fcd shows the start menu items and returns
the choice plus one, which becomes the next state: 1 loads a saved game
through overlay 251 (0x470bf); 2 runs the
party creation screen (0x47103); 3 calls overlay 254
0x4d004, the transfer of an Eye of the Beholder I party,
and returns to the menu when it returns 0 (0x47132); 4 runs overlay 255 0x4e0b3, the
introduction, then the menu (0x47157); 5 exits.
It writes 0xff, 0xfe (a game was loaded) or 0 (a new party) to the
level start selector.
Comparative source: REF-SCUMM-017, the start loop
of EoBCoreEngine::go.
Used by: Transferring a party from Eye of the Beholder I › Transferring a party from Eye of the Beholder I, Level records and level changes › A new game, The game loop › How the game ends, The start menu, questions and text › The start menu, Sound and music, Transfer: spells and items, The introduction, Item types (ITEMTYPE.DAT) › Reading the file, Initial items (ITEM.DAT) › Reading the file
Copy-protection check
| Address | Range |
|---|---|
0x47181 | — |
Asks for the password; on failure the program exits.
Comparative source: REF-SCUMM-009, checkPassword.
Used by: Run a sequence › Protection check, Scripted sequences, Scripted characters, flags and messages › Special events and sequences
Sources
The executable is identified in the file inventory; the overlay layout is described on the overlays page. Comparative sources are listed in the technical references.