Patch:Level Entry Window

From KeenWiki
(Redirected from Patch:Level Loading Window)
Jump to: navigation, search

This page contains patches that affect the window that appears when Keen enters a level (Including the map, which happens when he exits a normal level, and when he dies and restarts a level.) In Galaxy this window contains the level entry text as well as an image of Keen himself over which a 'thumbs up' sequence plays. In Dreams this window simply contains the level names and a loading bar.

Keen Dreams is unique in that before the level entry text appears a loading window appears briefly. This window appears before many others too, such as when the menu is loading.


Window

These patches relate to the setup of the window itself but not the image sequences and text that appears in it. Those have their own sections.


Window size

The window has a specific size. Keen's bitmap appears in the top left of the window. (At 0,0). Note that in Keen Dreams there are no bitmaps and the window is also the 'loading' window. (See below.)

Patch: Keen 4
#Level entry window size
%patch $634A $0008W
#Height
%patch $634E $001AW
#Width

Patch: Keen 5
#Level entry window size
%patch $6305 $0008W
#Height
%patch $6309 $001AW
#Width

Patch: Keen 6
#Level entry window size
%patch $611A $0008W
#Height
%patch $611E $001AW
#Width

Patch: Keen Dreams
#Level entry window size
%patch $C56E $0008W
#Height
%patch $C572 $0014W
#Width


Playing demo level

This text appears in the Level Entry Window when the player is loading a level to record a demo in or the game is loading a level to display a demo in.

Patch: Play demo level text
#Keen 4 :
%patch $6259 $0299W %patch $2F109 "DEMO" $00


Disable window

This patch completely eliminates the level entry window. When entering a level from the map the One Moment window appears, but when exiting a level to the map the screen merely freezes.

Patch: Disable level entry window
#Disable level entry window -Keen 4
%patch $62AD $CB
#Disable level entry window -Keen 5
%patch $6268 $CB
#Disable level entry window -Keen 6
%patch $607D $CB
#Disable level entry window -Keen Dreams
%patch $C56B $EB


'Thumbs up' sequence

This is a collection of bitmaps displayed in the Keen galaxy window. An initial image is displayed over which a series of smaller images appear in sequence giving the impression of Keen giving the player a thumbs up.


Bitmaps used

For unknown reasons it is currently not possible to change the bitmaps used for the thumbs up sequence, changing the values causes the bitmaps not to be displayed.

Patch: Keen 5
#Initial bitmap used for 'thumbs up' sequence
%patch $62AE $005CW %patch $62C7 $005CW %patch $631C $005CW %patch $634A $005CW


Position of 'thumbs up' sequence

The sequence of smaller images appears over the initial image at a specific horizontal and vertical location. These differ depending on whether the player is entering the level for the first time or restarting the level after dying. The first value is lower down if larger but the second is 'reversed'; the larger it is the further left the image appears.

Patch: Keen 4
#Position of the frames of level loading animation
%patch $6478 $0028W
#Y position
%patch $647F $0018W
#X position
#Position of the frames of level loading animation - after player death
%patch $640D $0028W
#Y position
%patch $6414 $0018W
#X position

Patch: Keen 5
#Position of the frames of level loading animation
%patch $6433 $0028W
#Y position
%patch $643A $0018W
#X position
#Position of the frames of level loading animation - after player death
%patch $63C8 $0028W
#Y position
%patch $63CF $0018W
#X position

Patch: Keen 6
#Position of the frames of level loading animation
%patch $6248 $0028W
#Y position
%patch $624F $0018W
#X position
#Position of the frames of level loading animation - after player death
%patch $61DD $0028W
#Y position
%patch $61E4 $0018W
#X position


No 'thumbs up' sequence

This patch removes the 'thumbs up' sequence from the window. This means only one, unchanging, image appears in the window.

Patch: Keen 4
#No thumbs up when entering levels
%patch $642A $CB

Patch: Keen 5
#No thumbs up when entering levels
%patch $63E5 $CB

Patch: Keen 6
#No thumbs up when entering levels
%patch $61FA $CB


Level text and names

Keen Galaxy and Dreams has individual names for its levels. These work in a complex manner. There are lists of level names, the location of which is controlled by lists of pointers, the location of which is referenced in the code. All patches that follow use the default values.


Level name color

