;Layer3 multiple tilemap patch by DSO
;this file makes it possible for you to choose which layer3 tilemap is loaded
;by *writing* the pointer out in BTS at the upper left of the room
;it does not contain any custom code to control how that layer is scrolled
;or animated tiles or the effect the FX1 has... acid will still hurt etc
;even if you make it look like water
;sadly because water lacks the animation on the top layer
;this doesn't *quite* look right if you try to use this for fake acid or fake lava
;that might be in a later expansion to this
;So fog is probably the easiest to use with this
;Black Falcon's subdomain has a document with a disassembly of the scrolling routines for fog


;--------------------------------------------------------------
;			    WARNING!			      |
;  do not change BTS values of the very top left of the room  |
;unless you're setting up for this, or else you'll see garbage|
;--------------------------------------------------------------


lorom

org $82E4ED

JMP $F710	;you may need to change this if you've added to $82 before

org $82F710
LDA $7F6402	;grabbing bank byte from first BTS value
BNE New	;if no BTS, run original routine
LDA #$8A00
JMP $E4F0

New:
STA $05C1
LDA $7F6404	;grabbing location in bank from third and fourth BTS block
STA $05C0
JMP $E4FB

Unpause:
LDA $1964
BEQ nop
PHA
LDA $7F6404
BNE routine:
PLA
JMP $E989
routine:
STA $4312
PLA
LDA #$5BE0
STA $2116
LDA #$1801
STA $4310
LDA $7F6402
XBA
JMP $E99B
nop:
JMP $E9B9

org $82E984	;hijack for unpausing
JMP Unpause