User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
super_mario_64:behavior_commands [2017/06/23 10:11]
shygoo ↷ Page moved from super_mario_64:behavior_commands to sm64:behavior_commands
super_mario_64:behavior_commands [2017/12/03 17:33]
david [0B: End Behavior script (Unused)] Updated behavior command 0xB
Line 1: Line 1:
 +======== Behavior Commands ========
  
 +The behavior layout commands define how the objects and Mario are initialized and interact. ​ Like the [[super_mario_64:​geometry_layout_commands]],​ the behavior commands start with a type byte and have no length byte.
 +
 +===== Behavior Commands =====
 +
 +==== 00: Start ====
 +Marks start of behavior. If haunted chair (4FD4) or mad piano (5024), it calls BehCommonInit (802A4120). If it is message panel (32E0), it sets 0x194 to 0x43160000 (150.0).
 +
 +''​00 [<color darkgrey>​TT</​color>​] [<color purple>​AA AA</​color>​]''​
 +
 +| <color darkgrey>​T</​color>​ | Type of object. ​ Used to determine which linked list placed in. |
 +| <color purple>​A</​color>​ | Might be a bit-field, but Behavior00 ignores them |
 +
 +Length: 4
 +
 +----
 +
 +==== 01: State Loop ====
 +Used by some small effects. ​ if <color purple>​A</​color>​ > current 0x1F4, adds 1 to 0x1F4 of object, otherwise sets to 0.  It loops obj->​0x1F4 from 0 up to <color purple>​A</​color>​ - 1 and then back to 0.
 +
 +''​01 00 [<color purple>​AA AA</​color>​]''​
 +
 +| <color purple>​A</​color>​ | obj->​0x1F4 = (<color purple>​A</​color>​ >= obj->​0x1F4) ? obj->​0x1F4 + 1 : 0 |
 +
 +Length: 4
 +
 +----
 +
 +==== 02: Jump and Link? ====
 +Jumps into another behavior and changes obj->​0x1D0.
 +
 +''​02 00 00 00 [<color purple>​AA AA AA AA</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Segmented address of behavior to jump to |
 +
 +Length: 8
 +
 +----
 +
 +==== 03: Return? ====
 +Writes something to 0x1D0. jumps into behavior at object->​0x1d4.
 +
 +''​03 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 04: Jump ====
 +Jumps into another behavior.
 +
 +''​04 00 00 00 [<color purple>​AA AA AA AA</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Segmented address of behavior to jump to |
 +
 +Length: 8
 +
 +----
 +
 +==== 05: Loop N ====
 +Loop specified amount of times.
 +
 +''​05 00 [<color purple>​AA AA</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Number of times to loop |
 +
 +Length: 4
 +
 +----
 +
 +==== 06: End Loop N ====
 +End 0x05 loop.
 +
 +''​06 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 07: Infinite Loop ====
 +Jumps back 4 bytes (usually results in infinite loop).
 +
 +''​07 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 08: Loop Start ====
 +Loop start.
 +
 +''​08 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 09: Loop End ====
 +End of 08 loop. Behavior script normally ends with this, looping around ASM function (0x0C command).
 +
 +''​09 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 0A: End Behavior script ====
 +Marks the end of a behavior that doesn'​t use a loop.
 +
 +''​0A 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 0B: End Behavior script (Unused) ====
 +Marks the end of a behavior that doesn'​t use a loop. Exactly the same as command 0xA, except this never seems to be used.
 +
 +''​0B 00 00 00''​
 +
 +Length: 4
 +
 +----
 +==== 0C: Call Function ====
 +Calls ASM function. ​ Usually used to call object init routine or looping routine between 0x08/0x09 commands.
 +
 +''​0C 00 00 00 [<color purple>​AA AA AA AA</​color>​]''​
 +
 +| <color purple>​A</​color>​ | ASM routine to call |
 +
 +Length: 8
 +
 +----
 +
 +==== 0D: Update Object ====
 +Used to offset X, Y, or Z position a bit.  It's useless except for Dorrie.
 +
 +''​0D [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | float |
 +| obj->​address += (float)B (special cases are 06, 07 and 08. 06 is X, 07 is Y, and 08 is Z-position) ||
 +
 +Length: 4
 +
 +----
 +
 +==== 0E: Sight Distance ====
 +Mostly used for sight distance, does nearly the same as 0x0D.
 +
 +''​0E [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | float |
 +| obj->​address = (float)B (special case is 45 for sight distance) ||
 +
 +Length: 4
 +
 +----
 +
 +==== 0F: Texture Animate ====
 +Mostly used as texture animation rate. Same as 0x0D, but without float.
 +
 +''​0F [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | u16 |
 +| obj->​address = B (special case is 1A for texture animation rate) ||
 +
 +Length: 4
 +
 +----
 +
 +==== 10: Special Parameter ====
 +Special Parameter.
 +
 +''​10 [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | u16 |
 +| obj->​address += B (special case is 2A for interaction or 2F for Bparam2 rate) ||
 +
 +Length: 4
 +
 +----
 +
 +==== 11: Bit-set ====
 +Sets bits designated by mask <color brown>​B</​color>​ at object offset <color purple>​A</​color>​*4+88.
 +
 +''​11 [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | u16 |
 +| ''​obj->​address |= B''​ ||
 +
 +Length: 4
 +
 +----
 +
 +
 +==== 12: Bit-clear ====
 +Clears bits designated by mask <color brown>​B</​color>​ at object offset <color purple>​A</​color>​*4+88. This is not used by any of the behavior scripts.
 +
 +''​12 [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​]''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | u16 |
 +| ''​obj->​address &= (B ^ 0xFFFF)''​ ||
 +
 +Length: 4
 +
 +----
 +
 +==== 13: Add RNG ====
 +Used in dirt and arrow lift.  Calls 80383BB0 (some RNG).
 +
 +''​13 [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​] [<color darkgrey>​CC CC</​color>​] 00 00''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | u16 |
 +| <color darkgrey>​C</​color>​ | u16 |
 +| obj->​address = <color brown>​B</​color>​ + (80383BB0() >> <color darkgrey>​C</​color>​) ||
 +
 +Length: 8
 +
 +----
 +
 +==== 14: Object Type? ====
 +Mostly used for object type and once for Y-speed.
 +
 +''​14 [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​] [<color darkgrey>​CC CC</​color>​] 00 00''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | float |
 +| <color darkgrey>​C</​color>​ | float |
 +| obj->​address = (float)<​color brown>​B</​color>​ * (float)<​color darkgrey>​C</​color>​ ||
 +
 +Length: 8
 +
 +----
 +
 +==== 15: Float Multiply ====
 +Floating point multiple with float return from 80383CB4(). Used only in bubbles.
 +
 +''​15 [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​] [<color darkgrey>​CC CC</​color>​] 00 00''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | float |
 +| <color darkgrey>​C</​color>​ | float |
 +| obj->​address = <color brown>​B</​color>​ + 80383CB4() * <color darkgrey>​C</​color>​ ||
 +
 +Length: 8
 +
 +----
 +
 +==== 16: Float Add ====
 +Floating point add with float return from 80383CB4(). Used only in water particles.
 +
 +''​16 [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​] [<color darkgrey>​CC CC</​color>​] 00 00''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | float |
 +| <color darkgrey>​C</​color>​ | float |
 +| obj->​address = (float)<​color brown>​B</​color>​ + 80383CB4() + (float)<​color darkgrey>​C</​color>​ ||
 +
 +Length: 8
 +
 +----
 +
 +==== 17: Right Shift ====
 +Right shift C with return from 80383BB0(). Unused.
 +
 +''​17 [<color purple>​AA</​color>​] [<color brown>BB BB</​color>​] [<color darkgrey>​CC CC</​color>​] 00 00''​
 +
 +| <color purple>​A</​color>​ | Address = <color purple>​A</​color>​*4+88 |
 +| <color brown>​B</​color>​ | u16 |
 +| <color darkgrey>​C</​color>​ | u16 |
 +| obj->​address = <color brown>​B</​color>​ + 80383BB0() >> <color darkgrey>​C</​color>​ ||
 +
 +Length: 8
 +
 +----
 +
 +==== 18: No Operation ====
 +Does nothing. Unused.
 +
 +''​18 ?? ?? ??''​
 +
 +Length: 4
 +
 +----
 +
 +==== 19: No Operation ====
 +Does nothing. Unused.
 +
 +''​19 ?? ?? ??''​
 +
 +Length: 4
 +
 +----
 +
 +==== 1A: No Operation ====
 +Does nothing. Unused.
 +
 +''​1A ?? ?? ??''​
 +
 +Length: 4
 +
 +----
 +
 +
 +==== 1B: Change Model ID ====
 +Changes the model ID of current behavior. ​ Used by Mr. I, Bowser flame spawn, and floating wood bridge.
 +
 +''​1B 00 [<color darkgray>​II II</​color>​]''​
 +
 +| <color darkgray>​I</​color>​ | model ID |
 +
 +Length: 4
 +
 +----
 +
 +==== 1C: Load Child Object ====
 +Load child object and save child object pointer to 0x6C (automatically follows?).
 +
 +''​1C 00 00 00 [<color darkgray>​II II II II</​color>​] [<color purple>​AA AA AA AA</​color>​]''​
 +
 +| <color darkgray>​I</​color>​ | model ID |
 +| <color purple>​A</​color>​ | segmented address of child object behavior |
 +
 +Length: C
 +
 +----
 +
 +==== 1D: Deactivate ====
 +Deactivates object. obj->​active (0x74) = 0
 +
 +''​1D 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 1E: Drop to Ground? ====
 +Calls 80381794(). ​ Drop to ground? and object->​0xEC |= 0x2;
 +
 +''​1E 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +
 +==== 1F: Used for Waves ====
 +Sums two floats at offsets B and C and stores in offset A.  Used for waves and bubbles.
 +
 +''​1F [<color darkred>​AA</​color>​] [<color darkgreen>​BB</​color>​] [<color darkblue>​CC</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | AddressA = <color darkred>​A</​color>​*4+88 |
 +| <color darkgreen>​B</​color>​ | AddressB = <color darkgreen>​B</​color>​*4+88 |
 +| <color darkblue>​C</​color>​ | AddressC = <color darkblue>​C</​color>​*4+88 |
 +| obj->​addressA = obj->​addressB + obj->​addressC ||
 +
 +Length: 4
 +
 +----
 +
 +==== 20: Unused ====
 +Sums two values at offsets B C and stores in offset A?
 +
 +''​20 [<color darkred>​AA</​color>​] [<color darkgreen>​BB</​color>​] [<color darkblue>​CC</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | AddressA = <color darkred>​A</​color>​*4+88 |
 +| <color darkgreen>​B</​color>​ | AddressB = <color darkgreen>​B</​color>​*4+88 |
 +| <color darkblue>​C</​color>​ | AddressC = <color darkblue>​C</​color>​*4+88 |
 +| obj->​addressA = obj->​addressB + obj->​addressC ||
 +
 +Length: 4
 +
 +----
 +
 +==== 21: Set Billboarding ====
 +Sets billboarding flag (0x04) in graph flags.
 +
 +''​21 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 22: Set 0x10 flag ====
 +Sets 0x10 in graph flags.
 +
 +''​22 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 23: Collision sphere size ====
 +Define the collision sphere size.
 +
 +''​23 00 00 00 [<color darkred>​XZ XZ</​color>​] [<color darkgreen>​YY YY</​color>​]''​
 +
 +| <color darkred>​XZ</​color>​ | X and Z sphere|
 +| <color darkgreen>​Y</​color>​ | Y sphere |
 +
 +Length: 8
 +
 +----
 +
 +==== 24: Nothing ====
 +Does nothing. Unused.
 +
 +''​24 [<color darkred>​AA</​color>​] [<color darkgreen>​BB BB</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | Unused |
 +| <color darkgreen>​B</​color>​ | Unused |
 +
 +Length: 4
 +
 +----
 +
 +==== 25: State Cycle ====
 +Increment obj->​0x1F4 or cycle back to 0 when it reaches obj->​AddressA. Only used in Bubble (Mario) behavior.
 +
 +''​25 [<color darkred>​AA</​color>​] 00 00''​
 +
 +| <color darkred>​A</​color>​ | AddressA = <color darkred>​A</​color>​*4+88 |
 +| <code c>if (obj->​0x1F4 < obj->​AddressA - 1) {
 +  obj->​0x1F4 += 1;
 +} else {
 +  obj->​0x1F4 = 0;
 +}</​code>​||
 +
 +Length: 4
 +
 +----
 +
 +==== 26: Loop? ====
 +Similar to behavior command 0x05, except parameter is only 1 byte. Unused.
 +
 +''​26 [<color darkred>​AA</​color>​] 00 00''​
 +
 +| <color darkred>​A</​color>​ | Loops? |
 +
 +Length: 4
 +
 +----
 +
 +==== 27: Set Word ====
 +Store word B at address A of object. Always used with A = 0x26 (addressA = 0x120) to set initial [[sm64:​animation]] with segmented address.
 +
 +''​27 [<color darkred>​AA</​color>​] 00 00 [<color darkgreen>​BB BB BB BB</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | AddressA = <color darkred>​A</​color>​*4+88 |
 +| <color darkgreen>​B</​color>​ | value to store in AddressA |
 +| obj->​addressA = <color darkgreen>​B</​color>​ ||
 +
 +Length: 8
 +
 +----
 +
 +==== 28: Animates ====
 +Animates object by advancing [[sm64:​animation]] pointer (obj->​0x120).
 +
 +''​28 [<color darkred>​AA</​color>​] 00 00''​
 +
 +| <color darkred>​A</​color>​ | animation number (*4) |
 +| ''​8037C658(obj,​ obj->​0x120 + <color darkred>​A</​color>​*4)''​ ||
 +
 +Length: 4
 +
 +----
 +
 +==== 29: Load Child Object ====
 +Load child object. Only used in Koopa flag and poundable.
 +
 +''​29 00 [<color darkred>​AA AA</​color>​] [<color darkgreen>​BB BB BB BB</​color>​] [<color darkblue>​CC CC CC CC</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | Bparam for child object |
 +| <color darkgreen>​B</​color>​ | model ID |
 +| <color darkblue>​C</​color>​ | Segmented address of behavior |
 +
 +Length: C
 +
 +----
 +
 +==== 2A: Set Collision ====
 +Set collision data.
 +
 +''​2A 00 00 00 [<color darkred>​AA AA AA AA</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | Segmented address of collision pointer |
 +
 +Length: 8
 +
 +----
 +
 +==== 2B: Set Collision Sphere ====
 +Set collision data.
 +
 +''​2B 00 00 00 [<color darkred>​AA AA</​color>​] [<color darkgreen>​BB BB</​color>​] [<color darkblue>​CC CC</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | X/Z sphere as int |
 +| <color darkgreen>​B</​color>​ | Y sphere as int |
 +| <color darkblue>​C</​color>​ | obj->​0x208 = (float)<​color darkblue>​C</​color>​ |
 +
 +Length: C
 +
 +----
 +
 +==== 2C: Spawn Object ====
 +Spawns object. Same as 0x1C, but stores child obj pointer to parent->​0x6C.
 +
 +''​2C 00 00 00 [<color darkred>​AA AA AA AA</​color>​] [<color darkgreen>​BB BB BB BB</​color>​] [<color darkblue>​CC CC</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | model ID |
 +| <color darkgreen>​B</​color>​ | Segmented address of behavior |
 +
 +Length: C
 +
 +----
 +
 +==== 2D: Set Init Position ====
 +Declare initial position. Saves positions to 0x164, 0x168, and 0x16C. Used in Dorrie, Fly guys, etc. to determine in which range they can move.
 +
 +''​2D 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 2E: Sight Distance ====
 +Uselessly long version of 0E?
 +
 +''​2E 00 00 00 [<color darkred>​AA AA</​color>​] [<color darkgreen>​BB BB</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | obj->​0x200 = (float) <color darkred>​A</​color>​ |
 +| <color darkgreen>​B</​color>​ | obj->​0x204 = (float) <color darkgreen>​B</​color>​ |
 +
 +Length: 8
 +
 +----
 +
 +==== 2F: Set Interaction ====
 +Set interaction (obj->​0x130). Same as 27 2A.
 +
 +''​2F 00 00 00 [<color darkred>​AA AA AA AA</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | Interaction (see table below) |
 +
 +^ Interaction ^ Description ^
 +| 00000001 | Mario can hang from it |
 +| 00000002 | Mario can pick it up |
 +| 00000004 | Door |
 +| 00000008 | Damages Mario (normal) |
 +| 00000010 | Coin |
 +| 00000020 | Nothing? |
 +| 00000040 | Pole |
 +| 00000080 | Damages Mario (can be punched, bounced on) |
 +| 00000100 | Damages Mario (can be punched) |
 +| 00000200 | Nothing (can be punched) |
 +| 00000400 | Blows Mario away |
 +| 00000800 | Warp door |
 +| 00001000 | Star |
 +| 00002000 | Warp hole |
 +| 00004000 | Cannon |
 +| 00008000 | Damages Mario (can be punched, bounced on) |
 +| 00010000 | Replenishes health |
 +| 00020000 | Bully |
 +| 00040000 | Flame |
 +| 00080000 | Koopa shell |
 +| 00100000 | Damages Mario (can be punched, bounced on) |
 +| 00200000 | Damages Mario |
 +| 00400000 | Damages Mario (can be punched and bounced on) |
 +| 00800000 | Message |
 +| 01000000 | Makes Mario spin |
 +| 02000000 | Makes Mario fall? |
 +| 04000000 | Damages Mario |
 +| 08000000 | Warp (Mario shrinks in) |
 +| 10000000 | Damages Mario |
 +| 20000000 | Electrocutes Mario |
 +| 40000000 | Normal |
 +
 +Length: 8
 +
 +----
 +
 +==== 30: Set Gravity ====
 +Set gravity.
 +
 +''​30 00 00 00 [<color darkred>​AA AA</​color>​] [<color darkgreen>​BB BB</​color>​] [<color darkblue>​CC CC</​color>​] [<color red>DD DD</​color>​] [<color green>EE EE</​color>​] [<color blue>FF FF</​color>​] [<color purple>​GG GG</​color>​] [<color darkgrey>​HH HH</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | obj->​0x128 = (float)<​color darkred>​A</​color>​ |
 +| <color darkgreen>​B</​color>​ | obj->​0xE8 = (float)<​color darkgreen>​B</​color>/​100 |
 +| <color darkblue>​C</​color>​ | obj->​0x158 = (float)<​color darkblue>​C</​color>/​100 |
 +| <color red>​D</​color>​ | obj->​0x12C = (float)<​color red>​D</​color>/​100 |
 +| <color green>​E</​color>​ | obj->​0x170 = (float)<​color green>​E</​color>/​100 |
 +| <color blue>​F</​color>​ | obj->​0x174 = (float)<​color blue>​F</​color>/​100 |
 +| <color purple>​G</​color>​ | Ignored |
 +| <color darkgrey>​H</​color>​ | Ignored |
 +
 +Length: 0x14
 +
 +----
 +
 +==== 31: ?? ====
 +Sets obj->​0x190. Unused.
 +
 +''​31 00 00 00 [<color darkred>​AA AA AA AA</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | obj->​0x190 = <color darkred>​A</​color>​ |
 +
 +Length: 8
 +
 +----
 +
 +==== 32: Scale Object ====
 +Scale object uniformly, sets X, Y, Z scaling to A as percent.
 +
 +''​32 00 [<color darkred>​AA AA</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | scale value (percent) |
 +| <code c>​ScaleObject((float)A/​100.0f;</​code>​ ||
 +
 +Length: 4
 +
 +----
 +
 +==== 33: Child Object Change ====
 +Clear flags in address of child object.
 +
 +''​33 [<color darkred>​AA</​color>​] 00 00 [<color darkgreen>​BB BB BB BB</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | AddressA = <color darkred>​A</​color>​*4+88 |
 +| <color darkgreen>​B</​color>​ | bit values to clear |
 +| obj->​child(0x68)->​addressA &= ~B ||
 +
 +Length: 8
 +
 +----
 +
 +==== 34: Texture Animate Rate ====
 +Clear flags in address of child object. ​ Only used for texture animation rate (0x1A).
 +
 +''​34 [<color darkred>​AA</​color>​] [<color darkgreen>​BB BB</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | AddressA = <color darkred>​A</​color>​*4+0x88 |
 +| <color darkgreen>​B</​color>​ | divide value at 0x8032d5d4 with this (see code below) |
 +
 +<code c>
 +if ((*0x8032d5d4 / B) == 0) {
 +  addressA = A*4 + 0x88;
 +  obj->​addressA += 1;
 +}
 +return 0;</​code>​
 +
 +Length: 4
 +
 +----
 +
 +==== 35: Clear Graph Flag ====
 +Clears least significant bit of graph (obj->​0x02 &= 0xFFFE).
 +
 +''​35 00 00 00''​
 +
 +Length: 4
 +
 +----
 +
 +==== 36: Set Value ====
 +Store value B at address A. Unused.
 +
 +''​36 [<color darkred>​AA</​color>​] 00 00 [<color darkgreen>​BB BB</​color>​] 00 00''​
 +
 +| <color darkred>​A</​color>​ | AddressA = <color darkred>​A</​color>​*4+0x88 |
 +| <color darkgreen>​B</​color>​ | value (u16) |
 +| obj->​addressA = (u32)value ||
 +
 +Length: 8
 +
 +----
 +
 +==== 37: Spawn Something ====
 +Spawns something. ​ Only used in waves generator and surface waves.
 +
 +''​37 00 00 00 [<color darkred>​AA AA AA AA</​color>​]''​
 +
 +| <color darkred>​A</​color>​ | Spawn function address |
 +
 +Length: 8
 +
 +===== See Also =====
 +[[sm64:​list_of_behaviors]]
 +
 +===== References =====
 +  * https://​sites.google.com/​site/​kazemario64/​home/​all-behavior-commands