Hacking [PSP] La Pucelle Ragnarok Translation

Linka

Well-Known Member
Member
Joined
Sep 13, 2013
Messages
248
Trophies
0
Age
34
XP
189
Country
United States
In general it seems to be the items that you'd be able to buy in the shops. Though of course due to a lack of "y", "Fairy Dust" is now "Fair Dust", but he might be able to someday figure out how to change the font.
 

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
V0.0.2 is for item names and descriptions in the store....

That is actually a typo... I can put y's in but I need to use a different character code.

I have fixed it for the next release. If anyone else finds any typos please let me know. I have to hex edit every letter and I am bound to make some mistakes.

I am a little more that halfway through skills. I think I have finished all the character skills but still need to get through the creature skills. I will post another update once I am done.
 

Cyberdrive

Well-Known Member
Member
Joined
Aug 6, 2013
Messages
141
Trophies
0
XP
181
Country
Serbia, Republic of
I am having a hard time finding any information about txp files?
I've had a look at .txp files in the START_JP.dat, here's what I figured out in a hex editor. Little endian byte order here and everywhere else.
16-byte TXP header:
WORD image_width,
WORD image_height,
DWORD image_colors,
WORD image_colors (again),
WORD unknown (0x1 or 0x10)
WORD 0x1
WORD 0x1
64 or 1024-byte 32-bit (likely RGBA8888) palette. The header doesn't have palette size, but IF (image_height > 255) OR (image_colors > 16) THEN palette is 1024 bytes long ELSE it's 64 bytes long, at least as long as START_JP.dat is concerned. I wouldn't count on that method too much for other TXP files though.
Raw image data in 16 colors (4 bits per pixel, 64-byte palette) or 256 colors (8bpp, 1024-byte)
I don't know any tools made for this format, but I'm not really into JRPGs, so it doesn't mean that they don't exist.

But let's assume that they don't.
I would change TXP files to GIM, which is 'default' PSP image format and has many existing tools to convert them to common image formats (TGA/BMP/PNG etc).
Having edited them, I'd convert them to GIM with GimConv (official Sony tool available as a part of PS3 Custom Theme compiler v2.00, for example) and change GIMs back to TXP, ready for reinsertion to SCRIPT_JP.DAT

Technical details follow, also see pic related:
TXP2GIM algorithm: get image width, height and number of colors from 16-byte TXP header described above,
use them to determine palette size and create a 128-byte GIM header in a new file,
copy TXP palette immediately after the GIM header, create and insert second GIM header (80 bytes) between the palette and image iself, copy the rest of the TXP to GIM.
Both inserted GIM headers are shown in orange color on the attached screenshot:
FontB0_GIM.png
More or less reverse engineered GIM specification: http://pspdum.my.land.to/psp/gim.html
PSP SDK has gim_format.h file with all official details if you're curious.

Convert GIM to usable format using, for example, GIM2PNG converter.
I personally use XnView with GIM plugin for SUSIE, links are here: http://gbatemp.net/threads/susie-pl...nitrosdk-images-and-nitro-rom-file-sy.162863/

