Skip to content

Commit 197f69d

Browse files
committed
floor mode with top row
1 parent 89545f5 commit 197f69d

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

src/playstate/completedrows.asm

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
activeFloorMode := generalCounter5
2+
13
playState_checkForCompletedRows:
24
lda vramRow
35
cmp #$20
@@ -23,8 +25,9 @@ playState_checkForCompletedRows:
2325
adc generalCounter
2426
sta generalCounter
2527
tay
28+
lda #$00
29+
sta activeFloorMode ; Don't draw floor unless active
2630
ldx #$0A
27-
2831
@checkIfRowComplete:
2932
.if AUTO_WIN
3033
jmp @rowIsComplete
@@ -46,24 +49,14 @@ playState_checkForCompletedRows:
4649
beq @rowNotComplete
4750

4851
@fullRowBurningCheck:
49-
; bugfix to ensure complete rows aren't cleared
50-
; used in floor / linecap floor
51-
lda currentPiece_copy
52-
beq @IJLTedge
53-
cmp #5
54-
beq @IJLTedge
55-
cmp #$10
56-
beq @IJLTedge
57-
cmp #$12
58-
beq @IJLTedge
59-
bne @normalRow
60-
@IJLTedge:
61-
lda lineIndex
62-
cmp #3
63-
bcs @rowNotComplete
52+
inc activeFloorMode ; Floor is active
53+
lda #$13
54+
sec
55+
sbc generalCounter2 ; contains current row being checked
56+
cmp floorModifier
57+
bcc @rowNotComplete ; ignore floor rows
6458
@normalRow:
6559

66-
6760
@checkIfRowCompleteLoopStart:
6861
lda (playfieldAddr),y
6962
cmp #EMPTY_TILE
@@ -99,6 +92,23 @@ playState_checkForCompletedRows:
9992
bne @clearRowTopRow
10093
lda #$13
10194
sta currentPiece
95+
96+
; draw surface of floor in case of top line clear
97+
lda activeFloorMode
98+
beq @incrementLineIndex
99+
lda #$14
100+
sec
101+
sbc floorModifier
102+
tax
103+
ldy multBy10Table,x
104+
ldx #$0A
105+
lda #BLOCK_TILES
106+
@drawFloorSurface:
107+
sta playfield,y
108+
iny
109+
dex
110+
bne @drawFloorSurface
111+
102112
jmp @incrementLineIndex
103113

104114
@rowNotComplete:

0 commit comments

Comments
 (0)