i've found my code, but sadly i havent found anything that actually adds a new score into the table - this would have to be done with something like SamuraiCrow's code above.
What i have found is a high-score "block file" (i've attached a copy inside a zip file) - if you want to save a nice clean highscore table file (like the ones in many WHDload patches) then i suggest you create something like this first of all - decide what size etc you want the file to be, then work backwards from there.
Step 1: Decide on a memory block "layout" - mine is a total block size of 280 ($118) bytes long.
For each score entry, this has 24 bytes of text, then 4 bytes (longword) for the score. - this repeated 10 times
if you create one of these 'manually' in a hex editor or something, you then have something to work with - later on you can write some code in AMOS to create a 'default' file like this if an existing one does not exist.
Step 2: When entering the game's menu screens, i load the file into memory with the following (AMCAF?) command:
Wload "data/highscores.data",4
Bank Name 4,"HiScores"
The second line is simply to label the bank and make it easier to spot in the AMOS editor.
Step 3: you'll want to start by simply working out how to read the data in the block file. I've used the following code to "write" my entire highscore file onto the screen. You might want to consider using a user-defined function (DEF FN) to read a specific name / score out of the data... it shouldnt be too difficult using the peek commands and adapting the "FINDSCOREDATA:" sub routine below.
You'll notice i dont display text with the TEXT or PRINT commands, but my own "SMALLTYPE:" sub routine, but GOSUB SMALLTYPE could easily be substituted for TEXT MYX,MYY,MYTEXT$
MENUEVENTS_002:
If MENUCLOCK=0
' write scores
MYTEXT$="High-scores"
MYX=-1 : MYY=490+4 : MYDELAY=3
Gosub SMALLTYPE
For FIND=1 To 10
Gosub FINDSCOREDATA
MYTEXT$=HIGHSNAME$+" "+HIGHSCORE$
MYX=-1 : MYY=20+490+FIND*12 : MYDELAY=1
Gosub SMALLTYPE
Next FIND
' write extra text
MYTEXT$="press fire to continue"
MYX=-1 : MYY=660 : MYDELAY=3
Gosub SMALLTYPE
Else If MENUCLOCK=1
MYTEXT$="press fire to continue"
MYX=-1 : MYY=660 : MYDELAY=0
Gosub SMALLTYPE
Else
Screen Copy 1,0,650,320,700 To 0,0,650
End If
Return
FINDSCOREDATA:
HIGHSCORE$="" : HIGHSNAME$=""
If FIND<1 or FIND>10 Then Return
HIGHSCORE$=Lzstr$(Leek(Start(4)+($1C*(FIND-1))+24),8)
For E=0 To $17
HIGHSNAME$=HIGHSNAME$+Chr$(Peek(Start(4)+($1C*(FIND-1))+E))
Next E
Return
Once you're reading from the highscore data block with ease, it should be simple enough to either load all the scores into an array, and adapt SamuraiCrow's code, then at the end, move the updated scores back into the block with POKE commands.
You can then save the updated block back to disk with ease using the WSAVE command.
I'm sorry this is not a more complete solution / guide, but it's worth having a look at if you are serious about learning, and hopefully this will help you with some of the elements for consideration.