Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Final Fantasy I & II: Dawn of Souls/Notes

From Data Crystal
Jump to navigation Jump to search

Chip tiny.png The following article is a Notes Page for Final Fantasy I & II: Dawn of Souls.


Bitfields and IDs

Bitfields and IDs

FF1 Animation Scripting Format

FF1 Animation Script Commands

ROM Data Formats

Monsters

Monster Data Tables

0×1DE044 — 0×1DF8A3: Bestiary
0×223F4C — 0×2257AB: Monster Stats (mid-battle)
0×227054 — 0×2288B3: Monster Stats (battle start)
0×22A880 — 0×22C0DF: Check for Regenerating family; Load Morale when PCs Flee; awarding XP/Gil/item drops on death
32*195

All four tables are identical in and of themselves.

0x00-01: EXP given
0x02-03: Gil given
0x04-05: Max HP
0x06: Morale
0x07: AI Index (unused)
0x08: Evasion
0x09: Defence
0x0A: Number of hits
0x0B: Accuracy
0x0C: Attack
0x0D: Agility
0x0E: Intellect
0x0F: Critical Rate
0x10-11: Status Attack Element
0x12: Status Attack Ailment
0x13: Monster Family
0x14: Magic Defense
0x15: (Unused/Padding)
0x16-17: Elemental Weakness(es)
0x18-19: Elemental Resistance(s)
0x1A: Item Drop Type
0x1B: Dropped Item sub-ID
0x1C: Drop Chance (%)
0x1D-1F: (Unused/Padding)

Monster Attack Animation Table

0x223540 — 0x223603
1*195
0x00: Attack Animation ID - 0x2D

Monster AI Index Table

0x22F0B8 — 0x22F17A
1*195

Monster AI Definitions

0x22F17C — 0x22F5CB
16*69
0x00: Chance to cast a spell, out of 200; can't cast if Silenced
0x01: Chance to cast a monster ability, out of 128, if a spell wasn't cast
0x02-09: Spell queue. Each spell in the queue is cast in order. When an FF byte is reached, the queue loops
0x0A: FF terminator
0x0B-0E: Ability queue. Expressed as (Spell ID - 0x41), so Icestorm 1 is the first legal ability
0x0F: FF terminator

Monster GFX Pointer Table

0x2227DC — 0x2230FF
12*195
0x0: Palette Pointer
0x4: Tile Arrangement Data Pointer
0x8: Monster tile Data Pointer

Monster Size Table

0x223644 — 0x223706
1*195
0x00: Monster Size
 $00: Small (eg Goblin)
 $01: Big (eg Troll)
 $02: Fiend/Chaos
 $03: Soul of Chaos Boss

TSA/Tile Arrangement

All TSA data begins with a 12-byte header.

Bytes +$4-$5 indicate how many TSA tiles are in this TSA structure.
Byte +$6 indicates how large each TSA tile is in bytes by indexing to a table at 0x81AE280
Other values in the header are of unknown use.

Each TSA tile follows the usual GBA format for TSA:

Each TSA tile is two bytes; top nybble is palette ID; next two bits define flips:
+ 400   horizontal flip
+ 800   vertical flip
The remaining 10 bits index to the 8x8 tile graphics found in raw GFX data.

TSA in maps

All tiles in maps in Final Fantasy 1 are in units of 16x16 tiles. To construct these tiles, the game assembles two layers of 8x8 physical tiles, one for a background and the other for a foreground.

When given a Tile ID:

Take low 4 bits, multiply by 4
Take upper 12 bits, multiply by 256
Add together, add to TSA tile pointer
If map type is 0x1 and you're outside a room, add (0x1000); save result in r12
   This way, if you're in a room or not you'll load different GFX
load [r12], [r12+2] (top left/right of tile)
load [r12+0x80], [r12+0x82] (bottom left/right of tile)
Storing to tile map as 'background' tiles
load [r12+0x40], [r12+0x42]
load [r12+0xC0], [r12+0xC2] - These are for the 'foreground' tiles