Re: (Incomplete) Telefang English Translation

Discuss anything related to hacking ROMs of the Telefang games here.
telefangfan(imported)
Posts: 61
Joined: Sat Dec 20, 2008 12:30 am

Re: (Incomplete) Telefang English Translation

Post by telefangfan(imported) »

ok.thank you.sanky,can i contact you via mp about a thing?
Is the "your save got deleted" screen in your plains?I really like that cute Crypto crying (poor >,<"")
Aeonic Butterfly(imported)
Posts: 1
Joined: Mon Dec 13, 2010 2:29 pm

Re: (Incomplete) Telefang English Translation

Post by Aeonic Butterfly(imported) »

telefangfan wrote:i've got some questions,as usual (sorry to harass! :( )
-Did you planned modifying this logo in sgb border,too? the yellow thingy http://telefang.meowcorp.us/powerbordertitle.png
Sorry, the topic is kind of long and I'll admit to not reading it through, I'm just glad to see work on the translation's resumed. I love Telefang, but can barely understand a scrap of Japanese. This has largely restricted me to playing through a small bit, rather than a whole game. :P

Exactly what part are we talking about here? I might be able to work on it, if anyone is willing to let the newbie volunteer, but I just need to know what to do.
Kimbles(imported)
Posts: 470
Joined: Mon Dec 24, 2007 3:17 am

Re: (Incomplete) Telefang English Translation

Post by Kimbles(imported) »

Just some notes on the translation...

Mod (改造) evolution is now called Fusion evolution, since that's much more straightforward.
Experimental (実験) evolution is now called Lab evolution, since that's much shorter.
Natural (自然) is still Natural.
Hopefully these will be less awkward to use, and I don't think they make things any more vague than the original japanese. *nod*

In other news, now that we've located the master pointer table for all of the text pointer tables in the rom (list here), we could technically move them to whatever banks we want... This is really useful, since some banks have two different pointer tables, which limits the space we can use for the translation and makes the text more annoying to dump/re-insert. :/ Some of them still haven't been dumped for this reason, hence the red links... If you've seen any blank text boxes instead of /placeholders/ on random phone calls or post-game stuff, this is why. *nod*
IMO it'd be a good idea to move things around so that each text pointer table is at the start of its own bank, which should be possible since there are a lot of empty banks in the rom (full list here). It'd just be a matter of deciding where to put what and then moving it, so that might be something for the resident patch workers to hop on the IRC and discuss sometime (hint hint hint). :D
User avatar
andwhyisit
Site Admin
Posts: 1197
Joined: Fri Dec 14, 2007 9:24 pm

Re: (Incomplete) Telefang English Translation

Post by andwhyisit »

Some of that info is out of date though.

Here's a current list of empty banks as of v87:
1E (78000)
25 (94000)
2D (B4000)
3C (F0000)
3D (F4000)
43 (10C000)
44 (110000)
58 (160000)
5A (168000)
5B (16C000)
5C (170000)
5D (174000)
61 (184000)
62 (188000)
77 (1DC000)

I should take a look at freeing up bank 1 at some point as well.

Moving data across banks and repointing to those banks is easy. However the game will still look for the pointers halfway down the bank, so moving the pointer table to the start of the bank, editing all references to these pointers, moving scripts, and recaculating pointers for those new locations would be the meat of the work. I'll be going on a ski trip soon (come this weekend) so I won't be able to do much on it for a while. However I've been wanting something to do for the patch for a while now so consider done as soon as I get back. ;)
User avatar
andwhyisit
Site Admin
Posts: 1197
Joined: Fri Dec 14, 2007 9:24 pm

Re: (Incomplete) Telefang English Translation

Post by andwhyisit »

v88: http://www.mediafire.com/?e4bwd172ekp3dcr
- All dialogue and associated pointer table pairs now occupy their own bank.

Note: Empty banks 25, 43, 44, and 58 are now used.

I wrote a small script that iterates through a pointer table and recalculates it for moving the dialogue and pointer block to the start of the bank.

Here it is if anyone is curious:

Code: Select all

<?
$data=file_get_contents('tftable.bin');
$dataa=str_split($data,2);
$datah='';
$i=0;
$firstval=ord(substr($dataa[$i],0,1))+(ord(substr($dataa[$i],1,1))*256);
$sub=$firstval-(16384+strlen($data));
while($i<count($dataa)) {
	$datah.=implode(' ',str_split(str_pad(dechex(ord(substr($dataa[$i],0,1))+(ord(substr($dataa[$i],1,1))*256)-$sub),4,'0',STR_PAD_LEFT),2)).' ';
	$i++;
}
echo $datah;
?>
Kimbles(imported)
Posts: 470
Joined: Mon Dec 24, 2007 3:17 am

Re: (Incomplete) Telefang English Translation

Post by Kimbles(imported) »

Thanks, that should help a lot. XD

...Any chance you could say what you moved where?
Also, feel free to add changes to the bank map as you make them, it'd make things a bit easier to keep track of...^^;
User avatar
andwhyisit
Site Admin
Posts: 1197
Joined: Fri Dec 14, 2007 9:24 pm

Re: (Incomplete) Telefang English Translation

Post by andwhyisit »

Kimbles wrote:...Any chance you could say what you moved where?
This should be correct, but I am going off the top of my head, so take it with a pinch of salt:

11507B-118000 (45:507B, Phone questions - Part 3) moved to the start of bank 44
1281D9-12C000 (4A:41D9, Story/event text - Part 5) moved to the start of bank 43
145C9A-148000 (51:5C9A, Phone questions - Part 5) moved to the start of bank 58
99068-9C000 (26:5068, Phone questions - Part 6) moved to the start of bank 25

Anyone have a save for testing the evolution bug with?
kmeisthax
Posts: 128
Joined: Sat Dec 04, 2010 3:20 pm

Re: (Incomplete) Telefang English Translation

Post by kmeisthax »

Eww, you wrote it in PHP?

Also, at the prodding of Kimbles I disassembled more of the Main Script routines and figured out how questions work, because he might want to do multi-line questions in the future. I'm sure you're familiar with the opcode "E1 0A" to trigger a question, right? Well, "E1" is the "change Main Script State" opcode; the Main Script routine (ROM B:4100) is set up as a state machine which can be run per-frame (i.e. for drawing individual characters at a time) or all-at-once (draw the whole line of text at once). If you're wondering, State $01 is the normal text interpreter, and state $0A handles questions (not sure what the other states do yet).

In order to handle question selection, state $0A needs to know where to draw the arrows for the answers. Ingeniously, it turns out that during normal text handling we encoded a full-width space between the two answers, and state $01 writes the location of the last full-width space to WRAM C959. (We'll call this one SecondAnswerYPos) So, state $0A knows to draw the first answer's arrow at (3 down, 1 right) tiles relative to the main script window, and the second answer's arrow at (3 down, 1+([C959] & $16) right) tiles relative to the main script window.

In order to handle multi-line questions we need to make a bunch of changes:

- Create a 'start question' opcode that resets some counter in memory (call it ScriptLineCtr).
- Every time we process a newline, clear ScriptLineCtr and SecondAnswerYPos.
- Hack state $0A's arrow drawing routine such that the first answer will be drawn at (1 down, 1 right) if ScriptLineCtr is 1 (i.e. there's been a newline, and thus two lines of answers), and (3 down, 1 right) if ScriptLineCtr is 0 (i.e. there hasn't been a newline, and only one line of answers).
- Hack state $0A's input handling routine such that when there are two lines of answers, you have to press Up/Down instead of Left/Right in order to choose answers.
- Reformat all questions to start with the new opcode AFTER the newline, for example:

|Newline|StartQ|Absolutely!|Newline|I'm not okay with this.|E1 0A|

|Newline|StartQ|Yes|Full-width Space|No|E1 0A|
User avatar
andwhyisit
Site Admin
Posts: 1197
Joined: Fri Dec 14, 2007 9:24 pm

Re: (Incomplete) Telefang English Translation

Post by andwhyisit »

kmeisthax wrote:Eww, you wrote it in PHP?
I could have written it in C++, but considering that no-one would use it besides me and that I can punch out php code alot faster it's a no-brainer as to why I wrote it in php. I can always rewrite it in C++ if someone needs to use it. *shrug*
kmeisthax
Posts: 128
Joined: Sat Dec 04, 2010 3:20 pm

Re: (Incomplete) Telefang English Translation

Post by kmeisthax »

...You've never heard of Python? :P

It's just, well, PHP is annoyingly unreadable and a cruddy language. I don't like it.
Post Reply