Saving high scores

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
orthopteroid
Posts: 12
Joined: Mon Jan 18, 2010 8:08 am
Location: Vancouver, Canada

Saving high scores

Post by orthopteroid »

So, is anyone trying to write high scores to flash/eeprom? Which should I use, and how should I declare the save location?
User avatar
D3thAdd3r
Posts: 3222
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Saving high scores

Post by D3thAdd3r »

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.
User avatar
nebososo
Posts: 188
Joined: Sun Oct 04, 2009 10:33 pm

Re: Saving high scores

Post by nebososo »

D3thAdd3r wrote:there are 64 total blocks(This is correct Uze/Paul?)
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.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Saving high scores

Post by uze6666 »

I don't think they're being used right now
One of them is currently used for the bootloader to store the CRC of the game currently flashed.
orthopteroid
Posts: 12
Joined: Mon Jan 18, 2010 8:08 am
Location: Vancouver, Canada

Re: Saving high scores

Post by orthopteroid »

Awesome, guys. Thanks.

FYI though, it appears that EepromWriteBlock(...) scans blocks 2..63 but EepromReadBlock(...) only scans blocks 0..31
Post Reply