Skip to content

Commit eb3d967

Browse files
committed
rename some labels
1 parent 2ab72f5 commit eb3d967

File tree

6 files changed

+38
-38
lines changed

6 files changed

+38
-38
lines changed

src/gamemode/gametypemenu/menu.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ menuYTmp := tmp2
552552
jsr menuItemY16Offset
553553
bne @loopNext
554554
@doRender:
555-
lda crashMode
555+
lda crashModifier
556556
cmp #CRASH_OFF
557557
bne @notOff
558558
lda #$F1

src/nmi/nmi.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ nmi: pha
2626
jsr copyCurrentScrollAndCtrlToPPU
2727
jsr pollControllerButtons
2828
lda #$00
29-
sta lagFlag ; clear flag after lag frame achieved
29+
sta lagState ; clear flag after lag frame achieved
3030
.if KEYBOARD
3131
; Read Family BASIC Keyboard
3232
jsr pollKeyboard

src/nmi/render_mode_play_and_demo.asm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ render_mode_play_and_demo:
2020
and #$01
2121
beq @renderLevel
2222

23-
ldx #lines_old-lines
24-
lda lagFlag
23+
ldx #linesPrev-lines
24+
lda lagState
2525
and #$02
2626
bne @doLinesRender
2727
ldx #$00
@@ -60,8 +60,8 @@ render_mode_play_and_demo:
6060
sta PPUADDR
6161
lda #$B9
6262
sta PPUADDR
63-
ldx #level_old-levelNumber
64-
lda lagFlag
63+
ldx #levelPrev-levelNumber
64+
lda lagState
6565
and #$01
6666
bne @doLevelRender
6767
ldx #$00
@@ -102,10 +102,10 @@ render_mode_play_and_demo:
102102
; 3 added in float
103103

104104
; scorecap
105-
lda crashMode
105+
lda crashModifier
106106
cmp #CRASH_SHOW
107107
bne @noCrash
108-
lda crashFlag
108+
lda crashState
109109
cmp #$F0
110110
bne @noCrash
111111

@@ -307,8 +307,8 @@ rightColumns:
307307
.byte $05,$06,$07,$08,$09
308308
; Set Background palette 2 and Sprite palette 2
309309
updatePaletteForLevel:
310-
ldx #level_old-levelNumber
311-
lda lagFlag
310+
ldx #levelPrev-levelNumber
311+
lda lagState
312312
and #$01
313313
bne @loadLevelNumber
314314
ldx #$00

src/playstate/preparenext.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ playState_prepareNext:
4747
ldx #<haltEndingGraphic
4848
ldy #>haltEndingGraphic
4949

50-
lda crashFlag ; LINECAP_HALT set in testCrash
50+
lda crashState ; LINECAP_HALT set in testCrash
5151
cmp #$F0
5252
bne @nonCrash
5353
ldx #<crashGraphic

src/playstate/updatestats.asm

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ playState_updateLinesAndStatistics:
4343

4444
ldx completedLines
4545
lda lines
46-
sta lines_old
46+
sta linesPrev
4747
lda lines+1
48-
sta lines_old+1
48+
sta linesPrev+1
4949
incrementLines:
5050
inc lines
5151
lda lines
5252
and #$0F
5353
cmp #$0A
5454
bmi checkLevelUp
55-
inc crashFlag
55+
inc crashState
5656
lda lines
5757
clc
5858
adc #$06
@@ -64,9 +64,9 @@ incrementLines:
6464
and #$0F
6565
sta lines
6666
inc lines+1
67-
lda crashFlag
67+
lda crashState
6868
ora #$02
69-
sta crashFlag
69+
sta crashState
7070

7171
checkLevelUp:
7272
jsr calcBCDLinesAndTileQueue
@@ -104,11 +104,11 @@ checkLevelUp:
104104

105105
@nextLevel:
106106
lda levelNumber
107-
sta level_old
107+
sta levelPrev
108108
inc levelNumber
109-
lda crashFlag
109+
lda crashState
110110
ora #$08
111-
sta crashFlag
111+
sta crashState
112112
lda #$06 ; checked in floor linecap stuff, just below
113113
sta soundEffectSlot1Init
114114
lda outOfDateRenderFlags
@@ -192,7 +192,7 @@ addPoints:
192192
sta completedLines
193193
@notTapQuantity:
194194

195-
lda crashMode
195+
lda crashModifier
196196
cmp #CRASH_OFF
197197
beq @crashDisabled
198198
jsr testCrash
@@ -540,21 +540,21 @@ testCrash:
540540
adc allegroIndex
541541
sta allegroIndex
542542
@digit1:
543-
lda crashFlag
543+
lda crashState
544544
and #$01
545545
beq @digit2
546546
lda #$4F ; add 79 cycles for lines 10s place
547547
adc allegroIndex
548548
sta allegroIndex
549549
@digit2:
550-
lda crashFlag
550+
lda crashState
551551
and #$02
552552
beq @newLevel
553553
lda #$0C ; add 12 cycles for lines 100s place
554554
adc allegroIndex
555555
sta allegroIndex
556556
@newLevel:
557-
lda crashFlag
557+
lda crashState
558558
and #$08
559559
beq @pushDown
560560
lda #$12 ; 18 cycles for levelup
@@ -617,7 +617,7 @@ testCrash:
617617
sta factorA24+2
618618
sta factorB24+1
619619
sta factorB24+2
620-
sta crashFlag ; unrelated to current routine, just needed to clear the flag and $00 was loaded.
620+
sta crashState ; unrelated to current routine, just needed to clear the flag and $00 was loaded.
621621
jsr unsigned_mul24 ; result in product24
622622
clc
623623
lda product24
@@ -697,7 +697,7 @@ testCrash:
697697
cmp #$31 ; gap
698698
bcs @continue
699699
lda #$F0
700-
sta crashFlag ; F0 means standard crash.
700+
sta crashState ; F0 means standard crash.
701701
jmp @crashGraphics ;too far to branch
702702
@continue:
703703
cmp #$36
@@ -717,7 +717,7 @@ testCrash:
717717
jmp @allegroClear ;allegroClear is basically return, just clears the variable first.
718718
@notRed:
719719
lda #$F0
720-
sta crashFlag
720+
sta crashState
721721
jmp @crashGraphics ;triggering crash in all other cases
722722

