Prev: 60233 Up: Map Next: 60376
60301: Handler: Unlock Door
Used by the routine at Handler_Player.
Opens the door at HL, plays the unlock sound, and blanks the locked-door graphic.
Handler_UnlockDoor 60301 LD A,5 Queue the unlocked-door sound at SoundFlag_General.
60303 LD (65534),A
60306 PUSH IX Stash the player slot on the stack.
60308 PUSH HL Point IX at the matching door entry.
60309 POP IX
60311 PUSH BC Stash BC and DE on the stack.
60312 PUSH DE
60313 LD C,(IX+0) C=the door horizontal co-ordinate.
60316 LD B,(IX+1) B=the door vertical co-ordinate.
60319 DEC B Move one row up to the top of the door.
60320 LD (IX+5),0 Mark this door as open.
60324 PUSH BC Stash the door co-ordinates on the stack.
60325 PUSH IX Stash the door entry on the stack.
60327 LD DE,50 DE=0050 (beeper pitch).
60330 LD HL,200 HL=0200 (beeper duration).
60333 CALL 949 Call BEEPER.
60336 POP IX Restore the door entry from the stack.
60338 POP BC Restore the door co-ordinates from the stack.
60339 LD HL,(23606) HL=*CHARS.
60342 PUSH HL Stash the current character set pointer on the stack.
Blank the locked-door graphic with empty mask tiles.
60343 LD HL,40812 Write 40812 to *CHARS.
60346 LD (23606),HL
60349 LD D,4 Set the blank width/ height to 1/ 4.
60351 LD E,1
60353 LD A,0 A=0 (first mask tile).
60355 CALL WriteGameSpriteBuffer Erase the door from the room buffer.
60358 LD A,32 A=32 (space).
60360 CALL PrintSprite Print the blank door space.
60363 POP HL Restore the previous character set pointer from the stack.
60364 LD (23606),HL Write it back to *CHARS.
60367 POP DE Restore DE, BC and the player slot from the stack.
60368 POP BC
60369 POP IX
60371 LD (IX+16),0 Clear the key the player was holding.
60375 RET Return.
Prev: 60233 Up: Map Next: 60376