Patch:Terminator text

From KeenWiki
Jump to: navigation, search

The "terminator text" sequence is a sequence that appears when the Keen Galaxy games are first started. (It will also play again once all the demo sequences have been run.) It leads to the title screen on completion or if interrupted by any keypress.

It consists of three specific phases. In the first, two large bitmaps, COMMANDER and KEEN that phase through each other as they scroll right-left and left-right respectively. The bitmaps are dark colors and where they overlap turn light. As this happens several credits bitmaps scroll up from the bottom of the screen, pause in the midscreen for a few seconds, then scroll up off the screen top.

After the two background bitmaps have scrolled past each other the sequence will move on to phase 2. The bitmaps will 'zoom out', getting smaller as they shrink towards the top of the screen. This phase ends with the words 'COMMANDER KEEN' at the top of a black screen.

This then leads to phase 3, where a semi-random pixel effect replaces the old, mostly black, screen with the title screen.


Details

The first phase uses a unique palette composed of far fewer colors than the main game. The two background bitmaps are monochrome and translucent and the palette is set up so that their individual colors are dark while their combined color is light. The credits bitmaps appear over this and do not change color.

More technically the EGA graphics planes are divided up between the two horizontally scrolling monochrome images and the vertically scrolling credit pictures, as follows: The KEEN graphic is drawn into plane 0, the COMMANDER graphic into plane 1, and the vertically scrolling credit images into planes 2 and 3.

By setting EGA registers so that drawing to select planes at a time is allowed, the game can update one component of the scrolling screen without disturbing the other two. Thus, by default, the palette is set so that the vertically scrolling credit images can only have three completely opaque colors, and one completely transparent color (i.e., both planes 2 and 3 are zero). This leaves four colors that can be created from all the combinations of the two planes dedicated to the horizontally scrolling images (because 2^2 = 4). COMMANDER and KEEN can both have a unique color, as can their union and the backdrop. Hence, seven colors can be shown at once, if vertically scrolling images are not to have any translucence.


Skip sequences

These patches skip various parts of the terminator sequence, from the entire sequence to small parts of it.


Skip sequence, title screen & menu, go to new game

This patch causes a new game to start instead of the Terminator Text. The difficulty of the game is marked in blue. (By default it is 'normal'.) As a side effect the terminator text is permanently disabled, but the rest of the demos work fine.

Patch: Go straight to new game
#Go straight to new game on startup
%patch $4EA8 $C7 $06 $7A70W $0005W $C7 $06 $474AW $0002W $9A $146008A8RL $9A $05C40063RL $5F $5E $8B $E5 $5D $CB


Skip sequence & title screen, go to demo

This disables the Terminator text entirely and also the title screen. The game will go directly to the first demo instead. To simply disable a specific graphic see the 'images section below.

Patch: Keen 4
#Disable Terminator sequence and title screen (Frees $4E9F-$51B7)
%patch $3C26 $90 $90 $90 $90 $90


Skip sequence & title screen, go to menu

This disables the Terminator text entirely and also the title screen. The game will go directly to the Main Menu.

Patch: Keen 4
#Terminator sequence goes straight to main menu - Keen 4
%patch $50ED $A545W $001CW %patch $51BC $EB
#Terminator sequence goes straight to main menu - Keen 5
%patch $50E7 $9BADW $001CW %patch $51B6 $EB
#Terminator sequence goes straight to main menu - Keen 6
%patch $4F08 $A6D3W $001CW %patch $4FC5 $EB


Skip sequence, go to title or help

These patches skip the credit bitmaps scroll and zoom sequences and instead goes straight to the title screen appearing. Changing the blue value to $003BW will cause the terminator sequence to go straight to the help screen instead.

Patch: Skip terminator sequence, go straight to title
#Terminator sequence goes straight to title - Keen 4
%patch $50ED $A545W $001CW
#Terminator sequence goes straight to title - Keen 5
%patch $50E7 $9BADW $001CW
#Terminator sequence goes straight to title - Keen 6
%patch $4F08 $A6D3W $001CW


Skip scroll, go to zoom-out

These patches skip the credits scroll and go to the title zoom sequence, just before the title screen appears. (The terminator chunks do appear briefly but can be totally removed by altering their graphics to be totally black.)

Patch: Skip terminator sequence, go straight to title zoom
#Skip terminator sequence, go straight to title zoom -Keen 4
%patch $50F1 $90 $90 $90 $90
#Skip terminator sequence, go straight to title zoom -Keen 5
%patch $50EB $90 $90 $90 $90
#Skip terminator sequence, go straight to title zoom -Keen 6
%patch $4F0C $90 $90 $90 $90


Skip zoom sequence