This affects the color of the level name text. However this also changes the color of all other locations in the loading window. (Such as the 'options screen' text.) It is a 'reverse palette'; that is it takes the normal game's palette and reverses the color assignments. (So $00 is white, $1F black, $1E yellow and so on.) By default it is light red.

Patch: Keen Dreams
#Level loading name color
%patch $C598 $03


No text in window

This patch will remove all text from the level loading window, leaving only the bitmap.

Patch: No text in level loading window
#No text while loading levels - Keen 4
%patch $6266 $EB $1B
#No text while loading levels - Keen 5
%patch $6221 $EB $1B
#No text while loading levels - Keen 6
%patch $6036 $EB $1B


Text position

The level entry text is centered vertically and horizontally, but offset to the right horizontally by 48 ($30) pixels; the width of Keen's bitmap. The second value here is the location of the text, the first the location of the text and the thumbs up sequence. Both values should match.

Patch: Keen 5
#Horizontal location of level entry text
%patch $6350 $30
#Text and thumbs up
%patch $6355 $30
#Text


Pointer list locations

These are the start of the level names, where the list of level names are read from. They are in standard text patch format with one twist, there are TWO word values giving the location in the code minus the text start location instead of one. In the Keen 4 example below the text starts at $2EE70 so the level name list is at $2EE70 + $18F4 = $30764

There are two values for each reference because the level name pointers are 32-bit (Four bytes), meaning that two values each of two bytes must be read then added together. The first value is by default unimportant since all of those values are zero. (A side effect of this is that all default level names must be multiples of 16 bytes long.) The two values in each reference don't have to be anywhere near each other, but unless they are two bytes different this makes things a lot more complex.

There shouldn't be any need to relocate the pointer lists unless you are planning on adding a lot of extra levels and the default locations don't have enough space. There are three references, one loads the level entry text when Keen enters levels. The remaining two loads the level name when Keen dies and when the status window is displayed.

The Keen Dreams setup is far simpler, at least as understood at present.

Patch: Keen 4
#Where level entry text list is located:
%patch $6274 $1958W %patch $6270 $195AW
#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 $7D2C $18F4W
#Status window 1
%patch $7D28 $18F6W
#Status window 2

Patch: Keen 5
#Where level entry text list is located:
%patch $622F $17D8W %patch $622B $17DAW
#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 $7D10 $1774W
#Status window 1
%patch $7D0C $1776W
#Status window 2

Patch: Keen 6
#Where level entry text list is located:
%patch $6044 $17E6W %patch $6040 $17E8W
#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 $7AC0 $1782W
#Status window 1
%patch $7ABC $1784W
#Status window 2

Patch: Keen Dreams
#Where level entry text list is located:
%patch $4C46 $03D8W


Level Name Pointer Lists

The next step is the level name pointer list, a list of 32-bit values giving the location of the level entry texts and names. By default the lower two bytes of these values is zero, meaning the location of each text entry can be found by reading the first five letters of the patch. Thus the Keen 4 map name value of $1F040000RL points to the text at $1F040. This leads to the side effect that all level names are multiples of 16 bytes long.

There is some space in the level lists for extra levels, in Keen 4 up to six new entries are allowed without having to change the list location. (Just add them to the end of the default list.) This is important when adding extra levels as levels need text or the game will freeze.

In Keen Dreams things are different and simpler. There is no entry text, only level names and these are treated like simple text patches.

Patch: Keen 4
#Level name pointers:
%patch $30764 $1F040000RL
#Map
$1F050000RL
#Level 1
$1F060000RL
#Level 2
$1F070000RL
#Level 3
$1F090000RL
#Level 4...
$1F0B0000RL $1F0C0000RL $1F0D0000RL $1F0E0000RL $1F0F0000RL $1F100000RL $1F110000RL $1F130000RL $1F150000RL $1F180000RL $1F1A0000RL $1F1B0000RL $1F1C0000RL $1F1D0000RL
#BWB Rocket
#Level entrance text pointers
%patch $307C8 $1F1F0000RL
#Map
$1F210000RL
#Level 1
$1F240000RL
#Level 2
$1F260000RL
#Level 3...
$1F290000RL $1F2D0000RL $1F300000RL $1F330000RL $1F350000RL $1F380000RL $1F3A0000RL $1F3D0000RL $1F400000RL $1F430000RL $1F470000RL $1F4B0000RL $1F4E0000RL $1F510000RL $1F540000RL
#BWB Rocket

