-
Notifications
You must be signed in to change notification settings - Fork 6
/
Useful Function Names.txt
1782 lines (1490 loc) · 67.2 KB
/
Useful Function Names.txt
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
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
__OSUnhandledException
called whenever there's an error, use this to debug crashes
order__16dEevent_manager_c
called when an event is starting.
breakpoint on 800744D0 and look in r3 for the event
mainProc__16dEvent_manager_cFv
update code for events
breakpoint on 8007421C and look in r3 for a pointer to the event
order__16dEvent_manager_cFs
starts an event
breakpoint on 800744D0 and look in r3 for a pointer to the event
endProc__16dEvent_manager_c
ends an event
breakpoint on 80074134 and look in r3 for a pointer to the event
dEvent_manager_c::getMyActIdx(int, char const *const *, int, int, int)
getMyActIdx__16dEvent_manager_cFiPCPCciii
r3 - Pointer to the event manager (803C9ED4).
r4 - ? read from the entity
r5 - Pointer to a list of pointers to valid action names for this entity.
r6 - Number of actions in the list?
r7 - 1?
r8 - 0?
Returns the action index that this entity should execute next.
fopAcM_orderOtherEventId__FP10fopAc_ac_csUcUsUsUs
this is what really starts an event.
if you go up a call from here, you'll get whatever actor really started the event.
r3 - pointer to the entity that called this function
r4 - the event index to start in the event_list.dat
r5 - the event index to start in the stage's EVNT list (optional?)
r6 - 0xFFFF? (ushort)
r7 - 0? (ushort)
r8 - 1? (ushort)
fopAcM_orderOtherEvent2__FP10fopAc_ac_cPcUsUs
fopAcM_orderOtherEvent2(fopAc_ac_c *, char *, unsigned short, unsigned short)
another option for what really starts an event.
r3 - Pointer to the entity starting the event
r4 - Pointer to the event name (string)
r5 - 1?
r6 - 0xFFFF?
80025F3C fopAcM_orderPotentialEvent(fopAc_ac_c *, unsigned short, unsigned short, unsigned short)
starts a hardcoded event (e.g. for a boss)
r3 - Pointer to the entity starting the event
r4 - 1 or 2?
r5 - 0xFFFF?
r6 - 0?
dEvent_manager_c::getEventIdx
getEventIdx__16dEvent_manager_cFPCcUc
gets the index of an event in the event_list.dat based on its name (or its EVNT index)
it will try to find the event with the given EVNT index first, and fall back to the name if the EVNT index is invalid
r3 - Pointer to the event manager (803C9ED4).
r4 - pointer to the event name string
r5 - EVNT index
finish_check__12dEvDtEvent_cFv
checks if an event should end based on its flags.
80071AF4 is where it reads the ending flags.
setStartDemo__18dEvent_exception_cFi
handles starting the event specified by a player spawn's event index.
r3 - ? pointer to 803c9ef8
r4 - event index (in the EVNT list for this stage, not the event_list.dat)
dEvDtStaff_c::advanceCut(int)
updates the current action for an actor
r3 - pointer to the event actor
r4 - the index of the new action
fopAcM_getProcNameString
this gets the ACTR name from an entity. e.g. "item" or "itemFLY" for a field item.
CheckItemCreateHeap
reads from the item resources list (803842B0) and calls CreateItemHeap.
CheckFieldItemCreateHeap
reads from the field item resources list (803866B0) and calls CreateItemHeap.
dComIfGs_checkGetItem
Checks if the player owns a certain item or not.
Only work for certain items. (TODO: document which)
r3 - The item ID to check.
dComIfGs_checkGetItemNum
Returns the number of a certain item the player owns.
Only works for certain items. (TODO: document which)
r3 - The item ID to check.
execItemGet
argument r3 is the item ID. this simply calls the item get function for whatever that item is.
itemGetExecute
this is a function called when a field item is picked up.
at 800f655C it calls execItemGet
at 800f6460 it reads the item ID.
at 800f6480 it does a switch statement on the item ID.
the list of destinations for the switch are at 8038ca6c.
800f6c8c is the default, used for many items not intended to be pickups. it just calls onItem, I think? so it doesn't work for a lot of stuff.
I would need to modify the switch statement entries in this list to get other items to work as pickups.
here are some options for what to change the entries to:
800F667C - used by heart containers. makes link do the "you got an item!" thing. however it also plays the heart get sound effect.
800F6724 - makes the pickup float above your head for a second, with the sfx used for joy pendants and such. no item get text.
800F6484 - used by all items with an ID 0x84 or greater. seems to function the same as 800F6724, no item get text.
800F675C - one used by the small key. has the message and animation, and no heart sfx! perfect.
dComIfGs_isStageBossEnemy(int)
Checks if the boss for a given dungeon stage is dead.
r3 - The stage ID of the stage to check.
dSv_memBit_c::isDungeonItem(int)
Checks if a dungeon-specific flag for a particular stage save info is set.
r3 - Pointer to a stage save info.
r4 - Bit index to check.
0 - Got dungeon map.
1 - Got compass.
2 - Got big key.
3 - Boss is dead.
4 - Heart container is taken.
5 - Watched boss intro.
check_itemno
This takes a consumable item ID as an argument, and returns what consumable ID should actually be created.
Specifically:
Turns arrow refills into green rupees if the player doesn't own any of the three bow items.
Turns bomb refills into green rupees if the player doesn't own the bombs item.
Turns bait into green rupees if the player doesn't own the bait bag.
Turns spoils into green rupees if the player doesn't own the spoils bag.
GroundCheck
checks if an object hit the ground and sets y vel to 0 if so
itemActionForRupee
used for field items. calls CrrPos to update its position, which in turn calls GroundCheck.
daPy_lk_c::setDemoData(void)
this player function reads the event actions for link, and determines what action to take based on the numbers that are the first 3 chars of the action name.
getWarpAreaGridX
for Ballad of Gales warping, this gets the X pos of the next warp dest sector by an index.
entry__18dSalvage_control_cFP10fopAc_ac_cP14JPABaseEmitter
initializes a salvage point
cc_at_check
This function handles damaging an enemy.
Line 800AF07C is where it subtracts the damage from the current HP.
at_power_check
Gets the damage an attack should do.
r3 - Pointer on the stack. The amount of damage to do will be returned by storing it as a byte to [r3+8].
dCcD_GObjInf::GetTgHitGObj
This function returns the damage-dealing hitbox (cCcD_ObjAt) that damaged this entity on this frame, or null for no entity damaging this entity.
cCcD_ObjAt+0x10,4 has the bitfield of damage types the hitbox does while cCcD_ObjAt+0x14,1 has the amount of damage it deals.
setDamagePoint
Sets the amount of damage to do to the player.
f1 - Number of quarters of hearts to add to the player's health. Float. Should be negative to deal damage.
changeDamageProc
This function decides how much damage the player will actually take once they've gotten hit.
At 801108B4, it reads the amount of damage from an entity+3FFE?
But if it's not an enemy damaging the player and instead is spikes or something, then it calculates damage in some other, hardcoded way.
CalcTgPlusDmg
800AD850 - Stores the amount of damage for the enemy to do into an entity.
800AD840 - It reads the amount of damage to do from r28+0x14.
r28 was given as argument r4 to this function.
fopAcM_fastCreateItem(cXyz *, int, int, csXyz *, cXyz *, float, float, float, int, int (*)(void *))
Creates an item that already has its model loaded.
If you try to create an item that doesn't have its model loaded the game will crash.
r3 - Position
r4 - Item ID
r5 - Room number
r6 - Rotation
r7 - Scale
f1 - speed
stored to entity+254
f2 - ??? float
stored to entity+224
y velocity? upward momentum?
f3 - ??? float
stored to entity+258
gravity
r8 - Item pickup flag to set, or -1 for none
r9 - ???
can be just 0, or this can be a pointer to a function, unsure on the exact purpose
e.g. 80027254 for stealItem.
e.g. 800F3608 for itemParamSet
fopAcM_createItem(cXyz *, int, int, int, int, csXyz *, int, cXyz *)
Creates an item, and loads its model in if necessary.
r3 - Position. Pointer to a vector3 of floats.
r4 - Item ID.
r5 - Item pickup flag to set, or -1 for none.
r6 - Room number to create the item in.
r7 - unknown_2 int (e.g. 0 or 3)
If this is 0 or 2 the item will fade out if the player doesn't get it fast enough. If this is 1 or 3, it does not fade out.
If this is 1, the item is not affected by gravity. Otherwise it is.
This gets puts in the item's params with mask: 03000000.
(This is 0 for fastCreateItem, and 3 for createItemForBoss.)
r8 - Rotation. Pointer to a vector3 of shorts.
r9 - Item action. (e.g. 4, 5, 0xC)
this gets puts in the item's params with mask: FC000000
(this is 0xA for fastCreateItem, and either 0xC or 5 for createItemForBoss)
800F869C has a switch statement on this.
8038cdac is the list of switch statement cases.
0 means no action
r10 - scale (pointer to a vector3 (cXyz))
fopAcM_fastCreateItem2__FP4cXyziiiiP5csXyziP4cXyz
???
r9 - Item action.
fopAcM_createItemForBoss__FP4cXyziiP5csXyzP4cXyzi
r3 - position (pointer to a vector3 of floats (cXyz))
r4 - ???
r5 - Room number to create the item in
r6 - rotation (pointer to a vector3 of shorts (csXyz))
r7 - scale from entity RAM format (pointer to a vector3 (cXyz))
r8 - ?
if this is 1, use item action 0xC. (used in most cases)
otherwise, use item action 5. (used for the "disappear" cloud of smoke)
fopAcM_createItemForTrBoxDemo__FP4cXyziiiP5csXyzP4cXyz
r3 - position (pointer to a vector3 of floats (cXyz))
r4 - item ID
r5 - -1?
r6 - -1?
r7 - 0?
r8 - 0?
fopAcM_createItemForPresentDemo__FP4cXyziUciiP5csXyzP4cXyz
r3 -
r4 - Item ID
r5 -
r6 - Item pickup flag
r7 -
r8 -
r9 -
fopAcM_createDemoItem__FP4cXyziiP5csXyziP4cXyzUc
used by both createItemForPresentDemo and createItemForTrBoxDemo
r3 - position (pointer to a vector3 of floats (cXyz))
r4 - Item ID
r5 - Item pickup flag
r6 -
r7 -
r8 -
r9 -
fopAcM_createItemForKP2__FP4cXyziiP5csXyzP4cXyzfffUs
r3 - position (pointer to a vector3 of floats (cXyz))
r4 - item ID
r5 - Room number to create the item in
r6 - rotation (pointer to a vector3 of shorts (csXyz))
r7 - scale from entity RAM format (pointer to a vector3 (cXyz))
f1 - ??? float
stored to entity+254
speed?
f2 - ??? float
stored to entity+224
y velocity? upward momentum?
f3 - ??? float
stored to entity+258
gravity
r8 - unsigned short, bitfield.
lower byte is the item pickup flag to set.
upper byte is the prerequisite switch index.
these are stored as the item's params.
not sure if they're actually used though?
fopAcM_createItemFromTable__FP4cXyziiiiP5csXyziP4cXyz
Creates an item, potentially a randomized item from the item drop table.
r3 - Position. Pointer to a vector3 of floats.
r4 - Affects what item to spawn.
00-1F: Spawn this exact item ID.
20-3E: Subtract 20 from this value and it's the index in the random item table.
For values 2B-34, it will spawn *every* item in the corresponding entry of the table.
For values 20-2A and 35-3E, it will randomly pick just one item in the table to spawn.
3F: Spawn no item.
40-FE: Spawn this exact item ID.
FF: Spawn no item.
r5 - Item pickup flag to set, or -1 for none, or 0x7F for none.
r6 - Room number.
r7 -
r8 - Rotation. Pointer to a vector3 of shorts.
r9 -
r10 -
fopAcM_createRaceItem(cXyz *, int, int, csXyz *, int, cXyz *, int)
r3 - Position
r4 - Item ID
r5 - Item pickup flag
r6 -
r7 -
r8 -
r9 -
fopAcM_createRaceItemFromTable(cXyz *, int, int, int, csXyz *, cXyz *, int)
r3 - Position
r4 - Affects what item to spawn.
00-1F: It spawns this exact item ID.
20-3F: Subtract 20 from this value and it's the index in the random item table.
r5 - Item pickup flag
r6 -
r7 -
r8 -
r9 -
fopAcM_createDisappear(fopAc_ac_c *, cXyz *, unsigned char, unsigned char, unsigned char)
Creates a cloud of smoke for when an enemy dies.
r3 - The actor that just died.
r4 - Position to create the disappear at.
r5 - 5?
r6 - 0?
r7 - The item pickup flag for the created item?
fopAcM_createIball(cXyz *, int, int, csXyz *, int)
r3 -
r4 -
r5 -
r6 -
r7 -
fopAcM_createItemFromEnemyTable(unsigned short, int, int, cXyz *, csXyz *)
r3 -
r4 -
r5 -
r6 -
r7 -
dKyw_wind_set__Fv
updates the wind direction
dKy_daynight_check
Returns true if it is currently nighttime, or false otherwise.
Nighttime is defined as the current hour being less than 6:00AM, or more than or equal to 6:00PM.
cLib_addCalc__FPfffff
smoothly changes a float value to a desired new value.
r3 - pointer to the float value to change
f1 - desired value
f2 - percentage of the difference between curr value and desired value to change by per call
f3 - maximum amount to change by per call (absolute)
f4 - minimum amount to change by per call (absolute)
cLib_addCalc2
r3 - pointer to the float value to change
f1 -
f2 -
f3 -
f4 -
dKyw_tact_wind_set__Fss
function to change the wind direction to any angle.
r3 - ? angle stored to 803E5458. usually 0?
r4 - wind direction. stored to 803E545A.
cLib_targetAngleY(cXyz *, cXyz *)
calculates the Y angle between two points.
dLib_setNextStageBySclsNum
r3 - Exit index in the SCLS list
r4 - Room number for which room to look in the SCLS list for. If this is -1, it will look in the stage's SCLS list instead of the room's.
daPy_lk_c::startRestartRoom(unsigned long, int, float, int)
???
r3 - Pointer to the Link entity
r4 - 6?
r5 - 0xC9?
f1 - ?
r6 - 1?
setPointRestart
sets the partner's "restart" position (e.g. if a floormaster grabs them)
r3 - Pointer to the partner entity
r4 - Exit index in the stage.dzs's SCLS list for the player's partner to go through to be put in jail when captured
r5 - Partner ID number of the partner to set the restart position for
1 - Makar
2 - Medli
3 - Servant of the Tower
dSv_restart_c::setRestartOption
sets Medli or Makar's "restart" position if they're grabbed by a floormaster
checkItemGet__FUci
calls the "check has item" func for the given item ID.
r3 - item ID to check
r4 - default value to use (0 or 1) when the item-specific function returns -1
803f7338 4 r0 SComponent.a c_math.cpp
803f733c 4 r1 SComponent.a c_math.cpp
803f7340 4 r2 SComponent.a c_math.cpp
these are RNG counters
getActionBtnZ
checkItemAction
stringSet__21fopMsgM_msgDataProc_cFv
handles displaying a message string. this includes parsing commands, and calling various functions for each command.
e.g. tag_input_kenshi__21fopMsgM_msgDataProc_cFv is for the number of knight's crests you have.
stringLength__21fopMsgM_msgDataProc_cFv
handles calculating the length of a message string. (not sure if it's the character length of pixel length.)
calls sub-functions such as tag_len_stock_kenshi__21fopMsgM_msgDataProc_cFPiPfPiPiPi
getRubyString__21fopMsgM_msgDataProc_cFPcPcPcPcPcPcPfPfPi
this function handles actually parsing text commands.
r3 -
r4 -
r5 -
r6 -
r7 -
r8 - this is the command string.
for example, "crest(s)" for the number of knight's crests you have. (this string is at 8033C665.)
this is the only argument that seems to change between text commands (at least some of them).
r9 - an empty string? 8033C409
f0 -
f1 -
r10 -
dMsg_continueProc__FP13sub_msg_class
handles advancing a message to the next text box?
specifically line 80213608 stores some values to the entity that is triggering this message to tell it to advance the message?
it seems continueProc is called every frame the player has the option to press A to continue the message
80212E08 - where it checks if A is pressed. change this to read from offset 0x30 instead of 0x32 and it checks if A is down.
dMsg_stopProc__FP13sub_msg_class
handles ending a message?
dMsg_finishProc__FP13sub_msg_class
handles ending an event?
changeDemoProc__9daPy_lk_cFv
handles calling functions depending on the player's current action index (e.g. 034tact calls procTactWait_init__9daPy_lk_cFi in some cases)
procTactWait_init__9daPy_lk_cFi
function for the player to be holding the wind waker out and waiting for player input
song replay does NOT fall under this because its not waiting for player input
_create__9daArrow_cFv
function that creates an arrow
800D79E8 - reads the currently selected arrow type (0-3), only used to find the correct heap_size for this arrow type
800D72EC - calls setTypeByPlayer which stores the selected arrow type to arrow entity+0x601
800D79E8 - reads the arrow type from arrow entity+0x601
atHit_CB__FP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf
_atHit__9daArrow_cFP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf
called when an arrow hits an enemy
however, doesn't seem to actually affect anything...
SetAtTgGObjInf__4dCcSFbbP8cCcD_ObjP8cCcD_ObjP12cCcD_GObjInfP12cCcD_GObjInfP9cCcD_SttsP9cCcD_SttsP10cCcD_GSttsP10cCcD_GSttsP4cXyz
function that handles attack collisions.
calls the specific proc for each entity.
800AE448 seems to be an important line - this is what's responsible for telling the stalfos that a light arrow hit him?
the value stored seems to be the entity index of the entity that damaged it.
GetAc__22dCcD_GAtTgCoCommonBaseFv
this function reads the entity index of the entity that damaged another entity (the same one stored to by 800AE448)
this seems to be a func that returns the entity pointer of the entity that did damage.
ChkTgHit__12dCcD_GObjInfFv
checks if anything hit the enemy this frame
GetTgHitObj__12dCcD_GObjInfFv
returns the entity that hit the enemy this frame
fopMsg_Create__FPv
creates a message
breakpoint on 8002A804 and look in r0 for the message ID
fopMsgM_hyrule_language_check
Checks if a message should be displayed in Hylian script or regular language. Returns true for Hylian script.
r3 - The message ID to check
fopMsgM_itemMsgGet_c::getMesgHeader
r3 - ?
r4 - The message ID
Returns a pointer to the start of the BMG file header ("MESGbmg1")
fopMsgM_itemMsgGet_c::getMessage
r3 - ?
r4 - Pointer to the BMG file header ("MESGbmg1")
fopMsgM_itemMsgGet_c::getMesgEntry
r3 - ?
r4 - ?
dComIfG_resLoad(request_of_phase_process_class *, char const *)
loads a RARC into memory maybe?
r3 - Pointer to somewhere in the entity? e.g. entity+0x2AC
r4 - Pointer to the filename of the arc (without the .arc)
dRes_control_c::getRes(char const *, long, dRes_info_c *, int)
getRes__14dRes_control_cFPCclP11dRes_info_ci
loads a resource from a RARC
r3 - Pointer to the filename of the arc (without the .arc)
r4 - File index of the file to load.
r5 - 0x803E0BC8 (Pointer to the string "System")
r6 - ??? 0x40
returns a pointer to the loaded resource
dRes_control_c::getIDRes
loads a resource from a RARC based on the file ID
r4 - File ID
dRes_control_c::getRes(char const *, char const *, dRes_info_c *, int)
getRes__14dRes_control_cFPCcPCcP11dRes_info_ci
loads a resource from a RARC
r3 - Pointer to the filename of the arc (without the .arc)
r4 - File name of the file to load
r5 - 0x803E0BC8 (Pointer to the string "System")
r6 - ??? 0x40
returns a pointer to the loaded resource
JASystem::ResArcLoader::getResSize( (JKRArchive *, unsigned short))
Returns the filesize of a file in a RARC.
r3 -
r4 - File index of the file.
JKRArchive::readTypeResource(void *, unsigned long, unsigned long, char const *, JKRArchive *)
r3 -
r4 -
r5 - The node type to read from (e.g. "TIMG").
r6 -
r7 -
dBgWSv::Set(cBgD_t *, unsigned long)
sets the collision for an entity by a .dzb file
r3 - ? read from entity+0x2E8
r4 - Pointer to the .dzb file resource (return value from getRes)
r5 - 0?
dBgW::ChangeAttributeCodeByPathPntNo(int, unsigned long)
r3 - dBgW collision struct
r4 - ?
r5 - The new value to set for the attribute code direct value (mask 001F0000 in the second bitfield of the collision properties)
set__19dStage_startStage_cFPCcScsSc
changes the game to a different stage
set__19dSv_player_priest_cFUcR4cXyzsSc
sets the position of the player's partner (e.g. Makar) in the save file.
dComIfGs_setGameStartStage
Determines what stage, room, and spawn the player will respawn at after saving and reloading the game, or getting a Game Over and continuing.
There are various hardcoded conditions that change exactly where the respawn will be, depending on stage, stage type, story progress, etc.
For dungeons: The player will respawn at whichever spawn is pointed to by the stage.dzs's first SCLS entry.
For interiors, such as caves: The player will respawn on the sea, with the sector being determined by the sector coordinates in the current stage.dzs's 2DMA chunk.
dSv_player_return_place_c::set(char const *, signed char, unsigned char)
Sets the player's "return place" - where you will be placed when you reload your save.
r3 - 803C4C38 (pointer to dSv_player_return_place_c, the player's return place struct)
r4 - Pointer to the stage name of the return place
r5 - Room number of the return place
r6 - Spawn ID of the return place
screenSetTr__13dMenu_Fmap2_cFv
dMenu_Fmap2_c::screenSetTr(void)
Initializes the IN-credible Chart.
This includes setting the visiblity of the triforce shard markers and such.
It calls dMenu_Fmap2_c::isOpenCollectMapTriforce at 801C0A60 to check if you have each triforce chart opened and deciphered.
checkMarkCheck1__12dMenu_Fmap_cFv
handles making the blue quest markers appear on the sea chart (early game)
r30 = 8157d35c
[r30+0x46F4]+0xAA - DRC
[r30+0x4764]+0xAA - FW
[r30+0x472C]+0xAA - greatfish isle
[r30+0x479C]+0xAA - northern triangle isle
[r30+0x480C]+0xAA - eastern triangle isle
[r30+0x47D4]+0xAA - southern triangle isle
checkMarkCheck2__12dMenu_Fmap_cFv
handles making the blue quest markers appear on the sea chart (mid game)
r31 = 8157d35c
[r31+0x4844]+0xAA - WT
[r31+0x487C]+0xAA - ET
checkMarkCheck3__12dMenu_Fmap_cFv
handles making leaf icons representing korok withered trees appear on the sea chart?
execute__9daPy_lk_cFv
link's update code
8012204C - where it calls the proc for whatever state is currently in. breakpoint here to find the function for link's current state.
daPy_lk_c::checkNextActionFromButton(void)
function for taking button input and changing Link's state
8010E3BC - where it calls daPy_lk_c::procFrontRoll_init(float) to trigger a manual front roll. can replace this with a call to daPy_lk_c::procAutoJump_init(void) to make Link jump instead of rolling when forward+A is press.
procFanGlide_init
procFanGlide
update functions for when link is flying with deku leaf
8014CA98 - where it sets link's animation for initializing deku gliding by calling setSingleMoveAnime
setSingleMoveAnime
drawMirrorLightModel__9daPy_lk_cFv
draws the ray of light off the mirror shield/harp
init__18dDlst_mirrorPacketFP7ResTIMG
initializes the static image reflection when the mirror shield/harp reflect light onto a wall.
r4 - 0 for link, or a pointer to the raw data of the md_spot.bti file for medli
dComIfGp_setNextStage(char const *, short, signed char, signed char, float, unsigned long, int, signed char)
changes the current stage
r3 - Stage name pointer
r4 - Spawn ID
r5 - Room number
r6 - Override layer number, or FF for none
f1 -
r7 -
r8 -
r9 - Wipe type, affects the screen fade out type
0 - fade whole screen to white
1 - fade whole screen to black
4 - warp pot fade
9 -
B - fade letterboxed part of the screen to white (not the black borders at the top and bottom)
dStage_changeSceneExitId(cBgS_PolyInfo &, float, unsigned long, signed char)
Handles a stage transition specified by the Exit ID property set in the DZB collision geometry.
There are some special exit IDs for DZB collision:
3B - Goes into a submarine.
Only works if this is actor collision belonging to an instance of obj_ikada, since the game reads that actor's parameters to determine which room of Beedle's shop to go to.
3C - Goes into the Pirate Ship...?
depends on some event bits
3D - Returns to the sea via the last submarine or Beedle's Shop Ship exit.
Specifically, it returns you to the room number stored to 803CA90E, and sets the spawn ID to -2.
3E - Goes into Beedle's Shop Ship.
Only works if this is actor collision belonging to an instance of obj_ikada, since the game reads that actor's parameters to determine which room of Beedle's shop to go to.
dStage_changeScene(int, float, unsigned long, signed char)
r3 - The SCLS exit ID.
f1 -
r4 -
r5 -
dStage_playerInit(dStage_dt_c *, void *, int, void *)
r3 -
r4 -
r5 -
r6 -
dStage_chkPlayerId(int, int)
Checks whether a spawn with a particular ID exists.
r3 - The spawn ID.
r4 - The room number.
init__20dSeaFightGame_info_cFii
put_ship__20dSeaFightGame_info_cFUcUc
checkPutShip__20dSeaFightGame_info_cFiiii
attack__20dSeaFightGame_info_cFUcUc
sinking squids/sploosh kaboom stuff
see sploosh kaboom.txt for details
processHeartGaugeSound__11JAIZelBasicFv
handles playing the low hearts sound
seems to play a different sound depending on current number of quarter hearts (in r4)
0 - no sound
1-2 - sound D2
3-4 - sound D1
5-6 - sound D0
7+ - no sound
execWaitMainFromBoss__8daItem_cFv
seems related to the movement of the heart container gohdan shoots out of his nose?
fopAcM_fastCreate__FsUlP4cXyziP5csXyzP4cXyzScPFPv_iPv
creates an entity.
r3 - Actor ID
r4 - Params
(more args)
fopAcM_create(short, unsigned long, cXyz *, int, csXyz *, cXyz *, signed char, int (*)(void *))
fopAcM_create__FsUlP4cXyziP5csXyzP4cXyzScPFPv_i
creates an entity.
r3 - Actor ID
r4 - Params
r5 - Position (pointer to a vector3 of floats)
r6 - Room number
r7 - Auxilary params and rotation (pointer to a vector3 of shorts, auxilary params 1, Y rotation, auxilary params 2)
r8 - Scale (pointer to a vector3 of floats)
r9 - 0?
r10 - 0?
fopAcM_createChild__FsUiUlP4cXyziP5csXyzP4cXyzScPFPv_i
fopAcM_createChild(short, unsigned int, unsigned long, cXyz *, int, csXyz *, cXyz *, signed char, int (*)(void *))
creates an entity as a child of another entity
r3 - Actor ID
r4 - unique ID of the parent entity
r5 - Params
(more args)
fopAcM_createChild(char *, unsigned int, unsigned long, cXyz *, int, csXyz *, cXyz *, int (*)(void *))
creates an entity as a child of another entity
r3 - Actor name
(more args)
createAppend__FUlP4cXyziP5csXyzP4cXyzScUi
part of creating an entity
r3 - Params
r9 - unique ID of the parent entity, or -1 for no parent
(more args)
fpcSCtRq_Request__FP11layer_classsPFPvPv_iPvPv
part of creating an entity
r4 - Actor ID
r7 - "append" entity? (return value from createAppend__FUlP4cXyziP5csXyzP4cXyzScUi)
(more args)
createChild__16mDoHIO_subRoot_cFPCcP13JORReflexible
mDoHIO_subRoot_c::createChild(char const *, JORReflexible *)
creates a child entity...? used by darknuts for example
r3 - Pointer to 803A5774 + 4
r4 - Pointer to a string for this entity's name? not the actor name, but an actual japanese name. e.g. for darknut, this points to a SHIFT JIS string of "タートナック".
r5 - Pointer to "HIO" in the BSS section?
fopAcM_delete__FP10fopAc_ac_c
fopAcM_delete(fopAc_ac_c *)
deletes an entity
r3 - Entity to delete
checkRopeSwingWall__9daPy_lk_cFP4cXyzP4cXyzPsPf
daPy_lk_c::checkRopeSwingWall((cXyz *,cXyz *,short *,float *))
checks if the player swung into a wall and should bounce off.
r3 - pointer to the player
r4 - pointer to the player's current position (player_entity+0x1F8)
r5 - pointer to a position. might be the player's position after being rotated and offset compared to the swinging rope?
r6 - pointer to ??? rotation or rotational velocity? (short)
this seems to be calculated like so:
short(???*float(-players_previous_frame_rotation_velocity))
it seems to be the velocity of the player swinging on the rope, back and forth, not rotating.
r7 - pointer to ??? (float)
reinit__10dSv_info_cFv
initializes new game+
things it does:
* reads 0x11 event registers (the ones listed at 80375DC8) and stores them somewhere in free space (e.g. 815b0db4)
* reads the byte at 803C4DA8 (e.g. 0x01) into r28 (overrides hero's clothes to get the hero's new clothes?)
* copies the player's name from the old to the stack
* reads the byte at 803C4DAE (e.g. 0x00) into r27
* reads the byte at 803C4DAC (e.g. 0x01) into r26
* reads the byte at 803C4DAD (e.g. 0x00) into r25
* reads the byte at 803C4DAF (e.g. 0x01) into r24
* reads the byte at 803C4C70 (e.g. 0x00) into r23
* gets event register 89FF, puts the value into r22
* initializes the save with the regular new game function
* sets the same 0x11 event registers back to what their value was before
* sets 5 event bits to on (the ones listed at 80375DEC)
* sets event register C407 to 07 (lenzo related!)
* sets treasure box opened flag 0 in stage ID B (pictobox chest!)
* sets switch 0x47 for stage ID 0 (unsure what this is...)
* sets switch 0x5E for stage ID 0 (unsure what this is...)
* copies the player's old name from the stack to the new save file
* stores r28 back to 803C4DA8
* stores r27 back to 803C4DAE
* stores r26 back to 803C4DAC
* stores r25 back to 803C4DAD
* stores r24 back to 803C4DAF
* sets 803C4DA9, the index of the random salvage points to use, to 3
* puts deluxe picto box in the player's inventory
* sets byte 803CA7E5 to 8
* sets byte 803CA7E6 to 0x26 (same as picto box ID)
* sets the bits for owning both picto boxes
* stores r23 back to 803C4C70
* sets event register 89FF back to the old value (in r22)
event reg 89FF is related to pictures you take somehow.
it appears to be a bitfield.
when you erase a picture, a bit gets ORed.
when you take a picture, the whole thing gets set to 0...?
I guess it's doing something to preserve whatever pictographs you had in new game
onBeast__25dSv_player_get_bag_item_cFUc
sets a bit for whether you've ever owned a particular spoil
dSv_player_collect_c::isCollect(int, unsigned char)
checks if you own a particular item by checking a bitfield.
r3 - Offset of the one-byte bitfield from 803C4CBC.
r4 - Index of the bit in the bitfield.
setItemModel__9daPy_lk_cFv
seems to control which of the player's item accessory models are currently visible.
8010627C - reads the currently equipped shield ID to know which shield model to show.
setLinkShieldType__11JAIZelBasicFll
???
r3 - pointer to ?
r4 - shield type.
0 - no shield
1 - hero's shield
2 - mirror shield
JAIZelBasic::seStart(unsigned long, Vec *, unsigned long, signed char, float, float, float, float, unsigned char)
Plays a sound effect. The puzzle complete jingle counts as a sound effect.
r3 - Pointer to 803A2CE8, which is read from 803F7710 (JAIZelBasic::zel_basic(void))
r4 - The sound ID.
& 000003FF - The index of the sound in its category.
& 00000400 - ?
& 00000800 - ? Don't let the sound fade out?
& 000FF000 - Sound category.
0-7 - Valid sound categories.
& C0000000 - Some type of special flag?
0 - Use the sound category specified with the mask 000FF000.
1 - Maybe invalid?
2 - Use sound category 0x10. (For sequenced music.)
3 - Use sound category 0x11. (For streamed music.)
r5 -
r6 -
r7 -
f1 -
f2 -
f3 -
f4 -
r8 - 0?
JAIBasic::startSoundVec(unsigned long, JAISound **, Vec *, unsigned long, unsigned long, unsigned char)
Generic sound (sfx or music) playing function, called by all others.
r3 -
r4 - The sound ID. See seStart for details.
r5 -
r6 -
r7 - 0?
r8 - 0?
r9 - 4?
JAIZelBasic::charVoicePlay(long, long, Vec *, signed char)
Plays a character voice sound effect.
r3 -
r4 -
r5 -
r6 -
JAISound::setPortData(unsigned char, unsigned short)
???
r3 -
r4 - port number...?
r5 - data to set...?
mDoAud_messageSePlay(unsigned short, Vec *, signed char)
Plays a sound from a message text command.
r3 - The sound value from the message command.
r4 - Pointer to ??? (can be 0)
r5 - Return value from dComIfGp_getReverb? (Or can be 0)
JAIZelBasic::messageSePlay(unsigned short, Vec *, signed char)
Plays a sound from a message (either from a text command or the "initial sound" of the message).
r3 - Pointer to 803A2CE8 (JAIZelBasic::zel_basic)
r4 - The sound value from the message command.
r5 - Pointer to ??? (can be 0)
r6 - Return value from dComIfGp_getReverb? (Or can be 0)
JAIGlobalParameter::getParamSeCategoryMax(void)
This can be called to get the number of sound categories that exist (8).
JAInter::SoundTable::getInfoPointer( (unsigned long))
Gets a pointer to a sound's info.
r3 - The sound ID.
JAIBasic::getSoundOffsetNumberFromID(unsigned long)
r3 - (pointer to the something. read from 803F7578)
r4 - The sound ID.
bgmStart
Starts playing background music. Boss music counts as background music.
r3 - Pointer to JAIZelBasic (803A2CE8)
r4 - The BGM ID.
BGM IDs can be a bit different from normal sound IDs.
Normally they are the same, for example:
80000002 - Plays BGM with index 02.
But sometimes, the BGM ID is over 0x100, for example:
80000130 - Plays BGM with index 42.
These 100+ BGM IDs allow playing certain hardcoded BGMs with different instruments.
For example, 120-123 all play Gohdan's theme (d_amosu.bms), but they sound quite different.
How to map these special BGM IDs to BGM indexes is hardcoded into bgmStart.
Full list:
80000105 -> 80000005
80000110 -> 80000014
80000111 -> 80000014
80000112 -> 80000014
80000115 -> 80000015
80000120 -> 80000023
80000121 -> 80000023
80000122 -> 80000023
80000123 -> 80000023
80000124 -> 80000029
80000125 -> 80000028
80000126 -> 80000028
80000130 -> 80000042
80000131 -> 80000042
80000132 -> 80000042
80000133 -> 80000042
80000140 -> 80000048
80000150 -> 80000049
80000151 -> 8000004A
80000152 -> 8000004C
r5 - ?
r6 - Whether to interrupt the currently playing BGM or not.
If 0, JAISound::stop will be called, which interrupts the current BGM.
If 1, JAISound::stop will not be called, which allows the current BGM to take precedence over the new one.
expandSceneBgmNum
r4 - Halfword BGM ID read from a BGM info for a spot/island.
This function returns the BGM ID in a full word format.
e.g. 0012 -> 80000012
If the halfword BGM ID has the highest bit set, it instead returns like this (for BGM streams):
e.g. 8012 -> C0000012
setScene__11JAIZelBasicFllll
JAIZelBasic::setScene(long, long, long, long)
sets the music for the next stage/room the player is about to go into?
r3 -
r4 - Spot ID for the stage.
r5 - Room number.
r6 -
r7 - Override layer number.
(more args)
This function hardcodes various checks for specific stages based on the spot ID. Here is a list:
802AA40C - sea
802AA644 - A_mori
802AA66C - MajyuE
802AA690 - M_DragB
802AA724 - kinBOSS
802AA7B0 - SirenB
802AA83C - kazeB
802AA8D0 - M_DaiB
802AA964 - Hyroom
802AA9AC - Hyrule
802AA9F0 - Hyroom
802AAA34 - kenroom
802AAA98 - Omori
802AAADC - Pjavdou
802AAB20 - Ekaze
802AAB64 - Edaichi
802AABA8 - LinkRM
802AAC18 - Obombh
If the stage is "sea", it also hardcodes a check for a specific island based on the Room number. Here it is:
802AA44C - Outset Island
Each of these hardcoded checks includes various sub-checks for things like event bits and layer numbers and such to determine if music should be played or not.
checkSeaBgmID
returns the expanded BGM ID that should currently be played while sailing
bgmNowBattle
Starts playing the music for fighting common enemies.
JAIZelBasic::mbossBgmNearByProcess(float)
TODO look into this function, it might be detecting if a miniboss is near the player
r3 -
f1 -
subBgmStart
Starts playing "sub" background music. Mini-boss music, whirlpool music, and item get jingles are included in this.
Also sets 803A2D9E to know what the previous sub background music was before it was interrupted.
bgmStreamPlay
Plays an background music stream? Boss defeat fanfares count as this, maybe other things?
start__Q28JASystem8TSeqCtrlFPvUl
related to playing audio
adaptor_do_SOUND__Q214JStudio_JAudio14TAdaptor_soundFQ37JStudio4data15TEOperationDataPCvUl
handles playing sounds (sfx or music) during stb cutscenes
JAIZelBasic::setScene(long, long, long, long)
loads necessary audio stuff for a particular stage?
r3 -
r4 - The spot ID for this stage.
r5 -
r6 -
r7 -
This MIGHT hardcode loading certain things, like some of the instruments for Molgera's fight theme that are only loaded for kazeB.
or, maybe the hardcoding is just for UNLOADING them when the boss is dead...?
JAInter::BankWave::loadSceneWave
JAInter::BankWave::loadGroupWave
JASystem::WaveBankMgr::loadWave
JASystem::WaveBankMgr::getWaveArc
JASystem::WaveBankMgr::getWaveBank
These functions are part of loading a wave bank
r3 - The wave bank index (this is the same as the index of the .aw file in the .aaf file)