ROM Hack Gyakuten Saiban 1-3 Translation

Lycan911

wolf boi
Member
Joined
May 11, 2014
Messages
2,136
Trophies
1
Age
26
XP
4,450
Country
Germany
Glad to see that this is still going :D Do you plan to replace Phoenix's "RYU" with "P", like in the official English release? Ryu doesn't make much sense during one of Mia's sentences in the first case.
 

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
Actually, the "RYU" is spread across many different frames, and it is fragmented in tiny little pieces which are hard to locate in the rom. It is also RLE compressed, so it is not visible in normal tile viewers.

That been said, I have already completed the first replacement:

ruy1_new.png
 
  • Like
Reactions: Lycan911 and cearp

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,725
Trophies
2
XP
8,509
Country
Tuvalu
Actually, the "RYU" is spread across many different frames, and it is fragmented in tiny little pieces which are hard to locate in the rom. It is also RLE compressed, so it is not visible in normal tile viewers.

That been said, I have already completed the first replacement:

ruy1_new.png
if you really want to do it, maybe leave it to the end :) but nice work!
 

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
Patch 008

- Translated the "Ryu" to "P" in Phoenix's sprites and case 1 intro
- Translated the "Witness Testimony" and "Cross Examination" graphics
- Fixed a tiny glitch when "Objection" is displayed from the prosecutor's side
- Reallocated and repacked all the location/topic buttons in the rom to fix overwrites and corruptions (29 images fixed, 52 reallocations in total)

Phew... That was really time consuming. Had to sort a lot of clustered tiles for the "Ryu" graphics, and do a lot of readdressing and repositioning for the Witness Testimony/Cross Examination animations. Also, it took 2 days to manually calculate the space requirements and reposition the location/topic buttons in the rom.

With this version, I think that the translation of the graphics has been completed.

I will now move on to fixing the scripts and the overflow issues. I am still researching that though, and any help or guidance would be greatly appreciated. The ideal solution would be to write a new font routine, able to handle DTE (Dual Tile Encoding). But I have no prior ASM experience and I have no idea how to do that.

Screenshots

Before - After

ryu_intro_old.png
ryu_intro_new.png

ryu3_old.png
ryu3_new.png

witness_testimony_old.png
witness_testimony_new.png

cross_examination_old.png
cross_examination_new.png

corrupt_lz77.png
movetalk1_new.png
 

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
Patch 009

So I started working on the scripts.

After a lot of reading and experimenting, I found out that the overflow issues are actually easier to deal with than I thought them to be. I even managed to automate the process of calculating and splitting the scripts and readdressing the appropriate pointers.

I replaced some of the case scripts with the latest released scripts from cocomonk22, as I found them to be a little closer to the NDS version, in terms of text speed and text formatting.

I was also able to understand the control code system, and I've already made several bugfixes.
  • Fixed a crash when attempting to unlock the psyche-lock of Detective Atmey in case 2-1b.
  • Fixed a known crash when attempting to unlock the psyche-lock of Adrian Andrews in case 2-6.
  • Fixed several crashes when talking to Adrian Andrews after the Psyche-Lock has been unlocked in case 2-6.
  • Fixed the infinite loop/wrong evidence in the dialog "Sacred Urn" with Detective Atmey in case 2-1b.
  • Fixed an infinite loop when talking to Ron about "The night of the crime" in case 2-4
  • Fixed a crash in case 2-2 (trial) when Godot introduces himself.
  • Fixed 3 infinite loops in case 2-7 (trial) when Ron is cross-examined.
  • Fixed a glitch/crash in case 2-8 (trial) when showing a photo of Adrian Andrews breaking things
  • Added 2 missing text choices in case 2-9 (trial)
