Prev: E75A Up: Map Next: E7AE
E75B: Displays the closing / opening Magentic Lock Bars.
Used by the routine at Update_Room00.
Input
Output
Handler_MagLock E75B LD A,(MagLock_Dir) Check direction.
E75E CP $01
E760 JR NZ,Handler_MagLock_0
E762 LD A,(Flag_MagLock) For closing, see if reached the bottom.
E765 CP $B7
E767 RET Z If so then do nothing.
E768 JR Handler_MagLock_1
Handler_MagLock_0 E76A LD A,(Flag_MagLock) For opening, see if reached the top.
E76D CP $30
E76F RET Z If so then do nothing.
E770 DEC A Move up.
Handler_MagLock_1 E771 LD L,A Convert Y position into an address on the screen.
E772 LD H,$00
E774 ADD HL,HL
E775 LD DE,DF_lookup
E778 ADD HL,DE
E779 LD E,(HL)
E77A INC HL
E77B LD D,(HL)
E77C EX DE,HL
E77D LD DE,$000F Offset to first X position
E780 ADD HL,DE
Bar 1
E781 LD A,(HL) Draw bar 1 by XOR-ing with the screen.
E782 XOR $2C
E784 LD (HL),A
Bar 2
E785 INC HL
E786 LD A,(HL)
E787 XOR $2C
E789 LD (HL),A
Bar 3
E78A INC HL
E78B INC HL
E78C LD A,(HL)
E78D XOR $2C
E78F LD (HL),A
Bar 4
E790 INC HL
E791 INC HL
E792 INC HL
E793 LD A,(HL)
E794 XOR $2C
E796 LD (HL),A
Bar 5
E797 INC HL
E798 INC HL
E799 LD A,(HL)
E79A XOR $2C
E79C LD (HL),A
Bar 6
E79D INC HL
E79E LD A,(HL)
E79F XOR $2C
E7A1 LD (HL),A Update Y position.
E7A2 LD A,(Flag_MagLock)
E7A5 LD B,A
E7A6 LD A,(MagLock_Dir)
E7A9 ADD A,B
E7AA LD (Flag_MagLock),A
E7AD RET
Prev: E75A Up: Map Next: E7AE