-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththps2_sav.ksy
102 lines (95 loc) · 2.14 KB
/
thps2_sav.ksy
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
meta:
id: thps2_sav
application: Tony Hawk's Pro Skater 2 (PC)
title: Tony Hawk's Pro Skater 2 (PC) save file
file-extension: sav
endian: le
doc-ref: https://github.com/DCxDemo/LegacyTHPS/blob/master/formats/thps2_sav.ksy
seq:
- id: magic # "SC" - magic word
type: u2
- id: version # 0x112 - save file version?
type: u2
- id: name
type: strz
encoding: ascii
size: 0x5C
- id: icon # likely memcard icon leftover from psx?
size: 0x1A4
- id: char_career
type: char_career_entry
repeat: expr
repeat-expr: 20 # 16 chars + 4 cas ! 24 in korean thps
- id: score_table
type: score_table_level
repeat: expr
repeat-expr: 14
- id: gap_mask
type: gap_mask
repeat: expr
repeat-expr: 13 # 8 levels + 2 hidden + 3 legacy?
- id: skipdata
size: 0x1a0
- id: horse_name
type: strz
encoding: ascii
size: 16
- id: cas
type: cas_entry
repeat: expr
repeat-expr: 4
types:
char_career_entry:
seq:
- id: career_flags
type: u4
- id: total_cash # total amount of money
type: u4
- id: remaining_cash # cash available to spend
type: u4
- id: level_flags # 2 bytes per level, 10 bits - goals, 3 bits - medals, maybe more?
type: u2
repeat: expr
repeat-expr: 13
- id: unk
size: 10
- id: value2
type: u4
- id: decks # bit flag per unlocked deck
type: u4
- id: stats # just byte per stat
size: 10
- id: rest_of_data # more data
size: 0xc2
score_table_level:
seq:
- id: entries
type: score_table_entry
repeat: expr
repeat-expr: 8
score_table_entry:
seq:
- id: label
type: str
encoding: ascii
size: 3
- id: skater
type: u1
- id: score
type: u4
gap_mask: # allows for 12*8=96 gaps per level
seq:
- id: data
size: 12
cas_entry:
seq:
- id: name
type: strz
encoding: ascii
size: 16
- id: hometown
type: strz
encoding: ascii
size: 16
- id: data
size: 0x60