The save: one versioned, checksummed record in SRAM. More...
#include <snes.h>Go to the source code of this file.
Macros | |
| #define | SAVE_NONE 0xFFFF |
| save_best when no round was ever won. | |
| #define | SAVE_SIZE 8 |
| Bytes of the record. | |
| #define | SAVE_VERSION 1 |
| Layout version: a record of another version is not read. | |
Values of save_status | |
| #define | SAVE_CORRUPT 3 |
| #define | SAVE_FRESH 2 |
| #define | SAVE_NO_SRAM 4 |
| #define | SAVE_OK 1 |
| #define | SAVE_UNREAD 0 |
Functions | |
| void | saveLoad (void) |
| Read the record; whatever is there, the globals end up valid. | |
| u8 | saveRecord (u16 time) |
| Note a won round and write the record. | |
Variables | |
| u16 | save_best |
| Best time in frames, or SAVE_NONE. | |
| u8 | save_status |
| What saveLoad() found. | |
| u8 | save_wins |
| Rounds won, capped at 255. | |
The save: one versioned, checksummed record in SRAM.
| #define SAVE_CORRUPT 3 |
a record whose version, checksum or content is wrong: the defaults
| #define SAVE_FRESH 2 |
no record (blank SRAM): the defaults
| #define SAVE_NO_SRAM 4 |
the cartridge declares no SRAM: the defaults, nothing is written
| #define SAVE_NONE 0xFFFF |
save_best when no round was ever won.
| #define SAVE_OK 1 |
a valid record was read
| #define SAVE_SIZE 8 |
Bytes of the record.
| #define SAVE_UNREAD 0 |
saveLoad() has not run
| #define SAVE_VERSION 1 |
Layout version: a record of another version is not read.
| void saveLoad | ( | void | ) |
Read the record; whatever is there, the globals end up valid.
< the cartridge declares no SRAM: the defaults, nothing is written
< no record (blank SRAM): the defaults
< frames on the clock: 30 s at 60 Hz
< a record whose version, checksum or content is wrong: the defaults
< a valid record was read
Note a won round and write the record.
time beat the best. < frames on the clock: 30 s at 60 Hz
|
extern |
Best time in frames, or SAVE_NONE.
|
extern |
What saveLoad() found.
|
extern |
Rounds won, capped at 255.