Eye of the Beholder, decompiled: how it works
Eye of the Beholder won't start unless it is handed the word homie. What the 1991 game was, why CRPG fans still talk about it, and how the whole program works, read from its decompiled C.

Go to the directory of Eye of the Beholder, the 1991 DOS game, and type its name, EOB. Nothing happens. No error, no title screen: you're straight back at DOS.
Now type it with a few things after it: EOB 3 4 0 homie 3. A three, a four, a zero, then the word homie, then a three. This time the title menu comes up.
That word is checked in the game's own code. Here is the start of Main in EOB.EXE, as our matched source has it. The fourth argument is compared with homie, and if it doesn't match, the program returns before it sets anything up: no video mode, no interrupt handlers.1
gGraphicsChoice = argv[1][0] + 1;
gSoundCard = argv[2][0] - '1';
gSoundOn = argv[2][0] != '4';
mouseChoice = argv[3][0] - '0';
if (strcmp(argv[4], "homie"))
return 0;
We ran it in our emulator both ways. With a wrong word, the program ends at once, still in text mode, having opened only its own file. With the word, it switches to the VGA mode, loads its graphics driver, its fonts and its data, and draws the title menu. And in the version we decompiled, the word is in all three of the game's programs, once in each:2
$ for f in eob/START1.EXE eob/INTRO.EXE eob/EOB.EXE; do strings -a -t x $f | grep homie; done
1fae homie
11280 homie
26bca homie
So who is supposed to say it? The answer is further down, in the part about the three programs.
What Eye of the Beholder is
Eye of the Beholder was made by Westwood Associates, a studio in Las Vegas, and published by SSI, Strategic Simulations, in early 1991. Brett Sperry and Louis Castle founded Westwood in 1985. When SSI pitched TSR for the Dungeons and Dragons licence in 1987, Westwood made the graphics demos for the pitch, and then ported SSI's Gold Box games to the Atari ST and the Amiga.3
Eye of the Beholder was Westwood's own creation, with official AD&D second edition rules, set in the Forgotten Realms. The party is sent into the sewers under the city of Waterdeep by the city's lords, the way out collapses behind them, and they fight their way down twelve levels to the lair of Xanathar, a beholder.4
What was new was the way it played. FTL's Dungeon Master, from 1987, had done real time, first person, on a grid, and Louis Castle has said that Westwood loved what FTL had done. Jimmy Maher, in The Digital Antiquarian, writes that the game was conceived as Dungeons and Dragons meets Dungeon Master. FTL had not brought Dungeon Master to the PC yet, so Eye of the Beholder was the first good game of its kind on MS-DOS.5
It sold. SSI shipped its first 20,000 copies in February 1991, and Joel Billings at SSI remembered them being gone right away. A distributor's chart printed in Computer Gaming World had it at number one for the three months to the end of June 1991, ahead of Mavis Beacon Teaches Typing. The critics liked it too. In Computer Gaming World's June 1991 issue, Dennis Owens called it "a stunning, brilliantly graphic and agonizingly tricky" 3D role-playing game. Dragon magazine called it the best of its kind they had played that year, and in the UK the Amiga version got 92 percent from Amiga Format and from The One.6
| What | Number | Source |
|---|---|---|
| First shipment, February 1991 | 20,000 copies | The Digital Antiquarian |
| EAD Top 25, 90 days of unit sales to 30 June 1991 | No. 1 | Computer Gaming World 87 |
| Sold, by SSI's own records | 129,234 copies | SSI's records, via The Digital Antiquarian |
| Amiga Format 24 and The One 33 (Amiga) | 92% each; Format Gold from Amiga Format | Amiga Magazine Rack |
| CGW 148, "The 15 Least Rewarding Endings of All Time" (1996) | No. 2 | Computer Gaming World 148 |
| Eye of the Beholder II, December 1991 | 73,109 copies | SSI's records, via The Digital Antiquarian |
And then there's the ending. You kill Xanathar, a text box comes up, and you're back at DOS. Five years later Computer Gaming World ranked it second of the fifteen least rewarding endings of all time, and people still bring it up; the quirks article will come back to it.7
It led to big things for Westwood. Eye of the Beholder II came out in December of the same year. Virgin went after the studio after seeing the first game, and Richard Branson called to buy it just as Westwood was finishing Dune II. Then came Command and Conquer.8
I played it growing up, on a 486 with VGA graphics and an AdLib card, and I still have the IBM PC box.
How we know
We know how the game works because we decompiled it. All 1,011 functions in the three programs are now C or assembly that Borland's original tools, Turbo C++ 1.00 with its assembler and its linker TLINK 3.0, turn back into exactly the same bytes. That's called a matching decompilation. EOB.EXE has 783 of those functions, INTRO.EXE 213 (164 of them the very same modules as in EOB.EXE), and START1.EXE 15.9
We also rebuilt the programs from that source. The setup program, START1.EXE, comes out identical, all 8,652 bytes. The other two differ only in bytes we can explain: the link date, the order of the overlay stub entries, and in the game itself, one hook in one overlay.10
Then we recorded nine sessions of the original game in our emulator, which runs the program in virtual time, so a session plays the same way every time. They go from the intro to walking the dungeon, with every screen, the sound and the machine's state captured. All nine replay on the rebuilt programs with the same results.11
From the first commit to every function matched took about two days, with a team of AI agents doing the matching. That story gets its own article. This one is about what we found inside: how the whole program works, from that secret word to the frame it paints.
Three programs and a handshake
Back to the word. Eye of the Beholder is three programs, and they run in a chain: START1.EXE, then INTRO.EXE, then EOB.EXE.
START1 is a small text menu: which graphics (CGA, Tandy, EGA or VGA), which sound, and whether you have a mouse. It stars the graphics modes it detects in your machine and warns you about any other, and it only asks about a mouse when a mouse driver answers. The sound card it never checks: your answer is the configuration. Each answer becomes a one-character argument, and START1 runs the intro with the three answers plus a fourth argument, the word:12
execl(gIntroPath, gIntroName, gArgGraphics, gArgSound, gArgMouse, gHomie, 0);
INTRO.EXE checks the word too, with the same strcmp, then plays about two and a half minutes: thirteen scenes with music. There is no script file and no scene table behind it; the whole intro is code. The five logo cards share one function, and each of the seven story scenes is a function of its own, drawing and waiting. When it's done, or when you press Escape, it loads EOB.EXE into its own place in memory, passes on the same answers and the same word, adds the video mode to restore, and jumps to it. So the title menu is already the game.13
execl("EOB.EXE", "EOB.EXE", argv[1], argv[2], argv[3], argv[4], gRestoreModeArg, gMemTopArg, (char far *)0);
EOB.EXE checks the word, sets the video mode and loads one of four graphics drivers: CGA.OVL, EGA.OVL, TGA.OVL for the Tandy, or MCGA.OVL for VGA. Each driver plugs into a table of 47 function pointers, 7 that the game gives the driver and 40 that the driver gives the game, and the game always draws through that table.14
To fit all this into 640K, seven parts of the game are overlays, managed by Borland's VROOMM: party creation, the camp menu, the title menu with the item loading, level loading and saving, the 3D view, the event panels and the endings, and resting. They stay in the EXE file, after the program, and are read into one shared pool of 11,456 bytes when they're called. That's more than a quarter of the code: 50,641 of 178,076 bytes. A call into an overlay goes through a stub and interrupt 3Fh, and the game's own hook first checks that it can still open EOB.EXE, in case the disk was swapped.15
So the word is a kind of handshake. As far as we can tell, it's there so the game only runs when the chain starts it; nothing we have records what the authors meant by it. Type EOB by hand, and it just leaves.
One loop, one clock
Once you're in the dungeon, the whole game is one loop, RunMapLoop, a few lines of C around a for that never ends. It only leaves through exit.16
/*@ 0ACD:0E8A */ void RunMapLoop(void)
{
gNextRandomSoundTick = gGameTicks + (long)(RollDice(1, 10, 3) * 0x12);
EnterMapScreen();
LockShowPointer();
gUnreadPartyCellCopy = gPartyCell;
gUnreadButtonChanges = 0;
for (;;) {
gUnreadPartyCellCopy = gPartyCell;
PollMapInput();
RunEffects();
if (gViewDirty)
DrawViewFrame(1);
if (gNextRandomSoundTick < gGameTicks) {
if (gCurLevel > 0 && gCurLevel < 4) {
gNextRandomSoundTick = gGameTicks + (long)(RollDice(1, 10, 3) * 0x12);
PlaySoundAtCell(0x1E, gPartyCell + RollDice(1, 12, -1));
}
}
PlaySoundDefault(0);
TurnUndead();
}
}
Each pass does six things in order. First it takes one key or mouse click, if one is waiting, and runs its handler, like stepping forward; if nothing is waiting, it doesn't wait. Then it runs the timed effects that are due, redraws the view if something changed, on levels 1 to 3 maybe plays an ambient sound, and sends off the sounds that were asked for during the pass. Last comes a turn undead check that only does anything on levels 2 and 7; that one is for the quirks article.
There is no wait in the loop itself. It runs as fast as the machine can take it. So the real time has to come from a clock. The PC's timer ticks 18.2 times a second, and the game's interrupt handler keeps its own count of those ticks, gGameTicks, which only counts while the game allows it.17
Almost everything that happens on its own is one of 16 timed effects in one table, gEffects, each with a handler and a period in ticks. RunEffects walks the table on every pass and calls each active entry whose time has come:18
for (; i < gEffectCount; i++, effect++) {
if (effect->active != 0 && effect->expiry < gGameTicks) {
effect->fn(effect->arg);
if (effect->active != 0)
effect->expiry = gGameTicks + effect->period;
}
}
| Entries | Handler | Period (ticks) | What it does |
|---|---|---|---|
| 0 | BlinkSelected |
9 | the selection blink |
| 1 | MoveDDEffects |
3 | thrown items and spell missiles in flight |
| 2 to 5 | UpdateMonsterGroup |
20 at start; each level sets 15 to 35 | the four monster groups |
| 6 to 11 | RunCharEffects |
50 each | one per party member: its timers (spells, hand cooldowns, poison) |
| 12 | StepDoor |
5 | a moving door |
| 13 | CheckFarTable |
10 | animated walls |
| 14 | DecayMemberState |
1,080 | food, about once a minute |
| 15 | RandomiseMonsterOffsets |
25 | the monsters' jitter in their cells on screen |
Monsters move on their own timers, not on your steps. Each level sets two speeds, periods between 15 and 35 ticks, so they move every second or two: level 1 sets 25 and 35, for its kobolds and its leeches. And each speed is split across two entries, half a period apart, so a group never moves all at once.19
The game clock only counts when the game lets it: it stops while the camp menu is open, while a level loads, and while a spell animation plays. That's why combat isn't a mode. There's no battle screen, no initiative and no rounds. When you click on the spell book, you're not starting up a different loop. You're just changing the list of buttons the loop pays attention to in its input step, and the spell panel isn't one of the few things that stop the clock. So the kobold's timer keeps firing, and he keeps swinging at you while you choose your spell. The real time article takes all of this apart.20
A dungeon made of cells
The dungeon is a grid: twelve levels, each 32 by 32 cells. The party stands in one cell, facing one of four directions, and each key press moves it one cell or turns it 90 degrees.
On disk, in the level's .MAZ file, a cell is four bytes, one for each side, saying whether that side is open, a wall, a door, or one of the special walls the level defines. A wall between two cells is stored twice, once in each. In memory the game adds five more bytes: the number of monsters in the cell and the events its script listens for, packed into one byte, then the head of the list of items lying in it, and where its script starts.21
Five wall sets give the levels their look: brick for levels 1 to 3, then blue, drow, green, and Xanathar's own for level 12. And a level remembers you. When you leave, the four side bytes of every cell are compressed into at most 1,200 bytes and stored in a temporary file, LEVELS.TMP, along with the level's 30 monster records. Come back, and the doors you opened are still open.22
Everything beyond walking and fighting is a script: stairs, levers, messages, traps, wandering monsters, quests. A script is bytecode attached to a cell and woken by an event: the party enters or leaves, an item is put down or taken, a thrown item flies in, someone clicks a wall, or the level timer fires. The twelve levels hold 871 scripts, 52,449 bytes, 7,054 instructions and 26 opcodes, the kinds of instruction, and we decoded every byte, with nothing left over. IF is the most common, 1,572 of them; HEAL is never used.23
Here are the level 1 stairs, cell 754's script, decoded:24
02CF IF mode 1 == ELSE 035A
02D6 IF facing 1 == ELSE 0308
02DD IF lflag 31 0 == ELSE 02EA
02E5 OVERLAY 10
02E7 SETFLAG level 31
02EA TEXT "going down..."
02FB SOUND 79 cell 0
02FF LOADLEVEL 2 cell 755 dir 1
0305 JUMP 035A
0308 TEXT "you can't go that way."
Which event woke this script: did the party just enter? Which way is it facing? If level flag 31 isn't set yet, this is the first time, so show a panel and set the flag. Then say "going down...", play a sound and load level 2. Facing any other way, it tells you that you can't go that way.
That panel is the copy protection, and it works the same way. In the version we decompiled, the stairs on levels 1 and 6 open the panel that asks for a word from the manual, and three wrong answers end the game.
Quests are scripts too. Level 2 has four odd carvings in its walls. Click one with a dagger in hand, and its script takes the dagger and sets a level flag: 4, 5, 6 or 7. Two of them also open a door, and one whispers a hint instead: "illusion, solid illusion". Then each one runs the same little check: are all four flags set, and is the quest not done yet? If so, it prints "special quest for this level!", a game flag marks the quest done, and four rations appear on the floor, one beside each carving.25
The view that is not 3D
Now the part everyone remembers: the view. It looks 3D, but it isn't. There's no projection and no scaling of walls. Every wall, door and decoration was drawn by hand for each distance it can appear at, and the program only decides which picture goes where.26
The view is 176 by 120 pixels, in the top left of the 320 by 200 screen. To fill it, the game looks at 18 cells: seven in the farthest row, then five, then three, then the three in the party's own row.
The walls are built from tiles of 8 by 8 pixels, 32 bytes each. The brick wall set's BRICK.VCN has 1,575 of them. A second file, the .VMP, is the map: for each of the nine sizes a wall piece can appear at, a rectangle saying which tiles go where. The front wall of a cell three rows ahead, for example, is 6 by 5 tiles.27
To draw a frame, start with the floor and ceiling, then copy in the wall pieces from the farthest cell to the closest. A close wall simply overwrites what was behind it. So for the walls, the hidden surface algorithm, the part that decides what hides what, is drawing things in the right order. (Things standing in the cells get some clipping as well.)
Two tricks help. The files only store the side walls on the left, plus one copy of each front piece; walls on the right are the same pieces mirrored. And the floor and ceiling are drawn mirrored on every other cell, by the parity of row plus column plus facing, so the picture changes when you step, even in a plain corridor.28
Then come the things in the cells, farthest cell first, and in each cell the decorations, the items, a door, the monsters, then things in flight like spells. Decorations and items are pre-drawn at each size too, so nothing scales them. Monsters are the one exception. A monster's shapes are cut once, at full size, and the code shrinks them, keeping two of every three rows and columns: once for two cells away, twice for three. A kobold's front view goes from 56 by 96 pixels to 40 by 64, then 32 by 43.29
The finished view, drawn on an off-screen page, is then copied to the screen as one rectangle. The article on the 3D view takes all of this apart.
The party and the fight
Your party is four characters you create, and up to two more can join. Nine ready-made ones are waiting in the program, at character levels 3 to 11. Each character is a 243-byte record, struct CharRec in src/EOB.H: name, abilities, hit points, class levels, spell slots, 27 item slots and ten timers. You roll each ability with four six-sided dice and drop the lowest.30
The party stands together in a single cell, in ranks of two, and only the front two can swing a weapon. The function that applies a melee attack gives up at once for anyone else, and the game shows CAN'T REACH:31
/*@ 0DE8:0359 */ int ApplyItemAttack(int who, int slot)
{
...
if (who > 1)
return -3;
To attack, you click a weapon in a character's hand. The game rolls a twenty-sided die against a number built from your level, the monster's armour class and your bonuses, the AD&D way, with descending armour class. Then that hand is busy. Each hand has its own cooldown, made of timed effects with periods of 18 ticks, then 36 more. Two hands, two cooldowns, and nothing waits for anything else.32
Throw a dagger and it becomes a flying object, the same kind of record as a magic missile. Up to ten can fly at once, moving half a cell at a time on that 3-tick period. When one stops, nothing destroys it: it lies on the floor of that cell, and you can pick it back up.33
A level holds up to 30 monsters, in one array, and the whole game has 22 monster types. Each monster is in a mode: hunting, wandering, following a wall, standing guard, waiting, or asleep with its group until something wakes them. A monster notices you when you're fewer than four cells away and not behind it. There's no line of sight test and no wall test, so by the code, they notice you through walls.34
When its group's timer fires, a hunting monster tries a ranged attack if it has one and you're straight down a clear corridor within three cells; otherwise a swing, every other update; or else a step toward you. A position in a cell is one of four quarters or the centre, and a monster can only strike from the half of its cell that faces you.35
Magic, the camp and food
Magic is AD&D's too, with 49 named spells: 25 for mages and 24 for clerics, and paladins can use 10 of the cleric ones. Each caster has five spell levels of six slots. A positive byte in a slot is a spell ready to cast; a negative one is spent or not yet memorised. A new mage starts with five spells in the spell book (Detect Magic, Magic Missile, Shield, Shocking Grasp and Melf's Acid Arrow), and you add more by scribing scrolls at camp.36
Picking a spell doesn't make it ready; resting does. At camp the game counts time in steps of ten minutes. The first spell after you change your choices takes 49 of those steps, roughly eight hours, and after that each spell takes one more step per spell level. You can't rest with a monster in your cell or in any of the eight around it ("You can't rest here, monsters are near.").37
Attack spells like Magic Missile, Fireball and Lightning Bolt fly through the dungeon as the same flying objects as a thrown dagger. Spells that last, like Shield or Haste, sit in one of the ten timer slots each character has, which stores the tick the spell runs out on, and the member's entry in the 16 timed effects watches them.38
Finally, food. Each character has a food value that starts at 100. Entry 14 of the timed effects takes a point off on a period of 1,080 ticks, roughly once a minute, so a full stomach lasts about an hour and forty minutes of play. At zero you're fine walking around. But at camp, a starving character memorises nothing, heals nothing, and loses a hit point a day.39
Sound and four video cards
On to sound. START1 asks what card you have, with four answers, and that answer is all the game knows. Nothing probes the card: with the first answer, the game simply starts its AdLib driver, which writes to the AdLib's ports, 388h and 389h. A Sound Blaster works because it has the same Yamaha chip, on those same two ports.40
| START1's answer | What EOB.EXE starts |
|---|---|
| 1. Adlib or Sound Blaster | StartAdlibDriver, Westwood's AdLib driver |
| 2. Built in speaker | SoundDriverInstall, the speaker driver |
| 3. Tandy speaker | SoundDriverInstall, with the Tandy flags set |
| 4. No sound | nothing: no driver, and sound off |
The AdLib driver is Westwood's own, about 20 kilobytes of assembly inside the game's first segment. Every write to the chip goes through one routine, the register number to port 388h and the value to the next port, 389h:41
_AdlibWrite PROC NEAR
mov dx, 388h
xchg al, ah
out dx, al
call _AdlibWaitAfterIndex
inc dx
xchg al, ah
out dx, al
call _AdlibWaitAfterData
ret
_AdlibWrite ENDP
The driver speeds the PC's timer up to 874 interrupts a second. Every twelfth one runs the music, 72.8 times a second. Every forty-eighth is passed on to the BIOS, so the game's own clock still ticks at 18.2.42
Every sound is a small script in its own bytecode: two header bytes, the voice and the priority, then notes and commands. A byte below 80h is a note followed by a duration; anything from 80h up is a command. ADLIB.DAT holds 149 sounds and 127 instruments. The driver has ten voices: one for each of the chip's nine channels, and one with no channel at all, the conductor, which starts the tracks of a piece. The character creation music is the conductor and eight tracks, on voices 0 to 7.43
Music has a low priority and most effects a high one, so an effect can take over a voice in the middle of a piece, and that track doesn't come back for the rest of it. On the PC speaker, only 66 of the game's 120 sound numbers do anything, against 116 on the AdLib, and the character creation music isn't one of the 66. On a Tandy, three voices play the same tune, each a little later and quieter, at volumes 15, 10 and 5, like an echo.44
Graphics work the same way: four drivers behind one table, and the game draws through the same 40 entries whichever is loaded.45
| Choice in START1 | Driver | Colours |
|---|---|---|
| VGA | MCGA.OVL (mode 13h) |
256, with a palette for each wall set |
| EGA | EGA.OVL |
16, in four bit planes |
| Tandy | TGA.OVL |
16, CGA's code for four-bit pixels |
| CGA | CGA.OVL |
4, each of the game's colours a dither of two |
Same game code, four looks. Each driver is one assembly module, in src/drivers/, and all four rebuild byte for byte from our source.
What it means, and what is next
So that's Eye of the Beholder from start to finish: the menu, the intro, the word, the loop, the cells, the view, the drivers.
Because every function matches, this is more than a description. You can read the game in C now, with real names: every function and global of the three programs has one, 608 of them named from the game's own tables and strings. You can rebuild it. You can change it, and check that nothing broke: the recorded sessions replay on the changed build, and every screen, the sound and the state must come out the same.46
We already have it running in a window on a modern machine, a Mac for now and still without its sound, translated from that same C source. There's also a faster version for the Tandy 1000 EX, built from the matched source with a patch series that changes nothing about what the game does except the Tandy's sound: the game's music, arranged for the Tandy's three voices. Since the PC game is still sold, it will be offered as a patch for your own copy. And a CoCo 3 port is on the way.47
Next in the series are the quirks: the things the code admits that the game never tells you. Like three spells, Stinking Cloud, Cloudkill and Protection from Lightning, that use up your slot and do nothing at all, at least in the version we decompiled. Here is all of Stinking Cloud, and its row in the spell table:48
/*@ 0EF3:1315 */ void CastStinkingCloudNoOp(void) {}
{ "stinking cloud", 0, CastStinkingCloudNoOp, 0, 0, 0, 1 },
If you want to play it yourself, the game is still sold on GOG, with its two sequels, in Forgotten Realms: The Archives, Collection One.49 The source and the tools behind this article are in the project's repository.
Notes and sources
Main, 07C8:0001,src/E07C8.Clines 248 to 253 (the check at 252 and 253).INTRO.EXEhas the same check,src/I0892.Clines 214 and 215. The listing is the matched source as it stands; the whole function is lines 243 on. ↩︎strings -a -t xon the three programs of our copy (research 1.5). The emulator runs aretools/oracle/run.pywith--args "3 4 0 hello 3"(exit in text mode, only\EOB\EOB.EXEopened, noINT 10h) and--args "3 4 0 homie 3"(mode 13h,MCGA.OVL, both fonts and four PAKs, the title menu) (research 1.6; whitepaper 2.7). In the emulator a bareEOBends the same way; on a real DOS, arguments never given read whatever memory follows them, so we checked it in DOSBox-X too, where a bareEOBalso returns at once with nothing drawn. Our copy is the fan patch "1.9", not the retail release, and no retail copy is in the repository, so we cannot say whether the word is in retail copies (research 1.7;docs/design/WHITEPAPER.mdsection 1). ↩︎Jimmy Maher, "Controlling the Spice, Part 3: Westwood's Dune", The Digital Antiquarian, 7 December 2018, https://www.filfre.net/2018/12/controlling-the-spice-part-3-westwoods-dune/ (founding in March 1985, the demos for SSI's 1987 pitch to TSR, the Gold Box ports). Publisher, developer and the first shipment: Maher, "Opening the Gold Box, Part 5: All That Glitters is Not Gold", 31 March 2017, https://www.filfre.net/2017/03/opening-the-gold-box-part-5-all-that-glitters-is-not-gold/. ↩︎
AD&D second edition rules: COMPUTE! 134, October 1991, https://www.atarimagazines.com/compute/issue134/138_Eye_of_the_Beholder.php. The setting: the CRPG Addict, http://crpgaddict.blogspot.com/2015/05/game-189-eye-of-beholder-1991.html, and Wikipedia's article on the game. Twelve levels:
gCurLevelruns from 1 to 12 (whitepaper 3.1). ↩︎Castle, in his Retro Replay interview, https://retro-replay.com/louis-castle-interview/. "Conceived as" Dungeons and Dragons meets Dungeon Master: Maher, "Opening the Gold Box, Part 5" (above). The first good one on MS-DOS: Maher, "Controlling the Spice, Part 3" (above), who calls it the first real-time dungeon crawl worth its salt there; FTL had not yet ported Dungeon Master to the PC. ↩︎
The first 20,000 and Billings: Maher, "Opening the Gold Box, Part 5". The chart: the "EAD Top 25 Entertainment Software Titles", 90-day unit sales ending 30 June 1991, a distributor's chart printed in an EAD advertisement in Computer Gaming World 87, October 1991, https://archive.org/stream/Computer_Gaming_World_Issue_87/Computer_Gaming_World_Issue_87_djvu.txt. Owens: Computer Gaming World 83, June 1991, from p. 14, https://archive.org/stream/Computer_Gaming_World_Issue_83/Computer_Gaming_World_Issue_83_djvu.txt. Dragon 171, July 1991, "The Role of Computers", https://archive.org/stream/DragonMagazine260_201801/DragonMagazine171_djvu.txt. Amiga Format 24 and The One 33: Amiga Magazine Rack, https://amr.abime.net/review_2160 and https://amr.abime.net/review_5292. The 129,234 and Eye of the Beholder II's 73,109: SSI's records, in Maher, "Opening the Gold Box, Part 5". ↩︎
The ending as the reviews saw it: Scorpia, Computer Gaming World 83, pp. 51 to 52 (above). The ranking: Computer Gaming World 148, November 1996, https://archive.org/stream/Computer_Gaming_World_Issue_148/Computer_Gaming_World_Issue_148_djvu.txt. Still brought up: David Brevik in PC Gamer, https://www.pcgamer.com/gaming-industry/david-brevik-creator-of-diablo-reveals-the-worst-ending-to-any-game-hes-played-but-i-really-love-the-game-its-amazing/. ↩︎
Maher, "Controlling the Spice, Part 3" (above): Virgin's Martin Alper wanted Westwood as soon as he saw Eye of the Beholder, and Branson's call came as Dune II was being finished; Maher gives no year for the purchase. ↩︎
work/status.md, P4; whitepaper 2.1 (Turbo C++ 1.00,-ml -O -Z, TLINK 3.0).EOB.EXE's 783 functions are 166,686 bytes,INTRO.EXE's 213 are 57,460 andSTART1.EXE's 15 are 1,097. The matcher ismake match. ↩︎work/status.md, P5; whitepaper 2.6, "EOB.EXE rebuilds but for the stub order, the link date and one hook".INTRO.EXEdiffers in 42 bytes (the link date and the stub order). Measured onEOB.EXEwithmake rebuild PROGRAM=EOB.EXE: 262 bytes of the image differ, 232 in the stub table and 27 in far pointers to its entries (the order), and 3 elsewhere (the hook). ↩︎make golden CHECK=1 REBUILT=1, 9 of 9 sessions OK: boot-adlib, boot-title, camp, intro-play, intro-skip, load-walk, mouse-party, new-character and new-party. The emulator (the "oracle") istools/oracle/; two runs of a session agree (tests/unit/test_oracle.py; whitepaper 2.7). ↩︎MainofSTART1.EXE,src/S_TEXT.C: the video probe and the starred modes (InitVideo, lines 65 on, the note at ds:0172), the mouse question only whenDetectMousefinds a driver (line 122), the hand-off at line 136, withgHomiethe string at ds:030E (line 49). Whitepaper 2.4 and 2.6. ↩︎Whitepaper 5.15: 13 scenes, 147 seconds of the emulator's virtual time (2,680 ticks), a length that scales with the CPU; Escape skips it (5.15.2); five logo cards in one function, the title, and seven story scenes of one function each (5.15.4). The hand-off is
src/I0892.Cline 263; the library loadsEOB.EXEwith DOS function 4B03h at the intro's own segment and jumps to it (whitepaper 2.6, 5.15.6). The command tail for VGA, no sound, no mouse is " 3 4 0 homie 3 0". ↩︎Whitepaper 2.5, "The driver interface". The table is at ds:802A (
src/D1AAD.ASMlines 1 and 2); the four slots in the still aregCopyPage(slot 7,src/E19EC.Cline 16),gDrawCell8x8(12,src/E1DE7.Cline 64),gDrawLine(14) andgFillRect(16) (src/E082C.Clines 54 and 55). ↩︎Whitepaper 3.3 and 3.3.1. The program has 62 units: the 7 overlays, Borland's start-up code and library, and 53 resident units, the game's code, drivers and services, Borland's overlay manager among them (whitepaper 3.3). ↩︎
src/E0ACD.Clines 952 to 975; whitepaper 3.1.1 and 3.1.2. ↩︎The tick handler is the
INT 1Chhandler at 1D8F:0055,src/E1D8F.ASMlines 76 to 105;gGameTickscounts while a bit ofgTimerEnableFlagsis set (whitepaper 3.1.2, 3.6.2). ↩︎The table is
gEffects, ds:5BA8,src/E1414.Clines 85 to 102;RunEffectsis lines 347 to 362, and the loop above is lines 354 to 360. The comparison is a strict "less than", a detail the real time article comes back to. The names of the effects are the whitepaper's, 3.1.2. ↩︎Whitepaper 3.1.2, its table of each level's periods, and 5.6.3:
LoadLevelreads up to two (group, period) pairs from the level file and starts one entry of each pair a full period ahead and the other half a period ahead (src/EOV3.Clines 654 to 665). That level 1's 25 is the kobolds and 35 the leeches is our reading of which kind belongs to which group. ↩︎Whitepaper 3.1, 5.7 and 5.7.1, and 5.9.1. The spell book sets
gFlagto 1 (OpenSpellPanel, 0EF3:21E0), which makes the input step read the "a" variants of its node lists (BuildList1toBuildList5,src/E0CF7.C); the routines that stop the clock by clearing bit 1 ofgTimerEnableFlagsare the camp menu,LoadLeveland the flash and spell animations (whitepaper 3.6.2), and the panel is not one of them. The oracle's recording showsgGameTickscounting with the panel open. ↩︎Whitepaper 5.3.1. Cell 754 of level 1, the stairs, is
02 02 01 18inLEVEL1.MAZand02 02 01 18 A8 00 00 CF 02in the original'sgMaze(ds:B894) after loading the fixture save: A8 holds no monsters in its low three bits and, in the other five, the triggers for the party entering, an item put down and a thrown item flying in; then no items, and the script at 02CF, low byte first (whitepaper 5.3.1, 5.5.1). Wall kinds 0 to 22 are the program's own (0 open, 1 and 2 walls, 3 to 22 doors); the level file defines the rest (5.3.2). ↩︎Wall sets:
BRICK(levels 1 to 3),BLUE(4 to 6),DROW(7 to 9),GREEN(10 and 11),XANATHA(12) (whitepaper 3.1, 5.3.5).LEVELS.TMPhas 12 slots of 2,040 bytes: the compressed walls (LCW, at most 1,200 bytes) and the 30 monster records, 840 bytes (whitepaper 5.3.6). ↩︎Whitepaper 5.5, 5.5.1 and 5.5.2, and its counts in 5.5.6 (
IF1,572, 22 percent of the instructions;SOUND770;TEXT668;MOVE653). A script's only memory between runs is flag bits, 32 for each level and 32 for the game (5.5.3). ↩︎Decoded with a small disassembler for the level scripts, written for this series, from
LEVEL1.INF, 02CF to 0308 (the listing stops at the start of the other branch). Whitepaper 5.5.5 walks through the same script. ↩︎The find-the-word panel is
FindWordPanel, ovl2:09ED (src/EOV2.Cline 523); whitepaper 5.5.3 and 3.3.1. Level 2's check, decoded the same way (02FD to 035C): level flags 4 to 7 all set and game flag 2 clear, then the text, a sound, game flag 2 set and fourNEWITEM 55(whitepaper 5.5.6). The four carvings are the wall scripts of cells 941, 1013, 502 and 1001: each tests that the item on the pointer has type 5 (a dagger), takes it, sets flag 4, 5, 6 or 7 and calls the check; 502 also opens door 535 and 1001 door 968.NEWITEMcopies an item record (CreateItemOp, 122E:1B9A), and record 55 ofITEM.DATis the prototype "Rations"; the four go to cells 942, 981, 534 and 969, each next to one carving. The special quests as a whole are the quirks article's. ↩︎Whitepaper 5.12 and 5.12.2. The 176 by 120 is the whitepaper's region 5 and was measured on the golden screenshot
tests/sessions/golden/load-walk/dungeon.png(x 0 to 175, y 0 to 119); whitepaper 3.1's "128 by 96" is wrong. ↩︎Whitepaper 5.12.3. The nine rectangles are 3 by 5, 1 by 5, 6 by 5, 2 by 6, 2 by 8, 10 by 8, 3 by 12, 16 by 12 and 3 by 15 tiles, 431 words a wall set, from
BuildViewBlockMap,src/EOV4.Clines 483 to 605 (the 6 by 5 front wall at line 511). ↩︎Whitepaper 5.12.3 and 5.12.4; the clipping of things in the cells is
ComputeViewSpan(5.12.11). That the floor's mirroring is there to make a step show is our reading. ↩︎The order of drawing is
DrawViewSlots,src/EOV4.Clines 1229 to 1251, and the copy to the screen line 1322 (whitepaper 5.12.1). Pre-drawn decorations and items: 5.12.6 and 5.12.9. The monster rule: 5.12.8; the shrunk sizes are the whitepaper's arithmetic from the code, and the same rule matches the kobold the original drew. ↩︎Whitepaper 3.1, 5.1.1 and 5.1.2. The record ends at offset F3h (
src/EOB.Hlines 57 to 124);gChars, six of them, is at ds:F580. The ability roll isRollAbilityScore, ovl0:1177. The nine who can join run from Dohrum at level 3 to Kirath at level 11 (tools/handbook/figs/chr_party.py). ↩︎ApplyItemAttack,src/E0DE8.Clines 248 to 256, abridged; -3 is drawn as CAN'T REACH (whitepaper 5.7.2). ↩︎The to-hit test is
RollToHit,src/E0DE8.Clines 113 to 144 (whitepaper 5.7.3); the cooldown, 18 ticks then 36 more (18 if hasted), is whitepaper 5.7.2. A spell cast from the panel has none. ↩︎gProjectiles, ds:DD2C (src/E0BD2.Cline 17; whitepaper 5.7.5). When a thrown item stops,ClearDDEffectonly clears its flying bits and runs the cell's script (src/E1414.Clines 215 to 229). ↩︎gMonsters, ds:8A82, 30 records of 28 bytes (src/E08E6.Cline 17);gMonsterTypes, ds:1A3B, 22 rows of 27 bytes; a level loads the shapes of up to two kinds (whitepaper 5.6, 5.6.1). The modes asUpdateMonstersdispatches them,src/E08E6.Clines 697 to 722 (whitepaper 5.6.4). Noticing the party: whitepaper 5.6.5; the distance is octagonal. ↩︎Whitepaper 5.6.5, 5.6.2 and 5.7.4; the ranged attack needs the party at most 3 cells straight ahead with every cell between passable and empty (
TryMonsterRangedAttack,src/E08E6.Clines 508 to 536). ↩︎Whitepaper 5.8 and 5.8.1; scribing, 5.9.2. ↩︎
CampLoop,src/EOV6.Clines 114 on; whitepaper 5.8.1 and 5.9.3. The neighbour test isAreMonstersNear,src/EOV6.Clines 403 to 417 (a distance under 2, so the eight cells around the party). ↩︎Whitepaper 5.8.4, 5.8.5 and 5.7.5. Each slot is a 32-bit tick (
timers[10]) and a type byte (src/EOB.Hlines 113 and 114). ↩︎Entry 14 of
gEffects,DecayMemberState, period 1080 (src/E1414.Cline 100); whitepaper 5.9.4. A hundred points at a point every 1,080 ticks or so, at 18.2 ticks a second, is about 99 minutes. ↩︎Whitepaper 5.14 and 2.7. The sound digit's path:
INTRO.EXEpassesargv[2]on, andEOB.EXEstoresgSoundCard = argv[2][0] - '1'(src/E07C8.Cline 249). What each answer starts:StartupGame,src/E07C8.Clines 426 to 454; answer 4 has no case, andgSoundOnis 0 (line 250). Every write goes throughAdlibWrite: the register number to port 388h, the value to 389h (src/E_TEXT.ASM, lines 2074 to 2085). The Sound Blaster carries the AdLib's chip, Yamaha's OPL2, at those ports. ↩︎AdlibWrite, 0000:4C6B,src/E_TEXT.ASMlines 2075 to 2085; whitepaper 2.1.2 and 5.14.3. ↩︎Whitepaper 3.6.2 and 5.14.3. The 874 assumes the PC's standard timer clock, as the whitepaper does. ↩︎
Whitepaper 5.14.2. A note or a command:
UpdateVoices,src/E_TEXT.ASMlines 887 to 890. The character creation music is game sound 20, driver sound 66 inADLIB.DAT: voice 9 and priority 1, three commands, the start of sounds 67 to 74 (on voices 0 to 7), then the end. ↩︎Whitepaper 5.14.1, 5.14.2 and 5.14.4. The Tandy's volumes 15, 10 and 5 are
gVoiceTandyVol(src/E1948.ASMline 112), and voices 1 and 2 start 23h and 46h timer passes late (lines 242 and 243); "like an echo" is our reading. ↩︎Whitepaper 2.5, 5.12.13, 5.13.7 (five
.PALfiles, one per wall set, loaded with each level) and 5.13.11. The EGA, CGA and Tandy views use the.ECNand.EMPwall files in place of.VCNand.VMP(5.12.13). The four drivers rebuild identical:make rebuild PROGRAM=EGA.OVLand the like (work/status.md, P7). ↩︎work/status.md, P6 (names) and P5 (the goldens on the rebuilds). The Tandy build's patches are checked the same way, withmake funcinports/dos/. ↩︎work/status.md, P7:make port-playplays the game in a window with SDL3 from its own data image; macOS only for now, sound still to come. The Tandy 1000 EX build:ports/dos/README.md(tandy-sound.patcharranges the game's own music). The CoCo 3 port is in progress (video/PLAN.md). ↩︎src/E0EF3.Cline 1157 andsrc/D07C8.Cline 406; the three spells are in whitepaper 5.8.7. ↩︎GOG, "Forgotten Realms: The Archives, Collection One" (Eye of the Beholder I, II and III), sold since 2015, https://www.gog.com/en/game/forgotten_realms_the_archives_collection_one. ↩︎