Prev: 29806 Up: Map Next: 29886
29835: 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 29835 PUSH BC Stash the row counter on the stack.
29836 CALL PixelRow Call PixelRow.
29839 PUSH HL Stash the start of the row on the stack.
The width immediate is self-modified by VerticalRun_Draw.
29840 LD DE,0 Load that width.
29843 LD B,8 Count the 8 pixel rows to reverse.
29845 ADD HL,DE Point DE at the start and HL at the far end.
29846 DEC HL
29847 POP DE
Reverse this pixel row from both ends.
VerticalRun_MirrorRow 29848 PUSH HL Stash HL, DE and BC on the stack.
29849 PUSH DE
29850 PUSH BC
The inner count immediate is self-modified by VerticalRun_Draw.
29851 LD B,0 Load that count.
Reverse one pair of bytes.
VerticalRun_MirrorByte 29853 CALL VerticalRun_Reverse Reverse the bits of the bytes at both ends.
29856 EX DE,HL
29857 CALL VerticalRun_Reverse
29860 EX DE,HL
29861 LD A,(DE) Swap those two bytes.
29862 LD C,(HL)
29863 EX DE,HL
29864 LD (DE),A
29865 LD (HL),C
29866 EX DE,HL
29867 INC DE Step inward along the row.
29868 DEC HL
29869 DJNZ VerticalRun_MirrorByte Jump to VerticalRun_MirrorByte until the row is done.
29871 POP BC Restore BC, DE and HL from the stack.
29872 POP DE
29873 POP HL
29874 INC D Step down one pixel row.
29875 INC H
29876 DJNZ VerticalRun_MirrorRow Jump to VerticalRun_MirrorRow until eight pixel rows are done.
29878 POP BC Restore the row counter from the stack.
29879 INC B Increment the row counter.
The stop immediate is self-modified by VerticalRun_Patch and FixedVertical.
29880 LD A,0 Jump to VerticalRun_Mirror until the row counter equals that stop.
29882 CP B
29883 JR NZ,VerticalRun_Mirror
29885 RET Return.
Prev: 29806 Up: Map Next: 29886