[v1.2 RELEASED!] New English translation project (Nakoruru: The Gift She Gave Me)

Moderators: pcwzrd13, deluxux, VasiliyRS

User avatar
ateam
Heroine Console
Posts: 478

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#31 » Tue Feb 01, 2022 1:42 pm

Here with another cool little update! In the spirit of leaving NO STONE unturned, I spent the last three days on cracking the text-encoding scheme used in this game's little VMU applications. Once you beat the game, you have the ability to download four individual VMU applications, each featuring one of the main characters.

Image

This little extra goodie is nothing more than a clock program with a few cute animations for each character, along with a little message to you, the player. My first order of business was to modify the "splash screen" (logo, text, etc.), which was easy enough in CrystalTile.

Image

I was also able to use CrystalTile to find the font sheet that the VMU program uses to render text. Despite text being extremely limited, the developers actually took the time to write their own text-rendering routine, rather than just use separate 48x32px 1bpp images for each instance of text. Truthfully, I'm not 100% sure if they wrote that code themselves, or it came from SEGA. Based on SEGA's VMU technical documentation, it would appear that they wrote something unique, and not templated.

Image

Funnily enough, the ill-fated (or still to be seen?) Dreamcast game "Elysian Shadows" managed to deliver something very useful for this endeavor: ElysianVMU. This little VMU emulator actually features a RAM/ROM debugger/editor.

Image

Furthermore, I was able to disassemble the Sanyo LC8670 assembly (similar to LC86104C/108C) using this processor for Ghidra and LCdis. However, after making all of that progress, I was still unable to track the archaic assembly to determine where the text strings were stored. Even guessing at the 1-byte representation of each font tile, and then searching for a known order, yielded no results.

Eventually, I decided to write a little program to do some brute-forcing. And yes, that's right folks, that's Perl you're seeing. Kindly hold your comments and critiques, for I simply do not care :lol: And remember, this is one-off code. It doesn't have to be pretty, or optimized. I have a day job. It just has to work.

Code: Select all

#!/usr/bin/perl

use strict;
use File::Path;
use String::HexConvert ':all';

my $filename = "NAKO_NAK.VMS";
my $file_size = (stat "$filename")[7];

open my $file_handle, '<:raw', $filename;

for(my $i = 1; $i < $file_size - 5; $i ++)
{
   my $byte = &read_bytes_at_offset($file_handle, 1, $i - 1);
   my $byte_plus_one = &read_bytes_at_offset($file_handle, 1, $i);
   my $byte_plus_two = &read_bytes_at_offset($file_handle, 1, $i + 1);
   my $byte_plus_three = &read_bytes_at_offset($file_handle, 1, $i + 2);
   my $byte_plus_four = &read_bytes_at_offset($file_handle, 1, $i + 3);
   my $byte_plus_five = &read_bytes_at_offset($file_handle, 1, $i + 4);

   if($byte eq $byte_plus_five &&
      $byte_plus_three eq $byte_plus_four &&
      $byte_plus_one ne $byte_plus_two &&
      $byte_plus_one ne $byte &&
      $byte_plus_one ne $byte_plus_three &&
      $byte_plus_one ne $byte_plus_five &&
      $byte_plus_two ne $byte &&
      $byte_plus_two ne $byte_plus_three &&
      $byte_plus_two ne $byte_plus_five &&
      ($byte ne "20" && $byte ne "00" && $byte ne "ff"))
   {
      print "BYTE: $byte\n";
      print "  +5: $byte_plus_five\n";
      print " LOC: " . ($i - 1) . " (decmical)\n";
      print "===========================\n";
   }
}

close($file_handle);

# arg 0 = file handle
# arg 1 = bytes to read (length)
# arg 2 = offset at which to read
sub read_bytes_at_offset
{
   seek $_[0], $_[2], 0;
   read $_[0], my $bytes, $_[1];
   
   return unpack 'H*', $bytes;
}


So what does that code do, and why? Well, let's consider the following, where 1, 2, 3, 4, 5, and 6 represent six separate bytes (or so I suspected).

Image

Going with the assumption that each character was represented by 1-byte, the above code will return all chunks of six bytes that meet the following conditions:

1) Bytes 1 and 6 are identical.
2) Bytes 4 and 5 are identical.
3) Bytes 2 and 3 are unique.
4) None of the matches are on the blacklist.

After sifting through the output of my program, I finally stumbled upon the text string! Given how little text these VMU applications contain, I opted to just write the character message consecutively, tile after tile.

Image

And alas, the final result (animated GIF)...

Image