Convert edited image to GIM using GimConv.
Configure the converter to match game's format by editing GimConv.cfg using the following command line arguments for GimConv:
--pixel_order faster (this enables swizzling)
--image_format index4 (for 16-colors) or
--image_format index8 (for 256-colors)
--palette_format rgba8888 (I think; it's ???a8888 definitely)
--format_style psp
--format_endian little

GIM2TXP: replace first GIM header with original TXP header, copy new or restore old TXP palette, remove second GIM header, copy new image data.
Also, since DAT_Unpack_v1.py available above is based on my mistake and doesn't work correctly, here's a proper extractor for START_JP.dat:
Code:
import os, sys, struct

datfname = 'START_JP.dat' # hardcoded for now
scriptdir = os.path.dirname(sys.argv[0])
if scriptdir != '': os.chdir(scriptdir) # else we're started from Python console

try:
    datfile = open(datfname, 'rb')
except IOError:
    print "Extraction aborted: no START_JP.dat file in the current directory"
    exit()

fnum = struct.unpack('I', datfile.read(4))[0]
foffset = fnum * 32 + 16 # 1168, file table length
datfile.seek(16)
fentries = list()

for i in range(fnum):
    fend = struct.unpack('I', datfile.read(4))[0] + foffset
    fname = datfile.read(28).split('\x00')[0]
    fentries.append((fname, fend))

dumpdir = os.path.splitext(os.path.basename(datfname))[0] # 'START_JP' for PSP
dumpdir = os.path.join(scriptdir, dumpdir)
try:
    os.mkdir(dumpdir)
except WindowsError: pass
os.chdir(dumpdir)

for fentry in fentries:
    fname, fend = fentry
    print os.path.join(dumpdir, fname)
    dumpfile = open(fname, 'wb')
    dumpfile.write(datfile.read(fend - datfile.tell()))
    dumpfile.close()
datfile.close()
I hope that I'll have a look at DAT decompression routine in EBOOT.BIN this weekend (finally), but if disabling decompression in favor of using uncompressed START_JP.LZS directly requires skills than I don't have, I'll probably optimize Python script for LZS compression instead.
 

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
Cyberdrive,

Thanks for help. I understand not being into jrpg. JRPG are about the only games I still enjoy playing. I appreciate all your technical help. Right now I have enough information that I should be able to translate and package about 98% of the game without issues.

I have modified your Unpack and created a new pack script. When I was translating some of the text in the files I was noticing that some files were not quite right. I was still able to package everything back up and get it working. I will post the final versions I plan to use once I have confirmed everything is working.
 

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
Alright I can confirm the new pack and unpack work.

Here is the code:
www.tarranoth.com/LPR/DAT_Unpack_v2.py
www.tarranoth.com/LPR/DAT_Pack_v2.py

DAT_Unpack_v2.py
######################################################################
# DAT_Unpack_v2.py
######################################################################
# Built to Pack files in dat format for La Pucelle: Ragnaraok [JPN]
# Run with python 2.7
# Last Update: 09/21/2013
######################################################################
import os, sys, struct, time

dTestTime = 0.0
dStartTime = time.time()

datfname = 'START_JP.dat' # hardcoded for now
headerName = 'START_JP_header.dat'

datfile = open(datfname, 'rb')

scriptdir = os.path.dirname(sys.argv[0])
if scriptdir != '': os.chdir(scriptdir) # else we're started from Python console

try:
datfile = open(datfname, 'rb')
except IOError:
print "Extraction aborted: no START_JP.dat file in the current directory"
exit()

fnum = struct.unpack('I', datfile.read(4))[0]
foffset = fnum * 32 + 16 # 1168, file table length
datfile.seek(16)
fentries = list()

for i in range(fnum):
fend = struct.unpack('I', datfile.read(4))[0] + foffset
fname = datfile.read(28).split('\x00')[0]
fentries.append((fname, fend))

dumpdir = os.path.splitext(os.path.basename(datfname))[0] # 'START_JP' for PSP
dumpdir = os.path.join(scriptdir, dumpdir)
try:
os.mkdir(dumpdir)
except WindowsError: pass
os.chdir(dumpdir)

for fentry in fentries:
fname, fend = fentry
print hex(fend)
print os.path.join(dumpdir, fname)
dumpfile = open(fname, 'wb')
dumpfile.write(datfile.read(fend - datfile.tell()))
dumpfile.close()

# Write header file for packing
datfile.seek(0)
headerFile = os.path.join(dumpdir, headerName)
headerDump = open(headerFile, 'wb')
headerDump.write(datfile.read(foffset))
headerDump.close()
datfile.close()

dTestTime = time.time() - dStartTime
print
print "Total Test Time = %.3f sec" % dTestTime
DAT_Pack_v2.py
######################################################################
# DAT_Pack_v2.py
######################################################################
# Built to Pack files in dat format for La Pucelle: Ragnaraok [JPN]
# Run with python 2.7
# Last Update: 09/21/2013
######################################################################

import math
import struct
import time
import copy
import os


fileName = 'START_JP/START_JP_header.dat'
fileName1 = 'START_JP_Temp.dat'
fileDir = 'START_JP/'

dTestTime = 0.0
dStartTime = time.time()

# Open file to convert
f = open(fileName, 'rb')
f1 = open(fileName1, 'w+b')

fnum = struct.unpack('I', f.read(4))[0]
foffset = fnum * 32 + 16 # 1168, file table length
f.seek(16)
fentries = list()

for i in range(fnum):
fend = struct.unpack('I', f.read(4))[0] + foffset
fname = f.read(28).split('\x00')[0]
fentries.append((fname, fend))

f.seek(0)
f1.write(f.read(foffset))

for fentry in fentries:
fname, fend = fentry
fname = os.path.join(fileDir, fname)
print fname
dumpfile = open(fname, 'rb')
dumpfile.seek(0,2)
byteRead = dumpfile.tell()
dumpfile.seek(0)
f1.write(dumpfile.read(byteRead))
dumpfile.close()

f.close()
f1.close()

dTestTime = time.time() - dStartTime
print
print "Total Test Time = %.3f sec" % dTestTime
 

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
So I have a new patch update. It includes every skill in the game. If you follow the previous instructions it includes patch v0.0.3.

If you find any typos please let me know.

For this update you need both the eboot and start_jp.lzs

LPR_translation_v0.0.3 (Skills)
1) Acquire PSP La Pucelle Ragnarok ISO
2) Download EBOOT.BIN - www.tarranoth.com/LPR/EBOOT.BIN
3) Download START_JP.LZS - www.tarranoth.com/LPR/START_JP.LZS
4) Backup ISO, EBOOT.BIN and START_JP.LZS
5) Extract files from LPR ISO using UMDGen
6) Replace EBOOT.BIN in \PSP_GAME\SYSDIR\ with the downloaded EBOOT.BIN
7) Replace START_JP.LZS in \PSP_GAME\USRDIR\ with the downloaded START_JP.LZS
8) Create a new LPR ISO with UMDGen
9) Either use a PSP emulator or download to PSP and enjoy