Patch: Keen 5
#Level name pointers:
%patch $31AB4 $20040000RL
#Map
$20050000RL
#Level 1
$20070000RL
#Level 2
$20080000RL
#Level 3...
$200A0000RL $200C0000RL $200E0000RL $20100000RL $20120000RL $20140000RL $20160000RL $20180000RL $201A0000RL $201C0000RL $201D0000RL
#Korath base
$201E0000RL
#BWB
$20100000RL
#High scores
#Level entrance text pointers
%patch $31B18 $201F0000RL
#Map
$20220000RL
#Level 1
$20250000RL
#Level 2
$20280000RL
#Level 3...
$202B0000RL $202E0000RL $20310000RL $20340000RL $20370000RL $203A0000RL $203D0000RL $20400000RL $20440000RL $20470000RL
#Korath base
$204A0000RL
#BWB
$204D0000RL
#High scores

Patch: Keen 6
#Level name pointers:
%patch $324B2 $1EF40000RL
#Map
$1EF50000RL
#Level 1
$1EF70000RL
#Level 2
$1EF80000RL
#Level 3
$1EFA0000RL
#Level 4...
$1EFC0000RL $1EFD0000RL $1EFF0000RL $1F000000RL $1F020000RL $1F030000RL $1F040000RL $1F050000RL $1F070000RL $1F090000RL $1F0B0000RL $1F0D0000RL $1F0E0000RL
#BWB
$1F100000RL
#High scores
#Level entrance text pointers
%patch $32516 $1F110000RL
#Map
$1F130000RL
#Level 1
$1F160000RL
#Level 2
$1F190000RL
#Level 3
$1F1C0000RL
#Level 4...
$1F1F0000RL $1F220000RL $1F250000RL $1F270000RL $1F2A0000RL $1F2D0000RL $1F300000RL $1F350000RL $1F380000RL $1F3C0000RL $1F400000RL $1F440000RL $1F470000RL
#BWB
$1F4A0000RL
#Highscores

Patch: Keen Dreams
#Level name pointers:
%patch $23E48 $055AW
#Land of Tuberia...
$056EW $057FW $058FW $059EW $05ADW $05BAW $05C2W $05CCW $05D4W $05E0W $05ECW $05F5W $0609W $0612W $061FW $062FW $056DW $063EW $0000W


Level names and entrance texts

These are almost standard text patches. There is a program to automate patching level names, Startext. In the case of Keen 5 there is a special text displayed when Keen is 'low' enough on the world map. This is used to tell the player he is on the Korath III base.

Patch: Keen 4
#Level names:
%patch $1F040 "Shadowlands " $00 %patch $1F050 "Border Village " $00 %patch $1F060 "Slug Village " $00 %patch $1F0B0 "Chasm of Chills" $00 %patch $1F0C0 "Crystalus " $00 %patch $1F0D0 "Hillville " $00 %patch $1F0E0 "Sand Yego " $00 %patch $1F0F0 "Miragia " $00 %patch $1F100 "Lifewater Oasis" $00 %patch $1F1A0 "Isle of Tar " $00 %patch $1F1B0 "Isle of Fire " $00 %patch $1F1C0 "Well of Wishes " $00 %patch $1F1D0 "Bean-with-Bacon" $0A "Megarocket " $00 %patch $1F070 "The Perilous Pit " $00 %patch $1F090 "Cave of the Descendents " $00 %patch $1F110 "Pyramid of the Moons " $00 %patch $1F130 "Pyramid of Shadows " $00 %patch $1F150 "Pyramid of the" $0A "Gnosticene Ancients " $00 %patch $1F180 "Pyramid of the Forbidden " $00
#Keen entering levels
%patch $1F1F0 "Keen enters the" $0A "Shadowlands " $00 %patch $1F240 "Keen slips into" $0A "Slug Village " $00 %patch $1F330 "Keen stumbles upon" $0A "Hillville " $00 %patch $1F380 "Keen disappears into" $0A "Miragia " $00 %patch $1F210 "Keen makes a run for" $0A "the Border Village " $00 %patch $1F260 "Keen plummets into" $0A "the The Perilous Pit " $00 %patch $1F2D0 "Keen shivers along" $0A "the Chasm of Chills " $00 %patch $1F300 "Keen reflects upon" $0A "entering Crystalus " $00 %patch $1F350 "Keen grits his teeth" $0A "and enters Sand Yego " $00 %patch $1F3A0 "Keen crawls into" $0A "Lifewater Oasis " $00 %patch $1F3D0 "Keen backs into the" $0A "Pyramid of the Moons " $00 %patch $1F400 "Keen move silently in" $0A "the Pyramid of Shadows " $00 %patch $1F4B0 "Keen mucks along the" $0A "Isle of Tar " $00 %patch $1F4E0 "Keen blazes across the" $0A "Isle of Fire " $00 %patch $1F510 "Keen hopefully enters" $0A "the Well of Wishes " $00 %patch $1F290 "Keen plods down into" $0A "the Cave of the Descendents " $00 %patch $1F430 "Keen reverently enters" $0A "the Pyramid of the" $0A "Gnosticene Ancients " $00 %patch $1F470 "Keen hesitantly crosses" $0A "into the Pyramid of the" $0A "Forbidden " $00 %patch $1F540 "Keen launches into the" $0A "Bean-with-Bacon" $0A "Megarocket " $00