Image
Last edited by ateam on Thu Jun 23, 2022 8:26 am, edited 2 times in total.
Find me on...

DreamcastForever.com
GitHub
Reddit
SegaXtreme
Twitter
YouTube
• Discord: derek.ateam

User avatar
Dirge Of Ram
Graffiti Grind
Posts: 311

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#32 » Tue Feb 01, 2022 4:35 pm

Very good ateam, like seeing the real indepth and passion putting into this. This is how all remasters should be approached giving it all.

User avatar
VincentNL
core
Posts: 125
Contact:

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#33 » Wed Mar 09, 2022 8:17 am

Congratulations for hacking VMU part @ateam, Bravissimo!
If you like my work or just want to show some love:
https://ko-fi.com/vincentnl
https://www.patreon.com/VincentNL

Enma09
rebel
Posts: 17

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#34 » Tue Mar 15, 2022 4:56 pm

Hello, I really love the work you have done here. Is the Japanese version of Jojo's Bizarre Adventure in your plans? It is well known that this game had an "official English translation" by Capcom USA, but they actually changed the entire story of the game and censored the original ending where DIO explodes to pieces (just like in the original manga). They also changed the names of the characters to avoid possible lawsuits from this side of the pond and changed the color of the blood from red to white (you know what it looks like, I won't say it here lmao) What do you think? It is a game loved by many fans and very playable on the Dreamcast :D

User avatar
ateam
Heroine Console
Posts: 478

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#35 » Wed Mar 16, 2022 9:44 am

Enma09 wrote:Hello, I really love the work you have done here. Is the Japanese version of Jojo's Bizarre Adventure in your plans? It is well known that this game had an "official English translation" by Capcom USA, but they actually changed the entire story of the game and censored the original ending where DIO explodes to pieces (just like in the original manga). They also changed the names of the characters to avoid possible lawsuits from this side of the pond and changed the color of the blood from red to white (you know what it looks like, I won't say it here lmao) What do you think? It is a game loved by many fans and very playable on the Dreamcast :D


Thank you for the kind words! Regarding JoJo, I presently have no plans. However, you never know what the future may hold!
Find me on...

DreamcastForever.com
GitHub
Reddit
SegaXtreme
Twitter
YouTube
• Discord: derek.ateam

Enma09
rebel
Posts: 17

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#36 » Wed Mar 16, 2022 4:46 pm

ateam wrote:
Enma09 wrote:Hello, I really love the work you have done here. Is the Japanese version of Jojo's Bizarre Adventure in your plans? It is well known that this game had an "official English translation" by Capcom USA, but they actually changed the entire story of the game and censored the original ending where DIO explodes to pieces (just like in the original manga). They also changed the names of the characters to avoid possible lawsuits from this side of the pond and changed the color of the blood from red to white (you know what it looks like, I won't say it here lmao) What do you think? It is a game loved by many fans and very playable on the Dreamcast :D


Thank you for the kind words! Regarding JoJo, I presently have no plans. However, you never know what the future may hold!


