Prev: 60FE Up: Map Next: 6272
623F: Move Marker
Used by the routine at ShowTitleMenu.
Moves the marker of one player, in the title menu, towards the control method option that is chosen. When the marker has reached the option, the key of the player ("1" or "2") chooses the next option. The marker moves down by one pixel at a time and up by four pixels at a time.
Input
IX The record of the marker (see MarkerRecords)
E The bit of the key of the player: 01 for "1" and 02 for "2"
MoveMarker 623F LD A,(IX+$02) Fetch the number of the chosen option from the record of the marker and keep it in B.
6242 LD B,A
6243 LD HL,$627B Point HL at the table of the vertical positions of the options at OptionPositions.
6246 CALL AddToAddress Add the number of the option to find its position.
6249 LD C,(HL) Fetch the position of the option into C.
624A LD A,C Copy it into A.
624B SUB (IX+$01) Subtract the current position of the marker.
624E JR NZ,MoveMarker_Step Jump to MoveMarker_Step if the marker has not reached the option.
6250 LD A,$F7 Read from the keyboard;
Port Number Bit
0 1 2 3 4
F7 1 2 3 4 5
6252 CALL ReadKeyboard
6255 AND E Test the bit of the key of the player.
6256 JR Z,MoveMarker_Step Jump to MoveMarker_Step if the key is not being pressed.
6258 LD A,B Fetch the number of the chosen option again.
6259 INC A Move onto the next option.
625A AND %00000011 Keep the number in the range 00-03.
625C LD (IX+$02),A Store the new number of the option in the record of the marker.
625F LD HL,$627B Point HL at OptionPositions.
6262 CALL AddToAddress Add the number of the option to find its position.
6265 LD C,(HL) Fetch the position of the new option into C.
MoveMarker_Step 6266 LD A,C Copy the position of the option into A.
6267 SUB (IX+$01) Subtract the current position of the marker.
626A RET Z Return if the marker is at the option.
626B RLA Rotate the sign of the difference into the carry flag.
626C JR C,MoveMarkerUp Jump to MoveMarkerUp if the option is above the marker.
626E INC (IX+$01) Move the marker down by one pixel.
6271 RET Return.
Prev: 60FE Up: Map Next: 6272