Prev: C1AC Up: Map Next: C279
C1CE: Draw the slab-and-spire load on top of the ship, or put it down on the surface
Used by the routines at draw_rocket, draw_ship and play.
The load the ship picks up as an object of kind 9 (collect_pickup sets +$10 of the player's record, player_count_nine, to 9) is the slab and the spire, add-ons 10 and 11 (addon_slab_picture, addon_spire_picture), and rides on top of it in two pieces, 5 bytes wide by $23 rows and 3 wide by $2F rows, drawn by draw_carried_piece at fixed places above the ship: the slab's bottom line $0D above ship_line, which is five lines above the top of the ship's picture, and the spire's $23 higher, standing on the slab. When the ship comes down to the surface (the view's map row, +4 of the ship record, is $0B, the lowest row of the surface above the caverns, and its y in the page is $A7 or more) the load is let go: it is erased and becomes two objects, of kinds 9 and 10, the slab and the spire (place_dropped_part), at the ship's place in the world, the second $10 pixels right and $23 rows up.
Called on even passes from draw_ship, every pass of the death sequence (play) and from draw_rocket. Nothing here ran in the build's sessions (+$10 of the player's record was always zero), so this is read only.
carried_part C1CE LD A,(player_count_nine) Nothing carried: return.
C1D1 AND A
C1D2 RET Z
C1D3 LD A,(view_page_row) Not yet down on the surface: just draw it.
C1D6 CP $0B
C1D8 JP NZ,carried_part_0
C1DB LD A,(view_page_y)
C1DE CP $A7
C1E0 JP C,carried_part_0
C1E3 LD A,(carried_part_facing) Let go: bit 6 of carried_part_facing makes draw_carried_piece erase it and not draw it again; nothing is carried any more, and the ship record's +$1F is cleared.
C1E6 OR $40
C1E8 LD (carried_part_facing),A
C1EB XOR A
C1EC LD (player_count_nine),A
C1EF LD (part_being_fitted),A
C1F2 LD A,(view_page_row) The view's map cell (column in E, row in D) for both new objects (at +$41 and +$45 of the player's record, score).
C1F5 LD D,A
C1F6 LD A,(view_page_column)
C1F9 LD E,A
C1FA LD (place_nine),DE
C1FE LD (place_ten),DE
C202 LD A,(ship_line) The first piece's y in the cell from the ship's screen row (ship_line) and its screen y (ship_screen_y); its x the view's x plus 8, rounded down to 8.
C205 SUB $0D
C207 LD B,A
C208 LD A,(ship_screen_y)
C20B SUB B
C20C LD B,A
C20D LD A,(view_page_y)
C210 SUB B
C211 LD H,A
C212 LD A,(view_page_x)
C215 ADD A,$08
C217 AND $F8
C219 LD L,A
C21A LD ($F62A),HL
C21D LD A,L The second piece $10 to the right and $23 higher.
C21E ADD A,$10
C220 LD L,A
C221 LD A,H
C222 SUB $23
C224 LD H,A
C225 LD ($F62E),HL
C228 LD HL,place_nine Make them objects of kinds 9 and 10, in the two object records loaded into IX.
C22B LD IX,pickup_record
C22F LD B,$09
C231 CALL place_dropped_part
C234 LD IX,second_pickup_record
C238 LD HL,place_ten
C23B LD B,$0A
C23D CALL place_dropped_part
carried_part_0 C240 LD IX,carried_big_x The 5-wide piece: its graphic, old and new widths 5, no erase unless draw_carried_piece decides on one, $23 rows; its place kept at carried_big_x.
C244 LD DE,addon_slab_picture
C247 LD HL,$0505
C24A LD (sprite_width),HL
C24D LD HL,$2300
C250 LD (scratch_count),HL
C253 CALL draw_carried_piece
C256 LD IX,carried_small_x The 3-wide piece: its graphic, widths 3, $2F rows; its place kept at carried_small_x.
C25A LD DE,addon_spire_picture
C25D LD HL,$0303
C260 LD (sprite_width),HL
C263 LD HL,$2F00
C266 LD (scratch_count),HL
C269 CALL draw_carried_piece
C26C LD A,(ship_facing) Remember the facing it was drawn with; the forced redraw is done.
C26F LD (carried_part_facing),A
C272 XOR A
C273 LD (carried_part_redraw),A
C276 JP colour_carried_parts The colour patches over the two pieces (colour_carried_parts).
Prev: C1AC Up: Map Next: C279