If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!
This article has a talk page!

King's Quest: Quest for the Crown

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

King's Quest: Quest for the Crown

Developer: Sierra On-Line
Publisher: Sierra On-Line
Platforms: IBM PCjr, DOS, Apple IIGS, Mac OS Classic, Atari ST, Amiga
Released in US: May 10, 1984


SourceIcon.png This game has uncompiled source code.
GraphicsIcon.png This game has unused graphics.
SoundIcon.png This game has unused sounds.
TextIcon.png This game has unused text.
DebugIcon.png This game has debugging material.
LevelSelectIcon.png This game has a hidden level select.


NotesIcon.png This game has a notes page

King's Quest is Sierra's first adventure game with fully animated graphics, and the first game to use the new AGI engine. You are not-yet-king Graham, who must recover three magical items for the King of Daventry before he dies of Plot's Disease.

Fall in the moat! Have your treasure stolen by a gnome, rendering the game unwinnable! Kick Ifnkovhgroghprm until he feels like his name sounds!

Debug Functions

Being based on the same engine, the DOS version of King's Quest shares a set of debugging features with King's Quest II.

Main Debug Commands

Press ALT+D (or Command-D in the Mac version) to enable some debugging words. These features are disabled upon entering a new room.

Here's the complete word list:

  • TP: Teleport to the appropriate room.
  • POS: Set Graham's X and Y positions.
  • GET OBJECT: Puts the appropriate object by ID in the player's inventory.
  • OBJECT or SP: Gives status on the appropriate object.
  • SET VAR: Sets a chosen variable to a given value.
  • SHOW VAR: Displays the value of a variable.
  • SET FLAG: Sets the appropriate flag.
  • RESET FLAG: Resets the appropriate flag.
  • SHOW FLAG: Displays info on a flag (Can be either set or not set).

Additional Functions

When debug mode is active, the text for handling unknown words is simplified.

Word not known: <word>

Numbers organized in a window for your convenience.
Press F10 to display info on memory use.

Your pink castle is hideous. I don't want to be king anymore.
Press F6 to display priority settings for the current room.

Unused Graphics

KQ1AGIEdwardSpin.gif
An animation of King Edward spinning. This is used in the original PCjr release -- right before King Edward falls over dead -- but not in the DOS version.

KQ1AGIKingGrahamF.png
This frame, however, was created for the newer versions of the game. It's never used: When Graham looks at the throne in the ending sequence, he looks left, not up.

(Source: Original TCRF research)

Unused Text

ID Message PCjr Notes
General Logic
2 Where do you think it could be? No An alternate message for trying to FIND something.
12 You need to be closer to the
water if you want to swim.
No Unused message for trying to SWIM at an insufficient distance from the water.
22 You do not have a bowl. No This is the first of several error messages that went unused because they spoil content in the game.
95 With disappointment, you see
that nothing happens.
No From where it's placed in the code, this is a generic message for the magic ring failing to work.
Logic 6 - Stump & Pouch Field
4 You could get a much better
look at it if it were in your
hands.
Yes Should be triggered by LOOK POUCH, but it's not.
11 You need to get closer to look
at the log.
No A more specific message for trying to look at the log from far away.
Logic 10 - Goat Pen (West Side)
1 There is no reason to jump or
duck here.
Yes The first of several messages for failing to jump / duck in a specific room.
8 That is not something the old
goat wants to eat.
Yes Probably meant for trying to feed the goat something other than a carrot.
17 The goat is following you. Yes Possibly triggered by typing LOOK GOAT after getting him to follow you.
Logic 11 - Goat Pen (East Side)
2 It's not nice to tease the
goat. You're not leaving
without him.
Yes Could have been used after showing the goat the carrot a second time.
16 You have nothing the old goat
wants to eat.
Yes (See above).
29 Why would you want to do that?
There is a gate.
Yes Trying to jump over or break the fence might have provoked this text.
Logic 13 - Wolf Field
11 Now that the goat is gone,
you'll have to take care of
yourself!
Yes If the player killed the goat while the wolf was on the screen, this text could have popped up.
Logic 21 - Witch Area
5 Your protection is gone and
you best look out for the
witch!
Yes A message meant for when the Fairy Godmother's protection disappeared while the witch was still on-screen.
6 With the goat now dead, you
are fair game for the witch.
Yes Another message for the goat dying, opening the player to danger.
18 Oh NO!! She's back!!! No Maybe the witch could leave the screen and come back again?
Logic 22 - Condor Area
8 You would hit your head on the
top of the cave if you jumped
now!
Yes More room-specific jumping messages! Woo!
Logic 25 - Troll Bridge (North)
19 You have no treasure to give
the troll.
Yes Attempting to GIVE the troll something with no items, most likely.
20 You can't give it if you don't
have it.
Yes Trying to give the troll a treasure that you don't actually have would display this message.
Logic 28 - Outside Witch's House
10 The goat is suspicious of this
witch's house and refuses to
go in.
Yes When Graham tries to enter the witch's house with the goat by his side, the goat would leave him.
20 The path is around the corner. No Typing LOOK CORNER with the path not in view?
Logic 29 - Sorcerer Area
3 You're so afraid of the
sorcerer that your knees are
locked.
Yes Yet more room-specific jumping / ducking failure text.
8 You are immobilized! You can't
jump or duck now!
Yes Whoa, two in the same room.
Logic 36 - Leprechaun Cave Entrance
9 There are several pretty trees
in the area and a few rocks.
One rock has a small hole in
its base.
Yes A nice description of the area that's never referenced in the room logic.
Logic 39 - Troll Bridge (West)
20 If you don't have it, how can
you give it to the troll?
Yes (Please see Logic 25).
Logic 41 - Troll Bridge (South)
20 You don't have any. Yes (Please see Logic 39, which will direct to you Logic 25).
Logic 46 - Ogre Area
6 The ogre can see you now! No A message for the magic ring's invisibility wearing off with the Ogre still on the screen.
Logic 51 - Dragon's Lair
28 You don't have a dagger. Yes Another message deleted for spoiling of a game item.
29 You don't have any water. Yes See above.
37 You are too busy looking
around to even think about
that.
Yes This is a pretty nondescript message, so it could have been used for any number of things.
Logic 53 - Daventry Throne Room
1 Even as you are reaching for
your medevial flamethrower,
the King's agents descend upon
you. You are taken away to be
torched at dawn.
No A humorous easter egg that seems to have been removed from the game entirely.
It was added for the later versions; It doesn't appear in the original PCjr game at all.
7 You bow, but you are the only
one who knows it.
Yes This appears in the PCjr game for bowing to the king after his death.
This isn't possible in the newer versions of the game.
11 Before exposing your
flamethrower, you decide the
King is just beyond the range
of your obsolete flamethrower.
No Oh that Graham, always traveling through time to get weapons for regicide!
15 He bids you to approach so he
can hear you.
Yes This can be triggered in the PCjr game by typing LOOK KING from far away.
17 Your heart also aches with
pain as you watch the King.
Yes Even in the PCjr version, you can't look at the King in the middle of his heart attack.
18 The King is lying motionless
on the ground.
Yes Another message left over from the PCjr version.
There, it's possible to type LOOK KING after his death, but before taking the throne.
31 As you are leaving, your
agents remind you that you
must remain here now, where
it is safe.
Yes This is the last message specific to the PCjr game.
This is triggered in that version by trying to exit the room after the king's death.
Logic 58 - Giant's Room
17 You have no sling! Yes A message revealing the existence of an item in the game? Right out.
19 You have no dagger! Yes Another one? Get that out of here.
Logic 65 - Witch's House
4 This is not a good place to
give up your protection!
Yes Unknown. It's not possible to voluntarily give up your protection...
5 There is no reason to jump or
duck here.
Yes I heard you like room-specific jumping and ducking messages. Here's one now.
51 The note was here at one time,
but now you can`t seem to
locate it.
Yes Trying to TAKE NOTE a second time would produce this message.
Logic 70/71/72 - Beanstalk Climb
1 If you were to jump or duck
here you might fall.
Yes Okay, this exact string appears in three rooms, so it's not really room-specific.
Still, though!
Logic 75 - Rat Cave
11 It is already open. Yes You can't open an open door. That's not how doors work, (wo)man.
13 The door appears to be stuck
and won't close.
Yes If for some reason the player tried to close the door, this message might have been displayed.
17 You have no treasure to give
the rat.
Yes Remember the troll message similar to this one? Yeah. Same deal.
23 You do not have any. Yes Trolls, like rats, hate adventurers who give them the absence of objects.
Logic 77 - Leprechaun King's Chamber
3 It is very difficult to play a
fiddle if you do not have one.
Yes It is indeed. Also, this message spoils the existence of the fiddle, so out it went.
20 The shield is already in your
pocket.
Yes Typing TAKE SHIELD a second time would prompt this error message.
(Source: Original TCRF research)

Early Draft

Early Final Notes
Logic 0, Message 25
There is no reason to drop it.
Logic 102, Message 3
There is no reason to do that.
Verily, there is no reason at all to drop any item in this game.
Logic 0, Message 26
You are already swimming.
Logic 101, Message 4
You are already swimming!
Emphasis!!
Logic 12, Message 26
The old bucket vanishes into
the depths of the well.
Logic 12, Message 19
The old bucket disappears
into the darkness.
Logic 12, Message 28
The old bucket is already at
the top of the well.
Logic 12, Message 21
The bucket is already at the
top of the well.
Commenting on the age of a bucket at the top of a well is poor form. Everybody knows that.
Logic 12, Message 31
The old bucket is lifted
from the well.
Logic 12, Message 22
The old bucket emerges from
the depths of the well.
Logic 12, Message 51
Sorry, all the water is at
the bottom of the well.
Logic 12, Message 50
All the water is at the
bottom of the well.
The final text is notably less apologetic.
Logic 79, Message 5
This is the woodcutter's
fiddle.
Logic 79, Message 37
The fiddle is a beautiful
instrument made of polished
wood.
This bland description of the fiddle was thankfully improved.
(Source: Original TCRF research)

Unused Sounds

Standard PC Tandy PC

Sound 03 is never used. This is actually the nightingale call from King's Quest II. The new version of King's Quest was built off of King's Quest II, and this sound was mistakenly left in.

(Source: Original TCRF research)

Uncompiled Source Code

The very first IBM PC release for CGA (not the PCjr release) with a MAIN.EXE dated May 30, 1984, has uncompiled 8088 assembler source code in the thirteen 512-byte sectors starting at cylinder 7, head 0, sector 3:

        mov     [di+saveptr],ax         ;save buffer pointer
        mov     ax,[si+word ptr outxpos]
        mov     [di+word ptr xpos],ax   ;positions
        pop     bx
        call    setcel
        mov     al,[di+steptime]
        or      al,al
        jnz     stepok
        mov     al,1
stepok: mov     [di+steptime],al        ;set default steptime
        mov     [di+stepclock],al       ;set stepclock
        ret
setcel: mov     al,[bx]                 ;loop count
        mov     ah,0
        xor     bx,bx                   ;if 1 loop, get loop 0
        dec     ax
        jz      stcel
        inc     bx                      ;if 2 loops, get loop 1
        dec     ax
        jz      stcel
        inc     bx                      ;if 4 loops, get loop 2
        xor     ax,ax
stcel:  push    bp
        mov     bp,sp
        push    ax                      ;pass cel #
        push    bx                      ;pass loop #
        push    di                      ;pass table pointer
        call    getstcel
        pop     di                      ;get table pointer
        pop     bx                      ;get loop #
        mov     sp,bp
        pop     bp
        mov     [di+celcnt],al          ;set cel count
        mov     [di+curl],bl            ;set loop #
        ret
trashem:lea     si,objtab               ;animation table pointer
        lea     di,chuck                ;object table pointer
        mov     ch,outlen               ;object table entry length
        mov     cl,4                    ;nibble shifter
t0:     add     si,grplen               ;point to next animation table
        mov     dl,[si]                 ;get room entry
        cmp     dl,0                    ;not terminator?
        jz      t1
        mov     byte ptr [si],0
        cmp     dl,flags.roomflag       ;in this room?
        jne     t0
        mov     al,[si+disknum]         ;get this object's #
        mul     ch                      ;offset of this obj's table entry
        mov     bx,ax
        mov     dh,[di+bx+outroom]
        and     dh,80h
        or      dl,dh                   ;maintain ego possession
        mov     [di+bx+outroom],dl      ;set this obj's room # entry
        mov     ah,[si+curl]
        mov     al,[si+curcel]          ;combine loop & cel values
        shl     ah,cl
        or      al,ah
        mov     [di+bx+outlupcel],al    ;set loop & cel entry
        mov     ax,word ptr [si+xpos]
        mov     word ptr [di+bx+outxpos],ax      ;set position entries
        jmp     t0              ;process the 3 non-ego animation tables
t1:     add     di,inobjtab     ;point to 1st object table's anitbl entry
        mov     cx,110          ;object count minus 1 (ego)
outlup: add     di,outlen       ;point to next object table
        mov     byte ptr [di],0 ;clear all objs' animation table entries
        loop    outlup          ;process all objects' tables
        mov     chuckptr,0              ;clear loaded objects count
        lea     di,objtab
        mov     byte ptr [di+grplen],0  ;terminate animation tables
        mov     ax,curact
        mov     objptr,ax               ;reset free memory pointer
        mov     cx,40-9
        lea     di,soundpos
        add     di,18
        lea     ax,stopsnd
;        rep     stosw                   ;set all non-res. sound ptrs to silence
        ret
loadego:call    wtprt
        mov     al,0
        call    load_obj                ;get ego
        lea     di,objtab               ;object table pointer
        mov     [di+lgrpptr],ax         ;set loop group pointer
        lea     bx,alterego
        mov     [bx],ax                 ;ditto
        mov     al,0
        mov     [di+disknum],al
        mov     [di+objnum],al
        mov     [di+curcel],al          ;disk #, obj # & cel # = 0
        mov     [di+curl],al            ;loop # = 2
        mov     [di+stepclock],1        ;stepclock = 1

        lea     bx,chuck                ;out table pointer
        mov     ax,[bx+word ptr outxpos]
        mov     [di+word ptr xpos],ax   ;set positions
        mov     ax,savetab
        mov     [di+saveptr],ax         ;set save buffer pointer


        mov     [di+celcnt],8           ;cel count = 8
        push    bp
        mov     bp,sp
        mov     ax,6
        push    ax                      ;pass cel #
        mov     al,0
        push    ax                      ;pass loop #
        push    di                      ;pass table pointer
        call    getstcel                ;set step sizes, cel pointer & stepclock
        mov     sp,bp
        pop     bp
        mov     flags.roomflag,1
        mov     dx,0
        call    dwt

        lea     ax,objtab
        mov     tabptr,ax
        cmp     cpyseq,0
        jnz     ldgrtn
        call    ers
ldgrtn: ret

clearscrn:
        push    ax
        mov     ax,600h
        jmp     sc1
scroll: push    ax
        mov     ax,601h
sc1:    push    bx
        push    cx
        push    dx
        mov     cx,1500h
        mov     dx,1827h
        mov     bh,0
        call    wtprt
        int     10h
        mov     dx,1800h
        jmp     short stcr






setcsr: push    ax
        push    bx
        push    cx
        push    dx
stcr:   mov     curchar,dl
        mov     ah,2
        mov     bh,0
        call    wtprt
        int     10h
        pop     dx
        pop     cx
        pop     bx
        pop     ax
        ret











term    equ     0ffh
skip    equ     0feh
psn     equ     0fdh
flag    equ     0fch
always  equ     0fbh
ignore  equ     0fah
unknown equ     0f9h












;                              Say-what?
;           Scans the text logic table ( @texptr or @texany ) 
;       for true sequences of conditions [ text, flag & position ]
;   then passes a pointer for the action table [ @actptr or @actany ]
;  to ACTMODUL to execute the action string for the matched conitions.

saywhat:
        mov     lgcflg,1        ;flag text table checks
        mov     si,txtptr       ;get text logics table pointer
        jmp     chklup

;                             Check-mate!
;         Scans the position logic table ( @posptr or @posany )
;        for true sequences of conditions  [ flags & positions ]
;   then passes a pointer for the action table [ @actptr or @actany ]
;  to ACTMODUL to execute the action string for the matched conitions.

chekmate:
        mov     lgcflg,0        ;flag position table checks
        mov     
(Source: NewRisingSun)