Thank you very much for answering, in that case Guilty Gear X could also be a good option to translate in the future, this game on dreamcast never left japan (the menus are already in English and you have much less text than Jojo's, you just have to translate the character dialogues and relocate it in case they change the Ip.bin) for that there is already a custom 0GDTEX that I have made, I will upload it in a while if you like the idea. It is a game with extremely beautiful graphics.

User avatar
ateam
Heroine Console
Posts: 478

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#37 » Wed Mar 16, 2022 8:30 pm

Enma09 wrote:Thank you very much for answering, in that case Guilty Gear X could also be a good option to translate in the future, this game on dreamcast never left japan (the menus are already in English and you have much less text than Jojo's, you just have to translate the character dialogues and relocate it in case they change the Ip.bin) for that there is already a custom 0GDTEX that I have made, I will upload it in a while if you like the idea. It is a game with extremely beautiful graphics.


I’m well aware of GGX, beautiful game! I appreciate the offer, but my current project will keep me busy for the rest of the year.

Maybe somebody else will pick it up, though.
Find me on...

DreamcastForever.com
GitHub
Reddit
SegaXtreme
Twitter
YouTube
• Discord: derek.ateam

Enma09
rebel
Posts: 17

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#38 » Thu Mar 17, 2022 1:19 am

ateam wrote:
Enma09 wrote:Thank you very much for answering, in that case Guilty Gear X could also be a good option to translate in the future, this game on dreamcast never left japan (the menus are already in English and you have much less text than Jojo's, you just have to translate the character dialogues and relocate it in case they change the Ip.bin) for that there is already a custom 0GDTEX that I have made, I will upload it in a while if you like the idea. It is a game with extremely beautiful graphics.


I’m well aware of GGX, beautiful game! I appreciate the offer, but my current project will keep me busy for the rest of the year.

Maybe somebody else will pick it up, though.


That would be great. Good luck with your current projects, I'm really looking forward to seeing them completed and let's see what others think of this idea :)

EDIT: This is a 0GDTEX I created for simply fun, check it out:
Image

A box art for GDEMU:
Image

User avatar
ateam
Heroine Console
Posts: 478

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#39 » Fri Mar 25, 2022 2:55 pm

Major, major update today! It might be something small, but I've been working on it for a month, so I'm quite proud. Allow me to explain...

You may recall in earlier posts how I mentioned that I'm generating multiple textboxes for any line of dialog that requires more space to fit English text. Even with a font-width hack, this requirement for multiple textboxes is still present.

Well, the game has been programmed in such a way that rendering a new textbox halts the voice actor audio clip currently being streamed. This is by design, and makes a lot of sense when you consider the original Japanese always fit in a single box. However, this is not the case for us here.

Before the hack I'm about to describe, the voice clip would halt when the player cycled to box 2+, which really gave off an unpolished feel. Not only that, but it robbed players of hearing the entirety of the 12,000+ lines of dialog that the voice actors tirelessly recorded. And in this game, the voice acting is great!

So, what to do? Well, I needed some way to tell the game not to stop the voice stream whenever rendering a new textbox. At first, I tried hijacking the sound effect control code to play back voice audio, as that stream isn't stopped upon each new textbox. I got very, very close to making this solution work, but ultimately it caused interference and unintended consequences in scenes where both voice AND sound effect audio clips were played simultaneously.

So, back to the drawing board I went. In Ghidra, I managed to find the function that assesses control codes and identified the address where the game determined that it was interpreting the new-textbox control code.

Image

Armed with that knowledge, I took to the lxdream-nitro emulator, setup a breakpoint, and started stepping through the assembly line-by-line, following along in Ghidra to better understand the logic and to see what other code existed in those same functions. My goal was to find all of the functions being executed when a new textbox was rendered so I could locate the code that actually kills the audio.

Image

After hours and hours of doing this (maybe 20?), I reached out to a fellow romhacker/translation patch developer buddy of mine, EsperKnight. Being far more experienced than I, he offered to lend a hand. In the end, he wound up modifying Flycast to dump a full tracelog. These log files fill up FAST, reaching several GBs in under a minute.

Image

Ignore the erroneous "SH2" in the log filename, haha. Anyway, what you end up with is the full assembly in the order that the emulator executed it. Now that I had this tracelog, I decided to ditch the emulator and instead sift through every line and follow along in Ghidra to understand what was happening.

Remember, I'm still stepping through the assembly from the moment that the game knows it has to render a new textbox. As you can imagine, this tracelog is GIGANTIC, coming in at exactly 13,538,000 lines. Eventually, I narrowed down a section of code that only hit when a voice clip was playing. I knew I was getting close!

From here, my method was to disable any calls to any functions (typically jsr and bsr instructions) to find any that dealt with audio playback. This process leads to all sorts of breakage, many moments of thinking I was almost there, and of course plenty of frustration. It can be like trying to find a needle in a haystack. I knew it was just a matter of time, though.

And then...

Image

...when I disabled this little call to FUN_8c09aa08, I found that voice continued to play across multiple textboxes. However, there were a number of unwanted side effects, such as background music continuing to play after it's supposed to stop, as one example. But I was close!

I continued to backtrack to determine where, in between this and the new textbox control code, this function was being called. And alas, at long, long last, I FOUND IT.

Image

After analyzing the tracelogs a bit more, I determined that this variable (decompiled view in Ghidra has it labeled as bVar1) is only true when a voice clip is currently being played. That meant that this hack is as simple as replacing the jsr instruction with a nop to disable it.

Image

And that, my friends, is another chapter in the "Hacking Nakoruru" story wrapped up!
Last edited by ateam on Wed Mar 30, 2022 4:42 pm, edited 1 time in total.
Find me on...

DreamcastForever.com
GitHub
Reddit
SegaXtreme
Twitter
YouTube
• Discord: derek.ateam

User avatar
fafadou
Gold Lion
Posts: 1653

Re: New English translation project (Nakoruru: The Gift She Gave Me)

Post#40 » Fri Mar 25, 2022 5:12 pm

incredible level of skill and patience ! Thank you for all.

  • Similar Topics
    Replies
    Views
    Last post

Return to “Modifications”

Who is online

Users browsing this forum: No registered users