From c024598ce5ea8c5286d0aab076d8d1ea0f510c3a Mon Sep 17 00:00:00 2001 From: Randy Thiemann Date: Fri, 20 Oct 2023 08:46:11 +0200 Subject: [PATCH] Initial delay mode code. --- src/field.asm | 7 ++++++- src/state_gameplay.asm | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/field.asm b/src/field.asm index 46f9287..e1640f8 100644 --- a/src/field.asm +++ b/src/field.asm @@ -361,6 +361,9 @@ CanPieceFit: TrySpawnPiece:: + ; Always reset these for a new piece. + ldh a, [hCurrentLockDelay] + ldh [hCurrentLockDelayRemaining], a ldh a, [hCurrentFramesPerGravityTick] ldh [hTicksUntilG], a @@ -771,6 +774,9 @@ FieldProcess:: .postmove + ; TODO: Do we need to reset the lock timer? + ; TODO: Do we need to decrement the lock timer? + ; TODO: What tile do we use to draw the piece? ; Draw the piece. @@ -791,7 +797,6 @@ FieldProcess:: pop hl pop de call DrawPiece - ret ENDC diff --git a/src/state_gameplay.asm b/src/state_gameplay.asm index f52dbf4..88e3bc4 100644 --- a/src/state_gameplay.asm +++ b/src/state_gameplay.asm @@ -248,7 +248,12 @@ pieceInMotionMode: ld [wMode], a ; Do we go into delay state? - ; TODO + ldh a, [hCurrentLockDelayRemaining] + cp a, 0 + jr nz, :+ + ld a, MODE_DELAY + ld [wMode], a + ; No fall through this time. : jr drawStaticInfo