Prev: 43173 Up: Map Next: 43252
43225: Build Stack Graphic
Used by the routines at BuildShip and BeginLife.
Builds the graphic of the stack that hangs below the ship, as a sprite that is two bytes wide in a buffer with seven bytes to a row, by copying one row of the stack for each unit of its height. This is a best reading of the code.
BuildStackGraphic 43225 LD HL,63163 Use the buffer.
43228 LD DE,30497 Use the graphic of the stack.
43231 LD A,(51461) Fetch the height of the stack.
43234 AND A Return if the stack is empty.
43235 RET Z
43236 LD B,A Use the height as a counter.
BuildStackGraphic_Loop 43237 LD A,(DE) Copy a row of the stack...
43238 LD (HL),A Write A where HL points.
43239 INC DE Advance DE.
43240 INC HL Advance HL.
43241 LD A,(DE) ...two bytes wide.
43242 LD (HL),A Write A where HL points.
43243 INC DE Advance DE.
43244 LD A,5 Move on to the next row of the buffer.
43246 CALL AddAToHL Call AddAToHL.
43249 DJNZ BuildStackGraphic_Loop Loop back to BuildStackGraphic_Loop for each row.
43251 RET Return.
Prev: 43173 Up: Map Next: 43252