-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandle_input_wait_start.asm
More file actions
87 lines (76 loc) · 1.15 KB
/
handle_input_wait_start.asm
File metadata and controls
87 lines (76 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
handle_input_wait_start:
LDA buttons
CMP #$80
BEQ pressA
CMP #$40
BEQ pressB
CMP #$10
BEQ pressStart
CMP #$20
BEQ pressSelect
CMP #$A0
BEQ pressSelect
CMP #$08
BEQ pressUp
CMP #$04
BEQ pressDown
CMP #$02
BEQ pressLeft
CMP #$01
BEQ pressRight
CMP #$30
BEQ .reset
RTS
.reset:
JMP RESET
pressStart:
LDA timer
STA seed2
LDA timer+1
STA seed2+1
INC gamestate
LDA score_1
STA current_game
JMP handle_input_wait_start_done
pressUp:
pressDown:
pressLeft:
pressRight:
pressA:
pressB:
JMP handle_input_wait_start_done
pressSelect:
LDA gamestate
BEQ handle_input_wait_start_done
JSR sound_game_select
LDA #$0A
STA hi_score_1
LDA gamestate
CMP #$08
BPL .later_select
CMP #$02
BNE handle_input_wait_start_done
JMP .initial_select
.later_select:
LDA #$02
STA gamestate
LDA #$00
STA score_1
STA current_game
.initial_select:
clear_board
LDA score_1
CLC
ADC #$01
STA score_1
CMP #$09
BEQ .back_to_1
JSR load_level_selector_screen
JMP handle_input_wait_start_done
.back_to_1:
LDA #$00
STA score_1
JMP pressSelect
handle_input_wait_start_done:
RTS
.db $FF