en:guide:febuildergba:the_config_data_structure_of_febuildergba_en

Rule of configuration file.

/config/config.xml

The settings of this tool are stored.


/config/translate/

This is a translation resource used by this tool.

It is KEY:\\r\\nVALUE format, based on the idea like GNU GetText.

:Original string
Translation string


i.imgur.com_ipfrtme.jpg

/config/data/

There is setting data in the game which this tool uses.
Data that seems to be more extensible is included if it is extracted as an external resource.


Search rules.

The files are searched in the following order.
lang contains the selected language. en=English, zh=Chinese.
file_VERSION.lang.txt
file_VERSION.txt
file_ALL.lang.txt
file_ALL.txt

Also in the file, there are things that switch on {J} {U}.
For example, since the pointer value is different in FE8J FE8U, it is used for this switching.

All file format are tab delimited TSV format.
Character codes are unified in UTF-8.

Example.

search“foo”
gameFE8
langen
typeFE8U
if ( Exists("config/data/foo_FE8.en.txt") )
{
   return found;
}
if ( Exists("config/data/foo_FE8.txt") )
{
   return found;
}
if ( Exists("config/data/foo_ALL.en.txt") )
{
   return found;
}
if ( Exists("config/data/foo_ALL.txt") )
{
   return found;
}
return NOT_FOUND;


Suppose foo_ALL.txt is found.

Assume that the contents of foo_ALL.txt were written as follows.

TEST1=A
TEST2=B	{U}
TEST3=C	{J}

Since type==FE8U was specified in the search instruction, the following contents are acquired.

TEST1=A
TEST2=B

If the search command is type == FE8J, the following contents are acquired.

TEST1=A
TEST3=C

List

ai1Define the list of unit Placer AI1.
ai2Define the list of unit Placer AI2.
aiscriptDefine the aiscript command
asmmapFunction map. Displays hints during function map disassembly.
base_rom_infoDefine the capacity and CRC of unmodified ROM.
battleanime_85commandDefine C85 command list of battle animation.
battleanime_auto_recolorIt is used to decide enemy color scheme with battle animation.
battleanime_modeDefine the type of battle animation.
eventDefine the event instruction.
eventcondDefine the type of event condition.
func_langDefine the languages available in FEBuilderGBA.
item_anime_effectDefine a list of weapon animation effects.
item_staff_use_effectDefine the effect of using items.
item_weapon_effectDefine the additional effect of the weapon.
item_usability_array_Determine whether items can be used.
item_effect_array_Define the effect of using items.
item_promotion1_array_Define processing when using Promotion Item.
item_promotion2_array_Define whether it is a Promotion Item (FE 7 only).
item_staff1_array_Define the method of target selection of items (maybe).
item_staff2_array_Define the type of Staff.
item_statbooster1_array_Define a message when using stat booster.
item_statbooster2_array_Define Stat Booster and whether it is a Promotion Item.
magic_commandDefine the command of magic extension.
magic_csa_spell_tableDefine the condition to search for CSATABLE which defines magic animation of magic extension.
magic_extendsDefine how to judge whether magic expansion is appropriate or not.
mappointerDefine the map pointer name.
mapstyleDefine map style list.
other_textDefines an address list in which character string direct value of C language is embedded.
skill_extendsDefine how to judge whether skill extension is appropriate or not.
skill_extends_*For each skill extends, define the skill ID.
song_instrumentMake the instrument information MD5 and assign the instrument name to the instrument address.
song_instrumentsetDefine how to judge whether NIMAP is right or wrong.
soundDefine the name of the sound effect.
sound_foot_stepsDefine footsteps. FE8 only.
tbl_condDefine whether to use tbl or not.
translate_textidFor translation, correspondence table of string IDs in ROMs of US and Japan.
updater.bat.txtIt is not a configuration file. It is a batch file of automatic update.



/config/patch/

Detailed settings are cut out as patches.
You can access it from menu tool → Patch management.

i.imgur.com_59gvcy9.jpg

Patch format

The patch file is in KEY=VALUE format.
// #; is a comment.
Numeric data becomes hexadecimal when 0x is attached.
If you do not add anything, it is a decimal number.
- 0x08000000 With or without a GBA pointer, there is no problem in either case.

Common items

NAME=Patch name


Define the name of the patch.
If undefined, it becomes the file name of the patch.

TYPE=IMAGE TYPE=ADDR TYPE=STRUCT TYPE=BIN TYPE=EA TYPE=SWITCH


