Prev: F7EB Up: Map Next: F86B
F856: Build Reverse Table
Used by the routine at BuildTables.
Builds the table at F900 of every byte with its bits in reverse order, indexed by the byte. The drawing routines use it to draw tiles back to front. The table overwrites the routine at F8FD onwards, which is no longer needed once the shape tables have been built.
BuildReverseTable F856 LD C,$00 Clear C.
F858 LD HL,$F900 The next shifted shape.
BuildReverseTable_Loop F85B LD B,$08 B=08.
F85D LD D,C D=C.
F85E XOR A Clear A.
BuildReverseTable_Bits F85F SLA D Shift D left.
F861 RR A Rotate A right through the carry.
F863 DJNZ BuildReverseTable_Bits Decrease B and jump to BuildReverseTable_Bits until none remain.
F865 LD (HL),A Write A where HL points.
F866 INC HL Advance HL.
F867 INC C Advance C.
F868 JR NZ,BuildReverseTable_Loop Jump to BuildReverseTable_Loop if the zero flag is clear.
F86A RET Return.
Prev: F7EB Up: Map Next: F86B