These patches skip the brief zoom out sequence after the credits have scrolled and before the title screen appears. If the COMMANDER\KEEN images are still onscreen they will change color to the default palette colors (Dark blue and green) which will look unusual. As such it's best to edit these images so that the screen will be completely black at the end of scrolling.

Patch: Skip zoom sequence, go straight to title appearance
#Skip the zoom out sequence -Keen 4
%patch $5140 $90 $90 $90 $90
#Skip the zoom out sequence -Keen 5
%patch $513A $90 $90 $90 $90
#Skip the zoom out sequence -Keen 6
%patch $4F5B $90 $90 $90 $90


Replace Terminator Text with another action

This is the Main menu actions list, a list of various things the game does at the main menu. By simply swapping various pointers around it is possible to change the order that various actions appear or replace one action with another. A novel option is to replace the terminator text with the star wars story

Patch: Keen 4
#Main menu actions list
%patch $3CB9 $0448W
#3C18: Terminator sequence and title screen
$045FW
#3C2F: Demo 1
$046CW
#3C3C: Star wars story
$0473W
#3C43: Demo 2
$0481W
#3C51: High score demo
$0488W
#3C58: Demo 3
$0496W
#3C66: Demo 4


Colors

These patches govern how terminator images are colored. Patches like these regarding how color maps are used are explained on the palettes page.

Unlike most of the game, the COMMANDER, KEEN and credits bitmaps don't use the same |'color map'. Keen Galaxy uses 16 colors which are created from different sums of four 'plane values' of 1, 2, 4 and 8. In the normal game these planes are blue, green, red and brightness. Thus 'dark blue' is color 1, 'purple' is color 1 + 4 = 5 and white is color 1 + 2 + 4 + 8 = 15.

In the terminator sequence COMMANDER occupies the first plane of value 1 and KEEN occupies plane 2. In the normal game they would thus be blue and green. They are transparent so they produce a third color where they overlap. (Color 1 + 2 = 3.) The credits bitmaps use the remaining two planes and are not transparent, so their colors don't 'add' in the same way.

However the terminator sequence doesn't map colors to pixels in the same way as the regular game. For example, by default, both COMMANDER and KEEN appear the same color. Their different pixel values are mapped to the same color. (Their overlap however is mapped to a light version of that color. How the 16 possible pixel values are mapped to the 16 possible colors is governed by a 17-byte 'color map' (The extra byte is for the 'screen border'.) By using an odd color map the game can do neat stuff like the terminator sequence.

As a final complexity the value of colors goes 0,1,2...7,8,19,1A... Thus a value of 9 is not a valid color but $19 is. The following table shows what color each palette value will shoe:

$1F, white       $1E, yellow       $1D, light purple  $1C, light red
$1B, light teal  $1A, light green  $19, light blue    $18, dark grey (light black)
$17, white       $16, yellow       $15, light purple  $14, light red
$13, light teal  $12, light green  $11, light blue    $10, dark grey (light black)
$0F, light grey  $0E, brown        $0D, dark purple   $0C, dark red
$0B, dark teal   $0A, dark green   $09, dark blue     $08, black
$07, light grey  $06, brown        $05, dark purple   $04, dark red
$03, dark teal   $02, dark green   $01, dark blue     $00, black

