Changes

Jump to navigation Jump to search

FF7/Field/Script/Opcodes/D4 SIN

1,257 bytes added, 16:45, 16 September 2020
Creation of SIN page
* Opcode: '''0xD4'''
* Short name: '''SIN'''
* Long name: SIN Calculation

==== Memory layout ====
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! width="40" | 0xD4
! width="50" | ''B1 / B2''
! width="40" | ''B3 / B4''
! width="40" | ''D''
! width="40" | ''M''
! width="40" | ''A''
! width="40" | ''S''
|}

==== Arguments ====

* '''const Bit[4]''' ''B1'': Destination bank.
* '''const Bit[4]''' ''B2'': Bank to retrieve ''M'', or zero if ''M'' is specified as a literal value.
* '''const Bit[4]''' ''B3'': Bank to retrieve ''A'', or zero if ''A'' is specified as a literal value.
* '''const Bit[4]''' ''B4'': Bank to retrieve ''S'', or zero if ''S'' is specified as a literal value.
* '''const UByte''' ''D'': Destination address.
* '''const UByte''' ''M'': Multiplicand, or address to retrieve value if ''B2'' is non-zero.
* '''const UByte''' ''A'': Addition, or address to retrieve value if ''B3'' is non-zero.
* '''const UByte''' ''S'': Variable for sin angle, or source address to retrieve value if ''B4'' is non-zero.

==== Description ====

Var[B1][D] = ( ( Math.sin(Var[B4][S]) * M) + A) >> 12

Creates a variable from the another variable, with SIN, a multiplicand and an addition factor
50
edits

Navigation menu