Prev: E4CF Up: Map Next: E52C
E4F1: Draw a three-byte-wide terrain step, mirrored
Directions 4 and 11 shifted by 2, 4 or 6 pixels, entered at the second DEC L (the first is not used by the tables). As blit_three, but each byte goes through the bit-reversed table at bit_reverse_table, and the graphic is the partner's at the opposite shift, started one row on. The last DEC L is the entry for directions 4 and 11 at shift 0 into blit_mirror_two.
Input
A the number of pairs of rows
HL the screen address, plus two
SP the graphic
blit_mirror_three E4F1 DEC L Step left into the column
E4F2 DEC L
E4F3 DEC L
E4F4 LD B,$F9 B' holds the table's page, B the count; (the loop) pop two bytes and mirror the first
E4F6 EXX
E4F7 LD B,A
blit_mirror_three_0 E4F8 EXX
E4F9 POP DE
E4FA LD C,E
E4FB LD A,(BC)
E4FC LD (HL),A It goes on the left; the second
E4FD INC L
E4FE LD C,D
E4FF LD A,(BC) Mirrored on its right; pop two more and mirror the first
E500 LD (HL),A
E501 INC L
E502 POP DE
E503 LD C,E
E504 LD A,(BC)
E505 LD (HL),A The row's third byte; up a row; the next
E506 DEC H
E507 LD C,D
E508 LD A,(BC) Mirrored, right to left; pop two more and mirror the first
E509 LD (HL),A
E50A DEC L
E50B POP DE
E50C LD C,E
E50D LD A,(BC)
E50E LD (HL),A Leftwards; the last of the row
E50F DEC L
E510 LD C,D
E511 LD A,(BC) Mirrored; up a row; into the next character row up if this one is done; the next pair; leave HL as the column for the next step. The last DEC L is the entry for directions 4 and 11 at shift 0 into blit_mirror_two
E512 LD (HL),A
E513 DEC H
E514 LD A,H
E515 INC A
E516 AND $07
E518 JR NZ,blit_mirror_three_1
E51A LD A,L
E51B SUB $20
E51D LD L,A
E51E JR C,blit_mirror_three_1
E520 LD A,H
E521 ADD A,$08
E523 LD H,A
blit_mirror_three_1 E524 EXX
E525 DJNZ blit_mirror_three_0
E527 EXX
E528 JP after_step_drawn
E52B DEC L
Prev: E4CF Up: Map Next: E52C