Right; somebody recently asked for a door trick, something I don't have the skill to pull off. (Indded, it turned out I was looking at the whole wrong area of code.) The code involved here is that which chooses the tiles displayed as the door is opened, it is found at location $27F8 - $290D (With some other subroutines linked to it)
Basically, when Keen goes to open a door, the game looks at the level he's in and 'takes' three tiles from the level; the door top tile, and the tiles 3 and 4 rows below this. From the door top tile, it then picks the tile next along in the tileset. The four tiles the game now has are displayed as follows; the two door tiles start at the door top, and fall downwards for 2 tiles, then dissapear. To make it look like the tiles are sinking into the ground, the remaining two tiles are displayed over the level, just under the door, to hide the bottom of the two door tiles. After (Actually during) the door tiles' sinking, the level's door tiles are replaced by two other (blank) tiles so Keen can get past where the door used to be.
After a long phone conversation with Adis (Disguised as a deep heart-to-heart chat.) I have managed to cut n' paste together this somewhat clunky and complicated patch. I apologize for it's lack of use and complexity, but a crazy patcher I am not.
Code: Select all
#The door opening involves 3 tiles; one 3 below the door top, one 2 below the door top,
#and the door top (And the tile that follows it in the tileset) There are also 2 tiles that
#replace the door when it is opened. For the opening door, it is possible to change where
#in the level these tiles are taken from; normally the tile displayed is the same as that
#already there, but this can be changed... (PATCH MAY HAVE SIDE EFFECTS!)
#Ultimate door versitility patch; set default door code:
%patch $28A1 $C7 $05 $02 $00 $F7 $2E $08 $6C $03 $46 $04 $D1 $E0 $C4 $1E $48 #1
%patch $28B1 $6C $03 $D8 $26 $8B $07 $89 $44 $0E $8B $C7 $05 $00 $00 $F7 $2E #3-4
%patch $28C1 $08 $6C $03 $46 $04 $D1 $E0 $C4 $1E $48 $6C $03 $D8 $26 $8B $07
%patch $28D1 $89 $44 $10 $8B $5E $FE $D1 $E3 $C7 $87 $9A $AA $00 $00 $8B $C7
%patch $28E1 $05 $00 $00 $F7 $2E $08 $6C $03 $46 $04 $D1 $E0 $C4 $1E $48 $6C #3-7
%patch $28F1 $03 $D8 $26 $C7 $07 $8F $00 $8B $C7 $05 $01 $00 $F7 $2E $08 $6C #2-9
%patch $2901 $03 $46 $04 $D1 $E0 $C4 $1E $48 $6C $03 $D8 $26 $C7 $07 $8F $00
%patch $2911 $5F $5E $8B $E5 $5D $C3 $90 $90
#Adjustable stuff:
%patch $2889 $03 $00 #Tile for 4 below doortop is picked from... [Vert location]
%patch $28A3 $02 $00 #Tile for 3 below doortop is picked from...
%patch $28BD $00 $00 #Doortop is picked from...
%patch $28E2 $00 $00 #First replacement tile vert location
%patch $28FB $01 $00 #Second replacement tile vert location
%patch $28F6 $8F $00 #First replacement tile
%patch $290F $8F $00 #Second replacement tile
#Probbably poinmtless stuff:
#%patch $289F $12 #Make 4 below tile always tile 0
#%patch $28B9 $12 #Make 3 below tile always tile 0
#%patch $28D3 $12 #Make descending door tiles always tile 0
Code: Select all
#Door opening sound
%patch $2801 $21 $00
#Only blue door takes key
%patch $28D7 $A0
#Doors don't take keys
%patch $28D7 $00
#Doors don't open, Keen can just walk right through them
#If he has the right key- over and over. (Doesn't take Keen's key.)
%patch $27F8 $C3