Changes

Jump to navigation Jump to search

FF7/Field/Script/Opcodes/14 IFUB

393 bytes added, 05:16, 23 May 2019
m
8 revisions imported
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! width="40" | 0x14
! width="4050" | ''BB1 / B2''
! width="40" | ''A''
! width="40" | ''V''
==== Arguments ====
* '''const UByteBit[4]''' ''B1'': First memory bank to access.* '''const Bit[4]''' ''BB2'': Memory Second memory bank to access.* '''const UByte''' ''A'': Address , from the first bank, of the value to retrieve.* '''const UByte''' ''V'': Unsigned value to compare the retrieved value to, or address from the second bank of the value to retrieve.
* '''const UByte''' ''C'': Type of comparison to perform.
* '''const UByte''' ''E'': Amount to jump if the comparison does not hold.
==== Description ====
Performs a comparison between a retrieved value values from memory (Bank at specific banks and Address)addresses. If '''B2''' is zero, and then the unsigned byte Value given in the argument list. The type of comparison used value retrieved from bank '''B1''', address '''A''' is shown in compared with the table belowvalue specified by '''V'''. If '''B2''' is not zero, then the comparison failsvalue retrieved from bank '''B1''', the script pointer jumps forward by the amount specified in the final argument; the starting offset for this jump address '''A''' is just before compared with the jump value argument itself. This, combined with an appropriate [[FF7/Field/Script/Opcodes/10 JMPF|jump forward]], is used to implement if/else functionality in scriptsretrieved from bank '''B2''', as demonstrated belowaddress '''V'''.
The type of comparison used is shown in the table below. If the comparison fails, the script pointer jumps forward by the amount specified in the final argument; the starting offset for this jump is just before the jump value argument itself. This, combined with an appropriate [[FF7/Field/Script/Opcodes/10 JMPF|jump forward]], is used to implement if/else functionality in scripts, as demonstrated below. If the content of the 'if' block following the IFUB line is longer than 0xFF, the jump argument will also need to be longer than 0xFF, and hence you should use the [[FF7/Field/Script/Opcodes/15 IFUBL|IFUBL]] variant is used instead. If the value or address to compare is larger than 0xFF, you should use the [[FF7/Field/Script/Opcodes/18 IFUW|IFUW]]/[[FF7/Field/Script/Opcodes/19 IFUWL|IFUWL]] variantsare used. If the value you are comparing being compared is negative, you should use the [[FF7/Field/Script/Opcodes/16 IFSW|IFSW]]/[[FF7/Field/Script/Opcodes/17 IFSWL|IFSWL]] variantsare used.
==== Comparison Types ====

Navigation menu