Define the type of patch.
There are 6 types.
Details will be explained later.


INFO=Write more information.\\r\\nPlease describe yourself if possible.


Write more information.Please make line breaks\\r\\n


IF:0xEE594=0x4B 0xFA 0x2F 0x59 0x7E 0x19


Defines whether patches are available.
In this example, we are checking whether ROM 0xEE594 is 0x4B 0xFA 0x2F 0x59 0x7E 0x19.
If 0xEE594 is 0x4B 0xFA 0x2F 0x59 0x7E 0x19, you can use this patch.

IF_NOT:0xEE594=0x4B 0xFA 0x2F 0x59 0x7E 0x19

Defines whether patches are available.
On the contrary, in ROM, 0xEE594 will be available unless it is 0x4B 0xFA 0x2F 0x59 0x7E 0x19.

PATCHED_IF:0x080bb182=0x45 0x46 0xE0 0xB4
PATCHED_IF_NOT:0x080bb182=0x45 0x46 0xE0 0xB4

It defines whether the patch has already been adapted.
If we patch twice it will be mainly used with bad BIN patch.


Multilingual.

To write English names, add .en
To write Chinese name, add .zh

NAME=Japanese name
NAME.en=English
NAME.zh=Chinese

From ver20171211, it is now possible to specify languages such as AAAA.en for all parameters.



Patch type ADDR patch.

NAME=きずぐすりの回復量
NAME.en=Recovery amount of Vulnerary
NAME.zh=责骂的回收量

TYPE=ADDR

ADDRESS=0x2fe16

AUTHOR=出典:aeraさんの資料より\r\nhttp://ngmansion.xyz/wiki/hackfe/index.php?%E3%83%91%E3%83%83%E3%83%81#jf501d8a
AUTHOR.zh=来源:从aera的数据\r\nhttp://ngmansion.xyz/wiki/hackfe/index.php?%E3%83%91%E3%83%83%E3%83%81#jf501d8a
AUTHOR.en=Source: From aera's data\r\http://ngmansion.xyz/wiki/hackfe/index.php?%E3%83%91%E3%83%83%E3%83%81#jf501d8a

~
Recovery amount of Vulnerary of FE8J is stored in 0x2fe16.
This is a patch that changes it.

i.imgur.com_yloe1u7.jpg

Multibyte

Although ADDR is basically only 1 byte change,
but You can use the long byte by using the combo box format.

NAME=フリーマップから入らないとフリーズする制約を消す
NAME.en=Eliminate the constraint of freezing unless it enters from the world map.
NAME.zh=消除冻结的限制,除非从免费地图进入

//Implement as an address patch.
TYPE=ADDR

ADDRESS=0xc1e7c
COMBO=default|0x47 0x2D|fix|0xB8 0xE0


i.imgur.com_vruzdeu.jpg

DATASIZE

Newly, DATASIZE specification is supported.
When DATASIZE=4, it operates as 4 bytes (data is written in little endian because it is GBA).

For compatibility, if nothing is specified, it becomes 1 byte with DATASIZE=1.
If COMBO is specified, the DATASIZE specification is ignored and the COMBO specification takes precedence.

Example: Change Portrait of lyn by MODE SELECT on FE7

NAME=MODE SELECT 顔画像 リン編
NAME.en=MODE SELECT Portrait of the Lyn Editing

TYPE=ADDR

ADDRESS=0x4393D8
ADDRESS_TYPE=PORTRAIT
DATASIZE=4         //The Portrait  ID of MODE SELECT is stored by 4 byte DWORD for some reason

Simultaneous specification of ADDRESS

Multiple addresses can be written to the ADRESS with a space delimiter.
The same value is set for each.
It is used when you need to change various places at the same time.


NAME=幸運上限
NAME.en=Upper limit of lucky
NAME.zh=运气最大

//アドレスパッチとして実装します
TYPE=ADDR

ADDRESS=0x80CA0 0x29f0e 0x29f12 0x180d8 0x180dc 0x95694 0x95694 0x9585C

For example, because the lucky limit is hard-coded with scattered settings in various places,
It will change the value at once by describing it as above.

HEX

Use HEX=FALSE if you want to display the number displayed on the UI as a decimal number.

NAME=最大レベル
NAME.en=Max Level
NAME.zh=最高级别

//Implement as an address patch.
TYPE=ADDR

