From 5a78565934bb5900c6b03c96208bd31b6cf4dd86 Mon Sep 17 00:00:00 2001 From: iridiumR Date: Wed, 8 Jun 2022 00:33:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(MCU=E8=AF=BE=E8=AE=BE):=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=B8=85=E7=A9=BA=E6=8E=92=E8=A1=8C=E6=A6=9C=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MCU/MCU_REAL_FINAL/menu.c | 44 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/MCU/MCU_REAL_FINAL/menu.c b/MCU/MCU_REAL_FINAL/menu.c index 244492c..3a9a366 100644 --- a/MCU/MCU_REAL_FINAL/menu.c +++ b/MCU/MCU_REAL_FINAL/menu.c @@ -2,6 +2,7 @@ #include "display.h" #include "delay.h" #include "draw.h" +#include "eeprom.h" #include #include #include "block.h" @@ -24,7 +25,7 @@ Menu* LAST = NULL; // code unsigned int ver _at_ 0x7ffe; enum OPR opr = idle; -static unsigned char local[2] = {0}; +static unsigned int local[4] = {0}; unsigned int score; unsigned int bestScore[10]; extern enum GS blockGameStatus; @@ -163,6 +164,8 @@ void m_about(struct _menu* this) if(LAST != &M_ABOUT) { LAST = &M_ABOUT; + local[2] = 0; + local[3] = 0; delayms(2000); drawNAME(); //绘制名字 delayms(2000); @@ -176,12 +179,49 @@ void m_about(struct _menu* this) drawSUPNUM(29, 6, (ver % 100) / 10); drawSUPNUM(38, 6, ver % 10); } - if(opr == confirm) { opr = idle; NOW = &M_MAINMENU; //转向下一菜单 clear(); + //若满足隐藏条件,清空排行榜 + if(local[2] >= 10 && local[3] >= 10) + { + IapProgramByte(IAP_ADDRESS + 0, 0); + IapProgramByte(IAP_ADDRESS + 1, 0); + IapProgramByte(IAP_ADDRESS + 2, 0); + IapProgramByte(IAP_ADDRESS + 3, 0); + IapProgramByte(IAP_ADDRESS + 4, 0); + IapProgramByte(IAP_ADDRESS + 5, 0); + IapProgramByte(IAP_ADDRESS + 6, 0); + IapProgramByte(IAP_ADDRESS + 7, 0); + IapProgramByte(IAP_ADDRESS + 8, 0); + IapProgramByte(IAP_ADDRESS + 9, 0); + IapProgramByte(IAP_ADDRESS + 10, 0); + IapProgramByte(IAP_ADDRESS + 11, 0); + IapProgramByte(IAP_ADDRESS + 12, 0); + IapProgramByte(IAP_ADDRESS + 13, 0); + IapProgramByte(IAP_ADDRESS + 14, 0); + IapProgramByte(IAP_ADDRESS + 15, 0); + IapProgramByte(IAP_ADDRESS + 16, 0); + IapProgramByte(IAP_ADDRESS + 17, 0); + IapProgramByte(IAP_ADDRESS + 18, 0); + IapProgramByte(IAP_ADDRESS + 19, 0); + } + local[2] = 0; + local[3] = 0; + } + if(opr == left) + { + local[2]++; + opr = idle; + delayms(20); + } + if(opr == right) + { + local[3]++; + opr = idle; + delayms(20); } }