Prev: D1A1 Up: Map Next: D1E2
D1B1: Initialise Player
Used by the routine at InitialiseGame.
Sets up the copy of the player at the start of the game. The player appears in a room that is picked at random from four rooms.
Copy the initial player and pick a start room.
InitialisePlayer D1B1 LD HL,$D1A1 Point HL at the initial data of the player, InitialPlayerData.
D1B4 LD DE,$D161 Point DE at PlayerCopy.
D1B7 LD BC,$0008 Set the number of bytes to 08.
D1BA LDIR Copy the initial data of the legs.
D1BC LD DE,$D181 Point DE at PlayerCopy_TopHalf.
D1BF LD BC,$0008 Set the number of bytes to 08.
D1C2 LDIR Copy the initial data of the top half.
D1C4 LD A,$12 Fetch the graphic number of the legs of a human.
D1C6 LD ($D171),A Store it as the graphic that the legs have when the player appears.
D1C9 LD A,$22 Fetch the graphic number of the top half of a human.
D1CB LD ($D191),A Store it as the graphic that the top half has when the player appears.
D1CE LD A,($5BA0) Fetch the first random seed from RandomSeed1.
D1D1 AND %00000011 Keep two bits.
D1D3 LD L,A Make it an offset.
D1D4 LD H,$00
D1D6 LD BC,$D1E2 Point BC at StartRooms.
D1D9 ADD HL,BC Add the offset.
D1DA LD A,(HL) Fetch the start room.
D1DB LD ($D169),A Set the room of the legs at PlayerCopy_LegsRoom.
D1DE LD ($D189),A Set the room of the top half at PlayerCopy_TopHalfRoom.
D1E1 RET Return.
View the equivalent code in;
Prev: D1A1 Up: Map Next: D1E2