ADDRESS=0x25132
HEX=false //Since it is level, it displays it in decimal number

i.imgur.com_crqavfm.jpg

ADDRESS_TYPE

Please use ADDRESS_TYPE if there is something you want to associate with the value.

ADDRESS_TYPE=UNIT //It is treated as a unit ID.(Character ID)
ADDRESS_TYPE=ITEM //It is treated as a Item ID.
ADDRESS_TYPE=CLASS //It is treated as a Class ID
ADDRESS_TYPE=SONG //It is treated as a Music ID(Song ID)

For example.

NAME=進撃準備
NAME.en=MUSIC_Preparation
NAME.zh=MUSIC_提前准备
//Implement as an address patch.
TYPE=ADDR

ADDRESS=0x080495cc 0x080af17e 0x08031654 0x08090048 0x080960b4 0x0809b880 0x0809c7f6
ADDRESS_TYPE=SONG //the preparation BGM is changed, it is treated as music ID.

i.imgur.com_gen0pz4.jpg

Patch type IMAGE patch.


TYPE=IMAGE


Define the patch to change the image.
This patch needs to be written with a pointer, not an image address.
This is because the image is variable length, so the image address may be changed.


The following is a patch to change FIN of FE8J.

NAME=SYSTEM_FIN

TYPE=IMAGE

WIDTH=256
HEIGHT=160
//Number of pallets used.
PALETTE=1

//Compressed image.
ZIMAGE_POINTER=0xBBF48
//TSA with uncompressed header.
HEADERTSA_POINTER=0xBBF54
//Uncompressed palette.
PALETTE_POINTER=0xBBF44


i.imgur.com_oetdony.jpg

Uncompressed image.
IMAGE_POINTER

Compressed image.
ZIMAGE_POINTER

Use compressed TSA.
ZTSA_POINTER

Use TSA with compression header.
ZHEADERTSA_POINTER

Use TSA with uncompressed header.
HEADERTSA_POINTER

Use uncompressed pallet.
PALETTE_POINTER

It is used when displaying and importing images.
In the example below, it is a condition that it holds one kind of 16 color palette with 256×160 size image.

WIDTH=256
HEIGHT=160
//Number of pallets used.
PALETTE=1


It is hard to write image patches by hand, so you can generate them automatically.

In the menu → tool → graphic tool, find the image, find out the TSA etc, then click the Patch Maker button in the bottom right, all.
Automatically make patches.
There is no need to calculate the pointer by hand each time.

i.imgur.com_whg6ziq.jpg

i.imgur.com_ltklo5l.jpg

i.imgur.com_qj0vh2c.jpg


Patch type STRUCT patch.

TYPE=STRUCT

Structure patch

Use it when you want to change data like a structure.
However, sophisticated things like doing with the tool body can not be done.
If you want to make difficult things, if it can be generalized, you should make it on the tool body side.


//Implement it as a STRUCT patch.
TYPE=STRUCT

//Pointer to data.
POINTER=$GREP4END 0x00 0xB5 0xC0 0x46 0x06 0x48 0xC0 0x46 0x06 0x49 0x89 0x7B 0x89 0x00 0x40 0x58 0x01 0x21 0x00 0xF0 0x02 0xF8 0x17 0x20 0x00 0xBD 0xC0 0x46 0x02 0x4B 0x9F 0x46

//Unit Class 0x00 0x00 [Animation setting pointer] = 8 bytes
//Data size (decimal number).
DATASIZE=8

//Number of data (decimal number).
DATACOUNT=12

//Define the data.
B0:UNIT=ユニット
B1:CLASS=クラス
B2=00
B3=00
P4:BATTLEANIMENAME=アニメ設定


i.imgur.com_noqoruh.jpg

FE 8 Patch to set individual animation of Yugdra patch.
There is no additional structure in Kaitou patch, so I will explain about Yugdra as an example.

B0:UNIT=ユニット
B1:CLASS=クラス
B2=00
B3=00
P4:BATTLEANIMENAME=アニメ設定

↓↓↓↓↓

struct 
{
	byte	unit;			// +0
	byte	class;			// +1
	byte	zero1;			// +2
	byte	zero2;			// +3
	void*	battleanime;	// +4
};



b	sbyte( char )	-128 ~ 127
B	byte			0 ~ 255
W	word			0 ~ 65535
D	dword			0 ~ 4294836225
P	dword			0 ~ 4294836225


