Prev: F8B9 Up: Map Next: F9A4
F93A: Asteroids : Check for player's movement
Used by the routine at EDF7.
F93A CALL $B03C Was 'left' pressed?
F93D OR A
F93E JR Z,$F94E Jump forward if it wasn't.
'left' was pressed, so rotate anticlockwise.
F940 DEC (IY+$00) Decrement the graphic used for the player.
F943 LD A,(IY+$00) If it's now 6D past the end of usable sprites, set it to the maximum of 75.
F946 CP $6D
F948 JR NZ,$F94E
F94A LD (IY+$00),$75
F94E CALL $B00B Was 'right' pressed?
F951 OR A
F952 JR Z,$F962 Jump forward if it wasn't.
'right' was pressed, so rotate clockwise.
F954 INC (IY+$00) Increment the graphic used for the player.
F957 LD A,(IY+$00) If it's now 75 past the end of usable sprites, set it to the minimum of 6E.
F95A CP $76
F95C JR NZ,$F962
F95E LD (IY+$00),$6E
F962 CALL $ABD7 Was 'in' pressed?
F965 OR A
F966 JR Z,$F994 Jump forward if it wasn't.
'in' was pressed, so move forward.
F968 CALL $F9A4 Put the change in co-ordinates in HL.
F96B LD A,(IY+$05) Get the x co-ordinate.
F96E ADD A,(HL) Add the offset (may be negative).
F96F JR NZ,$F975 If the x co-ordinate is 0, wrap around to EE.
F971 LD A,$EE
F973 JR $F97B
F975 CP $F0 If the x co-ordinate is F0 wrap around to 02.
F977 JR NZ,$F97B
F979 LD A,$02
F97B LD (IY+$05),A Set the new x co-ordinate.
F97E INC HL Move to the next position in the table.
F97F LD A,(IY+$0A) Get the y co-ordinate
F982 ADD A,(HL) Add the offset (may be negative).
F983 CP $40 If the y co-ordinate is 40 wrap around to AC.
F985 JR NZ,$F98B
F987 LD A,$AC
F989 JR $F991
F98B CP $AE If the y co-ordinate is AE wrap around to 42.
F98D JR NZ,$F991
F98F LD A,$42
F991 LD (IY+$0A),A Set the new y co-ordinate.
F994 LD L,(IY+$05) Set the co-ordinates as the location to draw. (A838)
F997 LD H,(IY+$0A)
F99A LD ($A838),HL
F99D LD A,(IY+$00) Use the current sprite ID for the player.
F9A0 CALL $A83D Draw it and return.
F9A3 RET
Prev: F8B9 Up: Map Next: F9A4