Difference between revisions of "FF7/Field/Script/Opcodes/30 IFKEY"

From Final Fantasy Inside
< FF7‎ | Field‎ | Script‎ | Opcodes
Jump to navigation Jump to search
my_wiki>Synergy Blades
m (Arguments)
my_wiki>Synergy Blades
(Corrected)
Line 1: Line 1:
 
* Opcode: '''0x30'''
 
* Opcode: '''0x30'''
 
* Short name: '''IFKEY'''
 
* Short name: '''IFKEY'''
* Long name: If Key is pressed.
+
* Long name: If Key Pressed
  
 
==== Memory layout ====
 
==== Memory layout ====
 
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
 
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
 
! width="40" | 0x30
 
! width="40" | 0x30
! width="40" | ''B/0''
+
! width="40" | ''B''
! width="40" | ''C''
 
 
! width="40" | ''A''
 
! width="40" | ''A''
 
|}
 
|}
Line 13: Line 12:
 
==== Arguments ====
 
==== Arguments ====
  
* '''const Bit[4]''' ''B'': Which button to check for.
+
* '''const UShort (Bit field)''' ''B'': Button ID to check for.
* '''const Bit[4]''' ''0'': Zero.
+
* '''const UByte''' ''A'': Amount to jump if button not pressed.
* '''const UByte''' ''C'': Condition of button.
 
* '''const UByte''' ''A'': Amount to jump if comparison is false.
 
  
 
==== Description ====
 
==== Description ====
  
Checks the status of a button being pressed. If the checked button fails the condition check, then the code jumps ahead ''A'' amount of bytes.
+
Checks the status of a button being pressed; if pressed, the "if" body executes (that is, the script pointer is moved to the opcode after the current IFKEY). If the checked button fails the condition check, then the script pointer moves ahead ''A'' bytes.
  
==== Conditions ====
+
==== Button IDs ====
  
 
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
 
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
 
! style="background:rgb(204,204,204)" width="40" | ID
 
! style="background:rgb(204,204,204)" width="40" | ID
! style="background:rgb(204,204,204)" width="100" | Button
+
! style="background:rgb(204,204,204)" width="120" | Button
 +
|-
 +
| align="center" | 0x0001
 +
| Assist
 +
|-
 +
| align="center" | 0x0008
 +
| Start
 +
|-
 +
| align="center" | 0x0010
 +
| Up
 +
|-
 +
| align="center" | 0x0020
 +
| Right
 +
|-
 +
| align="center" | 0x0040
 +
| Down
 +
|-
 +
| align="center" | 0x0080
 +
| Left
 +
|-
 +
| align="center" | 0x0100
 +
| Camera
 
|-
 
|-
| align="center" | 0
+
| align="center" | 0x0200
| Pressed
+
| Target
 
|-
 
|-
| align="center" | 1
+
| align="center" | 0x0400
| Not Pressed
+
| Page Up
 
|-
 
|-
|}
+
| align="center" | 0x0800
 
+
| Page Down
==== Button IDs ====
 
 
 
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
 
! style="background:rgb(204,204,204)" width="40" | ID
 
! style="background:rgb(204,204,204)" width="120" | Button
 
 
|-
 
|-
| align="center" | 5
+
| align="center" | 0x1000
| Triangle [Menu]
+
| Menu
 
|-
 
|-
| align="center" | 6
+
| align="center" | 0x2000
| Cross [Cancel]
+
| OK
 
|-
 
|-
| align="center" | 7
+
| align="center" | 0x4000
| Circle [OK]
+
| Cancel
 
|-
 
|-
| align="center" | 8
+
| align="center" | 0x8000
| Square [EXT]
+
| Switch
 
|-
 
|-
 
|}
 
|}

Revision as of 18:36, 19 January 2007

  • Opcode: 0x30
  • Short name: IFKEY
  • Long name: If Key Pressed

Memory layout

0x30 B A

Arguments

  • const UShort (Bit field) B: Button ID to check for.
  • const UByte A: Amount to jump if button not pressed.

Description

Checks the status of a button being pressed; if pressed, the "if" body executes (that is, the script pointer is moved to the opcode after the current IFKEY). If the checked button fails the condition check, then the script pointer moves ahead A bytes.

Button IDs

ID Button
0x0001 Assist
0x0008 Start
0x0010 Up
0x0020 Right
0x0040 Down
0x0080 Left
0x0100 Camera
0x0200 Target
0x0400 Page Up
0x0800 Page Down
0x1000 Menu
0x2000 OK
0x4000 Cancel
0x8000 Switch