-
Notifications
You must be signed in to change notification settings - Fork 6
/
Entity RAM Formats.txt
369 lines (349 loc) · 15.1 KB
/
Entity RAM Formats.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
Format of entities in RAM:
fopAcM_prm_class (created and returned by f_op_actor_mng::fopAcM_CreateAppend)
00,4: Parameters.
04,4: X position.
08,4: Y position.
0C,4: Z position.
10,2: Auxilary parameter.
12,2: Y rotation.
14,2: Auxilary parameter 2.
16,2: "Enemy number" from the ACTR data
18,1: X scale.
19,1: Y scale.
1A,1: Z scale.
1B,1: Actor GBA type.
1C,4: Unique ID of this entity's parent.
20,1: Actor subtype index.
21,1: Room number.
create_request (created and returned by f_pc_create_req::fpcCtRq_Create)
3C,4: Unique ID of this specific entity instance.
This entity can be found by calling f_op_actor_mng::fopAcM_SearchByID with r3=this ID.
fopAc_ac_c (entity created by f_op_actor_mng::createAppend):
Size: 0x290 bytes.
004,4: Unique ID of this specific entity instance.
This entity can be found by calling fopAcM_SearchByID__FUiPP10fopAc_ac_c with r3=this ID.
008,2: Actor ID.
010,4: Pointer to this actor class's actor profile. (f_pc_profile__Profile_Actor)
0AC,4: Pointer to the fopAcM_prm_class used to create this actor...???
0B0,4: Parameters.
0C0,4: Entity type?
09130005 - Normal actor? Maybe an instance of fopAc_ac_c as opposed to its parent classes?
0EC,4: Pointer to a list of pointers to methods for this actor class. (profile_method_class)
This is copied from the actor class's actor profile+0x24,4.
In order:
Create
Delete
Execute
IsDelete
Draw
???
???
???
Pointer to something in the loaded REL file for this entity?
Go to this pointer+8, and read the pointer there. That has a pointer to the execute code for this entity.
0F0,4: Pointer to the game heap memory allocated for this entity by fopAcM_entrySolidHeap? (instance of JKRHeap)
This pointer is 0x10 bytes after the start of the free space block that was chosen for this entity.
0F4,14: dEvt_info_c
0FC,2: Event index for this actor to trigger.
18C,8: Color C0
194,4: Color K0
198,4: Color K1
19C,8: Fog color
1BC,2: Enemy number from the ACTR data.
This is officially known as "Set ID", and the bitfield this is an index in is known as the "zone actors" bitfield.
1BE,1: Type of actor.
This is copied from the actor class's actor profile+0x2C,1.
Possible values:
0 - Normal actor
1 - The player
2 - Enemy
3 - Wildlife and various miscellaneous objects
Morths, crabs, falling stairs, pigs, boko buds, Helmaroc King in cutscenes, wooden platforms in Gohma fight
4 - Certain NPCs (not all)
Note that only 2 (Enemy) seems to have an effect. The other values never seem to be checked.
1BF,1: Affects how this actor is culled.
This is copied from the actor class's actor profile+0x2D,1.
00 - 50x50x50 bounding box (origin at bottom center).
00-0D - Standard bounding boxes.
0E - Custom bounding box. (Set via fopAcM_setCullSizeBox)
0F-16 - Standard bounding spheres.
17 - Custom bounding sphere. (Set via fopAcM_setCullSizeSphere)
1C1,1: Actor subtype index.
1C2,1: Actor GBA type.
1C4,4: Bitfield of actor status bits. (fopAcM__Status)
This is copied from the actor class's actor profile+0x28,4.
& 0000001F - Affects how this actor is drawn on the Tingle Tuner's GBA minimap.
This is an index into list statusMapNo2TypeNoTbl$6998.
& 00000020 - Should be drawn on the minimap.
& 00000080 - Actor should not execute if it didn't draw.
In other words, if this bit is set, and bit 00000004 of bitfield 1C8,4 is also set, it won't execute this frame.
& 00000100 - Should check culling before drawing.
& 00000400 - Is frozen
& 00000800 - (set for actors in events that have staff type 1?)
& 00002000 - Being carried by Link.
e.g. For player partners, enemy weapons, etc.
& 00008000 - (set for actors in events?)
& 00020000 - Executes even when game is paused.
This has a side effect for enemies where they effectively have very few iframes and take damage multiple times per attack.
& 01000000 - Do not draw for one frame.
This bit is automatically unset after the actor decides to not draw itself because of this bit once.
& 04000000 - Is a boss or mini-boss (?)
& 08000000 - (something set by enemy_ice)
1C8,4: Bitfield of conditions?
& 00000002 - Actor did not execute this frame.
& 00000004 - Actor did not draw this frame.
& 00000008 - Actor has been constructed (__ct has been called).
1D0,14: Home transform.
1D0,4: Home X pos.
1D4,4: Home Y pos.
1D8,4: Home Z pos.
1DC,2: Home X rotation (auxilary parameter 1).
1DE,2: Home Y rotation.
1E0,2: Home Z rotation (auxilary parameter 2).
1E2,1: Home room number.
1E3,1: Home ? (unused?)
1E4,14: Old transform.
1E4,4: Old X pos.
1E8,4: Old Y pos.
1EC,4: Old Z pos.
1F0,2: Old X rotation (auxilary parameter 1).
1F2,2: Old Y rotation.
1F4,2: Old Z rotation (auxilary parameter 2).
1F6,1: Old room number.
1F7,1: Old ? (unused?)
1F8,14: Current transform.
1F8,4: Current X pos.
1FC,4: Current Y pos.
200,4: Current Z pos.
204,2: Current X rotation (auxilary parameter 1).
206,2: Current Y rotation.
208,2: Current Z rotation (auxilary parameter 2).
20A,1: Current room number.
20B,1: Current ? (unused?)
20C,2: Collision X rotation (auxilary parameter 1).
20E,2: Collision Y rotation.
210,2: Collision Z rotation (auxilary parameter 2).
214,4: X scale.
218,4: Y scale.
21C,4: Z scale.
220,4: X velocity.
224,4: Y velocity.
228,4: Z velocity.
248,4: Affects draw distance.
254,4: Forward velocity.
fopAcM_calcSpeed uses this value and the Y rotation value at 206,2 to calculate what this actor's X and Z velocity should be.
258,4: Gravity. (Y acceleration.)
25C,4: Terminal velocity. (Minimum Y velocity.)
280,4: Attention flags.
284,1: Max HP.
285,1: Current HP.
28C,1: Item pickup flag for the item this enemy drops?
enemyice (passed to enemy_ice(enemyice *) for enemy status effect handling):
004,2: Total number of frames the enemy should stay frozen.
The enemy's code sets this value when hit by ice arrows, then enemy_ice(enemyice *) sees that, resets this value to zero, and sets 00E,2 to this value instead.
006,1: Number of frames this enemy has been dying to light arrows so far.
The enemy's code sets this value to 1 when hit by light arrows, then enemy_ice(enemyice *) increases it by 1 per frame.
00E,2: Number of frames left the enemy should stay frozen.
enemy_ice(enemyice *) decreases this by 1 per frame.
1B1,1: Death switch index.
???:
328,4: Pointer to the entity's model data?
In the model data, the pointer at offset 2C points to the model's list of joints?
8153AC58 - list of joints for link
each joint is 0x64 bytes
3B8,2: Y rotational velocity.
For item entities:
630,4: Item pickup flag.
63A,1: Item ID.
648,4: Prerequisite switch index.
This item will not appear until this switch index is set.
read at 800F5298
667,1: unknown_2
read at 800F51B0
if this is 3 or 1, set bit 02 of bitfield entity+669
668,1: Item action.
read at 800F51D4
read at 800F8568
read at 800F8684 for a switch statement
669,1: bitfield?
66A,1: Current mode of the item.
0 - Normal. (mode_wait_init)
1 - ? Duplicate of normal mode? Unused?
2 - In water. (mode_water_init)
66B,1: maybe the item's current state?
For treasure chest entities:
3F0,2: Bitfield.
& 0001 - This bit means the chest is still hidden (because its appear condition hasn't been met yet)
& 0002 - This bit might also be related to the chest being hidden somehow
& 0004 - This bit might also be related to the chest being hidden somehow
76C,1: The treasure chest opened flag index.
F - For tingle statue chests. This special value means the chest will not appear on the dungeon map with the compass until you have revealed the chest.
For Link (daPy_lk_c):
0290,1: The player's current attack state.
0 - Not attacking
1 - Attacking with sword while locked on
4 - Attacking with sword while not locked on
8 - Spin attacking
A - Jump attacking
029C,4: Bitfield
00000008 - Player has just bonked into something when doing a forward roll.
00000010 -
00000080 - ? (prevents transitioning to the swimming state?)
00020000 - Player is autojumping after running off a ledge.
02000000 - Player is currently wearing the iron boots.
02A0,4: Bitfield
00000008 - Player is in their casual clothes.
00000800 - Player is frozen as a solid block of ice?
00040000 - ?? set automatically after 00000800 is set?
02A4,4: Bitfield
00000080 - ?? maybe about to use an equipped item?
00200000 - Player's mirror shield is currently reflecting light.
0314,4: The current event action index. e.g. 11 (0xB) for 011get_item.
031C,4: Pointer to Link's vtable (8038FDC0).
032C,4: Pointer to Link's main cl.bdl model.
0330,4: Pointer to Link's katsura.bdl model.
0334,4: Pointer to Link's yamu.bdl model.
0338,4: Pointer to ???
03A4,4: hands related?
03A8,4: hands related?
0494,4: Bitfield of flags for Link's dBgS_Acch.
00000020 - Is on the ground.
0554,2: The index of the face the player is currently colliding with.
This is an index in the currently loaded .dzb file's list of faces.
0954,4: Pointer to Link's hands.bdl model.
0958,4: Pointer to Link's currently equipped sword model (same as either 095C,4 or 0960,4).
095C,4: Pointer to Link's swgripa.bdl model.
0960,4: Pointer to Link's swgripms.bdl model.
097C,4: Pointer to Link's podms.bdl model.
0980,4: Pointer to Link's currently equipped shield model (same as either 0984,4 or 0988,4).
0984,4: Pointer to Link's sha.bdl model.
0988,4: Pointer to Link's shms.bdl model.
25BC,4: The player's true speed?
2E7C,4: Pointer to Link's ymsls00.bdl model.
2E80,4: Pointer to Link's ymsls00.btk animation.
2E84,4: Pointer to Link's hboots.bdl model (for the right foot).
2E88,4: Pointer to Link's hboots.bdl model (for the left foot).
2E8C,4: Pointer to Link's pring.bdl model.
2E98,4: Pointer to Link's held item model.
This is the model for whatever item is currently in Link's left hand.
For example, the sword, the hammer, the hookshot, a bottle, a hyoi pear, etc.
2EE0,4: Pointer to Link's bottle contents model.
This model can be multiple different things depending on what is contained in the bottle Link currently has in his hands.
2EE4,4: Pointer to Link's bottlecap.bdl model.
2EE8,4: Pointer to Link's sword glow model.
Can be yhsls00.bdl or ymsli00.bdl.
2EEC,4: Pointer to Link's sword tip stabbing effect model.
Can be cutfh.bdl or cutfm.bdl.
2F14,4: Pointer to Link's suimen_munya.bdl model.
2F1C,4: Pointer to Link's yuchw00.bdl model.
2F38,4: Pointer to Link's ybafo00.bdl model.
2F8C,4: Pointer to Link's ymgcs00.bdl model.
2FDC,2: File index in LkAnm.arc of Link's current upper body animation.
2FEC,2: File index in LkAnm.arc of Link's current lower body animation.
2FFC,2: File index in LkAnm.arc of Link's current ??? animation. (ActAnime?)
300C,2: File index in LkAnm.arc of Link's current ??? animation. (ActAnime?)
301C,2: File index in LkAnm.arc of Link's current ??? animation. (ActAnimeUpper?)
318C,4: Unique ID of the actor Link is holding above his head.
3190,4: Pointer to the actor Link is holding above his head.
31DC,C: Link's PTMF (pointer to member functions) struct.
31DC,4: "Delta to this pointer" (usually 0).
31E0,4: Offset in virtual table (usually -1: does not use a virtual table).
31E4,4: Pointer to the execute function for Link's current state (e.g. daPy_lk_c::procWait).
If 04,4 is not -1, this value is instead the offset of the virtual function entry in the vtable.
3484,4: Related to what's on the A button icon...?
34C8,1: Bitfield of pressed buttons.
01 - A
02 - B
04 - X
08 - Y
10 - Z
20 - L
40 - R
34CB,1: Spawn ID Link most recently spawned from, for non-cutscenes...?
Set by daPy_lk_c::onDekuSpReturnFlg(unsigned char)
34D4,2: Rotational velocity? Used by procRopeHangWait_init and procRopeHangWait
3560,2: What item the player is holding in their hand.
00-FF - The item ID of the item.
0100 - No item.
0101 - Enemy weapon.
0103 - Sword.
010B - ?
3562,2: Item in hand like above, but when throwing the boomerang this value will still have the boomerang's ID in it, while the above will not.
3584,4: The attribute code of the collision triangle directly below Link (no matter how far below).
Called "Attribute Type" in Winditor and "Attrib ID" in DZB-i-Fy.
Probably related to taking damage from lava. This is passed as argument r5 to checkLavaFace (but only when the value is 6 or 8 - the Lava and Respawn Generic types)
3530,2: Current keyframe index for Link's eyes .btk animation.
3594,4: Spawn ID Link most recently spawned from, for cutscenes...?
Set by daPy_lk_c::setRoomInfo(void)
3618,4: Bitfield related to Link's current state.
For enemies:
[Varies]+14,1: Damage for this enemy to do.
[Varies] depends on the enemy. To determine what it is for a particular enemy, find where it calls 80242D04 and check r4. That has the varying pointer.
The [Varies] seems to be an instance of cCcD_Obj
For cCcD_ObjAt (damaging dealing hitbox):
010,4: Bitfield of damage types this hitbox does.
00000001 -
00000002 - Sword.
00000004 -
00000008 - Enemy weapon wielded by an enemy?
00000010 -
00000020 - Bombs.
00000040 - Boomerang.
00000080 - Boko stick.
00000100 - Water? (checked by bomb flowers, boko sticks)
00000200 - Fire? (checked by warp pots, wooden fences) (on for red bubbles)
00000400 - Bokoblin scimitar.
00000800 - ? (winged mothulas do this type of damage)
00001000 -
00002000 - ? (peahats do this type of damage?)
00004000 - Normal arrows.
00008000 - Hookshot.
00010000 - Skull hammer. (also Darknut sword, while wielded by a Darknut?)
00020000 - ? (checked by warp pots, wooden fences)
00040000 - Fire arrows.
00080000 - Ice arrows.
00100000 - Light arrows.
00200000 - Deku Leaf's wind.
00400000 - Maybe another type of wind?
00800000 - (related to light beams somehow?)
01000000 - Stalfos mace.
02000000 -
04000000 - Darknut sword.
08000000 - Grappling hook.
10000000 - Moblin spear.
20000000 - Phantom Ganon sword.
40000000 -
80000000 -
014,1: Amount of damage this hitbox deals.
For the enemy HP bar entity:
58C,4: Width of the red HP bar? In pixels, maybe?
For magic meter entity:
3016,2: How full the meter is, from 0 to decimal 10000.
For KoRL:
34E,1: Current ship mode.
0 - Idle.
1 - Sailing.
2 - Cannon out.
3 - Salvage arm out.
For doors:
2A0,1: This is 0 if you're in front of the door (can see the lock), or 1 if you're behind the door.
This is set by frontCheck__12dDoor_info_cFv
For Zunari:
788,4: State?
-1 = On the left side of his stall
0 = On the right side of his stall
Model format (J3DModel):
18,04: X scale.
1C,04: Y scale.
20,04: Z scale.
24,30: Base transform matrix.
8C,04: Pointer to a list of the matrices for each of the model's joints.
The index in the list of matrices is simply the joint index.
e.g. For joint 0xF, the offset in that list would be 0xF*0x30 = 0x2D0.
Model entity format?:
070,4: Something texture related
074,4: Something texture related
these two values are used by Ajav to copy the first model's texture to the other 5 models in the function daObjAjav::Act_c::set_tex( (void))
Bounding box(?) format:
(Bounding boxes are created by calling dBgS_Acch::__ct(void) with r3 equal to the pointer to where the entity should be, which is at a variable location within the entity's RAM depending on what class of entity it is.)
094,4: Floating point Y position of the floor below this entity.