1

I have a .dat file that (I believe) stores high scores in advmame in a file called hiscore.dat. From what I understand, and I could be wrong, the .dat file stores the game name and the memory address of the high scores for that game:

foogame:  ;******foo game
0:6105:9e:10:10
0:7661:1:10:10
0:7641:1:00:00
0:7621:1:00:00
0:7601:1:07:07
0:75e1:1:06:06
0:75c1:1:05:05
0:75a1:1:00:00

In python, is there a way to read the values stored at these memory locations?

Edited - Per the instructions at the top of the file:

;This file should be in the same directory of MAME.EXE .
;
;This file can be edited with a text editor, but keep the same format:
; all fields are separated by a colon (:)
; <gamename>:
; <cpu>:<address>:<length>:<value to wait for
; in the first byte/word>:<value to wait for in the last byte/word>
; [repeat the above as many times as necessary]

Some addition info on the hiscore.dat:

Info on hiscore.dat for mame

A hiscore.dat file is needed so your modified version of MAME will read to know which memory addresses contain the high scores for supported games. 
PhillyNJ
  • 3,859
  • 4
  • 38
  • 64
  • 3
    I highly doubt that the file stores the memory locations of the scores- memory is a temporary storage system and would not be preserved after the computer restarts or the game is closed. Are you sure that the values aren't the highscores themselves? – Blue Ice Mar 09 '14 at 21:59
  • 1
    I seriously doubt that a memory address is stored in a file. When the games end, what is stored in that address is simply erased. – hivert Mar 09 '14 at 22:00
  • 1
    I stand with the doubters:-) but sometimes its faster to try anyway, see this answer http://stackoverflow.com/questions/8250625/access-memory-address-in-python using the ctypes module to read memory directly. – James Mar 09 '14 at 22:02
  • Like I said, "I believe" and "I could be wrong", which you all are probably right. :) – PhillyNJ Mar 09 '14 at 22:04
  • What are the actual scores and initials for this data? – Peter Gibson Mar 09 '14 at 23:37
  • I added some more info to the OP. As for your question, an example of the 1st score is 018500 PMV. – PhillyNJ Mar 10 '14 at 00:19

1 Answers1

1

MAME is an emulator for the various kinds of computers used in arcade game systems. The "memory addresses" being referred to in that file are addresses into the memory of the emulated machine, not into your own system's memory. While it might be possible to use debugging hooks of your OS to peer into MAME's memory while it is running a game and find the emulated system's memory within it (and then look up the game's high scores within the emulated memory), I suspect that it will be much more trouble than it is worth.

Indeed, following the "info" link you provide suggests that the whole point of highscores.dat is to tell MAME how to find the high scores within the running game so that it can save them for you (to some other file, I assume). The link is about the writer's experience applying a patch to do that saving.

Blckknght
  • 100,903
  • 11
  • 120
  • 169