Note: You must have CFW in order to play the translated ISO on a PSP

Screenshot of skills:

Skills.jpg
 
  • Like
Reactions: kit13 and Linka

Linka

Well-Known Member
Member
Joined
Sep 13, 2013
Messages
248
Trophies
0
Age
34
XP
189
Country
United States
Awesome! I'd been busy the past couple days, but I should be able to give this more of a good whirl, now.

Skills will help so much in this.
 

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
I was hoping to have locations translated as well but somehow I screwed up during my hex editing tonight. It might take awhile to solve the issue. I think I found it but I have to re-encrypt everything.

-ChepChep
 

xhai

Well-Known Member
Member
Joined
Sep 19, 2012
Messages
173
Trophies
0
XP
109
Country
I was hoping to have locations translated as well but somehow I screwed up during my hex editing tonight. It might take awhile to solve the issue. I think I found it but I have to re-encrypt everything.

-ChepChep


Nice work ChepChep i wish i could help you but your much far better than me...
keep up! i do support your project..

it's been a while for me, i need to resume my projects since my partner got missing..
 
D

Deleted User

Guest
Chep what is the status as of ver 0.0.3?

I guess:
Main Menu + options – 100%
Battle Menu – 100%
Character Names – 100%
Shop Menu – 100%
Items - 100%
Skills – 100%

What am i missing?
 

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
NicoBlogs,

That's about right. I guarantee that I have made some typos in the content.

Xhai,

I do not have access to DLC for the game. Also I do not know Japanese so unless the content is in the PS2 version or in Disgaea, I am going to have a hard time translating it. Google translate works for nouns or names but not for any dialogue. It can give me a clue and most of the time I can then find it in the Disgaea games.

