Zophar's Message Domain

Go Back   Zophar's Message Domain > Emulation Talk > Rom Hack

Reply
 
Thread Tools Display Modes
Old 05-26-2009, 10:30 PM   #1
Kilyle
Junior Member
 
Kilyle's Avatar
 
Join Date: May 2009
Location: Stuck in the black hole that is TVTropes.org
Posts: 24
Arrow Sorcerer's Kingdom: Where to find "dictionary"?

Okay, so the Sega Genesis game Sorcerer's Kingdom turns out to be a great first project. It doesn't appear to have been translated before; it's an enjoyable game with some odd mechanics I haven't found elsewhere; and the text was easy to find, even the digraph-compression stuff.

So now I've figured out my table, most of it. And it includes a few longer entries: monster, King, have (with a space after it), you, the, and, ing, ill, etc.

My question is: How do I figure out where these words are defined, so that I could change them into something else?

I haven't been able to locate the font using Tile Layer; that's still a little confusing for me, especially where this game is concerned. So I'm hoping that it's defined in the code (that is, "King" works out to "K, i, n, g" instead of "graphic 1, graphic 2"). But I really have no idea how to locate this part.

In case it matters: I'm using WindHex.

I appreciate any help you can give me!
__________________
Only the curious have, if they live, a tale worth telling at all.
Kilyle is offline   Reply With Quote
Old 05-26-2009, 10:38 PM   #2
Reaper man
Member
 
Reaper man's Avatar
 
Join Date: Apr 2002
Location: Austin, TX
Posts: 5,391
Default

ok, so you have an MTE table, great. did you try relative search for "king" and see what comes up?
__________________
Reaper man is offline   Reply With Quote
Old 05-26-2009, 11:26 PM   #3
InVerse
Senior Member
 
Join Date: Jul 2002
Location: Midwest, U.S.
Posts: 1,489
Default

It sounds like what you're dealing with is dictionary compression. If this is the case, do a search for one of the words in the "dictionary" and you should encounter a list of all of those words that include multiple values. It will most likely appear shortly after the rest of the game's text, though it could appear before the main text, as well. (For that matter, it *could* appear right in the middle of the text, but that would be rather unusual.)

As for not being able to find the font... Are you able to see the rest of the graphics in the game? If not, it may be that the graphics are compressed, an extremely common occurrence in Genesis games. There are a few utilities that may be able to locate common compression schemes and decompress the graphics (Nemesis Searcher is one such utility) but there's no guarantee that a particular game is compatible with these tools.

If you *can* see the other graphics, it's possible that your font is stored in a different bit plane than the rest of the graphics. Try switching to 1BPP which is a common format for fonts to be stored in almost every platform. (Fonts often consist of only 2 colors (usually white on black, but that's irrelevant) so they are often stored as 1BPP graphics so as to save space.)
InVerse is offline   Reply With Quote
Old 05-27-2009, 01:19 AM   #4
Kilyle
Junior Member
 
Kilyle's Avatar
 
Join Date: May 2009
Location: Stuck in the black hole that is TVTropes.org
Posts: 24
Thumbs up I'll give it a try

I will definitely fine-tooth-comb the text area now, looking to see if I can find that dictionary nearby. I expect that'll be the answer there, although if not, I'll be back

As far as the graphics: It's like looking at the Matrix screen. I'm sure there's a pattern there I'm supposed to be able to clue into, but so far I'm failing to spot even a single recognizable square. But since graphics aren't my focus, I was just toying with it anyway. I figured I'd spot a sprite (or part of a sprite), but so far, no dice.

Genesis games, though, have finer graphics than NES and SNES games - speaking from the scant experience I have ripping graphics for use in fangames. Genesis uses way more pixels than the 24x32 base I'm used to. It makes it look nicer, but I expect that it also makes it harder to recognize graphics when they're split into chunks (since an 8x8 square would be a fairly large chunk of an NES sprite but a fairly small chunk of a Genesis sprite).

That's why I expect it will be difficult for me to recognize the graphics even if they're uncompressed... and why I'm not going into graphics at present. I was just expressing a hope that the text compression was code instead of graphics (since I've seen graphical text compression in Ultima: Quest of the Avatar, with the names of the virtues etc.).

