Patch:You didn't make it past window

From KeenWiki
Jump to: navigation, search

The 'Didn't make it past' window appears whenever Keen dies in Keen galaxy or Keen Dreams. The player is shown the previous sentence along with the level name, and given two options, quit, or retry the level. The selected option is surrounded by a flashing rectangle. The player can use the arrow keys to change the selected option, the Esc key to quit to the map and either Space or Enter to choose the selected option.


No window, go to map or retry level

This patch disables the window. Keen will automatically restart a level if he dies with no option to return to the map. One version of the patch will decrease Keen's lives, the other two won't. The first patch works by altering the level state pointer list so that the 'lose level' option is made into 'restart level'. The last two patches both just skip the window. The difference is that one will set Keen's current level to 0 (The map, though of course others can be used.) while the other just remains in the current level.

As would be expected the patches that don't decrease lives eliminate the Game Over window as a side-effect. Otherwise Keen will get a Game over when his lives decrease to zero. (Unless otherwise patched.)

Patch: Keen 4
#Auto restart level, lives remain the same (Frees $5CD3-$5D12, $6632-$69C0)
%patch $6BC1 $0F5CW
#Auto restart level, decrements lives (Frees $5CD3-$5D12)
%patch $668C $9A $146008A8RL $5F $5E $8B $E5 $5D $CB
#Auto go to map, decrements lives (Frees $5CD3-$5D12)
%patch $668C $C7 $06 $7A68W $0000W $9A $146008A8RL $5F $5E $8B $E5 $5D $CB

Patch: Keen Dreams
#Auto restart level, decrements lives (Frees $59EE-$5CF3)
%patch $59E9 $90 $90


Window size and text

These patches control the window's size and text content. If the window is too small or the text too long the game will crash. The window appears different in each level as it mentions the level name.

Patch: Didn't make it past window
#Keen 4 :
%patch $6692 $0008W
#Window height
%patch $6696 $0014W
#Window width
%patch $66A7 $02FFW
#Text called from
%patch $2F16F "You didn't make it past" $00 %patch $66DC $0317W
#Text called from
%patch $2F187 "Try Again" $00 %patch $66F6 $0321W
#Text called from
%patch $2F191 "Exit to Shadowlands" $00
#Keen 5 :
%patch $664D $0008W
#Window height
%patch $6651 $0014W
#Window width
%patch $6662 $02A3W
#Text called from
%patch $305E3 "You didn't make it past" $00 %patch $6697 $02BBW
#Text called from
%patch $305FB "Try Again" $00 %patch $66B1 $2C5W
#Text called from
%patch $30605 "Exit to Armageddon" $00
#Keen 6 :
%patch $6462 $0008W
#Window height
%patch $6466 $0014W
#Window width
%patch $6477 $0243W
#Text called from
%patch $30F73 "You didn't make it past" $00 %patch $64AC $025BW
#Text called from
%patch $30F8B "Try Again" $00 %patch $64C6 $0265W
#Text called from
%patch $30F95 "Exit to Fribbulus Xax" $00
#Keen 7 :
%patch $59F4 $0008W
#Window height
%patch $59F8 $0014W
#Window width
%patch $5A09 $0B01W
#Text called from
%patch $24571 "You didn't make it past" $00 %patch $5A32 $0B19W
#Text called from
%patch $24589 "Try Again" $00 %patch $5A4A $0B23W
#Text called from
%patch $24593 "Exit to Tuberia" $00


Texts' locations in window

There are six variables controlling where text is located within the window and the flashing rectangle's movement. All values are in pixels Firstly the 'Didn't make it' text is three pixels below the inside of window's top edge. The level names are four pixels below that text. The options texts are 16 pixels below the 'Didn't' text and four pixels apart. (Leaving 16 pixels or 2 8-pixel lines for the level names.)

