Thursday, August 6, 2020

Updated guide on how to patch the game using the GL6 repository files Part 5 (patching the ISO)

After doing all of this we have 3 modified game files:

- SLPM_667.16 which contains the VWF code and some translated text
- GL6_FILE.DAT which contains the translated menues, some translated text and the GL5 ENG font
- GL6_SCEN.DAT which contains the translated script

Now all that needs to be done is to build a new ISO using Xpert2:

1. Dump the ISO using Xpert2

2. switch out the original files inside the folder where the game files have been dumped

3. rebuild the ISO

And with that the game is patched:




I will occasionally upload the latest compiled version to the repository, one that is a few weeks old can be found here:

GL6_VWF_0.8.rar
https://bitbucket.org/Risae/growlanser-6-english-translation/downloads/

Updated guide on how to patch the game using the GL6 repository files Part 4 (Adding the VWF to the ELF and translate image files)

Combining the repository scripts with the game files is not the only thing that has to be done.
Inside GL6_FILE.DAT there are the following files that need to be modified:

- the .tm2 image files
- the GL5 font file
- some files that contain text

A full list of the files can be found here:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL6_FILE.DAT/

On the repository the translated .tm2 GL6_FILE.DAT are can be downloaded here:

GL6_FILE.DAT.rar
https://bitbucket.org/Risae/growlanser-6-english-translation/downloads/

1. Extract all of the files and put them in 1 folder like this:



2. use the script "quickbms reimport2 - FILE.bat" from the repository to quickly insert the modified files into the original GL6_FILE.DAT. The paths have to be modified again:


Now the VWF code needs to be added to the ELF.
The latest translated, non-VWF ELF can be downloaded here:

XX.XX.XXXX_NO_VWF_SLPM_667.16
https://bitbucket.org/Risae/growlanser-6-english-translation/downloads/

We are using "armips" to quickly add the VWF code to the ELF file.
armips can be downloaded here:

https://github.com/Kingcom/armips/releases

1. Download all of the .asm files from the repository and put them into the folder where you extracted armips:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/SLPM_667.16/

2. put the ELF file into the folder and rename it to "SLPM_667.16". It should look like this:


3. create a .BAT file and put the following code into it:

armips.exe GL6.asm

pause


The batch file will now automaticly add the current VWF code to the ELF. With this, the font has been patched to the GL6_FILE.DAT and the VWF code has been patched to the ELF file.

Tuesday, August 4, 2020

Updated guide on how to patch the game using the GL6 repository files Part 3 (Patching the games script files)

Combining the repository files with the original game files:

1.1 abcde uses Perl, so i recommend using Strawberry Perl (for Windows) in order for abcde to work:

http://strawberryperl.com/releases.html


1.2 Add following paths to the PATH windows settings (replace <PATH> with the path to those files on your harddrive):

<PATH>\Strawberry Perl Portable\perl\site\bin
<PATH>\Strawberry Perl Portable\perl\bin
<PATH>\Strawberry Perl Portable\c\bin

https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/


1.3 Download abcde and extract it:

https://www.romhacking.net/utilities/1392/


1.4 Copy all the abcde .BAT files (and also abcde.tbl) from the repository to the abcde folder:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL%205%20and%206%20abcde%20scripts/


1.5 Now create a new folder somewhere where you will merge the repositor script with the games .SCEN/SCEC/STXT files.
I'm personally using it like this:



Inside the folder are the contents of the dumped GL6_SCEN.DAT file.


1.6 inside the abcde folder is a file called "abcde Atlas bulk import.bat".
Open it up and replace "PATH1" with the path of the original .SCEN files.
Replace "PATH2" with the path to the repository files.



1.7 Execute "abcde Atlas bulk import.bat" and it should automaticly insert all the repository files into the game files.


2.1 Download the latest version of quickBMS

https://aluigi.altervista.org/quickbms.htm


2.2 Copy all the files of the quickBMS repository folder into the quickBMS folder:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL%205%20and%206%20quickBMS%20scripts/


2.3 Now the modified .SCEN/.SCEC/.STXT files need to be imported into the original .DAT file, "quickbms reimport2 - SCEN.bat" can be used to do that, but just as with the abcde scripts the path needs to be updated in order to work:



Updated guide on how to patch the game using the GL6 repository files Part 2 (Dumping the ISO)

I actually took a look at the Growlanser 1 PS1 and PSP game contents, to see what kind of issue other people might have had to translate the game and i came across the problem of file compression. As far as i can tell, both the PS1 and PSP version use some kind of compression algorithm to reduce the filesize of the games ISO.
Because the games (Growlanser 5 and 6) .DAT files do not use any kind of compression we were able to dump the scripts of the game rather easily.

Heres a quick overview on how to compile all of the repository scripts into the game files.

1. Dump the ISO using "Xpert2"
2. extract the contents of the .DAT files with "quickBMS" using the Growlanser script
3. use "abcde" to re-insert the modified script files into the games .SCEN/.SCEC/.STXT files
4. use "quickBMS" to reinsert the modified files into the games .DAT files
5. use "Xpert2" to create a new ISO with the modified files

After dumping the ISO using Xpert2 or some other program you will have the following (on both Growlanser 5 and 6):

SLPM_667.16 is the ELF of the game
SYSTEM.CNF some game config file
DUMMY.DAT dummy file containing dummy data
GL6_BTL.DAT no clue about that one
GL6_CHAR.DAT seems to store the character model files
GL6_FACE.DAT probably contains all of the games face image files
GL6_FILE.DAT contains all of the image files (for example, the games character menu) and some other stuff
GL6_MAP.DAT Seems to contain the map data, also has a file that has all of the different map information stored in it
GL6_MOV.DAT contains alls of the movies without sound
GL6_SCEN.DAT contains all of the games script files
GL6_SND.DAT contains the sound files
GL6_VOI.DAT contains all of the voice data


