Prev: 36707 Up: Map Next: 36852
36805: Draw the portal, or move to the next cavern if Willy has entered it
Used by the routine at 34574. First check whether Willy has entered the portal.
36805 LD HL,(32944) Pick up the address of the portal's location in the attribute buffer at 23552 from 32944
36808 LD A,(32876) Pick up the LSB of the address of Willy's location in the attribute buffer at 23552 from 32876
36811 CP L Does it match that of the portal?
36812 JR NZ,36831 Jump if not
36814 LD A,(32877) Pick up the MSB of the address of Willy's location in the attribute buffer at 23552 from 32877
36817 CP H Does it match that of the portal?
36818 JR NZ,36831 Jump if not
36820 LD A,(32911) Pick up the portal's attribute byte from 32911
36823 BIT 7,A Is the portal flashing?
36825 JR Z,36831 Jump if not
36827 POP HL Drop the return address from the stack
36828 JP 36904 Move Willy to the next cavern
Willy has not entered the portal, or it's not flashing, so just draw it.
36831 LD A,(32911) Pick up the portal's attribute byte from 32911
36834 LD (HL),A Set the attribute bytes for the portal in the buffer at 23552
36835 INC HL
36836 LD (HL),A
36837 LD DE,31
36840 ADD HL,DE
36841 LD (HL),A
36842 INC HL
36843 LD (HL),A
36844 LD DE,32912 Point DE at the graphic data for the portal at 32912
36847 LD HL,(32946) Pick up the address of the portal's location in the screen buffer at 24576 from 32946
36850 LD C,0 C=0: overwrite mode
This routine continues into the one at 36852.
Prev: 36707 Up: Map Next: 36852