Skip to content

Commit 519737f

Browse files
committed
squashed merge of master
1 parent 5ddab95 commit 519737f

28 files changed

+34131
-148
lines changed

CHANGELOG.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22

33
## [unreleased]
44
* Crunch Mode
5-
* Invisible linecap turns entire playfield invisible
6-
* Invisible mode preserves original piece colors
5+
* Marathon Mode
6+
* Added hidden score option
7+
* M Scoring changed to just add a millions counter to Classic Scoring
78
* Famicom Keyboard support
8-
* Fixed Floor-0 disabled burns
99
* MMC3 Support
1010
* MMC5 Support
11+
* Invisible linecap turns entire playfield invisible
12+
* Invisible mode preserves original piece colors
13+
* Floor no longer gobbled up by top line clear
14+
* Floor 0 has original no-burns behaviour again
1115
* Fixed CNROM legal screen CHR bank
1216
* Fixed CNROM legal to title flicker
17+
* Fixed ingame score display at 8 million with Classic Scoring
1318
* Block Tool pieces wrap around
14-
* Added hidden score option
15-
* Added marathon mode
1619
* 0001 seeds are ignored
17-
* Floor no longer gobbled up by top line clear
1820

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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* [Tap Quantity](#tap-quantity)
2222
* [Checkerboard](#checkerboard)
2323
* [Transition](#transition)
24+
* [Marathon](#marathon)
2425
* [Garbage](#garbage)
2526
* [Drought](#drought)
2627
* [DAS Delay](#das-delay)

build.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if (args.includes('-h')) {
2929
-w force WASM compiler
3030
-c force PNG to CHR conversion
3131
-o override autodetect mmc1 header with cnrom
32+
-t run tests (requires cargo)
3233
-h you are here
3334
`);
3435
process.exit(0);
@@ -174,8 +175,9 @@ if (!fs.existsSync('clean.nes')) {
174175
} else {
175176
console.time('patch');
176177
const patcher = require('./tools/patch/create');
177-
patcher('clean.nes', 'tetris.nes', 'tetris.bps');
178+
const pct = patcher('clean.nes', 'tetris.nes', 'tetris.bps');
178179
console.timeEnd('patch');
180+
console.log(`using ${pct}% of original file`);
179181
}
180182

181183
// stats
@@ -203,3 +205,8 @@ hashFile('tetris.bps');
203205
console.log();
204206

205207
console.timeEnd('build');
208+
209+
if (args.includes('-t')) {
210+
console.log('\nrunning tests');
211+
handleSpawn('cargo', ...'run --release --manifest-path tests/Cargo.toml -- -t'.split(' '));
212+
}

src/constants.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
113113

114114
; menuConfigSizeLookup
115115
; menu ram is defined at menuRAM in ./ram.asm
116-
.macro MENUSIZES
116+
.macro MENUSIZES
117117
.byte $0 ; MODE_TETRIS
118118
.byte $0 ; MODE_TSPINS
119119
.byte $0 ; MODE_SEED

src/nmi/pollkeyboard.asm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
; |+--- Select column, row is incremented if this bit goes from high to low.
1111
; +---- Enable keyboard matrix (if 0, all voltages inside the keyboard will be 5V, reading back as logical 0 always)
1212

13-
; Incrementing the row from the (keyless) 10th row will cause it to wrap back to the first row.
13+
; Incrementing the row from the (keyless) 10th row will cause it to wrap back to the first row.
1414

1515
; Output ($4017 read)
1616

@@ -50,14 +50,14 @@ pollKeyboard:
5050
sta JOY1
5151
ldy #$0A
5252
@avoidParasiticCapacitance: ; wait approx 50 cycles after advancing rows
53-
dey
53+
dey
5454
bne @avoidParasiticCapacitance
5555
lda JOY2_APUFC
5656
and #KB_MASK
5757
sta generalCounter
5858
lda #KB_COL_1
5959
sta JOY1
60-
lda JOY2_APUFC
60+
lda JOY2_APUFC
6161
and #KB_MASK
6262
lsr
6363
sta keyboardInput,x
@@ -129,7 +129,7 @@ mapKeysToButtons:
129129
ora #BUTTON_RIGHT
130130
sta newlyPressedKeys
131131
@skipRightRead:
132-
@rightNotPressed:
132+
@rightNotPressed:
133133

134134
ldy #$07 ; grph -> B
135135
ldx #$06
@@ -168,7 +168,7 @@ mapKeysToButtons:
168168
@startNotPressed:
169169

170170

171-
; Separate Newly Pressed from Held
171+
; Separate Newly Pressed from Held
172172
lda newlyPressedKeys
173173
tay
174174
eor heldKeys
@@ -189,6 +189,6 @@ mapKeysToButtons:
189189
keyMask:
190190
.byte $80,$40,$20,$10,$08,$04,$02,$01
191191
readKey:
192-
lda keyboardInput,y
193-
and keyMask,x
194-
rts
192+
lda keyboardInput,y
193+
and keyMask,x
194+
rts

src/nmi/render_mode_play_and_demo.asm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ render_mode_play_and_demo:
123123
cmp #SCORING_FLOAT
124124
bne @noFloat
125125
jsr renderFloat
126-
jmp @clearScoreRenderFlags
127126
@noFloat:
128127

129128
jsr renderClassicScore

src/nmi/render_score.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ renderFloat:
8080
ror
8181
ror
8282
sta PPUDATA
83-
jsr renderBCDScore
8483
rts
8584

8685
renderLevelDash:
@@ -196,6 +195,7 @@ getScoreDiv100k:
196195
lsr
197196
lsr
198197
lsr
198+
clc
199199
tax
200200
lda multBy100Table, x
201201
adc tmpZ

src/sprites/piece.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ stageSpriteForCurrentPiece_actual:
8383
ldy oamStagingLength
8484
lda #$04
8585
sta generalCounter2
86-
@stageMino:
86+
@stageMino:
8787
lda orientationTable,x
8888
asl a
8989
asl a
@@ -116,7 +116,7 @@ stageSpriteForCurrentPiece_actual:
116116
sta oamStaging,y
117117
jmp @finishLoop
118118

119-
@validYCoordinate:
119+
@validYCoordinate:
120120
inc oamStagingLength
121121
iny
122122
lda orientationTable,x
@@ -126,7 +126,7 @@ stageSpriteForCurrentPiece_actual:
126126
clc
127127
adc generalCounter3
128128
sta oamStaging,y
129-
@finishLoop:
129+
@finishLoop:
130130
inc oamStagingLength
131131
iny
132132
inx

src/util/check_region.asm

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ checkRegion:
33

44
; region detection via http://forums.nesdev.com/viewtopic.php?p=163258#p163258
55
;;; use the power-on wait to detect video system-
6-
ldx #0
6+
ldx #0
77
stx palFlag ; extra zeroing
8-
ldy #0
8+
ldy #0
99
@vwait1:
10-
bit $2002
11-
bpl @vwait1 ; at this point, about 27384 cycles have passed
10+
bit $2002
11+
bpl @vwait1 ; at this point, about 27384 cycles have passed
1212
@vwait2:
13-
inx
14-
bne @noincy
15-
iny
13+
inx
14+
bne @noincy
15+
iny
1616
@noincy:
17-
bit $2002
18-
bpl @vwait2 ; at this point, about 57165 cycles have passed
17+
bit $2002
18+
bpl @vwait2 ; at this point, about 57165 cycles have passed
1919
@endVWait:
2020

2121
;;; BUT because of a hardware oversight, we might have missed a vblank flag.
@@ -24,16 +24,16 @@ checkRegion:
2424
;;; PAL NES: 33247 cycles / 12.005 -> $AD1 or $15A2
2525
;;; Dendy: 35464 cycles / 12.005 -> $B8A or $1714
2626

27-
tya
28-
cmp #16
29-
bcc @nodiv2
30-
lsr
27+
tya
28+
cmp #16
29+
bcc @nodiv2
30+
lsr
3131
@nodiv2:
32-
clc
33-
adc #<-9
34-
cmp #3
35-
bcc @noclip3
36-
lda #3
32+
clc
33+
adc #<-9
34+
cmp #3
35+
bcc @noclip3
36+
lda #3
3737
@noclip3:
3838
;;; Right now, A contains 0,1,2,3 for NTSC,PAL,Dendy,Bad
3939
cmp #0

src/util/core.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ updateAudioWaitForNmiAndResetOamStaging:
6161
beq @checkForNmi
6262

6363
resetOAMStaging:
64-
; Hide a sprite by moving it down offscreen, by writing any values between #$EF-#$FF here.
65-
; Sprites are never displayed on the first line of the picture, and it is impossible to place
66-
; a sprite partially off the top of the screen.
64+
; Hide a sprite by moving it down offscreen, by writing any values between #$EF-#$FF here.
65+
; Sprites are never displayed on the first line of the picture, and it is impossible to place
66+
; a sprite partially off the top of the screen.
6767
; https://www.nesdev.org/wiki/PPU_OAM
6868
ldx #$00
6969
lda #$FF

0 commit comments

Comments
 (0)