Code: Select all
# Switch tiles change to the next in the tileset when flipped
# Doesn't affect lightswitch
%patch $36D5 $05 $01 $00 $26 $89 $07 $90 $90 $90 $90 $90 $90 $90 $90 $90
Notes, whinges and failed attempts:
I am working on making it revert to tile $1E0 when $1E1 is reached (thus keeping the Keen2 switch in tact), but it's run into some issues. If it would work, the two reference tiles could easily be changed to allow an indefinite series of tiles to be alternated between.
It's pretty cramped around there, and I'm not sure how to jump back and forth over large distances in order to access empty space, so I've shuffled around the code a bit... alas, I believe I've broken it.
If I could work out how to determine the tile properties directly, this would be so much easier. I've found a single reference to $0019, the Switch On tile, but as far as I can tell it's an irrelevant fluke.
Code: Select all
# Basically the same as above but will have the same
# problem as the following one at tile $1ED
%patch $36DD $74 $08 $05
$01 $00 $26 $89 $07 $EB $46 $26 $C7 $07 $E0 $01 $EB $3F $07 $EB
$3C $FD $26 $C7 $07 $E0 $01 $EB $34 $26 $C7 $07 $ED $01 $EB $2D
# Switches go wacky
%patch $36DD $3D $E1 $02 $74 $08 $05
$01 $00 $26 $89 $07 $EB $46 $26 $C7 $07 $E0 $01 $EB $3F $07 $EB
$3C $FD $26 $C7 $07 $E0 $01 $EB $34 $26 $C7 $07 $ED $01 $EB $2D
Code: Select all
The Assembly code (and a couple of annotations) behind it:
$36DA:
cmp ax, 010F
je 371A
cmp ax, 01E1
je 36E7 [1]
add ax,0001
es:
mov word ptr [bx], ax
jmp 372D
[1]es:
mov word ptr [bx],01E0
jmp 372D
Now for sleep...