Re: (Incomplete) Telefang English Translation

Discuss anything related to hacking ROMs of the Telefang games here.
User avatar
Imaynotbehere4long
Posts: 74
Joined: Wed Dec 18, 2013 12:07 pm

Re: (Incomplete) Telefang English Translation

Post by Imaynotbehere4long »

DaVince wrote:Update: none. :P

Things have been so busy it wasn't even on my mind, simply put. I have a little bit of time now though...
wrote:Regarding the translation effort itself: I don't even have much time or energy to give it much thought at all
wrote:my update: real life is just taking a lot out of me
Recently, my brother started a show where he streams video games, and even though he's usually too busy to play games, he set aside three hours each week to devote to his stream. Maybe you could do something similar? Admittedly, I don't know how hectic your schedule is, but I think trying out this idea could work (of course, it doesn't have to be three hours). Like, for example, you can set aside 10-30 minutes a week during when you'd normally go to bed (or perhaps some other period of down-time; maybe wake up 10 minutes early?) to try to translate a few lines. That way, you'd at least be slowly chipping away at it.
DaVince
Posts: 112
Joined: Sat Dec 28, 2013 8:10 am

Re: (Incomplete) Telefang English Translation

Post by DaVince »

wrote:Recently, my brother started a show where he streams video games, and even though he's usually too busy to play games, he set aside three hours each week to devote to his stream. Maybe you could do something similar?
I get what you mean with your plan, but that's exactly what I tried, and it didn't work out for me in the end.

There was some time before, but at this point, I'm working more than full-time hours. In the end, most of the spare time goes straight into resting and relaxing so I don't compromise my health. Translating takes some attention and focus I currently can't really bring up, unfortunately. Same for continuing to learn the language, really...

Even so, I'll see what I can do...
getspawned(imported)
Posts: 11
Joined: Tue Dec 25, 2012 4:53 pm

Re: (Incomplete) Telefang English Translation

Post by getspawned(imported) »

Hi all
I was wondering, do we have a discord chat group?
I feel that discord would make for a good update/communication place :>
kmeisthax
Posts: 128
Joined: Sat Dec 04, 2010 3:20 pm

Re: (Incomplete) Telefang English Translation

Post by kmeisthax »

So, here's a not-entirely-monthly update... More like a "January is ending so here's something" post.

The quest to disassemble our own patch continues. I'm currently focused on compressed tilemap handling. Right now, I have an extractor and a compressor; the extractor is smart enough to recover six unused attribmaps in the code. I currently can't compile this right now because make isn't handing my script a list of all the files it wants, so the six unused tilemaps don't get compressed. I may have to start parsing gfx/tilemaps.asm directly...

I also hacked my Old3DS to run A9LH/Luma3DS/etc so I can install VC injections. I briefly tested out Telefang v110 in the GBC injector. The voice sample is completely screwed up and I have a feeling that the code either needs to be modified or Nintendo has some config file for overlaying PCM samples on top of the emulated audio output. The RTC works fine, I can even reload the game and time will advance as expected, despite the game itself having been loaded from a savestate. I'd like to try the Telefang 2 patch sometime; the 3DS is actually backwards-compatible with GBA software loaded through AGB_FIRM so it's as close to real hardware testing as I can get without buying a flashcard.

One thing I haven't investigated is the GBC emulator's link support. Not only because I'm not comfortable with going full A9LH on my New3DS (the one I wanna keep online), but also because the "Ultimate GBC Injector" app requires a game-specific patch. Naturally, none exist for Telefang and it's my responsibility to create one. So I need to contact some people in order to get some kind of information on how this all works and what the ROM has to do differently when it's in a 3DS CIA.

You may have noticed that the amount of non-translation-patch related changes seems to be piling up. We have Blaziken's RTC-disable patch, we need a better sound sample routine (3DS GBC isn't the only emulator that can't handle it), and now these 3DS link patches. Once the patch has been disassembled (current ETA: 2018+) I'd like to separate these patches out into a "Telefang+" patch that goes on top of the Japanese version, and then have English Telefang based off of Plus. This would allow Japanese users to enjoy the benefits of whatever compatibility patches we add to the English patch without actually having to play it in English.
Blaziken257
Posts: 983
Joined: Fri Dec 22, 2006 11:52 am

Re: (Incomplete) Telefang English Translation

Post by Blaziken257 »

As far as the voice sample thing is concerned, I did notice an odd change in the Virtual Console version of Pokémon Yellow when I dumped it on my 3DS. Basically, when I ran this modified ROM on my Game Boy using an Everdrive GB flash cart, Pikachu's voice was missing, even though it's still present on the 3DS. To make it work properly on real hardware, I had to undo a change at ROM offset 0xF0039 (this offset is in the Spanish version, which is the one I have on 3DS VC) -- the value 0x80 allows Pikachu's voice to be heard, while 0x00 makes it silent. It's weird that the voice is still heard on the 3DS despite this change. I think there's some emulator quirk that makes Pikachu's voice work somehow. I imagine that a similar change might have to be made to Telefang to make the voice sample work on 3DS.

There's also a weird change made to link communication. When I used an Everdrive GB to link the modified Pokémon Yellow to a real Pokémon Blue cartridge, both games froze up on the "Waiting" screen. I had to undo changes at ROM offsets 0x2102 and 0x210D (again, this is Spanish Yellow -- the offsets might differ for other languages and versions). An unmodified ROM has these values at 0x0A, but the 3DS VC version has these values at 0x1A. I didn't take a thorough look at what these values actually do, though, except that they're part of ld b instructions. Again, similar changes might be needed to make linking work on a 3DS.

Also, is the SGB patch going to be part of Telefang+ as well? That change has nothing to do with the translation, after all. Same with any bug fixes (like the glitch where it's possible to make a Denjuu's FD exceed 100).

As an aside, while 2018 is a ways off, it's actually fitting considering when the patch started. It would be the 10th anniversary at some point in 2018. Maybe we can time it so that it's finished exactly on the anniversary?

Finally, I really wish I had time to contribute to this, but I'm often busy with other things, so I barely ever get the chance to work on this game anymore. I feel bad for this, but I'm glad to see other people working diligently on this game...
kmeisthax
Posts: 128
Joined: Sat Dec 04, 2010 3:20 pm

Re: (Incomplete) Telefang English Translation

Post by kmeisthax »

Blaziken: I found some info on the VC link patches. The emulator patch files contain raw ROM byte changes as well as execution breakpoints for various emulator functions. My best guess is that they're trying to get copies of internal buffers to transfer all-at-once and then emulate the byte-for-byte serial protocol the GB uses. Thusly, link functions won't work on real hardware because the emulator copies the transferred data between systems rather than emulating REG_SB correctly. I'm not 100% sure what each function does and even crossreferencing a Crystal VC patch and Crystal disassembly I can't figure this out entirely. Telefang also has extra link functions for supporting that blinking LED thing that I'll probably have to disable in the VC config file.

I probably will need to A9LH another 3DS (which means buy another one, since I don't wanna have A9LH on my "online" 3DS) in order to run two copies of my injected ROM. Or perhaps disassemble the emulator itself, since there's other emulator functions not documented in the file I found on a certain online forum. AFAIK Citra doesn't emulate 3DS Wireless Multiplayer just yet so I actually need two pieces of real hardware.

Telefang+ is going to have all those other bug fixes and the SGB enable, too. I definitely need to test Telefang on real SGB hardware as well since obviously none of this SGB stuff actually went through certification.
Blaziken257
Posts: 983
Joined: Fri Dec 22, 2006 11:52 am

Re: (Incomplete) Telefang English Translation

Post by Blaziken257 »

I have looked at the emulator patch files for other games before (there are a whole bunch of them here, though I haven't listed any Pokémon ones yet), but I didn't fully understand the format (though I know that anything with mode = 1 involves changes to the ROM itself -- changes that can be seen on real hardware). Your explanation about the link changes makes some sense to me and it explains why Nintendo didn't bother with Link Cable support in the majority of GB/GBC games for the Virtual Console. It's kind of sad that the emulation for the Link Cable seems to be inaccurate to the point where the ROMs have to be hacked to make them work. It sounds difficult to make Telefang work with it, but I hope that you can figure it out eventually!

And as for the blinking LED accessory, I have one of those, and it works even I'm playing off an Everdrive GB flash cart, so I can try to mess with the link function that supposedly interacts with this and see if it affects the blinking LED. I think I know what function you're talking about, because I recall seeing it myself when I was working on the RTC-free patch.

If you need another 3DS to test with, you can probably get by with a 2DS. Normally I don't like these due to the lack of a clamshell, but they're the cheapest model, and A9LH still works on it, I think. Just a thought... (Or for the record, my only 3DS has A9LH installed on it, and I use it online without any issues!)

Also, the Everdrive GB is fully compatible with the SGB, so I was able to easily test SGB features with Telefang. And it works as you expect it to! Here are a few pictures that I took (excuse the quality of them -- I was using my phone camera to take pictures of my television):

Power Version (English): Power Version (Japanese): Speed Version (Japanese): Keep in mind, however, that the game will run about 2% or so faster on a Super Game Boy. This is an issue with the SGB hardware and not the game -- all games are affected by this. If you do not own an SGB but would like to see this for yourself, the easiest way (that I know of) is to use BGB and do the following:
  • Right click->Options...
  • Go to the Misc tab
  • In the framerate text box, enter: 61.17
  • Click on the "adjust sound speed" checkbox to the right of this
  • Click Apply
It's possible to detect SGB hardware and slow down the music to compensate for the extra speed, at least, but most games don't bother to do this, and the only game that I know of that does this is Mole Mania. Also, apparently the Super Game Boy 2 runs at normal speed, but I don't have one to verify this.
kmeisthax
Posts: 128
Joined: Sat Dec 04, 2010 3:20 pm

Re: (Incomplete) Telefang English Translation

Post by kmeisthax »

2DS will work with A9LH, it's almost identical to an Old3DS. Hell, the 2.1 firmware you have to downgrade to will even run on a New3DS. (Just don't close the lid...) I'm tempted to buy one of those Pokemon 2DSes just because I'm a sucker for transparent plastics. As for the actual emulator patch format, I'm half-tempted to just disassemble the emulator and find the code that parses patchfiles.

So the only thing they have in SGB mode is the border, huh? Not even any color palettes. No wonder they removed this, they never actually finished it. Maybe SGB palettes will be some Telefang+ fodder...
Blaziken257
Posts: 983
Joined: Fri Dec 22, 2006 11:52 am

Re: (Incomplete) Telefang English Translation

Post by Blaziken257 »

SGB color palettes are actually programmed in the game, but apart from the first few screens, the functionality is unfinished. Telefang loads all palettes at the start of the game, by using the PAL_TRN command to read palettes from 0xEBC8, and then it loads colormaps by using the ATTR_TRN command to read colormaps from 0xEED8. To change the palette and colormap, Telefang uses PAL_SET, which picks a palette index and colormap index. Here's some more information about the palettes, though it currently doesn't mention the colormaps, many of which are unused:
https://tcrf.net/Keitai_Denjuu_Telefang/SGB_Colors

(Dumped colormaps can be found here: http://www.mediafire.com/file/1d1vjow18otku48/attr_imgs.7z)

Note that the title screen is normally completely white, and the rest of the game is too, since the PAL_SET command is never run after the title screen. When I first added the SGB functionality, I replaced the bytes from ROM offsets 0xEBC8 to 0xEBCF (which are FF 7F (white) repeated four times) with other colors so that most of the game is actually visible. I arbitrarily picked grayish colors, but you can pick anything as long as you know the 15-bit blue/green/red format.

(Note that there's another way to fix this as well: At ROM offsets 0x94C5-94D1, which is executed just before the title screen loads, there's some ASM code to set several registers, followed by a call to 0x04C0, which changes the color palette and colormap. Registers b, c, d, and e determine the four SGB palettes based on the table in the link above, and register a determines which attribute file (a.k.a. colormap) to be used.
Modifying the value of register b (at ROM offset 0x94C6) makes the title screen and anything after that load a different palette index. Registers c, d, and e don't matter for this screen, since the title screen colormap only uses the first palette line.)

Finally, while a few SGB games use extra features like SNES-quality sound effects, or even an entire SNES program, Telefang just uses borders and color palettes.

I hope some of this makes sense! If this is still confusing, note that BGB's debugger lets you view how SGB packets are used -- In the debugger, go to Window -> SGB Packets. Every time a packet is sent, it will show up in this window. It helps in conjunction with this: http://bgb.bircd.org/pandocs.htm#sgbfunctions
User avatar
Sanqui
Posts: 736
Joined: Sun Dec 16, 2007 12:25 am

Re: (Incomplete) Telefang English Translation

Post by Sanqui »

I believe I've determined the unused SGB colormaps found in Telefang are actually lifted straight from Medarot 2, presumably Natsume's previous game, which did have complete SGB support.
Post Reply