List of Opcodes: Difference between revisions

Happylappy (talk | contribs)
m World Map Mode documentation
Adex (talk | contribs)
m StopAnimation documentation
 
(10 intermediate revisions by 3 users not shown)
Line 4,763: Line 4,763:
|position_marker_id?
|position_marker_id?
|Set to one of the following character sprite offsets:
|Set to one of the following character sprite offsets:
0: Head<br>1: Right Hand<br>2: Left Hand<br>3: Center<br>4: No offset (bottom of sprite)
# <li value="0">Head</li>
# Right Hand
# Left Hand
# Center
# No offset (bottom of sprite)
|}
|}


Line 5,103: Line 5,107:


=== 0x114 - Slide2PositionOffset ===
=== 0x114 - Slide2PositionOffset ===
<TO DO: Opcode description>
Offsets an entity (i.e., an actor, object, or performer) from its current position across both axes without restricting the angles used. The entity does not change the direction that it faces.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 5,128: Line 5,134:
|}
|}
=== 0x115 - Slide2PositionOffset ===
=== 0x115 - Slide2PositionOffset ===
<TO DO: Opcode description>
Offsets an entity (i.e., an actor, object, or performer) from its current position across both axes without restricting the angles used. The entity does not change the direction that it faces.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


{| class="wikitable"
{| class="wikitable"
Line 5,141: Line 5,149:
|uint
|uint
|speed
|speed
|
|Movement speed. Higher values result in a faster speed. Values starting at 32770 or above will be slower than a value of 1.
|-
|-
|2
|2
|sint
|sint
|x
|x
|
|How much the entity is offset in the x direction.
|-
|-
|3
|3
|sint
|sint
|y
|y
|
|How much the entity is offset in the y direction.
|}
|}
=== 0x116 - Slide2PositionOffsetRandom ===
=== 0x116 - Slide2PositionOffsetRandom ===
Line 5,583: Line 5,591:
No parameters.
No parameters.
=== 0x129 - StopAnimation ===
=== 0x129 - StopAnimation ===
<TO DO: Opcode description>
Stops a sprite's current animation, freezing it to its first frame.
 
This opcode does not have a parameter for an entity, as it must be used in a with-statement or a targeted routine.


No parameters.
No parameters.
Line 5,644: Line 5,654:
|uint
|uint
|script_sector
|script_sector
|The "sector" of the script, and the value <code>switch(sector())</code> will return in def 0. Often used to determine whether a cutscene should be played as a flashback or not.
|The "sector" of the script, and the value <code>switch(sector())</code> will return in def 0. Often used to determine whether a cutscene should be played as a flashback or not. Sector ids above a certain threshold do not function. Perhaps 100, or 127?
|}
|}


Line 5,671: Line 5,681:
|uint
|uint
|script_sector
|script_sector
|The "sector" of the script, and the value <code>switch(sector())</code> will return in def 0. Often used to determine whether a cutscene should be played as a flashback or not.
|The "sector" of the script, and the value <code>switch(sector())</code> will return in def 0. Often used to determine whether a cutscene should be played as a flashback or not. Note: Sector ids above a certain threshold do not function. Perhaps 100, or 127?
|}
|}


Line 5,908: Line 5,918:


=== 0x13a - supervision_SpecialActing ===
=== 0x13a - supervision_SpecialActing ===
<TO DO: Opcode description>
It performs various hardcoded functionalities, mostly fancy graphical things like the Waterfall Cave flood, the beach bubbles, SE1 spotlight, etc


{| class="wikitable"
{| class="wikitable"
Line 6,352: Line 6,362:
=== 0x15d - WaitBgmSignal ===
=== 0x15d - WaitBgmSignal ===
Pauses the routine until a DSE event with ID 0xF6 on the current BGM track is triggered. This can be used to sync certain parts of the scene to the background music.
Pauses the routine until a DSE event with ID 0xF6 on the current BGM track is triggered. This can be used to sync certain parts of the scene to the background music.
Also unpauses if there is no BGM playing, making it a general purpose WaitBgm.


No parameters.
No parameters.
Line 6,777: Line 6,789:


== Other Opcodes ==
== Other Opcodes ==
These opcodes cannot be directly called from ExplorerScript, since they are represented as higher-level constructs.
These opcodes cannot be directly called from ExplorerScript, since they are represented as higher-level constructs, but are present in [[SSBScript]].


=== 0x28 - Branch ===
=== 0x28 - Branch ===
Line 7,076: Line 7,088:
|}
|}
=== 0x33 - BranchSum ===
=== 0x33 - BranchSum ===
<TO DO: Opcode description>
Calculates the sum of an indexed variable, compares it against a value, and jumps to a relative address if a certain condition is met (e.g., equal).


{| class="wikitable"
{| class="wikitable"
Line 7,087: Line 7,099:
|-
|-
|1
|1
|uint
|GameVar
|unk0
|var
|
|One of the 115 possible script variables. Specifically, an indexed variable is expected.
|-
|-
|2
|2
|uint
|uint
|unk1
|operator
|
|Comparison operator used when comparing variable sum against a value.
# <li value="0">Always true</li>
# Always false
# Equal
# Greater than
# Less than
# Greater than or equal
# Less than or equal
# Not equal
# Bitwise AND
# Bitwise XOR
# Test specific bit
|-
|-
|3
|3
|uint
|uint
|unk2
|value
|
|Value used in comparison.
|-
|-
|4
|4
|uint
|uint
|jump_address
|jump_address
|
|Address to jump to if the comparison meets the condition.
|}
|}
=== 0x34 - BranchValue ===
=== 0x34 - BranchValue ===
Line 7,983: Line 8,006:
|}
|}
=== 0x149 - SwitchSector ===
=== 0x149 - SwitchSector ===
<TO DO: Opcode description>
Returns the currently-loaded "sector" for a given routine. When used in targeted routines, this returns the sector the entity is loaded on. When used in the main routine, this returns a value passed in to load the scene, e.g., the final parameter of <code>supervision_ExecuteActingSub</code>. Most often used in Enter scenes to mark a Cutscene -> Overworld transition, but can also be checked within Acting scenes.
 
In ExplorerScript, this can be simply represented as <code>switch(sector())</code>.


No parameters.
No parameters.
Note: Sector ids above a certain threshold do not function. Perhaps 100, or 127?
=== 0x14a - SwitchValue ===
=== 0x14a - SwitchValue ===
<TO DO: Opcode description>
<TO DO: Opcode description>