Prev: 8479 Up: Map Next: 84D5
849D: Initialise New Game
Used by the routine at GameInitialise.
Clears the 1UP/ 2UP game data for:
Initialise_NewGame 849D LD HL,$8C30 Start at 1UP_Location (stored in HL), as the player name is retained (probably as it's a pain to enter!)
84A0 LD B,$08 Set a counter in B for 08 bytes (02 for location, 03 for score, 02 for cash balance and 01 for player state).
Loop through the player variables and reset them all to 00, ready for the new game.
Clear1UPStats_Loop 84A2 LD (HL),$00 Write 00 to *HL.
84A4 INC HL Increment HL by one.
84A5 DJNZ Clear1UPStats_Loop Decrease counter by one and loop back to Clear1UPStats_Loop until counter is zero.
Set the initial location for when the game starts.
84A7 LD DE,$8E82 Write London_Location to *1UP_Location.
84AA LD ($8C30),DE
Set the starting cash amount.
84AE LD HL,$0250 Write 0250 to *1UP_Cash.
84B1 LD ($8C35),HL
Copy all the same 1UP data to 2UP.
84B4 LD HL,$8C30 Copy 0008 bytes of data from 1UP_Location to 2UP_Location.
84B7 LD DE,$8C40
84BA LD BC,$0008
84BD LDIR
Set the active player to 1UP.
84BF LD HL,$8C28 Write 1UP_Name to *Pointer_ActivePlayer.
84C2 LD ($EFF2),HL
Set the 1UP default state (and also 2UP if this is a two player game).
84C5 LD A,$81 Write 10000001 to *1UP_State.
84C7 LD ($8C37),A
84CA LD HL,$EFFB Return if this is not a two player game.
84CD BIT 5,(HL)
84CF RET Z
84D0 INC A Write 10000010 to *2UP_State.
84D1 LD ($8C47),A
84D4 RET Return.
Prev: 8479 Up: Map Next: 84D5