LoRom
;Made by SadiztykFish
;Ver1.0
;Modifies the exisiting elevator enemy to allow both up and down travel. 
;Speed = $0002, Speed 2 = 0X40 (X is screen below where you emerge from).
;Using a Speed of $0000 or $0001 will result in a normally functioning down or up only elevator.
;Ver1.1
;Multiway elevators can pass through a midway level without stopping by holding the direction you are travelling.


org $A39520
	JSR EnterCheck
org $A39551
	DW #InputCheck
org $A39555
	JSR ExitCheck
org $A3957C
	LDA $0D90
	DB $D0
org $A395BF
	LDA $0D90
	DB $D0
org $A395FB
	JSR ContinueCheck
org $A3F311
InputCheck:
	DW $0400,$0800,$0C00
EnterCheck:
	LDA $0D90 : BNE $04
	LDA #$0018 : RTS
	LDA $0FB6,X : RTS
ExitCheck:
	CMP #$0800 : BNE $05
	LDA #$0002 : BRA $03
	LDA #$0000
	STA $0FB4,X : STA $0D90
	LDA #$000B : RTS
ContinueCheck:
	LDA $0FB4,X
	CMP #$0004
	BNE StopElevator
	LDA $0D90
	ASL A : TAY
	LDA $8B
	AND InputCheck,Y
	BEQ StopElevator
	STA $8F
	LDA #$0001 : STA $0E16
	PLA : PLA
	JSL $A3952A : RTL
StopElevator:
	STZ $0E16
	RTS