723723
@nextSwitch:
@@ -753,7 +753,7 @@ testCrash:
753753
bcs @nextCheck
754754
@confettiA:
755755
lda #$E0 ;E0 = limited confetti
756-
sta crashFlag
756+
sta crashState
757757
jmp confettiHandler
758758
@nextCheck:
759759
;levellag at 30877 = 0x789D
@@ -766,7 +766,7 @@ testCrash:
766766
bcc @allegroClear
767767
@levelLag:
768768
lda #$01
769-
sta lagFlag
769+
sta lagState
770770
;linelag at 31072 = 0x7960
771771
lda cycleCount
772772
cmp #$79;high byte min
@@ -777,7 +777,7 @@ testCrash:
777777
bcc @allegroClear
778778
@lineLag:
779779
lda #$03
780-
sta lagFlag
780+
sta lagState
781781
;confettiB at 31327-31755 7A5F-7C0B
782782
lda cycleCount
783783
cmp #$7A ;high byte min
@@ -795,12 +795,12 @@ testCrash:
795795
bcs @allegroClear
796796
@confettiB:
797797
lda #$D0 ;D0 = infinite confetti
798-
sta crashFlag
798+
sta crashState
799799
jmp confettiHandler
800800
@allegroClear:
801801
lda #$00 ;reset allegro flag and return to program execution, no crash
802802
sta allegroIndex
803-
lda lagFlag
803+
lda lagState
804804
beq @noLag ;if lag should happen, wait a frame here so that sprite staging doesn't happen.
805805
lda #$00
806806
sta verticalBlankingInterval
@@ -811,7 +811,7 @@ testCrash:
811811
@crashGraphics:
812812
lda #$00
813813
sta allegroIndex ; resetting variable
814-
lda crashMode
814+
lda crashModifier
815815
bne @otherMode
816816
lda outOfDateRenderFlags ; if mode = 0, tell score to update (might not be necessary?) so that crash info is printed
817817
ora #$04
@@ -835,7 +835,7 @@ sumTable:
835835
switchTable:
836836
.byte $3C, $77, $3C, $65, $3C, $66, $3C;60 119 60 101 60 102 60 gets read in reverse
837837
confettiHandler:
838-
lda crashFlag ;E0 = confetti exits if [framecounter = 255 && controller != BDLR] or controller = AS
838+
lda crashState ;E0 = confetti exits if [framecounter = 255 && controller != BDLR] or controller = AS
839839
cmp #$E0
840840
bne @infiniteConfetti
841841
lda heldButtons_player1

src/ram.asm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tmpBulkCopyToPpuReturnAddr: .res 2 ; $0006 ; 2 bytes
1212
binScore: .res 4 ; $8 ; 4 bytes binary
1313
score: .res 4 ; $C ; 4 bytes BCD
1414
nmiReturnAddr: .res 1 ; $0010 ; used for crash
15-
crashFlag: .res 1 ; $0011 ; used for crash
15+
crashState: .res 1 ; $0011 ; used for crash
1616
cycleCount: .res 2 ; $0012 ; 2 bytes ; used for crash
1717
oneThirdPRNG: .res 1 ; $0014 ; used for crash
1818
.res $2
@@ -25,7 +25,7 @@ pointerAddrB: .res 2 ; $001D ; used in harddrop
2525
allegroIndex: .res 1 ; $001F for crash
2626
wasAllegro: .res 1 ; $0020 for crash
2727
startParity: .res 1 ; $0021 for crash
28-
lagFlag: .res 1 ; $0022 for lagged lines & score
28+
lagState: .res 1 ; $0022 for lagged lines & score
2929
.res $10
3030

3131
verticalBlankingInterval: .res 1 ; $0033
@@ -58,8 +58,8 @@ garbageHole: .res 1 ; $0059 ; Position of hole in receive
5858
garbageDelay: .res 1 ; $005A
5959
pieceTileModifier: .res 1 ; $005B ; above $80 - use a single one, below - use an offset
6060
curtainRow: .res 1 ; $5C
61-
lines_old: .res 2 ; $5D-E ; used for delayed draw at high levels
62-
level_old: .res 1 ; $5F
61+
linesPrev: .res 2 ; $5D-E ; used for delayed draw at high levels
62+
levelPrev: .res 1 ; $5F
6363

6464
mathRAM: .res $12
6565
binary32 := mathRAM+$0
@@ -349,6 +349,6 @@ linecapFlag: .res 1
349349
dasOnlyFlag: .res 1
350350
qualFlag: .res 1
351351
palFlag: .res 1
352-
crashMode: .res 1
352+
crashModifier: .res 1
353353

354354
; ... $7FF

0 commit comments

Comments
 (0)