Clearing
The rule by which a falling-block game removes pieces from the well, such as a full row or a run of one color.
On this page
Clearing is how a falling-block game takes pieces off the board, and it decides what a player builds. NES Tetris clears a row once all 10 of its cells are filled1. Dr. Mario clears four or more cells of one color in a line, across or down2.
- Full rowTetris (NES) (1989). A row of 10 filled cells clears, and the rows above move down.1
- Line of fourDr. Mario (NES) (1990). Four or more cells of one color in a row or a column.2
What falls after a clear decides whether one clear can cause another. In NES Tetris whole rows move down, so it can’t1; in Dr. Mario single halves fall, so it can (chain)3.
Games
| Game | Year | How | Note |
|---|---|---|---|
| Yoshi's Cookie | 1992 | a whole row or column of one kind clears, rows first; the line runs the full width or height of the board | |
| Tetris (NES) | 1989 | Full row | a row of 10 filled cells clears, and the rows above move down |
| Dr. Mario (NES) | 1990 | Line of four | four or more cells of one color in a row or a column |
Every claim about this mechanic, by game (5)
References
- ^ abcAfter a lock, NES Tetris checks four rows, from two above the piece's row down; a row with none of its 10 cells empty is complete, and every row above it moves down one row whole while the top row empties.CodeCelestialAmber/TetrisNESDisasmrevised
How we know
3195 lda tetriminoY ⋮ 3197 sbc #$02 ⋮ 3202 adc lineIndex ⋮ 3212 ldx #$0A 3213@checkIfRowComplete: ⋮ 3215 cmp #tileEmpty 3216 beq @rowNotComplete ⋮ 3218 dex ⋮ 3222 inc completedLines
main.asm lines 3195–3222 at 94581c0 · upstream ↗ 3228@movePlayfieldDownOneRow: ⋮ 3230 ldx #$0A ⋮ 3232 sta (playfieldAddr),y ⋮ 3237 bne @movePlayfieldDownOneRow 3238 lda #tileEmpty ⋮ 3240@clearRowTopRow: 3241 sta (playfieldAddr),y
main.asm lines 3228–3244 at 94581c0 · upstream ↗ 3254 inc lineIndex 3255 lda lineIndex 3256 cmp #$04
main.asm lines 3253–3256 at 94581c0 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-21.
Revised after a check by a second AI model, 2026-10-21.
- ^ abAfter a pill lands the game scans the bottle row by row for 4 or more cells of one color in a row, then column by column for 4 or more in a column, and clears every run it finds.CodeNostaljipi/dr-mario-disassembly
How we know
15match_length = $04 ;Length of color chain required for a matchdefines/drmario_constants.asm line 15 at ecb9899 · upstream ↗ 1141 @noMatchInMemory: 1142 lda #$00 1143 sta fieldPos ;Will check field pos from top left to bottom right, row after row ⋮ 1145 lda fieldPos ⋮ 1149 ldy fieldPos 1150 lda (currentP_fieldPointer),Y ⋮ 1157 and #mask_fieldobject_color ⋮ 1159 @checkHorColorChain_loop: 1160 inc fieldPos_tmp ;Checks next horizontal 1161 lda fieldPos_tmp 1162 and #lastColumn ;Check if reached right end of bottle 1163 beq @horColorChainBroken ⋮
prg/drmario_prg_game_logic.asm lines 1141–1170 at ecb9899 · upstream ↗ 1171 @horColorChainBroken: ⋮ 1173 cmp #match_length-1 ;Checks if enough for a match (does not include the starting color, which explains the "-1") ⋮ 1176 inc currentP_comboCounter ;Increase combo counter and store color chain length
prg/drmario_prg_game_logic.asm lines 1171–1176 at ecb9899 · upstream ↗ 27 .word checkDrop 28 .word resetMatchFlag 29 .word checkHorMatch 30 .word checkVerMatch 31 .word updateField
prg/drmario_prg_game_logic.asm lines 26–31 at ecb9899 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-25.
Checked by a second AI model, 2026-10-21.
Checked by a second AI model, 2026-10-25.
- ^When a clear happens,
updateFieldsends the placed pill's steps back tocheckDrop, which lets unsupported halves fall, and the match checks run again, so one pill can set off a chain of clears.CodeNostaljipi/dr-mario-disassemblyHow we know
1478 lda currentP_matchFlag ;Check if there was a match (and thus if we need to process drops and further field update) ⋮ 1481 lda #pillPlaced_nextStep1 ;If there was a match, we need to update the field again to process the impacts of this match (ex: pill drops) ⋮ 1485 sta currentP_pillPlacedStep
prg/drmario_prg_game_logic.asm lines 1478–1486 at ecb9899 · upstream ↗ 71checkDrop: ⋮ 80 ldy #lastFieldPos 81 sty fieldPointerOffset ;Starts at the end and goes backward ⋮ 83 ldy fieldPointerOffset 84 lda (currentP_fieldPointer),Y 85 cmp #fieldPosJustEmptied ;If not empty, then no drop possible ⋮ 90 sta (currentP_fieldPointer),Y ⋮ 101 sbc #rowSize ;Substract 1 row to check what's on top ⋮ 103 lda (currentP_fieldPointer),Y ⋮ 122 lda (currentP_fieldPointer),Y 123 cmp #fieldPosJustEmptied ;If not empty, then no drop possible ⋮ 128 lda (currentP_fieldPointer),Y ⋮
prg/drmario_prg_game_logic.asm lines 71–149 at ecb9899 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-25.
Checked by a second AI model, 2026-10-21.
Checked by a second AI model, 2026-10-25.
Sources
Code
- (CelestialAmber), Amber Brault and contributors. 2024. “TetrisNESDisasm: a disassembly of Tetris (NES).” Commit 94581c0. CelestialAmber/TetrisNESDisasm @ 94581c0 · licence, all uses
- Nostaljipi. 2021. “Dr. Mario (NES) Disassembly.” Commit ecb9899. Nostaljipi/dr-mario-disassembly @ ecb9899 · licence, all uses