Also,
  • Fixed a tiny glitch in "Take that!"
  • Translated "Stop" for Psyche-Locks
  • Changed the font for "Present", "Press" and "Stop"
  • Translated the "Unlock Successful" graphic.
  • Fixed a glitch in "Mask*Demasque" topic name when talking to Gumshoe at case 2-1b.
  • Replaced the scripts for cases 1-1, 1-2, 1-3, 2-1, 2-1b and 2-6 with the latest scripts by cocomonk22.
  • Corrected Phoenix's english voice in "Objection", he had Edgeworth's voice by mistake.
  • Translated the letters on the Sacred Urn in a background image at the end of case 2-9

I have tested and played the game with no problems up to the end of case 2.


Due to changes in the scripts, some old savegames may not work anymore.
If you have a savegame that happens to crash, select "From the Beginning"
in the Load menu.


Screenshots

psyche_old.png
psyche.png


unlock_old.png
unlock_new.png


urn_ed_old.png
urn_ed_new.png
 
Last edited by h3rmit,

Lycan911

wolf boi
Member
Joined
May 11, 2014
Messages
2,136
Trophies
1
Age
26
XP
4,450
Country
Germany
Patch 009

So I started working on the scripts.

After a lot of reading and experimenting, I found out that the overflow issues are actually easier to deal with than I thought them to be. I even managed to automate the process of calculating and splitting the scripts and readdressing the appropriate pointers.

I replaced some of the case scripts with the latest released scripts from cocomonk22, as I found them to be a little closer to the NDS version, in terms of text speed and text formatting.

I was also able to understand the control code system, and I've already made several bugfixes.
  • Fixed a crash when attempting to unlock the psyche-lock of Detective Atmey in case 2-1b.
  • Fixed a known crash when attempting to unlock the psyche-lock of Adrian Andrews in case 2-6.
  • Fixed several crashes when talking to Adrian Andrews after the Psyche-Lock has been unlocked in case 2-6.
  • Fixed the infinite loop/wrong evidence in the dialog "Sacred Urn" with Detective Atmey in case 2-1b.
  • Fixed an infinite loop when talking to Ron about "The night of the crime" in case 2-4
  • Fixed a crash in case 2-2 (trial) when Godot introduces himself.
  • Fixed 3 infinite loops in case 2-7 (trial) when Ron is cross-examined.
  • Fixed a glitch/crash in case 2-8 (trial) when showing a photo of Adrian Andrews breaking things
  • Added 2 missing text choices in case 2-9 (trial)
Also,
  • Fixed a tiny glitch in "Take that!"
  • Translated "Stop" for Psyche-Locks
  • Changed the font for "Present", "Press" and "Stop"
  • Translated the "Unlock Successful" graphic.
  • Fixed a glitch in "Mask*Demasque" topic name when talking to Gumshoe at case 2-1b.
  • Replaced the scripts for cases 1-1, 1-2, 1-3, 2-1, 2-1b and 2-6 with the latest scripts by cocomonk22.
  • Corrected Phoenix's english voice in "Objection", he had Edgeworth's voice by mistake.
  • Translated the letters on the Sacred Urn in a background image at the end of case 2-9

I have tested and played the game with no problems up to the end of case 2.


Due to changes in the scripts, some old savegames may not work anymore.
If you have a savegame that happens to crash, select "From the Beginning"
in the Load menu.


Screenshots

psyche_old.png
psyche.png


unlock_old.png
unlock_new.png


urn_ed_old.png
urn_ed_new.png
So is the second case now fully complete?
 

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
Yes, the second case is now complete and fully playable.

I was able to play it through the end without problems.

Just be careful when saving and loading the game. Because of the Variable Font Routine hack, you may see a black background when loading from a savegame. Before talking, examining or presenting items make sure to move to another place first. That will give the game the chance to reload some required information. When you see a black background after loading a savegame, the game is still not fully loaded and is vulnerable to glitches and crashes. Unfortunately, I do not possess the required ASM skills to reprogram the Variable Font Routine and fix this issue.

In case anyone finds a bug, please let me know.
 

Pacheko17

Controversial opinions guy.
Member
Joined
Jan 31, 2015
Messages
1,495
Trophies
1
Location
República Juliana
XP
1,855
Country
Brazil
Patch 009

