Final Fantasy IV Research & Development / Re: Developing a comprehensive editor for FF4
« on: December 20, 2014, 11:31:01 AM »As I mentioned last time, if bit 0 of byte 1 is on AND bit 5 of byte 0 is on, then it is animated. Then byte 0 which is normally the graphics tile index becomes instead:
byte 0: tt1MMMnn
tt: I think this may be speed or type of palette effect?
1: Indicates it is animated
MMM: Major index
nn: Minor index
I need to re-investigate the "tt" bits to see if that is what indicates the difference, I didn't take enough notes, but I seem to remember the palette effects might be indicated here.
Assuming it is of the 4-frame variety, the base graphics tile offset is major_index * 16 + minor_index. Each has 4 frames, which are always 4 tiles in stride no matter how many sub tiles of the 16x16 are animated. See the attached image for an example of the candle, clock, and torch tiles and note the green/blue arrows show the interleave. Those are simple in that all four subtiles of the 16x16 tiles are animated, so they are just packed together intuitively. In some other tilesets, only 1 or 2 of the subtiles of a tile are animated, and so they can interleave with totally unrelated tiles where there is room.
I wasn't able to determine how to correctly calculate the base address for these animated tiles, but they don't seem to be in the same place as the non-animated graphics. Now that I think of it, a read breakpoint in Geiger's might help. I manually located a few, so I'll just list them here.
#3 Castle Exterior: FBEC0
#4 Town: FC040
#5 House FC4C0
#6 Castle Interior: FC640
#14 Cave: FCF40