This is a complex patch, which changes the 'background' tiles in Keen 1 -- more specifically, it means that the first tile in each row of the tileset (there are 13 tiles in a row) becomes the background for any door or collectable item on the same row. Here is the patch file for Keen 1:
Code: Select all
%ext ck1
%version 1.31
%patch $4409 $26 $8B $07 $B6 $0D $F6 $FE
%patch $4410 $F6 $EE $26 $89 $07 $E9 $60 $01
%patch $4482 $E9 $74 $FF
%patch $44BA $E9 $3C $FF
%patch $4513 $E9 $E3 $FE
%patch $28EC $26 $8B $07 $B6
%patch $28F0 $0D $F6 $FE $F6 $EE $26 $89 $07
%patch $28F8 $03 $1E $08 $6C $03 $1E $08 $6C
%patch $2900 $26 $89 $07 $90 $90 $90 $90 $90
%end
Note that if you use this patch, you should ignore the original assignment of doors and collectable items, and instead rearrange them to suit your choice of background tiles etc. If you don't, bad things will happen: for example, Keen will die when he tries to open a yellow door or gets a raygun or the pogo stick, and he'll never be able to get through any other door. But some results might be considered good: he could get as many joysticks as he wanted, and hence as many points. Bonus points if you can explain all this.
Now, before you start re-using tile 143 for a totally different purpose, I should mention that there are two other references to tile 143 that I could find in the code--but I'm not sure what they do. Anyone who can tell me the other occurrences that will cause one tile to be replaced with this background tile will get mega bonus points.
Finally, for those who are interested in how this patch works, here is the assembly code that makes up the Keen 1 version of the patch (it's the same for Keen 2 except with a few different offsets):
Code: Select all
; At location 4409:
; Change point item collection so the background tile used is the leftmost tile in the row
; Store the tile in ax
es:
mov ax, word ptr [bx]
; Divide by 13, multiply by 13 to get replacement tile in ax
mov dh, 0D
idiv dh
imul dh
; Put the new tile on the map
es:
mov word ptr [bx], ax
; And continue
jmp 4578
; Actually, this now leaves us with 40 unused bytes here...
; I wonder what we could do with those...
; At locations 4482 (joystick etc.), 44BA (raygun and pogo), 4513 (keycards)
; Change so that they use the same tile replacement as point item collecting
jmp 43F9
; At location 28EC (when door opens)
; Change so that they replace with the leftmost tile in the row
; Store the tile in ax
es:
mov ax, word ptr [bx]
; Divide by 13, multiply by 13 to get replacement tile in ax
mov dh, 0D
idiv dh
imul dh
; Put the new tile on the map
es:
mov word ptr [bx], ax
; Move to the next row
add bx, word ptr [6c08]
add bx, word ptr [6c08]
; Put the new tile on the map
es:
mov word ptr [bx], ax