Prev: B03C Up: Map Next: B09D
B06D: Controls: Jump
Used by the routines at B09F and F8B9.
Output
A 00 for no press and 01 for pressed
Controls_Jump B06D LD A,($B2DB) If Game_Options is zero then jump to Controls_Jump_Keyboard.
B070 OR A
B071 JR Z,Controls_Jump_Keyboard
B073 CP $01 If Game_Options is not 01 then jump to Controls_Jump_Sinclair.
B075 JR NZ,Controls_Jump_Sinclair
Handle Kempston Joystick.
B077 IN A,($1F) Read from Kempston Joystick.
B079 BIT 4,A If bit 4 is set/ "FIRE" is being pressed then jump to Controls_NoPress_Jump.
B07B JR Z,Controls_NoPress_Jump
Key was pressed so return A=01.
Controls_Pressed_Jump B07D LD A,$01 A=01.
B07F RET Return.
Handle Sinclair Joystick.
Controls_Jump_Sinclair B080 LD A,$EF Read from the keyboard;
Port Number Bit
0 1 2 3 4
EF 0 9 8 7 6
B082 IN A,($FE)
B084 BIT 0,A If bit 0 is set jump to Controls_Pressed_Jump.
B086 JR Z,Controls_Pressed_Jump
B088 JR Controls_NoPress_Jump Jump to Controls_NoPress_Jump.
Handle Keyboard controls.
Controls_Jump_Keyboard B08A LD A,$FE Read from the keyboard;
Port Number Bit
0 1 2 3 4
FE SHIFT Z X C V
B08C IN A,($FE)
B08E LD B,A Store the result in B.
B08F LD A,$7F Read from the keyboard;
Port Number Bit
0 1 2 3 4
7F SPACE FULL-STOP M N B
B091 IN A,($FE)
B093 AND B Merge in the bits from B.
Fill in the "blanks".
B094 OR %11100000 Set bits 5-7.
If there's been any keypress at all then A won't be FF.
B096 CP $FF If the result is not FF jump to Controls_Pressed_Jump.
B098 JP NZ,Controls_Pressed_Jump
No key was pressed so return A=00.
Controls_NoPress_Jump B09B XOR A A=00.
B09C RET Return.
Prev: B03C Up: Map Next: B09D