From 7b9f62d0ba7bb8304ce05e22c14119d82eee2466 Mon Sep 17 00:00:00 2001 From: Randy Thiemann Date: Fri, 20 Oct 2023 08:52:57 +0200 Subject: [PATCH] Game over mode --- src/state_gameplay.asm | 30 ++++++++++++++++++++++++++++-- tools/Emulicious.ini | 2 +- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/state_gameplay.asm b/src/state_gameplay.asm index 88e3bc4..b90cdb4 100644 --- a/src/state_gameplay.asm +++ b/src/state_gameplay.asm @@ -255,7 +255,6 @@ pieceInMotionMode: ld [wMode], a ; No fall through this time. - : jr drawStaticInfo @@ -264,7 +263,34 @@ delayMode: gameOverMode: - ; TODO. + ld de, sGameOver + ld hl, wField+(10*10) + ld bc, 10 + call UnsafeMemCopy + + ; Retry? + ldh a, [hAState] + cp a, 1 + jr nz, :+ + call RNGInit + call ScoreInit + call LevelInit + call FieldInit + ld a, PIECE_NONE + ldh [hHeldPiece], a + xor a, a + ldh [hHoldSpent], a + ld a, MODE_LEADY + ld [wMode], a + ld a, 90 + ld [wModeCounter], a + jr drawStaticInfo + + ; Quit +: ldh a, [hBState] + cp a, 1 + jp z, $100 + jr drawStaticInfo ; Always draw the score, level, next piece, and held piece. diff --git a/tools/Emulicious.ini b/tools/Emulicious.ini index 581a548..b5dc806 100644 --- a/tools/Emulicious.ini +++ b/tools/Emulicious.ini @@ -1,5 +1,5 @@ #Emulicious settings file -#Fri Oct 20 08:40:06 CEST 2023 +#Fri Oct 20 08:52:26 CEST 2023 WindowEventViewerWindowHeight=1416 WindowEventViewerWindowDivider=876 WindowMemoryTracerWindowY=631