The flashing rectangle's top line is located two pixels above the first option's line and it moves to be two pixels above the second option's line. This tweaks the rectangle's movement in a subtle way. (The actual amount will be the option's separation plus 8 pixels plus the first $02 minus the second $02.) In Keen Dreams there is a twist; rather than a variable pixel value two $48s are used to remove two pixels, one at a time. Replacing these with $90s will shift the rectangle a pixel each time. (In the below patch both $48s are replaced.) This is rather limiting.

Patch: Keen 4
#How far from window top 'Didn't make it' text is
%patch $66A5 $03
#How far down level names are from 'Didn't' text
%patch $66C5 $04
#How far down from level names options are
%patch $66B6 $16
#How far down second option is from first
%patch $66EB $04
#Rectangle is 2 pixels above first option
%patch $66D6 $02
#Rectangle moves to be 2 pixels above second option
%patch $66F0 $02

Patch: Keen 5
#How far from window top 'Didn't make it' text is
%patch $6660 $03
#How far down level names are from 'Didn't' text
%patch $6680 $04
#How far down from level names options are
%patch $6671 $16
#How far down second option is from first
%patch $66A6 $04
#Rectangle is 2 pixels above first option
%patch $6691 $02
#Rectangle moves to be 2 pixels above second option
%patch $66AB $02

Patch: Keen 6
#How far from window top 'Didn't make it' text is
%patch $6475 $03
#How far down level names are from 'Didn't' text
%patch $6495 $04
#How far down from level names options are
%patch $6486 $16
#How far down second option is from first
%patch $64BB $04
#Rectangle is 2 pixels above first option
%patch $64A6 $02
#Rectangle moves to be 2 pixels above second option
%patch $64C0 $02

Patch: Keen Dreams
#How far from window top 'Didn't make it' text is
%patch $5A07 $04
#How far down from level names options are
%patch $5A28 $08
#How far down second option is from first
%patch $5A40 $04
#Rectangle is 2-2 pixels above first option
%patch $5A2C $90 $90
#Rectangle moves to be 2-2 pixels above second option
%patch $5A44 $90 $90


Location of level name list

This patch is for the location of the level name list that allows the current level's name to be displayed in the window. This shouldn't need to be patched under most circumstances. In Keen Galaxy this requires two variables of two bytes difference, in Keen Dreams it requires only one, a text patch.

It is also possible to change what variable affects the level entry read. By default this is the current level, thus displaying the current level's name. However it can also be anything else. (Though this runs the risk of crashing the game if the variable is too large.)

Patch: Keen 4
#What defines what entry to read:
%patch $663C $A7EDW
#Where level name list is located:
%patch $6648 $18F4W
#Didn't make it past 1
%patch $6644 $18F6W
#Didn't make it past 2

Patch: Keen 5
#What defines what entry to read:
%patch $65F7 $9E55W
#Where level name list is located:
%patch $6603 $1774W
#Didn't make it past 1
%patch $65FF $1776W
#Didn't make it past 2

Patch: Keen 6
#What defines what entry to read:
%patch $640C $A97BW
#Where level name list is located:
%patch $6418 $1782W
#Didn't make it past 1
%patch $6414 $1784W
#Didn't make it past 2

Patch: Keen Dreams
#Where level name list is located:
%patch $5A1B $03D8W


No level names in window

This patch eliminates the level names in the window, meaning that the window appears the same on all levels and also allows it to be used in levels that exceed the level name list's ability to hold entries. This will also alter the position of other texts in the window.

Patch: No level names in window
#No level names in window -Keen 4
%patch $663A $EB $1B %patch $66B2 $EB $27
#No level names in window -Keen 5
%patch $65F5 $EB $1B %patch $666D $EB $27
#No level names in window -Keen 6
%patch $640A $EB $1B %patch $6482 $EB $27
#No level names in window -Keen Dreams
%patch $5A13 $EB $0F


Window options

There are two options in the window, to try the level again or to quit to the map. Either can be changed or disabled.


Option first highlighted

This patch changes which option is the default when the window first appears. By default this value is 0 and the default selected option is 'Try again'. Changing this to 1 makes the default option 'Exit'.

Patch: Change default option in window to 'Exit'
#Change default option in window to 'Exit' -Keen 4
%patch $6709 $0001W
#Change default option in window to 'Exit' -Keen 5
%patch $66C4 $0001W
#Change default option in window to 'Exit' -Keen 6
%patch $64D9 $0001W
#Change default option in window to 'Exit' -Keen Dreams
%patch $5A57 $0001W


Disable options

This patch disables the up and down keys meaning that the player cannot change whatever option is first highlighted. This has the effect of eliminating the other option. This may need to be combined with the 'first option highlighted' patch above. In essence the window simply becomes a pause when the player dies.

The two other patches here remove either option's text from the window completely.

Patch: Keen 4
#Disable ability to change options
%patch $6989 $E9 $FD7FW
#Remove 'Try again' text
%patch $66DB $EB $0A
#Remove 'Exit' text
%patch $66F5 $EB $0A

Patch: Keen 5
#Disable ability to change options
%patch $6944 $E9 $FD7FW
#Remove 'Try again' text
%patch $6696 $EB $0A
#Remove 'Exit' text
%patch $66B0 $EB $0A

Patch: Keen 6
#Disable ability to change options
%patch $6759 $E9 $FD7FW
#Remove 'Try again' text
%patch $64AB $EB $0A
#Remove 'Exit' text
%patch $64C5 $EB $0A

Patch: Keen Dreams
#Disable ability to change options
%patch $5CC9 $E9 $FD88W
#Remove 'Try again' text
%patch $5A31 $EB $09
#Remove 'Exit' text
%patch $5A49 $EB $09


Flashing rectangle

These patches affect the flashing rectangle which tells the player which option they have chosen. There is also a 'blanking rectangle' used to cover up the old location of the flashing rectangle when the player changes their selected option. This is a white rectangle of the exact same size as the flashing rectangle.


No rectangle

This patch removes the flashing rectangle completely. However it does not remove the blanking rectangle which can cause issues overwriting text.

Patch: No rectangle in death window
#No rectangle -Keen 4
%patch $6737 $E9 $00EAW
#No rectangle -Keen 5
%patch $66F2 $E9 $00EAW
#No rectangle -Keen 6
%patch $6507 $E9 $00EAW
#No rectangle -Keen Dreams
%patch $5A85 $E9 $00EAW


Remove parts of rectangle

These patches remove various parts of the flashing rectangle, but not the entire box. This is done by removing individual 'bars' from the rectangle.

Patch: Keen 4
#Remove bars
%patch $6737 $EB $1A
#Topmost
%patch $6737 $EB $39
#Top two
%patch $6793 $EB $1F
#Bottommost
%patch $6772 $EB $39
#Bottom two
%patch $6737 $EB $7B
#All four

Patch: Keen 5
#Remove bars
%patch $66F2 $EB $1A
#Topmost
%patch $66F2 $EB $39
#Top two
%patch $674E $EB $1F
#Bottommost
%patch $672D $EB $39
#Bottom two
%patch $66F2 $EB $7B
#All four

Patch: Keen 6
#Remove bars
%patch $6507 $EB $1A
#Topmost
%patch $6507 $EB $39
#Top two
%patch $6563 $EB $1F
#Bottommost
%patch $6542 $EB $39
#Bottom two
%patch $6507 $EB $7B
#All four

Patch: Keen Dreams
#Remove bars
%patch $5A85 $EB $1A
#Topmost
%patch $5A85 $EB $39
#Top two
%patch $5AE1 $EB $1F
#Bottommost
%patch $5AC0 $EB $39
#Bottom two
%patch $5A85 $EB $7B
#All four


Color

The first patches involve the color of the rectangle. It is colored with two palette colors, light red and light blue that alternate regularly. However the blanking rectangle also requires a palette and each of its 8 components has its own entry. By default this is $0F or white, the same color as the window background. These values probably do not need to be changed.

Patch: Keen 4
#Rectangle colors
%patch $6730 $000CW
#Light red
%patch $6735 $0001W
#Dark blue
#Blanking color (White)
%patch $682A $000FW %patch $6849 $000FW %patch $686B $000FW %patch $688F $000FW %patch $68B3 $000FW %patch $68D0 $000FW %patch $68ED $000FW %patch $690E $000FW

Patch: Keen 5
#Rectangle colors
%patch $66EB $000CW
#Light red
%patch $66F0 $0001W
#Dark blue
#Blanking color (White)
%patch $67E5 $000FW %patch $6804 $000FW %patch $6826 $000FW %patch $684A $000FW %patch $686E $000FW %patch $688B $000FW %patch $68A8 $000FW %patch $68C9 $000FW

Patch: Keen 6
#Rectangle colors
%patch $6500 $000CW
#Light red
%patch $6505 $0001W
#Dark blue
#Blanking color (White)
%patch $65FA $000FW %patch $6619 $000FW %patch $663B $000FW %patch $665F $000FW %patch $6683 $000FW %patch $66A0 $000FW %patch $66BD $000FW %patch $66DE $000FW

Patch: Keen Dreams
#Rectangle colors
%patch $5A7E $000CW
#Light red
%patch $5A83 $0001W
#Dark blue
#Blanking color (White)
%patch $5B78 $000FW %patch $5B97 $000FW %patch $5BB9 $000FW %patch $5BDD $000FW %patch $5C01 $000FW %patch $5C1E $000FW %patch $5C3B $000FW %patch $5C5C $000FW


Size

The rectangle is actually composed of eight different lines, two for each side, making the rectangle two pixels thick on all sides. All values are in pixels. While the vertical values are simple enough, the horizontal values relate to how far the lines are from the inside edge of the window. (So a value of 4 can be 4 pixels right of the left side of the window or 4 pixels left of the right side.)

In order for the rectangle to fit together neatly not all values are the same; there are one and two pixel differences and these must be taken into account when resizing. (If, for example, you want the rectangle to be 6 pixels from the window's edges notice that some values will be 7 pixels.)

Patch: Keen 4
#Rectangle left boundary
%patch $6748 $0004W
#Topmost
%patch $6767 $0004W
#Top
%patch $6788 $0004W
#Bottom
%patch $67A9 $0004W
#Bottommost
%patch $67B9 $0004W
#Side 1
%patch $67D3 $0005W
#Side 2
%patch $683D $0004W
#Topmost blanking
%patch $685F $0004W
#Top blanking
%patch $6883 $0004W
#Bottom blanking
%patch $68A7 $0004W
#Bottommost blanking
%patch $68BA $0004W
#Side 1 blanking
%patch $68D7 $0005W
#Side 2 blanking
#Rectangle right boundary
%patch $6741 $0004W
#Topmost
%patch $6760 $0004W
#Top
%patch $6781 $0004W
#Bottom
%patch $67A2 $0004W
#Bottommost
%patch $67F1 $0004W
#Side 3
%patch $680F $0005W
#Side 4
%patch $6836 $0004W
#Topmost blanking
%patch $6858 $0004W
#Top blanking
%patch $687C $0004W
#Bottom blanking
%patch $68A0 $0004W
#Bottommost blanking
%patch $68F8 $0004W
#Side 3 blanking
%patch $6919 $0005W
#Side 4 blanking
#Rectangle height
%patch $6776 $000CW
#Bottom
%patch $6797 $000DW
#Bottommost
%patch $67BF $000BW
#Side 1
%patch $67D9 $000BW
#Side 2
%patch $67F7 $000BW
#Side 3
%patch $6815 $000BW
#Side 4
%patch $6881 $000CW
#Bottom blanking
%patch $6895 $000DW
#Bottommost blanking
%patch $68C0 $000BW
#Side 1 blanking
%patch $68DD $000BW
#Side 2 blanking
%patch $68FE $000BW
#Side 3 blanking
%patch $691F $000BW
#Side 4 blanking

Patch: Keen 5
#Rectangle left boundary
%patch $6703 $0004W
#Topmost
%patch $6722 $0004W
#Top
%patch $6743 $0004W
#Bottom
%patch $6764 $0004W
#Bottommost
%patch $6774 $0004W
#Side 1
%patch $678E $0005W
#Side 2
%patch $67F8 $0004W
#Topmost blanking
%patch $681A $0004W
#Top blanking
%patch $683E $0004W
#Bottom blanking
%patch $6862 $0004W
#Bottommost blanking
%patch $6875 $0004W
#Side 1 blanking
%patch $6892 $0005W
#Side 2 blanking
#Rectangle right boundary
%patch $66FC $0004W
#Topmost
%patch $671B $0004W
#Top
%patch $673C $0004W
#Bottom
%patch $675D $0004W
#Bottommost
%patch $67AC $0004W
#Side 3
%patch $67CA $0005W
#Side 4
%patch $67F1 $0004W
#Topmost blanking
%patch $6813 $0004W
#Top blanking
%patch $6837 $0004W
#Bottom blanking
%patch $685B $0004W
#Bottommost blanking
%patch $68B3 $0004W
#Side 3 blanking
%patch $68D4 $0005W
#Side 4 blanking
#Rectangle height
%patch $6731 $000CW
#Bottom
%patch $6752 $000DW
#Bottommost
%patch $677A $000BW
#Side 1
%patch $6794 $000BW
#Side 2
%patch $67B2 $000BW
#Side 3
%patch $67D0 $000BW
#Side 4
%patch $683C $000CW
#Bottom blanking
%patch $6850 $000DW
#Bottommost blanking
%patch $687B $000BW
#Side 1 blanking
%patch $6898 $000BW
#Side 2 blanking
%patch $68B9 $000BW
#Side 3 blanking
%patch $68DA $000BW
#Side 4 blanking

Patch: Keen 6
#Rectangle left boundary
%patch $6518 $0004W
#Topmost
%patch $6537 $0004W
#Top
%patch $6558 $0004W
#Bottom
%patch $6579 $0004W
#Bottommost
%patch $6589 $0004W
#Side 1
%patch $65A3 $0005W
#Side 2
%patch $660D $0004W
#Topmost blanking
%patch $662F $0004W
#Top blanking
%patch $6653 $0004W
#Bottom blanking
%patch $6677 $0004W
#Bottommost blanking
%patch $668A $0004W
#Side 1 blanking
%patch $66A7 $0005W
#Side 2 blanking
#Rectangle right boundary
%patch $6511 $0004W
#Topmost
%patch $6530 $0004W
#Top
%patch $6551 $0004W
#Bottom
%patch $6572 $0004W
#Bottommost
%patch $65C1 $0004W
#Side 3
%patch $65DF $0005W
#Side 4
%patch $6606 $0004W
#Topmost blanking
%patch $6628 $0004W
#Top blanking
%patch $664C $0004W
#Bottom blanking
%patch $6670 $0004W
#Bottommost blanking
%patch $66C8 $0004W
#Side 3 blanking
%patch $66E9 $0005W
#Side 4 blanking
#Rectangle height
%patch $6546 $000CW
#Bottom
%patch $6567 $000DW
#Bottommost
%patch $658F $000BW
#Side 1
%patch $65A9 $000BW
#Side 2
%patch $65C7 $000BW
#Side 3
%patch $65E5 $000BW
#Side 4
%patch $6651 $000CW
#Bottom blanking
%patch $6665 $000DW
#Bottommost blanking
%patch $6690 $000BW
#Side 1 blanking
%patch $66AD $000BW
#Side 2 blanking
%patch $66CE $000BW
#Side 3 blanking
%patch $66EF $000BW
#Side 4 blanking

Patch: Keen Dreams
#Rectangle left boundary
%patch $5A96 $0004W
#Topmost
%patch $5AB5 $0004W
#Top
%patch $5AD6 $0004W
#Bottom
%patch $5AF7 $0004W
#Bottommost
%patch $5B07 $0004W
#Side 1
%patch $5B21 $0005W
#Side 2
%patch $5B8B $0004W
#Topmost blanking
%patch $5BAD $0004W
#Top blanking
%patch $5BD1 $0004W
#Bottom blanking
%patch $5BF5 $0004W
#Bottommost blanking
%patch $5C08 $0004W
#Side 1 blanking
%patch $5C25 $0005W
#Side 2 blanking
#Rectangle right boundary
%patch $5A8F $0004W
#Topmost
%patch $5AAE $0004W
#Top
%patch $5ACF $0004W
#Bottom
%patch $5AF0 $0004W
#Bottommost
%patch $5B3F $0004W
#Side 3
%patch $5B5D $0005W
#Side 4
%patch $5B84 $0004W
#Topmost blanking
%patch $5BA6 $0004W
#Top blanking
%patch $5BCA $0004W
#Bottom blanking
%patch $5BEE $0004W
#Bottommost blanking
%patch $5C46 $0004W
#Side 3 blanking
%patch $5C67 $0005W
#Side 4 blanking
#Rectangle height
%patch $5AC4 $000CW
#Bottom
%patch $5AE5 $000DW
#Bottommost
%patch $5B0D $000BW
#Side 1
%patch $5B27 $000BW
#Side 2
%patch $5B45 $000BW
#Side 3
%patch $5B63 $000BW
#Side 4
%patch $5BCF $000CW
#Bottom blanking
%patch $5BE3 $000DW
#Bottommost blanking
%patch $5C0E $000BW
#Side 1 blanking
%patch $5C2B $000BW
#Side 2 blanking
%patch $5C4C $000BW
#Side 3 blanking
%patch $5C6D $000BW
#Side 4 blanking


Rectangle movement

The rectangle automatically moves between the two options' texts no matter where they are located. This is covered in the 'text position' section above.


Rectangle doesn't move off an option

This patch stops the rectangle from moving. Though the player can still select either option, the rectangle will not move. By itself this is confusing but it may be useful when combined with other patches.

Patch: Keen 4
#Rectangle doesn't move
%patch $670B $EB $09
#From top option
%patch $670B $EB $04
#From bottom option

Patch: Keen 5
#Rectangle doesn't move
%patch $66C6 $EB $09
#From top option
%patch $66C6 $EB $04
#From bottom option

Patch: Keen 6
#Rectangle doesn't move
%patch $64DB $EB $09
#From top option
%patch $64DB $EB $04
#From bottom option

Patch: Keen Dreams
#Rectangle doesn't move
%patch $5A59 $EB $09
#From top option
%patch $5A59 $EB $04
#From bottom option


Level Keen returns to on quitting

If Keen presses the Esc key or selects the 'Exit' option then he will return to level 0, the map. It is possible to change this level and even to have two different options.

Patch: Keen 4
#Level Keen goes to when...
%patch $6939 $0000W
#Pressing Esc
%patch $697B $0000W
#Choosing to exit

Patch: Keen 5
#Level Keen goes to when...
%patch $68F4 $0000W
#Pressing Esc
%patch $6936 $0000W
#Choosing to exit

Patch: Keen 6
#Level Keen goes to when...
%patch $6709 $0000W
#Pressing Esc
%patch $674B $0000W
#Choosing to exit

Patch: Keen Dreams
#Level Keen goes to when...
%patch $5C87 $0000W
#Pressing Esc
%patch $5CC5 $0000W
#Choosing to exit


Retry the level instead of going to map

These patches change things so that when the player selects the 'Exit' option (Or presses the Esc key) they instead retry the level, same as if they had selected 'Try again'. By itself this is a rather pointless patch but it can prove useful in combination.

Patch: Keen 4
#Esc retries level
%patch $6935 $EB $04
#'Exit' option retries level
%patch $6977 $EB $04

Patch: Keen 5
#Esc retries level
%patch $68F0 $EB $04
#'Exit' option retries level
%patch $6932 $EB $04

Patch: Keen 6
#Esc retries level
%patch $6705 $EB $04
#'Exit' option retries level
%patch $6747 $EB $04

Patch: Keen Dreams
#Esc retries level
%patch $5C83 $EB $04
#'Exit' option retries level
%patch $5CBF $EB


Keys

As noted above keys can be used; the arrow keys change the selected option, Esc quits to the map and enter and space choose the selected option.


Change function keys

These patches change the keys that perform various functions. In this case they keys use a simple scancode.

Patch: Keen 4
#Keys that select an option
%patch $6967 $1C
#Enter
%patch $696E $39
#Spacebar
#Key that quits (Esc)
%patch $6932 $01

Patch: Keen 5
#Keys that select an option
%patch $6922 $1C
#Enter
%patch $6929 $39
#Spacebar
#Key that quits (Esc)
%patch $68ED $01

Patch: Keen 6
#Keys that select an option
%patch $6737 $1C
#Enter
%patch $673E $39
#Spacebar
#Key that quits (Esc)
%patch $6702 $01

Patch: Keen Dreams
#Keys that select an option
%patch $5CB1 $1C
#Enter
%patch $5CB8 $39
#Spacebar
#Key that quits (Esc)
%patch $5C80 $01


Disable keys

This patch disables the Esc key so that pressing it has no effect. It is possible to disable other keys also.

Patch: Keen 4
#Disable Esc key
%patch $692E $EB $16

Patch: Keen 5
#Disable Esc key
%patch $68E9 $EB $16

Patch: Keen 6
#Disable Esc key
%patch $66FE $EB $16

Patch: Keen Dreams
#Disable Esc key
%patch $5C7C $EB $12