[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/jp/ - Otaku Culture


View post   

File: 76 KB, 648x453, screenshot.png [View same] [iqdb] [saucenao] [google]
10416115 No.10416115 [Reply] [Original]

Hello /jp/

I really want to make an English patch for Mystic Square (using translations from Touhou wiki) and document technical things about it as I'm making it.

Anyone know where I'd start? I know I'm going to be dealing with DOS and hex editing.

>> No.10416120

GNU strings

>> No.10416135

http://www.romhacking.net/documents/

http://agtp.romhack.net/docs/tnrb/

>> No.10416151

If you are serious about this, please post your findings and progress in this thread. I am also passively curious about translating PC98 games as well (Not now, but later on when and if I get my Nihongo skills to an acceptable level.). My blind bet would be to first locate the dialogue lines by their character encoding numbers and try to replace them in-place.

>> No.10416305

>>10416151
That's what I was thinking I'd need to do, a simple replace and repeat for each character. But I've never done anything like this before, plus the PC-98's DOS is hardly documented in English so I don't know what I'm doing in terms of that and it's why I wish to document it.

>> No.10416316

http://en.touhouwiki.net/wiki/Highly_Reonsive_to_Prayers/Translation/Patch

Ask this dude? The tools and tables might already exist.

>> No.10416322 [DELETED] 
File: 168 KB, 288x361, nigggggggggggy.png [View same] [iqdb] [saucenao] [google]
10416322

>> No.10416365 [DELETED] 

>>10416305
>That's what I was thinking I'd need to do, a simple replace and repeat for each character.
I see several problems with this approach, though.
First, the binary can be encoded and you'd have to disassemble it and find out how to convert the characters back into the proper encoding. Though I think this should be unlikely.
Second and most likely, you'll discover that English dialogues don't fit into the the existing string lengths (Japanese is generally more compact) and you'll have to extend the binary and do some pointer magic. And probably also understand how dialogues work to make these to fit the new lines in the dialog box.
I don't think there is anything special about PC98 DOS you should know about if you just rewrite the strings above the existing ones without changing the executable (problem #2). But thanks to >>10416316さん, you already have a great lead.

>> No.10416383

>>10416115
Man Reimu looks so cute there

>> No.10416398

>>10416305
>That's what I was thinking I'd need to do, a simple replace and repeat for each character.
I see several problems with this approach, though.
First, the binary can be encoded and you'd have to disassemble it and find out how to convert the characters back into the proper encoding. Though I think this should be unlikely.
Second and most likely, you'll discover that English dialogues don't fit into the the existing string lengths (Japanese is generally more compact) and you'll have to extend the binary and do some pointer magic. And probably also understand how dialogues work to make these longer lines fit in the dialog box.
I don't think there is anything special about PC98 DOS you should know about if you just rewrite the strings above the existing ones without extending the executable (problem #2). Anyway, thanks to >>10416316さん, you already have a great lead.

>> No.10416436

>>10416398
Thanks anon, I can see that one of the problems may be that it's encoded in ShiftJIS (and the hex editors I've looked at deal with ASCII) but I'm sure there's a way.

And in the case I can't fit the words in the string, I'm aware of that, and I'd just edit the translation to be shorter.

If I can be bothered later I'll get the executable out of my disc image (which I think is KAIKI101.EXE) and throw it in a hex editor to see what I can find.

>> No.10416444

>>10416436
>I'd just edit the translation to be shorter.

No.

>> No.10416465

>>10416444
What should I do instead?

>> No.10416470

>>10416436
> I can see that one of the problems may be that it's encoded in ShiftJIS (and the hex editors I've looked at deal with ASCII) but I'm sure there's a way.
Are you sure it's shift jis? Anyway, any editor will do once you figure the encoding and the string location. You don't need to _see_ Japanese characters in the editor, you need to know their binary numbers and the offset at which they start. First, you convert the lines from the wiki to the encoding the game uses and then you put the converted strings somehow (hex editor, your own tool, whatever) into the game. Also, I'm the same clueless anonymous from >>10416151, so take everything I say with a grain of salt.

Also, with no effort I found this thread:
http://www.shrinemaiden.org/forum/indexhp?topic=13903.0
and it seems that the translation is either complete or close to being one, so it seems everything you intend to do has already been done.

>> No.10416504

>>10416470
I was just using common sense since a lot of Japanese programs use SJIS, I don't know exactly.

And thanks for that thread, now reading through it, I can't see anything about a complete patch and files I can apply so far for MS which is what I want to do.

Also, my only intention for this patch is to replace pre-boss dialogue, I believe everything else is an image (such as character select screen) which I don't want to get into right now after reading the thread and edited files being corrupted in the emulator.

>> No.10416515

I haven't done anything related to this so I can't help you there, but I know you'll find a way to do this OP! Good luck, I'll be rooting for you!

>> No.10416537

>>10416504
> I was just using common sense since a lot of Japanese programs use SJIS, I don't know exactly.
The reason of my doubt is that I can't Grep the jis text:

$ grep -ai `iconv -f utf8 -t shift-jis <<<東方` <<<"$(strings 5_Mystic\ Square\ .hdi)"

gives 0 results, when

$ grep -ai `iconv -f utf8 -t shift-jis <<<children` <<<"$(strings 5_Mystic\ Square\ .hdi)"