Patch: Keen 5
#Level names:
%patch $20040 "Omegamatic" $00 %patch $20050 "Ion Ventilation System" $00 %patch $20070 "Security Center" $00 %patch $20080 "Defense Tunnel Vlook" $00 %patch $200A0 "Energy Flow Systems" $00 %patch $200C0 "Defense Tunnel Burrh" $00 %patch $200E0 "Regulation" $0A "Control Center" $00 %patch $20100 "Defense Tunnel Sorra" $00 %patch $20120 "Neutrino" $0A "Burst Injector" $00 %patch $20140 "Defense Tunnel Teln" $00 %patch $20160 "Brownian" $0A "Motion Inducer" $00 %patch $20180 "Gravitational" $0A "Damping Hub" $00 %patch $201A0 "Quantum" $0A "Explosion Dynamo" $00 %patch $201C0 "Korath III Base" $00 %patch $201D0 "BWBMegarocket" $00 %patch $201E0 "High Scores" $00
#Keen entering levels
%patch $201F0 "Keen purposefully" $0A "wanders about the" $0A "Omegamatic" $00 %patch $20220 "Keen investigates the" $0A "Ion Ventilation System" $00 %patch $20250 "Keen struts through" $0A "the Security Center" $00 %patch $20280 "Keen invades" $0A "Defense Tunnel Vlook" $00 %patch $202B0 "Keen engages" $0A "Energy Flow Systems" $00 %patch $202E0 "Keen barrels into" $0A "Defense Tunnel Burrh" $00 %patch $20310 "Keen goes nuts in" $0A "the Regulation" $0A "Control Center" $00 %patch $20340 "Keen regrets entering" $0A "Defense Tunnel Sorra" $00 %patch $20370 "Keen blows through" $0A "the Neutrino" $0A "Burst Injector" $00 %patch $203A0 "Keen trots through" $0A "Defense Tunnel Teln" $00 %patch $203D0 "Keen breaks into" $0A "the Brownian" $0A "Motion Inducer" $00 %patch $20400 "Keen hurries through" $0A "the Gravitational" $0A "Damping Hub" $00 %patch $20440 "Keen explodes into" $0A "the Quantum" $0A "Explosion Dynamo" $00 %patch $20470 "Keen faces danger" $0A "in the secret" $0A "Korath III Base" $00 %patch $204A0 "Keen will not be" $0A "in the BWBMegarocket" $00 %patch $204D0 "Keen unexplainedly" $0A "finds himself by" $0A "theHigh Scores" $00
#Korath base text
%patch $6210 $64
#Vertical location for difference
%patch $6214 $0223W
#Text called from
%patch $30563 "Keen steps out" $0A "onto Korath III" $00

