Patch:Satellite

From KeenWiki
Jump to: navigation, search

The Satellite is a sprite found on the Keen 6 map that allows Keen to travel to an area he normally cannot reach. It works similar to Messie in that Keen can 'board' it at one point on the map and 'disembark' at another. These 'dropoff points' are themselves separate sprites that must be placed on the map.


Keen cannot ride the satellite

This patch prevents Keen from interacting with the Satellite entirely; he cannot ride it and therefore cannot disembark.

Patch: Keen 6
#Keen cannot ride the Satellite
%patch $FE2A $90 $90


Sprite Type

The Satellite uses sprite type 33, which is used only by it and has no real affect on anything.

Patch: Keen 6
#Satellite sprite type
%patch $FD61 $21


Sprite Actions

The Satellite has few actions and is quite simple to understand. It is spawned in the first frame of its only loop and continues using this four action loop indefinitely.

When Keen touches the Satellite one of two things may happen. Normally he will turn into 'hanging Keen' and be taken for a ride. However if he is already hanging (and a few other conditions are met) then he will drop off the Satellite as map Keen standing. As such a check is made for hanging Keen's action to decide which of these things to do.

Hanging Keen does not change his action at all. There is also an unknown check for hanging Keen's action.

The dropoff point is spawned using its action and does not change at all.

Actions:
$1C52W #Satellite dropoff point
$1C70W #Keen hang from satellite
$1C8EW #Satellite 1
$1CACW #Satellite 2
$1CCAW #Satellite 3
$1CE8W #Satellite 4

Patch: Keen 6
#Satellite spawned
%patch $FD7E $1C8EW
#Satellite loop
%patch $329DA $1CACW %patch $329F8 $1CCAW %patch $32A16 $1CE8W %patch $32A24 $1C8EW
#Keen goes to hanging Keen
%patch $FED6 $1C70W
#Hanging Keen
%patch $329BC $0000W
#Check if Keen is not already hanging
%patch $FE6C $1C70W
#Keen drops off Satellite
%patch $FE94 $130AW
#Unknown check for hanging Keen
%patch $FEF4 $1C70W
#Spawn dropoff point
%patch $FD23 $1C52W
#Dropoff point sits
%patch $3299E $0000W


Sprite Behavior

The Satellite has a unique behavior it always uses that makes it move along a 'track' on the map. It is also responsible for allowing Keen to ride the Satellite, so changing it will result in Keen being unable to ride. Hanging Keen and the dropoff points have no behavior at all.

Behaviors:
$0EFC0E08RL #Satellite

Patch: Keen 6
#Satellite
%patch $329CE $0EFC0E08RL %patch $329EC $0EFC0E08RL %patch $32A0A $0EFC0E08RL %patch $32A28 $0EFC0E08RL
#Hanging Keen
%patch $329B0 $00000000L
#Dropoff point
%patch $32992 $00000000L


Speed

The Satellite has no animation motion, nor does hanging Keen. The speed of both is controlled in their behavior codes.

Patch: Animation motion
#Satellite
%patch $329CA $0000W $0000W %patch $329E8 $0000W $0000W %patch $32A06 $0000W $0000W %patch $32A24 $0000W $0000W
#Hanging Keen
%patch $329AC $0000W $0000W
#Dropoff point
%patch $3298E $0000W $0000W


Animations

The Satellite has one four frame animation cycle. Hanging Keen has a single animation for its action. The dropoff point uses animation -1 (That is it is invisible.) There is no cache as all animations involved are cached with Keen when he is placed on the map.

Patch: Keen 6
#Satellite
%patch $329BE $00D5W $00D5W %patch $329C8 $000AW
#Animation speed
%patch $329DC $00D6W $00D6W %patch $329E6 $000AW
#Animation speed
%patch $329FA $00D7W $00D7W %patch $32A04 $000AW
#Animation speed
%patch $32A18 $00D8W $00D8W %patch $32A22 $000AW
#Animation speed
#Hanging Keen
%patch $329A0 $00E3W $00E3W %patch $329AA $0000W
#Animation speed
#Dropoff point
%patch $32982 $FFFFW $FFFFW %patch $3298C $0000W
#Animation speed


Clipping and foreground

The Satellite and dropoff points have no clipping so it may pass through all map tiles and take Keen places. It has a foreground variable of 2 making it appear in front of all tiles not marked as foreground themselves. Oddly the invisible dropoff points have this value as well.

Keen's clipping is removed (Set to 0) when he boards the Satellite so that he can pass through solid tiles. It is reset when he disembarks.

