NDS Translator Application

Discussion in 'NDS - ROM Hacking and Translations' started by oldbushie, Aug 31, 2009.

Aug 31, 2009

NDS Translator Application by oldbushie at 6:48 PM (3,820 Views / 0 Likes) 15 replies

  1. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    I made this application which is capable of translating games on the fly: Aerobush Screenshot Translator Version 1.35

    Basically, it builds an array of characters based on the font files, and polls the system clipboard for changes. Every time you hit alt+printscreen, for instance, it will attempt to translate the screenshot you just took. You can then edit the Japanese text if there's any errors and re-translate it.

    However, right now it's a bit dependent on exact character matching, and creating fonts from nds roms is rather tedious when I can't extract the font file in the rom into an image. Right now I'm basically using the character naming screen to create two fonts (one that's used in the creation screen and one that's used in general dialog in the game). I would love to do fuzzy OCR, but some of the small fonts are so stylistic they barely resemble the original Japanese characters.

    Edit: New version available! The application now takes only 0.25 seconds to translate the average emulator screenshot, and 10 seconds to translate an entire 1920x1200 screenshot. It's also much easier to use; the config file is not needed anymore. You only need to create the font files. More improvements are on the way...

    Re-edit: The current version supports multiple languages for input and output and fixes some issues that caused text to not line up properly. I would like to make the text output separated into frames based on how the text is arranged on the screen, but that's just cake at this point. All the really hard stuff is *done*. [​IMG]

    Edit 3: I did numerous tweaks and bug fixes, and I also added all the fonts for Tingle's Balloon Trip. I basically messed around with the address ranges that point to the fonts in order to control the fonts displayed on the character selection screen. Took some time, but I think it's worth it.
     
  2. azerty1

    Member azerty1 GBAtemp Regular

    Joined:
    Mar 22, 2009
    Messages:
    160
    Country:
    Canada
    so...given a font and a screenshot, it translates the graphic into text and then searches the rom for the text? but if you just replace the text with translated text, wouldn't that mess something up? i don't quite get how this can work with all nds games...
     
  3. sadak5

    Member sadak5 GBAtemp Fan

    Joined:
    Feb 27, 2007
    Messages:
    421
    Location:
    Mexico City
    Country:
    Mexico
    His post says its for extracting it and letting you to translate it using google translate. I remember there was a program like this to help you play Japanese games in Windows
     
  4. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    Yeah, I don't touch the rom itself, I just use screenshots from the emulator. This is meant to be a streaming translator if you just want to translate as you play. I have the tool that Sadak mentioned, which works great for PC games, and it is indeed the inspiration for this application (though the PC game translator has an easier job since it simply grabs the text out of the textboxes; no character recognition is involved).
     
  5. DarthNemesis

    Member DarthNemesis GBAtemp Maniac

    Joined:
    Feb 19, 2008
    Messages:
    1,208
    Country:
    United States
    Edit: nevermind, question was answered
     
  6. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    Edit: No answer clarification needed.
     
  7. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    New version available! More details in the first post. I basically added advanced blob detection to make it orders of magnitude faster to look for possible characters on the screen. I still need to fix a few minor hitches with punctuation, but there's enough changes to warrant a new release. Enjoy!!!!
     
  8. cybrian

    Newcomer cybrian Member

    Joined:
    Sep 14, 2009
    Messages:
    30
    Country:
    United States
    If only there was something like this for people playing it on a real DS...
     
  9. dimmidice

    Member dimmidice GBAtemp Maniac

    Joined:
    Sep 12, 2009
    Messages:
    1,463
    Country:
    Belgium
    could you add the fonts of Pokemon heartgold and Soulsilver? i'm not quite sure how to do it myself....
     
  10. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    Yeah, I know. If there's a way to create a homebrew wrapper that has some basic functions (get a screenshot of the current game and temporarily replace the top screen with output, triggered by a certain button combination) I would totally port it to the DS. I don't know if such wrappers are possible, though. I may have to check out a homebrew forum.
     
  11. Pyrofyr

    Member Pyrofyr GBAtemp Maniac

    Joined:
    Apr 24, 2008
    Messages:
    1,258
    Location:
    Miami
    Country:
    United States
    Probably not possible. The SCDS1 seems to have problem enough just loading up RTS/Guide/Cheats with the game. Most other carts even only have Reset.

    I believe I read a while back that the Supercard team had thought of a few other things to add with it, but they couldn't do it because it wasn't powerful enough. Same thing with someone who tried to make a persistent HUD.
     
  12. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    Pity. I was hoping that this wrapper would technically be possible considering it's not touching the game directly, just the hardware. But then, in order to do that, I guess it would have to be built into the firmware on a flashcart.
     
  13. Shardnax

    Member Shardnax GBAtemp Regular

    Joined:
    Aug 23, 2008
    Messages:
    175
    Country:
    United States
    It'd probably need to be something like the DSi movie player cart. Nonetheless, this is awesome, thanks for developing it [​IMG].
     
  14. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    I'm so glad you're getting good use out of it! [​IMG] I'm honestly surprised that a tool like this (being able to scan for specific fonts) didn't exist yet. Fuzzy OCR just doesn't work very well on tiny fonts.

    Also, can anyone *please* take a look at these font files for the Tingle game? http://www.aerobushentertainment.com/misc/...leFontFiles.zip
    The .inf file seems to specify the chunks that the extensionless file should be broken up into (there's 10 fonts packed into there) but I'm baffled as to what to do. I'd really like to grab all the fonts for this game. I tried analyzing the raw image data for patterns and I did see that there's an apparent slight gap between the different fonts (9 gaps total). I couldn't figure out the magic way to parse it, though.
     
  15. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    I managed to figure out the inf file at least, and updated the zip to contain the unpacked files. The inf contains address ranges for all the individual files in the giant packed file. All 10 of the sub-files contain DFV in the same place in the header, so that's promising at least. Now if only I could find out what DFV stands for... In the meantime, I'm basically guessing at the color depth used in the font image file.
     
  16. oldbushie
    OP

    Newcomer oldbushie Member

    Joined:
    Aug 22, 2008
    Messages:
    29
    Country:
    United States
    I gave up on trying to decipher those files, and instead tweaked and repacked the rom to help create all the fonts by hand. I also fixed a bunch of minor issues. Check it out! [​IMG]
     

Share This Page