Prev: 61638 Up: Map Next: 61774
61720: Overlay graphic data for Magic Knight's current frame on table of bitmap data for Magic Knight at his current location
Used by the routine at 61860.
61720 LD A,(24843) Load Magic Knight's current frame index into A...
61723 LD B,A ...multiply by 48...
61724 ADD A,A ...
61725 ADD A,B ...
61726 ADD A,A ...
61727 ADD A,A ...
61728 ADD A,A ...
61729 ADD A,A ...
61730 LD L,A ...load into HL...
61731 LD H,0 ...
61733 ADD HL,HL ...and double again to give 96 times original value, as graphic data for Magic Knight's frames are 96 bytes each
61734 LD A,(23417) If Magic-Knight-facing-left flag is reset...
61737 OR A ...
61738 JR Z,61744 ...then skip ahead to 61744
61740 LD BC,384 Advance HL by 384 bytes...
61743 ADD HL,BC ...i.e. prepare to use left-facing graphic data, rather than right-facing...
61744 PUSH HL Copy value in HL to IX...
61745 POP IX ...
61747 LD DE,26968 Point DE at start of graphic data for Magic Knight facing right, frame 1 (mask)
61750 ADD HL,DE Add HL as offset in HL (HL now points to start of graphic data for Magic Knight's current frame mask)
61751 LD DE,26200 Point DE at start of graphic data for Magic Knight facing right, frame 1
61754 ADD IX,DE Add IX as offset in IX (IX now points to start of graphic data for Magic Knight's current frame)
61756 LD DE,24576 Point DE at table of bitmap data for Magic Knight at his current location
61759 LD B,96 Load B with 96, as Magic Knight's bitmap graphic data is 96 bytes per frame
61761 LD A,(DE) Load current background bitmap byte into A
61762 AND (HL) Apply mask to bitmap data
61763 OR (IX+0) Overlay Magic Knight bitmap graphic data
61766 LD (DE),A Store result back into table of background bitmap data
61767 INC HL Advance HL to next byte in Magic Knight mask bitmap data
61768 INC DE Advance DE to next byte in background graphic bitmap data
61769 INC IX Advance IX to next byte in Magic Knight graphic bitmap data
61771 DJNZ 61761 Decrease B (remaining number of bytes to process) and loop back to 61761
61773 RET Return
Prev: 61638 Up: Map Next: 61774