øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1657.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index81b5.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=17.80e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index81b5.html.zxÏ9h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ °V:OKtext/htmlISO-8859-1gzip8:Ö:ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 01:23:51 GMT0ó°° ®0®P®€§²ð®Î9h^ÿÿÿÿÿÿÿÿ{3: GBA portraits - Hack Completed!!

Author Topic: GBA portraits - Hack Completed!!  (Read 23046 times)

magicpants29

  • FF5 Hacker
  • *
  • Posts: 47
    • View Profile
GBA portraits - Hack Completed!!
« on: August 31, 2011, 03:06:57 PM »
I prefer to play the GBA version of FFV but I hate the look of those new portraits. How complex would it be to either remove them or change them? I'd prefer to redraw them to be more accurate and cartoony to keep the lighthearted silliness of the game's atmosphere going but I don't know how to hack roms at all, especially not something like the in-game graphics. Hopefully its not too hard since there are only about a dozen in the whole game and they don't change or animate or anything.

EDIT: Hack completed! Patching file attached! Give it a try!

« Last Edit: December 08, 2014, 04:37:35 AM by Jorgur »

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: GBA portraits
« Reply #1 on: September 02, 2011, 04:50:18 PM »
The easiest thing to do is to look for the palette they use & change all the colors for a transparent one, although I think only the first color is left as the transparent, not sure if it would make the others transparent when you use the same color as the first one of the palette (never tried this) though... The problem with this is whether or not another image shares the same palette, if that's the case then that method wouldn't work.

The other method is to search for the sprites (you can use a tool like Tile Layer Pro or Tile Molester) & modify them, although I did a quick look with one of them & didn't found them, I believe they are encrypted, so it wouldn't be easy w/o any information about this (the encryption method)...

Just for the kicks, I'll post the portraits. Maybe it could help someone interested on looking for them...:

I'm the best in the universe! Just remember! [F-zero X]

magicpants29

  • FF5 Hacker
  • *
  • Posts: 47
    • View Profile
Re: GBA portraits
« Reply #2 on: September 03, 2011, 01:43:30 PM »
so basically, I should try messing around with those tools til I find the portraits within the ROM, though if there's a chance I just won't be able to find them that way depending how they're encrypted?

For now I'm going to mess around with those tools and see if I find anything. At the very least I'll develop some understanding of how this all works.
« Last Edit: September 03, 2011, 01:56:05 PM by magicpants29 »

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: GBA portraits
« Reply #3 on: September 05, 2011, 12:21:45 AM »
I kind of forgot how the colors where stored in the GBA, as I've found some palettes for another game (which I mention on my page :P). Anyway, it seems is not that hard to find them, here's a quick example of what I had in mind that it can easily be done:

Replacing Lenna's palette with only black colors...
   


And this is how I did it to find & change this info:
  • Open "Visual Boy Advance" & go to an scene where there are portraits being displayed (like in the opening title)
  • Open the "Palette View" and "Memory View"
  • On the Palette view, look for the 14th (or 3rd last) line on the sprite block, that should be the palette of the portrait
  • Just to be sure, go to the address mentioned using the Memory View (I think it'll be fixed to 0x050003A0), it should match with the values mentioned on the sprite block
  • Open the ROM with a hex editor & look for these values & change them to 0's (which represents black)

As an example, this is Lenna's portrait palette:
3231E0 - 00 7C FF 7F BE 73 DD 67 5C 67 7D 4B 1A 5B 5B 66 D9 52 1D 33 AC 7E 75 46 12 3A AF 31 6C 29 08 21

Hope this helps ;)
« Last Edit: September 05, 2011, 12:28:35 AM by samurai goroh »
I'm the best in the universe! Just remember! [F-zero X]

magicpants29

  • FF5 Hacker
  • *
  • Posts: 47
    • View Profile
Re: GBA portraits
« Reply #4 on: September 05, 2011, 01:20:46 AM »
Interesting... so basically, to find each character's portraits, I should view a scene where the portrait shows in the palette and memory viewers and pick out the values in that row, then using a hex editor I can search for where in the rom the palette is stored. I went through your steps and was able to get the same results, blacking out Lenna's portrait, then trying the same thing on King Tycoon as practice, same result, so things are looking good. After comparing the hex editor to the palette viewer, I understand how the colors are written, so if I wanted to, I could just as easily set all portraits to the transparent color.

Now that I know how to adjust the palette, I need to figure out where and how in the code the palette is applied. I figured the solution would be to try other viewers til I find something that looks like the sprites. The OAM viewer shows a picture of Lenna's portrait so I'm betting this is where I need to look first.

Thanks a ton for the help! I'll post if I discover something new, unless you beat me to it I guess haha

magicpants29

  • FF5 Hacker
  • *
  • Posts: 47
    • View Profile
Re: GBA portraits
« Reply #5 on: September 05, 2011, 02:35:01 AM »
I'm not good with all the terminology and you guys might already be more familiar with some of this than I am, so bear with me haha.

Through the tile viewer I was able to learn how the portraits are written. I realize that each value was a reference to the palette, and that by changing each value I can reassign the color used on each pixel. Then, I can change the palette to colors of my choice if I need to. The hard part, for some reason, is finding the values of the pixels within the hex editor. For some reason, when I search for what I found using the memory viewer, I get nothing. I assume I'm just entering it wrong or something. I keep checking to make sure I didn't make a typo or something but everything I've tried so far hasn't worked.

Example:
The upper left 8x8 pixels (06014400 - 06014420) of Lenna's portrait reads:
00 00 00 00 00 00 00 DD 00 D0 CC 8B 00 3D 33 64 D0 43 68 43 30 B4 BB 8B 80 C3 CC 48 B0 C3 8C 12
...in the Memory Viewer. When I compare these values to the palette, it adds up; the 0's are transparent, the higher values are generally dark and lower ones are generally light (I'll post a picture if you somehow don't understand me). Yet searching in my hex editor for those values yields nothing for some reason.
« Last Edit: September 05, 2011, 03:13:26 AM by magicpants29 »

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
4 bpp
« Reply #6 on: September 05, 2011, 10:34:36 PM »
I believe you've grasped already how graphics work. Usually, the GBA (and SNES) store most of the images using 4 bits-per-pixel (bpp). With that, you can have 2^4 colors in the palette, or in other words, up to 16 colors (which we already knew...)

As for how the image is stored, well this is how it (normally) works:
  • The image is stored in a 8x8 grid
  • They use 32 bytes
  • Each nibble (4bits), represent a color in the palette (from 0 to F)
  • The bpp are intercalated, that's why you see odd results

Portraits seems to have a size of 32x32 + 32x8 (=32x40), so that would be 40 lines to modify using the Memory View on the GBA...


BTW, I believe that the following information was from this image, so I hope it helps a bit:


4BPP (32 bits)

37 00 59 26 6F 10 FB 04 BB 44 BD 4A 76 01 35 06
00 00 11 26 0F 10 23 54 22 44 08 6B 28 09 08 00

Bitplane 1 - 37 59 6F FB BB BD 76 35
Bitplane 2 - 00 26 10 04 44 4A 01 06
Bitplane 3 - 00 11 0F 23 22 08 28 08
Bitplane 4 - 00 26 10 54 44 6B 09 00


 0 0 1 1 0 1 1 1      0 0 0 0 0 0 0 0      0 0 0 0 0 0 0 0      0 0 0 0 0 0 0 0
 0 1 0 1 1 0 0 1      0 0 1 0 0 1 1 0      0 0 0 1 0 0 0 1      0 0 1 0 0 1 1 0
 0 1 1 0 1 1 1 1      0 0 0 1 0 0 0 0      0 0 0 0 1 1 1 1      0 0 0 1 0 0 0 0
 1 1 1 1 1 0 1 1      0 0 0 0 0 1 0 0      0 0 1 0 0 0 1 1      0 1 0 1 0 1 0 0
 1 0 1 1 1 0 1 1      0 1 0 0 0 1 0 0      0 0 1 0 0 0 1 0      0 1 0 0 0 1 0 0
 1 0 1 1 1 1 0 1      0 1 0 0 1 0 1 0      0 0 0 0 1 0 0 0      0 1 1 0 1 0 1 1
 0 1 1 1 0 1 1 0      0 0 0 0 0 0 0 1      0 0 1 0 1 0 0 0      0 0 0 0 1 0 0 1
 0 0 1 1 0 1 0 1      0 0 0 0 0 1 1 0      0 0 0 0 1 0 0 0      0 0 0 0 0 0 0 0

Code: [Select]
_ _ _ _ _ _ _ _    _ _ _ _ _ _ _ _    _ _ _ _ _ _ _ _    _ _ _ _ _ _ _ _
____XXXX__XXXXXX   ________________   ________________   ________________
__XX__XXXX____XX   ____XX____XXXX__   ______XX______XX   ____XX____XXXX__
__XXXX__XXXXXXXX   ______XX________   ________XXXXXXXX   ______XX________
XXXXXXXXXX__XXXX   __________XX____   ____XX______XXXX   __XX__XX__XX____
XX__XXXXXX__XXXX   __XX______XX____   ____XX______XX__   __XX______XX____
XX__XXXXXXXX__XX   __XX____XX__XX__   ________XX______   __XXXX__XX__XXXX
__XXXXXX__XXXX__   ______________XX   ____XX__XX______   ________XX____XX
____XXXX__XX__XX   __________XXXX__   ________XX______   ________________


0 0 0 0 0 0 0 0      0 0 1 0 0 1 1 0      0 0 0 1 0 0 0 0      0 1 0 1 0 1 0 0    <-- BP 3
0 0 0 0 0 0 0 0      0 0 0 1 0 0 0 1      0 0 0 0 1 1 1 1      0 0 1 0 0 0 1 1    <-- BP 2
0 0 0 0 0 0 0 0      0 0 1 0 0 1 1 0      0 0 0 1 0 0 0 0      0 0 0 0 0 1 0 0    <-- BP 1
0 0 1 1 0 1 1 1      0 1 0 1 1 0 0 1      0 1 1 0 1 1 1 1      1 1 1 1 1 0 1 1    <-- BP 0

0 1 0 0 0 1 0 0      0 1 1 0 1 0 1 1      0 0 0 0 1 0 0 1      0 0 0 0 0 0 0 0    <-- BP 3
0 0 1 0 0 0 1 0      0 0 0 0 1 0 0 0      0 0 1 0 1 0 0 0      0 0 0 0 1 0 0 0    <-- BP 2
0 1 0 0 0 1 0 0      0 1 0 0 1 0 1 0      0 0 0 0 0 0 0 1      0 0 0 0 0 1 1 0    <-- BP 1
1 0 1 1 1 0 1 1      1 0 1 1 1 1 0 1      0 1 1 1 0 1 1 0      0 0 1 1 0 1 0 1    <-- BP 0


0 0 1 1 0 1 1 1
0 1 A 5 1 A A 5
0 1 1 A 5 5 5 5
1 9 5 9 1 A 5 5
1 A 5 1 1 A 5 1
1 A 9 1 F 1 A 9
0 1 5 1 C 1 1 A
0 0 1 1 4 3 2 1
« Last Edit: June 18, 2016, 09:26:35 AM by samurai goroh »
I'm the best in the universe! Just remember! [F-zero X]

magicpants29

  • FF5 Hacker
  • *
  • Posts: 47
    • View Profile
Re: GBA portraits
« Reply #7 on: September 06, 2011, 02:52:39 PM »
This is pretty informative... I've been trying to find the portraits in the hex editor through searching by rearranging the bits but I'm not having any luck. I've even, to an extent, tried searching manually to find closely grouped similar bits. Is it possible the bits are written out differently in the rom and undergo some sort of adjustment or something? Surprisingly, even the string you posted (37 00 59 26 6F 10 FB 04 BB 44 BD 4A 76 01 35 06) can't be found. Did you grab that from the SNES rom? Would they have rewritten stuff on the GBA rom to make more space?

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: GBA portraits
« Reply #8 on: September 06, 2011, 04:41:25 PM »
Sorry, I should had mentioned that all that information regarding the bpp was from the SNES version (it was from when I wanted to include the job sprites into the editor directly from the game & not as an image, as everything else is...)

I have not much information in general regarding the GBA, so that's why I haven't found/posted where the sprites are located. However, I'll try looking at them tonight & hope to have any luck... Once a portrait is found, the others should be nearby, therefore really easy to find...

One wild guess you can try is to change a block of data (to whatever you want) & hope it still runs & affects what you're looking for, then reduce the size of the block until you pinpoint the exact location. Since I don't know where to start, this could take long (since you still need to make it run)...
I'm the best in the universe! Just remember! [F-zero X]

magicpants29

  • FF5 Hacker
  • *
  • Posts: 47
    • View Profile
Re: GBA portraits
« Reply #9 on: September 06, 2011, 08:24:25 PM »
I suppose I could give that a shot, probably all I can do as far as the hacking goes at this point. I'll keep trying.

I've also been drawing the portraits I want to use, first as regular pictures, then resizing and adjusting the colors. Only these 4 are done so far:

Naturally anyone reading this thread can use whatever they want to replace the portraits, but for those curious this is what I'm going with (of course I'll also share the finished result with anyone who may want it).

