-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssbm-memory-config.toml
158 lines (136 loc) · 6.93 KB
/
ssbm-memory-config.toml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# ================================================================================
# README
# ================================================================================
#
# This file is organized into 4 sections
# - structure:
# This outlines the primitive data structure of the data found in this
# config which is a memory address mapping to a structure containing the
# data label and the value( which implicitly holds type information ).
# However, block data has no value because it's only perpose it to point
# to other data.
# - addresses:
# These are addresses of values of the game that do not need to be
# computed using offsets.
# - blocks:
# Block data describes the start of data blocks. data blocks contain
# memory locations that can be obtained by calculating the offset in the
# offset section. Block section headers have the same correspoding name
# to their offsets making blocks and offsets indexable by each others
# header information.
# - offsets:
# Offsets are used to calculate the abosolute addresses given a block of
# data. They typically represent attributes of a data structure similiar
# to a "C" data structure. Block section headers have the same correspoding name
# to their offsets making blocks and offsets indexable by each others
# header information.
#
# Sources pull heavily from these resources which will be references in comments
# as the following:
# - Achilles1515:
# https://github.com/Achilles1515/20XX-Melee-Hack-Pack/blob/master/SSBM%20Facts.txt:
# - SSBM datasheet:
# https://docs.google.com/spreadsheets/d/1JX2w-r2fuvWuNgGb6D3Cs4wHQKLFegZe2jhbBuIhCG8/edit#gid=12
#
# ================================================================================
# DATA
# ================================================================================
[structure]
# the first the memory block then a dot then the offset
label = "pichu.nair"
# numeric data either an int, float, or "string". hex values interpretted as int
value = "" # 0/0xdeadbeef, 0.0, "string"
# type of data to decode "float" "int" "string" "short"
type = "uint"
# what this struture maps to on the q table
q_type = "attack"
# q_types map to where a peice of data falls in the q table. data that
# contributes to the bounds of a q_type has the q type "static". Data that
# depends on the q table for its bounds has the corresponding name of the q_type
# it depends on i.e. q_type = "x" depends on x. There are some value that are
# hard coded for the game such as percentage ranging from 0-999
[rewards]
p1.falls = 1.0
p2.falls = -1.0
[q_types]
x = { min = "stage.blastzone_left", max = "stage.blastzone_right", delta = 8, type = "float16" }
y = { min = "stage.blastzone_bottom", max = "stage.blastzone_top", delta = 8, type = "float16" }
percentage = { min = 0, max = 160, delta = 15, type = "uint8" } # could be 999 but 150 is more realistic
# buttons = { min = 0, max = 1, delta = 1, type = "uint8" }
# sticks = { min = 0, max = 1, delta = 0.125, type = "uint8" }
[addresses]
# 80479D60 = { label = "global_frame_counter", value = 0 , type = "int" }
# 803D4A50 = { label = "game_duration_pause_toggle", value = 0.0 , type = "" }
# 8111674C = { label = "p4_cursor_x_position", value = 0.0 , type = "float" }
# 81116750 = { label = "p4_cursor_y_position", value = 0.0 , type = "float" }
# 811176EC = { label = "p3_cursor_x_position", value = 0.0 , type = "float" }
# 811176F0 = { label = "p3_cursor_y_position", value = 0.0 , type = "float" }
# 8111826C = { label = "p2_cursor_x_position", value = 0.0 , type = "float" }
# 81118270 = { label = "p2_cursor_y_position", value = 0.0 , type = "float" }
# 81118DEC = { label = "p1_cursor_x_position", value = 0.0 , type = "float" }
# 81118DF0 = { label = "p1_cursor_y_position", value = 0.0 , type = "float" }
[blocks]
[blocks.player]
# blocks: represent a pointer to the beggining of a player
# struct that contains data about the player
80453080 = "p1"
80453F10 = "p2"
# 80454DA0 = "p3"
# 80455C30 = "p4"
[blocks.match]
8046B6A0 = "match"
[blocks.stage]
8049E6C8 = "stage"
[offsets]
[offsets.player]
10 = { label = "x", value = 0.0 , type = "float", q_type = "x", mod = "volitile" }
14 = { label = "y", value = 0.0 , type = "float", q_type = "y", mod = "volitile" }
# 48 = { label = "id", value = 0.0 , type = "short", mod = "volitile" }
# 30 = { label = "direction", value = 0 , type = "float", mod = "volitile" }
# Facing direction Float. 1 is right, -1 is left
# 40 = { label = "facing_direction", value = 0.0 , type = "float", mod = "volitile" }
60 = { label = "percentage", value = 0 , type = "short", q_type = "percentage", mod = "volitile" }
# generic entity pointer
68 = { label = "falls", value = 0 , type = "int" }
# 8C = { label = "SDs", value = 0 , type = "short", mod = "volitile" }
# 54 = { label = "attack_ratio", value = 0.0 , type = "float", mod = "volitile" }
# 58 = { label = "defense_ratio", value = 0.0 , type = "float", mod = "volitile" }
# B0 = "entity"
# 8E = { label = "stocks", value = 0 , type = "int", mod = "volitile" }
# 0x660 Digital Button Data
# 0 is on ground 1 is in air
# 0 = normal, 1 = invulnerable, 2 = intangible
# 1988 = { label = "body_state", value = 0 , type = "string", mod = "volitile" }
[offsets.match]
# Set to 01 to initiate "match end" load sequence - Achilles1515
# 8016c864, might be player ID that won the match (7 = no contest, 9 = training
# mode exit) - Achilles1515
# 0008 = { label = "winner_player_id", value = 0 , type = "string" }
# 000D = { label = "player_last_died", value = 0x06 , type = "short" }
# 00=ingame, 01=match finished (I think.) - Achilles1515
0024 = { label = "frame_count", value = 0 , type = "int" }
# 0028 = { label = "seconds_left", value = "" , type = "int" }
# 0x002C = { label = "subseconds", value = 0 , type = "" }
# 00=ingame, 01=match finished - Achilles1515
[offsets.stage]
0074 = { label = "blastzone_left", value = 0.0 , type = "float", mod = "static" }
0078 = { label = "blastzone_right", value = 0.0 , type = "float", mod = "static" }
007C = { label = "blastzone_top", value = 0.0 , type = "float", mod = "static" }
0080 = { label = "blastzone_bottom", value = 0.0 , type = "float", mod = "static" }
# [offsets.gobj]
# [offsets.entity]
# 0 = { label = "entity", value = 0.0 , type = "float", mod = "static" }
# E90 = "character_data"
# [offsets.character_data]
# 70 = { label = "action_state", value = 0.0 , type = "string", mod = "volitile" }
# 140 = { label = "in_air", value = 0.0 , type = "int", mod = "volitile" }
# add_data_address('140', 'in_air', intHandler)
# 00B0 = { label = "x", value = 0.0 , type = "float", mod = "volitile" }
# 0080 = { label = "x_vel", value = 0.0 , type = "float", mod = "volitile" }
# E0 = { label = "grounded", value = 0 , type = "int", q_type = "grounded", mod = "volitile" }
# [offsets.action_state]
# 0014 = { label = "dash", value = 0.0 , type = "short", mod = "volitile" }
# 000F WalkSlow
# 0010 WalkMiddle
# 0011 WalkFast
# 0x1968 Number of jumps used