Prev: 63714 Up: Map Next: 63916
63801: Build Shifted Shape B
Used by the routine at BuildShapeTables.
Merges a description of a shape into the buffers, once for each of the three shifts, using the second format. The description starts with the number of strips, the number of rows and the number of bytes in a row. Each row is merged into the buffer next to the chequered background. When the flag at HorizontalStepSize is set the background is merged differently, as the shape is back to front.
Input
HL Address of the description
HL' Address of the buffer for the shifted shape
BuildShiftedShapeB 63801 CALL ReadShapeHeader Call ReadShapeHeader.
BuildShiftedShapeB_Shift 63804 PUSH HL Stash HL on the stack.
BuildShiftedShapeB_Row 63805 LD B,C B=C.
63806 LD A,(23589) The back-to-front flag.
63809 AND A Jump to BuildShiftedShapeB_Merge if A is zero.
63810 JR Z,BuildShiftedShapeB_Merge
63812 LD E,85 E=85.
63814 INC D Advance D.
63815 LD A,(DE) Read DE.
63816 DEC D Step D back.
63817 EXX Switch to the alternate registers.
63818 OR (HL) Set the bits of A that are set in the byte at HL.
63819 LD (HL),A Write A where HL points.
63820 EXX Switch to the alternate registers.
BuildShiftedShapeB_Merge 63821 CALL MergeShiftedByte Call MergeShiftedByte.
63824 INC HL Advance HL.
63825 DJNZ BuildShiftedShapeB_Merge Decrease B and jump to BuildShiftedShapeB_Merge until none remain.
63827 LD A,(23589) The back-to-front flag.
63830 AND A Jump to BuildShiftedShapeB_Background if A is zero.
63831 JR Z,BuildShiftedShapeB_Background
63833 EXX Switch to the alternate registers.
63834 INC HL Advance HL.
63835 EXX Switch to the alternate registers.
63836 JR BuildShiftedShapeB_Strip Jump to BuildShiftedShapeB_Strip.
BuildShiftedShapeB_Background 63838 CALL MergeBackgroundByte Call MergeBackgroundByte.
BuildShiftedShapeB_Strip 63841 LD A,(23582) The strips still to merge.
63844 DEC A Step A back.
63845 LD (23582),A The strips still to merge.
63848 JR Z,BuildShiftedShapeB_Reload Jump to BuildShiftedShapeB_Reload if the zero flag is set.
63850 LD A,(23589) The back-to-front flag.
63853 AND A Jump to BuildShiftedShapeB_Second if A is not zero.
63854 JR NZ,BuildShiftedShapeB_Second
63856 LD E,170 E=170.
63858 LD A,(DE) Read DE.
63859 CALL MergeNextShiftedByte_Merge Call MergeNextShiftedByte_Merge.
BuildShiftedShapeB_Second 63862 LD B,C B=C.
BuildShiftedShapeB_Bytes 63863 CALL FetchShiftedByte_Byte Call FetchShiftedByte_Byte.
63866 CALL MergeBackgroundByte_Merge Call MergeBackgroundByte_Merge.
63869 CALL MergeNextShiftedByte Call MergeNextShiftedByte.
63872 DJNZ BuildShiftedShapeB_Bytes Decrease B and jump to BuildShiftedShapeB_Bytes until none remain.
63874 LD A,(23589) The back-to-front flag.
63877 AND A Is A zero?
63878 EXX Switch to the alternate registers.
63879 JR Z,BuildShiftedShapeB_Advance Jump to BuildShiftedShapeB_Advance if the zero flag is set.
63881 EXX Switch to the alternate registers.
63882 LD E,170 E=170.
63884 INC D Advance D.
63885 LD A,(DE) Read DE.
63886 DEC D Step D back.
63887 EXX Switch to the alternate registers.
63888 OR (HL) Set the bits of A that are set in the byte at HL.
63889 LD (HL),A Write A where HL points.
BuildShiftedShapeB_Advance 63890 INC HL Advance HL.
63891 EXX Switch to the alternate registers.
63892 JR BuildShiftedShapeB_Count Jump to BuildShiftedShapeB_Count.
BuildShiftedShapeB_Reload 63894 LD A,(23583) The number of strips.
63897 LD (23582),A The number of strips.
BuildShiftedShapeB_Count 63900 LD A,(23580) The rows still to merge.
63903 DEC A Step A back.
63904 LD (23580),A The rows still to merge.
63907 JR NZ,BuildShiftedShapeB_Row Jump to BuildShiftedShapeB_Row if the zero flag is clear.
63909 POP HL Bring HL back off the stack.
63910 CALL NextShift Call NextShift.
63913 JR NZ,BuildShiftedShapeB_Shift Jump to BuildShiftedShapeB_Shift if the zero flag is clear.
63915 RET Return.
Prev: 63714 Up: Map Next: 63916