Open eadmaster opened 4 years ago
I suggest the following.
Type
Type 0: Direct value. The entirety of the score is converted to a hexadecimal value and is stored in the game, then converted back whenever displayed. Ex. Score 9999 is stored 0x27 0x0F (or 0x0F 0x27 depending on endianness)
Type 1: Each 2 digits is stored in 1 byte. Value is converted from hexadecimal to decimal then displayed. Ex: Score 99 is stored 0x63.
Type 2: Each 2 digits are stored in 1 byte. Value is stored in decimal, and displayed directly. Ex: Score 99 is stored 0x99.
Type 3: Each digit is stored in 1 bye. Value is stored in decimal, and displayed directly. Ex. Score 99 is stored 0x09 0x09
There's potentially more types, to be added and supported as they are encountered in games.
Order
Multiplication Factor Some games add extra zeroes to the right, but they're not actually included in the internal score tally.
The CPU memory format may be insufficient for consoles with bankswitching. I recommend adding an optional entry for banks.
I suggest adding for each game an optional list of preset events. The events will be memory offsets (space, address, bank) to ASM, and will have watchpoints tied to them that will trigger actions.
Sessions may be flagged with these flags, which will appear next to scores in listings:
Leaderboards may be three lists. Might be good to look into separating leaderboards further to separate difficulty settings.
Now for the events and associated actions whenever their execution watchpoints are tripped:
Game loads Scores from Save Data (SRAM) to "RAM Game Hi-Score". 1'. Game loads preset score to "RAM Game Hi-Score" Action: If first time only, Update "RA Game LB" with RAM Game Hi-Score(s). On subsequent times, overwrite RAM Game Hi-Score(s) with "RA Game LB" contents (might be better to make this overwriting optional and up to the player)
Initiating New Game. Action: Begin Player Session. Flag Session Flag as 1CC.
Initiating Attract Mode. Action: Abort Player Session.
Game Over / Continue Screen Action: Conclude Player Session. Session Flag 1CC disabled.
Choose "Yes" on Continue Screen Action: Begin Player Session.
Ending (may be multiple) Action: Conclude Player Session Session Flag Clear enabled IF 1CC disabled.
Accessed ingame cheat codes / debug modes Action: Session Flag "Improper" enabled.
Fallback Events and Actions:
Addition of new entries to the format: Type field
this could be useful to keep hiscores with games with no native support (https://github.com/eadmaster/console_hiscore/issues/2), but i think it would be better using string constants to describe them (e.g. lsb_value
, msb_value
, etc.)
Improvements to existing entries The CPU memory format may be insufficient for consoles with bankswitching. I recommend adding an optional entry for banks.
So far i've found no problems with NES games using bankswitching as they are mapped automatically by the emulator cores as "virtual" main memory.
Exporting Scores to Leaderboards / Updating Hi-Scores Ingame I suggest adding for each game an optional list of preset events.
I think this exceeds the aims of this project and also overlaps with RetroAchivements.
I'll try to keep things as simple as possible here so it would be easy to re-implement hiscore support in other 3rd party projects (emulators, flashcarts, etc.).
An ideal file format should:
solution 1 using json:
solution 2 using existing binary file patching formats:
Unlike the json solution they are not easily editable and could lead to confusion since they are often used for static ROM patching as well.