About the difference between D and P
In the case of P, it is always recorded as a pointer.
When the user enters 0x123, 0x123 is recorded in D, but if it is P, it is recorded as 0x08000123.


Patch type BIN patch.

type=BIN
Binary data and source code

NAME=SOUND_NIMAP(Native Instrument Map)

TYPE=BIN

PATCHED_IFNOT:$GREP4 0x00 0x3C 0x00 0x00 0x68 0x27 0x50 0x08 0xFF 0xFA 0x00 0xCC 0x00 0x3C 0x00 0x00 0x18 0x7D 0x29 0x08 0xFF 0xFA 0x00 0xCC 0x00 0x3C 0x00 0x00 0x3C 0x8E 0x28 0x08 0xFF 0xF9 0x00 0xA5 0x01 0x3C 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x0F 0x00=0x00 0x3C 0x00 0x00
BIN:$FREEAREA=JAPFE8_NI_Map.bin
INFO=Midi Instrument Map



i.imgur.com_ob9klti.jpg

In this example, paste JAPFE8_NI_Map.bin into the appropriate $ FREEAREA.
Since there is a problem when pasting twice, $GREP4 is investigating whether it is adapted.


Macro.
$FREEAREA	Free area.(Assign free space in ROM.)
$GREP4		Search byte string, but in 4-byte units (high speed).
$GREP1		Search byte string, however 1 byte unit (low speed).
$GREP4_NOT	It is conditional that it can not be found by searching a byte string.
$GREP1_NOT	It is conditional that it can not be found by searching a byte string.




NAME=10分割CG表示

//Implement as a BIN patch.
TYPE=BIN

//Patch adaptation condition.
PATCHED_IF:0x080bb182=0x45 0x46 0xE0 0xB4

BIN:$FREEAREA=show_10split_image.bin

//Jump to the place where 10 division image display routine is inserted.
JUMP:0x080bb182:$r4=show_10split_image.asm

INFO=10分割CGを表示できるようにします
INFO.en=It makes it possible to display 10 divided CG.

i.imgur.com_41kvbuk.jpg

Paste show_10split_image.bin in the free area.
Generate a Jump code for pasted data.
The r4 register is used for the jump code.

For code to jump, the following code will be generated.

When the address is divisible by 4 bytes.
(addr%4 == 0)
ldr r4,[JUMP ADDR]		//+0
mov pc,r4;				//+2
JUMP ADDR				//+4  -->Total 8 bytes.

However, if it is divisible by 2 bytes, NOP is inserted.

NOP					//+0
ldr r4,[JUMP ADDR]		//+2
mov pc,r4;				//+4
JUMP ADDR				//+6  -->Total 10 bytes.

Add offset.

JUMP:0x080bb182:$r4:+2=show_10split_image.bin


In this way, you can jump to the location of show_10split_image.bin installation location + 2.


Direct value. $NONE

JUMP:0x080bb182:$NONE=show_10split_image.bin


Instead of generating a jump code, write the address where show_10split_image.bin is installed as it is.
Since it is an address, it consumes 4 bytes.
The address to be written is in little endian format.

As a practical way of use, I think that I use it where I skip from setting to code.


//In the menu effect, enter the address of the GNP program.
//Because it puts a direct value, there is no register relation so $ NONE.
//In case of a direct value, it is necessary to set it to the address + 1, so +1.
JUMP:0x5C53A8:$NONE:+1=main指南本体.bin


B jump generation.

JUMP:0x988c6:$B=0x9893a


Generate the ASM op code of b 0x9893a at the address of 0x988c6.
b Because it is a jump, I can not fly too far.
b It consumes 2 bytes as it is a jump.


BL jump generation.

JUMP:0x340cc:$BL=0x988c8


Generate the ASM op code of bl 0x988c8 at the address of 0x340cc.
Because it is a jump jump, it can not fly too far.
It consumes 4 bytes as it is a bl jump.



Text Table extension instructions.

EXTENDS:0xe30=TEXT      //Extend the text table to 0xe30.
TEXT:0x0e01=0x0e01.txt  //Write the contents of 0x0e01.txt to the Text ID 0xe01 ..
TEXT:0x0e02=0x0e02.txt
TEXT:0x0e00=0x0e00.txt


Supports text table expansion and writing.
However, as of now, we can not extend other tables.


Patch type EA patch.

TYPE=EA
EA=ea.event


i.imgur.com_wavr6ro.jpg

