Skip to main content

Transferring an Eye of the Beholder I party

Overlay 254 · image 0x4c150–0x4d1b7 (4,200 bytes) · 12 stub entries

All overlays · ← 253 · Pixel dissolve · 255 · The introduction →

In brief​

Overlay 254 imports a party saved by Eye of the Beholder I. It reads EOBDATA.SAV, converts the six characters, lets the player choose four of them, converts their inventories and gives Khelben's Coin to one of them. It is reached from choice 3 of the start menu. The rules are described in transferring a party.

Addresses

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 steps of the transfer. 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 entryTargetRole
0x7f0:0x4d0x4d004Transfer an EOB I party

Routines at a glance​

RoutineAddress
Transfer an Eye of the Beholder I party0x4d004
Read EOBDATA.SAV0x4c150
Convert the transferred characters0x4c283, 0x4c216
Choose the four characters0x4cd67, 0x4cbc5, 0x4c905
Move the selection highlight (shown only with a mouse)0x4cb16
Find the entry under a click0x4cd15
Convert the transferred items0x4c827, 0x4c4cf
Clear a character record0x4cfb6
About this overlay

The transfer of an Eye of the Beholder I party. The stub lists twelve entries (0x4cb16, 0x4c216, 0x4cd15, 0x4c283, 0x4cfb6, 0x4c4cf, 0x4c905, 0x4c827, 0x4cd67, 0x4d004, 0x4c150, 0x4cbc5); only 0x4d004 has a known caller, the start menu. The others are called from inside the overlay.

Routines​

Transfer an Eye of the Beholder I party​

AddressRange
0x4d0040x4d004–0x4d1b7

Reads EOBDATA.SAV (none: returns 0), converts the six characters and lets the player choose four. CANCEL clears the six records and returns 0. Otherwise it copies the chosen records, in slot order, into slots 0–3 with their portrait images (0x4d057–0x4d0ff), clears records 4 and 5, converts the inventories of the four and gives Khelben's Coin (item 93) through give an item to the first of them with an empty backpack slot (0x4d144–0x4d1a7). When none has one, it writes 0 into inventory slot 2 of character 0 (DS:0xe6e9) at 0x4d190, without freeing the item there, and gives the coin in that slot. Returns 1.

Comparative source: REF-SCUMM-017, TransferPartyWiz::start and giveKhelbensCoin.

Used by: Transferring a party from Eye of the Beholder I › Transferring a party from Eye of the Beholder I, Transfer: spells and items › Anomalies of the transfer, Character record, Anomalies and bugs

Read EOBDATA.SAV​

AddressRange
0x4c1500x4c150–0x4c215

While the file test (0x4c15d) does not find EOBDATA.SAV (file name) on any drive, shows message 0x44 ("We cannot find your save game file… Do you wish to continue?"); no returns a null pointer. Otherwise reads, into the shared buffer, 0x5b2 bytes (six records of 0xf3 bytes), then 0x40 bytes that the next read overwrites, then 0x1b58 bytes (500 items of 14 bytes), and returns the address of the items.

Comparative source: REF-SCUMM-017, TransferPartyWiz::selectAndLoadTransferFile.

Used by: Transferring a party from Eye of the Beholder I › Transferring a party from Eye of the Beholder I

Convert the transferred characters​

AddressRange
0x4c283, 0x4c2160x4c283–0x4c4ce; 0x4c216–0x4c282

For each of the six records of 0xf3 bytes, copies bytes 0x00–0x1a to the same offsets of the character record, bytes 0x1f–0x32 to 0x21–0x34 and the 27 inventory words at 0x77 to 0xdd; sets hit_points_max and hit_points to the signed byte at 0x1c and defense to the byte at 0x1d; keeps only bit 0 of status_flags; sets food to 100; changes a negative portrait p into −p + 43; lowers each component's experience to the experience cap of its base class (0x4c37a–0x4c40b). 0x4c216 converts the known-spell mask at 0x73 through the spell conversion table. Then draws each present character's portrait from CHARGENA into its face_image (0x4c427–0x4c4c9).

Comparative source: REF-SCUMM-017, TransferPartyWiz::convertStats.

Used by: Transferring a party from Eye of the Beholder I › Transferring a party from Eye of the Beholder I, Transfer: spells and items

Choose the four characters​

AddressRange
0x4cd67, 0x4cbc5, 0x4c9050x4cd67–0x4cfb5; 0x4cbc5–0x4cd14; 0x4c905–0x4cb15

0x4cbc5 draws the screen ("You may only take four characters on your adventure.", "Select OK when you are finished choosing your party.") and 0x4c905 one character's box. 0x4cd67 toggles the choice of a character whose status_flags bit 0 is set (0x4ce39). OK with fewer or more than four shows message 0x45 or 0x46; OK with four shows message 0x47 ("Items which are not useful or unbalance the game will be deleted.") and returns the mask of chosen slots; CANCEL returns 0.

The selection e runs over eight entries: the six character boxes, 0 to 5 in reading order, then CANCEL (6) and OK (7). Codes are masked with 0x8ff:

