Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Mappy translation (was: Starting out)

Reply to topic
Author Message
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Mappy translation (was: Starting out)
Post Posted: Mon Oct 17, 2016 11:55 am
Holy crap, my account here still works!

Er, um, anyway. I'm kind of interested in taking a crack at translating some Game Gear games, but I don't know where to start. I've tried tile editors with GG support but I can't really figure out what I'm doing... most of the tiles are a garbled mess, even the ones that apparently have graphics in them. Sometimes I can't find anything that remotely resembles text... I get the feeling that some of the data I'm looking for is encrypted or otherwise obscured.

Back in the 1990s, emulators like NESticle let you edit graphics on the fly. When you see something you want to change, you pause, dig through the tile set, and alter the necessary tiles. It's not so easy these days. Very few emulators offer this feature, which is frustrating because I can think of a lot of games where it would be handy. While MEKA has a built-in tile viewer, you evidently can't make changes to the tiles.

Anyone got any advice or suggestions? What do you use to edit Game Gear graphics? I'm all ears. Thanks in advance.
  View user's profile Send private message Visit poster's website
  • Joined: 14 Oct 2008
  • Posts: 510
Reply with quote
Post Posted: Mon Oct 17, 2016 4:11 pm
That tile editing feature was only included in Nesticle as a side effect that, due to how the NES worked, some games had a dedicated ROM for the graphics. Tile edit saving was only supported for those games, as otherwise (for games which stored the graphics within the program code) the emulator would have to know where the graphics were originally stored in the ROM (which could've been compressed as well). An editing feature has not been included due to that coding complexity (actually probably not feasible for an emu to keep a record of all ROM-to-VRAM writes) (as well as that Nesticle led to a lot of garbage hacks with only one or two sprite changes being made).

Anyways, to edit graphics, you'd need to download a separate tile editor. I think SMS/GG is a pretty commonly supported graphics mode.
If you can see graphics but they looked garbled, try looking for a button that changes the ROM address by 1 at a time. Usually graphics are not necessarily stored at addresses convenient for tile editors.
As for finding text, if in a tile editor (such as MEKA's viewer) you can confirm the font is stored in order, you can use a technique called "Relative searching" to find the text. The tile editor I use, WindHex32, has that built-in. Otherwise you need a separate program. Use that and look for a word (single-case) that appears in the text in the game (ideally a word that appears not more than a couple times), and if the text is not compressed, it should find a result.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Mon Oct 17, 2016 4:46 pm
Master System and Game Gear games almost always use compression on the graphics, so any tile editing requires decompressing and recompressing things, but then you need to ensure the compressed graphics are no larger then the original, or you need to re-layout the game (ROM expansion or space saving some other way). This is a significant complication. Some tools exist to help, try Master Tile Converter which supports the most common compression scheme. If that doesn't help, you may need something custom - there is code around for other compression schemes (more for compression than decompression).
  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Mon Oct 17, 2016 9:06 pm
Lord, this is frustrating. I'm working with Mappy GG right now, and managed to find the tiles I need to change (offset 0xb50e). Changing the bit depth makes them more visible, but attempts to change the tiles in GIMP leaves them hopelessly garbled in the actual game. Looking for compressed tiles just leaves Master Tile Converter spinning its wheels until it hits empty space at the end of the file.

Also, I have NO idea how the hell to import a palette from MEKA. Is there a keystroke or a drop-down option for this? I sure haven't found it.

I'm just starting to feel like I'm out of my depth with this. I mean, it's not a HUGE deal in the grand scheme of things, but it's nevertheless frustrating. It'd be nice to play something like, say, Ninku Hiroyuki in English. And the massive chunk of kanji at the start of Mappy is just mystifying... why was that even necessary for an arcade port?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Tue Oct 18, 2016 9:42 am
I've reverse engineered the tile compression in Mappy, it's weird and new to me and there are most likely no tools in existence to work with it. If you can code then you can make your own...

I'll post details later. The compression looks quite poor. It may be easier to bypass it and hack in code to redraw the screen. How much more text is there in the game? I didn't actually go past the kanji yet.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Tue Oct 18, 2016 3:02 pm
I don't code... certainly not at this level, anyway. I've done stuff in BASIC but that's the sum of my experience. So this sounds like a pass for a noob like myself. Bummer. Thanks for giving it a look regardless.

I don't know how much Japanese text is in the game to be honest. I mean, it's Mappy! I'm a little stunned that there's this much.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Tue Oct 18, 2016 9:53 pm
I think no SMS/GG translation project can succeed without a coder, but then I see it through code-coloured glasses, plenty of people seem to get by hex editing...
  View user's profile Send private message Visit poster's website
  • Joined: 10 Aug 2016
  • Posts: 16
  • Location: Brasil
Reply with quote
Post Posted: Tue Oct 18, 2016 10:55 pm
I'd like to give some help but I'm more focused on other project styles (mostly by hex-editing and tile editing when I can open them), the best tip I can give is: if you can't edit it right now, try hex-editing the text you can find; if you can't even find the text, try other project and get back when you're experienced with romhacking. I'm considered a noob too but with time you can learn some nice tricks on editing those games.

Like Maxim said, you can progress very far using hex editors.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Wed Oct 19, 2016 7:52 am
So what would be the proper course of action here? Erase the screen when it appears and replace it with a few print statements? I don't think the kanji that appears in the options screen is formatted as text at all, but rather just a block of visual data. It would be impossible to change it with a table editor.

Then again, when it gets to the part in the program where it prints the graphic block, maybe you could change the addresses referenced. I'm pretty sure I found the letter tiles near the kanji. Food for thought.

EDIT

Here's what I've found so far:

B388 to B5F7 seem to be where the graphics for the options screen are stored. Weirdly, changing the values in these addresses push the remaining graphics into neighboring addresses. The carrot cursor is also stored in this range (B4F0 to B500 is the lower half of the carrot).

An alphabet begins at 16D1E, but it's broken up by 5s and other random symbols. In another odd twist, messages in the game and title screen just seem to be graphic blocks rather than built from text, so you'll see messages like "SCORE" and "MAPPY" reused in graphics editors. Seems like an inefficient way of doing business.

It seems logical to assume that B388, et al would be referenced elsewhere in the code (ie "put the contents of B388 at these screen coordinates") but I couldn't find that address with a search. B520 DOES appear twice, but changing it in one or both locations doesn't seem to do anything.

That's all I've got so far.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Wed Oct 19, 2016 2:56 pm
My plan of attack would be to take a screenshot of that screen, make a PNG translation, then hack the code to replace the current "draw an image" with something custom for your PNG. This means you don't need to make the data compatible with the original game, but it does require a small amount of code hacking.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 877
Reply with quote
Post Posted: Wed Oct 19, 2016 5:07 pm
ArugulaZ wrote
An alphabet begins at 16D1E, but it's broken up by 5s and other random symbols. In another odd twist, messages in the game and title screen just seem to be graphic blocks rather than built from text, so you'll see messages like "SCORE" and "MAPPY" reused in graphics editors. Seems like an inefficient way of doing business.

Actually, on the SMS it's the only way of doing it. The SMS doesn't know text as such, what looks like it are just regular graphic tiles.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Thu Oct 20, 2016 7:55 pm
Attaching the Mappy tile decoder disassembly. It's a bit interesting in that it does some postprocessing to try to improve the compression, but at the same time the compression is really weak.
Mappy.dis.asm (12.75 KB)
Mappy tile decoder

  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Sat Oct 22, 2016 7:43 pm
Thanks. Er, how do I use this?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Sat Oct 22, 2016 7:58 pm
You don't, it's just a historical footnote. As I mentioned above, it'll be easier to patch in a new, existing tile loader for that screen than to write a custom compressor.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Sun Oct 23, 2016 12:25 am
Oh. Well, at least I managed to figure out what the kanji for the adventure mode says. 御先祖様の挑戦 apparently means "Challenge of Your Ancestors," which makes sense as time travel heavily factors into the plot.

So okay, I could probably whip up alternate graphics for the options screen, and I think there's even a little bit of free space (blank purple squares) that I could use to store the tiles. Some questions still remain... how would you include the routine to print the alternate graphics without changing the file size and squirreling up the memory addresses in the process? Also, how the heck do you save a palette in MEKA? Believe me, I've looked for that information.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Sun Oct 23, 2016 6:54 am
I haven't looked into the size of the ROM, but there is at least the space taken by the existing tiles to reuse. Expanding the ROM is very easy, is there a strong reason not to do that?

I'm not sure how you save a palette in Meka, are you thinking of a format where you can load it in a graphics editor or just a raw memory dump? I'd usually just screen grab the palette viewer if I wanted to get it in RGB. In this case, it's black and white anyway except for the carrot.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Sun Oct 23, 2016 8:26 am
Is it? Every time I've tried to add stuff to a game beyond its original size, it screws everything up. If you've got some tips, I'd love to hear them! (Also, I'm not sure where I would put the commands that drop tiles on the screen. The only thing I can think to do is run it through a debugger and write down the code that appears after I press start.)

(It's probably pretty clear by now that I don't really know what I'm doing. I know just enough to be dangerous, as someone I knew once put it.)

I did whip up a mock up screen, in case it helps. Give it a look, let me know what you think of it. Thanks.
mappy eng options.png (1.22 KB)
Options Mock-Up
mappy eng options.png

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Sun Oct 23, 2016 12:45 pm
I'll see if I can hack it in and publish the source too. Give me a day or three...
  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Sun Oct 23, 2016 5:39 pm
Thanks!
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Tue Oct 25, 2016 9:50 pm
https://github.com/maxim-zhao/mappy-gg-translation/

IPS attached. For simplicity, I only edited the tiles in place, which meant I had to live with the way they're laid out for the Japanese. It would be a bit more work to allow more tiles. There's loads of space in the ROM, no expansion was needed, although the space below 32KB is a bit tight.
mappy-gg-translation.ips (1000 B)
Mappy translation 1.00

  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Wed Oct 26, 2016 6:00 am
Thanks! I really appreciate this! I applied the IPS and it works great. I'll be putting it on my 3DS shortly.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Wed Oct 26, 2016 8:31 am
I didn't correct the checksum, I ought to fix that and I'll see if I can draw in the tile map properly too.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Wed Oct 26, 2016 7:46 pm
Here we go. In theory you could now have fullscreen antialiased graphics but I don't think that's necessary; but you could take up more width or more height, if you feel the need. I already had to rewire the cursor code so it'd be easy to move it as needed.

Edit: added to the site: http://www.smspower.org/Translations/Mappy-GG-EN

  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Thu Oct 27, 2016 2:18 am
Looks just fine to me. I will say, though, that the translation doesn't work when injected into the 3DS Virtual Console. I might have to try it a couple more times to make sure.

Regardless, this is already getting praise from my friends. I don't know how you do the voodoo that you do so well, but I really appreciate you taking the time to do it for Mappy.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Post Posted: Thu Oct 27, 2016 8:24 pm
The code is there. Find where it loads the screen, load something else instead. It's not trivial to do but it's not that hard to do when you're used to it.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Jun 2005
  • Posts: 20
Reply with quote
Post Posted: Fri Oct 28, 2016 9:38 am
It's no big deal, really. The earlier translation you posted works just fine on the 3DS, most likely because the cursor/carrot wasn't moved to a different address. I'm happy, really!

Thanks again for the help, Maxim. No way this would have been possible without your coding expertise.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!