Prev: 9D47 Up: Map Next: 9E02
9D71: Handle Rex visibility during teleporting
Used by the routine at 947A.
9D71 LD A,($A060) Return if Rex is not teleporting
9D74 OR A
9D75 RET Z
9D76 LD A,($A05D) Return if Rex not visible
9D79 OR A
9D7A RET Z
9D7B LD A,($A0B7) Computes into HL the address pointer into room graphic data for Rex position
9D7E LD L,A
9D7F LD H,$00
9D81 ADD HL,HL
9D82 ADD HL,HL
9D83 ADD HL,HL
9D84 ADD HL,HL
9D85 ADD HL,HL
9D86 LD A,($A0B6)
9D89 SRL A
9D8B SRL A
9D8D SRL A
9D8F LD E,A
9D90 LD D,$00
9D92 ADD HL,DE
9D93 LD DE,$E89F
9D96 ADD HL,DE
9D97 LD C,$00 Set C the graphic data to draw
9D99 LD A,($A05E) Set B to the number of lines to hide from Rex sprite
9D9C LD B,A
9D9D CALL $9DF6 Hide a portion of Rex to simulate teleporting
9DA0 LD DE,$001D Garble randomly the last three lines of the Rex sprite not hidden
9DA3 LD B,$03
9DA5 PUSH BC
9DA6 LD B,$03
9DA8 PUSH BC
9DA9 CALL $A375
9DAC AND (HL)
9DAD LD (HL),A
9DAE INC HL
9DAF POP BC
9DB0 DJNZ $9DA8
9DB2 ADD HL,DE
9DB3 POP BC
9DB4 DJNZ $9DA5
9DB6 LD A,($A062) Jump forward if teleporting Rex dead
9DB9 OR A
9DBA JP NZ,$9DCE
9DBD LD A,($A05E) Decrement number of lines to hide
9DC0 DEC A
9DC1 LD ($A05E),A
9DC4 OR A Return if number of lines is not zero
9DC5 RET NZ
9DC6 JP $9DDF Jump to finish teleporting
Code not reached!
9DC9 LD A,$64
9DCB LD ($A061),A
Handle teleporting Rex after dead. This entry point is used by the routine at 9D71.
9DCE LD A,($A05E) Increment the number of lines to hide
9DD1 INC A
9DD2 LD ($A05E),A
9DD5 CP $12 Return if number of lines is not 18
9DD7 RET NZ
9DD8 XOR A Set Rex invisible
9DD9 LD ($A05D),A
9DDC JP $9DE8 Jump to reset teleporting counter
Rex has teleported completely
9DDF XOR A Stop teleporting
9DE0 LD ($A060),A
9DE3 LD A,$01 Set Rex visible
9DE5 LD ($A05D),A
Reset teleporting loop counter
9DE8 LD A,$1E Reset the teleporting loop counter
9DEA LD ($A061),A
9DED RET
Code not reached!
9DEE LD A,($A05F)
9DF1 OR A
9DF2 CALL NZ,$9E02
9DF5 RET
Hide B lines of Rex (used in teleporting animation) beginning from top of sprite
9DF6 LD DE,$001E Set DE to the increment for point to the next line of pixels
9DF9 LD (HL),C Copy the graphic data from C into room graphic data
9DFA INC HL
9DFB LD (HL),C
9DFC INC HL
9DFD LD (HL),C
9DFE ADD HL,DE Increment HL to the next line
9DFF DJNZ $9DF9 Jump back until all the lines of Rex are hidden
9E01 RET
Prev: 9D47 Up: Map Next: 9E02