Prev: A8A5 Up: Map Next: A8F4
A8D9: 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 A8D9 LD HL,$F6BB Use the buffer.
A8DC LD DE,$7721 Use the graphic of the stack.
A8DF LD A,($C905) Fetch the height of the stack.
A8E2 AND A Return if the stack is empty.
A8E3 RET Z
A8E4 LD B,A Use the height as a counter.
BuildStackGraphic_Loop A8E5 LD A,(DE) Copy a row of the stack...
A8E6 LD (HL),A Write A where HL points.
A8E7 INC DE Advance DE.
A8E8 INC HL Advance HL.
A8E9 LD A,(DE) ...two bytes wide.
A8EA LD (HL),A Write A where HL points.
A8EB INC DE Advance DE.
A8EC LD A,$05 Move on to the next row of the buffer.
A8EE CALL AddAToHL Call AddAToHL.
A8F1 DJNZ BuildStackGraphic_Loop Loop back to BuildStackGraphic_Loop for each row.
A8F3 RET Return.
Prev: A8A5 Up: Map Next: A8F4