MYCO curve and rot mode.

This commit is contained in:
Randy Thiemann 2023-11-07 09:14:43 +01:00
parent 0829978152
commit e9caff748c
18 changed files with 3747 additions and 3575 deletions

View File

@ -41,6 +41,7 @@ Select the rotation rules:
- ARS1: Classic ARS from TGM1 and TGM2.
- ARS2: ARS from TGM3.
- NES: No kicks.
- MYCO: Like ARS1, but without I, L, J and T restrictions.
### Drop Mode
Choose how the up and down buttons act:
@ -51,7 +52,7 @@ Choose how the up and down buttons act:
- NONE: Up does nothing. Down locks.
### Speed Curve
Select between several speed curves including the DMGTRIS default speed curve, TGM1, TGM3, as well as DEATH and SHIRASE mode. In addition there's a "CHILL" curve for when you just want to enjoy some tetris. It doesn't speed up very fast at all.
Select between several speed curves including the DMGTRIS default speed curve, TGM1, TGM3, as well as DEATH and SHIRASE mode. In addition there's a "CHILL" curve for when you just want to enjoy some tetris. It doesn't speed up very fast at all. The MYCO speed curve mimics the excellent game Tromi by Mycophobia.
Note that all modes use the same scoring and they are all infinite.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,16 @@ SECTION "Banking Variables", WRAM0
wBankBackup: ds 4
SECTION "Banking Functions", ROM0
BankingInit::
ld a, BANK_OTHER
ld [wBankBackup], a
ld [wBankBackup+1], a
ld [wBankBackup+2], a
ld [wBankBackup+3], a
ret
SECTION "Switch Bank", ROM0[$08]
; Pushes the current bank to the stach, switches to bank in B.
RSTSwitchBank::

View File

@ -1055,6 +1055,12 @@ FieldProcess::
cp a, PIECE_O
jp z, .norot
; MYCO always tries to kick.
ld a, [wRotModeState]
cp a, ROT_MODE_MYCO
jp z, .trykickright
ldh a, [hCurrentPiece]
; S/Z always kick.
cp a, PIECE_S
jr z, .trykickright
@ -2187,10 +2193,13 @@ FieldDelay::
cp a, 0
ret nz
; Add one level if we're not at a breakpoint.
; Add one level if we're not at a breakpoint and not in MYCO speed curve.
ldh a, [hRequiresLineClear]
cp a, $FF
jr z, .generatenextpiece
ld a, [wSpeedCurveState]
cp a, SCURVE_MYCO
jr z, .generatenextpiece
ld e, 1
call LevelUp
@ -3283,6 +3292,12 @@ BigFieldProcess::
cp a, PIECE_O
jp z, .norot
; MYCO always tries to kick.
ld a, [wRotModeState]
cp a, ROT_MODE_MYCO
jp z, .trykickright
ldh a, [hCurrentPiece]
; S/Z always kick.
cp a, PIECE_S
jr z, .trykickright
@ -4417,10 +4432,13 @@ BigFieldDelay::
cp a, 0
jp nz, BigWidenField
; Add one level if we're not at a breakpoint.
; Add one level if we're not at a breakpoint and not in MYCO speed curve.
ldh a, [hRequiresLineClear]
cp a, $FF
jr z, .generatenextpiece
ld a, [wSpeedCurveState]
cp a, SCURVE_MYCO
jr z, .generatenextpiece
ld e, 1
call LevelUp

View File

@ -312,6 +312,8 @@ GBCGameplayProcess::
ld a, [wSpeedCurveState]
cp a, SCURVE_CHIL
ld a, $01 ;Green
jr z, .goverride
ld a, $02 ;Green
; Are we 20G?
.goverride
@ -526,6 +528,8 @@ GBCBigGameplayProcess::
ld a, [wSpeedCurveState]
cp a, SCURVE_CHIL
ld a, $01 ;Green
jr z, .goverride
ld a, $02 ;Green
; Are we 20G?
.goverride

View File

@ -278,6 +278,7 @@ UpdateGrade::
jp UpdateGradeDEAT ;DEAT
jp UpdateGradeSHIR ;SHIR
no_jump ;CHIL
no_jump ;MYCO
; Jumps to the grade decay function for the current mode.
@ -300,6 +301,7 @@ DecayGradeProcess::
no_jump ;DEAT
no_jump ;SHIR
no_jump ;CHIL
no_jump ;MYCO
@ -324,6 +326,7 @@ DecayGradeDelay::
no_jump ;DEAT
no_jump ;SHIR
no_jump ;CHIL
no_jump ;MYCO
; Get the four most significant figures of the score in BC as BCD.

View File

