Prev: 942F Up: Map Next: 9489
9443: Prepare Player
Used by the routines at StartGame and HandlerFoodItem.
Work out the sprite ID to use.
Byte Character * 02 Only Bits 4-5 + 08
00 Knight (+ Keyboard) 00 00 Sprite ID: 08
08 Wizard (+ Kempston Joystick) 10 10 Sprite ID: 18
14 Serf (+ Cursor Joystick) 28 20 Sprite ID: 28
PreparePlayer 9443 LD A,($5E00) A=GameOptions * 02.
9446 RLCA
9447 AND %00110000 Keep only bits 4-5 (the base character address) + 08 frames (for the character direction).
9449 ADD A,$08
944B LD ($9488),A Write A to 9488.
Update the current room.
944E LD A,($EA91) Write PlayerRoom to 9482.
9451 LD ($9482),A
9454 LD HL,$9481 Copy 08 bytes of data from 9481 to Player.
9457 LD DE,$EA90
945A LD BC,$0008
945D LDIR
945F LD A,$68
9461 LD ($5E3C),A
9464 LD A,($5E21)
9467 CP $03
9469 JR Z,PreparePlayer_Energy
946B PUSH IX
946D LD IX,$EA90
9471 CALL DrawEntity Call DrawEntity.
9474 POP IX
Set starting energy.
PreparePlayer_Energy 9476 LD A,$F0 Write F0 to PlayerEnergy.
9478 LD ($5E28),A
947B CALL DrawChicken Call DrawChicken.
947E JP DrawLives Jump to DrawLives.
9481 DEFB $66,$00,$00,$60,$68,$47,$FF,$00
Prev: 942F Up: Map Next: 9489