Skip to content

Commit 5f6cb98

Browse files
Merge pull request #7 from timotheeg/standard_pause_in_qual_mode
Restore standard pause in qual mode / Added classic mode options
2 parents caa5059 + 22d82b3 commit 5f6cb98

File tree

3 files changed

+75
-13
lines changed

3 files changed

+75
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## [v4 classic]
3+
- Standard Pause in Qual Mode
4+
- No Next Box allowed in Qual Mode
5+
- Block Tool cannot be used in Qual Mode
26

37
## [v4]
48
- B-Type Trainer (height 0-8)

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ Combined with the level editor, savestates are effective for practising specific
265265

266266
Reintroduces the 'wait screens', intended for use in qualifiers where the the player would otherwise gain a time advantage skipping the rocket, legal and title screens.
267267

268+
Also reintroduces other classic features like the end game curtain, standard pause, and no next box.
269+
270+
These features make TetrisGYM work better with post processing tools like [NestrisChamps](https://github.com/timotheeg/nestrischamps) and [MaxoutClub](https://maxoutclub.com/).
271+
272+
You cannot use the Block Tool and Qual mode at the same time.
273+
268274
## PAL Mode
269275

270276
Dictate if the NTSC or PAL gameplay mechanics should be used. Should automatically detect region, but can be manually overwritten otherwise.

main.asm

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
PRACTISE_MODE := 1
1111
NO_MUSIC := 1
12-
ALWAYS_NEXT_BOX := 1
1312
AUTO_WIN := 0
1413
NO_SCORING := 0
1514
DEV_MODE := 0
@@ -1047,7 +1046,7 @@ menuConfigControls:
10471046
dec menuVars, x
10481047
lda #$01
10491048
sta soundEffectSlot1Init
1050-
jsr checkGoofy
1049+
jsr assertValues
10511050
@skipLeftConfig:
10521051

10531052
; check if pressing right
@@ -1061,15 +1060,33 @@ menuConfigControls:
10611060
inc menuVars, x
10621061
lda #$01
10631062
sta soundEffectSlot1Init
1064-
jsr checkGoofy
1063+
jsr assertValues
10651064
@skipRightConfig:
10661065
@configEnd:
10671066
rts
10681067

10691068
menuConfigSizeLookup:
10701069
.byte MENUSIZES
10711070

1072-
checkGoofy:
1071+
assertValues:
1072+
; make sure you can only have block or qual
1073+
lda practiseType
1074+
cmp #MODE_QUAL
1075+
bne @noQual
1076+
lda menuVars, x
1077+
beq @noQual
1078+
lda #0
1079+
sta debugFlag
1080+
@noQual:
1081+
lda practiseType
1082+
cmp #MODE_DEBUG
1083+
bne @noDebug
1084+
lda menuVars, x
1085+
beq @noDebug
1086+
lda #0
1087+
sta qualFlag
1088+
@noDebug:
1089+
; goofy
10731090
lda practiseType
10741091
cmp #MODE_GOOFY
10751092
bne @noFlip
@@ -2392,10 +2409,12 @@ orientationTable:
23922409
.byte $FF,$00,$00,$FF,$00,$00,$FF,$00
23932410

23942411
stageSpriteForNextPiece:
2395-
.if !ALWAYS_NEXT_BOX
2412+
lda qualFlag
2413+
beq @alwaysNextBox
23962414
lda displayNextPiece
23972415
bne @ret
2398-
.endif
2416+
2417+
@alwaysNextBox:
23992418
lda #$C8
24002419
sta spriteXOffset
24012420
lda #$77
@@ -4949,51 +4968,84 @@ gameModeState_startButtonHandling:
49494968
; do nothing if curtain is being lowered
49504969
lda playState
49514970
cmp #$0A
4952-
bne @pause
4953-
jmp @ret
4971+
beq @ret
4972+
jsr pause
4973+
4974+
@ret: inc gameModeState
4975+
rts
49544976

4955-
@pause:
4977+
pause:
49564978
lda #$05
49574979
sta musicStagingNoiseHi
4980+
4981+
lda qualFlag
4982+
beq @pauseSetupNotClassic
4983+
4984+
@pauseSetupClassic:
4985+
lda #$00
4986+
sta renderMode
4987+
lda #$16
4988+
sta PPUMASK
4989+
jmp @pauseSetupPart2
4990+
4991+
@pauseSetupNotClassic:
49584992
lda #$04 ; render_mode_pause
49594993
sta renderMode
4994+
4995+
@pauseSetupPart2:
49604996
jsr updateAudioAndWaitForNmi
4961-
lda #$1E ; $16 for black
4962-
sta PPUMASK
49634997
lda #$FF
49644998
ldx #$02
49654999
ldy #$02
49665000
jsr memset_page
5001+
49675002
@pauseLoop:
5003+
lda qualFlag
5004+
beq @pauseLoopNotClassic
5005+
5006+
@pauseLoopClassic:
5007+
lda #$70
5008+
sta spriteXOffset
5009+
lda #$77
5010+
sta spriteYOffset
5011+
jmp @pauseLoopCommon
5012+
5013+
@pauseLoopNotClassic:
49685014
lda #$74
49695015
sta spriteXOffset
49705016
lda #$58
49715017
sta spriteYOffset
5018+
5019+
@pauseLoopCommon:
49725020
; put 3 or 5 in a
49735021
lda debugFlag
49745022
asl
49755023
adc #3
49765024
sta spriteIndexInOamContentLookup
49775025
jsr loadSpriteIntoOamStaging
49785026

5027+
lda qualFlag
5028+
bne @pauseCheckStart
5029+
49795030
jsr practiseGameHUD
49805031
jsr debugMode
49815032
; debugMode calls stageSpriteForNextPiece, stageSpriteForCurrentPiece
49825033

5034+
@pauseCheckStart:
49835035
lda newlyPressedButtons_player1
49845036
cmp #$10
49855037
beq @resume
49865038
jsr updateAudioWaitForNmiAndResetOamStaging
49875039
jmp @pauseLoop
49885040

4989-
@resume:lda #$1E
5041+
@resume:
5042+
lda #$1E
49905043
sta PPUMASK
49915044
lda #$00
49925045
sta musicStagingNoiseHi
49935046
sta vramRow
49945047
lda #$03
49955048
sta renderMode
4996-
@ret: inc gameModeState
49975049
rts
49985050

49995051
; canon is waitForVerticalBlankingInterval

0 commit comments

Comments
 (0)