Add data using Event Assembler.
Add the contents of Event Assembler script specified in EA to the current ROM.

パッチの種類 SWITCHパッチ

NAME=No weapon display at Promotion
TYPE=SWITCH

COMBO.en=no weapons|ONN|with weapons|OFF

ONN:0x0802F5C0=0x00 0x20 0x00 0x20
ONN:0x080D1DE2=0x00 0x20 0x00 0x20

OFF:0x0802F5C0=0xE7 0xF7 0x86 0xF9
OFF:0x080D1DE2=0x44 0xF7 0x75 0xFD

“SWITCH patch” is a further development of the addr patch.

It is used when you need to write to different addresses with different values.
As a difference from the BIN or EA patch, we treat smaller data of about several bytes.

In this example, ON and OFF choices are displayed and
If it is ON, write the contents defined by ONN to the address.
If OFF, write the contents defined by OFF to the address.

MOD

You may want to use the unused area of ??the structure as a parameter of the patch.
In FEBuilderGBA, it is available by creating MOD_*.txt in the patch directory.


IF:0x89268=0x00 0x4B 0x9F 0x46
FORM=UnitForm   //UnitForm(FE8用)で動作します
J_38=スキル1
J_39=スキル2
J_49=個人スキル
J_38:NAME=J_38_SKILLASSIGNMENT_SCROLL1_B39
J_39:NAME=J_39_SKILLASSIGNMENT_SCROLL2_B38
J_49:NAME=J_49_SKILLASSIGNMENT_MASTERY


However, since the parameter to be set to MOD is the label name used in C # of FEBuilderGBA, it is necessary to understand the source code.
Moreover, in the remodeling in Europe and America, I think that it is not often the unused area, but often creates its own structure.
If you think so, MOD may be a feature that is often used in Japan remodeling.

Argument for FEBuilderGBA startup.

FEBuilderGBA.exe [ROM] [--options=value]

FEBuilderGBA will display the welcome screen unless you specify any options.
You can change this by specifying one of the options.


[ROM]

Opens the specified ROM file name.
If the file name is not specified or if the file can not be read, the Welcome screen will be displayed.

--rom=filename

It is same as [ROM].

--lastrom

Open the last opened ROM.
The last ROM opened will be the ROM that was open when you exited FEBuilderGBA.
(At the end of the process, record the currently open file name.)

--force-version=ver

Force to open ROM as a specific version.
Normally, the version is discriminated with the header of the ROM, but it is used when you want to forcibly open it with a specific version.
It is used when the ROM header is damaged for some reason or when you want to load another GBA game for debugging.
Normally you do not need to use it.

Version list
FE8JP
FE7JP
FE6
FE8U
FE7U

--force-detail

Forcibly start from the detailed menu screen.
There are some special reasons and it is used when you want to skip simp

FEBuilderGBA complex argument

--lint

FEBuilderGBA.exe --lint mygame.gba

Run FELint.
If there is no mistake, All Green is displayed.
Also, 0 is returned as the return value.

If there is an error, its contents are displayed.
A non-zero return value is returned.

Error check example using this.

start /w FEBuilderGBA.exe --lint fe8kaitou.en.gba
if NOT %ERRORLEVEL%==0 GOTO ERROR
:OK

:ERROR
pause

--makeups

FEBuilderGBA.exe --makeups=save.ups mygame.gba

Create a UPS.

The target ROM for the UPS is automatically recommended, but can also be specified with the target option.

FEBuilderGBA.exe --makeups=save.ups --target=FE8J.gba mygame.gba

--translate --text

FEBuilderGBA.exe --translate --fromrom=fe8j.gba --torom=fe8u.gba --text=fe8kaitou.en_fixed_only.txt fe8kaitou.en.gba

Translate ROM and overwrite as it is.
This command overwrites the ROM, so be sure to make a copy.

Use –text to specify a text file of translation resources.
This is the same as Text Export data of FEBuilderGBA.

This command imports translation resources, applies translation patches, and imports missing FONTs.

--translate --importfont

FEBuilderGBA.exe --translate --fromrom=fe8j.gba --torom=fe8u.gba --importfont fe8kaitou.en.gba

Import missing FONT into ROM and overwrite it as it is.
This command overwrites the ROM, so be sure to make a copy.

en/guide/febuildergba/the_config_data_structure_of_febuildergba_en.txt · 最終更新: 2019/09/06 21:51 by 211.14.39.225