-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscorelist.mps
64 lines (49 loc) · 1.51 KB
/
scorelist.mps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
option title, "Score List (*.raw) structure"
=
=
= Tiny Hexer script for .raw structure view in
= mirkes.de's tiny hex editor
=
=
option GlobalVars, 1
option ReadTags, 1
option target, structureviewer
= open active editor and goto current position/0
var editor file
editor = fileopen('::current')
if ((param_count > 0) and (dword(params(0))==1))
fileseek editor, 0
else
fileseek editor, filegetprop(editor, 'selstart')
endif
var start dword
start = filegetprop(editor, 'position')
= open browser window
var browser file
browser = fileopen('::browser', 'c')
filesetprop browser, 'accepttags', 1
filewrite browser "<font color=",'"',"blue",'"',"><b><u>Score Data List structure:</u></b></font>\n\n"
filesetprop browser, 'accepttags', 0
filewrite browser "File: '",filegetprop(editor, 'filename'),"'\nPosition: ",start,"\n\n"
= read the Score List header
var _identifier dword _scorecount dword
fileread editor _identifier
if _identifier != 0x45524353
error 'Unknown file format'
endif
= print file header
var _text text
filewrite browser "struct ScoreDataList {\n"
_text = data2text(_identifier)
copytags _text _identifier
filewrite browser " DWORD identifer\t'",_text,"'\t\t(",_identifier,");\n"
fileread editor _scorecount
filewrite browser " DWORD scoreCount\t",DEC(_scorecount),";\n"
LOOP showScoreAddrList,_scorecount
LOCAL showScoreAddrList
var _addr DWORD
fileread editor _addr
filewrite browser " DWORD score",DEC(loop),"addr\t",_addr,";\n"
TAGVAR _addr,_addr,1
filewrite browser "\t\t\t[",_addr,"]\n"
ENDLOCAL