Author Topic: Developing FF4kster: a comprehensive editor for FF4  (Read 245908 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #930 on: December 23, 2014, 12:05:47 PM »
While not official in any sense, as it was done by "Sight by Sight" instead of any real hacking, maybe it will be of some help to you somehow, it's the full notes on what each Sprite, Sequence, Pointer 1, and Pointer 2 use.

http://slickproductions.org/forum/index.php?topic=1713.msg19441#msg19441

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,266
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #931 on: December 23, 2014, 12:35:40 PM »
I haven't ever been able to find them in Tile Layer either...

I recently discovered where in RAM the current map's palettes are stored, and by way of that knowledge, I can say pretty confidently that they are 3BPP. But by playing around with the palettes, I also discovered that some map tiles use different palettes within an individual tile. For instance, the edge of the mountains - the mountain portion uses the mountain palette, but the grass portion uses the grass/forest palette. This would suggest that world map tiles are - or at least are set up to allow - two separate graphics tiles overlayed. I suppose, knowing where the palettes are, that informtion could be traced back to the entire graphics loading routine... But what a pain in the neck. Maybe when I take some time off next month I'll look into it.

Maybe.

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,425
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Developing a comprehensive editor for FF4
« Reply #932 on: December 23, 2014, 12:58:16 PM »
PinkPuff I don't know if this will help but I posted this in another thread.

Quote
$7FC0 = Title in ASCII for LoROM (22 bytes in length, some ROMs have 21 bytes)
$7FDB = Version # (1 byte (is X, V1.X))
$7FD6 = ROM Type (1 byte)
$7FD7 = ROM Size (1 byte)
$7FD8 = SRAM Size (1 byte)
$7FD9 = Country Code (1 byte)
$7FDA = Publisher / Company (1 byte)
$7FDC = Checksum (2 bytes)


ROM Type:
ROM = 00
ROM+RAM = 01
ROM+SRAM = 02
ROM+DSP1 = 03
ROM+DSP1+RAM = 04
ROM+DSP1+SRAM = 05
ROM+FX Chip = 13
ROM+RAM+Super GameBoy = E3
ROM+DSP2 = F6

ROM Size:
00-07 = Invalid Size
08 = 2MBit
09 = 4MBit
0A = 8MBit
0B = 10/12/14MBit
0C = 24/32MBit
0D = 48/64MBit
0F-FF = Do not know any factory ROM with this size


SRAM Size:
NONE = 00
16KBit = 01
32KBit = 02
64KBit = 03
128KBit = 04
256KBit = 05


Country code list:
Japan (NTSC) = 00
USA (NTSC) = 01
Euro+Asia+Oceania (PAL) = 02
Sweden (PAL) = 03
Finland (PAL) = 04
Denmark (PAL) = 05
France (PAL) = 06
Holland (PAL) = 07
Spain (PAL) = 08
German+Austria (PAL) = 09
Italy (PAL) = 0A
Hong Kong (PAL) = 0B
Indonesia (PAL) = 0C
Korea (PAL) = 0D

Publisher (Only listing a few exmamples):
Acclaim = 33
Enix = B4
TAITO = C0
Square+Squaresoft = C3

The bits in bold may be of some use?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #933 on: December 23, 2014, 01:11:10 PM »
That's some interesting information there JCE. Do any of those 7FXX values actually correspond to these changes? Like for example, what will changing the country code of FFII do? Will it cause it to play at 30 FPS due to it being in PAL? And would changing the ROM type or size do anything now that the game has been compiled?

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,425
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Developing a comprehensive editor for FF4
« Reply #934 on: December 23, 2014, 01:43:52 PM »
That's some interesting information there JCE.

1. Do any of those 7FXX values actually correspond to these changes?

2. Like for example, what will changing the country code of FFII do?

3. Will it cause it to play at 30 FPS due to it being in PAL?

4. And would changing the ROM type or size do anything now that the game has been compiled?

1. Could you be more specific on this one?  I'm not understanding the question.  :(

2 & 3. Changing the country code alone doesn't change the 60hz NTSC output to 50hz PAL, there is another spot that is changed at though I'm not 100% sure where this is in FF4/FF2us.  I only dabbled with it on Terranigma. 

4. It is only an internal identifier though I haven't really played with this much.  I may run a test by expanding the ROM and repointing some data after 8MBit to see if the game/system actually uses this.  I guess one could change J2e's FF4 translation's ROM size byte (make it 4MBit for example) to find out since it is already expanded?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #935 on: December 23, 2014, 02:15:31 PM »
That's some interesting information there JCE.

1. Do any of those 7FXX values actually correspond to these changes?

2. Like for example, what will changing the country code of FFII do?

3. Will it cause it to play at 30 FPS due to it being in PAL?

4. And would changing the ROM type or size do anything now that the game has been compiled?

1. Could you be more specific on this one?  I'm not understanding the question.  :(

2 & 3. Changing the country code alone doesn't change the 60hz NTSC output to 50hz PAL, there is another spot that is changed at though I'm not 100% sure where this is in FF4/FF2us.  I only dabbled with it on Terranigma. 

4. It is only an internal identifier though I haven't really played with this much.  I may run a test by expanding the ROM and repointing some data after 8MBit to see if the game/system actually uses this.  I guess one could change J2e's FF4 translation's ROM size byte (make it 4MBit for example) to find out since it is already expanded?

Ah, yeah that's what I meant. I basically was curious to know if these internal identifiers actually had any function, you pretty much confirmed that they likely do not, but it will be curious to know.

And checked... yeah it's all internal identification, I did not know that companies were given their own identifier byte though, odd that they never thought they would reach above 255 game companies, hehe.

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,425
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Developing a comprehensive editor for FF4
« Reply #936 on: December 23, 2014, 02:32:04 PM »
The funny thing is why would these even be in there if the SNES console hardware doesn't use these to alter anything?  I do know that emulators read the SRAM size byte to generate SRAM.  I have tested that and successfully had each emulator generate different SRAM sizes.  Try altering FF4 to use 256KBit SRAM and you'll see a 32Kbyte SRAM file get generated.  The puzzling thing is $60 is the byte that gets generated past $2000 when FF4 saves the data in to SRAM.  This makes me wonder if the remaining 224Kbytes can be used for other things in RAM. 

Anyone?

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #937 on: December 23, 2014, 03:21:56 PM »
I got it! There was a messed up loop index. Anyway the fixed version is uploaded.

I should take a stab with Geiger's to find whether the game uses a table or some other math formula to locate those base addresses so we can find the others.

Would be much appreciated  :wink:

Unrelated question, is the way spell animations are stored well known?  I have done a bit of deciphering on them, and want to know if it would be new useful information to post what I have.  It might be lengthy..

That would also be quite awesome! Not sure how long it'll be before I get to doing spell animation previews but it is on my list of things I'd love to see FF4kster capable of one day.

The bits in bold may be of some use?

In terms of FF4kster becoming compatible with other versions of FF4 I assume this is for? If so, being able to detect the version of the ROM dynamically is certainly half the battle. The other half though is knowing what to do with that information; what are the differences between the versions in terms of where and how things are stored. If someone expands the ROM for example, it's great to be able to detect it, but at the same time, not much good unless I know how they've jiggered around the data...

On a tangential note - do you happen to know anything at all about world map graphics? Like, where the graphical data and/or tile assembly data are?

This is currently a huge glaring hole in the map-related portions of FF4kster. Having a functioning world map editor would just be the icing on the cake but from what I understand we're missing a few key components.
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,266
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #938 on: December 23, 2014, 06:30:35 PM »
The information about map formation data and how it's manipulated is documented. It works much like location map formation, with the exception of each map row being terminated with an FF.
Triggers also work pretty much the same, except they are stored in a different place  in ROM and treasure chests are not allowed.
I documented tile properties myself, I believe on on of your wishlist threads.

World map tile graphics are still a big mystery.

avalanche

  • Mom Bomb
  • *
  • Posts: 122
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #939 on: December 24, 2014, 12:15:34 AM »
World map tile graphics are still a big mystery.

Challenge Accepted.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,266
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #940 on: December 24, 2014, 12:59:17 AM »
Challenge Accepted.
chillyfeez likes this

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #941 on: December 24, 2014, 05:56:16 AM »
Another update: animated tiles now actually animate!!
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #942 on: December 24, 2014, 09:48:34 AM »
Not only do tiles now animate (or at least appear correctly) you've also enabled tile editing in full! This makes things Much easier for me, all in all another fantastic update PinkPuff!

avalanche

  • Mom Bomb
  • *
  • Posts: 122
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #943 on: December 24, 2014, 11:10:22 AM »
Another update: animated tiles now actually animate!!

Congrats! I'm glad my first post was of some help! (I have to enjoy that one as much as I can because the overworld map graphics might not work out so well)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #944 on: December 24, 2014, 02:49:23 PM »
Avalanche, have you seen the old World Map Editor that Yousei made (for 1.0 only, bah)? Maybe you could find something to help you out there.