Patch:Bean-With-Bacon-Megarocket

From KeenWiki
Jump to navigation Jump to search

The Bean-with-Bacon Megarocket is Keen's ship, which can be seen in all episodes of Commander Keen excepting Keen Dreams. However the BwB only plays a role in gameplay in Keen 1, Keen 3, Keen 4 and Keen 6. This page is divided into three sections, the first is relates to Keen 1 where the BwB brings up a window, the second relates to Keen 3 where the BwB provides a series of messages, and the third section relates to Keen Galaxy, where the Bwb level has unique properties.

The BWB level name text patches can be found at Patch:Levels, related patches can be found at Patch:Map. The BWB also makes an appearance in both the Keen 1 ending sequence and Keen 2 ending sequence.


Keen 1

In Keen 1 a specific sprite on the map level will bring up a window when the player tries to enter it. Keen can bring up a window showing the four ship parts he must collect before he can win the game. It displays four tiles, which are not shown depending on what Keen has. These patches require some knowledge of Patch:Game stats and Patch:Text patches. Window size is in 8x8 blocks. The text is different depending on whether Keen is using a keyboard or joystick.


Level marker that brings up messages

This is the level marker that causes the BWB message box to appear rather than letting Keen into a level. If the 32 level patch is being used this will make level 20 inaccessible. As such when using this patch it is preferable to set the marker to $63 (99) so that this level can be used.

Keen 1

#BwB message level marker (20)
%patch $AE2A [$14] {$74}


Disable messages completely

This patch completely disables the BwB messages; no level marker will cause the messages to appear, freeing up the code space for other use.

Keen 1

#Completely remove BWB messages
%patch $AE2B $90 $90


Window and text

The patches affecting tile appearance requires knowledge of Patch:Jump conditions, by default only if the value is zero will the tile be shown.

Keen 1 BWB message box

#Size
%patch $AE31 [$0008W] #Height
%patch $AE35 [$0014W] #Width

#Text read from
%patch $AE3F [$354BW] #Ship missing
%patch $AE48 [$3572W] #GO GET EM!
%patch $AE51 [$3584W] #Press a-
%patch $AE64 [$3590W] #-key
%patch $AE68 [$3595W] #-button

#Text
%patch $1659B "Your ship is missing" $0A "these parts:" $0A $0A $0A $0A $0A $00
%patch $165C2 "    GO GET THEM!" $0A $00
%patch $165D4 "   Press a " $00
%patch $165E0 "key:" $00
%patch $165E5 "button:" $00

#Keen must find tiles
%patch $AE78  [$0141W] #1st tile, etc...
%patch $AE9D  [$0142W]
%patch $AEC2  [$0143W]
%patch $AEE7  [$0144W]

#Tile h-positions:
%patch $AE8C [$0003W] #1st tile, etc...
%patch $AEB1 [$0007W]
%patch $AED6 [$000BW]
%patch $AEFB [$000FW]

#What makes the parts tiles NOT appear at the BwB-parts window:
%patch $AE72 {$AA94W} $00 $75 #Joystick 
%patch $AE97 {$AA9CW} $00 $75 #Battery
%patch $AEBC {$AA96W} $00 $75 #Vacuum
%patch $AEE1 {$AA98W} $00 $75 #Whiskey


No 'Press any' text

This patch removes the 'Press any key\button' text that appears at the end of the BwB messages, this can make them more clear.

Keen 1

#No 'Press any' text
%patch $AE50 $EB $1E


No 'button\key' texts

This patch is similar to the above, however it removes only the 'button' or 'key' texts at the end of the 'press any' line. This means the window will look the same if the player is suing the keyboard or joystick. (The 'press any' message can easily be altered to reflect this.)

Keen 1

#No 'button\key' texts
%patch $AE59 $EB $15


Press any animation

This is the little twirling blue circle displayed at the very end of the message. it waits for Keen to press a key. Patches relating to it can be found at Patch:Press any key.


Keen 3

In Keen 3 Keen can interact with the BwB in a similar manner to Keen 1 to bring up one of four randomly chosen messages. Using Startext it is possible to display more messages and easily edit the message text. Only the four lines of message text are changed in every message, otherwise the window is the same.

The 'press any key\button' text displays differently depending on whether Keen is using the keyboard or joystick and is separate from the message text proper. It is positioned in the window at line 4, but starts with a down-line byte, putting it at line 5.


Level marker that brings up messages

This is the level marker that causes the BWB message box to appear rather than letting Keen into a level. If the 32 level patch is being used this will make level 20 inaccessible. As such when using this patch it is preferable to set the marker to $63 (99) so that this level can be used.

Keen 3

#BwB message level marker (20)
%patch $B85A [$14] {$74}


Disable messages completely

This patch completely disables the BwB messages; no level marker will cause the messages to appear, freeing up the code space for other use.

Keen 3

#Completely remove BWB messages
%patch $B85B $90 $90


Window and text

These patches relate to the window and text of the messages.

Keen 3

#Window size
%patch $B86F [$0020W] #Width
%patch $B86B [$0006W] #Height

#Text read from:
#First message
%patch $B88D [$35E4W]
%patch $B895 [$3605W]
%patch $B89D [$3623W]
%patch $B8A5 [$3643W]

#Second message
%patch $B8AF [$3658W]
%patch $B8B7 [$3678W]
%patch $B8BF [$3697W]

#Third message
%patch $B8C9 [$36B6W]
%patch $B8D1 [$36D7W]
%patch $B8D9 [$36F3W]
%patch $B8E1 [$3715W]

#Fourth message
%patch $B8EB [$3731W]
%patch $B8F3 [$374FW]
%patch $B8FB [$3770W]
%patch $B903 [$378CW]

#BwB Message 1; 4 lines
%patch $1CE04 "You enter your ship, sit around"
%patch $1CE25 "for a while, get bored, then"
%patch $1CE43 "remember that you have to find"
%patch $1CE63 "the Grand Intellect!"

#BwB Message 2; 3 lines
%patch $1CE78 "Into the ship you journey, lie"
%patch $1CE98 "about a bit, then resume your"
%patch $1CEB7 "quest for the Grand Intellect!"

#BwB Message 3; 4 lines
%patch $1CED6 "You feel like entering the ship"
%patch $1CEF7 "and taking a rest, but the"
%patch $1CF13 "mystery of the Grand Intellect's"
%patch $1CF35 "identity changes your mind."

#BwB Message 4;4 lines
%patch $1CF51 "Entering the ship might be a"
%patch $1CF6F "fun thing to do, but right now,"
%patch $1CF90 "you need to find the Grand"
%patch $1CFAC "Intellect and vanquish him!"


#Press a key text
%patch $B90F [$0004W] #Number of lines text starts at

#Read from: (Hard to change)
%patch $B915 [$37A8W] #Press a
%patch $B926 [$37BBW] #Key
%patch $B930 [$37C0W] #Button

#Press a key message (note it starts with $0A)
%patch $1CFC8 $0A "         press a " $00
%patch $1CFDB "key:" $00
%patch $1CFE0 "button:" $00


No 'Press any' text

This patch removes the 'Press any key\button' text that appears at the end of the BwB messages, this can make them more clear.

Keen 3

#No 'Press any' text
%patch $B90C $EB $29


No 'button\key' texts

This patch is similar to the above, however it removes only the 'button' or 'key' texts at the end of the 'press any' line. This means the window will look the same if the player is suing the keyboard or joystick. (The 'press any' message can easily be altered to reflect this.)

Keen 3

#No 'button\key' texts
%patch $B91C $EB $19


Press any animation

This is the little twirling blue circle displayed at the very end of the message. it waits for Keen to press a key. Patches relating to it can be found at Patch:Press any key.


Number of different messages

There are two values that define how many messages exist, by default both are 3, allowing for 3 + 1 = 4 different messages. Both of these values should be equal. If the first is smaller it will limit the number of messages, if the second is smaller then occasionally the window will appear with no message (but the 'press any key' text.)

Decreasing the number of messages is simple enough, but increasing the number is more difficult since the message code list will not fit anymore and will have to be relocated.

Keen 3

#Number of messages
%patch $B87F [$03]
%patch $B87F [$03]

#Message code list location
%patch $B88A [$BBF8W]

#Message code pointer list
%patch $BBF8 [$B88CW] #Message 1
             [$B8AEW] #Message 2
             [$B8C8W] #Message 3
             [$B8EAW] #Message 4


Map sprite that triggers messages

By default only one sprite number on the map will cause the BwB window to appear. By default this is 20. If this is set to 0 Keen will be able to bring up the window nearly anywhere on the map. If using the 32 levels patch the modder may want to change this to something like sprite 33 ($21).

Keen 3

#BwB message sprite (20)
%patch $B85A [$14] {$74}


Keen enters BwB after message is displayed

This patch makes it so Keen will enter the BwB level after the message window appears. By default this level is 20 and Keen will enter a glitch, but in combination with the patch above it can be made into say the secret level that Keen can then enter and play normally. Or the 32 level patch can be applied.

Keen 3

#Keen enters BwB level after window is displayed
%patch $B943 $EB $04


Sound when window appears\disappears

This patch plays a sound when the BwB message window appears, and has a second patch to also play a sound when it disappears. There are two patches depending on whether a sound is wanted when the window appears, or when it appears and disappears. The sounds can be the same or different and are marked in blue.

Keen 3

#Level entry texts and sound when window appears
%patch $B91C $B8 [$000AW]  $50 $E8 $1046W  $59 $EB $11

Keen 3

#Level entry texts and sound when window appears\disappears
%patch $B91C $B8 [$000AW]  $50 $E8 $1046W  $59 $E8 $6893W  $E8 $02D6W  $E8 $688DW
                 $E8 $087CW  $B8 [$000BW]  $50 $E8 $1032W  $59 $EB $09


Keen galaxy style level entry texts

This patch causes a window to appear whenever Keen tries to enter a level displaying three pieces of text, a 'level entry' line, the 'press any key' line and a level name that differs depending on what level he is about to enter. This is similar to Keen Galaxy, except the player must press a key before the level will begin. As a side effect this patch removes Keen's ability to ride Messie, though Messie will still appear on the map. BwB messages are of course not available. (If Messie is strongly desired it is possible to rewrite the patch to allow her to still be ridden.)

Most of the patch is technical and should not be altered. (It replaces the Messie check code by moving some other code over it, then uses the free space for the level name code.) The two brown values are the number of possible level names and differ by two for complex reasons. This patch sets 32 possible level names, meaning it will work with the default 16 levels or the 32 levels patch without needing any alteration.

The first two blue values are the size of the text window that appears. In this patch the default BwB dimensions are used though it is likely that alteration will be wanted. The third blue value is the location of the 'Keen enters' text that appears before the level name in all windows. The remaining blue values are the location of the level entry texts. In this patch they are set to a dummy value, all the same. The actual values will depend on the level names the modder wants.

Finally it is possible to alter the first line in the window, at the end of the patch. This will alter what is stated in all level entry windows. To alter the 'press any key' text, simply apply patches from elsewhere on this page. (For example the patch above that removes it will also work with this patch, preventing it from appearing in level entry windows.)

Keen galaxy style level entry texts in Keen 3

#Keen sees a galaxy style window appear before each level loads
#SIDE EFFECT: Messie cannot be ridden

#Move up Teleporter-BwB-level entry call code
%patch $B74A $83 $3E $70ECW  $00 $74 $1B $FF $76 $F2 $FF $76 $F4 $56 $FF $36
             $70ECW  $E8 $0063W  $83 $C4 $08 $0B $C0 $74 $06 $C7 $06 $70ECW 
             $0000W  $5F $5E $8B $E5 $5D $C3

#Move code pointer list
%patch $B772 $B4EAW $B4F6W $B507W $B513W $B524W $B530W $B541W $B4D9W

#New list location
%patch $B4D7 $B772W

#Level name code pointer list
%patch $B782 $B802W  $B808W  $B80EW  $B814W  $B81AW  $B820W  $B826W $B82CW
             $B832W  $B838W  $B83EW  $B844W  $B84AW  $B850W  $B856W $B85CW
             $B862W  $B868W  $B86EW  $B874W  $B87AW  $B880W  $B886W $B88CW
             $B892W  $B898W  $B89EW  $B8A4W  $B8AAW  $B8B0W  $B8B6W $B8BCW  

#New expanded level entry code, includes level entrance texts
%patch $B7C2 $55 $8B $EC $83 $EC $04 $56 $57 $83 $7E $04 {$21} $72 $03 $E9 $0176W
                 $A1 $70ECW  $8B $F8 $B8 [$0006W]  $50 $B8 [$0020W]  $50 $E8 $6E55W
                 $59 $59 $B8 [$35E4W]  $50 $E8 $7057W  $59 $8B $36 $86 $82 $8B
                 $DF $83 $FB {$20} $76 $03 $E9 $00C1W  $D1 $E3 $2E $FF $A7 $B780W

