Prev: 52937 Up: Map Next: 53073
53019: 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 53150.
53019 LD A,(25159) Load Magic Knight's current frame index into A...
53022 LD B,A ...multiply by 48...
53023 ADD A,A ...
53024 ADD A,B ...
53025 ADD A,A ...
53026 ADD A,A ...
53027 ADD A,A ...
53028 ADD A,A ...
53029 LD L,A ...load into HL...
53030 LD H,0 ...
53032 ADD HL,HL ...and double again to give 96 times original value, as graphic data for Magic Knight's frames are 96 bytes each
53033 LD A,(23425) If Magic-Knight-facing-left flag is reset...
53036 OR A ...
53037 JR Z,53043 ...then skip ahead to 53043
53039 LD BC,384 Advance HL by 384 bytes...
53042 ADD HL,BC ...i.e. prepare to use left-facing graphic data, rather than right-facing...
53043 PUSH HL Copy value in HL to IX...
53044 POP IX ...
53046 LD DE,63988 Point DE at start of graphic data for Magic Knight facing right, frame 1 (mask)
53049 ADD HL,DE Add HL as offset in HL (HL now points to start of graphic data for Magic Knight's current frame mask)
53050 LD DE,63220 Point DE at start of graphic data for Magic Knight facing right, frame 1
53053 ADD IX,DE Add IX as offset in IX (IX now points to start of graphic data for Magic Knight's current frame)
53055 LD DE,23813 Point DE at table of bitmap data for Magic Knight at his current location
53058 LD B,96 Load B with 96, as Magic Knight's bitmap graphic data is 96 bytes per frame
53060 LD A,(DE) Load current background bitmap byte into A
53061 AND (HL) Apply mask to bitmap data
53062 OR (IX+0) Overlay Magic Knight bitmap graphic data
53065 LD (DE),A Store result back into table of background bitmap data
53066 INC HL Advance HL to next byte in Magic Knight mask bitmap data
53067 INC DE Advance DE to next byte in background graphic bitmap data
53068 INC IX Advance IX to next byte in Magic Knight graphic bitmap data
53070 DJNZ 53060 Decrease B (remaining number of bytes to process) and loop back to 53060
53072 RET Return
Prev: 52937 Up: Map Next: 53073