Prev: 63161 Up: Map Next: 63574
63467: 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 61710. 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 255.
BuildShapeTables 63467 LD HL,23580 The working variables start here.
63470 LD B,38 B=38.
63472 CALL ClearBytes Call ClearBytes.
63475 XOR A Clear A.
63476 LD (23589),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 63479 LD HL,59210 The shifted shapes one.
63482 EXX Switch to the alternate registers.
63483 LD HL,58955 The fourth shape description.
63486 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
63489 LD HL,59396 The shifted shapes two.
63492 EXX Switch to the alternate registers.
63493 LD HL,59042 The sixth shape description.
63496 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
63499 LD HL,59678 The shifted shapes three.
63502 EXX Switch to the alternate registers.
63503 LD HL,59155 The eighth shape description.
63506 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
63509 LD HL,60566 The shifted shapes six.
63512 EXX Switch to the alternate registers.
63513 LD HL,60512 The shape description.
63516 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
63519 LD HL,60008 The shifted shapes four.
63522 EXX Switch to the alternate registers.
The next two descriptions use the other format.
63523 LD HL,58753 The shape descriptions.
63526 CALL BuildShiftedShapeA Call BuildShiftedShapeA.
63529 LD HL,60260 The shifted shapes five.
63532 EXX Switch to the alternate registers.
63533 LD HL,58839 The second shape description.
63536 CALL BuildShiftedShapeA Call BuildShiftedShapeA.
The last three descriptions are built with the flag at HorizontalStepSize set.
63539 OR %11111111 Set the bits of A that are set in 255.
63541 LD (23589),A The last shapes are built back to front.
63544 LD HL,60896 The shifted shapes seven.
63547 EXX Switch to the alternate registers.
63548 LD HL,58925 The third shape description.
63551 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
63554 LD HL,61082 The shifted shapes eight.
63557 EXX Switch to the alternate registers.
63558 LD HL,58985 The fifth shape description.
63561 CALL BuildShiftedShapeB Call BuildShiftedShapeB.
63564 LD HL,61361 The shifted shapes nine.
63567 EXX Switch to the alternate registers.
63568 LD HL,59101 The seventh shape description.
63571 JP BuildShiftedShapeB Jump to BuildShiftedShapeB.
Prev: 63161 Up: Map Next: 63574