-
Notifications
You must be signed in to change notification settings - Fork 1
/
FE8U.h
2353 lines (2239 loc) · 38.3 KB
/
FE8U.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
This file has been generated by IDA.
It contains local type definitions from
the type library 'FE8U-ida60'
*/
#pragma once
#define __int8 char
#define __int16 short
#define __int32 int
#define __int64 long long
/* 1 */
#pragma pack(push, 1)
struct ROMItemEntry
{
__int16 nameId;
__int16 descId;
__int16 useDescId;
char id;
char weaponType;
int attributes;
int pStatBonuses;
int pEffectiveness;
char maxUses;
char might;
char hit;
char weight;
char crit;
char range;
__int16 costPerUse;
char weaponRank;
char iconId;
char useEffect;
char weaponEffect;
char weaponExp;
char u21;
char u22;
char u23;
};
#pragma pack(pop)
/* 2 */
enum Item
{
ItemLightBrand = 0x10,
ItemRuneSword = 0x11,
ItemHandAxe = 0x28,
ItemTomahawk = 0x29,
ItemHatchet = 0x2C,
ItemChestKey = 0x69,
ItemDoorKey = 0x6A,
ItemLockpick = 0x6B,
ItemMemberCard = 0x72,
Item5ChestKey = 0x79,
ItemFillasMight = 0x7D,
ItemSetsLitany = 0x80,
ItemWindSword = 0xA1,
ItemNightmare = 0xA6,
ItemStone = 0xB5,
};
/* 3 */
#pragma pack(push, 1)
struct BattleStatsStruct
{
__int16 updateFlags;
__int16 attackRange;
__int16 damage;
__int16 attack;
__int16 defense;
__int16 hit;
__int16 crit;
__int16 lethalityChance;
int pExtraUnit1;
int pExtraUnit2;
};
#pragma pack(pop)
/* 4 */
#pragma pack(push, 1)
struct TrapStruct
{
char xPos;
char yPos;
char type;
char ext1;
char ext2;
char ext3;
char ext4;
char ext5;
};
#pragma pack(pop)
/* 5 */
#pragma pack(push, 1)
struct UnitStruct
{
int pCharData;
int pClassData;
char level;
char exp;
char u0A_aiextdata;
char index;
int state;
char xPos;
char yPos;
char maxHP;
char curHP;
char pow;
char skl;
char spd;
char def;
char res;
char lck;
char conBonus;
char rescueAll;
char ballistaIndex;
char movBonus;
__int16 item1;
__int16 item2;
__int16 item3;
__int16 item4;
__int16 item5;
char swordRank;
char lanceRank;
char axeRank;
char bowRank;
char staffRank;
char animaRank;
char lightRank;
char darkRank;
char status;
char torchBarrierDuration;
char support1;
char support2;
char support3;
char support4;
char support5;
char support6;
char unitLeader;
char supportBits;
char u3A;
char u3B;
int pStandingSpriteData;
__int16 ai3And4;
char ai1;
char ai1cursor;
char ai2;
char ai2cursor;
char u46_allycountin1to8range;
char u47;
};
#pragma pack(pop)
/* 6 */
enum Class
{
ClassGorgonEgg = 0x34,
ClassNecromancer = 0x4F,
ClassPhantom = 0x51,
ClassGorgonEgg2 = 0x62,
ClassDemonKing = 0x66,
};
/* 7 */
#pragma pack(push, 1)
struct ChapterDataStruct
{
int savedGlobalTimer;
int startGlobalTimer;
int goldAmount;
char savedSaveLocation;
char visionRange;
char chapterId;
char phase;
__int16 turnNumber;
char curX;
char curY;
char chapterState;
char weather;
__int16 supportGainCount;
char u18;
char u19;
char u1A;
char mode;
char field_1C;
char field_1D;
char field_1E;
char field_1F;
int sTacticianName;
char field_24;
char field_25;
char field_26;
char field_27;
char field_28;
char field_29;
char field_2A;
char field_2B;
char field_2C;
char field_2D;
char field_2E;
char field_2F;
char field_30;
char field_31;
char field_32;
char field_33;
char field_34;
char field_35;
char field_36;
char field_37;
char field_38;
char field_39;
char field_3A;
char field_3B;
char field_3C;
char field_3D;
char field_3E;
char field_3F;
char option1;
char option2;
__int16 option3;
char field_44;
char field_45;
char field_46;
char field_47;
__int16 field_48;
char somethingRelatedToSelectEvents;
char somethingRelatedToSelectEvents2;
};
#pragma pack(pop)
/* 8 */
#pragma pack(push, 1)
struct UnitWordStruct
{
char charId;
char xPos;
char yPos;
char u03;
};
#pragma pack(pop)
/* 9 */
#pragma pack(push, 1)
struct ROMUnitEntry
{
__int16 nameId;
__int16 descId;
char number;
char class;
__int16 portraitId;
char miniPortrait;
char affinity;
char u0A;
char baseLevel;
char baseHP;
char basePow;
char baseSkl;
char baseSpd;
char baseDef;
char baseRes;
char baseLck;
char baseCon;
char rank1;
char rank2;
char rank3;
char rank4;
char rank5;
char rank6;
char rank7;
char rank8;
char growthHP;
char growthPow;
char growthSkl;
char growthSpd;
char growthDef;
char growthRes;
char growthLck;
char u23;
char u24;
char u25;
char u26;
char u27;
int attributes;
int supportDataPtr;
int uPtr30;
};
#pragma pack(pop)
/* 10 */
#pragma pack(push, 1)
struct ROMClassEntry
{
__int16 nameId;
__int16 descId;
char number;
char promotion;
char standingMapSpriteId;
char slowWalking;
__int16 defaultPortrait;
char u0A;
char baseHP;
char basePow;
char baseSkl;
char baseSpd;
char baseDef;
char baseRes;
char baseCon;
char baseMov;
char maxHP;
char maxPow;
char maxSkl;
char maxSpd;
char maxDef;
char maxRes;
char maxCon;
char classRelativePower;
char growthHP;
char growthPow;
char growthSkl;
char growthSpd;
char growthDef;
char growthRes;
char growthLck;
char promotionHP;
char promotionPow;
char promotionSkl;
char promotionSpd;
char promotionDef;
char promotionRes;
int attributes;
char rank1;
char rank2;
char rank3;
char rank4;
char rank5;
char rank6;
char rank7;
char rank8;
int battleAnimPtr;
int movCostPtr;
int movCostRainPtr;
int movCostSnowPtr;
int terrainDefBonusPtr;
int terrainAvoBonusPtr;
int terrainResBonusPtr;
int uPtr50;
};
#pragma pack(pop)
/* 11 */
enum Unit
{
UnitLyonCh17 = 0x40,
UnitLyonFinal = 0x6C,
UnitFormortiis = 0xBE,
UnitWall = 0xFE,
UnitSnag = 0xFF,
};
/* 12 */
enum FlagsCAttr
{
CAttrNone = 0x0,
CAttrMountedAid = 0x1,
CAttrCanto = 0x2,
CAttrSteal = 0x4,
CAttrLockpick = 0x8,
CAttrDance = 0x10,
CAttrPlay = 0x20,
CAttrCritBonus = 0x40,
CAttrBallista = 0x80,
CAttrPromoted = 0x100,
CAttrSupply = 0x200,
CAttrMounted = 0x400,
CAttrWyvern = 0x800,
CAttrPegasus = 0x1000,
CAttrLord = 0x2000,
CAttrFemale = 0x4000,
CAttrBoss = 0x8000,
CAttrLock1 = 0x10000,
CAttrLock2 = 0x20000,
CAttrLock3 = 0x40000,
CAttrMaxLevel10 = 0x80000,
};
/* 13 */
enum FlagsIAttr
{
IAttrNone = 0x0,
IAttrWeapon = 0x1,
IAttrMagic = 0x2,
IAttrStaff = 0x4,
IAttrUnbreakable = 0x8,
IAttrUnsellable = 0x10,
IAttrBrave = 0x20,
IAttrMagicDamage = 0x40,
};
/* 14 */
#pragma pack(push, 1)
struct BattleUnitStruct
{
UnitStruct unit;
__int16 weaponAfter;
__int16 weaponBefore;
int weaponAttributes;
char weaponType;
char weaponSlot;
char u52;
char WTHitBonus;
char WTDmgBonus;
char terrainId;
char terrainDef;
char terrainAvo;
char terrainRes;
char u59;
__int16 attack;
__int16 defense;
__int16 attackSpeed;
__int16 hit;
__int16 avoid;
__int16 battleHit;
__int16 crit;
__int16 dodge;
__int16 battleCrit;
__int16 lethalityChance;
char expGained;
char outStatus;
char prevLevel;
char prevExp;
char prevHP;
char hpUp;
char powUp;
char sklUp;
char spdUp;
char defUp;
char resUp;
char lckUp;
char conUp;
char wexpGain;
char nonZeroDmg;
char wpnBroke;
char u7E;
char u7F;
};
#pragma pack(pop)
/* 15 */
#pragma pack(push, 1)
struct ActionStruct
{
__int16 currentRN;
__int16 currentRN2;
__int16 currentRN3;
__int16 pushedRN;
__int16 pushedRN2;
__int16 pushedRN3;
char unitIndex;
char targetIndex;
char xMove;
char yMove;
char moveCount;
char actionId;
char itemSlotIndex;
char xPos2;
char yPos2;
char someTrapType;
char field_16;
char field_17;
int SomeBattleRound;
int field_1C;
int field_20;
int field_24;
char field_28;
char field_29;
char field_2A;
char field_2B;
char field_2C;
char field_2D;
char field_2E;
char field_2F;
char field_30;
char field_31;
char field_32;
char field_33;
char field_34;
char field_35;
char field_36;
char field_37;
};
#pragma pack(pop)
/* 16 */
#pragma pack(push, 1)
struct EventDataPtr
{
int pTurnEvents;
int pCharEvents;
int pLocaEvents;
int pActionEvents;
int u10;
int u14;
int u18;
int u1C_SelectEvents;
int ballistae1;
int ballistae2;
int pAllyUnitsNormal;
int pAllyUnitsHard;
int field_30;
int field_34;
int field_38;
int field_3C;
int field_40;
int field_44;
int pStartScene;
int pEndScene;
};
#pragma pack(pop)
/* 17 */
#pragma pack(push, 1)
struct WMLocationStruct
{
char flags1;
char flags2;
__int16 mapIcon;
char chId_Eirika;
char chId_Ephraim;
__int16 altEvId;
char nextLocUnset_Eirika;
char nextLocUnset_Ephraim;
char nextLocSet_Eirika;
char nextLocSet_Ephraim;
int pArmory;
int pShop;
int pSecretShop;
__int16 xCoord;
__int16 yCoord;
__int16 text;
__int16 shipTravel;
};
#pragma pack(pop)
/* 18 */
#pragma pack(push, 1)
struct ArenaStruct
{
int playerUnitPtr;
int opponentUnitPtr;
char field_8;
char field_9;
char field_A;
char field_B;
char range;
char playerWType;
char opponentWType;
char playerClass;
char opponentClass;
char playerLevel;
char opponentLevel;
char playerMagicDamage;
char opponentMagicDamage;
char pad15;
__int16 playerPowWeight;
__int16 opponentPowWeight;
__int16 playerWeapon;
__int16 opponentWeapon;
__int16 field_1E;
};
#pragma pack(pop)
/* 19 */
#pragma pack(push, 1)
struct PrepListItemStruct
{
char charId;
char itemSlot;
__int16 item;
};
#pragma pack(pop)
/* 20 */
enum HardcodedTextId
{
HammerneUseHelpText = 0x878,
};
/* 21 */
#pragma pack(push, 1)
struct Header6C
{
int EntryPoint;
int NextCall;
int Destructor;
int Callback;
int NamePtr;
int Parent6C;
int FirstChild6C;
int Prev6C;
int Next6C;
__int16 SleepTimer;
char Mark;
char SomeBitfieldMaybe;
char ExecBlockCounter;
};
#pragma pack(pop)
/* 22 */
enum Construct6CCodes
{
_END = 0x0,
_SET_NAME = 0x1,
_CALL = 0x2,
_LOOP = 0x3,
_SET_ON_END = 0x4,
_ADD_CHILD = 0x5,
_ADD_CHILD_BLOCKING = 0x6,
_ADD_MAIN = 0x7,
_BLOCK_WHILE_EXISTS = 0x8,
_DELETE_EACH = 0x9,
_BREAK_EACH = 0xA,
_LABEL = 0xB,
_GOTO = 0xC,
_JUMP = 0xD,
_SLEEP = 0xE,
_MARK = 0xF,
_BLOCK = 0x10,
_DELETE_IF_DUPLICATE = 0x11,
_SET_BIT4 = 0x12,
_13 = 0x13,
_BLOCK_WHILE = 0x14,
_15 = 0x15,
_CALLR_AND_MAYBE_YIELD = 0x16,
_DELETE_EACH_DUPLICATE = 0x17,
_CALLR_ARG = 0x18,
_19 = 0x19,
};
/* 24 */
#pragma pack(push, 1)
struct SomeInternal6CBBStruct
{
int SomeVRAMPointer;
int field_4;
int SomeRoutinePointer;
int SomeRoutinePointer2;
__int16 field_10;
__int16 field_12;
__int16 field_14;
char field_16;
};
#pragma pack(pop)
/* 25 */
#pragma pack(push, 1)
struct TextStruct
{
__int16 VRAMTileIndexOffset;
char xCursor;
char textColorIndex;
char tileWidth;
char useDoubleBuffer;
char currentBufferId;
char field_7;
};
#pragma pack(pop)
/* 23 */
#pragma pack(push, 1)
struct State6CBB
{
Header6C header;
char gap_29[3];
int TextBufferPtr;
SomeInternal6CBBStruct field_30;
char field_47;
TextStruct field_48;
int field_50;
int field_54;
int field_58;
__int16 field_5C;
__int16 field_5E;
int field_60;
int field_64;
int field_68;
};
#pragma pack(pop)
/* 26 */
#pragma pack(push, 1)
struct EventEngine6C
{
Header6C header;
char gap_29[3];
int pActiveIdleRoutine;
int EvPtr;
int EvPtr2;
int pCurrentEvents;
__int16 state;
__int16 stallTimer;
char field_40;
char field_41;
char field_42;
char field_43;
__int16 field_44;
__int16 field_46;
int pUNIT;
__int16 unitCount;
char field_4E;
char loadParameter;
int field_50;
int field_54;
int field_58;
int field_5C;
int field_60;
int field_64;
int field_68;
};
#pragma pack(pop)
/* 27 */
#pragma pack(push, 1)
struct MenuCommandStruct
{
int u0;
__int16 nameId;
__int16 descId;
char color;
char u9;
__int16 uA;
int usabilityRoutine;
int u10;
int effectRoutine;
int u18;
int hoverRoutine;
int changeRoutine;
};
#pragma pack(pop)
/* 28 */
#pragma pack(push, 1)
struct AIStruct
{
__int16 flags;
__int16 xPos;
__int16 yPos;
__int16 delayCountdown;
__int16 OAM2Base;
__int16 drawDepth;
__int16 field_C;
__int16 field_E;
__int16 field_10;
char field_12;
char frameIndex;
char currentCommandCount;
char commandIndex;
char gap_16[2];
int field_18;
int OAM01Base;
int framePtrCurrent;
int framePtrStart;
int pSheetData;
int pSheetBuffer;
int pOAMDataStart;
int Previous;
int Next;
int pOAMData;
int field_40;
int field_44;
};
#pragma pack(pop)
/* 29 */
#pragma pack(push, 1)
struct OAMInterBufferStruct
{
int PreviousOrNext;
__int16 xCoord;
__int16 yCoord;
__int16 OAM2Data;
char gap_A[2];
int pOAMData;
};
#pragma pack(pop)
/* 30 */
#pragma pack(push, 1)
struct KeyBuffer
{
char field_0;
char ContinueFrameCount;
char Downcounter;
char field_3;
__int16 Current;
__int16 TickPresses;
__int16 NewPresses;
__int16 Previous;
__int16 LastPressState;
__int16 ABLRReleases;
__int16 AnotherPress;
__int16 TimeSinceLastPress;
};
#pragma pack(pop)
/* 31 */
#pragma pack(push, 1)
struct MovementFillStruct
{
int posStructPtr;
int fillStatePtr;
char hasUnitBool;
char movement;
char unitIndex;
char maxMovValue;
};
#pragma pack(pop)
/* 32 */
#pragma pack(push, 1)
struct RTextStruct
{
int UpRText;
int DownRText;
int LeftRText;
int RightRText;
char xPos;
char yPos;
__int16 textId;
int LooperRoutine;
int TextGetter;
};
#pragma pack(pop)
/* 33 */
enum SpellAssocFacing
{
SAF_Target = 0x0,
SAF_Up = 0x1,
SAF_Right = 0x2,
SAF_Standing = 0x3,
};
/* 35 */
#pragma pack(push, 1)
struct BattleAnimStruct
{
int pUnit;
int pBattleUnit;
int pMOVEUNIT;
char maxHP;
char prevHP;
char field_E;
char field_F;
char field_10;
char field_11;
char field_12;
char field_13;
};
#pragma pack(pop)
/* 36 */
#pragma pack(push, 1)
struct UnitEventStruct
{
char charId;
char classId;
char leadId;
char levelAllAuto;
__int16 position_flags;
char u6;
char redaCount;
int pREDA;
char item1;
char item2;
char item3;
char item4;
char ai1;
char ai2;
char ai3;
char ai4;
};
#pragma pack(pop)
/* 37 */
#pragma pack(push, 1)
struct TCS
{
int ROMTCS;
int FrameDataPointer;
int AnimDataStart;
int AnimDataCursor;
int OAMDataPointer;
int RotScalePointer;
__int16 cycleTimer;
__int16 cycleTimeStep;
__int16 CurrentSubCycleTime;
__int16 OAMIndex;
char GfxUpdateNeeded;
char RotScaleIndex;
__int16 OAM2Data;
int GfxPointer;
};
#pragma pack(pop)
/* 38 */
#pragma pack(push, 1)
struct GmapUnit6C
{
Header6C header;
char gap_29[1];
__int16 field_2A;
__int16 someOAMIndex;
__int16 field_2E;
int field_30;
char index;
char field_35;
char field_36;
char field_37;
__int16 classId;
__int16 classId2;
__int16 field_3C;
__int16 field_3E;
int pMMSTCS;
int field_44;
int field_48;
int field_4C;
int field_50;
int field_54;
int field_58;
int field_5C;
int field_60;
int field_64;
int field_68;
};
#pragma pack(pop)
/* 53 */
#pragma pack(push, 1)
struct BattleAnimUnitStruct
{
int pUnit;
int field_4;
int pMOVEUNIT;
char field_C;
char field_D;
char field_E;
char field_F;
char field_10;
char field_11;
char field_12;
char field_13;
};
#pragma pack(pop)
/* 39 */
#pragma pack(push, 1)
struct MapAnimMasterStruct
{
BattleAnimUnitStruct BAS[4];
int pCurrentRound;
int p6CItemMapAnim;
char subjectBASIndex;
char targetBASIndex;
__int16 currentRoundLoBits;
char field_5C;
char field_5D;
char spellAssocCharCount;
char someBoolOrTimer;
char someX;
char someY;
char field_62;
};
#pragma pack(pop)
/* 40 */
#pragma pack(push, 1)
struct MOVEUNIT6C
{
Header6C header;
char gap_29[3];
int unit;
int tcs;
int extraDataPointer;
int vramPtr;
char sprFrameId;
char gap_3D[1];
char cameraFollow;
char state;
char field_40;
char classId;
char field_42;
char field_43;
char field_44;
char field_45;
__int16 OAMPriorityMask;
__int16 field_48;
__int16 field_4A;