(one of the song names) gives

Romantic Children
Romantic Children
Romantic Children
Romantic Children
Romantic Children

So it seems the strings are not encoded, but are in something different than ShiftJIS. Maybe I'm missing something?

>> No.10416580

>>10416537
That should mean they're ASCII, or a character encoding that includes the ASCII subset.

>> No.10416613

>>10416537
>>10416580
Ah, well this makes everything so much easier if it is ASCII, thanks for your help.

>> No.10416707

>>10416580
>>10416613

> a character encoding that includes the ASCII subset.
This is what I'm saying (and this should not be very surprising since the Latin alphabet is usually at the same place in all encodings), but the exact encoding is unknown, so I cannot find the Japanese lines. I tried to detect it with this line (my previous line was incorrect):

$ for enc in `iconv -l | sed 's/\/\///'`; do toho="$(iconv -f utf8 -t $enc <<<難易度 2> /dev/null)"; if [ "$?" -ne 0 ]; then continue; fi; grep -qU "$toho" 5_Mystic\ Square\ .hdi; if [ "$?" -eq 0 ]; then echo Found $enc; fi; done

But it did not find anything. 難易度 = difficulty level = the word displayed at the end of each level. So either my script is bugged, or you need to do some additional research to find what encoding is being used and probably make a converter if you can't find it (though you should).

>> No.10417035
File: 48 KB, 500x311, sry.jpg [View same] [iqdb] [saucenao] [google]
10417035

>>10416504

> I was just using common sense since a lot of Japanese programs use SJIS

It seems you are actually correct (unless the lines are in the readme and not the game which I cannot easily check without Windows)! The problem was in my one-liner since I did not know I could not simply "grep" a binary string. The script if you are interested (you can google bgrep, it's a simple binary searcher):

$ for enc in `iconv -l | sed 's/\/\///'`; do toho="$(echo -n ごめんなさ | iconv -f utf8 -t $enc 2> /dev/null)"; if [ "$?" -ne 0 ]; then continue; fi; echo Checking $enc; ~/temp/bgrep `echo -n "$toho" | xxd -p` 5_Mystic\ Square\ .hdi; done
...
Checking SHIFT-JIS
5_Mystic Square .hdi: 004241aa
...

So character replacement should be very straightforward, you just need to find the offsets in the file where the original strings are and then replace them with English. Though it seems that some logical lines have invisible characters inside (formatting?).

>> No.10417055

Also main menu text example:

toho="$(echo -n "開始します" | iconv -f utf8 -t shift-jis 2> /dev/null)"; ~/temp/bgrep `echo -n "$toho" | xxd -p` 5_Mystic\ Square\ .hdi

5_Mystic Square .hdi: 003262b2

>> No.10417057

While you are at it, please do a patch for EoSD. It's in dire need of an update.

>> No.10417063

Shorter one-liner to get an offset of a line:

/temp/bgrep `echo -n "開始します" | iconv -f utf8 -t shift-jis | xxd -p` 5_Mystic\ Square\ .hdi

I'm done.

>> No.10417083

>>10417035
Well it seems my common sense paid off, sometime later I'll open the disc image up and see if I can start editing. This laptop I'm using is already set to Japanese locale anyway, (which is ShiftJIS as far as I know) so I don't think there'll be any encoding issues.

This'll be the most productive thing I've done in ages, so I'm hoping it works out well.

>> No.10417104

>>10417057
I could after this, since as far as I know those are just .msg files in the .dat I can extract and repack using tools.

I'll have to use translation from the wiki though since I can't translate runes for shit. (I'm working on it, but very, very slowly)

>> No.10417140
File: 69 KB, 457x800, b657ed48e45252c9546b5b0908b17964.jpg [View same] [iqdb] [saucenao] [google]
10417140

>>10417083
Just don't get overconfident or tired of the whole idea before even starting. Many pitfalls may and will appear. I'd wager that translating the first line will take hours, if not days or weeks. I am by no means trying to dissuade you, but speak based on my own constant failures in trying to do anything useful. That said, good luck!

>> No.10417184

>>10417104

That's fine, EoSD currently translation is horrible, the wiki's is much better.

>> No.10417190

install gentoo

>> No.10417194 [DELETED] 
File: 172 KB, 295x361, nigggggy.png [View same] [iqdb] [saucenao] [google]
10417194

>> No.10417343
File: 85 KB, 669x628, ss (2013-01-27 at 07.43.23).png [View same] [iqdb] [saucenao] [google]
10417343

>>10417190
/g/ pls leave

Also, I tried opening the .hdi and I have no idea wtf I can do with this.

>>10417140
Thanks for that advice, I know this won't be done overnight and I may end up saying fuck it and giving up, but at least I can try and learn things I didn't know before.

(Like, I just found out that MIKO.CFG inside the game is the user config file like the Windows games have. It's not useful to what I'm doing but I'm glad I found out nonetheless)

>> No.10417379

>>10417343
> MIKO.CFG inside the game is the user config file like the Windows games have.
CFG is not a single format, it's just common to give config files this extension. The way data is kept in them is usually totally different in different programs.

>> No.10417407

>>10417379
I know, it's sometimes just a text file, but from the name I thought it might be something to do with Reimu's player character.

>>
Name
E-mail
Subject
Comment
Action