So I guess it's back to work I go
__________________
Only the curious have, if they live, a tale worth telling at all.
Kilyle is offline   Reply With Quote
Old 05-27-2009, 01:54 AM   #5
InVerse
Senior Member
 
Join Date: Jul 2002
Location: Midwest, U.S.
Posts: 1,489
Default

If you're just seeing green pixels on a black background, it's because you're in 1BPP mode. Genesis ROMs use .bin for their extension, but .bin is a generic format, so Tile Layer Pro doesn't recognize it as a Genesis ROM. Under Format in the View menu, select Genesis and then scroll down 25% or so and you'll see things that are obviously graphics. I didn't, however, see a font. I quickly glanced through it in 1BPP mode and a few others but still didn't locate a font, though I wasn't looking too terribly closely, so it's possible that I missed it. Hell, I haven't even played the game, so I don't even know if the font is 8x8, 8x16, 16x16 or some other strange format.

Just for the hell of it, I ran the ROM through Nemesis Search and it didn't detect any common compression algorithms.

Also, just for information's sake: I have 2 different versions of the ROM. One is specified as 1992 and the other is specified as 1993 [!]. (The [!] signifies that a ROM is a verified good dump (meaning somebody redumped it and compared it to the existing ROM and they were identical.)) So I would recommend using the 1993 [!] version. It probably won't make a difference as far as hacking goes, but the 1993 version most likely has some bug fixes and the like that may not be present in the 1992 version, and it's possibly that a patch made for one version may not work on the other version, so whichever version you use, if you complete your hack, make sure to specify the correct version in your documentation.

Also, I should have mentioned earlier, if you're using a .smd instead of a .bin ROM, you need to convert it to .bin, though I'm pretty sure if you were using a .smd (interleaved) ROM, you wouldn't have made as much progress as you already have.
InVerse is offline   Reply With Quote
Old 05-27-2009, 02:49 AM   #6
Kilyle
Junior Member
 
Kilyle's Avatar
 
Join Date: May 2009
Location: Stuck in the black hole that is TVTropes.org
Posts: 24
Post Hmmm...

The .bin vs. .smd thing strikes a chord. I checked and the ROM itself, in the .zip backup I have, is .bin - Sorcerers Kingdom (U) (REV 01) [!].bin, to be precise.

