Difference between revisions of "FF7/Command data"

From Final Fantasy Inside
< FF7
Jump to navigation Jump to search
my_wiki>G
m (18 revisions imported)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== KERNEL.BIN - Section 1: Command data format ==
+
== KERNEL.BIN - Section 1: Command data format ==
<i>(Note:This information has been provided by NFITC1. Please thank him for his hard work as reversing is a long and thankless task.)</i>
 
  
 +
This section contains the data for Menu commands.<br />
  
This section contains the data for Menu commands. There are 32 entries of 8 bytes in the following format:
+
There are 32 entries of 8 bytes in the following format:
{| border="0" cellpadding="3" cellspacing="1" style="background: rgb(0,0,0)"  
+
 
! style="background:rgb(204,204,204); width:50px;" align="center" | Offset
+
{| class="wikitable"
! style="background:rgb(204,204,204); width:50px;" | Length
+
! style="background: rgb(204,204,204); width: 50px" align="center" | Offset
! style="background:rgb(204,204,204); width:275px;" colspan="2" | Description
+
! style="background: rgb(204,204,204); width: 50px" | Length
 +
! style="background: rgb(204,204,204); width: 275px" colspan="2" | Description
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 0x00
+
| style="background: rgb(255,255,255)" align="center" | 0x00
|style="background:rgb(255,255,255)" | 1 byte
+
| 1 byte
|style="background:rgb(255,255,255)" | Initial Cursor Action*
+
| Initial Cursor Action*
|style="background:rgb(255,255,255)" | &nbsp;
 
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 0x01
+
| style="background: rgb(255,255,255)" align="center" | 0x01
|style="background:rgb(255,255,255)" | 1 byte
+
| 1 byte
|style="background:rgb(255,255,255)" | Force Targeting**
+
|
|style="background:rgb(255,255,255)" | &nbsp;
+
[[FF7/Battle/Targeting_Data|Target Flags]]
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 0x02
+
| style="background: rgb(255,255,204)" align="center" | 0x02
|style="background:rgb(255,255,255)" | 2 bytes
+
| style="background: rgb(255,255,204)" | 2 bytes
|style="background:rgb(255,255,255)" | Unknown (Always [FFh])
+
| style="background: rgb(255,255,204)" | Unknown (Always [FFFFh])
|style="background:rgb(255,255,255)" | &nbsp;
 
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 0x04
+
| style="background: rgb(255,255,255)" align="center" | 0x04
|style="background:rgb(255,255,255)" | 2 bytes
+
| 2 bytes
|style="background:rgb(255,255,255)" | Single Target Camera
+
|
|style="background:rgb(255,255,255)" | &nbsp;
+
[[FF7/Battle/Camera_Movement_Id_List|Camera Movement Id]] for single target.
 
|-
 
|-
|style="background:rgb(255,255,255)" align="center" | 0x04
+
| style="background: rgb(255,255,255)" align="center" | 0x06
|style="background:rgb(255,255,255)" | 2 bytes
+
| 2 bytes
|style="background:rgb(255,255,255)" | Multiple Targets Camera
+
|
|style="background:rgb(255,255,255)" | &nbsp;
+
[[FF7/Battle/Camera_Movement_Id_List|Camera Movement Id]] for multiple targets.
 
|}
 
|}
<nowiki>*Initial Cursor Action:</nowiki>
 
