Skip to content

Commit 2cb0606

Browse files
authored
Merge branch 'master' into mapper_edit
2 parents 4ec7962 + 1ac2a80 commit 2cb0606

32 files changed

+1141
-597
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
* Crunch Mode
66
* Marathon Mode
77
* Hidden Score Mode
8+
* Low Stack Mode
89
* M Score changed to Classic Scoring + Millions counter
910
* Invisible linecap turns entire playfield invisible
1011
* Invisible mode preserves original piece colors
12+
* Added "negative delay" to the hz display
1113
* Block Tool pieces wrap around
1214
* Always Next Box removed
1315
* 0001 seeds are ignored
@@ -20,7 +22,8 @@
2022
* Fixed storage bug for push down points
2123
* Fixed crashes in garbage mode 4
2224
* Fixed line clearing happening on pause
23-
* Fixed PAL level 181 colour
25+
* Fixed PAL colours
26+
* Keep hz display enabled when topped out
2427
* Famicom Keyboard support
2528
* Autodetect MMC1/CNROM
2629
* NROM 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)
@@ -154,16 +152,6 @@ Fill in the floor to a certain height to force higher stacking. This mode is oft
154152

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

157-
### Crunch
158-
159-
![Crunch](./assets/screens/crunch.png)
160-
161-
Shrink the width of the playfield to force cramped stacking.
162-
163-
Every increment of 4 will decrease the width from the left.
164-
165-
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.
166-
167155
### (Quick)Tap
168156

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

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

197-
### Marathon
198-
199-
Play as long as you are able to survive at a consistent speed.
200-
201-
0. Level transitions do not happen, game remains on the same level for as long as you are able to survive.
202-
1. Levels will transition normally, but speed and points will remain fixed based on your starting level.
203-
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.
204-
205185
### Garbage
206186

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

assets/screens/lowstack.png

4.76 KB
Loading

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');
@@ -125,7 +124,10 @@ console.timeEnd('CHR');
125124

126125
// build object files
127126

128-
function handleSpawn(exe, ...args) {
127+
const { spawnSync } = require('child_process');
128+
129+
function exec(cmd) {
130+
const [exe, ...args] = cmd.split(' ');
129131
const output = spawnSync(exe, args).output.flatMap(
130132
(d) => d?.toString() || [],
131133
);
@@ -135,36 +137,23 @@ function handleSpawn(exe, ...args) {
135137
}
136138
}
137139

138-
const ca65bin = nativeCC65 ? ['ca65'] : ['node', './tools/assemble/ca65.js'];
140+
const ca65bin = nativeCC65 ? 'ca65' : 'node ./tools/assemble/ca65.js';
141+
const flags = compileFlags.join(' ');
139142

140143
console.time('assemble');
141144

142-
handleSpawn(
143-
...ca65bin,
144-
...compileFlags,
145-
...'-g src/header.asm -o header.o'.split(' '),
146-
);
147-
148-
handleSpawn(
149-
...ca65bin,
150-
...compileFlags,
151-
...'-l tetris.lst -g src/main.asm -o main.o'.split(' '),
152-
);
145+
exec(`${ca65bin} ${flags} -g src/header.asm -o header.o`);
146+
exec(`${ca65bin} ${flags} -l tetris.lst -g src/main.asm -o main.o`);
153147

154148
console.timeEnd('assemble');
155149

156150
// link object files
157151

158-
const ld65bin = nativeCC65 ? ['ld65'] : ['node', './tools/assemble/ld65.js'];
152+
const ld65bin = nativeCC65 ? 'ld65' : 'node ./tools/assemble/ld65.js';
159153

160154
console.time('link');
161155

162-
handleSpawn(
163-
...ld65bin,
164-
...'-m tetris.map -Ln tetris.lbl --dbgfile tetris.dbg -o tetris.nes -C src/tetris.nes.cfg main.o header.o'.split(
165-
' ',
166-
),
167-
);
156+
exec(`${ld65bin} -m tetris.map -Ln tetris.lbl --dbgfile tetris.dbg -o tetris.nes -C src/tetris.nes.cfg main.o header.o`);
168157

169158
console.timeEnd('link');
170159

@@ -208,5 +197,5 @@ console.timeEnd('build');
208197

209198
if (args.includes('-t')) {
210199
console.log('\nrunning tests');
211-
handleSpawn('cargo', ...'run --release --manifest-path tests/Cargo.toml -- -t'.split(' '));
200+
exec('cargo run --release --manifest-path tests/Cargo.toml -- -t');
212201
}

src/chr/game_tileset.png

-22.5 KB
Loading

src/constants.asm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ BTYPE_START_LINES := $25 ; bcd
3636
MENU_HIGHLIGHT_COLOR := $12 ; $12 in gym, $16 in original
3737
BLOCK_TILES := $7B
3838
EMPTY_TILE := $EF
39+
LOW_STACK_LINE := $DF
3940
TETRIMINO_X_HIDE := $EF
4041

4142
PAUSE_SPRITE_X := $74
@@ -80,12 +81,14 @@ MODE_CHECKERBOARD
8081
MODE_GARBAGE
8182
MODE_DROUGHT
8283
MODE_DAS
84+
MODE_LOWSTACK
8385
MODE_KILLX2
8486
MODE_INVISIBLE
8587
MODE_HARDDROP
8688
MODE_SPEED_TEST
8789
MODE_SCORE_DISPLAY
8890
MODE_CRASH
91+
MODE_STRICT
8992
MODE_HZ_DISPLAY
9093
MODE_INPUT_DISPLAY
9194
MODE_DISABLE_FLASH
@@ -122,7 +125,7 @@ LINECAP_WHEN_STRING_OFFSET := $10
122125
LINECAP_HOW_STRING_OFFSET := $12
123126

124127
MENU_SPRITE_Y_BASE := $47
125-
MENU_MAX_Y_SCROLL := $80
128+
MENU_MAX_Y_SCROLL := $98
126129
MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
127130

128131
; menuConfigSizeLookup
@@ -145,12 +148,14 @@ MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
145148
.byte $4 ; MODE_GARBAGE
146149
.byte $12 ; MODE_DROUGHT
147150
.byte $10 ; MODE_DAS
151+
.byte $0F ; MODE_LOWSTACK
148152
.byte $0 ; MODE_KILLX2
149153
.byte $0 ; MODE_INVISIBLE
150154
.byte $0 ; MODE_HARDDROP
151155
.byte $0 ; MODE_SPEED_TEST
152156
.byte $5 ; MODE_SCORE_DISPLAY
153157
.byte $3 ; MODE_CRASH
158+
.byte $1 ; MODE_STRICT
154159
.byte $1 ; MODE_HZ_DISPLAY
155160
.byte $1 ; MODE_INPUT_DISPLAY
156161
.byte $1 ; MODE_DISABLE_FLASH
@@ -181,6 +186,7 @@ MENU_TOP_MARGIN_SCROLL := 7 ; in blocks
181186
.byte "GARBGE"
182187
.byte "LOBARS"
183188
.byte "DASDLY"
189+
.byte "LOWSTK"
184190
.byte "KILLX2"
185191
.byte "INVZBL"
186192
.byte "HRDDRP"

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
@@ -79,6 +79,7 @@ mainLoop:
7979
.include "modes/pace.asm"
8080
.include "modes/debug.asm"
8181
.include "modes/saveslots.asm"
82+
.include "modes/crash.asm"
8283

8384
.code
8485

0 commit comments

Comments
 (0)