Level state data
Data · Routines · Address index
The current level and its blocks, saved-game tables and descriptions, option settings and the start menu. The data page explains how the entries are written.
DS:0x1346 — Saved-game chunk lengths
- Layout: 7 dwords
- Role: Expected lengths of the seven chunks of a saved game, checked by
the save reader:
0x14,0x816,0x5c,0x20d0,0x8d72, 3 and0x60in the executable's data, the same lengths the save writer uses. - Used by: Saved games (SAV) › Organization, Loading, failures and the end of the game › Loading a saved game, Loading, failures and the end of the game › When saving or loading fails
DS:0x65fa, DS:0x65fc, DS:0xe4c5 — Option settings
- Layout: words
0x65faand0x65fc, byte0xe4c5 - Role: On/off settings shown by the game menu of overlay 247 as
"Sounds" (
0x65fa), "Tunes" (0x65fc) and "Bar Graphs" (0xe4c5). A saved game keeps one byte of each, in the order tunes, sounds, bar graphs. - Comparative source: REF-SCUMM-015,
saveAsOriginalSaveFile. - Used by: Saving and restoring › What a saved game holds, Play a sound › Behavior, Sound effects, Camp menus › The camp menu, How input works › Keys and mouse presses, Saved games (SAV)
DS:0xee3f — Saved-game descriptions
- Layout: six 20-byte strings, one per save slot 0–5; the byte before
them,
DS:0xee3e, has one bit per slot whose file exists - Role: The description of each save slot, edited by the
save menu and written as the first chunk of the
saved game by the save writer. The
save reader does not restore it. The slot list of
the load menu (
0x4a117) sets each bit ofDS:0xee3eand reads the description from eachEOBDATA<n>.SAVthat exists, and clears both for the others. ForFINAL.SAV, slot −1, the writer readsDS:0xee2b–0xee3e, the 20 bytes before the table (0x49993–0x499a1; ANOMALY-72). - Used by: Saving and restoring › What a saved game holds, Loading, failures and the end of the game, Loading, failures and the end of the game › The end of the game, Camp menus › Saving and loading, Texts, Saved games (SAV)
DS:0x6542, DS:0x658a — Restore and save routines
- Layout: far pointers
- Role: Indirect pointers to a restore routine and a save routine: slots 8 and 26 of the driver function table, filled by the display driver.
- Used by: —
DS:0x6dce — Current level
- Layout: word
- Role: The level being played. It starts a
0x5c-byte block,DS:0x6dce–0x6e29, saved as one chunk of a saved game: current level, sublevel, party block, party direction, held item, saved-level bits,DS:0x6ddc, a byte at0x6de0that no code reads or writes except as part of this block, the rest refusal flag, the level flags and the global script flags. - Used by: Flag operation targets › Forbidding rest, Item entry › In brief, Level 4: the forest › In brief, Saving and restoring › What a saved game holds, How a script runs › Scripts and the game's state, Saved games (SAV)
DS:0x6dd0 — Sublevel
- Layout: word
- Role: Sublevel argument stored by the
INF level loader: the index of the sublevel record
selected in the level's INF file. Kept in a saved
game with the current level. Copied to byte
0x1dof each initialized monster slot, which only the monster count of conditions reads back. - Used by: Level 4: the forest › In brief, Sublevels › The two records, Place a monster › Initializing the monster, Test a condition › Monster counts
DS:0x6dd8 — Saved-level bits
- Layout: dword
- Role: Bit n − 1 is set when the record of level n is written,
by the level change or the
save writer. When the bit is set, loading the
level restores its walls, monsters and temporary walls from the record and
skips the level's initial monsters. It is saved with the block that starts
at the current level. No code clears it: it is zero when the
program starts, because the C start-up code clears
DS:0x6c68–0xf2e5(analysis0x100a9–0x100b9), and only a loaded game replaces it. Every use builds the mask as a 16-bit1 << (level − 1)extended withcwd: the writers at overlay 2510x4944a–0x49451and0x4992c–0x49933, the tests at overlay 2500x48408–0x48412,0x48c9a–0x48ca4and0x48e57–0x48e61; for level 16 this sets or tests bits 15 to 31 (ANOMALY-138). - Used by: Level records and level changes › Level records, Level records and level changes › A new game, Level records (LEVELS.TMP) › Organization, Level records (LEVELS.TMP) › Lifetime of the file, Saved games (SAV) › Organization, Loading, failures and the end of the game, Anomalies and bugs
DS:0x6de1 — Rest refusal flag
- Layout: byte, inside the saved block starting at DS:
0x6dce - Role: When it is not zero, the rest routine refuses to rest.
- Used by: Clear a flag › Encoding, Flag operation targets › Forbidding rest, Resting: special cases › Anomalies while resting, Resting › Resting, Resting › Whether the party can rest, Scripted characters, flags and messages › Flags and resting, Set a flag › Behavior, Saved games (SAV), Level 7: reference tables › Arrival and the way down
DS:0x9316 — Level start selector
- Layout: byte
- Role: Tells the start of the game what the start-up screen did. 0
starts a new game (see
choose between a new game and the current level);
0xff, set by the start-up screen before it reads a saved game, makes the saved-game reader stop before loading the level (0x49eec); any other value makes the start of the game load the restored level. Written by overlay routines0x47086(0 after a party is created or transferred or when a load fails,0xffbefore a load,0xfeafter a successful one) and0x49b60(0 when a chunk is short, otherwise 1), and cleared by0x1caf7. - Used by: Changing level › When the game loads a level, Loading, failures and the end of the game › Loading a saved game, Test a condition › The expression stack
DS:0x0ffa — Start menu items
- Layout: far pointers to the strings LOAD GAME IN PROGRESS (
DS:0x106a), START A NEW PARTY, TRANSFER EOB I PARTY, RUN INTRODUCTION and EXIT TO DOS - Role: Items of the start menu, in the order of its choices.
- Used by: The start menu, questions and text › The start menu, Texts
DS:0xa360 — Level blocks
- Layout: 1,024 blocks of 10 bytes
- Role: The blocks of the current level, one
LevelBlockRuntimeeach. The map reader clears the table and reads the six MAZ header bytes into its first entry (ANOMALY-64). - Used by: Level block › From the files to memory, Level block › In brief, Level data › Loading a level, Set walls or a direction › Behavior, Decoding status and unexpected values › Unexpected values, Level maps (MAZ), Level records (LEVELS.TMP) › What it becomes in memory, Level 1: reference tables › The spider quarter
DS:0xd0aa — State-change flag
- Layout: flag
- Role: Set to 1 by many state changes. Once per pass, the game loop calls the scene redraw when it is set, and the redraw clears it.
- Used by: The game loop › One pass of the game loop, Dialogue screen › Opening and closing the screen, Move the party, monsters or items › Item locations, Turn the party or flying objects › Behavior, Where each face goes on the screen › Special cases, Level 1: reference tables › The spider quarter
DS:0xdf3a — Level-data buffer
- Layout: far pointer
- Role: Set once by the program start-up
(
0x18b5a–0x18b69). Buffer holding the compressed INF data while a level loads, and the image of a saved game while one is written or read. - Used by: Level maps (MAZ) › Reading the file