feat(MCU课设): 增加清空排行榜隐藏方法

This commit is contained in:
iridiumR 2022-06-08 00:33:44 +08:00
parent c7abe9d0d6
commit 5a78565934

View file

@ -2,6 +2,7 @@
#include "display.h"
#include "delay.h"
#include "draw.h"
#include "eeprom.h"
#include <stdio.h>
#include <stdlib.h>
#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);
}
}