Prev: F6FD Up: Map Next: F788
F71A: Hide a wall after enough coal has been collected
Used by the entry point at F6A6.
Input
H Y co-ordinate
L X co-ordinate
C Width
IX Pointer to wall flags at F7D1.
F71A PUSH HL Remember HL and BC
F71B PUSH BC
F71C LD A,($F7D4) Get the current frame number.
F71F NEG Subtract it from the base Y co-ordinate and store in F7D2 and F7D3.
F721 LD D,A
F722 LD E,$00
F724 ADD HL,DE
F725 LD ($F7D2),HL
F728 LD B,C Put the number of characters in B.
F729 LD C,L Convert the Y co-ordinate to a offset for a screen address.
F72A LD L,H
F72B LD H,$00
F72D ADD HL,HL
F72E LD DE,$EA60 Add to the base pointer at EA60 to get a screen address.
F731 ADD HL,DE
F732 LD A,(HL) Put the screen address in HL.
F733 INC HL
F734 LD H,(HL)
F735 LD L,A
F736 LD E,C Add the X co-ordinate.
F737 LD D,$00
F739 ADD HL,DE
F73A LD (HL),$00 Erase the character.
F73C LD DE,$9260 Also erase it in the screen buffer (9260).
F73F ADD HL,DE
F740 LD (HL),$00
F742 LD HL,($F7D2) Get the wall position.
F745 LD DE,$F800 Move to the next position by subtracting 8 from the Y co-ordinate.
F748 ADD HL,DE
F749 LD ($F7D2),HL Set this as the new position.
F74C DJNZ $F72A Loop back if there are more characters to do.
F74E LD A,($F7D4) Get current frame number.
F751 INC A Increment it, but if this reaches 8, reset to 0.
F752 AND $07
F754 POP BC Restore co-ordinates and width.
F755 POP HL
F756 LD ($F7D4),A Store next frame number and return if it is 0.
F759 RET NZ
Erase the wall from the set of graphics, and change it to mid-air.
F75A LD IY,$C54E C54E is the store of static graphics for this room.
F75E CALL $F6FD Erase the wall.
F761 RES 0,(IX+$00) Clear the flag to mark a wall as being erased.
F765 LD A,($9649) Get the current room (9649).
F768 CP $06 Is it 06?
F76A JR NZ,$F771 Jump forward if not.
F76C SET 5,(IX+$00) Set the wall as cleared and return.
F770 RET
F771 CP $0B Is this room 00B?
F773 JR NZ,$F77A Jump forward if not.
F775 SET 4,(IX+$00) Set the wall as cleared and return.
F779 RET
F77A CP $0F Is this room 00F?
F77C JR NZ,$F783 Jump forward if not.
F77E SET 3,(IX+$00) Set the wall as cleared and return.
F782 RET
F783 SET 2,(IX+$00) Must be room 0E. Set the wall as cleared and return.
F787 RET
Prev: F6FD Up: Map Next: F788