forked from UsernameFodder/pmdsky-debug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
overlay11.yml
526 lines (477 loc) · 15.4 KB
/
overlay11.yml
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
overlay11:
versions:
- EU
- NA
- JP
address:
EU: 0x22DCB80
NA: 0x22DC240
JP: 0x22DD8E0
length:
EU: 0x48E40
NA: 0x48C40
JP: 0x48B00
description: |-
The script engine.
This is the "main" overlay of ground mode. The script engine is what runs the ground mode scripts contained in the SCRIPT folder, which are written in a custom scripting language. These scripts encode things like cutscenes, screen transitions, ground mode events, and tons of other things related to ground mode.
functions:
- name: FuncThatCallsCommandParsing
address:
EU: 0x22DDAA4
NA: 0x22DD164
JP: 0x22DE804
- name: ScriptCommandParsing
address:
EU: 0x22DE6A4
NA: 0x22DDD64
JP: 0x22DF404
- name: SsbLoad2
address:
EU: 0x22E503C
NA: 0x22E46FC
JP: 0x22E5D28
- name: StationLoadHanger
address:
EU: 0x22E5514
NA: 0x22E4BD4
JP: 0x22E6200
- name: ScriptStationLoadTalk
address:
EU: 0x22E5D24
NA: 0x22E53E4
JP: 0x22E6A10
- name: SsbLoad1
address:
EU: 0x22E6690
NA: 0x22E5D50
JP: 0x22E737C
- name: ScriptSpecialProcessCall
address:
EU: 0x22E7A58
NA: 0x22E7118
JP: 0x22E874C
description: |-
Processes calls to the OPCODE_PROCESS_SPECIAL script opcode.
r0: some struct containing a callback of some sort, only used for special process ID 18
r1: special process ID
r2: first argument, if relevant? Probably corresponds to the second parameter of OPCODE_PROCESS_SPECIAL
r3: second argument, if relevant? Probably corresponds to the third parameter of OPCODE_PROCESS_SPECIAL
return: return value of the special process if it has one, otherwise 0
- name: GetSpecialRecruitmentSpecies
address:
EU: 0x22E897C
NA: 0x22E803C
JP: 0x22E9670
description: |-
Returns an entry from RECRUITMENT_TABLE_SPECIES.
Note: This indexes without doing bounds checking.
r0: index into RECRUITMENT_TABLE_SPECIES
return: enum monster_id
- name: PrepareMenuAcceptTeamMember
address:
EU: 0x22E89C0
NA: 0x22E8080
JP: 0x22E96B4
description: |-
Implements SPECIAL_PROC_PREPARE_MENU_ACCEPT_TEAM_MEMBER (see ScriptSpecialProcessCall).
r0: index into RECRUITMENT_TABLE_SPECIES
- name: InitRandomNpcJobs
address:
EU: 0x22E8A64
NA: 0x22E8124
JP: 0x22E9758
description: |-
Implements SPECIAL_PROC_INIT_RANDOM_NPC_JOBS (see ScriptSpecialProcessCall).
r0: job type? 0 is a random NPC job, 1 is a bottle mission
r1: ?
- name: GetRandomNpcJobType
address:
EU: 0x22E8AFC
NA: 0x22E81BC
JP: 0x22E97F0
description: |-
Implements SPECIAL_PROC_GET_RANDOM_NPC_JOB_TYPE (see ScriptSpecialProcessCall).
return: job type?
- name: GetRandomNpcJobSubtype
address:
EU: 0x22E8B14
NA: 0x22E81D4
JP: 0x22E9808
description: |-
Implements SPECIAL_PROC_GET_RANDOM_NPC_JOB_SUBTYPE (see ScriptSpecialProcessCall).
return: job subtype?
- name: GetRandomNpcJobStillAvailable
address:
EU: 0x22E8B30
NA: 0x22E81F0
JP: 0x22E9824
description: |-
Implements SPECIAL_PROC_GET_RANDOM_NPC_JOB_STILL_AVAILABLE (see ScriptSpecialProcessCall).
return: bool
- name: AcceptRandomNpcJob
address:
EU: 0x22E8B98
NA: 0x22E8258
JP: 0x22E988C
description: |-
Implements SPECIAL_PROC_ACCEPT_RANDOM_NPC_JOB (see ScriptSpecialProcessCall).
return: bool
- name: GroundMainLoop
address:
EU: 0x22E90B4
NA: 0x22E8774
JP: 0x22E9DA8
description: |-
Appears to be the main loop for ground mode.
Based on debug print statements and general code structure, it seems contain a core loop, and dispatches to various functions in response to different events.
r0: mode, which is stored globally and used in switch statements for dispatch
return: return code
- name: GetAllocArenaGround
address:
EU: 0x22E9C9C
NA: 0x22E935C
JP: 0x22EA990
description: |-
The GetAllocArena function used for ground mode. See SetMemAllocatorParams for more information.
r0: initial memory arena pointer, or null
r1: flags (see MemAlloc)
return: memory arena pointer, or null
- name: GetFreeArenaGround
address:
EU: 0x22E9D00
NA: 0x22E93C0
JP: 0x22EA9F4
description: |-
The GetFreeArena function used for ground mode. See SetMemAllocatorParams for more information.
r0: initial memory arena pointer, or null
r1: pointer to free
return: memory arena pointer, or null
- name: GroundMainReturnDungeon
address:
EU: 0x22E9D54
NA: 0x22E9414
JP: 0x22EAA48
description: |-
Implements SPECIAL_PROC_RETURN_DUNGEON (see ScriptSpecialProcessCall).
No params.
- name: GroundMainNextDay
address:
EU: 0x22E9D78
NA: 0x22E9438
JP: 0x22EAA6C
description: |-
Implements SPECIAL_PROC_NEXT_DAY (see ScriptSpecialProcessCall).
No params.
- name: JumpToTitleScreen
address:
EU: 0x22E9F1C
NA: 0x22E95DC
JP: 0x22EAC10
description: |-
Implements SPECIAL_PROC_JUMP_TO_TITLE_SCREEN and SPECIAL_PROC_0x1A (see ScriptSpecialProcessCall).
r0: int, argument value for SPECIAL_PROC_JUMP_TO_TITLE_SCREEN and -1 for SPECIAL_PROC_0x1A
return: bool (but note that the special process ignores this and always returns 0)
- name: ReturnToTitleScreen
address:
EU: 0x22E9FD4
NA: 0x22E9694
JP: 0x22EACC8
description: |-
Implements SPECIAL_PROC_RETURN_TO_TITLE_SCREEN (see ScriptSpecialProcessCall).
r0: fade duration
return: bool (but note that the special process ignores this and always returns 0)
- name: ScriptSpecialProcess0x16
address:
EU: 0x22EA034
NA: 0x22E96F4
JP: 0x22EAD28
description: |-
Implements SPECIAL_PROC_0x16 (see ScriptSpecialProcessCall).
r0: bool
- name: LoadBackgroundAttributes
address:
EU: 0x22EC480
NA: 0x22EBB40
JP: 0x22ED174
description: |-
Note: unverified, ported from Irdkwia's notes
r0: [output] bg_attr_str
r1: bg_id
- name: LoadMapType10
address:
EU: 0x22ED664
NA: 0x22ECD24
JP: 0x22EE358
description: |-
Note: unverified, ported from Irdkwia's notes
r0: [output] buffer_ptr
r1: map_id
r2: dungeon_info_str
r3: additional_info
- name: LoadMapType11
address:
EU: 0x22EDB84
NA: 0x22ED244
JP: 0x22EE878
description: |-
Note: unverified, ported from Irdkwia's notes
r0: [output] buffer_ptr
r1: map_id
r2: dungeon_info_str
r3: additional_info
- name: GetSpecialLayoutBackground
address:
EU: 0x22F1F00
NA: 0x22F155C
JP: 0x22F2BA8
description: |-
Note: unverified, ported from Irdkwia's notes
r0: bg_id
r1: dungeon_info_str
r2: additional_info
r3: copy_fixed_room_layout
- name: SetAnimDataFields
address:
EU: 0x22F51BC
NA: 0x22F481C
JP: 0x22F5E74
description: |-
Sets some fields on the animation struct?
r0: animation pointer
r1: ?
- name: SetAnimDataFieldsWrapper
address:
EU: 0x22F52FC
NA: 0x22F495C
JP: 0x22F5FB4
description: Calls SetAnimDataFields with the second argument right-shifted by 16.
- name: InitAnimDataFromOtherAnimData
address:
EU: 0x22F5604
NA: 0x22F4C64
JP: 0x22F62E8
description: |-
Appears to partially copy some animation data into another animation struct, plus doing extra initialization on the destination struct.
r0: dst
r1: src
- name: SetAnimDataFields2
address:
EU: 0x22F5C88
NA: 0x22F52E8
JP: 0x22F696C
description: |-
Sets some fields on the animation struct, based on the params?
r0: animation pointer
r1: flags
r2: ?
- name: LoadObjectAnimData
address:
EU: 0x22F7800
NA: 0x22F6E60
JP: 0x22F84E4
description: |-
Loads the animation (WAN) data for a given object index?
r0: animation pointer
r1: object index
r2: flags
- name: InitAnimDataFromOtherAnimDataVeneer
address:
NA: 0x22F6F0C
description: |-
Likely a linker-generated veneer for InitAnimDataFromOtherAnimData.
See https://developer.arm.com/documentation/dui0474/k/image-structure-and-generation/linker-generated-veneers/what-is-a-veneer-
r0: dst
r1: src
- name: AnimRelatedFunction
address:
NA:
- 0x22F6F14
- 0x22F7064
description: |-
Does more stuff related to animations...probably?
r0: animation pointer?
others: ?
- name: SprintfStatic
address:
EU: 0x2309868
NA: 0x2308ECC
JP: 0x230A478
description: |-
Statically defined copy of sprintf(3) in overlay 11. See arm9.yml for more information.
r0: str
r1: format
...: variadic
return: number of characters printed, excluding the null-terminator
- name: StatusUpdate
address:
EU: 0x2314478
NA: 0x2313A98
JP: 0x2314FFC
description: |-
Implements SPECIAL_PROC_STATUS_UPDATE (see ScriptSpecialProcessCall).
No params.
data:
- name: OVERLAY11_UNKNOWN_TABLE__NA_2316A38
address:
NA: 0x2316A38
length:
NA: 0xA0
description: |-
Multiple entries are pointers to the string "script.c"
Note: unverified, ported from Irdkwia's notes
type: undefined4[40]
- name: SCRIPT_COMMAND_PARSING_DATA
address:
NA: 0x2316AD8
length:
NA: 0x20
description: Used by ScriptCommandParsing somehow
- name: SCRIPT_OP_CODE_NAMES
address:
NA: 0x2316AF8
length:
NA: 0x1B18
description: "Opcode name strings pointed to by entries in SCRIPT_OP_CODES (script_opcode::name)"
- name: SCRIPT_OP_CODES
address:
EU: 0x2318FF0
NA: 0x2318610
JP: 0x2319B74
length:
EU: 0xBF8
NA: 0xBF8
JP: 0xBF8
description: |-
Table of opcodes for the script engine. There are 383 8-byte entries.
These opcodes underpin the various ExplorerScript functions you can call in the SkyTemple SSB debugger.
type: struct script_opcode_table
- name: OVERLAY11_DEBUG_STRINGS
address:
NA: 0x2319208
length:
NA: 0x8E4
description: Strings used with various debug printing functions throughout the overlay
- name: C_ROUTINE_NAMES
address:
NA: 0x2319AEC
length:
NA: 0x2D3C
description: "Common routine name strings pointed to by entries in C_ROUTINES (common_routine::name)"
- name: C_ROUTINES
address:
EU: 0x231D208
NA: 0x231C828
JP: 0x231DD8C
length:
NA: 0x15E8
JP: 0x15E8
description: |-
Common routines used within the unionall.ssb script (the master script). There are 701 8-byte entries.
These routines underpin the ExplorerScript coroutines you can call in the SkyTemple SSB debugger.
type: struct common_routine_table
- name: GROUND_WEATHER_TABLE
address:
NA: 0x231DE10
length:
NA: 0x30
description: |-
Note: unverified, ported from Irdkwia's notes
type: struct ground_weather_entry[12]
- name: GROUND_WAN_FILES_TABLE
address:
EU: 0x231E820
NA: 0x231DE40
length:
EU: 0x10BC
NA: 0x1014
description: |-
Note: unverified, ported from Irdkwia's notes
type: char[343][12]
- name: OBJECTS
address:
EU: 0x231F8DC
NA: 0x231EE54
JP: 0x23203B8
length:
EU: 0x1AAC
NA: 0x1A04
JP: 0x1A04
description: |-
Table of objects for the script engine, which can be placed in scenes. There are a version-dependent number of 12-byte entries.
type: struct script_object[length / 12]
- name: RECRUITMENT_TABLE_LOCATIONS
address:
EU: 0x23213C4
NA: 0x2320894
length:
EU: 0x16
NA: 0x16
description: |-
Table of dungeon IDs corresponding to entries in RECRUITMENT_TABLE_SPECIES.
type: struct dungeon_id_16[22]
- name: RECRUITMENT_TABLE_LEVELS
address:
EU: 0x23213DC
NA: 0x23208AC
length:
EU: 0x2C
NA: 0x2C
description: |-
Table of levels for recruited Pokémon, corresponding to entries in RECRUITMENT_TABLE_SPECIES.
type: int16_t[22]
- name: RECRUITMENT_TABLE_SPECIES
address:
EU: 0x2321408
NA: 0x23208D8
length:
EU: 0x2C
NA: 0x2C
description: |-
Table of Pokémon recruited at special locations, such as at the ends of certain dungeons (e.g., Dialga or the Seven Treasures legendaries) or during a cutscene (e.g., Cresselia and Manaphy).
Interestingly, this includes both Heatran genders. It also includes Darkrai for some reason?
type: struct monster_id_16[22]
- name: LEVEL_TILEMAP_LIST
address:
EU: 0x232185C
NA: 0x2320D2C
length:
EU: 0x288
NA: 0x288
description: |-
Irdkwia's notes: FIXED_FLOOR_GROUND_ASSOCIATION
type: struct level_tilemap_list_entry[81]
- name: OVERLAY11_OVERLAY_LOAD_TABLE
address:
EU: 0x2323B9C
NA: 0x232306C
length:
EU: 0x150
NA: 0x150
description: |-
The overlays that can be loaded while this one is loaded.
Each entry is 16 bytes, consisting of:
- overlay group ID (see arm9.yml or enum overlay_group_id in the C headers for a mapping between group ID and overlay number)
- function pointer to entry point
- function pointer to destructor
- possibly function pointer to frame-update function?
type: struct overlay_load_entry[21]
- name: UNIONALL_RAM_ADDRESS
address:
EU: 0x23257E4
NA: 0x2324CA4
description: "[Runtime]"
- name: GROUND_STATE_MAP
address:
EU: 0x2325800
NA: 0x2324CC0
description: "[Runtime]"
- name: GROUND_STATE_PTRS
address:
EU: 0x2325834
NA: 0x2324CF4
length:
EU: 0x18
NA: 0x18
description: |-
Host pointers to multiple structure used for performing an overworld scene
type: struct main_ground_data