So I started working on the scripts.

After a lot of reading and experimenting, I found out that the overflow issues are actually easier to deal with than I thought them to be. I even managed to automate the process of calculating and splitting the scripts and readdressing the appropriate pointers.

I replaced some of the case scripts with the latest released scripts from cocomonk22, as I found them to be a little closer to the NDS version, in terms of text speed and text formatting.

I was also able to understand the control code system, and I've already made several bugfixes.
  • Fixed a crash when attempting to unlock the psyche-lock of Detective Atmey in case 2-1b.
  • Fixed a known crash when attempting to unlock the psyche-lock of Adrian Andrews in case 2-6.
  • Fixed several crashes when talking to Adrian Andrews after the Psyche-Lock has been unlocked in case 2-6.
  • Fixed the infinite loop/wrong evidence in the dialog "Sacred Urn" with Detective Atmey in case 2-1b.
  • Fixed an infinite loop when talking to Ron about "The night of the crime" in case 2-4
  • Fixed a crash in case 2-2 (trial) when Godot introduces himself.
  • Fixed 3 infinite loops in case 2-7 (trial) when Ron is cross-examined.
  • Fixed a glitch/crash in case 2-8 (trial) when showing a photo of Adrian Andrews breaking things
  • Added 2 missing text choices in case 2-9 (trial)
Also,
  • Fixed a tiny glitch in "Take that!"
  • Translated "Stop" for Psyche-Locks
  • Changed the font for "Present", "Press" and "Stop"
  • Translated the "Unlock Successful" graphic.
  • Fixed a glitch in "Mask*Demasque" topic name when talking to Gumshoe at case 2-1b.
  • Replaced the scripts for cases 1-1, 1-2, 1-3, 2-1, 2-1b and 2-6 with the latest scripts by cocomonk22.
  • Corrected Phoenix's english voice in "Objection", he had Edgeworth's voice by mistake.
  • Translated the letters on the Sacred Urn in a background image at the end of case 2-9

I have tested and played the game with no problems up to the end of case 2.


Due to changes in the scripts, some old savegames may not work anymore.
If you have a savegame that happens to crash, select "From the Beginning"
in the Load menu.


Screenshots

psyche_old.png
psyche.png


unlock_old.png
unlock_new.png


urn_ed_old.png
urn_ed_new.png

I am HARD right now.
 
  • Like
Reactions: Lycan911

Pagio94

Well-Known Member
Member
Joined
Jul 28, 2014
Messages
125
Trophies
0
Age
29
Location
Genova
XP
199
Country
Italy
So actually you're focusing on third game leaving first and second one for later times? Didn't quite catch that from the thread
 

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
I don't know the exact reason why the starter of this project (broco) decided to start with the third game first.

But I guess that the main reason is that by the time this project started back in 2006, the third game was the only one that was not released in english for the Nintendo DS. So, I guess that the point was to provide fans of Phoenix Wright an extra game to play, which would otherwise be totally unavailable.

The initial project ceased with the release of the third game in english for the NDS in 2007, leaving behind unfinished work and tools for the GBA translation.

In 2008, cocomonk22 decided to continue this project, taking the official translations from the NDS and putting them in the GBA version. I guess it was a lot easier to continue some unfinished work (the third game) than start from scratch with another game (the other two). But, as you can read in the first post of the current thread, he stopped this project by the end of 2008, having translated a big portion of the game.

In 2011, kcaze picked up the project and almost reached completion. He managed to translate the whole game, as far as the text is concerned, by using the NDS translations. However, apparently his version crashed at some point in the second case, leaving the game only partially playable. He never found the time to complete it. Also, he wasn't able to transfer but a small portion of the translated graphics from cocomonk's version.

I came here in 2014, searching for a english GBA version of the game. I found the latest version of kcaze to be just dead links. He was inactive for a long time, so it took me days to find a way to contact him. He was kind enough to give me both the latest patch and all his work files of the project.