The different values will tell it what to do or what menu to bring up:
 
  
{|border="1"
+
<br /> *Initial Cursor Action: The different values will tell it what to do or what menu to bring up:
|-
+
 
!style="background:rgb(204,204,204);" align="center" |Value
+
{| class="wikitable"
!style="background:rgb(204,204,204);" align="center" |Effect
+
! Value
 +
! Effect
 
|-
 
|-
|0h
+
| 00h
|Perform command, using selected target
+
| Perform command using target data
 
|-
 
|-
|1h
+
| 01h
|Magic Menu
+
| Magic Menu
 
|-
 
|-
|2h
+
| 02h
|Summon Menu
+
| Summon Menu
 
|-
 
|-
|3h
+
| 03h
|Item Menu
+
| Item Menu
 
|-
 
|-
|4h
+
| 04h
|E.Skill Menu
+
| E.Skill Menu
 
|-
 
|-
|5h
+
| 05h
|Throw Menu
+
| Throw Menu
 
|-
 
|-
|6h
+
| 06h
|Limit Menu
+
| Limit Menu
 
|-
 
|-
|7h
+
| 07h
|Start on enemy
+
| Enable Target Selection via Cursor
 
|-
 
|-
|8h
+
| 08h
|W-Item Menu
+
| W-Magic Menu
 
|-
 
|-
|9h
+
| 09h
|W-Magic Menu
+
| W-Summon Menu
 
|-
 
|-
|Ah
+
| 0Ah
|W-Summon Menu
+
| W-Item Menu
 
|-
 
|-
|Bh
+
| 0Bh
|Coin Menu
+
| Coin Menu
 
|}
 
|}
  
Note: If this value is 0h and Target is NULL (FFh) then the action will be performed without showing the cursor.
+
The commands themselves are hard-coded into the Battle Engine and their actions cannot be changed via editing the KERNEL.BIN<br /> Example of what this means: If the summon command was changed to bring up the magic menu and Cure was selected, the battle engine would perform Choco/Mog summon instead. Why? Because The Battle Engine is expecting summon data from command 03h. While the target was considered based on the targeting information of Cure, which has the same magic index as Choco/Mog has summon index, the attack the Battle Engine selected to perform was Summon attack 00h which is Choco/Mog.
 
 
<nowiki>** Targeting data:</nowiki>
 
This is the targeting data used throughout the battle engine to determine which battle participant (PCs and monsters alike) to perform damage calculation upon. It is stored as an 8-bit bitmask:
 
{|border="1"
 
|-
 
!style="background:rgb(204,204,204); " align="center" |Bitmask
 
!style="background:rgb(204,204,204); " align="center" |Effect
 
|-
 
|01h
 
|Enable selection. Without this, the target cannot be changed from the participant performing the command.
 
|-
 
|02h
 
|Start on Enemies. This will default the target to the first member of the opposing row.
 
|-
 
|04h
 
|Multiple by default. This will select all targets on a row.
 
|-
 
|08h
 
|Multiple "toggle". This will enable toggling between a single target or multiple targets.
 
Magics that have this enabled must be linked to an "All" to be multiple. Commands must have a Mega-All.
 
|-
 
|10h
 
|One side only. This will not let you choose another row other than the one defined by 02h.
 
|-
 
|20h
 
|Long ranged enemy can be targeted.
 
|-
 
|40h
 
|All participants. Targets all available targets in the battle.
 
|-
 
|80h
 
|Random target. Choose, from among selected targets, one to perform damage calculation upon.
 
|}
 

Latest revision as of 05:11, 23 May 2019

KERNEL.BIN - Section 1: Command data format

This section contains the data for Menu commands.

There are 32 entries of 8 bytes in the following format:

Offset Length Description
0x00 1 byte Initial Cursor Action*
0x01 1 byte

Target Flags

0x02 2 bytes Unknown (Always [FFFFh])
0x04 2 bytes

Camera Movement Id for single target.

0x06 2 bytes

Camera Movement Id for multiple targets.


*Initial Cursor Action: The different values will tell it what to do or what menu to bring up:

Value Effect
00h Perform command using target data
01h Magic Menu
02h Summon Menu
03h Item Menu
04h E.Skill Menu
05h Throw Menu
06h Limit Menu
07h Enable Target Selection via Cursor
08h W-Magic Menu
09h W-Summon Menu
0Ah W-Item Menu
0Bh Coin Menu

The commands themselves are hard-coded into the Battle Engine and their actions cannot be changed via editing the KERNEL.BIN
Example of what this means: If the summon command was changed to bring up the magic menu and Cure was selected, the battle engine would perform Choco/Mog summon instead. Why? Because The Battle Engine is expecting summon data from command 03h. While the target was considered based on the targeting information of Cure, which has the same magic index as Choco/Mog has summon index, the attack the Battle Engine selected to perform was Summon attack 00h which is Choco/Mog.