|
@ -78,6 +78,7 @@ void tetris_highscore_saveHighScore(tetris_highscore_index_t nIndex, |
|
|
{ |
|
|
{ |
|
|
if (nHighScore > tetris_highscore_retrieveHighScore(nIndex)) |
|
|
if (nHighScore > tetris_highscore_retrieveHighScore(nIndex)) |
|
|
{ |
|
|
{ |
|
|
|
|
|
eeprom_busy_wait(); |
|
|
eeprom_write_word(&g_highScoreTable.nHighScore[nIndex], nHighScore); |
|
|
eeprom_write_word(&g_highScoreTable.nHighScore[nIndex], nHighScore); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -91,6 +92,7 @@ void tetris_highscore_saveHighScore(tetris_highscore_index_t nIndex, |
|
|
inline static |
|
|
inline static |
|
|
uint16_t tetris_highscore_retrieveHighScoreName(tetris_highscore_index_t nIdx) |
|
|
uint16_t tetris_highscore_retrieveHighScoreName(tetris_highscore_index_t nIdx) |
|
|
{ |
|
|
{ |
|
|
|
|
|
eeprom_busy_wait(); |
|
|
uint16_t nHighScoreName = |
|
|
uint16_t nHighScoreName = |
|
|
eeprom_read_word(&g_highScoreTable.nHighScoreName[nIdx]); |
|
|
eeprom_read_word(&g_highScoreTable.nHighScoreName[nIdx]); |
|
|
|
|
|
|
|
@ -107,6 +109,7 @@ inline static |
|
|
void tetris_highscore_saveHighScoreName(tetris_highscore_index_t nIndex, |
|
|
void tetris_highscore_saveHighScoreName(tetris_highscore_index_t nIndex, |
|
|
uint16_t nHighscoreName) |
|
|
uint16_t nHighscoreName) |
|
|
{ |
|
|
{ |
|
|
|
|
|
eeprom_busy_wait(); |
|
|
eeprom_write_word(&g_highScoreTable.nHighScoreName[nIndex], nHighscoreName); |
|
|
eeprom_write_word(&g_highScoreTable.nHighScoreName[nIndex], nHighscoreName); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|