Prev: 64637 Up: Map Next: 64810
64687: If do-not-draw-storm-cloud flag is reset then draw storm cloud
If the do-not-draw-storm-cloud flag is reset, then the Storm Cloud will be drawn. After this, the flag is set, ensuring that the position of the Storm Cloud can be updated by the routine at 64637. This also ensures that if Magic Knight moves to a different room, the drawing of the Storm Cloud will cease, since the do-not-draw-storm-cloud flag is only reset by the routine at 64637, which in turn is only called when both the Storm Cloud and Magic Knight are in the same room.
Used by the routine at 62178.
The operand of the instruction at 64687 represents the do-not-draw-storm-cloud flag. This is modified by the instructions at 38134, 64683 and 64806.
64687 LD A,1 If do-not-draw-storm-cloud flag is set...
64689 OR A ...
64690 RET NZ ...then return
64691 LD HL,(23677) Store value in coordinate storage on stack...
64694 PUSH HL ...
64695 LD HL,(63018) Load HL with address of bitmap virtual text cursor
64698 PUSH HL Store HL (bitmap virtual cursor address)
64699 LD HL,(23707) Load HL with address of attribute virtual text cursor
64702 PUSH HL Store HL (attribute virtual cursor address)
The operand of the instruction at 64703 represents the display file address for the top-left of the Storm Cloud. This is modified by the instruction at 64657.
64703 LD HL,0 Load HL with current display file address of Storm Cloud
64706 PUSH HL Store HL (current display file address of Storm Cloud)
The operand of the instruction at 64707 represents the start address of the graphic data for the Storm Cloud's current frame. This is modified by the instruction at 64679.
64707 LD DE,0 Load DE with start address of graphic data for Storm Cloud's current frame
64710 LD B,8 Load B with 8 (as we are drawing the first eight pixel rows of cloud graphic data)
64712 PUSH HL Store HL (current display file address at left side of cloud)
64713 LD A,(DE) Copy a run of eight bytes from Storm Cloud's graphic data...
64714 LD (HL),A ...to display file, starting at current display file address...
64715 INC HL ...
64716 INC DE ...
64717 LD A,(DE) ...
64718 LD (HL),A ...
64719 INC HL ...
64720 INC DE ...
64721 LD A,(DE) ...
64722 LD (HL),A ...
64723 INC HL ...
64724 INC DE ...
64725 LD A,(DE) ...
64726 LD (HL),A ...
64727 INC HL ...
64728 INC DE ...
64729 LD A,(DE) ...
64730 LD (HL),A ...
64731 INC HL ...
64732 INC DE ...
64733 LD A,(DE) ...
64734 LD (HL),A ...
64735 INC HL ...
64736 INC DE ...
64737 LD A,(DE) ...
64738 LD (HL),A ...
64739 INC HL ...
64740 INC DE ...
64741 LD A,(DE) ...
64742 LD (HL),A ...
64743 INC DE Advance DE to next byte in graphic data (i.e. start of next pixel row)
64744 POP HL Restore HL (current display file address at left side of cloud)
64745 INC H Advance down a pixel row
64746 DJNZ 64712 Decrease remaining number of pixel rows to draw, and loop back to 64712 if not zero
64748 POP HL Restore HL (current display file address of Storm Cloud)
64749 LD A,32 Add 32 to display file address to move down eight pixels...
64751 ADD A,L ...
64752 LD L,A ...
64753 XOR A Set A to zero (see trivia)
64754 LD B,5 Load B with 5 (as we are drawing a further five pixel rows of cloud graphic data)
64756 PUSH HL Store HL (current display file address at left side of cloud)
64757 LD A,(DE) Copy a run of eight bytes from Storm Cloud's graphic data...
64758 LD (HL),A ...to display file, starting at current display file address...
64759 INC HL ...
64760 INC DE ...
64761 LD A,(DE) ...
64762 LD (HL),A ...
64763 INC HL ...
64764 INC DE ...
64765 LD A,(DE) ...
64766 LD (HL),A ...
64767 INC HL ...
64768 INC DE ...
64769 LD A,(DE) ...
64770 LD (HL),A ...
64771 INC HL ...
64772 INC DE ...
64773 LD A,(DE) ...
64774 LD (HL),A ...
64775 INC HL ...
64776 INC DE ...
64777 LD A,(DE) ...
64778 LD (HL),A ...
64779 INC HL ...
64780 INC DE ...
64781 LD A,(DE) ...
64782 LD (HL),A ...
64783 INC HL ...
64784 INC DE ...
64785 LD A,(DE) ...
64786 LD (HL),A ...
64787 INC DE ...
64788 POP HL Restore HL (current display file address at left side of cloud)
64789 INC H Advance down a pixel row
64790 DJNZ 64756 Decrease remaining number of pixel rows to draw, and loop back to 64756 if not zero
64792 POP HL Restore HL (attribute virtual cursor address)
64793 LD (23707),HL Restore attribute virtual cursor address
64796 POP HL Restore HL (bitmap virtual cursor address)
64797 LD (63018),HL Restore bitmap virtual cursor address
64800 POP HL Restore value in coordinate storage from stack...
64801 LD (23677),HL ...
64804 LD A,1 Set do-not-draw-storm-cloud flag...
64806 LD (64688),A ...
64809 RET Return
Prev: 64637 Up: Map Next: 64810