File tree Expand file tree Collapse file tree 2 files changed +37
-6
lines changed Expand file tree Collapse file tree 2 files changed +37
-6
lines changed Original file line number Diff line number Diff line change @@ -96,10 +96,18 @@ pause:
96
96
lda newlyPressedButtons_player1
97
97
cmp #$10
98
98
beq @resume
99
+ @stayPaused:
99
100
jsr updateAudioWaitForNmiAndResetOamStaging
100
101
jmp @pauseLoop
101
102
102
103
@resume:
104
+ ; Stay paused if invalid debug position
105
+ lda debugFlag
106
+ beq @validPosition
107
+ jsr isPositionValid
108
+ beq @validPosition
109
+ jmp @stayPaused
110
+ @validPosition:
103
111
lda #$1E
104
112
sta PPUMASK
105
113
lda #$00
Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ debugSelectMenuControls:
39
39
lda debugLevelEdit
40
40
eor #1
41
41
sta debugLevelEdit
42
+ ; Don't switch if invalid position
43
+ bne @skipDebugType
44
+ jsr isPositionValid
45
+ beq @skipDebugType
46
+ inc debugLevelEdit
42
47
@skipDebugType:
43
48
44
49
jsr checkSaveStateControlsDebug
@@ -108,21 +113,37 @@ debugContinue:
108
113
jsr menuThrottle
109
114
beq @notPressedUp
110
115
dec tetriminoY
116
+ bpl @notPressedUp
117
+ lda #$13
118
+ sta tetriminoY
111
119
@notPressedUp:
112
120
lda #BUTTON_DOWN
113
121
jsr menuThrottle
114
122
beq @notPressedDown
115
123
inc tetriminoY
124
+ lda tetriminoY
125
+ cmp #$14
126
+ bne @notPressedDown
127
+ lda #$00
128
+ sta tetriminoY
116
129
@notPressedDown:
117
130
lda #BUTTON_LEFT
118
131
jsr menuThrottle
119
132
beq @notPressedLeft
120
133
dec tetriminoX
134
+ bpl @notPressedLeft
135
+ lda #$09
136
+ sta tetriminoX
121
137
@notPressedLeft:
122
138
lda #BUTTON_RIGHT
123
139
jsr menuThrottle
124
140
beq @notPressedRight
125
141
inc tetriminoX
142
+ lda tetriminoX
143
+ cmp #$0A
144
+ bne @notPressedRight
145
+ lda #$00
146
+ sta tetriminoX
126
147
@notPressedRight:
127
148
128
149
; check mode
@@ -152,19 +173,21 @@ debugContinue:
152
173
lda newlyPressedButtons_player1
153
174
and #BUTTON_B
154
175
beq @notPressedB
155
- lda currentPiece
156
- cmp #$1
157
- bmi @notPressedB
158
176
dec currentPiece
177
+ bpl @notPressedB
178
+ lda #$12
179
+ sta currentPiece
159
180
@notPressedB:
160
181
161
182
lda newlyPressedButtons_player1
162
183
and #BUTTON_A
163
184
beq @notPressedA
164
- lda currentPiece
165
- cmp #$12
166
- bpl @notPressedA
167
185
inc currentPiece
186
+ lda currentPiece
187
+ cmp #$13
188
+ bne @notPressedA
189
+ lda #$00
190
+ sta currentPiece
168
191
@notPressedA:
169
192
170
193
; handle piece
You can’t perform that action at this time.
0 commit comments