Patch:TED5
TED or TED5 is a level editor for Keen galaxy (And with some modifications, Dreams.) It is the original editor used by ID Software and can be launched, if present, from within the Keen galaxy games. This shuts down the game and allows levels to be edited; originally this was used when working on the game. This functionality remains in the final release notably when using the F10 E Cheat.
TED5 will only run if the TED5 variable is not zero. This is set somewhere in the game but it is currently unknown how.
Disable launching TED5
These patches remove the possibility of launching TED5 from within the galaxy game. In Keen 4 and 6 (but not 5) it is also possible to launch TED5 when the game is first started, this must also be disabled.
Keen 4
#Remove references to Ted5 running in:
%patch $6A75 $EB $1B #Level state loop
%patch $74AC $EB $0A #F10-E cheat
%patch $1CDAC $EB $0C #After quitting game
Keen 5
#Remove references to Ted5 running in:
%patch $6A36 $EB $1B #Level state loop
%patch $7461 $EB $0A #F10-E cheat
%patch $1DD48 $EB $0C #After quitting game
Keen 6
#Remove references to Ted5 running in:
%patch $6866 $EB $1B #Level state loop
%patch $727B $EB $0A #F10-E cheat
%patch $1CA1A $EB $0C #After quitting game
#Remove TED5 switch
%patch $3A32 $EB $23
TED5 switch
There is an executable switch that launches TED5 when the game is first run, if TED5 is in the game directory. (If not the game continues.) This is "/LAUNCH" by default. Interestingly this is not a switch for the game executable but rather TED5 itself and is 'passed along' to TED5. See following section.
TED5 file name
Three things are required when TED5 is launched the "/LAUNCH" string and two copies of the TED5 executable string. (The same by default. There are also two different situations that these three things are called, when the game calls TED5 (Which happens confusingly in three different circumstances) and at the start of the game.
In Keen 4\6 this comes to a total of 6 strings, four copies of 'TED5' and two of 'launch' In Keen 5 things are more logical with only two strings being used, the same string being called several times.
Keen 4 TED5 executable strings
#TED5 checked twice when run at start
%patch $2EF3E "/LAUNCH" $00
%patch $2EF2C "TED5.EXE" $00
%patch $2EF35 "TED5.EXE" $00
#TED5 checked twice when called by game
%patch $2EF68 "/LAUNCH" $00
%patch $2EF56 "TED5.EXE" $00
%patch $2EF5F "TED5.EXE" $00
Keen 5 TED5 executable strings
#TED5 checked when run at start
%patch $3A61 [$00C4W]
%patch $3A65 [$00BBW]
#TED5 checked when called by game
%patch $3B01 [$00C4W]
%patch $3B05 [$00BBW]
#Text for both
%patch $30404 "/LAUNCH" $00
%patch $303FB "TED5.EXE" $00
Keen 6 TED5 executable strings
#TED5 checked twice when run at start
%patch $3A42 [$00E6W] #Launch
%patch $3A4A [$00BCW] #Ted5
%patch $3A46 [$00C5W] #Ted5
%patch $30DFE "/LAUNCH" $00
%patch $30DEC "TED5.EXE" $00
%patch $30DF5 "TED5.EXE" $00
#TED5 checked twice when called by game
%patch $3AE5 [$00F8W] #Launch
%patch $3AED [$00E6W] #Ted5
%patch $3AE9 [$00EFW] #Ted5
%patch $30E28 "/LAUNCH" $00
%patch $30E16 "TED5.EXE" $00
%patch $30E1F "TED5.EXE" $00