But the file I have in my Tile Layer Pro folder is SorKtest.smd, and I don't recall if I simply renamed it or what. I think, if I did rename it, it was because Tile Layer wouldn't load it as a .bin file, and for some reason I experimented (I don't usually go around renaming file extentions all willy-nilly). I don't believe I downloaded a separate file.

Now, as for what I can actually make out at a cursory scan:



First, there's the text (copied from a screenshot); I haven't seen anything like it in Tile Layer's load of the file.

Secondly (in the red), I managed to find some sort of unfamiliar logo. It clearly says "The E--" and it might be a company logo; I didn't see something like that in the loading of the game.

Thirdly, the big stuff: Some sort of... hut? and a giant mountain. I think maybe if I had played the game more recently, these would look familiar, but they really don't. Maybe they're part of the map screen? Who knows. In the dark green circle I've highlighted a... cake-shaped thing that might be a building of some sort. Similarly, there's some little building to the south.

Again, haven't played the game recently, but to the extent of my recollection, this is a game very like Zelda. There is a map, but there's no external map mode (as with Final Fantasy IV) where you walk around. The houses are big and detailed. Maybe these tiny buildings are on the map itself, but it just kinda seems odd.

Fourthly, in the blue, we have a section from a large collection of pieces that probably would make a picture if you moved them around enough. Kind of like a jigsaw puzzle where you don't have the lid.

And lastly, in the yellow, there's stuff I'm pretty sure is just fuzz. Static. Lack of graphical information.

I guess it's a little less hopeless than staring at the Matrix screen. At least I'm getting actually pictures here and there. But still, no sprites.
Attached Thumbnails
Click image for larger version

Name:	SorKfind.PNG
Views:	535
Size:	34.7 KB
ID:	71  
__________________
Only the curious have, if they live, a tale worth telling at all.

Last edited by Reaper man; 05-27-2009 at 03:25 PM. Reason: angelfire doen't use hotlinking... try to use attachments next time.
Kilyle is offline   Reply With Quote
Old 05-27-2009, 11:35 AM   #7
InVerse
Senior Member
 
Join Date: Jul 2002
Location: Midwest, U.S.
Posts: 1,489
Default

I found the font, but you won't be able to get to it in Tile Layer Pro, as it is stored in 1bpp Linear, which TLP doesn't support. (TLP uses 1bpp Planar, which is different. I don't know enough about the technicalities of graphics formats to actually know what that difference is, however.)

In Tile Molester (written by the same author as TLP) open up the ROM and under the View menu, select the '1bpp Linear' codec. Now hit Ctrl-G, enter 3307C as the offset and click OK. You'll see a 16x8 font and some icons. Hit Page Down and you'll see the 8x8 font.

The bit in red says "The End". Futzing around with it in Tile Molester, I can almost get the graphic completely in order. By setting Tile Molester to a Block Size of 16x3, you can clearly see that that particular graphic says The End.

I would guess that your assumptions about what you have circled in blue & yellow are correct. As for the other graphics.... It is possible that the graphical data for the maps is uncompressed while the rest of the graphics are compressed. Since you're only looking to do a translation hack (I think) then that hopefully won't be a problem. (The only time it would is if there are some signs or other graphics with text on them.)

Also, just a random note... Keep in mind that the font really is nothing more than graphics. Unlike on a web page, where text and graphics are completely separate things, in a ROM, they're identical. We just treat the text differently because that's how we're used to doing things. But a hex editor displaying the text from a ROM utilizing a table is really no different than a level editor displaying the map of a ROM.
InVerse is offline   Reply With Quote
Old 05-27-2009, 05:36 PM   #8
Kilyle
Junior Member
 
Kilyle's Avatar
 
Join Date: May 2009
Location: Stuck in the black hole that is TVTropes.org
Posts: 24
Talking That worked

Okay, so now I've got the font available. I'm guessing, since I don't see any digraphs, that they're definitely in the code, and thus much easier for me to mess around with once I find them.

As far as text versus graphics... are you indicating that, once I find a graphics (level) editor capable of letting me switch the graphics displayed in a given area, the task itself is no more complex than switching which letters are displayed, which I am already doing pretty easily?

As far as my table: Turns out several codes just make blocks (the block present in the font table), while a few seem to be control codes (close the window immediately, without letting me read it). But I'm finishing it up. Once I'm done, is there a place I could submit it here, in case it would be useful for others (obscure as the game may be)?

Oh, and apparently there are two distinct tables at work in this game. One for the chat text, for when you talk to people; the other for some other readable sections I've found in the code. The chat text has smalls starting at 61, caps at 81; the other had 41 (caps only... I think). Trying to put the 41-area letters into the chat codes makes blocks, punctuation, anything but letters. So I redid that area of my table.

I think I've hit on part of the table for the copyright announcement at the beginning of the game, using the 8x8 font. Not sure yet. But it's interesting.

Okay, just tried to attach a picture here... not sure how that works yet. But anyway, it's a pic of the font. And there's significant space here between the caps and the smalls, and between the 16x8 and the 8x8. Is it possible to add extra letters or symbols to this area without messing things up? How do I tell the distinction between "place I can draw" and "place I shouldn't draw" - the boundaries of the font-definition area? (I assume that once I have drawn things, I should just use the codes I've identified as "space" to see which one creates which space.)
Attached Thumbnails
Click image for larger version

Name:	SorKFont.PNG
Views:	174
Size:	8.7 KB
ID:	72  
__________________
Only the curious have, if they live, a tale worth telling at all.

Last edited by Kilyle; 05-27-2009 at 05:45 PM. Reason: Font pic attachment
Kilyle is offline   Reply With Quote
Old 05-28-2009, 12:28 AM   #9
InVerse
Senior Member
 
Join Date: Jul 2002
Location: Midwest, U.S.
Posts: 1,489
Default

Quote:
Originally Posted by Kilyle View Post
As far as text versus graphics... are you indicating that, once I find a graphics (level) editor capable of letting me switch the graphics displayed in a given area, the task itself is no more complex than switching which letters are displayed, which I am already doing pretty easily?
Basically, what I meant was that for a game to display, say, a doorway and a game to display the letter 'A' is the exact same process. If you knew where level data was stored and what the various values were, changing that door to, say, a chair, would be pretty much identical to change the letter 'A' to the letter 'Z'. It is a bit more complex in the sense that there's generally a hell of a lot more level data than there is text data, but the process itself is identical.

Quote:
As far as my table: Turns out several codes just make blocks (the block present in the font table), while a few seem to be control codes (close the window immediately, without letting me read it). But I'm finishing it up. Once I'm done, is there a place I could submit it here, in case it would be useful for others (obscure as the game may be)?
Data Crystal has a section for posting table files. There's no listing for Sorcerer's Kingdom at the moment, but it's a wiki, so you can add a listing for any game you want. Along with the table file, I would also add the location of the text and the font.

Quote:
Oh, and apparently there are two distinct tables at work in this game. One for the chat text, for when you talk to people; the other for some other readable sections I've found in the code. The chat text has smalls starting at 61, caps at 81; the other had 41 (caps only... I think). Trying to put the 41-area letters into the chat codes makes blocks, punctuation, anything but letters. So I redid that area of my table.
It's relatively common for a game to use more than one table, especially for different sections of text. Quite often, there will be separate fonts for menus and dialogue. I've also seen many a game use a separate font for the credits of a game, even though the actual appearance of the credits font is identical to the font used in the rest of the game. As you get deeper into ROM hacking, you'll find things like this that make absolutely no sense. Experienced ROM hackers generally chalk this up to game programmers smoking a lot of crack.


Quote:
Okay, just tried to attach a picture here... not sure how that works yet. But anyway, it's a pic of the font. And there's significant space here between the caps and the smalls, and between the 16x8 and the 8x8. Is it possible to add extra letters or symbols to this area without messing things up? How do I tell the distinction between "place I can draw" and "place I shouldn't draw" - the boundaries of the font-definition area? (I assume that once I have drawn things, I should just use the codes I've identified as "space" to see which one creates which space.)
If the "significant space" you're referring to is the 5 blank spaces after the Z and z, then you should be able to use them with no problem. If you're referring to the space between the lines of letters, then probably not. (I'm pretty sure you're referring to those blank spaces after the Zs, though.) The value of the 8x16 space after the Z should be one larger than the value of Z and so forth.

As for how to tell where it's safe to draw and where it's not, you figure that out in the way you figure a lot of things out. Make a backup, try it out and if it breaks the ROM, then you know you can't use that area.

Without trying it, I can't say for sure, but I would venture a guess that you'll even be able to use the blank line underneath the various symbols at the bottom of your screen shot. Also, I'm going to assume (but you'll have to experiment to see) that the space in front of the capital A is the one actually used as a blank space in the game.

You seem to be making some good progress. It's nice to see someone who simultaneously asks questions while trying to figure things out on there own. That's a rarity. A lot of people want babied through the process step by step which is almost as bad, or maybe even worse, than just asking someone to all the work for them.
InVerse is offline   Reply With Quote
Old 05-28-2009, 01:36 AM   #10
Maximum Potion
Staff (news - ROM hacking/translations)
 
Maximum Potion's Avatar
 
Join Date: Jul 2008
Location: Châteauguay, Québec, Canada
Posts: 625
Default

Quote:
Originally Posted by InVerse View Post
You seem to be making some good progress. It's nice to see someone who simultaneously asks questions while trying to figure things out on there own. That's a rarity. A lot of people want babied through the process step by step which is almost as bad, or maybe even worse, than just asking someone to all the work for them.
It would be cool if this thread were made into some sort of tutorial or something, or stickied as some kind of FAQ... There's alot of cool stuff that is adressed here that alot of people ask frequently on the forum.

I don't know, I was just thinking that as I read through it.
__________________
Metroid: Other M. June 27th, 2010.
Delayed - August 31st, 2010.
Maximum Potion is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:34 AM.

Contact Us - Zophar's Domain - Archive - Top

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.