Skip to content

Commit 1cc3d88

Browse files
Merge pull request #65 from zohassadar/floorfix2
Fix linecap floor top row bug
2 parents 59c92c2 + 5d02138 commit 1cc3d88

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

src/gamemodestate/initstate.asm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ gameModeState_initGameState:
4040
sta linecapState
4141
sta dasOnlyShiftDisabled
4242
sta invisibleFlag
43+
sta currentFloor
44+
45+
; initialize currentFloor if necessary
46+
lda practiseType
47+
cmp #MODE_FLOOR
48+
bne @notFloor
49+
lda floorModifier
50+
sta currentFloor
51+
@notFloor:
4352

4453
lda practiseType
4554
cmp #MODE_INVISIBLE

src/modes/floor.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
advanceGameFloor:
2-
lda floorModifier
2+
lda currentFloor
33
drawFloor:
44
; get correct offset
55
sta tmp1

src/playstate/completedrows.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ playState_checkForCompletedRows:
4545
bne @normalRow
4646

4747
@floorCheck:
48-
lda floorModifier
48+
lda currentFloor
4949
beq @rowNotComplete
5050

5151
@fullRowBurningCheck:
5252
inc activeFloorMode ; Floor is active
5353
lda #$13
5454
sec
5555
sbc generalCounter2 ; contains current row being checked
56-
cmp floorModifier
56+
cmp currentFloor
5757
bcc @rowNotComplete ; ignore floor rows
5858
@normalRow:
5959

@@ -98,7 +98,7 @@ playState_checkForCompletedRows:
9898
beq @incrementLineIndex
9999
lda #$14
100100
sec
101-
sbc floorModifier
101+
sbc currentFloor
102102
tax
103103
ldy multBy10Table,x
104104
ldx #$0A

src/playstate/updatestats.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ checkLinecap: ; set linecapState
164164
sta garbageHole
165165
lda #1
166166
sta pendingGarbage
167+
inc currentFloor
167168
@floorLinecapEnd:
168169

169170
addPoints:

src/ram.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ linecapState: .res 1 ; $639 ; 0 if not triggered, 1 + linecapHow otherwise, rese
209209
dasOnlyShiftDisabled: .res 1 ; $63A
210210

211211
invisibleFlag: .res 1 ; $63B ; 0 for normal mode, non-zero for Invisible playfield rendering. Reset on game init and game over.
212+
currentFloor: .res 1 ; floorModifier is copied here at game init. Set to 0 otherwise and incremented when linecap floor.
212213

213-
.res $39
214+
.res $38
214215

215216
.if KEYBOARD
216217
newlyPressedKeys: .res 1 ; $0675

0 commit comments

Comments
 (0)