There are two color maps. The first is used for the terminator sequence proper while the second is used during the 'zoom out' sequence just before the title screen appears. Both have a call to the color map and a second call to the screen border color. Interestingly the same border color is used in both cases. (It's the one belonging to the terminator sequence palette.)

Patch: Keen 4
#Terminator sequence
%patch $50BB $0218W
#Screen border color
%patch $50C2 $0208W
#Main color map
#Zoom out sequence
%patch $50B5 $0218W
#Screen border color
%patch $50B8 $0229W
#Main color map
#Terminator text color map:
%patch $2F078 $00 $18 $18 $07 $01 $01 $01 $01
#Dark colors
$11 $11 $11 $11 $13 $13 $13 $13 $00
#Light colors (and border color)
#Zoom out color map:
%patch $2F089 $00 $18 $18 $07 $01 $01 $01 $01
#Dark colors
$11 $11 $11 $11 $13 $13 $13 $18 $00
#Light colors (and border color)

Patch: Keen 5
#Terminator sequence
%patch $50B5 $01C8W
#Screen border color
%patch $50BC $01B8W
#Main color map
#Zoom out sequence
%patch $50AF $01C8W
#Screen border color
%patch $50B2 $01D9W
#Main color map
#Terminator text color map:
%patch $304F8 $00 $04 $04 $1C $01 $01 $01 $01
#Dark colors
$11 $11 $11 $11 $13 $13 $13 $13 $00
#Light colors (and border color)
#Zoom out color map:
%patch $30509 $00 $04 $04 $1C $01 $01 $01 $01
#Dark colors
$11 $11 $11 $11 $13 $13 $13 $04 $00
#Light colors (and border color)

Patch: Keen 6
#Terminator sequence
%patch $4ED6 $015CW
#Screen border color
%patch $4EDD $014CW
#Main color map
#Zoom out sequence
%patch $4ED0 $015CW
#Screen border color
%patch $4ED3 $016DW
#Main color map
#Terminator text color map:
%patch $30E7C $00 $05 $05 $15 $01 $01 $01 $01
#Dark colors
$11 $11 $11 $11 $13 $13 $13 $13 $00
#Light colors (and border color)
#Zoom out color map:
%patch $30E8D $00 $05 $05 $15 $01 $01 $01 $01
#Dark colors
$11 $11 $11 $11 $13 $13 $13 $05 $00
#Light colors (and border color)


COMMANDER\KEEN images

These are the 'COMMANDER KEEN' images that move past each other, they are in the same plane, behind the credit bitmaps. The values for what is used is the chunk number, (properly labelled by Keengraph, ModKeen does not extract the chunk properly and labels it differently.)

Patch: Keen 4
#Terminator chunks:
%patch $4EE8 $1281W
#COMMANDER
%patch $4EF4 $1280W
#KEEN


Don't show COMMANDER and\or KEEN images

These patches allow a modder to selectively remove one or both of the background terminator images from the sequence. This also frees up a little patch space. Note however that both images will still appear in the 'zooming out' section at the end of the sequence.

Patch: Keen 4
#Don't display 'KEEN' (Free $4F3F-$4F9E)
%patch $4F3E $60
#Don't display 'COMMANDER' (Free $4FFF-$5074)
%patch $4FFC $E9 $00ACW


Credit bitmaps

These are the images crediting the game team that appear over the terminator text images for specific periods of time. They are read from a pointer list whose pointer is stored elsewhere in the code. It is possible to change the number of images shown. (Less is simple, more becomes more difficult as there is only a limited time to display images.)

Patch: Keen 4
#Bitmap list:
%patch $3F46 $0200W
#Location
%patch $50E0 $04
#Number of bitmaps to show 1
%patch $5113 $04
#Number of bitmaps to show 2
#Credit bitmaps:
%patch $2F070 $0068W $0069W $006AW $006BW

Patch: Keen 5
#Bitmap list:
%patch $3F40 $01B0W
#Location
%patch $50DA $04
#Number of bitmaps to show 1
%patch $510D $04
#Number of bitmaps to show 2
#Credit bitmaps:
%patch $304F0 $0053W $0054W $0055W $0056W

Patch: Keen 6
#Bitmap list:
%patch $3D61 $0144W
#Location
%patch $4EFB $04
#Number of bitmaps to show 1
%patch $4F2E $04
#Number of bitmaps to show 2
#Credit bitmaps:
%patch $30E74 $001DW $001EW $001FW $0020W


Don't display credits

This patch completely removes the credit bitmaps, skipping the code block entirely.

Patch: Keen 4
#Don't display credit bitmaps in terminator sequence (Keen 4; frees $4007-$41A7)
%patch $4006 $CB
#Don't display credit bitmaps in terminator sequence (Keen 5; frees $4001-$41A1)
%patch $4000 $CB
#Don't display credit bitmaps in terminator sequence (Keen 6; frees $3E21-$3FC1)
%patch $3E21 $CB


Credits horizontal position

This patch changes the horizontal position of the credit images. by default this is right in the middle of the screen, but it needs to be made less if the images are wider.

Patch: Credit images horizontal position
#Credit images horizontal position -Keen 4
%patch $402C $0014W
#Credit images horizontal position -Keen 5
%patch $4026 $0014W
#Credit images horizontal position -Keen 6
%patch $3E47 $0014W


Credits sitting time

This patch changes how long the credit images sit still for before moving up. If very small the images will just keep moving up the screen.

Patch: Credit images horizontal position
#Credit images sitting time -Keen 4
%patch $424F $00C8W
#Credit images sitting time -Keen 5
%patch $4249 $00C8W
#Credit images sitting time -Keen 6
%patch $406A $00C8W


Credits wobble

This patch causes the credit images to 'wobble' back and forth once they rise into position.

Patch: Credit images wobble
#Credit images wobble -Keen 4
%patch $4012 $0005W
#Credit images wobble -Keen 5
%patch $400C $0005W
#Credit images wobble -Keen 6
%patch $3E2D $0005W


Credits appear instantly

This patch makes the credit images appear in the middle of the screen instantly instead of sliding into place. It is slightly buggy ('Image dirt' may appear) but stable. The images will slide off the screen.

Patch: Credit images appear instantly
#Credit images appear instantly -Keen 4
%patch $4217 $0000W
#Credit images appear instantly -Keen 5
%patch $4211 $0000W
#Credit images appear instantly -Keen 5
%patch $4032 $0000W