| Chase H.Q. | Routines |
| Prev: 87DC | Up: Map | Next: 88D5 |
|
Discards the user's input outright during a fade transition (transition_control 4). Otherwise it masks user_input with the stage's input mask and dispatches on the top three bits: quit starts the quit sequence at check_user_input_quit_key, pause spins until the key is released and then waits for any key before debouncing, and turbo arms 60 ticks of boost and starts the turbo chatter — but only if no boost is running and boosts remain.
Used by the routine at main_loop.
|
||||
| check_user_input | 8876 | LD A,($A231) | Load transition_control | |
| 8879 | LD HL,$A0D5 | Load address of user_input | ||
| 887C | CP $04 | Ignore the user's input if transition_control is set to 4 | ||
| 887E | JR NZ,check_user_input_0 | |||
| 8880 | LD (HL),$00 | Clear user_input | ||
| 8882 | RET | Return | ||
| check_user_input_0 | 8883 | LD A,($A16F) | AND user_input with user input mask | |
| 8886 | AND (HL) | |||
| 8887 | LD (HL),A | |||
| 8888 | AND $E0 | AND with mask for (Quit+Pause+Turbo), return if none | ||
| 888A | RET Z | |||
| 888B | RLA | Quit bit set? Jump to quit_key if so | ||
| 888C | JR C,check_user_input_quit_key | |||
| 888E | RLA | Pause bit set? Jump to pause_key if so | ||
| 888F | JR C,cui_pause_key | |||
|
Turbo was pressed
|
||||
| 8891 | LD HL,$A24E | Load address of boost timer | ||
| 8894 | LD A,(HL) | Return if a turbo boost is in effect | ||
| 8895 | AND A | |||
| 8896 | RET NZ | |||
| 8897 | LD A,($A170) | Return if no turbo boosts are left | ||
| 889A | AND A | |||
| 889B | RET Z | |||
| 889C | LD (HL),$3C | Set 60 ticks of boost | ||
| 889E | LD HL,$9917 | HL -> Random choice of (WHOAAAAA! / GREAT! / ONE MORE TIME.) | ||
| 88A1 | LD A,$02 | Call start_chatter (priority 2) | ||
| 88A3 | CALL start_chatter | |||
| 88A6 | JP setup_engine_sfx_hook | Exit via setup_engine_sfx_hook | ||
|
This entry point is used by the routine at check_time_up.
|
||||
| check_user_input_quit_key | 88A9 | LD A,($A26A) | If quit_state != 0 then return (quit in progress) | |
| 88AC | AND A | |||
| 88AD | RET NZ | |||
| 88AE | CALL drive_chatter_stop | Call drive_chatter_stop | ||
| 88B1 | CALL fill_attributes | Call fill_attributes | ||
| 88B4 | LD ($A16F),A | user_input_mask = 0 -- A is zero from fill_attributes | ||
| 88B7 | INC A | |||
| 88B8 | LD ($A26A),A | quit_state = 1 -- start quitting | ||
| 88BB | RET | Return | ||
| cui_pause_key | 88BC | CALL silence_audio_hook | Call silence_audio_hook | |
| check_user_input_1 | 88BF | CALL keyscan | Call keyscan while PAUSE is pressed | |
| 88C2 | AND $40 | |||
| 88C4 | JR NZ,check_user_input_1 | |||
| check_user_input_2 | 88C6 | CALL keyscan | Call keyscan until keys are pressed (ignoring quit) | |
| 88C9 | AND $7F | |||
| 88CB | JR Z,check_user_input_2 | |||
| check_user_input_3 | 88CD | CALL keyscan | Call keyscan until keys are released (debounce) | |
| 88D0 | AND $7F | |||
| 88D2 | JR NZ,check_user_input_3 | |||
| 88D4 | RET | Return | ||
| Prev: 87DC | Up: Map | Next: 88D5 |