From b9e5813223409f664de4949c73cd5970e198aeae Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sat, 4 May 2024 12:58:02 +0200 Subject: [PATCH] flash --- game-ctrl/game.c | 8 ++++++-- rgb-driver/colors.S | 2 ++ rgb-driver/colors.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/game-ctrl/game.c b/game-ctrl/game.c index ec54d8e..44963fa 100644 --- a/game-ctrl/game.c +++ b/game-ctrl/game.c @@ -25,7 +25,7 @@ static uint16_t delayFactor(uint16_t level) { typedef enum { e_Start, e_NewStone, e_Down, e_DownDelay, - e_ClearRowInit, e_ClearRowNext, e_ClearRowCheck, e_ClearRowFlash, e_ClearRowWipe, + e_ClearRowInit, e_ClearRowNext, e_ClearRowCheck, e_ClearRowFlash, e_ClearRowFlashDelay, e_ClearRowWipe, e_GameOver, e_GameOverFill, e_GameOverWipe, e_GameOverDelay } state_t; @@ -114,7 +114,11 @@ void gameExec(void *handle) { break; case e_ClearRowFlash: - canvasFillRow(clearCheckCnt, _white); + canvasFillRow(clearCheckCnt, _flash); + state = e_ClearRowFlashDelay; + break; + + case e_ClearRowFlashDelay: state = e_ClearRowWipe; break; diff --git a/rgb-driver/colors.S b/rgb-driver/colors.S index 397f3cf..692fa19 100644 --- a/rgb-driver/colors.S +++ b/rgb-driver/colors.S @@ -35,4 +35,6 @@ white: .byte 0xff>>DIMM_FACTOR, 0xff>>DIMM_FACTOR, 0xff>>DIMM_FACTOR, 0 red: .byte 0xff>>DIMM_FACTOR, 0x00>>DIMM_FACTOR, 0x00>>DIMM_FACTOR, 0 +flash: + .byte 0xff, 0xff, 0xff, 0 diff --git a/rgb-driver/colors.h b/rgb-driver/colors.h index c2bc46a..352fdd4 100644 --- a/rgb-driver/colors.h +++ b/rgb-driver/colors.h @@ -16,6 +16,7 @@ #define _yellow 0x0b #define _white 0x0c #define _red 0x0d +#define _flash 0x0e