Patch: Keen 6
#Keen entering levels
%patch $1F110 "Keen attacks" $0A "Fribbulus Xax" $00 %patch $1F130 "Keen hops across" $0A "Bloogwaters" $0A "Crossing" $00 %patch $1F160 "Keen fights his way" $0A "through Guard Post One" $00 %patch $1F190 "Keen crosses into the" $0A "First Dome of Darkness" $00 %patch $1F1C0 "Keen dares to enter the" $0A "Second Dome of Darkness" $00 %patch $1F1F0 "Keen foolishly enters" $0A "the Bloogdome" $00 %patch $1F220 "Keen makes his way" $0A "into Bloogton" $0A "Manufacturing" $00 %patch $1F250 "Keen ascends" $0A "Bloogton Tower" $00 %patch $1F270 "Keen hungrily enters" $0A "Bloogfoods, Inc." $00 %patch $1F2A0 "Keen smashes through" $0A "Guard Post Two" $00 %patch $1F2D0 "Keen seeks thrills" $0A "in Bloogville" $00 %patch $1F300 "Keen rockets into the" $0A "Bloog Aeronautics and" $0A "Space Administration" $00 %patch $1F350 "Keen boldly assaults" $0A "Guard Post Three" $00 %patch $1F380 "Keen whoops it up in" $0A "the Bloogbae" $0A "Recreational District" $00 %patch $1F3C0 "Keen purposefully struts" $0A "into the Bloogbase" $0A "Management District" $00 %patch $1F400 "Keen bravely enters the" $0A "Bloog Control Center," $0A "looking for Molly" $00 %patch $1F440 "Keen warily enters" $0A "Blooglab Space" $0A "Station" $00 %patch $1F470 "Keen returns to the" $0A "Bean-with-Bacon" $0A "Megarocket" $00 %patch $1F4A0 "Keen is in the High" $0A "Score screen. Call Id!" $00

Patch: Keen Dreams
#Level names
%patch $23FCA "The land of Tuberia" %patch $23FDE "Horseradish Hill" %patch $23FEF "The melon mines" %patch $23FFF "Bridge bottoms" %patch $2400E "Rhubarb rapids" %patch $2401D "Parsnip Pass" %patch $2402A "Level 6" %patch $24032 "Spud City" %patch $2403C "Level 8" %patch $24044 "Apple Acres" %patch $24050 "Grape Grove" %patch $2405C "Level 11" %patch $24065 "Brussels Sprout Bay" %patch $24079 "Level 13" %patch $24082 "Squash Swamp" %patch $2408F "Boobus' Chamber" %patch $2409F "Castle Tuberia" %patch $240AE "Title Page"


High scores has entry text and name (Keen 4)

This patch gives the high scores level in Keen 4 an entry text and name. It does this by using parts of the level entry texts as level names, freeing up space for the high Score level name and entry text. This is useful for those who want to enable access to the high scores level.

Patch: Keen 4
#Level name pointers: (Compressed)
%patch $30764 $1F200000RL
#Map
$1F220009RL
#Level 1
$1F250000RL
#Level 2
$1F270007RL
#Level 3
$1F090000RL
#Level 4...
$1F0B0000RL $1F0C0000RL $1F0D0000RL $1F0E0000RL $1F0F0000RL $1F100000RL $1F110000RL $1F130000RL $1F150000RL $1F180000RL $1F1A0000RL $1F1B0000RL $1F1C0000RL $1F1D0000RL
#Bwb Rocket
$1F060005RL
#High scores
#High score entry text
%patch $30814 $1F040000RL
#High score entry text and name
%patch $1F040 "Keen is in the High" $0A "Scores! Call Id!" $00 "High Scores" $00


Level entry sounds

A sound is played when levels are entered, along with the level entry window. It can be silenced.

Patch: Level entry sounds
#Level entry sound -Keen 4
%patch $DF7D $0C
#Enter level sound
%patch $DF7C $EB $0A
#Don't play Enter level sound
#Level entry sound -Keen 5
%patch $D2E2 $0C
#Keen enters level sound
%patch $D2E1 $EB $0A
#Don't play Keen enters level sound
#Level entry sound -Keen 6
%patch $D041 $0C
#Enter level sound
%patch $D040 $EB $0A
#Don't play Enter level sound


Keen Dreams style window

These patches change the level entry window so that it appears identical to the one used in Keen Dreams; lacking Keen's thumbs up sequence and instead displaying a progress bar

Patch: Keen Dreams style level loading box
#Keen Dreams style level loading box -Keen 4
%patch $38FF $EB $22
#Keen Dreams style level loading box -Keen 5
%patch $38FF $EB $22
#Keen Dreams style level loading box -Keen 6
%patch $38E0 $EB $22