The high score file for Marble Madness is purely in hexdecimal. The scores are saved as 3 byte integers and the name is stored as 2 bytes for 3 characters. Here’s a sample of the data

C R 14500
UFO 14000
GJL 13500
SKP 13000
PCT 12500
PTR 12000
JDH 11500
DAZ 11170
DAT 11000
JFS 10500

Each entry in the high score table is stored in 5 bytes. The first three bytes are score. 0038A4 = 14500. In Python I appended each of the bytes into a three byte array, converted into an int and then a string with `tempScore = str(int.from_bytes(tempIntScore,byteorder='big'))`

The name was a lot trickier to work out, 2 bytes for 3 characters. As by pure fluke when I created a test entry and used my name “DAZ”, the one right below was just one character difference “DAT”
DAZ = (hex)1942 = (dec)6466
DAT = (hex) 193C = (dec)6460
The decimal value had a difference of 6, the number of positions in the alphabet between T and Z. This leaves a question of the values for the first two characters. Taking a punt that the char values starting with A = 1, B = 2 and so on, I divided the decimal values by the number val of the first character so….
DAZ = (hex)1942 = (dec)6466 / (D)4 = 1616
SKP = (hex)7888 = (dec)30856 / (S)19 = 1624
UFO = (hex)843F = (dec)33855 / (U)21= 1612
A little guess work fixed the value to the first character as the decimal value / 1600. Knowing this and knowing that the last character was to the power of 1 lead to the relisation that the second character was worth a multiple of 40.
DAZ = 6466. 6466 – (1600*(D)4) = 66
66-Z(26) = 40 and as A=1 then 1*40 works.
D A Z
4 1 26
(4*1600) + (1*40) + (26*1)
6400 + 40 + 26
6466

Spaces are worth 0.

0 = ‘ ‘, 1 = ‘A’, 2 = ‘B’ …… 26 = ‘Z’

This entry was posted in Uncategorized. Bookmark the permalink.