My initial intention was to just re-upload kcaze's patch. But then I noticed that it was pretty easy to copy a few translated graphics from cocomonk22's version to kcaze. I had no idea about rom hacking, but I was able to do this much with a hex editor and binary editing. After that, I began to dig deeper and deeper into the technical details.

I still do not possess the required knowledge to start the translation for another game from scratch (e.g. Gyakuten Saiban 1 & 2). It requires assembly knowledge specifically for GBA.

As for Gyakuten Saiban 3, 99.9% or the graphics are now translated (I may have overlooked 2-3 images), and the game is fully playable up to a point in case 3. I am now working on resolving the crashes that appear in case 3 and later, and I plan on seeing at least the third game through to completion.
 
  • Like
Reactions: Lycan911

Pacheko17

Controversial opinions guy.
Member
Joined
Jan 31, 2015
Messages
1,495
Trophies
1
Location
República Juliana
XP
1,855
Country
Brazil
I have been checking this thread since 2011.
I only made my account this year though, because I was looking for something which probably will never happen, unlike this!

Good job h3rmit.
 
Last edited by Pacheko17,

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
Case 3 seems to be real mess. Apparently, broco's documentation was incomplete, and his tools have messed up a lot of things.

Just for the history, control code <60> seems to take 4 parameters, not 0! And control code <33> seems to take 5 parameters, not 2! The undocumented control code <33> controls which places should be displayed in the "Move" action. The parameter "ff" seems to mean "empty/do not show".

As a result, a few crusial bytes every here and there have been chewed up by the translation tools, resulting in crashes and infinite loops at many different points.
  • I have already found and corrected 9 crashes, infinite loops and other bugs in case 3-2, and there are still a few more. Gumshoe never gives me back an important piece of evidence, which is required to continue.
  • Case 3-1 seems to have similar problems. I have found a few but still haven't touched it.
  • Case 3-3 seems to be corrupt. There are <endjmp> missing at the end of the pointers, so I can't even extract it properly. I'll probably have to re-translate it from scratch.

Edit


Apparently, control code <10> stores some checkpoint info. Gumshoe needed a certain checkpoint to give back the piece of evidence. Fixed.
 
Last edited by h3rmit,

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
I have made some progress with case 3, and I have fixed 15 bugs so far (crashes, infinite loops, evidence problems, psyche locks) in cases 3-1 and 3-2. I think they are now ok, so the first part of case 3 (Investigation) should be fully playable now. I have tested and played it though to case 3-3 (Trial) without any problems.

As for case 3-3 (Trial), upon closer inspection half the case is missing/corrupted. Probably some miscalculation of pointers by kcaze has caused half the case data to vanish. The game enters an infinite loop near the beginning of the trial, and will crash without a doubt a little later. So, I will definitely have to re-translate it. That will take some time.

So, case 3 is still buggy and incomplete, but I will still release a patch with the fixes I've done.


Patch 010


  • Fixed an infinite loop in case 3-2 when examining a bottle in the Kitchen.
  • Fixed an infinite loop when presenting evidence to the old man at Vitamin Square.
  • Corrected the place names of Vitamin Square, Criminal Affairs Dept. and Tender Lender, they were swapped.
  • Fixed several infinite loops and crashes when unlocking old man's and Armstrong's psyche locks and when talking to Gumshoe.
  • Fixed an bug that prevented the game to progress (Gumshoe was never giving back some important piece of evidence)
 

cearp

瓜老外
Developer
Joined
May 26, 2008
Messages
8,725
Trophies
2
XP
8,509
Country
Tuvalu
@h3rmit - thanks again for all your hard work, not many would do something neat like this when the games already exist on ds and 3ds, so it is really appreciated :)
 

Pablitox

Well-Known Member
Member
Joined
Oct 18, 2011
Messages
821
Trophies
1
Age
33
XP
1,294
Country
Argentina
I have made some progress with case 3, and I have fixed 15 bugs so far (crashes, infinite loops, evidence problems, psyche locks) in cases 3-1 and 3-2. I think they are now ok, so the first part of case 3 (Investigation) should be fully playable now. I have tested and played it though to case 3-3 (Trial) without any problems.