All,

Well I solved the issue I had last night. It was a pain to find but somehow I had inserted an extra 5 bytes (5 zeros) into a file. It made everything crash when I tried to run it after encrypting the file.

It also turns out what I was translating was not what I thought it was. The maps names are for when you enter a location. I thought I was translating the names on the maps. I am going to have to find them and then I hope to post a new update today.
 

Linka

Well-Known Member
Member
Joined
Sep 13, 2013
Messages
248
Trophies
0
Age
34
XP
189
Country
United States
For the record, only the Rozalin DLC is the one you pay for. The Elly and Prinny Hero DLC are both free, but Prinny Hero requires you to be strong enough to beat him up (he's level 100).

But I guess getting online access might be a little hard. Though it also depends on whether or not the DLC isn't just hidden in the code regardless, since it might be on-disk.
 

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
Prinny Hero is definitely in the base game. I do not remember translating Rozalin anywhere in the name file.
 

Linka

Well-Known Member
Member
Joined
Sep 13, 2013
Messages
248
Trophies
0
Age
34
XP
189
Country
United States
Hmm, maybe Rozalin's one of those DLCs that was actually added post-development. Given the random choice of her, I think they might've held a poll to add her in afterwards. It'd explain the lack of presence in the file.
 

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
So I have a new patch update. It includes all the map areas and various random things in eboot.bin that were annoying and wanted to translate. I plan to just go through eboot.bin and try to get everything translated in it. It is not too huge and hopefully can get all the little things I may have missed.

There are some issues with text not fitting in windows. I will try to address it sometime in the future. If you find any typos please let me know.

For this update you need both the eboot and start_jp.lzs

LPR_translation_v0.0.4 (Map Locations)
1) Acquire PSP La Pucelle Ragnarok ISO
2) Download EBOOT.BIN - www.tarranoth.com/LPR/EBOOT.BIN
3) Download START_JP.LZS - www.tarranoth.com/LPR/START_JP.LZS
4) Backup ISO, EBOOT.BIN and START_JP.LZS
5) Extract files from LPR ISO using UMDGen
6) Replace EBOOT.BIN in \PSP_GAME\SYSDIR\ with the downloaded EBOOT.BIN
7) Replace START_JP.LZS in \PSP_GAME\USRDIR\ with the downloaded START_JP.LZS
8) Create a new LPR ISO with UMDGen
9) Either use a PSP emulator or download to PSP and enjoy

Note: You must have CFW in order to play the translated ISO on a PSP
 
  • Like
Reactions: Linka

ChepChep

Well-Known Member
Member
Joined
Feb 9, 2011
Messages
611
Trophies
0
XP
876
Country
United States
So I have another new patch update. It includes all custom enemy names. The JPN version has even more nonsensical names than the USA version.
I also fixed a few other typos I have found in the game.

For this update you need both the eboot and start_jp.lzs

LPR_translation_v0.0.5 (Custom Enemy Names and other random typos)
1) Acquire PSP La Pucelle Ragnarok ISO
2) Download EBOOT.BIN - www.tarranoth.com/LPR/EBOOT.BIN
3) Download START_JP.LZS - www.tarranoth.com/LPR/START_JP.LZS
4) Backup ISO, EBOOT.BIN and START_JP.LZS
5) Extract files from LPR ISO using UMDGen
6) Replace EBOOT.BIN in \PSP_GAME\SYSDIR\ with the downloaded EBOOT.BIN
7) Replace START_JP.LZS in \PSP_GAME\USRDIR\ with the downloaded START_JP.LZS
8) Create a new LPR ISO with UMDGen
9) Either use a PSP emulator or download to PSP and enjoy

Note: You must have CFW in order to play the translated ISO on a PSP
 
  • Like
Reactions: kit13 and Linka

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    OctoAori20 @ OctoAori20: Nice nice-