InputEffect
Left-button press (0x41)e = the entry under the press, if any; act on it
Enter (43), Space (61)Act on e
Keypad 4 (92), keypad 6 (102)e XOR 1, the other column
Keypad 8 (96)e − 2; below 0, + 8 (0x4cdde–0x4cdec)
Keypad 2 (98)e + 2; above 8, − 8 (0x4cdee–0x4cdfc)
Escape (110)e = 6; act

The keypad 2 rule keeps 8, so keypad 2 on CANCEL gives a ninth entry, 8, and keypad 4 or 6 then gives 9. Acting on an entry of 6 or more flashes a button box at x = (e − 6) × 268 + 4 (0x4ce6b–0x4cee0), 540 or 808 for 8 and 9, and every entry but 6 is handled as OK. While a mouse is present (DS:0x6654 nonzero) the highlight is updated on every pass (0x4ce12–0x4ce20); for 8 and 9 it prints, as a button label, a pointer and an x read past the two-entry label tables (DS:0x1716–0x171c, DS:0x170e, DS:0x1710). That x, 6103 or 11030, is beyond the right edge, where the drivers' text routine returns without reading the text; the flash box at x 540 or 808 is not drawn either, its fill and lines lying beyond the right edge of the page. Without a mouse the highlight is never called. The keypad 2 rule, which every other bound contradicts (the keypad 8 rule, the eight rectangles, the click test), is the proof of ANOMALY-91; the mouse test before the highlight (0x4ce12–0x4ce20) that of ANOMALY-92.

Comparative source: REF-SCUMM-017, TransferPartyWiz::selectCharactersMenu.

Used by: Transferring a party from Eye of the Beholder I › Transferring a party from Eye of the Beholder I, Transfer: spells and items, Transfer: spells and items, Anomalies and bugs

Convert the transferred items​

AddressRange
0x4c827, 0x4c4cf0x4c827–0x4c904; 0x4c4cf–0x4c802

0x4c827 converts the 27 inventory slots of a character; for the quiver, slot 16, it follows the old chain by its link at +0x0a and inserts each converted item with location −2. 0x4c4cf converts one item: none when its type has 0 in the transfer filter; otherwise a copy of item 1 takes the old flags with ITEM_RUNTIME_IDENTIFIED, the icon, the type and the value; mage and cleric scrolls (value + 25) go through the spell conversion table and are deleted on 0; potions lose 1; a wand of value 5 is deleted, other wands get flags (old flags & 0x3f) + 3 at 0x4c60f–0x4c625, which drops ITEM_RUNTIME_IDENTIFIED; rocks get icon 19. ITEM_RUNTIME_MAGICAL is added by item kind through the table at 0x4c803. The names come from the first item 1–599, except 60, 62, 63 and 83, of level 0, not in a quiver, with the same type and icon, else the same type; with none, the message "Item conversion matching failure" shows the type, icon, value and flags (0x4c77a–0x4c7ed) and the item is deleted.

Comparative source: REF-SCUMM-017, TransferPartyWiz::convertInventory and convertItem.

Used by: Transferring a party from Eye of the Beholder I › Transferring a party from Eye of the Beholder I, Transfer: spells and items › Anomalies of the transfer, Anomalies and bugs

Clear a character record​

AddressRange
0x4cfb60x4cfb6–0x4d003

Fills the 345 bytes of a character record with zeros, keeping its face_image pointer and its first byte.

Used by: Transferring a party from Eye of the Beholder I › Transferring a party from Eye of the Beholder I, Transfer: spells and items, Character record

Move the selection highlight​

AddressRangeStatus
0x4cb160x4cb16–0x4cbc4The pulsing frame is inferred from its colour table

Stub entry 0, called only by the chooser at 0x4ce1d. 0x4cb16(e) keeps the highlighted entry in DS:0x1716 (−1 at first). When the old entry was CANCEL or OK and differs from e, its label is redrawn in colour 15. For a character box (e below 6) it calls resident 0x1e78e with box 14 + e (highlight a box frame), which frames that portrait box and, on each later call with the same box, steps its frame colour once per tick through a table of colours; for CANCEL or OK it removes the box frame (0x1e78e(−1)) when the old entry was a box, and draws the label of e (DS:0x16f6, x at DS:0x16fe, y 151) in colour 6.

Comparative source: REF-SCUMM-017, TransferPartyWiz::updateHighlight.

Used by: Choose the four characters, Transferring a party from Eye of the Beholder I › Transferring a party from Eye of the Beholder I, Transfer: spells and items

Find the entry under a click​

AddressRange
0x4cd150x4cd15–0x4cd66

Stub entry 2, called only by the chooser at 0x4cdcb. Tests the position of the last mouse-button press (DS:0x6622, DS:0x6624) against eight rectangles at DS:0x1718 with point in a rectangle and returns the first that contains it, or −1: the six character boxes, from (4, 24)–(157, 56) to (162, 104)–(316, 137), CANCEL (4, 148)–(46, 158) and OK (272, 148)–(314, 158). In the first row the boxes end one pixel apart, the left at row 56 and the right at row 57; in the other two rows they end alike.

Used by: Choose the four characters, Transferring a party from Eye of the Beholder I, Transfer: spells and items

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.