Changes

Jump to navigation Jump to search

FF8/Field/Script/Opcodes

14,130 bytes added, 05:22, 23 May 2019
m
13 revisions imported
[[FF8/Field/Script/Opcodes/000 ADD]] [[FF8/Field/Script/Opcodes/001 SUB]] [[FF8/Field/Script/Opcodes/002 MUL]] [[FF8/Field/Script/Opcodes/003 MOD]] [[FF8/Field/Script/Opcodes/004 DIV]] [[FF8/Field/Script/Opcodes/005 MIN]] [[FF8/Field/Script/Opcodes/006 EQ]] [[FF8/Field/Script/Opcodes/007 GT]] [[FF8/Field/Script/Opcodes/008 GE]] [[FF8/Field/Script/Opcodes/009 LS]] [[FF8/Field/Script/Opcodes/00A LE]] [[FF8/Field/Script/Opcodes/00B NT]] [[FF8/Field/Script/Opcodes/00C AND]] [[FF8/Field/Script/Opcodes/00D OR]] [[FF8/Field/Script/Opcodes/00E EOR]] [[FF8/Field/Script/Opcodes/00F NOP]] [[FF8/Field/Script/Opcodes/010 CAL]] [[FF8/Field/Script/Opcodes/011 JMP]] [[FF8/Field/Script/Opcodes/012 JPF]] [[FF8/Field/Script/Opcodes/013 GJMP]] [[FF8/Field/Script/Opcodes/014 LBL]] [[FF8/Field/Script/Opcodes/015 RET]] [[FF8/Field/Script/Opcodes/016 PSHN_L]] [[FF8/By Aali, myst6re and Shard. == The language == The field script language in ff8 is a simple assembly language with a stack. Here is an example:  stack = []  PSHM_W 1024 # push var1024 onto the stack (stack = [var1024]) PSHN_L 6 # push number 6 onto the stack (stack = [6Â ; var1024]) CAL EQ # compare the two numbers at the top of the stack, pop this numbers, and push the result (1 or 0) into the stack (stack = [1 or 0]) JPF LABEL1 # if the popped top of the stack is 0, jump to LABEL1 (stack = []) PSHN_L 0 # push 0 at the top of the stack (stack = [0]) POPM_W 1024 # pop the top of the stack into var1024 (stack = []) JMP LABEL2 # goto LABEL2 LABEL1 PSHN_L 1 # push 1 at the top of the stack (stack = [1]) POPM_W 1024 # pop the top of the stack into var1024 (stack = []) LABEL2 ... In standard code, it's equivalent to:  if(var1024 == 6) { var1024 = 0; } else { var1024 = 1; } == Reading Documentation == Each Opcode's page lists all the parameters for that function in the order you would put them on the stack before the function call. The inline argument is listed separately, if the function requires one. For example, on the page for [[FF8/Field/Script/Opcodes/01E_SET3|SET3]], the parameters are listed like this: : ''XCoord'': ''YCoord'': ''ZCoord'': '''SET3''' Which means when you call '''SET3''', the ZCoord is the top item on the stack, YCoord is under it, and XCoord is under that, for example  PSHN_L 402 (XCoord) PSHN_L -381 (YCoord) PSHN_L 20 (ZCoord) SET3 17 (walkmesh triangle ID) == Opcode list == {| class="wikitable sortable" border="1"! Opcode! Name! Function Type|-| 000|[[FF8/Field/Script/Opcodes/000_NOP|000 NOP]] ''(Unused)''| Script Processing|-| 001|[[FF8/Field/Script/Opcodes/001_CAL|001 CAL]]| Script Processing|-| 002|[[FF8/Field/Script/Opcodes/002_JMP|002 JMP]]| Script Processing|-| 003|[[FF8/Field/Script/Opcodes/003_JPF|003 JPF]]| Script Processing|-| 004|[[FF8/Field/Script/Opcodes/004_GJMP|004 GJMP]] ''(Unused)''| Script Processing|-| 005|[[FF8/Field/Script/Opcodes/005_LBL|005 LBL]]| Script Processing|-| 006|[[FF8/Field/Script/Opcodes/006_RET|006 RET]]| Script Processing|-| 007|[[FF8/Field/Script/Opcodes/007_PSHN_L|007 PSHN_L]]| Memory|-| 008|[[FF8/Field/Script/Opcodes/008_PSHI_L|008 PSHI_L]]| Memory|-| 009|[[FF8/Field/Script/Opcodes/009_POPI_L|009 POPI_L]]| Memory|-| 00A|[[FF8/Field/Script/Opcodes/00A_PSHM_B|00A PSHM_B]]| Memory|-| 00B|[[FF8/Field/Script/Opcodes/00B_POPM_B|00B POPM_B]]| Memory|-| 00C|[[FF8/Field/Script/Opcodes/00C_PSHM_W|00C PSHM_W]]| Memory|-| 00D|[[FF8/Field/Script/Opcodes/00D_POPM_W|00D POPM_W]]| Memory|-| 00E|[[FF8/Field/Script/Opcodes/00E_PSHM_L|00E PSHM_L]]| Memory|-| 00F|[[FF8/Field/Script/Opcodes/00F_POPM_L|00F POPM_L]]| Memory|-| 010|[[FF8/Field/Script/Opcodes/010_PSHSM_B|010 PSHSM_B]]| Memory|-| 011|[[FF8/Field/Script/Opcodes/011_PSHSM_W|011 PSHSM_W]]| Memory|-| 012|[[FF8/Field/Script/Opcodes/012_PSHSM_L|012 PSHSM_L]]| Memory|-| 013|[[FF8/Field/Script/Opcodes/013_PSHAC|013 PSHAC]]| Memory|-| 014|[[FF8/Field/Script/Opcodes/014_REQ|014 REQ]]| Script Processing|-| 015|[[FF8/Field/Script/Opcodes/015_REQSW|015 REQSW]]| Script Processing|-| 016|[[FF8/Field/Script/Opcodes/016_REQEW|016 REQEW]]| Script Processing|-| 017|[[FF8/Field/Script/Opcodes/017_PREQ|017 PREQ]]| Script Processing|-| 018|[[FF8/Field/Script/Opcodes/018_PREQSW|018 PREQSW]]| Script Processing|-| 019|[[FF8/Field/Script/Opcodes/019_PREQEW|019 PREQEW]]| Script Processing|-| 01A|[[FF8/Field/Script/Opcodes/01A_UNUSE|01A UNUSE]]| Entity|-| 01B|[[FF8/Field/Script/Opcodes/01B_DEBUG|01B DEBUG]] ''(Unused)''||-| 01C|[[FF8/Field/Script/Opcodes/01C_HALT|01C HALT]]| Script Processing|-| 01D|[[FF8/Field/Script/Opcodes/01D_SET|01D SET]]| Entity|-| 01E|[[FF8/Field/Script/Opcodes/01E_SET3|01E SET3]]| Entity|-| 01F|[[FF8/Field/Script/Opcodes/01F_IDLOCK|01F IDLOCK]]| Field related|-| 020|[[FF8/Field/Script/Opcodes/020_IDUNLOCK|020 IDUNLOCK]]| Field related|-| 021|[[FF8/Field/Script/Opcodes/021_EFFECTPLAY2|021 EFFECTPLAY2]]| Music and Sound|-| 022|[[FF8/Field/Script/Opcodes/022_FOOTSTEP|022 FOOTSTEP]]||-| 023|[[FF8/Field/Script/Opcodes/023_JUMP|023 JUMP]]| Entity|-| 024|[[FF8/Field/Script/Opcodes/024_JUMP3|024 JUMP3]]| Entity|-| 025|[[FF8/Field/Script/Opcodes/025_LADDERUP|025 LADDERUP]]| Entity|-| 026|[[FF8/Field/Script/Opcodes/026_LADDERDOWN|026 LADDERDOWN]]| Entity|-| 027|[[FF8/Field/Script/Opcodes/027_LADDERUP2|027 LADDERUP2]]| Entity|-| 028|[[FF8/Field/Script/Opcodes/028_LADDERDOWN2|028 LADDERDOWN2]]| Entity|-| 029|[[FF8/Field/Script/Opcodes/029_MAPJUMP|029 MAPJUMP]]| Field related|-| 02A|[[FF8/Field/Script/Opcodes/02A_MAPJUMP3|02A MAPJUMP3]]| Field related|-| 02B|[[FF8/Field/Script/Opcodes/02B_SETMODEL|02B SETMODEL]]| Entity|-| 02C|[[FF8/Field/Script/Opcodes/02C_BASEANIME|02C BASEANIME]]| Animation|-| 02D|[[FF8/Field/Script/Opcodes/02D_ANIME|02D ANIME]]| Animation|-| 02E|[[FF8/Field/Script/Opcodes/02E_ANIMEKEEP|02E ANIMEKEEP]]| Animation|-| 02F|[[FF8/Field/Script/Opcodes/02F_CANIME|02F CANIME]]| Animation|-| 030|[[FF8/Field/Script/

Navigation menu