#Level name code
%patch $B802 $B8 [$35E4W]  $50 $EB $04 $B8 [$35E4W]  $50 $EB $7C $B8 [$35E4W]  $50 $EB $76
             $B8 [$35E4W]  $50 $EB $70 $B8 [$35E4W]  $50 $EB $6A $B8 [$35E4W]  $50 $EB $64
             $B8 [$35E4W]  $50 $EB $5E $B8 [$35E4W]  $50 $EB $58 $B8 [$35E4W]  $50 $EB $52
             $B8 [$35E4W]  $50 $EB $4C $B8 [$35E4W]  $50 $EB $46 $B8 [$35E4W]  $50 $EB $40
             $B8 [$35E4W]  $50 $EB $3A $B8 [$35E4W]  $50 $EB $34 $B8 [$35E4W]  $50 $EB $2E
             $B8 [$35E4W]  $50 $EB $28 $B8 [$35E4W]  $50 $EB $22 $B8 [$35E4W]  $50 $EB $1C
             $B8 [$35E4W]  $50 $EB $16 $B8 [$35E4W]  $50 $EB $10 $B8 [$35E4W]  $50 $EB $0A
             $B8 [$35E4W]  $50 $EB $04 $B8 [$35E4W]  $50 $EB $7A $B8 [$35E4W]  $50 $EB $74
             $B8 [$35E4W]  $50 $EB $6E $B8 [$35E4W]  $50 $EB $68 $B8 [$35E4W]  $50 $EB $62
             $B8 [$35E4W]  $50 $EB $5C $B8 [$35E4W]  $50 $EB $56 $B8 [$35E4W]  $50 $EB $50
             $B8 [$35E4W]  $50 $EB $4A $B8 [$35E4W]  $50 $EB $44

#Keen enters level after window is displayed
%patch $B943 $EB $04

#Level entry text
%patch $1CE04 "Keen enters" $0A $00


Level entry texts and sound when window appears\disappears

This patch is similar to the 'sound when window appears' patch above, but adapted for the galaxy style entry text patch. It must replace %patch $B943 $EB $04 found near the end of the level entry text patch. As above, there are two patches depending on whether a sound is wanted when the window appears, or when it appears and disappears.

Keen 3

#Level entry texts and sound when window appears
%patch $B91C $B8 [$000AW]  $50 $E8 $1046W  $59 $EB $17

Keen 3

#Level entry texts and sound when window appears\disappears
%patch $B91C $B8 [$000AW]  $50 $E8 $1046W  $59 $E8 $6893W  $E8 $02D6W  $E8 $688DW
                 $E8 $087CW  $B8 [$000BW]  $50 $E8 $1032W  $59 $EB $0F


Specific message appears under certain circumstances

By default the BwB messages are random, any one of a specific number appearing each time. However it is possible to make the messages nonrandom, so that the player encounters them in a predictable manner. each of these patches makes the specific message that appears depend on a different variable. Using game stats it's possible to alter these example patches to cover all sorts of circumstances, such as whether or not Keen has a keycard or has completed a level.

Keen 3

#BWB message depends on ammo
%patch $B860 $A1 {$9D48W} $90 $90 $90 $90 $90

#BWB message depends on level Keen is in
%patch $B860 $A1 {$828CW} $90 $90 $90 $90 $90

#BWB message depends on sprite Keen is touching
%patch $B860 $A1 {$70ECW} $90 $90 $90 $90 $90


Keen Galaxy

In Keen Galaxy the BWB is a special level that can be continuously reentered, often to gain a small amount of points or ammunition.


BWB-type levels

In Keen 4 and Keen 6 levels above a certain number do not get marked as 'done' when they are exited, no flag appears on the map, no map tiles are removed and the level can be reentered. It is possible for just one level to have this status, or none. (Setting the level as 0 means no level has this status, setting the jump as $77 means all levels above x have this status and so on.) This requires some knowledge of Patch:Jump conditions See also Patch:Levels (Galaxy), which also has patches for the BwB level's name.

Keen 4

#BwB levels: all levels above 17
%patch $60FD $11 $77

Keen 5

#BwB levels: all levels above 17
%patch $60B3 $11 $77

Keen 6

#BwB levels: all levels above 16
%patch $5ECD $10 $77


Game starts in BWB level

This patch causes the player to start the game in a different level than the map. The values of the level variable given here will start the game in the default BWB level (Except Keen 5 where the player will start in the High Scores level due to the game lacking a BWB level proper.)

There is one minor side effect to this patch; the high word of the Extra Keen At score is not set to 0. What this means is that the game cannot start with an Extra Keen At score of more than 65'000 or so without a slightly more complicated patch being used.

Keen 4

#Keen starts game in the BWB
%patch $5CBB {$7A68W} [$0012W]

Keen 5

#Keen starts game in the BWB
%patch $5C8F {$6F68W} [$000FW]

Keen 6

#Keen starts game in the BWB
%patch $58AF {$75A4W} [$0011W]