Prev: 32771 Up: Map Next: 32853
32826: Initialise Location States
Used by the routine at GameInitialise.
Start with Madrid, as it's the first location in the table Trashman can travel to (London doesn't count, that's the first game!)
Initialise_LocationStates 32826 LD HL,36522 Set a pointer in HL for the first location state: Madrid_State.
32829 LD DE,17 Set 0017 in DE, which is the count of data before the location name starts. The location names vary in length but the data for them does not.
32832 LD B,13 Set a counter in B of the number of locations which have a playable level for Trashman (13 - one less than the total which includes London).
Initialise_LocationState 32834 LD (HL),0 Mark this location as: "Not visited".
Keep moving forward one byte until the termination bit is found, signifying the final character of the location name.
FindEndCharacter_Loop 32836 INC HL Increment HL by one.
32837 BIT 7,(HL) Jump to FindEndCharacter_Loop if the terminator bit is not set.
32839 JR Z,FindEndCharacter_Loop
32841 ADD HL,DE Move HL to point to the next location state.
32842 DJNZ Initialise_LocationState Decrease the location counter by one and loop back to Initialise_LocationState until all of the location states have been processeed.
32844 LD A,(61435) Reset all the bits in *GameState_2 except for the 1UP/ 2UP choice.
32847 AND %00100000
32849 LD (61435),A
32852 RET Return.
Prev: 32771 Up: Map Next: 32853