Photoshopped a portrait into a screen capture of the game. I left it blurry since I (and I assume most people) have their emulators magnified:


And, if anyone cares, here are the images I drew originally to make into the portraits:

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: GBA portraits
« Reply #10 on: September 06, 2011, 09:08:16 PM »
Great portraits! :D

If you make a hack out of this, I'll be sure to download.  :wink:

magicpants29

  • FF5 Hacker
  • *
  • Posts: 47
    • View Profile
Re: GBA portraits
« Reply #11 on: September 06, 2011, 09:54:05 PM »
Thanks! It always bugged me and my friends that the portraits looked nothing like the characters. I'm pretty pleased with how they came out, though I definitely want people to try playing through the whole game with them to determine how well they fit the characters' personalities.

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: GBA portraits
« Reply #12 on: September 07, 2011, 07:19:48 AM »
If you are having problems finding the portraits (or anything else), you could always try corruption. Corrupt specific areas you suspect might contain the portraits and see if the portraits change.

http://slickproductions.org/corrupster.php

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: GBA portraits
« Reply #13 on: September 07, 2011, 09:23:09 AM »
So there IS a tool to do the corruption for you, that's neat :)


As for the portraits you're making magicpants29, I like the cartoonish version you got there, with the only exception of their expressions (like their mouths & eyebrows). Butz (I know he's called Bartz on the GBA, but prefer the other name) & Lenna look surprised while Galuf & Faris look pissed,  I think they could look more like this:
  • I think Butz should look happy, like an adventurer he is.
  • I think Lenna fits well with the surprised face, like a princess that is learning about the outside of the world.
  • I think Galuf should look clueless, as he lost his memory at the start of the game...
  • I guess Faris looking with in a bad mood goes with her character being the pirate boss & trying to be manly and such...

