Prev: F6B9 Up: Map Next: F856
F7EB: Build Shape Tables
Used by the routine at BuildTables.
Builds the shifted copies of the descriptions of the ground textures (see ShapeDescriptions). Each description is merged into three buffers, shifted by two, four and six pixels to the right, so that the terrain can be drawn at any horizontal pixel position. Those buffers are in ShiftedShapesOne to F10E. Four of the descriptions are read in the format of BuildShiftedShapeB, two in the format that BuildShiftedShapeA handles, and the last three in the format of BuildShiftedShapeB again with HorizontalStepSize set to FF.
BuildShapeTables F7EB LD HL,$5C1C The working variables start here.
F7EE LD B,$26 B=26.
F7F0 CALL ClearBytes Call ClearBytes.
F7F3 XOR A Clear A.
F7F4 LD ($5C25),A The shapes are built front to back.
Make the copies of each description, with the description in HL and the buffer for the copies in HL'.
BuildShapeTables_First F7F7 LD HL,$E74A The shifted shapes one.
F7FA EXX Switch to the alternate registers.
F7FB LD HL,$E64B The fourth shape description.
F7FE CALL BuildShiftedShapeB Call BuildShiftedShapeB.
F801 LD HL,$E804 The shifted shapes two.
F804 EXX Switch to the alternate registers.
F805 LD HL,$E6A2 The sixth shape description.
F808 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
F80B LD HL,$E91E The shifted shapes three.
F80E EXX Switch to the alternate registers.
F80F LD HL,$E713 The eighth shape description.
F812 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
F815 LD HL,$EC96 The shifted shapes six.
F818 EXX Switch to the alternate registers.
F819 LD HL,$EC60 The shape description.
F81C CALL BuildShiftedShapeB Call BuildShiftedShapeB.
F81F LD HL,$EA68 The shifted shapes four.
F822 EXX Switch to the alternate registers.
The next two descriptions use the other format.
F823 LD HL,$E581 The shape descriptions.
F826 CALL BuildShiftedShapeA Call BuildShiftedShapeA.
F829 LD HL,$EB64 The shifted shapes five.
F82C EXX Switch to the alternate registers.
F82D LD HL,$E5D7 The second shape description.
F830 CALL BuildShiftedShapeA Call BuildShiftedShapeA.
The last three descriptions are built with the flag at HorizontalStepSize set.
F833 OR %11111111 Set the bits of A that are set in FF.
F835 LD ($5C25),A The last shapes are built back to front.
F838 LD HL,$EDE0 The shifted shapes seven.
F83B EXX Switch to the alternate registers.
F83C LD HL,$E62D The third shape description.
F83F CALL BuildShiftedShapeB Call BuildShiftedShapeB.
F842 LD HL,$EE9A The shifted shapes eight.
F845 EXX Switch to the alternate registers.
F846 LD HL,$E669 The fifth shape description.
F849 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
F84C LD HL,$EFB1 The shifted shapes nine.
F84F EXX Switch to the alternate registers.
F850 LD HL,$E6DD The seventh shape description.
F853 JP BuildShiftedShapeB Jump to BuildShiftedShapeB.
Prev: F6B9 Up: Map Next: F856