1. First you have to download Xpert2 and use it to dump the ISO file (a little bit out of date guide but its still pretty much the same):

https://growlanser6english.blogspot.com/2019/03/growlanser-6-unpack-iso.html


2 Download quickBMS and extract the it in a folder, put the Growlanser quickBMS script into the same folder.
The quickBMS Growlanser 5/6 script can be found here:

https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/GL%205%20and%206%20quickBMS%20scripts/


3. Use quickBMS to dump the contents of "GL6_SCEN.DAT":

https://growlanser6english.blogspot.com/2019/03/growlanser-6-unpack-iso.html

All of the contents of SCEN.DAT will be extracted from the .DAT file.
Now you can pretty much do the following

- We have the repository folder that contains the abcde script files (/GL6_SCEN.DAT/)
- We have a folder that contain the extracted GL6_SCEN.DAT (game) files
- We have the original GL6_SCEN.DAT file

We use abcde to import the repository script files into the original .SCEN files.
And after that we use quickbms to import the modified .SCEN files to the original .DAT files.
(And after that you just have to use armips to import the variable width code into the ELF file)

Repository script (abcde) > original .SCEN/SCEC/STXT (quickBMS) > original GL6_SCEN.DAT (Xpert 2) > dump the iso and switch out the files, rebuild the ISO

Updated guide on how to patch the game using the GL6 repository files Part 1 (Overview)

Over the last year the way we compile our repository scripts changed a little bit, so heres an updated How-To guide on how to compile the repository scripts into the games .DAT files.
But first, a quick overview on the different tools we use for our project:


- PCSX2
https://pcsx2.net/
I personally use the PS2 emulator to test the game


- PCSX2 debugger
a useful debugger for checking the MIPS code that is being processed in the background while the game is running.


- PCSX2dis (ps2dis)
https://forums.pcsx2.net/Thread-PCSX2dis-v1-1-A-ps2dis-inspired-PCSX2-enabled-Game-Hacking-Tool-W-I-P-13-02-2015
Another useful tool:
"PCSX2dis is an ambitious new hacking tool based on old hackers' favourite ps2dis. Created for advanced hackers and beginner/intermediate hackers who wish to learn ASM hacking, this is an all-purpose tool fixed to a modded version of PCSX2, designed to make PS2 game hacking easier than ever, all in realtime!"
Afaik, only works with PCSX2 1.2.1.


- bitbucket
https://bitbucket.org/Risae/growlanser-6-english-translation/src/master/
We are using the repository tool "Bitbucket" to share and store our project.
It contains all the games script files and also files for various software that we are using.
We are using GitHub Desktop to sync our repository files to our local hard drive:

https://medium.com/@rvrajavijay/how-to-use-bitbucket-repository-in-the-github-desktop-fae2ef61135d

With this you can download the repository to your local computer and work on the files in there.
Any changes you make you can "commit" to the repository for all of the team to access.
The changes will be documented and everybody can see what changed.
A lot easier than working on the scripts files inside the bitbucket web view.


- abcde (Cartographer and Atlas)
https://www.romhacking.net/utilities/1392/
abcde is a tool to dump (Cartographer) and re-import (Atlas) the Growlanser 6 script file text.
I already dumped all of the script files that exist in Growlanser 6, so currently we only use its Atlas function to reinsert it into the games files.
The control codes for abcde are stored inside "/GL 5 and 6 abcde scripts/abcde.tbl" and so far i think i have all of the ones that are used inside the table file.


- quickBMS
https://aluigi.altervista.org/quickbms.htm
quickBMS is a tool to dump and reinsert game specific files.
For example, Growlanser 6 uses ".DAT" archives that stores the game files.
We are using quickBMS to dump all of the files that are inside the .DATs using a custom script which is saved in "/GL 5 and 6 quickBMS scripts/growlanser.bms"


- Xpert 2
http://xpert2.blogspot.com/
Xpert 2 is a tool to dump the contents of the games ISO and rebuild it.
Since the filesizes of the modified .DAT files are going to be bigger than the original, Xpert lets us create a new ISO with the bigger files.


- Apache2.0
https://www.psx-place.com/resources/apache.697/
Apache was another ISO tool to dump and hotswap files inside the games ISO.
Because of the fact that most of the game files are going to be bigger in size we sadly can't use it anymore.


- deltapatcher
Deltapatcher is a useful tools to create patched for the ISO, but this only works if the modified ISO is not bigger in size than the original.
Because of the new quickBMS script we don't have any script size limitation anymore, but this also means that we can't use deltapatcher because the filesize of the original ISO will increase.


- rainbow
https://github.com/marco-calautti/Rainbow
Rainbow is a tool to view the TIM2 (.tm2) image files


- Ghidra with the Emotion Engine processor
https://github.com/NationalSecurityAgency/ghidra
https://github.com/beardypig/ghidra-emotionengine
Ghidra lets us decompile the "ELF" file (SLPM_667.16).
The ELF file contains various text that only can be translated in there, but its almost all been translated.


- armips
https://github.com/Kingcom/armips
We are using armips to quickly modify the ELF file, mainly for the Variable Width Font code.


- TileShop
https://www.romhacking.net/forum/index.php?topic=30404.0
A tool to view the Growlanser 5/6 font files.
Uses XML files to tell the program how the font file is build up.


- wxMEdit
https://wxmedit.github.io/
A bit outdated Hex editor which supports Shift-JIS.