Input data
Data · Routines · Address index
Mouse, pointer and button state, the active button lists, floor buttons, the selected character and input recording. The data page explains how the entries are written.
DS:0x351c — Floor position table
- Layout: 4 × 4 bytes, indexed by direction and floor zone
- Role: Turns a floor zone of the view (0 near left, 1 near right, 2 far
left, 3 far right) into a position in a block (0 north-west, 1 north-east,
2 south-west, 3 south-east) for each direction:
0 1 2 3,1 3 0 2,3 2 1 0,2 0 3 1. Used by the floor routine. - Used by: Blocks, directions and positions › Floor positions
DS:0x3b50 — Floor buttons
- Layout: 4 button records at
DS:0x3b20,0x3b5c,0x3b98and0x3bd4(entries 8–11 of the main button list); callbacks atDS:0x3b50,0x3b8c,0x3bc8and0x3c04, zone at+0x38 - Role: The four floor zones of the view, each calling the floor routine with its zone number: (0, 102) and (89, 102), 88 wide and 18 high, for the near half; (0, 72) and (89, 72), 88 wide and 29 high, for the far half (screen coordinates; the view is 176 wide).
- Used by: Blocks, directions and positions › Floor positions
DS:0x47bc — Front-block action pointer
- Layout: far pointer, the callback field (
+0x30) of the front-block button record atDS:0x478c, entry 0 of the main button list - Role: Points to the front-block record run. The
callbacks of the six movement buttons lie at
DS:0x45a0,DS:0x45dc,DS:0x4618,DS:0x4654,DS:0x4690andDS:0x46cc, in the same field of their records; the button processing calls them. - Used by: The game loop › One pass of the game loop
DS:0x6654, DS:0x6655 — Mouse and control state
- Layout: bytes
- Role:
0x6654records whether a mouse was detected.0x6655is 1 when the game is played without the mouse: the start-up sets it when no mouse was detected, or when the third word ofEOSPREFS.DATis 0, the answer "No, I would rather not use a mouse" ofSETUP.EXE(0x18aa9–0x18ac1; SETUP stores 1 for "Yes" and 0 for "No" at image offsets0x1232and0x1256). It gates keyboard input and selects how the held item is chosen. The camp's preferences show "Mouse is ON" when it is 0 (camp menu,0x44613–0x4461d). The slot menus ignore the pointer while it is nonzero; the party transfer shows its selection only while0x6654is nonzero. - Used by: Item properties in conditions › Which item is tested, The play screen › Keyboard commands, Camp menus › Saving and loading, Transfer: spells and items, The start menu, questions and text › Questions and messages, How input works › Mouse control and keyboard control, Events that start scripts › Events from the keyboard, The creation screen, Transferring a party from Eye of the Beholder I, Settings (EOSPREFS.DAT)
DS:0x9317 — Selected character
- Layout: signed byte
- Status: that nothing shows it in mouse play is inferred from its reads
by the display code (
0x293eb,0x2955f,0x29616,0x29d84only with the panel open,0x299b9only in keyboard control). - Role: The selected character. Its literal writers are the
keyboard selection (
0x1c46a–0x1c4d1), the face buttons that open the inventory page (0x1bba6, for a mouse click), the previous and next buttons (0x1bc03–0x1bca8), the game start (0x1cb3c, 0), the removal of a character (0x1e77e, 0) and set the selected character (0x1e298), called by the character boxes, the swap of two characters and overlay 2470x428d0. It selects the character of the inventory page and of the keyboard slot, and is the thrower for the throw buttons and the keyboard throw, which do not test its condition. - Used by: The inventory › The selected character, Item properties in conditions › Which item is tested, Move an inventory item to a block › Behavior, Test a condition › The expression stack, Recruiting and dismissing characters
DS:0xf0fe — Button trigger
- Layout:* word
- Role:* Set by the button processing before it
calls a callback: 0 at the start (
0x2f912), 1 or 2 when the key read matches the entry's first or second key code (0x2fbb1,0x2fbde). Button handlers use it to tell a mouse click from a keyboard shortcut, for instance the face buttons, which change the selected character only for a click. - Used by: How input works › The active button list
DS:0x352c — Keyboard moves between inventory slots
- Layout: 27 rows of 4 bytes, indexed by slot and by W, S, Z, A
- Role: The slot reached from each inventory slot.
Slots 0 to 26:
18 1 25 11,21 23 21 0,14 3 4 3,15 2 5 2,2 5 6 19,3 16 7 4,4 7 8 20,5 17 9 6,6 9 10 22,7 18 11 8,8 11 12 23,9 0 13 10,10 13 14 24,11 25 15 12,12 15 2 15,13 14 3 14,25 19 17 5,16 20 18 7,17 22 0 9,24 4 20 16,19 6 22 17,1 24 1 26,20 8 23 18,22 10 24 1,23 12 19 21,0 26 16 13,0 21 16 25. - Used by: Keyboard character and hand selection, The play screen › Keyboard commands
DS:0x6600 — Input recording mode
- Layout: byte; handle at
0x6601, event and time at0x6603,0x6605, position at0x6607,0x6609, end flag at0x660b - Status: that it stays 0 is inferred: no instruction found writes it.
- Role: 0 plays normally, 1 records the input to a file, 2 replays it.
- Used by: Record and replay input
DS:0x6616 — Changed mouse buttons
- Layout: word
- Role: The mouse event handler ors into it the bits
that changed in the button word
DS:0x6612(0x32788–0x3278c). It is cleared before the game loop (0x1ca1a) and at0x28cf2. No other instruction reads it. - Used by: Install the mouse and keyboard handlers
DS:0x6622, DS:0x663a — Click and pointer positions
- Layout: two pairs of words (x, y):
0x6622,0x6624;0x663a,0x663c - Role:
0x6622is the position stored with the last mouse event taken from the input queue (0x32eb7,0x32ed3).0x663ais the position at which the pointer was last drawn (0x339cc,0x339dc). - Used by: Test a position against a rectangle
DS:0x6636, DS:0x664c — Pointer hot spot and shape
- Layout: two words (x, y) at
DS:0x6636,DS:0x6638; far pointer atDS:0x664c - Role: Stored by set the pointer shape
(
0x337fc–0x3380f). The pointer drawing subtracts the hot spot from the pointer position (0x338d9,0x338e3,0x339cf,0x339df,0x33aff,0x33b1f) and passes the shape to driver slot 18 (0x33aa0–0x33aac). - Used by: Mouse pointer
DS:0x5424, DS:0x5440 — Character-choice buttons
- Layout: 7 far pointers each, to button records in the data segment
- Role: The buttons installed while a character is
being swapped (
0x5424) and while a spell waits for its target (0x5440): the six names or faces, then a button that cancels the swap or aborts the spell. - Used by: Character-choice button lists, The play screen › Waiting for a character, Formation
DS:0xcb76 — Unused selection mode
- Layout: byte
- Status: that nothing else writes it is inferred from a search of the direct accesses.
- Role: Set to 1 when a game starts (
0x1cb54); stepped between 1 and 2 only by a routine with no known reference. The keyboard routines test it against 5 (0x1c566,0x1c5a0,0x1c8ee), a test that therefore never succeeds. - Used by: Keyboard character and hand selection
DS:0xe5a4 — Selected hand slot
- Layout: byte
- Role: Hand slot selected with the keyboard.
- Used by: Item properties in conditions › Which item is tested
DS:0xee3a — Character panel state
- Layout: byte
- Role: State of the character panel: 0 the dungeon view, 1 the
inventory page of the selected character, 2 the character
sheet; set by the inventory buttons. The
portrait and sheet routine draws the conditions and
the 27 item slots for 1 and the sheet (alignment, attributes) for 2
(
0x29b58–0x29b6d,0x29df1–0x29df8), and the page switch builds the inventory buttons (DS:0x51a8, 47 entries, or 60 with a book open) for 1 and the shorter sheet list (DS:0x5264, 19 entries, or 33) for 2 (0x1bcc5, routines0x1e09dand0x1e12bthroughDS:0x3502). While it is nonzero the use routine ignoresdisabled_slotsand skips the weapon, book, scroll and wand handlers, and removing an item redraws an inventory slot instead of the portrait. It also gates item transfers and the keyboard command dispatch. - Used by: Using items › What each kind does, Move an inventory item to a block › Behavior, The play screen › The character panel, Choosing a spell in the book, How input works › The active button list
DS:0xeee0 — Active button list
-
Layout: far pointer (offset
0xeee0, segment0xeee2) -
Role: List passed by the key reader to the button processing; rebuilt by the routines from
0x1dff7onward, among them0x1e02f, which links the entries of the far-pointer arrayDS:0x5038(38 entries, no spell book open) orDS:0x50d0(54 entries, a book open) in array order. InDS:0x5038, after the front-block action, come the six character boxes, then the floor zones, faces, hands, name strips, movement and throw buttons. Each entry is a0x3c-byte record: next pointer at+0, identifier+4, two key codes+6and+8, position and size from+0x1e, callback+0x30, argument+0x38. The records of the file image, in array order (keys are the key numbers, Shift adding0x100; positions in screen pixels):DS:0x5038Records Area (x, y, w × h) Keys Callback, argument 0 0x478cThe view, (24, 8, 128 × 96) — Run the front block's records, 1 1–6 0x39f4,0x3a30,0x3a6c,0x3aa8,0x4f0c,0x4f48Character boxes, 63 × 50 at x 184/256, y 2/54/106 F1–F6 Select a character, 0–5 7 0x3ae4Camp button, (289, 177, 31 × 21) C, Esc Camp menu, through the overlay 247 stub 0x2ad2:0x208–11 0x3b20–0x3bd4Floor zones (0, 102, 88 × 18), (89, 102, 88 × 18), (0, 72, 88 × 29), (89, 72, 88 × 29) — Drop or pick up an item on the floor, 0–3 12–17 0x3c10–0x3cc4,0x4c3c,0x4c78Faces, 33 × 33 I for the first Inventory buttons ( 0x1bb6d), 0–518–23 0x3d00–0x3db4,0x4cb4,0x4cf0Hands, 31 × 33 — Inventory buttons ( 0x1befa), 0–524–29 0x3df0–0x3ea4,0x4d2c,0x4d68Name strips, 63 × 8 Shift+F1–F6 Swap two characters, 0–5 30–35 0x4570–0x469cArrows, 21 × 16: forward (24, 128), back (24, 144), left (3, 144), right (45, 144), turn left (3, 128), turn right (45, 128) keypad 8 or Shift+keypad 8; 2 or 5; 4 or Shift+4; 6 or Shift+6; 7; 9 Movement buttons, 25 36, 37 0x4714,0x4750Throw zones (0, 8, 88 × 48) and (88, 8, 88 × 48) — Throw the held item, 0 and 1 DS:0x50d0, used while a spell book is open, starts with the same entry 0, then the book's records — the six tabs (keys 1–6), the page arrows, the six spell lines, two off-screen entries for the keys,,.and Space, and ABORT SPELL (Esc), all handled by the spell-book buttons — and ends with entries 1 to 37 ofDS:0x5038.The character panel uses four more arrays of the same kind, chosen by the panel state:
DS:0x51a8(47 entries, inventory page) andDS:0x5264(19 entries, character sheet) with no book open,DS:0x52b0(60 entries) andDS:0x53a0(33 entries) with a book open. The two arrays that combine the panel and the book have no record for the page arrows (0x4ffc) nor for,,.and Space (0x4bc4,0x4c00), which onlyDS:0x50d0holds. The areas and keys of these records are listed in the interface. -
Comparative source: REF-SCUMM-014,
runLoop(_activeButtons). -
Used by: How input works › The active button list, The play screen, Choosing a spell in the book