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); } }