diff --git a/.gitignore b/.gitignore index 5104ee2..a985245 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ assets build .vscode +.idea tools/build diff --git a/include/ability.h b/include/ability.h index 675ea89..8831d3e 100644 --- a/include/ability.h +++ b/include/ability.h @@ -24,11 +24,11 @@ typedef struct { ASSERT_SIZE(AbilityData, 0x10); -extern AbilityData ABILITY_DATA[]; +extern AbilityData obAbilityData[]; -extern char *ability_get_name(u8 index); +extern char *obAbilityGetName(u8 index); extern u8 ability_get_field_0x4(u8 index); -extern Element ability_get_element(u8 index, u16 arg1, u16 arg2, s32 arg3, +extern Element obAbilityGetElement(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4); #endif // __ABILITY_H__ \ No newline at end of file diff --git a/include/common.h b/include/common.h index cd173da..1cacdfe 100644 --- a/include/common.h +++ b/include/common.h @@ -1,11 +1,41 @@ #ifndef __COMMON_H__ #define __COMMON_H__ -#include "PR/os.h" #include "include_asm.h" +#include "ultratypes.h" #include +typedef u8 qu08_t; +typedef u16 qu016_t; +typedef s16 qs48_t; +typedef s16 qs510_t; +typedef u16 qu510_t; +typedef u16 qs102_t; +typedef u16 qu102_t; +typedef s16 qs105_t; +typedef u16 qu105_t; +typedef s16 qs132_t; +typedef s16 qs142_t; +typedef s32 qs1516_t; +typedef s32 qs1616_t; +typedef s32 qs205_t; + +#define qu08(n) ((qu08_t)((n)*0x100)) +#define qu016(n) ((qu016_t)((n)*0x10000)) +#define qs48(n) ((qs48_t)((n)*0x0100)) +#define qs510(n) ((qs510_t)((n)*0x0400)) +#define qu510(n) ((qu510_t)((n)*0x0400)) +#define qs102(n) ((qs102_t)((n)*0x0004)) +#define qu102(n) ((qu102_t)((n)*0x0004)) +#define qs105(n) ((qs105_t)((n)*0x0020)) +#define qu105(n) ((qu105_t)((n)*0x0020)) +#define qs132(n) ((qs132_t)((n)*0x0004)) +#define qs142(n) ((qs142_t)((n)*0x0004)) +#define qs1516(n) ((qs1516_t)((n)*0x00010000)) +#define qs1616(n) ((qs1616_t)((n)*0x00010000)) +#define qs205(n) ((qs205_t)((n)*0x00000020)) + extern OSDevMgr __osPiDevMgr; extern OSPiHandle *__osCurrentHandle[2]; extern OSMesgQueue piEventQueue; @@ -31,9 +61,14 @@ typedef u8 bool; #define true 1 #define MAX_BYTES_TO_READ 512 - #define ARRAY_LENGTH(x) ((sizeof(x)) / (sizeof(x[0]))) +#define SCREEN_WIDTH_MIN 320 +#define SCREEN_HEIGHT_MIN 240 + +#define SCREEN_WIDTH_MAX 640 +#define SCREEN_HEIGHT_MAX 480 + #include "character.h" typedef struct { @@ -487,89 +522,27 @@ typedef struct { /* 0xb */ u8 field_0xb; } ItemData; // size:0xc -extern ItemData ITEM_DATA[45]; +extern ItemData obItemData[45]; -extern char *item_get_name(u16 arg0); +extern char *obItemGetName(u16 arg0); extern u8 item_get_field_0x4(u16 arg0); extern u8 item_get_field_0x5(u16 arg0); extern u8 item_get_field_0x8(u16 arg0); extern u8 item_get_field_0x9(u16 arg0); -void func_80179354(); /* extern */ +extern void func_80179354(); + extern Gfx* PTR_DISPLAY_LIST; -extern Gfx DISPLAY_LIST_80186310[]; -extern Gfx DISPLAY_LIST_80186330[]; -extern Gfx DISPLAY_LIST_80186320[]; -extern Gfx DISPLAY_LIST_80186358[]; -extern Gfx DP_FILL_RECT_639x479[]; -extern Gfx DL_DRAW_TEX_2560x1920[]; -extern Gfx DISPLAY_LIST_801869C8[]; -extern Gfx DISPLAY_LIST_80186BD0[]; -extern Gfx DISPLAY_LIST_80186D90[]; -extern Gfx DISPLAY_LIST_80186E70[]; -extern Gfx DISPLAY_LIST_800A9EF0[]; -extern Gfx DISPLAY_LIST_80186C60[]; -extern Gfx DISPLAY_LIST_80186D00[]; -extern Gfx DISPLAY_LIST_80186DD0[]; -extern Gfx DISPLAY_LIST_80186E20[]; -extern Gfx DISPLAY_LIST_800A96C8[]; -extern Gfx DISPLAY_LIST_800A9790[]; -extern Gfx DISPLAY_LIST_800A97C8[]; -extern Gfx DISPLAY_LIST_800A9810[]; -extern Gfx DISPLAY_LIST_8018FA70[]; extern Gfx DISPLAY_LIST_8018FC80[]; -extern Gfx DISPLAY_LIST_8018FD10[]; -extern Gfx DISPLAY_LIST_8018F3E0[]; -extern Gfx DISPLAY_LIST_801EABF0[]; -extern Gfx DISPLAY_LIST_801EAC40[]; -extern Gfx DISPLAY_LIST_801EB1D0[]; -extern Gfx DISPLAY_LIST_801ED650[]; -extern Gfx DISPLAY_LIST_801FD0E8[]; -extern Gfx DISPLAY_LIST_801FCF70[]; -extern Gfx DISPLAY_LIST_801FCF98[]; -extern Gfx DISPLAY_LIST_801FD280[]; -extern Gfx DISPLAY_LIST_801FD328[]; -extern Gfx DISPLAY_LIST_801FD3D0[]; -extern Gfx DISPLAY_LIST_801FD3E8[]; -extern Gfx DISPLAY_LIST_801FD400[]; -extern Gfx DISPLAY_LIST_801FD450[]; -extern Gfx DISPLAY_LIST_801FD4A0[]; -extern Gfx DISPLAY_LIST_801FD4F0[]; -extern Gfx DISPLAY_LIST_801FD598[]; -extern Gfx DISPLAY_LIST_801FD5B0[]; -extern Gfx DISPLAY_LIST_801FD640[]; -extern Gfx DISPLAY_LIST_801FD658[]; -extern Gfx DISPLAY_LIST_801FD6F8[]; -extern Gfx DISPLAY_LIST_801FD740[]; -extern Gfx DISPLAY_LIST_801FD7D0[]; -extern Gfx DISPLAY_LIST_801FD7E8[]; -extern Gfx DISPLAY_LIST_801FD878[]; -extern Gfx DISPLAY_LIST_80213648[]; -extern Gfx DISPLAY_LIST_8021F0C0[]; -extern Gfx DISPLAY_LIST_8021F108[]; -extern Gfx DISPLAY_LIST_80219C48[]; -extern Gfx DISPLAY_LIST_80219CD0[]; -extern Gfx DISPLAY_LIST_8021ABC0[]; -extern Gfx DISPLAY_LIST_8021ABE8[]; -extern Gfx DISPLAY_LIST_80216BF0[]; -extern Gfx DISPLAY_LIST_80216C70[]; -extern Gfx DISPLAY_LIST_80216F18[]; -extern Gfx DISPLAY_LIST_8021C6E0[]; -extern Gfx DISPLAY_LIST_8021C230[]; -extern Gfx DISPLAY_LIST_8021C568[]; -extern Gfx DISPLAY_LIST_8021C698[]; -extern Gfx DISPLAY_LIST_8022A0B0[]; -extern Gfx DISPLAY_LIST_8022A0D0[]; -extern Gfx DISPLAY_LIST_80229FB8[]; -extern Gfx DISPLAY_LIST_8022A030[]; -extern Gfx DISPLAY_LIST_8022A068[]; -extern Gfx DISPLAY_LIST_801B8218[]; -extern Gfx DISPLAY_LIST_801B8268[]; -extern Gfx DISPLAY_LIST_801B82B0[]; -extern Gfx DISPLAY_LIST_801B8308[]; -extern Gfx DISPLAY_LIST_801B8358[]; -extern Gfx DISPLAY_LIST_801B8388[]; + +extern Vp obVpMinResolution; +extern Vp obVpMaxResolution; + +extern Gfx obDlSetupMinResolution[]; +extern Gfx obDlSetupMaxResolution[]; + +extern Lights2 LIGHTS_801869A0; #endif \ No newline at end of file diff --git a/include/equipment.h b/include/equipment.h index 0d8b67c..bf321ee 100644 --- a/include/equipment.h +++ b/include/equipment.h @@ -74,32 +74,32 @@ typedef struct { ASSERT_SIZE(EquipmentData, 0x20); -extern char *EQUIPMENT_TYPE_NAMES[]; -extern EquipmentData EQUIPMENT_DATA[]; -extern s8 (*FP_EQUIPMENT_GET_RESISTANCE[])(EquipmentId index); +extern char *obEquipmentTypeName[]; +extern EquipmentData obEquipmentData[]; +extern s8 (*obEquipmentGetResistance[])(EquipmentId index); -extern char *equipment_get_name(EquipmentId index); -extern EquipmentType equipment_get_type(EquipmentId index); -extern Element equipment_get_element(EquipmentId index); +extern char *obEquipmentGetName(EquipmentId index); +extern EquipmentType obEquipmentGetType(EquipmentId index); +extern Element obEquipmentGetElement(EquipmentId index); extern u8 equipment_get_field_0x6(EquipmentId index); -extern u16 equipment_get_buy_price(EquipmentId index); +extern u16 obEquipmentGetBuyPrice(EquipmentId index); extern s8 equipment_get_field_0x10(EquipmentId index); -extern s8 equipment_get_strength(EquipmentId index); -extern s8 equipment_get_vitality(EquipmentId index); -extern s8 equipment_get_intelligence(EquipmentId index); -extern s8 equipment_get_mentality(EquipmentId index); -extern s8 equipment_get_agility(EquipmentId index); -extern s8 equipment_get_dexterity(EquipmentId index); +extern s8 obEquipmentGetStrength(EquipmentId index); +extern s8 obEquipmentGetVitality(EquipmentId index); +extern s8 obEquipmentGetIntelligence(EquipmentId index); +extern s8 obEquipmentGetMentality(EquipmentId index); +extern s8 obEquipmentGetAgility(EquipmentId index); +extern s8 obEquipmentGetDexterity(EquipmentId index); -extern s8 equipment_get_resistance_strike(EquipmentId index); -extern s8 equipment_get_resistance_wind(EquipmentId index); -extern s8 equipment_get_resistance_fire(EquipmentId index); -extern s8 equipment_get_resistance_earth(EquipmentId index); -extern s8 equipment_get_resistance_water(EquipmentId index); -extern s8 equipment_get_resistance_holy(EquipmentId index); -extern s8 equipment_get_resistance_dark(EquipmentId index); +extern s8 obEquipmentGetResistanceStrike(EquipmentId index); +extern s8 obEquipmentGetResistanceWind(EquipmentId index); +extern s8 obEquipmentGetResistanceFire(EquipmentId index); +extern s8 obEquipmentGetResistanceEarth(EquipmentId index); +extern s8 obEquipmentGetResistanceWater(EquipmentId index); +extern s8 obEquipmentGetResistanceVirtue(EquipmentId index); +extern s8 obEquipmentGetResistanceBane(EquipmentId index); extern u8 equipment_get_field_0x18_b68(EquipmentId index); extern u8 equipment_get_field_0x18_b46(EquipmentId index); @@ -113,12 +113,12 @@ extern u8 equipment_get_field_0x19_b12(EquipmentId index); extern u8 equipment_get_field_0x1a_b7(EquipmentId index); -extern u8 equipment_is_weapon(EquipmentId index); -extern EquipmentId equipment_get_first_weapon(EquipmentId arg0, +extern u8 obEquipmentIsWeapon(EquipmentId index); +extern EquipmentId obEquipmentGetFirstWeapon(EquipmentId arg0, EquipmentId arg1, EquipmentId arg2, EquipmentId arg3); -extern EquipmentId equipment_get_first_spellbook(EquipmentId arg0, +extern EquipmentId obEquipmentGetFirstSpellbook(EquipmentId arg0, EquipmentId arg1, EquipmentId arg2, EquipmentId arg3); diff --git a/include/str_decorate.h b/include/str_decorate.h new file mode 100644 index 0000000..5516835 --- /dev/null +++ b/include/str_decorate.h @@ -0,0 +1,10 @@ +#ifndef __STR_DECORATE_H__ +#define __STR_DECORATE_H__ + +#define DECORATE(s) ("\x0E" s "\x0F"); +// Newline +#define NEWLINE "\x10" +// Indent string +#define INDENT "\x63" + +#endif // __STR_DECORATE_H__ \ No newline at end of file diff --git a/splat.yaml b/splat.yaml index 74df71e..7dbd0cf 100644 --- a/splat.yaml +++ b/splat.yaml @@ -459,17 +459,30 @@ segments: - [0x5C1D0, asm] - [0x5C210, .data, "dl"] - - [0x5C220, .data, "dl"] - - [0x5C230, .data, "dl"] - - [0x5C280, .data, "dl"] - - [0x5C510, .data, "dl"] - - [0x5C8A0, data] - - [0x5CD70, data] + # - [0x5C220, data] + # - [0x5C230, data] + # - [0x5C280, data] + # - [0x5C510, data] + # - [0x5C8A0, data] + # - [0x5CAD0, data] + # - [0x5CB60, data] + # - [0x5CC00, data] + # - [0x5CC90, data] + # - [0x5CCD0, data] + # - [0x5CD20, data] + # - [0x5CD70, data] + + - [0x5CE70, .data, "strategy.data"] + - [0x5CEF0, data] - [0x5CF00, data] - [0x5CF20, data] - [0x5CF30, data] - - [0x5D560, data] + + - [0x5D560, .data, "5D560.data"] + # - [0x5D560, data] + # - [0x5D5C0, data] + - [0x5DB10, data] - [0x613B0, data] - [0x647F0, data] diff --git a/src/5C8A0.data.c b/src/5C8A0.data.c new file mode 100644 index 0000000..12ed0f0 --- /dev/null +++ b/src/5C8A0.data.c @@ -0,0 +1,86 @@ +#include "common.h" +#include "gbi.h" + +/* 5C8A0 801869A0 */ +Lights2 LIGHTS_801869A0 = gdSPDefLights2( + // ar, ag, ab + 5, 5, 5, + // r1, g1, b1 + 100, 100, 0, + // x1, y1, z1 + 32, 64, 32, + // r2, g2, b2 + 50, 50, 0x00, + // x2, y2, z2 + 15, 30, 100 +); + +extern u8 D_6000000; + +/* 5C8C8 801869C8 */ +Gfx DISPLAY_LIST_801869C8[] = { + gsDPPipeSync(), + gsDPPipeSync(), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPPipeSync(), + + gsSPViewport(&obVpMinResolution), + gsSPClearGeometryMode( + G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | + G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | + G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA + ), + gsSPTexture(0, 0, 0, G_TX_RENDERTILE, G_OFF), + gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH), + gsSPClipRatio(FRUSTRATIO_2), + gsSPFogPosition(900, 1000), + gsSPSetLights2(LIGHTS_801869A0), + gsDPPipeSync(), + {0xE3000800, 0x00000000}, + gsDPPipeSync(), + {0xED000000, 0x004FC3BC}, + gsDPPipeSync(), + {0xE3000F00, 0x00000000}, + {0xE3001001, 0x00000000}, + {0xE3000D01, 0x00000000}, + {0xE3000C00, 0x00080000}, + {0xE3001201, 0x00002000}, + {0xE3001402, 0x00000C00}, + {0xFCFFFFFF, 0xFFFE793C}, + {0xE3001700, 0x00000000}, + {0xE2001E01, 0x00000000}, + {0xE200001C, 0x0F0A4000}, + {0x00000000, 0x00000000}, + {0xE3001801, 0x00000000}, + {0xFB000000, 0x00000000}, + {0xFA000000, 0x00000000}, + {0xF9000000, 0x00000000}, + {0xF8000000, 0x00000000}, + {0xF7000000, 0x00000000}, + {0xEE000000, 0x00000000}, + {0xEC000000, 0x00000000}, + {0xEB000000, 0x00000000}, + {0xEA000000, 0x00000000}, + {0xF5100000, 0x00000000}, + {0xF5100000, 0x01000000}, + {0xF5100000, 0x02000000}, + {0xF5100000, 0x03000000}, + {0xF5100000, 0x04000000}, + {0xF5100000, 0x05000000}, + {0xF5100000, 0x6000000}, + {0xF5100000, 0x07000000}, + + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0, 0), + + {0xF2000000, 0x01000000}, + {0xF2000000, 0x02000000}, + {0xF2000000, 0x03000000}, + {0xF2000000, 0x04000000}, + {0xF2000000, 0x05000000}, + + gsDPSetTileSize(6, 0, 0, 0, 0), + gsDPSetTileSize(G_TX_LOADTILE, 0, 0, 0, 0), + gsSPSetLights2(LIGHTS_801869A0), + gsDPPipeSync(), + gsSPEndDisplayList(), +}; \ No newline at end of file diff --git a/src/5D560.data.c b/src/5D560.data.c new file mode 100644 index 0000000..986f05d --- /dev/null +++ b/src/5D560.data.c @@ -0,0 +1,254 @@ +#include "common.h" + +#include "str_decorate.h" + +/* 5D560 80187660 */ +char obElementNamePhysical[] = "Physical"; +/* 5D56C 8018766C */ +char obElementNameWind[] = "Wind"; +/* 5D574 80187674 */ +char obElementNameFlame[] = "Flame"; +/* 5D57C 8018767C */ +char obElementNameEarth[] = "Earth"; +/* 5D584 80187684 */ +char obElementNameWater[] = "Water"; +/* 5D58C 8018768C */ +char obElementNameVirtue[] = "Virtue"; +/* 5D594 80187694 */ +char obElementNameBane[] = "Bane"; +/* 5D59C 8018769C */ +char obElementNameDrakonite[] = "Drakonite"; +/* 5D5A8 801876A8 */ +char obElementNameVariable[] = "Variable"; +/* 5D5B4 801876B4 */ +char obElementNameWindFlame[] = "Wind+Flame"; +/* 5D5C0 801876C0 */ +char obElementNameFlameWind[] = "Flame+Wind"; +/* 5D5CC 801876CC */ +char obElementNameEarthFlame[] = "Earth+Flame"; +/* 5D5D8 801876D8 */ +char obElementNameWaterEarth[] = "Water+Earth"; +/* 5D5E4 801876E4 */ +char obElementNameWindBane[] = "Wind+Bane"; +/* 5D5F0 801876F0 */ +char obElementNameFlameBane[] = "Flame+Bane"; + +/* 5D5FC 801876FC */ +char obAbilityNameThrust[] = "Thrust"; +/* 5D604 80187704 */ +char obAbilityNamePeck[] = "Peck"; +/* 5D60C 8018770C */ +char obAbilityNamePierce[] = "Pierce"; +/* 5D614 80187714 */ +char obAbilityNameSlash[] = "Slash"; +/* 5D61C 8018771C */ +char obAbilityNameCleave[] = "Cleave"; +/* 5D624 80187724 */ +char obAbilityNameRend[] = "Rend"; +/* 5D62C 8018772C */ +char obAbilityNameClaw[] = "Claw"; +/* 5D634 80187734 */ +char obAbilityNameBite[] = "Bite"; +/* 5D63C 8018773C */ +char obAbilityNameStrike[] = "Strike"; +/* 5D644 80187744 */ +char obAbilityNameCrush[] = "Crush"; +/* 5D64C 8018774C */ +char obAbilityNameSmash[] = "Smash"; +/* 5D654 80187754 */ +char obAbilityNameLash[] = "Lash"; +/* 5D65C 8018775C */ +char obAbilityNamePullStrings[] = "Pull Strings"; +/* 5D66C 8018776C */ +char obAbilityNameShoot[] = "Shoot"; +/* 5D674 80187774 */ +char obAbilityNameTakeAPeek[] = "Take a Peek"; +/* 5D680 80187780 */ +char obAbilityNameFlipOver[] = "Flip Over"; +/* 5D68C 8018778C */ +char obAbilityNameSonicBoom[] = "Sonic Boom"; +/* 5D698 80187798 */ +char obAbilityNameWindShot[] = "Wind Shot"; +/* 5D6A4 801877A4 */ +char obAbilityNameThunderArrow[] = DECORATE("Thunder" NEWLINE INDENT "Arrow"); +/* 5D6B8 801877B8 */ +char obAbilityNameWindStorm[] = "Wind Storm"; +/* 5D6C4 801877C4 */ +char obAbilityNameMesmerize[] = "Mesmerize"; +/* 5D6D0 801877D0 */ +char obAbilityNameLifeDrain[] = "Life Drain"; +/* 5D6DC 801877DC */ +char obAbilityNameThrowAKiss[] = "Throw a Kiss"; +/* 5D6EC 801877EC */ +char obAbilityNameGazeOfTerror[] = DECORATE("Gaze of" NEWLINE INDENT "Terror"); +/* 5D700 80187800 */ +char obAbilityNamePumpkinSmash[] = "Pumpkin Smash"; +/* 5D710 80187810 */ +char obAbilityNamePumpkinShower[] = DECORATE("Pumpkin" NEWLINE INDENT "Shower"); +/* 5D724 80187824 */ +char obAbilityNameBanish[] = "Banish"; +/* 5D72C 8018782C */ +char obAbilityNameJihad[] = "Jihad"; +/* 5D734 80187834 */ +char obAbilityNameMagicMissile[] = "Magic Missile"; +/* 5D744 80187844 */ +char obAbilityNameAbyss[] = "Abyss"; +/* 5D74C 8018784C */ +char obAbilityNameLightningBreath[] = DECORATE("Lightning" NEWLINE INDENT "Breath"); +/* 5D760 80187860 */ +char obAbilityNameFireBreath[] = "Fire Breath"; +/* 5D76C 8018786C */ +char obAbilityNameAcidBreath[] = "Acid Breath"; +/* 5D778 80187878 */ +char obAbilityNameBreathOfCold[] = "Breath of Cold"; +/* 5D788 80187888 */ +char obAbilityNameSacredBreath[] = "Sacred Breath"; +/* 5D798 80187898 */ +char obAbilityNameRottenBreath[] = "Rotten Breath"; +/* 5D7A8 801878A8 */ +char obAbilityNamePetrify[] = "Petrify"; +/* 5D7B0 801878B0 */ +char obAbilityNameRadiantGale[] = "Radiant Gale"; +/* 5D7C0 801878C0 */ +char obAbilityNameCrimsonNote[] = "Crimson Note"; +/* 5D7D0 801878D0 */ +char obAbilityNameEarthquake[] = "Earthquake"; +/* 5D7DC 801878DC */ +char obAbilityNameClearDisaster[] = DECORATE("Clear" NEWLINE INDENT "Disaster"); +/* 5D7F0 801878F0 */ +char obAbilityNameDivineRay[] = "Divine Ray"; +/* 5D7FC 801878FC */ +char obAbilityNameEvilDead[] = "Evil Dead"; +/* 5D808 80187908 */ +char obAbilityNameEvocation[] = "Evocation"; +/* 5D814 80187914 */ +char obAbilityNameNinjaArt[] = "Ninja Art"; +/* 5D820 80187920 */ +char obAbilityNameLightning[] = "Lightning"; +/* 5D82C 8018792C */ +char obAbilityNameThunderFlare[] = "Thunder Flare"; +/* 5D83C 8018793C */ +char obAbilityNameShockBolt[] = "Shock Bolt"; +/* 5D848 80187948 */ +char obAbilityNameThunderbird[] = "Thunderbird"; +/* 5D854 80187954 */ +char obAbilityNameFireball[] = "Fireball"; +/* 5D860 80187960 */ +char obAbilityNameFireStorm[] = "Fire Storm"; +/* 5D86C 8018796C */ +char obAbilityNameRayOfParalysis[] = DECORATE("Ray of" NEWLINE INDENT "Paralysis"); +/* 5D880 80187980 */ +char obAbilityNameSalamander[] = "Salamander"; +/* 5D88C 8018798C */ +char obAbilityNameAcidVapor[] = "Acid Vapor"; +/* 5D898 80187998 */ +char obAbilityNameCragPress[] = "Crag Press"; +/* 5D8A4 801879A4 */ +char obAbilityNamePoisonCloud[] = "Poison Cloud"; +/* 5D8B4 801879B4 */ +char obAbilityNameGnome[] = "Gnome"; +/* 5D8BC 801879BC */ +char obAbilityNameIceBlast[] = "Ice Blast"; +/* 5D8C8 801879C8 */ +char obAbilityNameIceField[] = "Ice Field"; +/* 5D8D4 801879D4 */ +char obAbilityNameSlumberMist[] = "Slumber Mist"; +/* 5D8E4 801879E4 */ +char obAbilityNameFenrir[] = "Fenrir"; +/* 5D8EC 801879EC */ +char obAbilityNameHealing[] = "Healing"; +/* 5D8F4 801879F4 */ +char obAbilityNameHealingPlus[] = "Healing Plus"; +/* 5D904 80187A04 */ +char obAbilityNameWordOfPain[] = "Word of Pain"; +/* 5D914 80187A14 */ +char obAbilityNameDarkQuest[] = "Dark Quest"; +/* 5D920 80187A20 */ +char obAbilityNameNightmare[] = "Nightmare"; +/* 5D92C 80187A2C */ +char obAbilityNameDarkLore[] = "Dark Lore"; +/* 5D938 80187A38 */ +char obAbilityNameTempest[] = "Tempest"; +/* 5D940 80187A40 */ +char obAbilityNameAnnihilation[] = "Annihilation"; +/* 5D950 80187A50 */ +char obAbilityNameMeteorStrike[] = "Meteor Strike"; +/* 5D960 80187A60 */ +char obAbilityNameWhiteMute[] = "White Mute"; +/* 5D96C 80187A6C */ +char obAbilityNameIonosphere[] = "Ionosphere"; +/* 5D978 80187A78 */ +char obAbilityNameAtmosphere[] = "Atmosphere"; +/* 5D984 80187A84 */ +char obAbilityNameDeepSleep[] = "Deep Sleep"; +/* 5D990 80187A90 */ +char obAbilityNamePlasmaBall[] = "Plasma Ball"; +/* 5D99C 80187A9C */ +char obAbilityNamePlasmaStorm[] = "Plasma Storm"; +/* 5D9AC 80187AAC */ +char obAbilityNameBindFlare[] = "Bind Flare"; +/* 5D9B8 80187AB8 */ +char obAbilityNameLavaShot[] = "Lava Shot"; +/* 5D9C4 80187AC4 */ +char obAbilityNameLavaFlow[] = "Lava Flow"; +/* 5D9D0 80187AD0 */ +char obAbilityNamePoisonPlant[] = "Poison Plant"; +/* 5D9E0 80187AE0 */ +char obAbilityNameClayAssault[] = "Clay Assault"; +/* 5D9F0 80187AF0 */ +char obAbilityNameBlueSpiral[] = "Blue Spiral"; +/* 5D9FC 80187AFC */ +char obAbilityNamePoisonLime[] = "Poison Lime"; +/* 5DA08 80187B08 */ +char obAbilityNameInfest[] = "Infest"; +/* 5DA10 80187B10 */ +char obAbilityNameInferno[] = "Inferno"; +/* 5DA18 80187B18 */ +char obAbilityNameBlackBreeze[] = "Black Breeze"; +/* 5DA28 80187B28 */ +char obAbilityNameDarkBlaze[] = "Dark Blaze"; +/* 5DA34 80187B34 */ +char obAbilityNameDarkFlame[] = "Dark Flame"; +/* 5DA40 80187B40 */ +char obAbilityNameDoom[] = "Doom"; +/* 5DA48 80187B48 */ +char obAbilityNameSonicBlast[] = "Sonic Blast"; +/* 5DA54 80187B54 */ +char obAbilityNameWindBlast[] = "Wind Blast"; +/* 5DA60 80187B60 */ +char obAbilityNameFireBlast[] = "Fire Blast"; +/* 5DA6C 80187B6C */ +char obAbilityNameEarthBlast[] = "Earth Blast"; +/* 5DA78 80187B78 */ +char obAbilityNameAquaBlast[] = "Aqua Blast"; +/* 5DA84 80187B84 */ +char obAbilityNameHolyBlast[] = "Holy Blast"; +/* 5DA90 80187B90 */ +char obAbilityNameDarkBlast[] = "Dark Blast"; +/* 5DA9C 80187B9C */ +char obAbilityNameSonicBlade[] = "Sonic Blade"; +/* 5DAA8 80187BA8 */ +char obAbilityNameIgnisFatuus[] = "Ignis Fatuus"; +/* 5DAB8 80187BB8 */ +char obAbilityNameMirageSlash[] = "Mirage Slash"; +/* 5DAC8 80187BC8 */ +char obAbilityNameFatalDance[] = "Fatal Dance"; + +/* 5DAD4 80187BD4 */ +char* obElementName[] = { + obElementNamePhysical, + obElementNameWind, + obElementNameFlame, + obElementNameEarth, + obElementNameWater, + obElementNameVirtue, + obElementNameBane, + obElementNameDrakonite, + obElementNameVariable, + obElementNameWindFlame, + obElementNameFlameWind, + obElementNameEarthFlame, + obElementNameWaterEarth, + obElementNameWindBane, + obElementNameFlameBane +}; \ No newline at end of file diff --git a/src/ability.c b/src/ability.c index c71ee64..e6a2c3b 100644 --- a/src/ability.c +++ b/src/ability.c @@ -5,32 +5,32 @@ #include "class.h" /* 44340 8016E440 */ -char* ability_get_name(u8 index) { - return ABILITY_DATA[index].name; +char* obAbilityGetName(u8 index) { + return obAbilityData[index].name; } /* 44358 8016E458 */ u8 ability_get_field_0x4(u8 index) { - return ABILITY_DATA[index].field_0x4; + return obAbilityData[index].field_0x4; } /* 44370 8016E470 */ -Element ability_get_element(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4) { +Element obAbilityGetElement(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4) { u16 item_index; - if (ABILITY_DATA[index].element != ELEMENT_INVALID && ABILITY_DATA[index].element != 0xF) - return ABILITY_DATA[index].element; + if (obAbilityData[index].element != ELEMENT_INVALID && obAbilityData[index].element != 0xF) + return obAbilityData[index].element; - if (ABILITY_DATA[index].field_0x4 == 3) { - item_index = equipment_get_first_spellbook(arg1, arg2, arg3, arg4); + if (obAbilityData[index].field_0x4 == 3) { + item_index = obEquipmentGetFirstSpellbook(arg1, arg2, arg3, arg4); } else { - item_index = equipment_get_first_weapon(arg1, arg2, arg3, arg4); + item_index = obEquipmentGetFirstWeapon(arg1, arg2, arg3, arg4); } if (item_index == 0) return ELEMENT_PHYSICAL; - return equipment_get_element(item_index); + return obEquipmentGetElement(item_index); } @@ -88,27 +88,27 @@ INCLUDE_ASM(const s32, "ability", __character_handle_levelup); INCLUDE_ASM(const s32, "ability", __character_initialise); /* 453E0 8016F4E0 */ -char *item_get_name(u16 arg0) { - return ITEM_DATA[arg0].name; +char *obItemGetName(u16 arg0) { + return obItemData[arg0].name; } /* 45400 8016F500 */ u8 item_get_field_0x4(u16 arg0) { - return ITEM_DATA[arg0].field_0x4; + return obItemData[arg0].field_0x4; } /* 45420 8016F520 */ u8 item_get_field_0x5(u16 arg0) { - return ITEM_DATA[arg0].field_0x5; + return obItemData[arg0].field_0x5; } /* 45440 8016F540 */ u8 item_get_field_0x8(u16 arg0) { - return ITEM_DATA[arg0].field_0x8; + return obItemData[arg0].field_0x8; } /* 45460 8016F560 */ u8 item_get_field_0x9(u16 arg0) { - return ITEM_DATA[arg0].field_0x9; + return obItemData[arg0].field_0x9; } diff --git a/src/class.c b/src/class.c index e989de9..3eb4f70 100644 --- a/src/class.c +++ b/src/class.c @@ -202,14 +202,14 @@ char* class_get_ability_front_name(u8 portrait, u8 class) { var_v0 = CLASS_DATA[class].ability_front; } - return ability_get_name(var_v0); + return obAbilityGetName(var_v0); } /* 44040 8016E140 */ char* class_get_ability_middle_name(u8 portrait, u8 class) { // Possible a C macro wrapping? do { - char* ret = ability_get_name(CLASS_DATA[class].ability_middle); + char* ret = obAbilityGetName(CLASS_DATA[class].ability_middle); return ret; } while(0); } @@ -224,7 +224,7 @@ char* class_get_ability_back_name(u8 portrait, u8 class) { var_v0 = CLASS_DATA[class].ability_back; } - return ability_get_name(var_v0); + return obAbilityGetName(var_v0); } /* 440DC 8016E1DC */ diff --git a/src/dl.c b/src/dl.c index de3248b..3259c60 100644 --- a/src/dl.c +++ b/src/dl.c @@ -3,36 +3,39 @@ #include "common.h" /* 5C210 80186310 */ -Gfx DISPLAY_LIST_80186310[] = { - gsSPModifyVertex(240, 0x0080, 0x01FF0000), - gsSPModifyVertex(240, 0x0080, 0x01FF0000), +Vp obVpMinResolution = { + (SCREEN_WIDTH_MIN / 2) * 4, (SCREEN_HEIGHT_MIN / 2) * 4, 511, 0, + (SCREEN_WIDTH_MIN / 2) * 4, (SCREEN_HEIGHT_MIN / 2) * 4, 511, 0 }; - /* 5C220 80186320 */ -Gfx DISPLAY_LIST_80186320[] = { - // 0x050003C0, 0x01FF0000 - { 0x050003C0, 0x01FF0000 }, - // { _SHIFTL(G_TRI1, 24, 8) | 0x000003C0, __gsSP1Triangle_w1f(25.5, 0, 0, 1) }, - // 0x050003C0, 0x01FF0000 - { 0x050003C0, 0x01FF0000 }, - // { _SHIFTL(G_TRI1, 24, 8) | 0x000003C0, __gsSP1Triangle_w1f(25.5, 0, 0, 1) }, +Vp obVpMaxResolution = { + (SCREEN_WIDTH_MAX / 2) * 4, (SCREEN_HEIGHT_MAX / 2) * 4, 511, 0, + (SCREEN_WIDTH_MAX / 2) * 4, (SCREEN_HEIGHT_MAX / 2) * 4, 511, 0 }; /* 5C230 80186330 */ -Gfx DISPLAY_LIST_80186330[] = { - gsDma1p(G_MOVEMEM, DISPLAY_LIST_80186310, 8, 8), +Gfx obDlSetupMinResolution[] = { + gsSPViewport(&obVpMinResolution), gsDPPipeSync(), - gsDPSetScissorFrac(0, 0, 0, 1276, 956), + gsDPSetScissor( + G_SC_NON_INTERLACE, + 0, 0, + SCREEN_WIDTH_MIN - 1, SCREEN_HEIGHT_MIN - 1 + ), gsDPPipeSync(), gsSPEndDisplayList(), }; -/* 5C258 80186358 */ -Gfx DISPLAY_LIST_80186358[] = { - gsDma1p(G_MOVEMEM, DISPLAY_LIST_80186320, 8, 8), +// /* 5C258 80186358 */ +Gfx obDlSetupMaxResolution[] = { + gsSPViewport(&obVpMaxResolution), gsDPPipeSync(), - gsDPSetScissorFrac(0, 0, 0, 2560, 1920), + gsDPSetScissor( + G_SC_NON_INTERLACE, + 0, 0, + SCREEN_WIDTH_MAX, SCREEN_HEIGHT_MAX + ), gsDPPipeSync(), gsSPEndDisplayList(), }; @@ -209,34 +212,228 @@ Gfx DL_DRAW_TEX_2560x1920[] = { gsSPEndDisplayList(), }; -// /* 65970 8018FA70 */ -// const Gfx DISPLAY_LIST_8018FA70[] = { -// -// gsDPPipeSync(), -// -// gsDPPipeSync(), -// // 0xE3000A01, 0x00000000 -// gsSPSetOtherMode(G_SETOTHERMODE_H, 10, 1, 0x0), -// -// gsDPPipeSync(), -// // 0xD9000000, 0x00000000 -// { 0xD9000000, 0x00000000 }, -// // 0xD9FFFFFF, 0x00200404 -// { 0xD9FFFFFF, 0x00200404 }, -// // 0xE200001C, 0x0F0A4000 -// gsSPSetOtherMode(G_SETOTHERMODE_L, 0, 28, 0x0F0A4000), -// // 0xFC121824, 0xFF33FFFF -// gsDPSetCombine(0x121824,0xFF33FFFF), -// // 0xE3000C00, 0x00080000 -// gsSPSetOtherMode(G_SETOTHERMODE_H, 12, 0, 0x80000), -// // 0xE2001E01, 0x00000000 -// gsSPSetOtherMode(G_SETOTHERMODE_L, 30, 1, 0x0), -// // 0xDE000000, 0x80186330 -// gsSPDisplayList(0x80186330), -// // 0xD7000002, 0x80008000 -// gsSPTexture(0x8000, 0x8000, 0, 0, 2), -// -// gsDPPipeSync(), -// -// gsSPEndDisplayList(), -// }; \ No newline at end of file +/* 5C8A0 801869A0 */ +Lights2 LIGHTS_801869A0 = gdSPDefLights2( + // ar, ag, ab + 5, 5, 5, + // r1, g1, b1 + 100, 100, 0, + // x1, y1, z1 + 32, 64, 32, + // r2, g2, b2 + 50, 50, 0x00, + // x2, y2, z2 + 15, 30, 100 +); + +/* 5C8C8 801869C8 */ +Gfx DISPLAY_LIST_801869C8[] = { + gsDPPipeSync(), + gsDPPipeSync(), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPPipeSync(), + + gsSPViewport(&obVpMinResolution), + gsSPClearGeometryMode( + G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | + G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | + G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA + ), + gsSPTexture(0, 0, 0, G_TX_RENDERTILE, G_OFF), + gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH), + gsSPClipRatio(FRUSTRATIO_2), + gsSPFogPosition(900, 1000), + gsSPSetLights2(LIGHTS_801869A0), + gsDPPipeSync(), + {0xE3000800, 0x00000000}, + gsDPPipeSync(), + {0xED000000, 0x004FC3BC}, + gsDPPipeSync(), + {0xE3000F00, 0x00000000}, + {0xE3001001, 0x00000000}, + {0xE3000D01, 0x00000000}, + {0xE3000C00, 0x00080000}, + {0xE3001201, 0x00002000}, + {0xE3001402, 0x00000C00}, + {0xFCFFFFFF, 0xFFFE793C}, + {0xE3001700, 0x00000000}, + {0xE2001E01, 0x00000000}, + {0xE200001C, 0x0F0A4000}, + {0x00000000, 0x00000000}, + {0xE3001801, 0x00000000}, + {0xFB000000, 0x00000000}, + {0xFA000000, 0x00000000}, + {0xF9000000, 0x00000000}, + {0xF8000000, 0x00000000}, + {0xF7000000, 0x00000000}, + {0xEE000000, 0x00000000}, + {0xEC000000, 0x00000000}, + {0xEB000000, 0x00000000}, + {0xEA000000, 0x00000000}, + {0xF5100000, 0x00000000}, + {0xF5100000, 0x01000000}, + {0xF5100000, 0x02000000}, + {0xF5100000, 0x03000000}, + {0xF5100000, 0x04000000}, + {0xF5100000, 0x05000000}, + {0xF5100000, 0x6000000}, + {0xF5100000, 0x07000000}, + + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, 0, 0), + + {0xF2000000, 0x01000000}, + {0xF2000000, 0x02000000}, + {0xF2000000, 0x03000000}, + {0xF2000000, 0x04000000}, + {0xF2000000, 0x05000000}, + + gsDPSetTileSize(6, 0, 0, 0, 0), + gsDPSetTileSize(G_TX_LOADTILE, 0, 0, 0, 0), + gsSPSetLights2(LIGHTS_801869A0), + gsDPPipeSync(), + gsSPEndDisplayList(), +}; + +/* 5CAD0 80186BD0 */ +Gfx DISPLAY_LIST_80186BD0[] = { + { 0xE7000000, 0x00000000 }, + { 0xD7000000, 0x00000000 }, + { 0xD9000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE3000A01, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE3000C00, 0x00000000 }, + { 0xE3000D01, 0x00000000 }, + { 0xE3000F00, 0x00000000 }, + { 0xE3001001, 0x00000000 }, + { 0xFCFFFFFF, 0xFFFCF279 }, + { 0xE200001C, 0x0F0A4000 }, + { 0xE3001201, 0x00000000 }, + { 0xF9000000, 0xFFFFFF01 }, + { 0xE2001E01, 0x00000001 }, + { 0xE7000000, 0x00000000 }, + { 0xDF000000, 0x00000000 } +}; + +/* 5CB60 80186C60 */ +Gfx DISPLAY_LIST_80186C60[] = { + { 0xE7000000, 0x00000000 }, + { 0xD7000000, 0x00000000 }, + { 0xD9000000, 0x00000000 }, + { 0xD9FFFFFF, 0x00200004 }, + { 0xE7000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE3000A01, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE3000C00, 0x00000000 }, + { 0xE3000D01, 0x00000000 }, + { 0xE3000F00, 0x00000000 }, + { 0xE3001001, 0x00000000 }, + { 0xF9000000, 0xFFFFFF01 }, + { 0xE3001700, 0x00000000 }, + { 0xE2001E01, 0x00000000 }, + { 0xE3001201, 0x00000000 }, + { 0xFCFFFFFF, 0xFFFCF279 }, + { 0xE200001C, 0x00504240 }, + { 0xE7000000, 0x00000000 }, + { 0xDF000000, 0x00000000 } +}; + +/* 5CC00 80186D00 */ +Gfx DISPLAY_LIST_80186D00[] = { + { 0xE7000000, 0x00000000 }, + { 0xD7000000, 0x00000000 }, + { 0xD9000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE3000A01, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE3000C00, 0x00000000 }, + { 0xE3000D01, 0x00000000 }, + { 0xE3000F00, 0x00000000 }, + { 0xE3001001, 0x00000000 }, + { 0xFCFFFFFF, 0xFFFCF279 }, + { 0xE200001C, 0x0F0A4000 }, + { 0xE3001201, 0x00000000 }, + { 0xF9000000, 0xFFFFFF01 }, + { 0xE2001E01, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xDF000000, 0x00000000 }, +}; + +/* 5CC90 80186D90 */ +Gfx DISPLAY_LIST_80186D90[] = { + { 0xE7000000, 0x00000000 }, + { 0xE3001201, 0x00002000 }, + { 0xFCFFFFFF, 0xFFFE793C }, + { 0xE200001C, 0x0F0A4000 }, + { 0xE2001E01, 0x00000000 }, + { 0xE3000C00, 0x00080000 }, + { 0xE7000000, 0x00000000 }, + { 0xDF000000, 0x00000000 }, +}; + +/* 5CCD0 80186DD0 */ +Gfx DISPLAY_LIST_80186DD0[] = { + { 0xE7000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE3000A01, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xD9000000, 0x00000405 }, + { 0xE200001C, 0x00552078 }, + { 0xFCFFFFFF, 0xFFFDF6FB }, + { 0xD7000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xDF000000, 0x00000000 }, +}; + +/* 5CD20 80186E20 */ +Gfx DISPLAY_LIST_80186E20[] = { + { 0xE7000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xE3000A01, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xD9000000, 0x00200405 }, + { 0xE200001C, 0x00552078 }, + { 0xFCFFFFFF, 0xFFFE793C }, + { 0xD7000000, 0x00000000 }, + { 0xE7000000, 0x00000000 }, + { 0xDF000000, 0x00000000 }, +}; + +/* 5CD70 80186E70 */ +Gfx DISPLAY_LIST_80186E70[] = { + { 0xE7000000, 0x00000000 }, + { 0xFB000000, 0x00000000 }, + { 0xFA000000, 0x00000000 }, + { 0xF9000000, 0x00000000 }, + { 0xF8000000, 0x00000000 }, + { 0xF7000000, 0x00000000 }, + { 0xEE000000, 0x00000000 }, + { 0xEC000000, 0x00000000 }, + { 0xEB000000, 0x00000000 }, + { 0xEA000000, 0x00000000 }, + { 0xFCFFFFFF, 0xFFFE793C }, + { 0xE7000000, 0x00000000 }, + { 0xED000000, 0x004FC3BC }, + { 0xE7000000, 0x00000000 }, + { 0xF5100000, 0x00000000 }, + { 0xF5100000, 0x01000000 }, + { 0xF5100000, 0x02000000 }, + { 0xF5100000, 0x03000000 }, + { 0xF5100000, 0x04000000 }, + { 0xF5100000, 0x05000000 }, + { 0xF5100000, 0x06000000 }, + { 0xF5100000, 0x07000000 }, + { 0xF2000000, 0x00000000 }, + { 0xF2000000, 0x01000000 }, + { 0xF2000000, 0x02000000 }, + { 0xF2000000, 0x03000000 }, + { 0xF2000000, 0x04000000 }, + { 0xF2000000, 0x05000000 }, + { 0xF2000000, 0x06000000 }, + { 0xF2000000, 0x07000000 }, + { 0xE7000000, 0x00000000 }, + { 0xDF000000, 0x00000000 }, +}; diff --git a/src/equipment.c b/src/equipment.c index 965bcc5..2d6d7f0 100644 --- a/src/equipment.c +++ b/src/equipment.c @@ -5,29 +5,29 @@ /* 45480 8016F580 */ u8 equipment_get_field_0x1b(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x1b; + return obEquipmentData[index].field_0x1b; } /* 45498 8016F598 */ u8 equipment_get_field_0x1c(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x1c; + return obEquipmentData[index].field_0x1c; } /* 454B0 8016F5B0 */ -char* equipment_get_name(EquipmentId index) { - return EQUIPMENT_DATA[index].name; +char* obEquipmentGetName(EquipmentId index) { + return obEquipmentData[index].name; } /* 454C8 8016F5C8 */ -EquipmentType equipment_get_type(EquipmentId index) { - return EQUIPMENT_DATA[index].type; +EquipmentType obEquipmentGetType(EquipmentId index) { + return obEquipmentData[index].type; } /* 454E0 8016F5E0 */ -Element equipment_get_element(EquipmentId index) { +Element obEquipmentGetElement(EquipmentId index) { Element element; - element = EQUIPMENT_DATA[index].element; + element = obEquipmentData[index].element; if (element == ELEMENT_UNKNOWN_0x10) { element = CHARACTER_SLOT[0].element; } @@ -36,168 +36,168 @@ Element equipment_get_element(EquipmentId index) { /* 45514 8016F614 */ u8 equipment_get_field_0x6(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x6; + return obEquipmentData[index].field_0x6; } /* 4552C 8016F62C */ -u16 equipment_get_buy_price(EquipmentId index) { - return EQUIPMENT_DATA[index].buy_price; +u16 obEquipmentGetBuyPrice(EquipmentId index) { + return obEquipmentData[index].buy_price; } /* 45544 8016F644 */ s8 equipment_get_field_0x10(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x10; + return obEquipmentData[index].field_0x10; } /* 4555C 8016F65C */ -s8 equipment_get_strength(EquipmentId index) { +s8 obEquipmentGetStrength(EquipmentId index) { s8 ret; if (index == EQUIPMENT_ID_GALLANT_DOLL) { ret = CHARACTER_SLOT[0].strength / 20; } else { - ret = EQUIPMENT_DATA[index].strength; + ret = obEquipmentData[index].strength; } return ret; } /* 455AC 8016F6AC */ -s8 equipment_get_vitality(EquipmentId index) { +s8 obEquipmentGetVitality(EquipmentId index) { s8 ret; if (index == EQUIPMENT_ID_GALLANT_DOLL) { ret = CHARACTER_SLOT[0].vitality / 20; } else { - ret = EQUIPMENT_DATA[index].vitality; + ret = obEquipmentData[index].vitality; } return ret; } /* 455FC 8016F6FC */ -s8 equipment_get_intelligence(EquipmentId index) { +s8 obEquipmentGetIntelligence(EquipmentId index) { s8 ret; if (index == EQUIPMENT_ID_GALLANT_DOLL) { ret = CHARACTER_SLOT[0].intelligence / 20; } else { - ret = EQUIPMENT_DATA[index].intelligence; + ret = obEquipmentData[index].intelligence; } return ret; } /* 4564C 8016F74C */ -s8 equipment_get_mentality(EquipmentId index) { +s8 obEquipmentGetMentality(EquipmentId index) { s8 ret; if (index == EQUIPMENT_ID_GALLANT_DOLL) { ret = CHARACTER_SLOT[0].mentality / 20; } else { - ret = EQUIPMENT_DATA[index].mentality; + ret = obEquipmentData[index].mentality; } return ret; } /* 4569C 8016F79C */ -s8 equipment_get_agility(EquipmentId index) { +s8 obEquipmentGetAgility(EquipmentId index) { s8 ret; if (index == EQUIPMENT_ID_GALLANT_DOLL) { ret = CHARACTER_SLOT[0].agility / 20; } else { - ret = EQUIPMENT_DATA[index].agility; + ret = obEquipmentData[index].agility; } return ret; } /* 456EC 8016F7EC */ -s8 equipment_get_dexterity(EquipmentId index) { +s8 obEquipmentGetDexterity(EquipmentId index) { s8 ret; if (index == EQUIPMENT_ID_GALLANT_DOLL) { ret = CHARACTER_SLOT[0].dexterity / 20; } else { - ret = EQUIPMENT_DATA[index].dexterity; + ret = obEquipmentData[index].dexterity; } return ret; } /* 4573C 8016F83C */ -s8 equipment_get_resistance_strike(EquipmentId index) { - return EQUIPMENT_DATA[index].res_strike; +s8 obEquipmentGetResistanceStrike(EquipmentId index) { + return obEquipmentData[index].res_strike; } /* 45754 8016F854 */ -s8 equipment_get_resistance_wind(EquipmentId index) { - return EQUIPMENT_DATA[index].res_wind; +s8 obEquipmentGetResistanceWind(EquipmentId index) { + return obEquipmentData[index].res_wind; } /* 4576C 8016F86C */ -s8 equipment_get_resistance_fire(EquipmentId index) { - return EQUIPMENT_DATA[index].res_fire; +s8 obEquipmentGetResistanceFire(EquipmentId index) { + return obEquipmentData[index].res_fire; } /* 45784 8016F884 */ -s8 equipment_get_resistance_earth(EquipmentId index) { - return EQUIPMENT_DATA[index].res_earth; +s8 obEquipmentGetResistanceEarth(EquipmentId index) { + return obEquipmentData[index].res_earth; } /* 4579C 8016F89C */ -s8 equipment_get_resistance_water(EquipmentId index) { - return EQUIPMENT_DATA[index].res_water; +s8 obEquipmentGetResistanceWater(EquipmentId index) { + return obEquipmentData[index].res_water; } /* 457B4 8016F8B4 */ -s8 equipment_get_resistance_holy(EquipmentId index) { - return EQUIPMENT_DATA[index].res_holy; +s8 obEquipmentGetResistanceVirtue(EquipmentId index) { + return obEquipmentData[index].res_holy; } /* 457CC 8016F8CC */ -s8 equipment_get_resistance_dark(EquipmentId index) { - return EQUIPMENT_DATA[index].res_dark; +s8 obEquipmentGetResistanceBane(EquipmentId index) { + return obEquipmentData[index].res_dark; } /* 457E4 8016F8E4 */ u8 equipment_get_field_0x18_b68(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x18 >> 6; + return obEquipmentData[index].field_0x18 >> 6; } /* 45800 8016F900 */ u8 equipment_get_field_0x18_b46(EquipmentId index) { - return (EQUIPMENT_DATA[index].field_0x18 >> 4) & 3; + return (obEquipmentData[index].field_0x18 >> 4) & 3; } /* 45820 8016F920 */ u8 equipment_get_field_0x18_b24(EquipmentId index) { - return (EQUIPMENT_DATA[index].field_0x18 >> 2) & 3; + return (obEquipmentData[index].field_0x18 >> 2) & 3; } /* 45840 8016F940 */ u8 equipment_get_field_0x18_b12(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x18 & 3; + return obEquipmentData[index].field_0x18 & 3; } /* 4585C 8016F95C */ u8 equipment_get_field_0x19_b68(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x19 >> 6; + return obEquipmentData[index].field_0x19 >> 6; } /* 45878 8016F978 */ u8 equipment_get_field_0x19_b46(EquipmentId index) { - return (EQUIPMENT_DATA[index].field_0x19 >> 4) & 3; + return (obEquipmentData[index].field_0x19 >> 4) & 3; } /* 45898 8016F998 */ u8 equipment_get_field_0x19_b24(EquipmentId index) { - return (EQUIPMENT_DATA[index].field_0x19 >> 2) & 3; + return (obEquipmentData[index].field_0x19 >> 2) & 3; } /* 458B8 8016F9B8 */ u8 equipment_get_field_0x19_b12(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x19 & 3; + return obEquipmentData[index].field_0x19 & 3; } /* 458D4 8016F9D4 */ u8 equipment_get_field_0x1a_b7(EquipmentId index) { - return EQUIPMENT_DATA[index].field_0x1a >> 7; + return obEquipmentData[index].field_0x1a >> 7; } /* 458F0 8016F9F0 */ -bool equipment_is_weapon(EquipmentId index) { - s32 type = EQUIPMENT_DATA[index].type; +bool obEquipmentIsWeapon(EquipmentId index) { + s32 type = obEquipmentData[index].type; if (type != 0) { if (type < EQUIPMENT_TYPE_SMALL_SHIELD) { @@ -211,20 +211,20 @@ bool equipment_is_weapon(EquipmentId index) { return false; } -INCLUDE_ASM(const s32, "equipment", equipment_get_first_weapon); +INCLUDE_ASM(const s32, "equipment", obEquipmentGetFirstWeapon); /* 45A50 8016FB50 */ -EquipmentId equipment_get_first_spellbook(EquipmentId arg0, EquipmentId arg1, EquipmentId arg2, EquipmentId arg3) { - if (EQUIPMENT_DATA[arg0].type == EQUIPMENT_TYPE_SPELLBOOK) +EquipmentId obEquipmentGetFirstSpellbook(EquipmentId arg0, EquipmentId arg1, EquipmentId arg2, EquipmentId arg3) { + if (obEquipmentData[arg0].type == EQUIPMENT_TYPE_SPELLBOOK) return arg0; - if (EQUIPMENT_DATA[arg1].type == EQUIPMENT_TYPE_SPELLBOOK) + if (obEquipmentData[arg1].type == EQUIPMENT_TYPE_SPELLBOOK) return arg1; - if (EQUIPMENT_DATA[arg2].type == EQUIPMENT_TYPE_SPELLBOOK) + if (obEquipmentData[arg2].type == EQUIPMENT_TYPE_SPELLBOOK) return arg2; - if (EQUIPMENT_DATA[arg3].type == EQUIPMENT_TYPE_SPELLBOOK) + if (obEquipmentData[arg3].type == EQUIPMENT_TYPE_SPELLBOOK) return arg3; return 0; diff --git a/src/strategy.data.c b/src/strategy.data.c new file mode 100644 index 0000000..5265e38 --- /dev/null +++ b/src/strategy.data.c @@ -0,0 +1,35 @@ +#include "common.h" + +#include "class.h" +#include "str_decorate.h" + +/* 5CE70 80186F70 */ +char obStrategyNameAutonomous[] = DECORATE("Autonomous"); + +/* 5CE80 80186F80 */ +char obStrategyNameAttackStrongest[] = DECORATE("Attack" NEWLINE INDENT "Strongest"); + +/* 5CE94 80186F94 */ +char obStrategyNameAttackLeader[] = DECORATE("Attack" NEWLINE INDENT "Leader"); + +/* 5CEA8 80186FA8 */ +char obStrategyNameAttackWeakest[] = DECORATE("Attack" NEWLINE INDENT "Weakest"); + +/* 5CEBC 80186FBC */ +u8 D_80186FBC[] = { 0x07, 0x02, 0x06, 0x03, 0x05, 0x04, 0x01, 0x00 }; + +/* 5CEC4 80186FC4 */ +char* obStrategyName[] = { + obStrategyNameAutonomous, + obStrategyNameAttackStrongest, + obStrategyNameAttackLeader, + obStrategyNameAttackWeakest +}; + +/* 5CED4 80186FD4 */ +u16 (*obClassGetItem[])(u8 portrait, u8 class) = { + class_get_item_upper_left, + class_get_item_upper_right, + class_get_item_lower_left, + class_get_item_lower_right +}; diff --git a/symbol_addrs.txt b/symbol_addrs.txt index 273ba9f..6370d70 100644 --- a/symbol_addrs.txt +++ b/symbol_addrs.txt @@ -12,10 +12,12 @@ VTX_8021EF08 = 0x8021EF08; // rom:0x16FF48 PTR_DISPLAY_LIST = 0x800E9BA0; -DISPLAY_LIST_80186310 = 0x80186310; // rom:0x5C210 -DISPLAY_LIST_80186330 = 0x80186330; // rom:0x5C230 -DISPLAY_LIST_80186320 = 0x80186320; // rom:0x5C220 -DISPLAY_LIST_80186358 = 0x80186358; // rom:0x5C258 +obVpMinResolution = 0x80186310; // rom:0x5C210 +obVpMaxResolution = 0x80186320; // rom:0x5C220 + +obDlSetupMinResolution = 0x80186330; // rom:0x5C230 +obDlSetupMaxResolution = 0x80186358; // rom:0x5C258 + DP_FILL_RECT_639x479 = 0x80186380; // rom:0x5C280 DL_DRAW_TEX_2560x1920 = 0x80186610; // rom:0x5C510 DISPLAY_LIST_801869C8 = 0x801869C8; // rom:0x5C8C8 @@ -90,6 +92,7 @@ DISPLAY_LIST_801B8358 = 0x801B8358; // rom:0x1EE858 DISPLAY_LIST_801B8388 = 0x801B8388; // rom:0x1EE888 DISPLAY_LIST_8021F058 = 0x8021F058; // rom:0x170098 +LIGHTS_801869A0 = 0x801869A0; // rom:0x5C8A0 size:40 __SOMETHING_FRAMEBUFFERS = 0x800A9EE0; // rom:0x3A2E0 size:0xC @@ -125,8 +128,6 @@ D_801977D8 = 0x801977D8; // size:0x1E D_80197710 = 0x80197710; // size:0x64 __CONTAINS_BATTALION_NAME = 0x80196A58; // size:0x94 -STR_FATAL_DANCE = 0x80187BC8; // rom:0x5DAC8 type:asciz size:0xc - DEFAULT_BATTALION_NAME = 0x80190EFC; // rom:0x66DFC type:asciz STR_COMMAND_MOBILE_WALL = 0x80212FF0; // rom:0x164160 type:asciz @@ -153,25 +154,134 @@ STR_MEN_UP = 0x8021E000; // rom:0x1B2310 STR_CANNOT_BE_USED = 0x8021DF80; // rom:0x1B2290 STR_PETRIFICATION = 0x8021DFA0; // rom:0x1B22B0 -ELEMENT_NAMES = 0x80187BD4; // rom:0x5DAD4 type:u32 -STR_ELEMENT_PHYSICAL = 0x80187660; // rom:0x5D560 type:asciz -STR_ELEMENT_WIND = 0x8018766C; // rom:0x5D56C type:asciz -STR_ELEMENT_FLAME = 0x80187674; // rom:0x5D574 type:asciz -STR_ELEMENT_EARTH = 0x8018767C; // rom:0x5D57C type:asciz -STR_ELEMENT_WATER = 0x80187684; // rom:0x5D584 type:asciz -STR_ELEMENT_VIRTUE = 0x8018768C; // rom:0x5D58C type:asciz -STR_ELEMENT_BANE = 0x80187694; // rom:0x5D594 type:asciz -STR_ELEMENT_DRAKONITE = 0x8018769C; // rom:0x5D59C type:asciz -STR_ELEMENT_VARIABLE = 0x801876A8; // rom:0x5D5A8 type:asciz -STR_ELEMENT_WIND_FLAME = 0x801876B4; // rom:0x5D5B4 type:asciz -STR_ELEMENT_FLAME_WIND = 0x801876C0; // rom:0x5D5C0 type:asciz -STR_ELEMENT_EARTH_FLAME = 0x801876CC; // rom:0x5D5CC type:asciz -STR_ELEMENT_WATER_EARTH = 0x801876D8; // rom:0x5D5D8 type:asciz -STR_ELEMENT_WIND_BANE = 0x801876E4; // rom:0x5D5E4 type:asciz -STR_ELEMENT_FlAME_BANE = 0x801876F0; // rom:0x5D5F0 type:asciz +obStrategyName = 0x80186FC4; // rom:0x5CEC4 size:16 +obStrategyNameAutonomous = 0x80186F70; // rom:0x5CE70 type:asciz +obStrategyNameAttackStrongest = 0x80186F80; // rom:0x5CE80 type:asciz +obStrategyNameAttackLeader = 0x80186F94; // rom:0x5CE94 type:asciz +obStrategyNameAttackWeakest = 0x80186FA8; // rom:0x5CEA8 type:asciz + +obElementName = 0x80187BD4; // rom:0x5DAD4 type:u32 +obElementNamePhysical = 0x80187660; // rom:0x5D560 type:asciz +obElementNameWind = 0x8018766C; // rom:0x5D56C type:asciz +obElementNameFlame = 0x80187674; // rom:0x5D574 type:asciz +obElementNameEarth = 0x8018767C; // rom:0x5D57C type:asciz +obElementNameWater = 0x80187684; // rom:0x5D584 type:asciz +obElementNameVirtue = 0x8018768C; // rom:0x5D58C type:asciz +obElementNameBane = 0x80187694; // rom:0x5D594 type:asciz +obElementNameDrakonite = 0x8018769C; // rom:0x5D59C type:asciz +obElementNameVariable = 0x801876A8; // rom:0x5D5A8 type:asciz +obElementNameWindFlame = 0x801876B4; // rom:0x5D5B4 type:asciz +obElementNameFlameWind = 0x801876C0; // rom:0x5D5C0 type:asciz +obElementNameEarthFlame = 0x801876CC; // rom:0x5D5CC type:asciz +obElementNameWaterEarth = 0x801876D8; // rom:0x5D5D8 type:asciz +obElementNameWindBane = 0x801876E4; // rom:0x5D5E4 type:asciz +obElementNameFlameBane = 0x801876F0; // rom:0x5D5F0 type:asciz + +obAbilityNameThrust = 0x801876FC; // type:asciz rom:0x5D5FC size:7 +obAbilityNamePeck = 0x80187704; // type:asciz rom:0x5D604 size:5 +obAbilityNamePierce = 0x8018770C; // type:asciz rom:0x5D60C size:7 +obAbilityNameSlash = 0x80187714; // type:asciz rom:0x5D614 size:6 +obAbilityNameCleave = 0x8018771C; // type:asciz rom:0x5D61C size:7 +obAbilityNameRend = 0x80187724; // type:asciz rom:0x5D624 size:5 +obAbilityNameClaw = 0x8018772C; // type:asciz rom:0x5D62C size:5 +obAbilityNameBite = 0x80187734; // type:asciz rom:0x5D634 size:5 +obAbilityNameStrike = 0x8018773C; // type:asciz rom:0x5D63C size:7 +obAbilityNameCrush = 0x80187744; // type:asciz rom:0x5D644 size:6 +obAbilityNameSmash = 0x8018774C; // type:asciz rom:0x5D64C size:6 +obAbilityNameLash = 0x80187754; // type:asciz rom:0x5D654 size:5 +obAbilityNamePullStrings = 0x8018775C; // type:asciz rom:0x5D65C size:13 +obAbilityNameShoot = 0x8018776C; // type:asciz rom:0x5D66C size:6 +obAbilityNameTakeAPeek = 0x80187774; // type:asciz rom:0x5D674 size:12 +obAbilityNameFlipOver = 0x80187780; // type:asciz rom:0x5D680 size:10 +obAbilityNameSonicBoom = 0x8018778C; // type:asciz rom:0x5D68C size:11 +obAbilityNameWindShot = 0x80187798; // type:asciz rom:0x5D698 size:10 +obAbilityNameThunderArrow = 0x801877A4; // type:asciz rom:0x5D6A4 size:17 +obAbilityNameWindStorm = 0x801877B8; // type:asciz rom:0x5D6B8 size:11 +obAbilityNameMesmerize = 0x801877C4; // type:asciz rom:0x5D6C4 size:10 +obAbilityNameLifeDrain = 0x801877D0; // type:asciz rom:0x5D6D0 size:11 +obAbilityNameThrowAKiss = 0x801877DC; // type:asciz rom:0x5D6DC size:13 +obAbilityNameGazeOfTerror = 0x801877EC; // type:asciz rom:0x5D6EC size:18 +obAbilityNamePumpkinSmash = 0x80187800; // type:asciz rom:0x5D700 size:14 +obAbilityNamePumpkinShower = 0x80187810; // type:asciz rom:0x5D710 size:18 +obAbilityNameBanish = 0x80187824; // type:asciz rom:0x5D724 size:7 +obAbilityNameJihad = 0x8018782C; // type:asciz rom:0x5D72C size:6 +obAbilityNameMagicMissile = 0x80187834; // type:asciz rom:0x5D734 size:14 +obAbilityNameAbyss = 0x80187844; // type:asciz rom:0x5D744 size:6 +obAbilityNameLightningBreath = 0x8018784C; // type:asciz rom:0x5D74C size:20 +obAbilityNameFireBreath = 0x80187860; // type:asciz rom:0x5D760 size:12 +obAbilityNameAcidBreath = 0x8018786C; // type:asciz rom:0x5D76C size:12 +obAbilityNameBreathOfCold = 0x80187878; // type:asciz rom:0x5D778 size:15 +obAbilityNameSacredBreath = 0x80187888; // type:asciz rom:0x5D788 size:14 +obAbilityNameRottenBreath = 0x80187898; // type:asciz rom:0x5D798 size:14 +obAbilityNamePetrify = 0x801878A8; // type:asciz rom:0x5D7A8 size:8 +obAbilityNameRadiantGale = 0x801878B0; // type:asciz rom:0x5D7B0 size:13 +obAbilityNameCrimsonNote = 0x801878C0; // type:asciz rom:0x5D7C0 size:13 +obAbilityNameEarthquake = 0x801878D0; // type:asciz rom:0x5D7D0 size:11 +obAbilityNameClearDisaster = 0x801878DC; // type:asciz rom:0x5D7DC size:18 +obAbilityNameDivineRay = 0x801878F0; // type:asciz rom:0x5D7F0 size:11 +obAbilityNameEvilDead = 0x801878FC; // type:asciz rom:0x5D7FC size:10 +obAbilityNameEvocation = 0x80187908; // type:asciz rom:0x5D808 size:10 +obAbilityNameNinjaArt = 0x80187914; // type:asciz rom:0x5D814 size:10 +obAbilityNameLightning = 0x80187920; // type:asciz rom:0x5D820 size:10 +obAbilityNameThunderFlare = 0x8018792C; // type:asciz rom:0x5D82C size:14 +obAbilityNameShockBolt = 0x8018793C; // type:asciz rom:0x5D83C size:11 +obAbilityNameThunderbird = 0x80187948; // type:asciz rom:0x5D848 size:12 +obAbilityNameFireball = 0x80187954; // type:asciz rom:0x5D854 size:9 +obAbilityNameFireStorm = 0x80187960; // type:asciz rom:0x5D860 size:11 +obAbilityNameRayOfParalysis = 0x8018796C; // type:asciz rom:0x5D86C size:20 +obAbilityNameSalamander = 0x80187980; // type:asciz rom:0x5D880 size:11 +obAbilityNameAcidVapor = 0x8018798C; // type:asciz rom:0x5D88C size:11 +obAbilityNameCragPress = 0x80187998; // type:asciz rom:0x5D898 size:11 +obAbilityNamePoisonCloud = 0x801879A4; // type:asciz rom:0x5D8A4 size:13 +obAbilityNameGnome = 0x801879B4; // type:asciz rom:0x5D8B4 size:6 +obAbilityNameIceBlast = 0x801879BC; // type:asciz rom:0x5D8BC size:10 +obAbilityNameIceField = 0x801879C8; // type:asciz rom:0x5D8C8 size:10 +obAbilityNameSlumberMist = 0x801879D4; // type:asciz rom:0x5D8D4 size:13 +obAbilityNameFenrir = 0x801879E4; // type:asciz rom:0x5D8E4 size:7 +obAbilityNameHealing = 0x801879EC; // type:asciz rom:0x5D8EC size:8 +obAbilityNameHealingPlus = 0x801879F4; // type:asciz rom:0x5D8F4 size:13 +obAbilityNameWordOfPain = 0x80187A04; // type:asciz rom:0x5D904 size:13 +obAbilityNameDarkQuest = 0x80187A14; // type:asciz rom:0x5D914 size:11 +obAbilityNameNightmare = 0x80187A20; // type:asciz rom:0x5D920 size:10 +obAbilityNameDarkLore = 0x80187A2C; // type:asciz rom:0x5D92C size:10 +obAbilityNameTempest = 0x80187A38; // type:asciz rom:0x5D938 size:8 +obAbilityNameAnnihilation = 0x80187A40; // type:asciz rom:0x5D940 size:13 +obAbilityNameMeteorStrike = 0x80187A50; // type:asciz rom:0x5D950 size:14 +obAbilityNameWhiteMute = 0x80187A60; // type:asciz rom:0x5D960 size:11 +obAbilityNameIonosphere = 0x80187A6C; // type:asciz rom:0x5D96C size:11 +obAbilityNameAtmosphere = 0x80187A78; // type:asciz rom:0x5D978 size:11 +obAbilityNameDeepSleep = 0x80187A84; // type:asciz rom:0x5D984 size:11 +obAbilityNamePlasmaBall = 0x80187A90; // type:asciz rom:0x5D990 size:12 +obAbilityNamePlasmaStorm = 0x80187A9C; // type:asciz rom:0x5D99C size:13 +obAbilityNameBindFlare = 0x80187AAC; // type:asciz rom:0x5D9AC size:11 +obAbilityNameLavaShot = 0x80187AB8; // type:asciz rom:0x5D9B8 size:10 +obAbilityNameLavaFlow = 0x80187AC4; // type:asciz rom:0x5D9C4 size:10 +obAbilityNamePoisonPlant = 0x80187AD0; // type:asciz rom:0x5D9D0 size:13 +obAbilityNameClayAssault = 0x80187AE0; // type:asciz rom:0x5D9E0 size:13 +obAbilityNameBlueSpiral = 0x80187AF0; // type:asciz rom:0x5D9F0 size:12 +obAbilityNamePoisonLime = 0x80187AFC; // type:asciz rom:0x5D9FC size:12 +obAbilityNameInfest = 0x80187B08; // type:asciz rom:0x5DA08 size:7 +obAbilityNameInferno = 0x80187B10; // type:asciz rom:0x5DA10 size:8 +obAbilityNameBlackBreeze = 0x80187B18; // type:asciz rom:0x5DA18 size:13 +obAbilityNameDarkBlaze = 0x80187B28; // type:asciz rom:0x5DA28 size:11 +obAbilityNameDarkFlame = 0x80187B34; // type:asciz rom:0x5DA34 size:11 +obAbilityNameDoom = 0x80187B40; // type:asciz rom:0x5DA40 size:5 +obAbilityNameSonicBlast = 0x80187B48; // type:asciz rom:0x5DA48 size:12 +obAbilityNameWindBlast = 0x80187B54; // type:asciz rom:0x5DA54 size:11 +obAbilityNameFireBlast = 0x80187B60; // type:asciz rom:0x5DA60 size:11 +obAbilityNameEarthBlast = 0x80187B6C; // type:asciz rom:0x5DA6C size:12 +obAbilityNameAquaBlast = 0x80187B78; // type:asciz rom:0x5DA78 size:11 +obAbilityNameHolyBlast = 0x80187B84; // type:asciz rom:0x5DA84 size:11 +obAbilityNameDarkBlast = 0x80187B90; // type:asciz rom:0x5DA90 size:11 +obAbilityNameSonicBlade = 0x80187B9C; // type:asciz rom:0x5DA9C size:12 +obAbilityNameIgnisFatuus = 0x80187BA8; // type:asciz rom:0x5DAA8 size:13 +obAbilityNameMirageSlash = 0x80187BB8; // type:asciz rom:0x5DAB8 size:13 +obAbilityNameFatalDance = 0x80187BC8; // type:asciz rom:0x5DAC8 size:12 D_80187BD4 = 0x80187BD4; // rom:0x5DAD4 type:u32 +obClassGetItem = 0x80186FD4; // rom:0x5CED4 size:16 + CLASS_DATA = 0x80187C14; // rom:0x5DB14 size:0x2E68 type:u32 class_get_field_0x2c = 0x8016DBD8; // rom:0x43AD8 class_get_ability_front = 0x8016DC2C; // rom:0x43B2C @@ -197,37 +307,38 @@ class_get_ability_hitcount = 0x8016E338; // rom:0x44238 FORMATION_COMMAND_NAMES = 0x8021315C; // rom:0x1642CC type:char* -ABILITY_DATA = 0x8018AA7C; // rom:0x6097C size:0xA20 -ability_get_name = 0x8016E440; +obAbilityData = 0x8018AA7C; // rom:0x6097C size:0xA20 +obAbilityGetName = 0x8016E440; ability_get_field_0x4 = 0x8016E458; // rom:0x44358 -ability_get_element = 0x8016E470; +obAbilityGetElement = 0x8016E470; -FP_EQUIPMENT_GET_RESISTANCE = 0x801EF2B0; // rom:0xDBD10 -FP_EQUIPMENT_GET_ALL_STATS = 0x801EF298; // rom:0xDBCF8 +obEquipmentGetResistance = 0x801EF2B0; // rom:0xDBD10 +obEquipmentGetStat = 0x801EF298; // rom:0xDBCF8 + +obEquipmentTypeName = 0x802130A4; // rom:0x164214 type:char* +obEquipmentData = 0x8018C40C; // size:0x20 -EQUIPMENT_TYPE_NAMES = 0x802130A4; // rom:0x164214 type:char* -EQUIPMENT_DATA = 0x8018C40C; // size:0x20 equipment_get_field_0x1b = 0x8016F580; // rom:0x45480 equipment_get_field_0x1c = 0x8016F598; // rom:0x45498 -equipment_get_name = 0x8016F5B0; -equipment_get_type = 0x8016F5C8; -equipment_get_element = 0x8016F5E0; +obEquipmentGetName = 0x8016F5B0; +obEquipmentGetType = 0x8016F5C8; +obEquipmentGetElement = 0x8016F5E0; equipment_get_field_0x6 = 0x8016F614; -equipment_get_buy_price = 0x8016F62C; +obEquipmentGetBuyPrice = 0x8016F62C; equipment_get_field_0x10 = 0x8016F644; -equipment_get_strength = 0x8016F65C; -equipment_get_vitality = 0x8016F6AC; -equipment_get_intelligence = 0x8016F6FC; -equipment_get_mentality = 0x8016F74C; -equipment_get_agility = 0x8016F79C; -equipment_get_dexterity = 0x8016F7EC; -equipment_get_resistance_strike = 0x8016F83C; -equipment_get_resistance_wind = 0x8016F854; -equipment_get_resistance_fire = 0x8016F86C; -equipment_get_resistance_earth = 0x8016F884; -equipment_get_resistance_water = 0x8016F89C; -equipment_get_resistance_holy = 0x8016F8B4; -equipment_get_resistance_dark = 0x8016F8CC; +obEquipmentGetStrength = 0x8016F65C; +obEquipmentGetVitality = 0x8016F6AC; +obEquipmentGetIntelligence = 0x8016F6FC; +obEquipmentGetMentality = 0x8016F74C; +obEquipmentGetAgility = 0x8016F79C; +obEquipmentGetDexterity = 0x8016F7EC; +obEquipmentGetResistanceStrike = 0x8016F83C; +obEquipmentGetResistanceWind = 0x8016F854; +obEquipmentGetResistanceFire = 0x8016F86C; +obEquipmentGetResistanceEarth = 0x8016F884; +obEquipmentGetResistanceWater = 0x8016F89C; +obEquipmentGetResistanceVirtue = 0x8016F8B4; +obEquipmentGetResistanceBane = 0x8016F8CC; equipment_get_field_0x18_b68 = 0x8016F8E4; equipment_get_field_0x18_b46 = 0x8016F900; equipment_get_field_0x18_b24 = 0x8016F920; @@ -237,12 +348,12 @@ equipment_get_field_0x19_b46 = 0x8016F978; equipment_get_field_0x19_b24 = 0x8016F998; equipment_get_field_0x19_b12 = 0x8016F9B8; equipment_get_field_0x1a_b7 = 0x8016F9D4; // rom:0x458D4 -equipment_is_weapon = 0x8016F9F0; // rom:0x458F0 -equipment_get_first_weapon = 0x8016FA34; // rom:0x45934 -equipment_get_first_spellbook = 0x8016FB50; // rom:0x45A50 +obEquipmentIsWeapon = 0x8016F9F0; // rom:0x458F0 +obEquipmentGetFirstWeapon = 0x8016FA34; // rom:0x45934 +obEquipmentGetFirstSpellbook = 0x8016FB50; // rom:0x45A50 -ITEM_DATA = 0x8018E6CC; // rom:0x645CC size:0x21C -item_get_name = 0x8016F4E0; // rom:0x453E0 +obItemData = 0x8018E6CC; // rom:0x645CC size:0x21C +obItemGetName = 0x8016F4E0; // rom:0x453E0 item_get_field_0x4 = 0x8016F500; // rom:0x45400 item_get_field_0x5 = 0x8016F520; // rom:0x45420 item_get_field_0x8 = 0x8016F540; // rom:0x45440 diff --git a/tools/ability_data.py b/tools/ability_data.py index dec5940..375024a 100644 --- a/tools/ability_data.py +++ b/tools/ability_data.py @@ -16,7 +16,7 @@ def read_ability(index): return unpack_from(ABILITY_FORMAT, read_rom(ability_start, ability_end)) -MAX_ABILITIES = 162 +MAX_ABILITIES = 159 for i in range(1, MAX_ABILITIES): (name_vaddr, field_0x0, element, field_0x2, field_0x3, field_0x4, @@ -26,6 +26,8 @@ for i in range(1, MAX_ABILITIES): name_addr_diff = (name_vaddr - NAME_VADDR_START) + NAME_ADDR_START name = read_rom(name_addr_diff, name_addr_diff + 32).split(b'\0', 1)[0] - print(f"{name} ({i}):\t", (field_0x0, field_0x2, field_0x3, field_0x4, field_0x5, - field_0x6, field_0x7, field_0x8, field_0x9, field_0xa, - field_0xb)) \ No newline at end of file + print(f"{name} = 0x{name_vaddr:X}") + + # print(f"({i}):\t", (field_0x0, field_0x2, field_0x3, field_0x4, field_0x5, + # field_0x6, field_0x7, field_0x8, field_0x9, field_0xa, + # field_0xb)) \ No newline at end of file diff --git a/tools/ability_names.py b/tools/ability_names.py new file mode 100644 index 0000000..c60bedc --- /dev/null +++ b/tools/ability_names.py @@ -0,0 +1,35 @@ +from ob import read_rom + +import string + +NAMES_START = 0x5D5FC; +NAMES_END = 0x5DAD4; + +NAME_VADDR_START = 0x801876FC + +data = read_rom(NAMES_START, NAMES_END) + +def strip_name(name): + return ''.join(chr(ch) for ch in name if chr(ch).isalnum()) + +buf = bytearray() +for i, d in enumerate(data): + + # Read until 0 + if d != 0: + buf.append(d) + else: + if len(buf) == 0: + continue + + clean_name = strip_name(buf) + offset = i - len(buf) + + # print(f"// {bytes(buf)}") + print(f"obAbilityName{clean_name} = 0x{(NAME_VADDR_START + offset):X}; // rom:0x{(NAMES_START + offset):X} size:{(len(buf) + 1)}") + buf = bytearray() + + + + +