Porting Metal Max Xeno from PS4 to PSVITA.
Game files are located in "romfiles.psarc", update files are in "patch01.psarc". I will refer to romfiles.psarc for the remainder of the guide.
Translation files include image assets in ".gxt" located in "\romfiles.psarc\menu\" and text files located in \romfiles.psarc\xls\data\" and "\romfiles.psarc\xls\npc\".
"\romfiles.psarc\xls\data\" files follow a format where data pointers are located in a ".arr" file, which point to text strings in a ".nam" file.
"\romfiles.psarc\xls\data\sysmsg_message.arr" contains 2-byte pointers
01 00 15 00 8C 00 A6 00 E0 00 49 01 A1 01 1C 02
77 02 D3 02 07 03 28 03 6E 03 85 03 A7 03 CF 03
E6 03 08 04 2F 04 50 04 7E 04 B0 04 C4 04 E5 04
0B 05 23 05 3A 05 64 05 98 05 CC 05 FC 05 21 06
52 06 6D 06 90 06 B0 06 D8 06 F6 06 0D 07 41 07
6F 07 DF 07 FB 07 20 08 36 08 59 08 81 08 B4 08
ED 08 1F 09 5A 09 93 09 CD 09 03 0A 46 0A 8B 0A
BC 0A FF 0A 3B 0B 73 0B A9 0B E4 0B 1B 0C 57 0C
A2 0C ED 0C 38 0D 83 0D CE 0D 19 0E 64 0E AF 0E
FC 0E 49 0F 96 0F E3 0F 00 10 21 10 3C 10 56 10
"\romfiles.psarc\xls\data\sysmsg_message.nam" contains text strings separated by NUL(00)
01 00 - In development. $WW
15 00 - Either no corresponding weapon is equipped, or you are out of bullets and big waves, but you can't use any weapons!$WW
8C 00 - $WCAttack won't reach!$WW
A6 00 - Even if you use $_I right now, it will have no effect!$WW
E0 00 - You were so close to defeating it. Use the experience you've gained this time and challenge it again.$WW
49 01 - If you make one more adjustment, you might be able to defeat it. I hope you succeed.$WW
Issues with porting the PS4 version to the PSVITA include pointers/strings that don't match the input expected by the game, and certain .nam files hard-coded within the eboot.bin.
Example error: Menu items descriptions are 2 pointers off from their expected locations. Fixing this requires comparison between the original JP/CHI game and the sysmsg_message (.arr/.nam) files from the PS4 localization.


.nam files hardcoded into the eboot.bin are:
- \xls\data\ability_data.nam
- \xls\data\ability_setumei.nam
- \xls\data\btl_message.nam
- \xls\data\encount_data.nam
- \xls\data\skill_table.nam
To edit the eboot.bin, you need a fully decrypted and decompressed copy of the eboot.bin.
FAGDec with 0syscall6 gives the proper .ELF file, which you'll then need to pass through make_fself.exe from the leaked PSVITA devkit.
Pointers for ability_data.nam and ability_setumei.nam are located in a 10-byte struct within the eboot.bin. First 2 bytes are the ability_data.nam(ability name), second 2 bytes are the ability_setumei.nam(ability description).
01 00 01 00 00 01 05 0A 12 1E
05 00 23 00 00 01 03 07 0C 14
14 00 48 00 00 01 03 07 0C 14
Pointers for btl_message.nam are located as 2-bytes, side-by-side. Issues with this are more mismatches between JP/CHI and the PS4 English localization.
Pointers for encount_data.nam(the various monster encounter biomes) are located in a 40-byte struct.
Pointers for skill_table.nam are located in a 24-byte struct.
NPC dialog and text for scripted events are run from the \romfiles.psarc\xls\npc\ folder. All these ".msg" files seem to work with no modification.

Image ReplacementVita images are stores in the *.gxt format, which is essentially a *.dds file with a different header.
GXT header, courtesy of froid_san:
47 58 54 00 = ID string (GXT)
03 00 00 10 = version (3.01)
01 00 00 00 = number of texture in the file (1)
40 00 00 00 = Offset of the texture data/ header size (0x40)
00 FC 07 00 = Total size of the Textures (0x7FC00)
00 00 00 00 = Number of 16 entry palettes (P4) (0x0)
01 00 00 00 = Number of 256 entry palettes (P8) (0x1)
00 00 00 00 = Padding (0x00000000)
40 00 00 00 = Offset of the single texture data (0x40)
00 F8 07 00 = Size of the single texture data (0x7FC00)
00 00 00 00 = Index of the palette (0x0)
00 00 00 00 = Texture flags/Not used?
00 00 00 60 = Texture Type
00 50 00 95 = Texture Base Format
C0 03 = Width (960)
20 02 = Height (544)
01 00 = Mipmaps (0x1)
00 00 = Not Used?/Padding
Texture type (GXT)
0x00 = SWIZZLED
0x40 = CUBE
0x60 = LINEAR
0x80 = TILED
0x0C = LINEAR STRIDED
Texture base format 0x34
00 00 00 85 = DXT1 no alpha
00 00 00 86 = DXT3
00 00 00 87 = DXT5
10 00 04 00 = 1555
00 00 00 10 = ARGB4444
00 10 00 0C = ARGB8888
00 00 00 0C = ABGR8888
00 50 00 0C = XRGB888
00 10 00 98 = RGB888
00 10 00 05 = RGB565
00 50 00 04 = RGB555
00 10 00 02 = RGB4444
00 10 00 04 = ARGB 1555
00 10 00 95 = palette ABGR 8bpp | 256 colors
00 00 00 95 = palette ARGB 8bpp | 256 colors
00 50 00 00 = L8
00 60 00 00 = A8
00 20 00 07 = A8L8
00 30 00 07 = L8A8
00 50 00 09 = L16
PS4 images are stored in a very similar *.gnf format.
To Extract Vita images use Scarlet.
https://github.com/xdanieldzd/ScarletTo Extract PS4 images, use Noesis and export to *.dds.
https://richwhitehouse.com/index.php?content=inc_projects.php&showproject=91Edit/Resize PS4 images with your favorite image editor. (I used Paint.NET)
To Convert *.dds to *.gxt, use psp2gxt.exe from the leaked Vita or PS3 SDK.
- If you are getting "Invalid UBC texture width", then your *.dds is in the wrong format. (MMX uses DXT5 and ABGR8888 for all images, best to check the original GXT header for which to use.)
Metal Max Xeno also uses some magic bits to layer images. The magic bits are at the end of the source GXT file. They seem to subdivide the image into horizontal and vertical slices, so this one is 1x horizontal and 50x(hex 32) vertical.

I just used a hex editor to copy them to the new GXT file created by psp2gxt.exe.
The last few images were hidden away in *.pack files, which seem to be a container file with *.gxt, *.mdl and *.anim files.
I used a set of quickbms scripts made by froid_san (see attachment) to extract the *.gxt images and replace them with converted and resized files from the PS4 *.pack. (PS4 *.mdl files didn't work on Vita, probably due to different sized images.)
Images imported back into the *.pack should be the exact same size as the exported ones. (I was getting size differences due to not having mipmaps in my imports).