Saving high scores
-
- Posts: 12
- Joined: Mon Jan 18, 2010 8:08 am
- Location: Vancouver, Canada
Saving high scores
So, is anyone trying to write high scores to flash/eeprom? Which should I use, and how should I declare the save location?
Re: Saving high scores
Hey,
Use the eeprom since the flash will get overwritten by the bootloader etc. Take a look at the EEPROM Reserve List and reserve the block(s) you need.
*Edit - Also keep in mind each block is 32 bytes(2 byte id + 30 data bytes) and there are 64 total blocks(This is correct Uze/Paul?). Check out Space Invaders source code for an example of loading/saving a highscore.
Use the eeprom since the flash will get overwritten by the bootloader etc. Take a look at the EEPROM Reserve List and reserve the block(s) you need.
*Edit - Also keep in mind each block is 32 bytes(2 byte id + 30 data bytes) and there are 64 total blocks(This is correct Uze/Paul?). Check out Space Invaders source code for an example of loading/saving a highscore.
Re: Saving high scores
Yes, 64 blocks, 644's eeprom is 2kB, 2048/32 = 64. But two blocks are reserved for the kernel (I don't think they're being used right now), so we can only count on 62 blocks.D3thAdd3r wrote:there are 64 total blocks(This is correct Uze/Paul?)
Re: Saving high scores
One of them is currently used for the bootloader to store the CRC of the game currently flashed.I don't think they're being used right now
-
- Posts: 12
- Joined: Mon Jan 18, 2010 8:08 am
- Location: Vancouver, Canada
Re: Saving high scores
Awesome, guys. Thanks.
FYI though, it appears that EepromWriteBlock(...) scans blocks 2..63 but EepromReadBlock(...) only scans blocks 0..31
FYI though, it appears that EepromWriteBlock(...) scans blocks 2..63 but EepromReadBlock(...) only scans blocks 0..31