.RES2 LDA #NOST \ Reset NOSTM, the number of stardust particles, to the STA NOSTM \ maximum allowed (18) LDX #&FF \ Reset LSX2 and LSY2, the ball line heaps used by the STX LSX2 \ BLINE routine for drawing circles, to &FF, to set the STX LSY2 \ heap to empty STX MSTG \ Reset MSTG, the missile target, to &FF (no target) LDA #128 \ Set the current pitch and roll rates to the mid-point, STA JSTX \ 128 STA JSTY ASL A \ This sets A to 0 STA MCNT \ Reset MCNT (the main loop counter) to 0 STA QQ22+1 \ Set the on-screen hyperspace counter to 0 LDA #3 \ Reset DELTA (speed) to 3 STA DELTA LDA SSPR \ Fetch the "space station present" flag, and if we are BEQ P%+5 \ not inside the safe zone, skip the next instruction JSR SPBLB \ Light up the space station bulb on the dashboard LDA ECMA \ Fetch the E.C.M. status flag, and if E.C.M. is off, BEQ yu \ skip the next instruction JSR ECMOF \ Turn off the E.C.M. sound .yu JSR WPSHPS \ Wipe all ships from the scanner JSR ZERO \ Zero-fill pages &9, &A, &B, &C and &D, which clears \ the ship data blocks, the ship line heap, the ship \ slots for the local bubble of universe, and various \ flight and ship status variables LDA #LO(LS%) \ We have reset the ship line heap, so we now point STA SLSP \ SLSP to LS% (the byte below the ship blueprints at D%) LDA #HI(LS%) \ to indicate that the heap is empty STA SLSP+1 JSR DIALS \ Update the dashboard JSR U% \ Call U% to clear the key logger \ Finally, fall through into ZINF to reset the INWK \ ship workspaceName: RES2 [Show more] Type: Subroutine Category: Start and end Summary: Reset a number of flight variables and workspacesContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DEATH calls RES2 * DEATH2 calls RES2 * ESCAPE calls RES2 * Main flight loop (Part 9 of 16) calls RES2 * MJP calls RES2 * TT110 calls RES2 * TT18 calls RES2
This is called after we launch from a space station, arrive in a new system after hyperspace, launch an escape pod, or die a cold, lonely death in the depths of space.
Returns: Y Y is set to &FF
[X]
Subroutine DIALS (Part 1 of 4) (category: Dashboard)
Update the dashboard: speed indicator
[X]
Subroutine ECMOF (category: Sound)
Switch off the E.C.M.
[X]
Configuration variable LS% = &0CFF
The RSHIPS of the descending ship line heap
[X]
The ball line heap for storing x-coordinates (see the deep dive on The ball line heap for details)
[X]
The ball line heap for storing y-coordinates (see the deep dive on The ball line heap for details)
[X]
Configuration variable NOST = 18
The number of stardust particles in normal space (this goes down to 3 in witchspace)
[X]
Subroutine SPBLB (category: Dashboard)
Light up the space station indicator ("S") on the dashboard
[X]
Subroutine U% (category: Keyboard)
Clear the key logger
[X]
Subroutine WPSHPS (category: Dashboard)
Clear the scanner, reset the ball line and sun line heaps
[X]
Subroutine ZERO (category: Utility routines)
Reset the local bubble of universe and ship status
[X]
Label yu is local to this routine