Slightly improve game over and also add modes, removing the RNG setting instead.

This commit is contained in:
Randy Thiemann 2023-10-22 13:42:30 +02:00
parent 3116bccde4
commit f1f33b27d3
12 changed files with 276 additions and 125 deletions

Binary file not shown.

View File

@ -11,6 +11,13 @@ The Randomizer uses a TGM2-style 4-history randomizer preloaded with SSZZ, and w
The game itself runs at a constant 60fps as well as at the traditional 20 row visible grid. The game itself runs at a constant 60fps as well as at the traditional 20 row visible grid.
There are five available game modes:
- TGM1: 4 history, 4 rerolls, no sonic drop, never start with O, S or Z.
- TGM2: 4 history, 6 rerolls, sonic drop, never start with O, S or Z.
- TGM3: 6 history, 6 rerolls, sonic drop, never start with O, S or Z. (Note, not the actual 35-bag as used in TGM3, and floor kicks are not implemented (yet) either.)
- HELL: No history, no rerolls, no sonic drop, never start with O, S or Z.
- EASY: 6 history, 256 rerolls, sonic drop, never start with O, S or Z.
## Playing ## Playing
You can build the game yourself, or use the binary [here](https://git.villadelfia.org/villadelfia/dmgtris/raw/branch/master/DMGTRIS.GB) or [here](https://github.com/Villadelfia/DMGTRIS/raw/master/DMGTRIS.GB). You can build the game yourself, or use the binary [here](https://git.villadelfia.org/villadelfia/dmgtris/raw/branch/master/DMGTRIS.GB) or [here](https://github.com/Villadelfia/DMGTRIS/raw/master/DMGTRIS.GB).
@ -25,7 +32,7 @@ Please do not try running it on older emulators such as VBA, since this game use
- A/B/Start — Start the game - A/B/Start — Start the game
- Left/Right — Switch A/B rotation direction - Left/Right — Switch A/B rotation direction
- Up/Down — Select starting level - Up/Down — Select starting level
- Select — Select amount of times a piece will be rerolled if it was given to you in the previous 4 pieces. TGM2 uses 6 for this value, TGM1 uses 4 for this value. You can set this to 0 (pure RNG except you'll never start with O, S, or Z), to 15 (F. Basically never get duplicates.) - Select — Select game mode
### Gameplay ### Gameplay
- A — Rotate 1 - A — Rotate 1

View File

@ -475,6 +475,25 @@ CanPieceFit:
ret ret
ForceSpawnPiece::
call SetPieceData
call SetPieceDataOffset
ldh a, [hCurrentPieceY]
ld b, a
ldh a, [hCurrentPieceX]
call XYToFieldPtr
ld d, h
ld e, l
call GetPieceData
ld a, GAME_OVER_OTHER
ld b, a
push hl
push de
pop hl
pop de
jp DrawPiece
TrySpawnPiece:: TrySpawnPiece::
; Always reset these for a new piece. ; Always reset these for a new piece.
ldh a, [hCurrentLockDelay] ldh a, [hCurrentLockDelay]
@ -678,7 +697,12 @@ FieldProcess::
; How deep can we go? ; How deep can we go?
: call FindMaxG : call FindMaxG
; If we press up, we want to do a sonic drop. ; If we press up, we want to do a sonic drop, but not in TGM1 or HELL mode.
ldh a, [hSimulationMode]
cp a, MODE_TGM1
jr z, :+
cp a, MODE_HELL
jr z, :+
ldh a, [hUpState] ldh a, [hUpState]
cp a, 1 cp a, 1
jr nz, :+ jr nz, :+

View File

@ -111,15 +111,16 @@ DEF PALETTE_LIGHTER_3 EQU %00000000
DEF TITLE_A EQU $99CD DEF TITLE_A EQU $99CD
DEF TITLE_B EQU $99CF DEF TITLE_B EQU $99CF
DEF TITLE_LEVEL EQU $996C DEF TITLE_LEVEL EQU $996C
DEF TITLE_ROLLS EQU $9A2F DEF TITLE_MODE EQU $9A2E
DEF FIELD_RNGTELL EQU $9812 DEF FIELD_MODE EQU $9811
DEF FIELD_TOP_LEFT EQU $9800+1 DEF FIELD_TOP_LEFT EQU $9800+1
DEF EASTER_0 EQU $9885 DEF EASTER_0 EQU $9885
DEF EASTER_1 EQU $98A5 DEF EASTER_1 EQU $98A5
DEF TILE_FIELD_EMPTY EQU 4 DEF TILE_FIELD_EMPTY EQU 4
DEF TILE_PIECE_0 EQU 10 DEF TILE_PIECE_0 EQU 10
DEF TILE_0 EQU 66 DEF TILE_0 EQU 66
DEF TILE_0_FAINT EQU 196 DEF TILE_MODE_FAINT_0 EQU 196
DEF TILE_MODE_0 EQU 234
DEF TILE_CLEARING EQU 124 DEF TILE_CLEARING EQU 124
DEF TILE_GHOST EQU 125 DEF TILE_GHOST EQU 125
DEF TILE_A EQU 76 DEF TILE_A EQU 76
@ -158,6 +159,11 @@ DEF GAME_OVER_R12 EQU 153
DEF GAME_OVER_R14 EQU 173 DEF GAME_OVER_R14 EQU 173
DEF GAME_OVER_OTHER EQU 131 DEF GAME_OVER_OTHER EQU 131
DEF LEADY_GO_TIME EQU 90 DEF LEADY_GO_TIME EQU 90
DEF MODE_TGM1 EQU 0
DEF MODE_TGM2 EQU 1
DEF MODE_TGM3 EQU 2
DEF MODE_HELL EQU 3
DEF MODE_EASY EQU 4
ENDC ENDC

View File

@ -29,6 +29,7 @@ SECTION "High Globals", HRAM
hGameState:: ds 1 hGameState:: ds 1
hSwapAB:: ds 1 hSwapAB:: ds 1
hInitialA:: ds 1 hInitialA:: ds 1
hSimulationMode:: ds 1
SECTION "Stack", WRAM0 SECTION "Stack", WRAM0
@ -64,13 +65,13 @@ Main::
; Zero out the ram where needed. ; Zero out the ram where needed.
xor a, a xor a, a
ldh [hSwapAB], a ldh [hSwapAB], a
ld a, MODE_TGM2
ldh [hSimulationMode], a
ld hl, sSpeedCurve ld hl, sSpeedCurve
ld a, l ld a, l
ldh [hStartSpeed], a ldh [hStartSpeed], a
ld a, h ld a, h
ldh [hStartSpeed+1], a ldh [hStartSpeed+1], a
ld a, 6
ldh [hRNGRerolls], a
call TimeInit call TimeInit
call IntrInit call IntrInit
call InputInit call InputInit

Binary file not shown.

Binary file not shown.

View File

@ -282,30 +282,30 @@ Tiles::
DB $C0,$C0,$C0,$C0,$F0,$F0,$00,$00 DB $C0,$C0,$C0,$C0,$F0,$F0,$00,$00
DB $0F,$0F,$03,$03,$03,$03,$03,$03 DB $0F,$0F,$03,$03,$03,$03,$03,$03
DB $03,$03,$03,$03,$0F,$0F,$00,$00 DB $03,$03,$03,$03,$0F,$0F,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $FF,$00,$FF,$00,$FF,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $FF,$7C,$FF,$C6,$FF,$C0,$FF,$CE DB $7C,$FF,$C6,$FF,$C0,$FF,$CE,$FF
DB $FF,$C6,$FF,$C6,$FF,$7C,$00,$00 DB $C6,$FF,$C6,$FF,$7C,$FF,$00,$00
DB $FF,$38,$FF,$6C,$FF,$C6,$FF,$FE DB $38,$FF,$6C,$FF,$C6,$FF,$FE,$FF
DB $FF,$C6,$FF,$C6,$FF,$C6,$00,$00 DB $C6,$FF,$C6,$FF,$C6,$FF,$00,$00
DB $FF,$C6,$FF,$EE,$FF,$FE,$FF,$D6 DB $C6,$FF,$EE,$FF,$FE,$FF,$D6,$FF
DB $FF,$C6,$FF,$C6,$FF,$C6,$00,$00 DB $C6,$FF,$C6,$FF,$C6,$FF,$00,$00
DB $FF,$FE,$FF,$C0,$FF,$C0,$FF,$F8 DB $FE,$FF,$C0,$FF,$C0,$FF,$F8,$FF
DB $FF,$C0,$FF,$C0,$FF,$FE,$00,$00 DB $C0,$FF,$C0,$FF,$FE,$FF,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $FF,$00,$FF,$00,$FF,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $FF,$7C,$FF,$C6,$FF,$C6,$FF,$C6 DB $7C,$FF,$C6,$FF,$C6,$FF,$C6,$FF
DB $FF,$C6,$FF,$C6,$FF,$7C,$00,$00 DB $C6,$FF,$C6,$FF,$7C,$FF,$00,$00
DB $FF,$C6,$FF,$C6,$FF,$6C,$FF,$6C DB $C6,$FF,$C6,$FF,$6C,$FF,$6C,$FF
DB $FF,$6C,$FF,$38,$FF,$38,$00,$00 DB $6C,$FF,$38,$FF,$38,$FF,$00,$00
DB $FF,$FE,$FF,$C0,$FF,$C0,$FF,$F8 DB $FE,$FF,$C0,$FF,$C0,$FF,$F8,$FF
DB $FF,$C0,$FF,$C0,$FF,$FE,$00,$00 DB $C0,$FF,$C0,$FF,$FE,$FF,$00,$00
DB $FF,$FC,$FF,$C6,$FF,$C6,$FF,$FC DB $FC,$FF,$C6,$FF,$C6,$FF,$FC,$FF
DB $FF,$F8,$FF,$DC,$FF,$CE,$00,$00 DB $F8,$FF,$DC,$FF,$CE,$FF,$00,$00
DB $FF,$18,$FF,$3C,$FF,$3C,$FF,$18 DB $18,$FF,$3C,$FF,$3C,$FF,$18,$FF
DB $FF,$18,$FF,$00,$FF,$18,$00,$00 DB $18,$FF,$00,$FF,$18,$FF,$00,$00
DB $7C,$7C,$C6,$C6,$C0,$C0,$CE,$CE DB $7C,$7C,$C6,$C6,$C0,$C0,$CE,$CE
DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00 DB $C6,$C6,$C6,$C6,$7C,$7C,$00,$00
DB $38,$38,$6C,$6C,$C6,$C6,$FE,$FE DB $38,$38,$6C,$6C,$C6,$C6,$FE,$FE
@ -326,26 +326,26 @@ Tiles::
DB $F8,$F8,$DC,$DC,$CE,$CE,$00,$00 DB $F8,$F8,$DC,$DC,$CE,$CE,$00,$00
DB $18,$18,$3C,$3C,$3C,$3C,$18,$18 DB $18,$18,$3C,$3C,$3C,$3C,$18,$18
DB $18,$18,$00,$00,$18,$18,$00,$00 DB $18,$18,$00,$00,$18,$18,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $FF,$00,$FF,$00,$FF,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $FF,$FC,$FF,$C6,$FF,$C6,$FF,$FC DB $FC,$FF,$C6,$FF,$C6,$FF,$FC,$FF
DB $FF,$F8,$FF,$DC,$FF,$CE,$00,$00 DB $F8,$FF,$DC,$FF,$CE,$FF,$00,$00
DB $FF,$FE,$FF,$C0,$FF,$C0,$FF,$F8 DB $FE,$FF,$C0,$FF,$C0,$FF,$F8,$FF
DB $FF,$C0,$FF,$C0,$FF,$FE,$00,$00 DB $C0,$FF,$C0,$FF,$FE,$FF,$00,$00
DB $FF,$FC,$FF,$30,$FF,$30,$FF,$30 DB $FC,$FF,$30,$FF,$30,$FF,$30,$FF
DB $FF,$30,$FF,$30,$FF,$30,$00,$00 DB $30,$FF,$30,$FF,$30,$FF,$00,$00
DB $FF,$FC,$FF,$C6,$FF,$C6,$FF,$FC DB $FC,$FF,$C6,$FF,$C6,$FF,$FC,$FF
DB $FF,$F8,$FF,$DC,$FF,$CE,$00,$00 DB $F8,$FF,$DC,$FF,$CE,$FF,$00,$00
DB $FF,$C6,$FF,$EE,$FF,$7C,$FF,$38 DB $C6,$FF,$EE,$FF,$7C,$FF,$38,$FF
DB $FF,$70,$FF,$E0,$FF,$C0,$00,$00 DB $70,$FF,$E0,$FF,$C0,$FF,$00,$00
DB $FF,$F0,$FF,$C0,$FF,$C0,$FF,$C0 DB $F0,$FF,$C0,$FF,$C0,$FF,$C0,$FF
DB $FF,$C0,$FF,$C0,$FF,$F0,$00,$00 DB $C0,$FF,$C0,$FF,$F0,$FF,$00,$00
DB $FF,$38,$FF,$6C,$FF,$C6,$FF,$FE DB $38,$FF,$6C,$FF,$C6,$FF,$FE,$FF
DB $FF,$C6,$FF,$C6,$FF,$C6,$00,$00 DB $C6,$FF,$C6,$FF,$C6,$FF,$00,$00
DB $FF,$0F,$FF,$03,$FF,$03,$FF,$03 DB $0F,$FF,$03,$FF,$03,$FF,$03,$FF
DB $FF,$03,$FF,$03,$FF,$0F,$00,$00 DB $03,$FF,$03,$FF,$0F,$FF,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $FF,$00,$FF,$00,$FF,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC DB $FC,$FC,$C6,$C6,$C6,$C6,$FC,$FC
@ -366,26 +366,26 @@ Tiles::
DB $03,$03,$03,$03,$0F,$0F,$00,$00 DB $03,$03,$03,$03,$0F,$0F,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $FF,$00,$FF,$00,$FF,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $FF,$7C,$FF,$C6,$FF,$C6,$FF,$C6 DB $7C,$FF,$C6,$FF,$C6,$FF,$C6,$FF
DB $FF,$D6,$FF,$DE,$FF,$7C,$00,$00 DB $D6,$FF,$DE,$FF,$7C,$FF,$00,$00
DB $FF,$C6,$FF,$C6,$FF,$C6,$FF,$C6 DB $C6,$FF,$C6,$FF,$C6,$FF,$C6,$FF
DB $FF,$C6,$FF,$C6,$FF,$7C,$00,$00 DB $C6,$FF,$C6,$FF,$7C,$FF,$00,$00
DB $FF,$18,$FF,$18,$FF,$18,$FF,$18 DB $18,$FF,$18,$FF,$18,$FF,$18,$FF
DB $FF,$18,$FF,$18,$FF,$18,$00,$00 DB $18,$FF,$18,$FF,$18,$FF,$00,$00
DB $FF,$FC,$FF,$30,$FF,$30,$FF,$30 DB $FC,$FF,$30,$FF,$30,$FF,$30,$FF
DB $FF,$30,$FF,$30,$FF,$30,$00,$00 DB $30,$FF,$30,$FF,$30,$FF,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $FF,$00,$FF,$00,$FF,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $FF,$F0,$FF,$C0,$FF,$C0,$FF,$C0 DB $F0,$FF,$C0,$FF,$C0,$FF,$C0,$FF
DB $FF,$C0,$FF,$C0,$FF,$F0,$00,$00 DB $C0,$FF,$C0,$FF,$F0,$FF,$00,$00
DB $FF,$FC,$FF,$C6,$FF,$C6,$FF,$FC DB $FC,$FF,$C6,$FF,$C6,$FF,$FC,$FF
DB $FF,$C6,$FF,$C6,$FF,$FC,$00,$00 DB $C6,$FF,$C6,$FF,$FC,$FF,$00,$00
DB $FF,$0F,$FF,$03,$FF,$03,$FF,$03 DB $0F,$FF,$03,$FF,$03,$FF,$03,$FF
DB $FF,$03,$FF,$03,$FF,$0F,$00,$00 DB $03,$FF,$03,$FF,$0F,$FF,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $FF,$00,$FF,$00,$FF,$00,$00,$00 DB $00,$FF,$00,$FF,$00,$FF,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $7C,$7C,$C6,$C6,$C6,$C6,$C6,$C6 DB $7C,$7C,$C6,$C6,$C6,$C6,$C6,$C6
@ -412,38 +412,38 @@ Tiles::
DB $A2,$A2,$A2,$A2,$BB,$BB,$00,$00 DB $A2,$A2,$A2,$A2,$BB,$BB,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00 DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$80,$80,$00,$00 DB $00,$00,$00,$00,$80,$80,$00,$00
DB $07,$00,$05,$00,$05,$00,$05,$00 DB $00,$00,$EE,$00,$48,$00,$4A,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $4A,$00,$4E,$00,$00,$00,$00,$00
DB $02,$00,$06,$00,$02,$00,$02,$00 DB $00,$00,$A4,$00,$EC,$00,$A4,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $A4,$00,$AE,$00,$00,$00,$00,$00
DB $07,$00,$01,$00,$02,$00,$04,$00 DB $00,$00,$EE,$00,$48,$00,$4A,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $4A,$00,$4E,$00,$00,$00,$00,$00
DB $07,$00,$01,$00,$03,$00,$01,$00 DB $00,$00,$AC,$00,$E2,$00,$A4,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $A8,$00,$AE,$00,$00,$00,$00,$00
DB $05,$00,$05,$00,$07,$00,$01,$00 DB $00,$00,$EE,$00,$48,$00,$4A,$00
DB $01,$00,$00,$00,$00,$00,$00,$00 DB $4A,$00,$4E,$00,$00,$00,$00,$00
DB $07,$00,$04,$00,$07,$00,$01,$00 DB $00,$00,$AC,$00,$E2,$00,$A4,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $A2,$00,$AC,$00,$00,$00,$00,$00
DB $07,$00,$04,$00,$07,$00,$05,$00 DB $00,$00,$AE,$00,$A8,$00,$EE,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $A8,$00,$AE,$00,$00,$00,$00,$00
DB $07,$00,$01,$00,$02,$00,$02,$00 DB $00,$00,$88,$00,$88,$00,$88,$00
DB $02,$00,$00,$00,$00,$00,$00,$00 DB $88,$00,$EE,$00,$00,$00,$00,$00
DB $07,$00,$05,$00,$07,$00,$05,$00 DB $00,$00,$E4,$00,$8A,$00,$CE,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $8A,$00,$EA,$00,$00,$00,$00,$00
DB $07,$00,$05,$00,$07,$00,$01,$00 DB $00,$00,$6A,$00,$8A,$00,$44,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $24,$00,$C4,$00,$00,$00,$00,$00
DB $07,$00,$05,$00,$07,$00,$05,$00 DB $00,$00,$AA,$00,$AA,$00,$44,$00
DB $05,$00,$00,$00,$00,$00,$00,$00 DB $AA,$00,$AA,$00,$00,$00,$00,$00
DB $07,$00,$05,$00,$06,$00,$05,$00 DB $00,$00,$AA,$00,$AA,$00,$44,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $AA,$00,$AA,$00,$00,$00,$00,$00
DB $07,$00,$04,$00,$04,$00,$04,$00 DB $00,$00,$AA,$00,$AA,$00,$44,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $AA,$00,$AA,$00,$00,$00,$00,$00
DB $06,$00,$05,$00,$05,$00,$05,$00 DB $00,$00,$AA,$00,$AA,$00,$44,$00
DB $06,$00,$00,$00,$00,$00,$00,$00 DB $AA,$00,$AA,$00,$00,$00,$00,$00
DB $07,$00,$04,$00,$06,$00,$04,$00 DB $00,$00,$AA,$00,$AA,$00,$44,$00
DB $07,$00,$00,$00,$00,$00,$00,$00 DB $AA,$00,$AA,$00,$00,$00,$00,$00
DB $07,$00,$04,$00,$06,$00,$04,$00 DB $00,$00,$AA,$00,$AA,$00,$44,$00
DB $04,$00,$00,$00,$00,$00,$00,$00 DB $AA,$00,$AA,$00,$00,$00,$00,$00
DB $7C,$7C,$42,$42,$41,$41,$5D,$48 DB $7C,$7C,$42,$42,$41,$41,$5D,$48
DB $6E,$4C,$5B,$4A,$79,$49,$00,$00 DB $6E,$4C,$5B,$4A,$79,$49,$00,$00
DB $68,$58,$58,$68,$68,$58,$48,$78 DB $68,$58,$58,$68,$68,$58,$48,$78
@ -472,6 +472,66 @@ Tiles::
DB $2D,$25,$3D,$3D,$01,$01,$00,$00 DB $2D,$25,$3D,$3D,$01,$01,$00,$00
DB $01,$01,$3D,$3D,$2D,$35,$C5,$FD DB $01,$01,$3D,$3D,$2D,$35,$C5,$FD
DB $08,$F8,$10,$F0,$E0,$E0,$00,$00 DB $08,$F8,$10,$F0,$E0,$E0,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$EE,$EE,$48,$48,$4A,$4A
DB $4A,$4A,$4E,$4E,$00,$00,$00,$00
DB $00,$00,$A4,$A4,$EC,$EC,$A4,$A4
DB $A4,$A4,$AE,$AE,$00,$00,$00,$00
DB $00,$00,$EE,$EE,$48,$48,$4A,$4A
DB $4A,$4A,$4E,$4E,$00,$00,$00,$00
DB $00,$00,$AC,$AC,$E2,$E2,$A4,$A4
DB $A8,$A8,$AE,$AE,$00,$00,$00,$00
DB $00,$00,$EE,$EE,$48,$48,$4A,$4A
DB $4A,$4A,$4E,$4E,$00,$00,$00,$00
DB $00,$00,$AC,$AC,$E2,$E2,$A4,$A4
DB $A2,$A2,$AC,$AC,$00,$00,$00,$00
DB $00,$00,$AE,$AE,$A8,$A8,$EE,$EE
DB $A8,$A8,$AE,$AE,$00,$00,$00,$00
DB $00,$00,$88,$88,$88,$88,$88,$88
DB $88,$88,$EE,$EE,$00,$00,$00,$00
DB $00,$00,$E4,$E4,$8A,$8A,$CE,$CE
DB $8A,$8A,$EA,$EA,$00,$00,$00,$00
DB $00,$00,$6A,$6A,$8A,$8A,$44,$44
DB $24,$24,$C4,$C4,$00,$00,$00,$00
DB $00,$00,$AA,$AA,$AA,$AA,$44,$44
DB $AA,$AA,$AA,$AA,$00,$00,$00,$00
DB $00,$00,$AA,$AA,$AA,$AA,$44,$44
DB $AA,$AA,$AA,$AA,$00,$00,$00,$00
DB $00,$00,$AA,$AA,$AA,$AA,$44,$44
DB $AA,$AA,$AA,$AA,$00,$00,$00,$00
DB $00,$00,$AA,$AA,$AA,$AA,$44,$44
DB $AA,$AA,$AA,$AA,$00,$00,$00,$00
DB $00,$00,$AA,$AA,$AA,$AA,$44,$44
DB $AA,$AA,$AA,$AA,$00,$00,$00,$00
DB $00,$00,$AA,$AA,$AA,$AA,$44,$44
DB $AA,$AA,$AA,$AA,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$00,$00,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00
DB $FF,$00,$FF,$00,$FF,$00,$FF,$00
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $00,$FF,$00,$FF,$00,$FF,$00,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
TilesEnd:: TilesEnd::

View File

@ -75,8 +75,8 @@ TitleScreenTilemap::
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01 DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01 DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01 DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$C1,$C2,$C3,$5D,$59 DB $01,$01,$01,$01,$01,$C1,$C2,$C3,$58,$5A
DB $52,$01,$5D,$5A,$57,$57,$5E,$01,$81,$48 DB $4F,$50,$01,$01,$01,$01,$01,$81,$C4,$C5
DB $82,$01,$01,$01,$01,$01,$01,$01,$01,$01 DB $82,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01 DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01
DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01 DB $01,$01,$01,$01,$01,$01,$01,$01,$01,$01

View File

@ -24,9 +24,8 @@ INCLUDE "globals.asm"
SECTION "High RNG Variables", HRAM SECTION "High RNG Variables", HRAM
hRNGSeed: ds 4 hRNGSeed: ds 4
hPieceHistory: ds 4 hPieceHistory: ds 6
hNextPiece:: ds 1 hNextPiece:: ds 1
hRNGRerolls:: ds 1
section "RNG Functions", ROM0 section "RNG Functions", ROM0
@ -52,6 +51,8 @@ RNGInit::
ld a, PIECE_Z ld a, PIECE_Z
ldh [hPieceHistory], a ldh [hPieceHistory], a
ldh [hPieceHistory+1], a ldh [hPieceHistory+1], a
ldh [hPieceHistory+4], a
ldh [hPieceHistory+5], a
ld a, PIECE_S ld a, PIECE_S
ldh [hPieceHistory+2], a ldh [hPieceHistory+2], a
ldh [hPieceHistory+3], a ldh [hPieceHistory+3], a
@ -72,33 +73,73 @@ RNGInit::
GetNextPiece:: GetNextPiece::
ldh a, [hRNGRerolls] : ldh a, [hSimulationMode] ; Hell?
cp a, 0 cp a, MODE_HELL
jr nz, :+ jr nz, :+
call NextPiece call NextPiece
jr .donerolling jr .donerolling
: inc a
: ldh a, [hSimulationMode] ; TGM1?
cp a, MODE_TGM1
jr nz, :+
ld a, 5
ld e, a ld e, a
: dec e jr .rollloop
: ldh a, [hSimulationMode] ; EASY?
cp a, MODE_EASY
jr nz, :+
ld a, 0
ld e, a
jr .rollloop
: ld a, 7 ; TGM2/3.
ld e, a
.rollloop
dec e
jr z, .donerolling jr z, .donerolling
call NextPiece call NextPiece
ld hl, hPieceHistory ld hl, hPieceHistory
cp a, [hl] cp a, [hl]
jr z, :- jr z, .rollloop
inc hl inc hl
cp a, [hl] cp a, [hl]
jr z, :- jr z, .rollloop
inc hl inc hl
cp a, [hl] cp a, [hl]
jr z, :- jr z, .rollloop
inc hl inc hl
cp a, [hl] cp a, [hl]
jr z, :- jr z, .rollloop
; Are we in TGM3 or EASY mode?
ld b, a
ldh a, [hSimulationMode]
cp a, MODE_TGM3
jr z, .6hist
cp a, MODE_EASY
jr z, .6hist
jr .donerolling ; If not, we're done rolling.
; If we are, extend the history by 2.
.6hist
ld a, b
inc hl
cp a, [hl]
jr z, .rollloop
inc hl
cp a, [hl]
jr z, .rollloop
.donerolling .donerolling
ldh [hNextPiece], a ldh [hNextPiece], a
ld b, a ld b, a
ldh a, [hPieceHistory+4]
ldh [hPieceHistory+5], a
ldh a, [hPieceHistory+3]
ldh [hPieceHistory+4], a
ldh a, [hPieceHistory+2] ldh a, [hPieceHistory+2]
ldh [hPieceHistory+3], a ldh [hPieceHistory+3], a
ldh a, [hPieceHistory+1] ldh a, [hPieceHistory+1]

View File

@ -63,10 +63,13 @@ SwitchToGameplay::
ld bc, GameplayTilemapEnd - GameplayTilemap ld bc, GameplayTilemapEnd - GameplayTilemap
call UnsafeMemCopy call UnsafeMemCopy
; Place a tell on the screen for RNG rerolls. ; Place a tell on the screen for mode.
ld hl, FIELD_RNGTELL ld hl, FIELD_MODE
ldh a, [hRNGRerolls] ldh a, [hSimulationMode]
add a, TILE_0_FAINT sla a
add a, TILE_MODE_FAINT_0
ld [hl+], a
inc a
ld [hl], a ld [hl], a
; Clear OAM. ; Clear OAM.
@ -352,6 +355,9 @@ delayMode:
: jp drawStaticInfo : jp drawStaticInfo
preGameOverMode: preGameOverMode:
; Spawn the failed piece.
call ForceSpawnPiece
; Draw the field in grey. ; Draw the field in grey.
; Yes. This really unrolls the loop that many times. ; Yes. This really unrolls the loop that many times.
ld hl, wField+(4*10) ld hl, wField+(4*10)

View File

@ -89,14 +89,17 @@ SwitchToTitle::
TitleEventLoopHandler:: TitleEventLoopHandler::
; Increment RNG leniency? ; Increment mode?
ldh a, [hSelectState] ldh a, [hSelectState]
cp a, 1 cp a, 1
jr nz, :+ jr nz, :+
ldh a, [hRNGRerolls] ldh a, [hSimulationMode]
inc a inc a
and a, $0F cp a, 5
ldh [hRNGRerolls], a jr nz, .write
xor a, a
.write
ldh [hSimulationMode], a
jp EventLoopPostHandler jp EventLoopPostHandler
; Start game? ; Start game?
@ -255,10 +258,13 @@ TitleVBlankHandler::
ld hl, TITLE_LEVEL+1 ld hl, TITLE_LEVEL+1
ld [hl], a ld [hl], a
; Draw RNG ; Draw Mode
ldh a, [hRNGRerolls] ld hl, TITLE_MODE
add a, TILE_0 ldh a, [hSimulationMode]
ld hl, TITLE_ROLLS sla a
add a, TILE_MODE_0
ld [hl+], a
inc a
ld [hl], a ld [hl], a
; Draw A/B ; Draw A/B