Skip to content

Commit 86b8d72

Browse files
Merge branch 'master' into lowstack
2 parents 94aaa09 + 33f808e commit 86b8d72

28 files changed

+1506
-653
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@
99
* M Score changed to Classic Scoring + Millions counter
1010
* Invisible linecap turns entire playfield invisible
1111
* Invisible mode preserves original piece colors
12+
* Added "negative delay" to the hz display
1213
* Block Tool pieces wrap around
1314
* Always Next Box removed
1415
* 0001 seeds are ignored
1516
* Floor no longer gobbled up by top line clear
1617
* Floor 0 has original no-burns behaviour again
17-
* Fixed ingame score display at 8 million with Classic Scoring
18+
* [Fixed ingame score display at 8/9 million with Classic Scoring](https://www.youtube.com/watch?v=fYdXky2i5AE)
1819
* Fixed CNROM legal screen CHR bank
1920
* Fixed CNROM legal to title flicker
2021
* Fixed piece skip when doing Sonic Drop then Hard Drop immediately
2122
* Fixed storage bug for push down points
23+
* Fixed crashes in garbage mode 4
24+
* Fixed line clearing happening on pause
25+
* Fixed PAL colours
26+
* Keep hz display enabled when topped out
2227
* Famicom Keyboard support
2328
* MMC3 Support
2429
* MMC5 Support

README.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
* [Setups](#setups)
1717
* [B-Type](#b-type)
1818
* [Floor](#floor)
19-
* [Crunch](#crunch)
2019
* [(Quick)Tap](#quicktap)
2120
* [Tap Quantity](#tap-quantity)
2221
* [Checkerboard](#checkerboard)
2322
* [Transition](#transition)
24-
* [Marathon](#marathon)
2523
* [Garbage](#garbage)
2624
* [Drought](#drought)
2725
* [DAS Delay](#das-delay)
@@ -155,16 +153,6 @@ Fill in the floor to a certain height to force higher stacking. This mode is oft
155153

156154
Setting the height to zero will result in a game mode with burns disabled.
157155

158-
### Crunch
159-
160-
![Crunch](./assets/screens/crunch.png)
161-
162-
Shrink the width of the playfield to force cramped stacking.
163-
164-
Every increment of 4 will decrease the width from the left.
165-
166-
Every increment of 1 will decrease the width from the right until it reaches its maximum of 3, where it will be reset to 0.
167-
168156
### (Quick)Tap
169157

170158
![Tap](./assets/screens/tap.png)
@@ -195,14 +183,6 @@ Puts you ten lines before transition. The value given will be added to your scor
195183

196184
Setting the value to G causes the mode to act identical to the game genie code `SXTOKL`
197185

198-
### Marathon
199-
200-
Play as long as you are able to survive at a consistent speed.
201-
202-
0. Level transitions do not happen, game remains on the same level for as long as you are able to survive.
203-
1. Levels will transition normally, but speed and points will remain fixed based on your starting level.
204-
2. Similar to 1, speed and points will remain fixed based on the starting level you choose, but actual game will begin at level 0.
205-
206186
### Garbage
207187

208188
![Garbage](./assets/screens/garbage.png)

build.js

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const fs = require('fs');
22
const path = require('path');
33
const crypto = require('crypto');
4-
const { spawnSync } = require('child_process');
54

65
console.log('TetrisGYM buildscript');
76
console.time('build');
@@ -117,7 +116,10 @@ console.timeEnd('CHR');
117116

118117
// build object files
119118

120-
function handleSpawn(exe, ...args) {
119+
const { spawnSync } = require('child_process');
120+
121+
function exec(cmd) {
122+
const [exe, ...args] = cmd.split(' ');
121123
const output = spawnSync(exe, args).output.flatMap(
122124
(d) => d?.toString() || [],
123125
);
@@ -127,36 +129,23 @@ function handleSpawn(exe, ...args) {
127129
}
128130
}
129131

130-
const ca65bin = nativeCC65 ? ['ca65'] : ['node', './tools/assemble/ca65.js'];
132+
const ca65bin = nativeCC65 ? 'ca65' : 'node ./tools/assemble/ca65.js';
133+
const flags = compileFlags.join(' ');
131134

132135
console.time('assemble');
133136

134-
handleSpawn(
135-
...ca65bin,
136-
...compileFlags,
137-
...'-g src/header.asm -o header.o'.split(' '),
138-
);
139-
140-
handleSpawn(
141-
...ca65bin,
142-
...compileFlags,
143-
...'-l tetris.lst -g src/main.asm -o main.o'.split(' '),
144-
);
137+
exec(`${ca65bin} ${flags} -g src/header.asm -o header.o`);
138+
exec(`${ca65bin} ${flags} -l tetris.lst -g src/main.asm -o main.o`);
145139

146140
console.timeEnd('assemble');
147141

148142
// link object files
149143

150-
const ld65bin = nativeCC65 ? ['ld65'] : ['node', './tools/assemble/ld65.js'];
144+
const ld65bin = nativeCC65 ? 'ld65' : 'node ./tools/assemble/ld65.js';
151145

152146
console.time('link');
153147

154-
handleSpawn(
155-
...ld65bin,
156-
...'-m tetris.map -Ln tetris.lbl --dbgfile tetris.dbg -o tetris.nes -C src/tetris.nes.cfg main.o header.o'.split(
157-
' ',
158-
),
159-
);
148+
exec(`${ld65bin} -m tetris.map -Ln tetris.lbl --dbgfile tetris.dbg -o tetris.nes -C src/tetris.nes.cfg main.o header.o`);
160149

161150
console.timeEnd('link');
162151

@@ -200,5 +189,5 @@ console.timeEnd('build');
200189

201190
if (args.includes('-t')) {
202191
console.log('\nrunning tests');
203-
handleSpawn('cargo', ...'run --release --manifest-path tests/Cargo.toml -- -t'.split(' '));
192+
exec('cargo run --release --manifest-path tests/Cargo.toml -- -t');
204193
}

src/constants.asm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ BUTTON_DPAD := BUTTON_UP | BUTTON_DOWN | BUTTON_LEFT | BUTTON_RIGHT
5656
RENDER_LINES = $01
5757
RENDER_LEVEL = $02
5858
RENDER_SCORE = $04
59+
RENDER_DEBUG = $08
5960
RENDER_HZ = $10
6061
RENDER_STATS = $40
6162
RENDER_HIGH_SCORE_LETTER = $80
@@ -85,6 +86,7 @@ MODE_HARDDROP
8586
MODE_SPEED_TEST
8687
MODE_SCORE_DISPLAY
8788
MODE_CRASH
89+
MODE_STRICT
8890
MODE_HZ_DISPLAY
8991
MODE_INPUT_DISPLAY
9092
MODE_DISABLE_FLASH
@@ -121,7 +123,7 @@ LINECAP_WHEN_STRING_OFFSET := $10
121123
LINECAP_HOW_STRING_OFFSET := $12
122124

123125
MENU_SPRITE_Y_BASE := $47
124-
MENU_MAX_Y_SCROLL := $80
126+
MENU_MAX_Y_SCROLL := $90
125127
MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
126128

127129
; menuConfigSizeLookup
@@ -151,6 +153,7 @@ MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
151153
.byte $0 ; MODE_SPEED_TEST
152154
.byte $5 ; MODE_SCORE_DISPLAY
153155
.byte $3 ; MODE_CRASH
156+
.byte $1 ; MODE_STRICT
154157
.byte $1 ; MODE_HZ_DISPLAY
155158
.byte $1 ; MODE_INPUT_DISPLAY
156159
.byte $1 ; MODE_DISABLE_FLASH

src/gamemodestate/initstate.asm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ gameModeState_initGameState:
149149
@noTypeBPlayfield:
150150

151151
jsr hzStart
152+
lda #0
153+
sta hzSpawnDelay
152154
jsr practiseInitGameState
153155
jsr resetScroll
154156

src/main.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ mainLoop:
7575
.include "modes/pace.asm"
7676
.include "modes/debug.asm"
7777
.include "modes/saveslots.asm"
78+
.include "modes/crash.asm"
7879

7980
.code
8081

0 commit comments

Comments
 (0)