Prev: 62219 Up: Map Next: 62366
62225: Reset Life
Used by the routine at PrepareLife.
Resets everything for the start of a life: the colour of the ship, the explosion, the shield timer and some other counters, the stars, the shots and the saved copies of the flame objects. The ship object at ShipObject is restored from the state at ShipStartState and all the enemy and map object slots are freed.
ResetLife 62225 LD A,71 A=71.
62227 LD (61953),A The ship starts white.
62230 XOR A Clear A.
62231 LD (36691),A Update the ship state.
62234 LD (35183),A Update the falling timer.
62237 LD (38571),A Update the crystal-delivery flag.
62240 LD (36803),A The damage counter.
62243 LD (49786),A No piece has been drawn yet.
62246 LD (34805),A The bonus timer.
62249 LD A,24 A=24.
62251 LD (40239),A Update the beam hit delay.
62254 LD HL,49386 The star positions.
62257 LD B,18 B=18.
ResetLife_Stars 62259 LD A,(HL) Read HL.
62260 AND %11111110 Keep the bits of A that are set in 254.
62262 LD (HL),A Write A where HL points.
62263 INC HL Advance HL.
62264 INC HL Advance HL.
62265 DJNZ ResetLife_Stars Decrease B and jump to ResetLife_Stars until none remain.
62267 LD HL,45946 The shot slots.
62270 LD B,96 B=96.
62272 CALL ClearBytes Call ClearBytes.
62275 LD HL,38576 The crystal-stack table.
62278 LD B,8 B=8.
ResetLife_Entries 62280 LD (HL),0 Store 0 at the address in HL.
62282 LD A,5 A=5.
62284 CALL AddAToHL Call AddAToHL.
62287 DJNZ ResetLife_Entries Decrease B and jump to ResetLife_Entries until none remain.
62289 LD HL,40259 The beam table.
62292 LD B,16 B=16.
62294 CALL ClearBytes Call ClearBytes.
62297 LD DE,51132 The ship top object.
62300 LD HL,51138 The other player's ship top.
62303 LD BC,6 BC=6.
62306 LDIR Copy BC bytes from HL to DE.
62308 LD DE,51087 The main flame object.
62311 LD HL,51093 The other player's main flame.
62314 LD C,6 C=6.
62316 LDIR Copy BC bytes from HL to DE.
62318 LD DE,50882 The side flame object.
62321 LD HL,50889 The other player's side flame.
62324 LD C,7 C=7.
62326 LDIR Copy BC bytes from HL to DE.
62328 LD C,32 C=32.
62330 LD DE,51429 The ship.
62333 LD HL,51462 The ship start state.
62336 LDIR Copy BC bytes from HL to DE.
ResetLife_Slots 62338 LD IX,39284 The enemy slots.
62342 LD B,9 B=9.
62344 LD DE,24 DE=24.
62347 CALL ResetLife_FreeSlot Call ResetLife_FreeSlot.
62350 LD IX,43019 The map object slots.
62354 LD E,26 E=26.
62356 LD B,6 B=6.
ResetLife_FreeSlot 62358 CALL FreeObjectSlot Call FreeObjectSlot.
62361 ADD IX,DE IX gains DE.
62363 DJNZ ResetLife_FreeSlot Decrease B and jump to ResetLife_FreeSlot until none remain.
62365 RET Return.
Prev: 62219 Up: Map Next: 62366