As for yesterday, I received a file I wanted, so that took all my time... Let see if tonight I can do something...
I'm the best in the universe! Just remember! [F-zero X]

magicpants29

  • FF5 Hacker
  • *
  • Posts: 47
    • View Profile
Re: GBA portraits
« Reply #14 on: September 07, 2011, 02:04:41 PM »
Gonna try the corruption tool when I have some time to sit down and play with it (later tonight probably), should be able to get results much faster

As for the portrait drawings, believe me, I keep adjusting them and consider redrawing them a lot, especially when I remember certain lines or scenes. I definitely want to play through the whole game and see how they feel, and I encourage anyone else to do the same.
  • Bartz tends to be kind of a happy idiot, but there's times in the dialogue when he's all pumped up or angry, so the expression I went for was kind of an ambiguously energetic idiot look. I actually based it off the original portrait cuz it had a good expression. If I adjust it, it would be around the eyebrows to make him look more worked up. His mouth in the mock screen capture looks more happy than surprised, which I think worked out well.
  • Lenna tends to do a lot of dumb stuff too (how many times does she eat poison?) but at the same time she's a sweetheart, so I actually drew her as a dumb blonde and then gave her a dye job. The original portrait is just plain sickly looking, unexpressive, and nothing at all like her sprite, but I feel like this one gives her more personality and color.
  • Galuf is really tricky... he's pretty much the most dynamic character, and has a lot of silly moments as well as serious ones. If there was ever a need for multiple portraits for anyone, it's Galuf. How can a guy be making the same face when he's making jokes as well as about to die? His memory is restored pretty early on so I felt it was between his wacky one-liners and his serious moments. I decided to go with a sort of grumpy old man look that could be interpreted as serious but also sarcastic and smart-alecky.
  • Faris was kind of hard too, the important thing to remember is that she's concealing her identity (if she wasn't she'd change her outfit), so I aimed for some androgyny. In the normal portrait, she looks like a woman with a mannish face, and not at all stunning like the other characters describe her. The simple answer was to do what her sprites do: cover her face with her hair. Her expression was based around how she's generally assertive, though I'm not 100% sure I like how it came out so I might redo it, depends how it performs in a playthrough.

As far as the other characters go, they should be easier since they tend to be in the same moods during their appearances. Cid will probably be the most difficult (loses and regains his motivation) and Exdeath will be the easiest (can't really mess up a helmet). Exdeath and Krile/Cara are the only ones I feel like their portraits really matched the characters, though I have to redraw them anyway to keep the style going.
« Last Edit: September 07, 2011, 03:22:21 PM by magicpants29 »