As for case 3-3 (Trial), upon closer inspection half the case is missing/corrupted. Probably some miscalculation of pointers by kcaze has caused half the case data to vanish. The game enters an infinite loop near the beginning of the trial, and will crash without a doubt a little later. So, I will definitely have to re-translate it. That will take some time.

So, case 3 is still buggy and incomplete, but I will still release a patch with the fixes I've done.


Patch 010


  • Fixed an infinite loop in case 3-2 when examining a bottle in the Kitchen.
  • Fixed an infinite loop when presenting evidence to the old man at Vitamin Square.
  • Corrected the place names of Vitamin Square, Criminal Affairs Dept. and Tender Lender, they were swapped.
  • Fixed several infinite loops and crashes when unlocking old man's and Armstrong's psyche locks and when talking to Gumshoe.
  • Fixed an bug that prevented the game to progress (Gumshoe was never giving back some important piece of evidence)
That is such an awesome job. Thanks h3rmit!
 

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
I managed to figure out another primary cause of infinite loops and crashes.

Apparently, the undocumented controlcode <35> is a conditional jump. It takes 2 parameters, and it means something like "if variable x is true, then jump to y bytes from the case pointer start offset". E.g. <35 7b00 760> means "if the variable at offset 0x7B00 is true, then jump to 0x0760 bytes (1888 in decimal) from the start offset of the case pointer".

Now, the problem with that is that the second parameter is a relative offset within the case pointer. When we translate a case, we are inserting longer text than the original japanese. This changes all the relative offsets, so all the <35> conditionals are no longer working.

Cocomonk22 used to dealt with that by removing all the <35> conditionals, resulting in a slightly different gameplay than the original. For instance, if you have talked to Gumshoe and he has given you a piece of evidence, there is a conditional saying that "if you have already got that piece of evidence, Gumshoe should say something else". By removing the conditional, Gumshoe gives the evidence every time (though that does not actually cause a problem).

In complex trials like in case 3-3, where you are given a lot of choices to press harder or to press about a specific topic, removing these conditionals can cause a lot of problems.

The proper way to deal with this is to first translate the case, compile it to binary, open it up with a hex editor, find the offset of each offset pointer, and somehow measure the new distance that the jump has to travel within it. And then of course change the parameters of the related conditionals. This is rather unconventient though, because every tiny change in the translation may require a lot of manual recalculations and manual changes in the binary.

So far, I have almost completed the translation and recalculations for case 3-3. I will soon be able to release a patch which will be fully working and playable up to the end of the first trial of case 3.
 

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
I have completed the re-translation of cases 3-3 and 3-4. The first trial of case 3 is now fully playable through the end. I have played and tested it thoroughly.

I was also able to make an automated way to recalculate all conditional jump offset whenever adding/removing a control code. I've built a program that handles it automatically (screenshot).

Patch 011

  • Re-translated cases 3-3 and 3-4.
  • Fixed a minor glitch in Tres Bien's floor plans in case 3-3.
  • Fixed all pointer/conditional jump issues.
 
  • Like
Reactions: cearp and Lycan911

h3rmit

Well-Known Member
Newcomer
Joined
Feb 16, 2014
Messages
99
Trophies
1
XP
944
Country
Greece
Patch 012

Phew, that was quite a lot of work. I've been working non-stop since the previous patch.

Case 3 is now complete, tested and fully working.

  • Re-translated cases 3-5, 3-6, 3-7, 3-8, 3-9 and 3-10

  • Re-translated cases 3-1 and 3-2 to fix some missing characters

  • Re-translated case 2-3 to fix a small missing piece at the end of the trial

  • Fixed a minor glitch in episode 4 title

  • Fixed a corruption at the location button "Tender Lender"

Due to changes in the scripts, some old savegames may not work anymore.
If you have a savegame that happens to crash, select "From the Beginning"
in the Load menu.
 
Last edited by h3rmit,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: