Jump to content
IGNORED

Storing game high scores for legacy games on TNFS servers.


Recommended Posts

Would it be practical to create an App Key .key file for the ATR being accessed on the TNFS server? Maybe use DUNIT for the drive the ATR is mounted on (this would be for hacking in code for saving/parsing hi scores). I'm kind of fumbling with the idea, but it would separate out a read-only ATR, and a read-write .key file.

 

I appreciate this would require some hacking of legacy disks, rather than relying on their R/W sector I/O code, but it could provide a consistent mechanism for shared hi-score tables.

Edited by E474
Added note on hacking legacy disks.
Link to comment
Share on other sites

A video showing the High Score Enabled feature now available for the #atari8bit #fujinet.

 

By using a few previously unused bytes in the header of ATR files, a range of sectors can be specified to be read-write, even if the disk image is mounted read only. With this feature, games on public TNFS servers can have high score tables on their disk images marked read-write, and scores will be written back to the server, transparently, without needing to change the game.

 

In addition, web pages can be set up to post high score table changes, as demonstrated in the video.

 

You can see the scores for these games here, and they refresh every 30 seconds: http://scores.irata.online/

 

Youtube video: 

enjoy

-Thom

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Anybody have any ideas on how we can graft on high-score tables to other existing games? ;)

 

(maybe e.g. a piece of code that could be patched on, which takes over screen/keyboard/etc so we can grab initials, and post to server, then restore what we took over?)

 

-Thom

Edited by tschak909
Link to comment
Share on other sites

Just curious - is scores.irata.online currently updating correctly?  I achieved three scores last night that were entered into the high score tables in the respective games (Frogger, Spelunker, and BC's Quest For Tires), but none appear to be there today.  In fact, it looks exactly the same as before I started playing.

 

FWIW, initials entered were USR, disk images were mounted RO, and were selected from the High Score Enabled directory.

Link to comment
Share on other sites

11 minutes ago, x=usr(1536) said:

Just curious - is scores.irata.online currently updating correctly?  I achieved three scores last night that were entered into the high score tables in the respective games (Frogger, Spelunker, and BC's Quest For Tires), but none appear to be there today.  In fact, it looks exactly the same as before I started playing.

 

FWIW, initials entered were USR, disk images were mounted RO, and were selected from the High Score Enabled directory.

Did you update your firmware? (You can see in the fujinet flasher if high score mode gets enabled when the high score table blocks are written)

-Thom

  • Like 1
Link to comment
Share on other sites

6 minutes ago, tschak909 said:

Did you update your firmware? (You can see in the fujinet flasher if high score mode gets enabled when the high score table blocks are written)

-Thom

My bad - I missed the announcement that a new firmware version was out.  I'll take care of that this evening.  Apologies for the inconvenience :)

Link to comment
Share on other sites

21 hours ago, tschak909 said:

Anybody have any ideas on how we can graft on high-score tables to other existing games? ;)

 

(maybe e.g. a piece of code that could be patched on, which takes over screen/keyboard/etc so we can grab initials, and post to server, then restore what we took over?)

 

-Thom

If you could put the set username code into the FujiNet config program, you could just hack in an SIO call that takes the score as a parameter, and wouldn't have to worry about messing up the screen, handle keyboard input, etc., mid-game.

 

Actually, if you could define Player 1, Player 2, Player 3, etc., names in config, this might be a bit more useful.

Edited by E474
Added in multi player name comment in config
Link to comment
Share on other sites

2 hours ago, E474 said:

If you could put the set username code into the FujiNet config program, you could just hack in an SIO call that takes the score as a parameter, and wouldn't have to worry about messing up the screen, handle keyboard input, etc., mid-game.

 

Actually, if you could define Player 1, Player 2, Player 3, etc., names in config, this might be a bit more useful.

definitely something to explore. would you like to take a crack at implementing it? I can point you in the right direction.

 

I'm also investigating writing an asm high score routine that can be easily called and bolted on that writes to sector 720.

 

We have some games with source code that build into usable code, such as: 

https://atariwiki.org/wiki/attach/PAC-MAN/PAC-MAN_Source_Code_2.zip

 

-Thom

Edited by tschak909
Link to comment
Share on other sites

Hi @tschak909,

 

   OK, I will see if I can put something together, but I know I won't have much free time until next weekend (22nd). Also, I have a DevKit ESP32, but haven't bread boarded it together yet (I think I have all the other components), but I do have a FujiNet-PC setup on a Raspberry Pi Model 1 that should be fine. 

 

   Wouldn't it be easier to delegate sector writing to the FujiNet, which just uses the sector(s) specified in the ATR header, rather than a fixed sector #?

 

   You could also always submit high scores to the FujiNet, but it would only update the high score list if the score was actually in the top 10, 20, etc.

Link to comment
Share on other sites

3 minutes ago, E474 said:

Hi @tschak909,

 

   OK, I will see if I can put something together, but I know I won't have much free time until next weekend (22nd). Also, I have a DevKit ESP32, but haven't bread boarded it together yet (I think I have all the other components), but I do have a FujiNet-PC setup on a Raspberry Pi Model 1 that should be fine. 

 

   Wouldn't it be easier to delegate sector writing to the FujiNet, which just uses the sector(s) specified in the ATR header, rather than a fixed sector #?

 

   You could also always submit high scores to the FujiNet, but it would only update the high score list if the score was actually in the top 10, 20, etc.

I'm trying to prevent the need for a dedicated server.

-Thom

 

Link to comment
Share on other sites

Hi @tschak909,

 

   I meant the FujiNet firmware would process the high score code.

 

   I thought it would be something like:

 

  siov($70,Dunit,Dcommand=$add_high_score,write,dbuf=address_of_score,dbyte=$80,daux=type_of_score)

 

where type_of_score would be one of:

 

daux1 = player_#

+

daux2 = one of

   ATASCI_TEXT 

   SCREEN_BYTE 

   2_BYTE_INT 

   4_BYTE_INT

   4_BYTE_BCD

   6_BYTE_BCD

 

etc.

 

Then to hack in the call to siov, you just need to figure out the screen location or memory location containing the value for the score in the legacy game you want to save.

The firmware processes the data frame against the highscore sector data according to daux2 to see if it's a high score, and updates it using the text for the player# and the processed data for the high score contained in the data frame.

 

High score processing is done on the high score sectors specified by the ATR header bytes.

 

Link to comment
Share on other sites

40 minutes ago, E474 said:

Hi @tschak909,

 

   I meant the FujiNet firmware would process the high score code.

 

   I thought it would be something like:

 

  siov($70,Dunit,Dcommand=$add_high_score,write,dbuf=address_of_score,dbyte=$80,daux=type_of_score)

 

where type_of_score would be one of:

 

daux1 = player_#

+

daux2 = one of

   ATASCI_TEXT 

   SCREEN_BYTE 

   2_BYTE_INT 

   4_BYTE_INT

   4_BYTE_BCD

   6_BYTE_BCD

 

etc.

 

Then to hack in the call to siov, you just need to figure out the screen location or memory location containing the value for the score in the legacy game you want to save.

The firmware processes the data frame against the highscore sector data according to daux2 to see if it's a high score, and updates it using the text for the player# and the processed data for the high score contained in the data frame.

 

High score processing is done on the high score sectors specified by the ATR header bytes.

 

Ah ok I see. Interesting. gonna grind this through my head. :)

 

What can I do to help?

 

-Thom

Edited by tschak909
Link to comment
Share on other sites

1 hour ago, tschak909 said:

Ah ok I see. Interesting. gonna grind this through my head. :)

 

What can I do to help?

 

-Thom

Thanks! I will try and set up a dev environment on Bullseye, and figure out which bits of FujiNet need to be extended, but I am time limited at the moment.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

9 hours ago, tschak909 said:

Some games ALSO have a high-score routine, but no way to persist it. These could also be patched.

I'd hazard a guess that a MAME-style approach to saving high scores on machines that originally had no persistence for them could work.

 

https://github.com/mamedev/mame/blob/5ab93130eb223aadabb6faebb1b4299e6000120c/docs/source/plugins/hiscore.rst

 

Basically, the hiscore.dat file contains info on the relevant memory locations; the plugin reads the data in those locations and dumps it out to disk.  Pretty straightforward; the only real PITA is figuring out exactly where in memory they reside.  Not impossible by any means, but often time-consuming even with the debugger.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...