Patch:F10 G Cheat
The F10 + G cheat in Keen 4-6 and Dreams makes Keen invulnerable to enemies and hazards. It requires two keys to be pressed simultaneously to activate and in Keen 4-6 requires debug mode to be active. Repeating the cheat will turn god mode off. There are two text messages associated with it, displayed in the same window.
Window
Keen 4
#Godmode
%patch $74D2 [$0002W] #Window height
%patch $74D6 [$000CW] #Window width
%patch $74F7 [$0515W] #Text called from (ON)
%patch $74E9 [$0508W] #Text called from (OFF)
#Text
%patch $2F378 "God mode OFF" $00
%patch $2F385 "God mode ON" $00
Keen 5
#Godmode
%patch $7487 [$0002W] #Window height
%patch $748B [$000CW] #Window width
%patch $749E [$0484W] #Text called from (Off)
%patch $74AC [$0491W] #Text called from (On)
#Text
%patch $307C4 "God mode OFF" $00
%patch $307D1 "God mode ON" $00
Keen 6
#Godmode
%patch $72A1 [$0002W] #Height
%patch $72A5 [$000CW] #Width
%patch $72B8 [$0480W] #Text called from (Off)
%patch $72C6 [$048DW] #Text called from (On)
#Text
%patch $311B0 "God mode OFF" $00
%patch $311BD "God mode ON" $00
Keen Dreams
#Godmode
%patch $37CA [$0002W] #Height
%patch $37CE [$000CW] #Width
%patch $37E1 [$00AEW] #Text called from (Off)
%patch $37E6 [$00BBW] #Text called from (On)
#Text
%patch $23B1E "God mode OFF" $00
%patch $23B2B "God mode ON" $00
Complete window code
This is the complete code for both the window and patch. The first line contains the two conditions that need to be met to activate the cheat. The first is the G key being pressed. Setting this to $C647, $BCAF, $C7D5 or $E48A (in Keen 4, Keen 5, Keen 6 and Keen Dreams respectively.) will disable the cheat. The second is the 'game state' and stops the cheat being activated during demos.
On the second line the window's size is set up. Line 3 checks to see whether or not god mode is already enabled by checking the god mode variable; this will change what text appears in the window, in lines 3 and 4. Line 5 waits for a key and line 6 switches the god mode variable between 0 and 1. (If it is 0 it becomes 1, if it is 1 it becomes 0.)
The Keen Dreams window code is slightly different (And more compact) but follows the same basic pattern.
Keen 4
#God mode window code
%patch $74BE $83 $3E {$C68BW} [$00] {$74} $55 $83 $3E {$C631W} [$00] {$74} $4E $9A
$1D060999RL $B8 [$0002W] $50 $B8 [$000CW] $50 $9A $19311070RL
$83 $C4 $04 $83 $3E {$C629W} [$00] {$74} $0E $B8 [$0508W] $50 $9A
$19310E1FRL $83 $C4 $02 $EB $0C $B8 [$0515W] $50 $9A $19310E1FRL
$83 $C4 $02 $9A $1D060A9BRL $9A $14600EDFRL $83 $36
{$C629W} [$01] $B8 $0001W $5F $5E $8B $E5 $5D $CB
Keen 5
#God mode window code
%patch $7473 $83 $3E {$BCF3W} [$00] {$74} $55 $83 $3E {$BC99W} [$00] {$74} $4E $9A
$1E000995RL $B8 [$0002W] $50 $B8 [$000CW] $50 $9A $1A2B106ERL
$83 $C4 $04 $83 $3E {$BC91W} [$00] {$74} $0E $B8 [$0484W] $50 $9A
$1A2B0E1DRL $83 $C4 $02 $EB $0C $B8 [$0491W] $50 $9A $1A2B0E1DRL
$83 $C4 $02 $9A $1E000A97RL $9A $155A0EDCRL $83 $36
{$BC91W} [$01] $B8 $0001W $5F $5E $8B $E5 $5D $CB
Keen 6
#God mode window code
%patch $728D $83 $3E {$C819W} [$00] {$74} $55 $83 $3E {$C7BFW} [$00] {$74} $4E $9A
$1CF709A3RL $B8 [$0002W] $50 $B8 [$000CW] $50 $9A $18F81070RL
$83 $C4 $04 $83 $3E {$C7B7W} [$00] {$74} $0E $B8 [$0480W] $50 $9A
$18F80E1FRL $83 $C4 $02 $EB $0C $B8 [$048DW] $50 $9A $18F80E1FRL
$83 $C4 $02 $9A $1CF70AA5RL $9A $14130EE0RL $83 $36
{$C7B7W} [$01] $B8 $0001W $5F $5E $8B $E5 $5D $CB
Keen Dreams
#God mode window code
%patch $37B6 $83 $3E {$E4CEW} [$00] {$74} $49 $83 $3E {$E9EAW} [$00] {$74} $42 $9A
$0CA507D5RL $B8 [$0002W] $50 $B8 [$000CW] $50 $9A $11FA1C64RL
$83 $C4 $04 $83 $3E {$6FAAW} [$00] {$74} $05 $B8 [$00AEW] $EB $03 $B8
[$00BBW] $50 $9A $11FA1A1ERL $44 $44 $9A $0CA508C0RL $9A
$0FE40C8ERL $81 $36 {$6FAAW} [$0001W] $B8 $0001W $E9 $0186W
Disable
These patches disable the F10-G cheat, pressing the cheat keys does nothing.
Keen 4
#Disable god mode
%patch $74CA $EB
Keen 5
#Disable god mode
%patch $747F $EB
Keen 6
#Disable god mode
%patch $7299 $EB
Keen Dreams
#Disable god mode
%patch $37BB $EB
Key that activates cheat
This patch alters what key activates the god mode cheat. (See Patch:Scancodes.) By default this is 'g'. Setting this to $C647, $BCAF, $C7D5 or $E48A (in Keen 4, Keen 5, Keen 6 and Keen Dreams respectively.) will disable the cheat.
Note that two conditions need to be met for the god mode cheat to work; the second is the 'game state' and stops the cheat being activated during demos.
Keen 4
#Godmode key
%patch $74C0 {$C68BW} #G
%patch $74C7 {$C631W} #Game state
Keen 5
#Godmode key
%patch $7475 {$BCF3W} #G
%patch $747C {$BC99W} #Game state
Keen 6
#Godmode key
%patch $728F {$C819W} #G
%patch $7296 {$C7BFW} #Game state
Keen Dreams
#Godmode key
%patch $37B8 {$E4CEW} #G
%patch $37BF {$E9EAW} #Game state
Disable god mode but not the cheat window
These patches allow the player to use the god mode cheat, but do not give the player actual immortality. The first keeps everything unchanged; the player sees both the 'god mode on' and 'god mode off' windows, but is still mortal. The second patch stops god mode being turned on, therefor the cheat only ever says 'god mode on' when used. (But never actually turns it on.)
Note that the second line of the first patch fixes the Dopefish, as seen below.
Keen 4
#Disable god mode effect but not windows
%patch $CBFB $EB
%patch $123F9 $90 $90
#Disable god mode effect, only one window
%patch $7510 $00
Keen 5
#Disable god mode effect, only one window
%patch $74C5 $00
Keen 6
#Disable god mode effect, only one window
%patch $72DF $00
Keen is completely immortal, even from falling out of levels
This patch makes Keen totally immortal, even if he falls off the bottom of a level he can just jump back up. (However the Dopefish can still eat him, see below.) This works by disabling the 'kill Keen' check, so it technically does not relate to the F10 G cheat.
Keen 4
#Keen is totally immortal, even from falling out of level
%patch $CBFB $90 $90
Keen Dreams
#Keen is totally immortal, even from falling out of level
%patch $7655 $EB
God mode and the Dopefish
The Dopefish is the only enemy in the Keen Galaxy series that has a novel death for Keen in that it swallows him whole. It therefore interacts with the god mode cheat in a way no other sprite does.
Don't eat Keen
This patch stops the Dopefish from devouring Keen, in essence making it harmless.
Keen 4
#Dopefish never eats Keen, even without god mode
%patch $123F9 $EB
Eat Keen even with god mode
This patch lets the Dopefish eat Keen even if he has god mode.
Keen 4
#Dopefish always eats Keen, even with god mode
%patch $123F9 $90 $90
Misc
These patches don't relate to any of the sections above.
Don't display F10 G window
This patch doesn't show the god mode window, when the cheat is activated god mode is turned on or off but there is no way for the player to tell. The game is paused however, though this can be removed by using the patch below too.
Keen 4
#Don't display god mode window
%patch $7502 $90 $90 $90 $90 $90
Keen 5
#Don't display god mode window
%patch $74B7 $90 $90 $90 $90 $90
Keen 6
#Don't display god mode window
%patch $72D1 $90 $90 $90 $90 $90
God mode doesn't wait for a key
This patch stops the game pausing and waiting for the player to press a key while the god mode window is being displayed.
Keen 4
#God mode doesn't wait for a key
%patch $7507 $90 $90 $90 $90 $90
Keen 5
#God mode doesn't wait for a key
%patch $74BC $90 $90 $90 $90 $90
Keen 6
#God mode doesn't wait for a key
%patch $72D6 $90 $90 $90 $90 $90
Window has a different border
In Keen Dreams it is possible to make certain windows use a different set of 8x8 tiles for their border. This patch is on the 'text windows' page.