Patch: Keen 6
#Satellite related clipping variables
%patch $FD53 $0000W
#Satellite
%patch $FCD5 $0000W
#Satellite dropoff point
%patch $FED3 $0000W
#Keen board Satellite
%patch $FEA6 $0001W
#Keen disembark Satellite

Patch: Keen 6
#Satellite related foreground variables
%patch $FD58 $0002W
#Satellite
%patch $FCDA $0002W
#Satellite dropoff point


Sprite spawn code

Only partial spawn code is available for the Satellite. There are three relevant sprites, two dropoff points and the Satellite itself. The two dropoff points use the same initiation code which according to what pointer used it passes along a 'variety' to the spawning code.

Neither initiation code sets a cache

In the spawning code $1C8EW is the sprite action the Satellite uses as it proceeds to act in-level. $C7 $02 $xxxxW sets the sprite activity, $C7 $07 $xxxxW sets the sprite type, $C7 $06 $xxxxW sets the clipping value, $C7 $20 $xxxxW sets the foreground value. Finally $D3 $E0 $05 $xxxx is how far down (Or more usually up) the sprite is spawned from where it is placed. This is necessary for sprites that walk on the ground as they can only be placed in the level at multiples of 16 pixels high while their actual height can be anything.

The Satellite always starts the level moving down but not horizontally. $C7 $47 $10 $xxxxW is the vertical direction the Satellite starts moving in, either $0001W (Facing down), $FFFFW (Facing up) or $0000W (Neither, seldom used.) $C7 $47 $0E $xxxxW is the horizontal direction.

A number of other variables are also set, these have unknown functions at the present time.

The dropoff point's spawn code is quite similar, setting a number of similar values. It also does two different things depending on which variety called it.

Patch: Keen 6
%patch $E9A8 $0288W 
#Satellite dropoff up (At $E6A8)
%patch $E9AA $0288W
#Satellite dropoff right (At $E6A8)
%patch $EA02 $0434W
#Satellite (At $E854)
#Satellite dropoff point initiation code
%patch $E6A8 $8B $46 $FA $05 $FFD4W $50 $57 $56 $9A $0EFC0CF3RL $83 $C4 $06 $E9 $020BW
#Satellite initiation code
%patch $E854 $57 $56 $9A $0EFC0D73RL $83 $C4 $04 $EB $67
#Satellite dropoff point spawn code
%patch $FCB3 $55 $8B $EC $56 $57 $8B $76 $06 $8B $7E $08 $33 $C0 $50 $9A $069A1E25RL $83 $C4 $02 $8B $1E $66 $A9 $C7 $47 $02 $0002W $C7 $47 $06 $0000W $C7 $47 $20 $0002W $C7 $07 $0022W $8B $C6 $89 $47 $30 $89 $47 $2C $8B $C7 $89 $47 $32 $89 $47 $2E $8B $46 $0A $35 $0001W $40 $89 $47 $3E $8B $C6 $B1 $08 $D3 $E0 $89 $47 $22 $89 $47 $0A $8B $47 $22 $05 $0100W $89 $47 $26 $8B $C7 $D3 $E0 $89 $47 $24 $89 $47 $0C $8B $47 $24 $05 $0100W $89 $47 $28 $B8 $1C52W $50 $53 $9A $08F41219RL $83 $C4 $04 $5F $5E $5D $CB
#Satellite spawning code
%patch $FD33 $55 $8B $EC $83 $EC $02 $56 $57 $8B $76 $06 $8B $7E $08 $33 $C0 $50 $9A $069A1E25RL $83 $C4 $02 $8B $1E $66 $A9 $C7 $47 $06 $0000W $C7 $47 $20 $0002W $C7 $47 $02 $0002W $C7 $07 $0021W $8B $C6 $B1 $08 $D3 $E0 $89 $47 $0A $8B $C7 $D3 $E0 $89 $47 $0C $C7 $47 $0E $0000W $C7 $47 $10 $0001W $B8 $1C8EW $50 $53 $9A $08F41219RL $83 $C4 $04 $C7 $46 $FE $0003W $8B $46 $FE $05 $005BW $8B $DF $D1 $E3 $8B $9F $8B $CA $D1 $EB $D1 $E3 $8E $06 $79 $A9 $8B $D6 $D1 $E2 $03 $DA $26 $89 $07 $8B $1E $66 $A9 $8B $46 $FE $89 $47 $3E $C7 $47 $40 $0100W $C7 $47 $44 $0002W $5F $5E $8B $E5 $5D $CB