@ -233,6 +233,7 @@ DEF TILE_PIECE_BONE EQU 104
DEF TILE_SMALL_0 EQU 213
DEF TILE_BONE EQU 104
DEF TILE_QUEUE_BONE EQU 105
DEF TILE_ROT_MODE_MYCO EQU 253
DEF GAME_OVER_R10 EQU 147
DEF GAME_OVER_R12 EQU 167
DEF GAME_OVER_R14 EQU 187
@ -257,7 +258,8 @@ DEF TILE_ROT_MODE_BASE EQU 135
DEF ROT_MODE_ARS EQU 0
DEF ROT_MODE_ARSTI EQU 1
DEF ROT_MODE_NES EQU 2
DEF ROT_MODE_COUNT EQU 3
DEF ROT_MODE_MYCO EQU 3
DEF ROT_MODE_COUNT EQU 4
; Drop mode.
DEF TILE_DROP_MODE_BASE EQU 138
@ -276,7 +278,8 @@ DEF SCURVE_TGM3 EQU 2
DEF SCURVE_DEAT EQU 3
DEF SCURVE_SHIR EQU 4
DEF SCURVE_CHIL EQU 5
DEF SCURVE_COUNT EQU 6
DEF SCURVE_MYCO EQU 6
DEF SCURVE_COUNT EQU 7
; 20G mode.
DEF TILE_HIG_MODE_BASE EQU 143

View File

@ -63,25 +63,10 @@ Main::
ld a, BANK_OTHER
ld [rROMB0], a
; Harvest entropy
call HarvestEntropy
; Let the DMG have some fun with the initial screen.
call DoDMGEffect
; Turn off LCD during initialization, but not on DMG.
ld a, [wInitialA]
cp a, $11
jr nz, :+
wait_vram
xor a, a
ldh [rLCDC], a
; Set up stack
: ld sp, wStackEnd-1
ld sp, wStackEnd-1
; GBC? Double speed mode and set up palettes.
; GBC? Double speed.
ld a, [wInitialA]
cp a, $11
jr nz, .notgbc
@ -90,6 +75,17 @@ Main::
stop
.notgbc
; Harvest entropy
call HarvestEntropy
; Let the DMG have some fun with the initial screen.
call DoDMGEffect
; Turn off LCD during initialization.
wait_vram
xor a, a
ldh [rLCDC], a
; Clear OAM.
call ClearOAM
call SetNumberSpritePositions
@ -101,13 +97,13 @@ Main::
call IntrInit
call InputInit
call SFXInit
call BankingInit
xor a, a
ldh [hMode], a
; Set up the interrupt handlers.
ld a, [wInitialA]
cp a, $11
jr z, :+
wait_vblank
: call InitializeLCDCInterrupt
call InitializeLCDCInterrupt
; Switch to gameplay state.
call SwitchToTitle

View File

@ -625,6 +625,111 @@ sSHIRSpeedCurve::
sSHIRSpeedCurveEnd::
dw $FFFF
; dw BCD_START_LEVEL, START_LEVEL, BCD_NEXT_100_LEVEL_BREAKPOINT
; db GRID_CELLS_PER_MOVE_ON_OVERFLOW, INCREMENT_PER_FRAME (0 means overflow each frame)
; db NORMAL_ARE, LINE_ARE, DAS, LOCK_DELAY, CLEAR_DELAY
sMYCOSpeedCurve::
dw $0000, 0, $0100
db 1, 4
db 20, 20, 12, 30, 20
dw $0005, 5, $0100
db 1, 6
db 20, 20, 12, 30, 20
dw $0009, 9, $0100
db 1, 8
db 20, 20, 12, 30, 20
dw $0013, 13, $0100
db 1, 10
db 20, 20, 12, 30, 20
dw $0017, 17, $0100
db 1, 12
db 20, 20, 12, 30, 20
dw $0021, 21, $0100
db 1, 16
db 20, 20, 12, 30, 20
dw $0025, 25, $0100
db 1, 32
db 20, 20, 12, 30, 20
dw $0029, 29, $0100
db 1, 48
db 20, 20, 12, 30, 20
dw $0033, 33, $0100
db 1, 64
db 20, 20, 12, 30, 20
dw $0037, 37, $0100
db 1, 80
db 20, 20, 12, 30, 20
dw $0041, 41, $0100
db 1, 96
db 20, 20, 12, 30, 20
dw $0045, 45, $0100
db 1, 112
db 20, 20, 12, 30, 20
dw $0049, 49, $0100
db 1, 128
db 20, 20, 12, 30, 20
dw $0053, 53, $0100
db 1, 144
db 20, 20, 12, 30, 20
dw $0057, 57, $0100
db 1, 160
db 20, 20, 12, 30, 20
dw $0061, 61, $0100
db 1, 192
db 20, 20, 12, 30, 20
dw $0065, 65, $0100
db 1, 224
db 20, 20, 12, 30, 20
dw $0069, 69, $0100
db 1, $00
db 20, 20, 12, 30, 20
dw $0090, 90, $0100
db 2, $00
db 20, 20, 12, 30, 20
dw $0100, 100, $0200
db 3, $00
db 20, 20, 12, 30, 20
dw $0120, 120, $0200
db 4, $00
db 20, 20, 12, 30, 20
dw $0135, 135, $0200
db 5, $00
db 20, 20, 12, 30, 20
dw $0150, 150, $0200
db 20, $00
db 20, 20, 8, 30, 20
dw $0300, 300, $0400
db 20, $00
db 1, 1, 1, 1, 1
sMYCOSpeedCurveEnd::
dw $FFFF
sSharedTiles::
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
@ -1554,8 +1659,8 @@ sGameplayTilesM::
DB $00,$FF,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$F0,$00,$08
DB $00,$F0,$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 $18,$18,$2C,$34,$62,$5E,$76,$6E
DB $24,$3C,$24,$3C,$18,$18,$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
@ -1973,8 +2078,8 @@ sGameplayTilesC::
DB $00,$FF,$00,$00,$00,$00,$00,$00
DB $00,$00,$00,$00,$00,$F0,$00,$08
DB $00,$F0,$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 $18,$18,$2C,$34,$62,$5E,$76,$6E
DB $24,$3C,$24,$3C,$18,$18,$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

