+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  SMS/GG Tile format question
Pages: [1]
Author Topic: SMS/GG Tile format question  (Read 672 times)
Malias
Guest
« on: November 15, 2007, 11:50:48 pm »

While perusing through a game gear rom which I am looking to hack, I noticed that the values for all the text characters were all 16 bit,  the first 8 for the character above and the second 8 for the character below.  Well, I thought that was pretty cool since if I could force the values to be eight bit, it would solve any, if not most space issues I might have.  However, after looking at the rom and several others in the latest version of MEKA, I noticed that all the the tiles in any game are stored like that with all 16 bit values.

My question is is it possible to get eight bit values for any SMS/GG tile?  If it is, could I apply the change only to font characters?  Knowing me, it's probably something completely obvious or way over my head.  Either way, I appreciate the assistance.
Malias
Guest
« Reply #1 on: November 22, 2007, 07:04:31 pm »

Hmm... a week without a reply.  I think I'll try my luck elsewhere
tomaitheous
Guest
« Reply #2 on: November 22, 2007, 10:42:52 pm »


What do you mean the tiles are stored in 16bit values?
 
 Are you referring to the tile format itself or just text characters? SMS/GG tiles are natively 4 bit tiles(16colors), but since the system uses VRAM only - the tiles could be stored in 1,2, or 3 bit format to save rom space and converted on the fly.
Malias
Guest
« Reply #3 on: November 22, 2007, 11:11:54 pm »

Quote from: tomaitheous on November 22, 2007, 10:42:52 pm

What do you mean the tiles are stored in 16bit values?
 
 Are you referring to the tile format itself or just text characters? SMS/GG tiles are natively 4 bit tiles(16colors), but since the system uses VRAM only - the tiles could be stored in 1,2, or 3 bit format to save rom space and converted on the fly.

Argh :banghead:  I meant that they are referenced with 32 bit values with 16 bit values for above and 16 for below.  For instance, a '5' is represented as "0006" instead of just "06".  No wonder I wasn't getting any responses.  Anyways, I am still wondering whether it is possible to reference text or other tiles with only half that.  If I'm still not making sense, please tell me.
tomaitheous
Guest
« Reply #4 on: November 23, 2007, 02:04:11 am »

Quote from: Malias on November 22, 2007, 11:11:54 pm
Quote from: tomaitheous on November 22, 2007, 10:42:52 pm

What do you mean the tiles are stored in 16bit values?
 
 Are you referring to the tile format itself or just text characters? SMS/GG tiles are natively 4 bit tiles(16colors), but since the system uses VRAM only - the tiles could be stored in 1,2, or 3 bit format to save rom space and converted on the fly.

Argh :banghead:  I meant that they are referenced with 32 bit values with 16 bit values for above and 16 for below.  For instance, a '5' is represented as "0006" instead of just "06".  No wonder I wasn't getting any responses.  Anyways, I am still wondering whether it is possible to reference text or other tiles with only half that.  If I'm still not making sense, please tell me.

 Well.. that still doesn't make any sense to me. "06" is an 8bit value in hex and "0006" is a 16bit representation in hex. Are you referring to the tile map values?
InVerse
Guest
« Reply #5 on: November 23, 2007, 06:24:14 am »

Quote from: Malias on November 22, 2007, 11:11:54 pm
Argh :banghead:  I meant that they are referenced with 32 bit values with 16 bit values for above and 16 for below.  For instance, a '5' is represented as "0006" instead of just "06".  No wonder I wasn't getting any responses.  Anyways, I am still wondering whether it is possible to reference text or other tiles with only half that.  If I'm still not making sense, please tell me.

What do you mean by 'above' and 'below'? Are the characters comprised of more than one tile?
Malias
Guest
« Reply #6 on: November 23, 2007, 06:57:00 pm »

Sorry for the confusion.  I'll leave out anything too technical since I'm really getting confused myself.

What I mean is that if you were to open the rom in a hex editor and go to the text there will be two values to represent one character.  Like in the example I gave, a five is represented by 0006, where 00 is the space above the character and the 06 is the value for the five itself.  Most of the time, the first value is 00 because there is nothing above the character.  However if there is a character with a handakuten or a dakuten, the first value will be something like 42 or 43 which will print one of them above the character.  The first value will also change if the text occurs near the top of a text box and the first value would be the horizontal line at the top of the box.

So, yeah I guess I'm saying that each character is composed of two tiles, though both can be used separately.

With that in mind, what I guess I'm asking is is it possible to represent a single character using only one value?

While I wait for a response, I'll see what I can find out myself just in case I'm overlooking something really obvious.
InVerse
Guest
« Reply #7 on: November 23, 2007, 07:25:39 pm »

While I understand what you're describing now, I'm still not sure what exactly you're wanting to do. Are you simply wanting to only have to type a single byte to cause a character to display? Are you hoping to double the amount of space available for text? Are you wanting to switch from double-spaced to single-spaced text? Basically, what I'm asking is why are you wanting to use only single byte values to display the characters? That will affect how to accomplish it.
Ryusui
Guest
« Reply #8 on: November 24, 2007, 04:41:27 am »

Whatever you want to do, it's gonna take some programming.

You could increase the amount of space you have available by...

1. Rigging up a text inserter that interleaves every pair of lines. This method allows you to double both the screen space you have available for text as well as script space in the ROM without even touching the game's ASM code, but it renders the end result needlessly complex (and might make your text look ugly, what with the lack of spaces between lines).

2. ASM hacking the game. ^_^; This might be as simple as changing the loop that reads the game's text to increment the source address by one byte instead of two, though if you're a genuine class act you won't break the original text (i.e. dakuten codes will be handled properly). You'll also need to make sure the proper map address gets updated; odds are printing will start in the top-left tile of the textbox (where the dakuten, if any, over the first character would go otherwise) rather than at the proper position.
Malias
Guest
« Reply #9 on: November 24, 2007, 02:25:10 pm »

Quote from: InVerse on November 23, 2007, 07:25:39 pm
Are you hoping to double the amount of space available for text?

Yeah, Inverse, that's the one I want.

Ryusui, thanks for the answer.  I knew it was most likely going to be asm work.  It's just that the way this game stores its text seems like an awful waste of space, especially considering that almost all of the games graphics are compressed; so, I was just making sure there wasn't something quirky I should be aware of.
Kagemusha
Guest
« Reply #10 on: November 24, 2007, 03:47:05 pm »

You could always expand the GG ROM and relocate the text. GG games can go up to like 1MB or something.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC