1468
« on: 2002-11-26 06:07:47 »
I've a few additions to the Griever save file format (ala PSX) it should be relatively easy to migrate to the PC (minor changes).
#ifndef _FF8_
#define _FF8_
#include <vcl.h>
/////////////////////////////////////////////////////////////////
// Final Fantasy VIII codes
// If you can find a way to make the enum 1 byte in size, uncomment
/*
enum FF8CHARID {
Squall,
Zell,
Irvine,
Quistis,
Rinoa,
Selphie,
Seifer,
Edea,
Laguna,
_zz1,
_zz2,
_blank,
Griever,
MiniMog,
Chicobo,
Angelo,
None = 0xFF
};
*/
#define CHAR_SQUALL 0
#define CHAR_ZELL 1
#define CHAR_IRVINE 2
#define CHAR_QUISTIS 3
#define CHAR_RINOA 4
#define CHAR_SELPHIE 5
#define CHAR_SEIFER 6
#define CHAR_EDEA 7
#define CHAR_LAGUNA 8
#define CHAR_KIROS 9
#define CHAR_WARD 10
#define CHAR_GRIEVER 12
#define CHAR_MINIMOG 13
#define CHAR_CHICOBO 14
#define CHAR_ANGELO 15
#define CHAR_NONE 0xFF
typedef BYTE FF8CHARID;
//#define FF8CHARID BYTE
//#define BYTE unsigned char
struct _FF8ITEM {
BYTE type;
char *name;
};
struct _FF8ABILITY {
BYTE type;
BYTE ap;
char *name;
};
struct _FF8MAGIC {
char *name;
};
#define CARD(t,l,r,b) { 0x##t,0x##l,0x##r,0x##b }
#define NONE -1
#define FIRE 0
#define ICE 1
#define THUNDER 2
#define EARTH 3
#define POISON 4
#define WIND 5
#define WATER 6
#define HOLY 7
#define SIMPLE 0
#define BOSS 1
#define GF 2
#define PLAYER 3
struct _FF8CARD {
char *name;
struct _FF8CARDVALUES {
char top;
char left;
char right;
char bottom;
} values;
char element;
char border;
};
struct _FF8CARDLOCATION {
char *name;
};
struct _FF8LOCATION {
char *name;
};
typedef BYTE _FF8INNATEABILITY;
/////////////////////////////////////////////////////////////////
// Final Fantasy VIII item/magic/ability lists
#define LOCCOUNT 200
extern _FF8ITEM dbItems[200];
extern _FF8ABILITY dbAbilities[120];
extern _FF8MAGIC dbMagic[60];
extern _FF8CARD dbCards[110];
extern _FF8CARDLOCATION dbCardLocations[256];
extern _FF8LOCATION dbLocations[LOCCOUNT];
extern _FF8INNATEABILITY dbInnateAbilities[16][21];
extern char *dbJuncNames[];
extern char *dbWeapons[];
extern int const GF_Level[16];
/////////////////////////////////////////////////////////////////
// Final Fantasy VIII save file structures
// Unknown data
struct UNKNOWN {
UNKNOWN () { data = 0xFF; }
BYTE data;
};
// FF8 text identifier
typedef char FF8STR;
// Save file description block
struct FF8DESC {
USHORT checktag; // Tag - must be 0x0FF8
USHORT location; // Current location
UNKNOWN zz0[4];
USHORT saves; // Number of saves
UINT gil; // Gil
UINT seconds; // Game time
BYTE level; // Lead character's level
FF8CHARID party[3]; // [3] Current party
};
// Guardian Force block
struct FF8GF {
FF8STR name[12]; // [10] GF name
//UNKNOWN zz1[2];
UINT exp; // GF EXP
UNKNOWN zz2;
BYTE found; // Has GF been found?
USHORT hp; // Current HP
BYTE abilities[16]; // [16] Learned abilities (bLearned[i] = abilities[i/8] & (1 << (i%8)))
BYTE ap[21]; // [21] Ability APs
UNKNOWN zz3[3];
USHORT kills; // Number of enemies killed
USHORT ko; // Number of KOs
BYTE learning; // Ability being learnt
BYTE forgotten[3]; // Abilities forgotten
};
// Magic block
struct FF8MAGIC {
BYTE type;
BYTE amount;
};
// Character block
struct FF8CHAR {
USHORT hp; // Current HP
USHORT basehp; // Base HP
UINT exp; // EXP
FF8CHARID id; // Character id
BYTE weapon; // Current weapon
BYTE str; // Strength
BYTE vit; // Vitality
BYTE mag; // Magic
BYTE spr; // Spr
BYTE spd; // Speed
BYTE luck; // Luck
FF8MAGIC magic[32]; // [32] Magic library (stock)
BYTE ab_command[3]; // [3] Command abilities
UNKNOWN zz;
BYTE ab_char[4]; // [4] Character abilities
USHORT gf; // Junctioned GFs
UNKNOWN zz2[2];
BYTE junction[19]; // [19] Junctions
// 00: HP Junction (Magic Type)
// 01: Str Junction (Magic Type)
// 02: Vit Junction (Magic Type)
// 03: Mag Junction (Magic Type)
// 04: Spr Junction (Magic Type)
// 05: Spd Junction (Magic Type)
// 06: Hit Junction (Magic Type)
// 07: Eva Junction (Magic Type)
// 08: Luck Junction (Magic Type)
// 09: Elem-Atk Junction (Magic Type)
// 10: ST-Atk Junction (Magic Type)
// 11: Elem-Def Junction 1 (Magic Type)
// 12: Elem-Def Junction 2 (Magic Type)
// 13: Elem-Def Junction 3 (Magic Type)
// 14: Elem-Def Junction 4 (Magic Type)
// 15: ST-Def Junction 1 (Magic Type)
// 16: ST-Def Junction 2 (Magic Type)
// 17: ST-Def Junction 3 (Magic Type)
// 18: ST-Def Junction 4 (Magic Type)
UNKNOWN zz3;
USHORT compat[16]; // [16] GF compatibility
USHORT kills; // Number of enemies killed
USHORT ko; // Number of KOs
BYTE stats; // Battle metere stats?
UNKNOWN zz4;
USHORT status; // Status effects
// 1: ?Death?
// 2: Poison
// 4: Petrify
// 8: Darkness
// 16: Silence
// 32: Berserk
// 64: Zombie
// 128: ?Sleep?
// 256: ?Slow?
// 512: ?Stop?
//1024: ?Curse?
//2048: ?Confuse?
//4096: ?Drain?
//UNKNOWN zz5;
};
// Item block
struct FF8ITEM {
BYTE type;
BYTE amount;
};
// Card identifier
typedef BYTE FF8CARD; // 0x80: Collected 0x7F: Amount
// Rare cards: Location
struct FF8CONFIG {
BYTE spd_battle; // Battle speed (0=fast,4=slow)
BYTE spd_battlemsg; // Battle message speed (0=fast,4=slow)
BYTE spd_fieldmsg; // Field message speed (0=fast,4=slow)
BYTE soundvolume; // Sound volume (0-100(%))
BYTE options; // Misc. options
// 1: ATB - 1:Wait 0:Active
// 2: ??? 0:Stereo 1: Mono
// 4: Cursor - 1:Memory 0:Initial
// 8: ???
// 16: ???
// 32: Controller - 1:Customize 0:Normal
// 64: ???
// 128: ???
BYTE scan; // 1: Scan - 1:Always 0:Once
BYTE camera; // Camera movement (0=100%,4=0%)
UNKNOWN zz1;
UNKNOWN buttons[12]; // [12] Button configuration (?)
};
// Chocobo World data
struct FF8CHOCOBO {
UNKNOWN zz[64];
};
// limit structure
struct FF8LMT
{
unsigned short Quistis;
unsigned short Zell;
BYTE Irvine;
BYTE Selphie;
};
// Save file block
struct FF8BLOCK {
UNKNOWN zz1[384];
USHORT checksum1; // Checksum
FF8DESC desc; // Save block description
FF8STR squall[12]; // [12] Squall's name
FF8STR rinoa[12]; // [12] Rinoa's name
FF8STR angelo[12]; // [8] Angelo's name
FF8STR chicobo[12]; // [4] Chicobo's name
BYTE disc; // Current disc (zero based)
UNKNOWN zz[3];
UINT saves; // Number of times saved (*2?)
FF8GF gf[16]; // [16] GF blocks
FF8CHAR chars[8]; // [8] Character blocks
// 0 - Squall
// 1 - Zell
// 2 - Irvine
// 3 - Quistis
// 4 - Rinoa
// 5 - Selphie
// 6 - Siefer
// 7 - Edea
UNKNOWN zz2[400];
FF8CONFIG config; // Configuration
FF8CHARID party[3]; // [3] Party
UNKNOWN zz22[5];
FF8STR griever[12]; // [8] Griever's name
UNKNOWN zz23[4];
UINT gil; // Gil
UNKNOWN zz24[4];
FF8LMT limits;
// BYTE limits[6]; // [6] Learned limit breaks
// [0]-[1] Quistis
// [2]-[3] Zell
// [4] Irvine
// [5] Selphie
BYTE combine_compl; // Rinoa's Combine: Angelo Abilities Completed
BYTE combine_known; // Rinoa's Combine: Angelo Abilities Known
BYTE combine_left[8]; // [8] Rinoa's Combine: Points left to learn different abilities
// [0] 'Angelo Rush' (max 10)
// [1] 'Angelo Recover' (max 30)
// [2] 'Angelo Reverse' (max 40)
// [3] 'Angelo Search' (max 60)
// [4] 'Angelo Cannon' (max 80)
// [5] 'Angelo Strike' (max 120)
// [6] 'Invincible Moon' (max 140)
// [7] 'Wishing Star' (max 160)
BYTE b_items[32]; // [32] Order of battle items
FF8ITEM items[198]; // [198] Items
UINT seconds; // Game time
UNKNOWN zz28[8];
UINT battleswon; // Number of battles won
UNKNOWN zz29[2];
USHORT battlesescaped; // Number of battles escaped
UNKNOWN zz30[60];
BYTE limit_options; // Limit break options (1:Renzokuken Auto, 2:Duel Auto)
BYTE limit_indicator; // Renzokuken indicator (128)
BYTE information0; // Bit 0 Party isolated / Dream world (1)
// Bit 1 Have Odin
// Bit 2 Have Phoenix
// Bit 3 Have Gilgamesh
// Bit 4 Rinoa can't summoon Angelo
// Bit 5 Rinoa can use Angle wings
// Bit 6 Unknown
// Bit 7 Unknown
BYTE information[9]; // [9] Information (bitmask)
// [0]1-8: Location information
// [2]1-8: Location information
// [3]1-4: Location information
// [3]5-8: Term information
// [4]1-8: Term information
// [5]1-6: Term information
// [5]7-8: People information
// [6]1-5: People information
// [6]6-8: Character reports
// [7]1-4: Character reports
// [8]3-3: Term information
// [8]4-6: Report information
UNKNOWN zz31;
BYTE gf_reports[3]; // [3] GF reports
UNKNOWN zz3[3];
BYTE testlevel; // Current written test level
UNKNOWN zz39[4];
FF8CHARID party_field[3]; // [3] Current field party ([0] = leader)
UNKNOWN zz395[7];
USHORT location; // Current location
USHORT location_last; // Last location (?)
UNKNOWN zz4[30];
UINT steps; // Number of steps taken
USHORT payslip; // Payslip steps
UNKNOWN zz5[6];
USHORT seedlevel; // SeeD Level
UNKNOWN zz55[66];
UNKNOWN zz550[2];
// USHORT location_last; // Last location ?
UNKNOWN zz551[186];
BYTE tt_rules[8]; // [8] Region game rules
BYTE tt_traderules[8]; // [8] Region trade rules
BYTE tt_lastrules[2]; // [2] Last game rules remembered ([1] = second to last)
BYTE tt_lastregion[2]; // [2] Last region remembered ([1] = second to last)
UNKNOWN zz555;
BYTE tt_currules; // Current game rule
BYTE tt_curtraderule; // Current trade rules
BYTE tt_cardqueen; // Card Queen's location
BYTE tt_traderating_region; // Region for trade rating
BYTE tt_traderating; // Trade rating
UNKNOWN zz6[1110];
FF8CARD cards[77]; // [77] Cards (bit 8=collected, bit 1-7=amount)
BYTE card_locations[33]; // [33] Card locations
BYTE cards_rare[5]; // [5] Rare cards found (bFound[i] = cardsfound[i/8] & (1 << (i%8)))
UNKNOWN zz7[9];
USHORT test1;
USHORT test2;
FF8CHOCOBO cw; // Chocobo World data
USHORT checksum2; // Checksum (identical to checksum1)
BYTE padding[2782]; // Padding, makes save block 8192 bytes
};
#endif
Have fun .. with this .. the changes are realtively small but make it easier to read. the information bit fields still have a way to go.. namely I have to go through the game and watch every tutorial and do everything in the game etc. (sigh).
Cyb