Binary file not shown.

Binary file not shown.

View File

@ -50,6 +50,7 @@ sOption2::
db "ARS1"
db "ARS2"
db " NES"
db "MYCO"
sOption3::
db "FIRM"
@ -65,6 +66,7 @@ sOption4::
db "DEAT"
db "SHIR"
db "CHIL"
db "MYCO"
sOption5::
db " NO"

View File

@ -39,32 +39,28 @@ wTGM3WorstDroughtIdx: ds 1
section "RNG Functions", ROM0
HarvestEntropy::
ld hl, $D000
ld hl, $C000
ld de, $E000
.loop
ldh a, [hRNGSeed]
xor a, [hl]
inc hl
ldh [hRNGSeed], a
xor a, a
ld [hl+], a
ldh a, [hRNGSeed+1]
xor a, [hl]
inc hl
ldh [hRNGSeed+1], a
xor a, a
ld [hl+], a
ldh a, [hRNGSeed+2]
xor a, [hl]
inc hl
ldh [hRNGSeed+2], a
xor a, a
ld [hl+], a
ldh a, [hRNGSeed+3]
xor a, [hl]
inc hl
ldh [hRNGSeed+3], a
xor a, a
ld [hl+], a
ld a, h
cp a, d
@ -122,6 +118,15 @@ RNGInit::
jr nz, .complexinit
call Next7Piece
ld [hUpcomingPiece2], a
call Next7Piece
ld [hUpcomingPiece1], a
call Next7Piece
ld [hNextPiece], a
xor a, a
ldh [hPieceHistory], a
ldh [hPieceHistory+1], a
ldh [hPieceHistory+2], a
ldh [hPieceHistory+3], a
ret
; Otherwise do complex init.
@ -150,7 +155,8 @@ RNGInit::
; Save the generated piece and put it in the history.
ldh [hPieceHistory], a
ld [hUpcomingPiece2], a
ldh [hUpcomingPiece1], a
ldh [hUpcomingPiece2], a
; Generate the next 2 to fill up the queue.
call GetNextPiece
@ -298,7 +304,7 @@ GetNextTGM3Piece:
inc [hl]
; Set the drought of our most recently drawn piece to 0.
: ldh a, [hCurrentPiece]
: ldh a, [hUpcomingPiece2]
ld c, a
xor a, a
ld b, a

View File

@ -104,7 +104,7 @@ ClearOAM::
ld hl, _OAMRAM
ld bc, 160
ld d, 0
call SafeMemSet
call UnsafeMemSet
ld hl, wShadowOAM
ld bc, 160
ld d, 0
@ -139,9 +139,16 @@ ApplyTells::
ld [wSPRModeRNG+2], a
ld a, [wRotModeState]
cp a, ROT_MODE_MYCO
jr z, .myco
add a, TILE_ROT_MODE_BASE
ld [wSPRModeRot+2], a
jr .dropmode
.myco
ld a, TILE_ROT_MODE_MYCO
ld [wSPRModeRot+2], a
.dropmode
ld a, [wDropModeState]
add a, TILE_DROP_MODE_BASE
ld [wSPRModeDrop+2], a

View File

@ -575,7 +575,11 @@ GetEnd:
jr nz, :+
ld bc, sSHIRSpeedCurveEnd
ret
: ld bc, sCHILSpeedCurveEnd
: cp a, SCURVE_CHIL
jr nz, :+
ld bc, sCHILSpeedCurveEnd
ret
: ld bc, sMYCOSpeedCurveEnd
ret
@ -602,7 +606,11 @@ GetStart:
jr nz, :+
ld hl, sSHIRSpeedCurve
ret
: ld hl, sCHILSpeedCurve
: cp a, SCURVE_CHIL
jr nz, :+
ld hl, sCHILSpeedCurve
ret
: ld hl, sMYCOSpeedCurve
ret