Prev: A83A Up: Map Next: A884
A859: Controller: Yes/ No
Used by the routine at Player_Name.
Controller_Yes_No A859 CALL Handler_Debounce_Controls Call Handler_Debounce_Controls.
Produce a short pause.
Controller_Yes_No_Loop A85C LD B,$0A B=0A.
Controller_Yes_No_Pause A85E HALT Halt operation (suspend CPU until the next interrupt).
A85F DJNZ Controller_Yes_No_Pause Decrease counter by one and loop back to Controller_Yes_No_Pause until counter is zero.
Fetch player input.
A861 CALL Handler_Controls Call Handler_Controls.
A864 LD A,E A=E.
Was "up" pressed?
A865 CP $18 Jump to Controller_Yes_No_Action if A is 18.
A867 JR Z,Controller_Yes_No_Action
Was "down" pressed?
A869 CP $08 Jump to Controller_Yes_No_Action if A is 08.
A86B JR Z,Controller_Yes_No_Action
Was "fire" not pressed?
A86D CP $80 Jump to Controller_Yes_No_Loop if A is not 80.
A86F JR NZ,Controller_Yes_No_Loop
Pressing "fire" exits/ sets the value.
A871 RET Return.
Flip bit 5 of A (20) using XOR with *Game_Flags.
Controller_Yes_No_Action A872 LD HL,$AB8A Flip bit 5 of Game_Flags.
A875 LD A,%00100000
A877 XOR (HL)
A878 LD (HL),A
Update the text on the screen to reflect the players choice.
A879 CALL Handler_Yes_No Call Handler_Yes_No.
A87C LD BC,$0080 BC=0080.
A87F CALL PressAnyKey_1 Call PressAnyKey_1.
A882 JR Controller_Yes_No Jump to Controller_Yes_No.
Prev: A83A Up: Map Next: A884