Prev: 746E Up: Map Next: 74BE
748B: Mirror Pixel Row
Used by the routine at VerticalRun_Patch.
Reverses eight pixel rows of the current character row about its midpoint. VerticalRun_Draw patches the span and the inner pair count; VerticalRun_Patch and FixedVertical patch the outer loop stop.
Input
B Character row
C Column
VerticalRun_Mirror 748B PUSH BC Stash the row counter on the stack.
748C CALL PixelRow Call PixelRow.
748F PUSH HL Stash the start of the row on the stack.
The width immediate is self-modified by VerticalRun_Draw.
7490 LD DE,$0000 Load that width.
7493 LD B,$08 Count the 08 pixel rows to reverse.
7495 ADD HL,DE Point DE at the start and HL at the far end.
7496 DEC HL
7497 POP DE
Reverse this pixel row from both ends.
VerticalRun_MirrorRow 7498 PUSH HL Stash HL, DE and BC on the stack.
7499 PUSH DE
749A PUSH BC
The inner count immediate is self-modified by VerticalRun_Draw.
749B LD B,$00 Load that count.
Reverse one pair of bytes.
VerticalRun_MirrorByte 749D CALL VerticalRun_Reverse Reverse the bits of the bytes at both ends.
74A0 EX DE,HL
74A1 CALL VerticalRun_Reverse
74A4 EX DE,HL
74A5 LD A,(DE) Swap those two bytes.
74A6 LD C,(HL)
74A7 EX DE,HL
74A8 LD (DE),A
74A9 LD (HL),C
74AA EX DE,HL
74AB INC DE Step inward along the row.
74AC DEC HL
74AD DJNZ VerticalRun_MirrorByte Jump to VerticalRun_MirrorByte until the row is done.
74AF POP BC Restore BC, DE and HL from the stack.
74B0 POP DE
74B1 POP HL
74B2 INC D Step down one pixel row.
74B3 INC H
74B4 DJNZ VerticalRun_MirrorRow Jump to VerticalRun_MirrorRow until eight pixel rows are done.
74B6 POP BC Restore the row counter from the stack.
74B7 INC B Increment the row counter.
The stop immediate is self-modified by VerticalRun_Patch and FixedVertical.
74B8 LD A,$00 Jump to VerticalRun_Mirror until the row counter equals that stop.
74BA CP B
74BB JR NZ,VerticalRun_Mirror
74BD RET Return.
Prev: 746E Up: Map Next: 74BE