Skip to content

Commit 3ca5fa2

Browse files
Merge pull request #50 from zohassadar/floor
make floor mode with top row bug not gobble up floor rows
2 parents e15e7bf + 983a97b commit 3ca5fa2

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Added hidden score option
1515
* Added marathon mode
1616
* 0001 seeds are ignored
17+
* Floor no longer gobbled up by top line clear
1718

1819
## [v5 tournament]
1920
* Linecap Menu (from CTM Masters September 2022)

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:

src/playstate/lock.asm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ playState_lockTetrimino:
4242
adc tetriminoX
4343
sta generalCounter
4444
lda currentPiece
45-
sta currentPiece_copy
4645
asl a
4746
asl a
4847
sta generalCounter2

src/ram.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ lines: .res 2 ; $0050
3939
rowY: .res 1 ; $0052
4040
linesBCDHigh: .res 1 ; $53
4141
linesTileQueue: .res 1 ; $54
42-
currentPiece_copy: .res 1 ; $55 ; used in floor code checking
42+
.res 1
4343
completedLines: .res 1 ; $0056
4444
lineIndex: .res 1 ; $0057 ; Iteration count of playState_checkForCompletedRows
4545
startHeight: .res 1 ; $0058

0 commit comments

Comments
 (0)