Differences between GBA version and WiiU VC version

This topic researches the difference between GBA version & WiiU VC version of FE7U & FE8U.


FE7U


Function Proc_Initialize

0000445C: 3F 41 > MAX_PROC_COUNT - 1
00004468: 08 46 > str r0, [r1] => stmia [r0]!, r1-r2, r6
00004469: 60 C0

remove

sProcessAllocList[MAX_PROC_COUNT] = NULL;

00004488: 28 00 > 02022869 => 0203F000
00004489: 69 F0
0000448A: 02 03


Function Proc_Find

000046C0: 3F 41 > MAX_PROC_COUNT - 1


000046EC: 3F 41
00004718: 3F 41
00004772: 3F 41
0000479C: 3F 41
000047C4: 3F 41
000047EA: 3F 41
0000480E: 3F 41


Function Proc_DeleteEachWithMark

00004834: 70 F0
0000483A: 3F 42 > 3F => (41+1): cmp r5, 0 => cmp r5, 1
0000483C: 20 26
0000483D: 1C 27
0000483E: 26 E0
0000483F: 30 5D
00004840: 00 B0
00004841: 78 42
00004842: B0 05
00004843: 42 D1
00004844: 02 20
00004845: D1 68
00004846: 20 00
00004847: 1C 28
00004848: FF 02
00004849: F7 D0
0000484A: 9C 20
0000484B: FE 1C
0000484C: 01 FF
0000484D: 3D F7
0000484E: 6C 9A
0000484F: 34 FE
00004850: 00 6C
00004851: 2D 34
00004852: F3 01
00004853: DA 3D
00004854: 70 F3
00004855: BC D1
00004856: 01 F0
00004858: 00 01
00004859: 47 BC
0000485B: 00 47


00004AF2: 3F 41
00004B3C: 3F 41


Function Proc_FindAfter

00004C8C: 28 00
00004C8D: 69 6A > 2026928 => 2026A00: 2026A00 - 2026928 = 6C x 2


Function Proc_FindAfterWithParent

00004C90: 02 00
00004C91: 1C 28
00004C92: 00 01
00004C93: 2A D1
00004C94: 06 08
00004C95: D1 48
00004C96: 01 00
00004C97: 4A E0
00004C98: 05 6C
00004C99: E0 30
00004C9A: 00 08
00004C9B: 00 4A
00004C9C: 28 90
00004C9D: 4E 42
00004C9E: 02 08
00004C9F: 02 D2
00004CA0: 10 03
00004CA1: 1C 68
00004CA2: 0B 00
00004CA3: E0 2B
00004CA4: 6C 02
00004CA5: 32 D0
00004CA6: 06 43
00004CA7: 48 69
00004CA8: 82 8B
00004CAA: 06 03
00004CAB: D2 D0
00004CAC: 03 6C
00004CAD: 1C 30
00004CAE: 50 90
00004CAF: 69 42
00004CB0: 88 F6
00004CB1: 42 D3
00004CB2: F5 00
00004CB3: D0 20
00004CB4: 6C 70
00004CB5: 32 47
00004CB6: 9A 00
00004CB7: 42 00
00004CB8: F9 28
00004CB9: D3 4E
00004CBA: 00 02
00004CBB: 20 02
00004CBC: 70 28
00004CBD: 47 69
00004CBE: 00 02
00004CBF: 00 02
00004CC0: 28 00
00004CC1: 69 00
00004CC2: 02 00
00004CC3: 02 00


Function Proc_GetValidProcNum

00004CC4: 40 42 > MAX_PROC_COUNT
00004CE4: 94 6C > 1A94 = 6C x 3F; 1B6C = 6C x 41
00004CE5: 1A 1B


Function SpellAnim_Shine

0005EFB4: 28 46 > 46 C0 = stmia [r0]!, r1-r2, r6; C0 46 = nop
0005EFB5: 1C C0
0005EFB6: 05 46
0005EFB7: 21 C0
0005EFB8: F0 46
0005EFB9: F7 C0
0005EFBA: 10 46
0005EFBB: F8 C0

remove call to function StartSpellBG_FLASH


Function SpellAnim_Superdruid

00061CA8: E0 46
00061CA9: 6D C0
00061CAA: 0A 46
00061CAB: 21 C0
00061CAC: ED 46
00061CAD: F7 C0
00061CAE: 96 46
00061CAF: F9 C0

remove call to function StartSpellBG_FLASH


Conclusion:

  1. Expand max proc number from 64 to 66
  2. Remove BG flash effect in spell animation Shine & Ereshkigal

FE8U


Function Proc_Delete

00002D6C: 10 00 > ldr r1,=0x8FFC001
00002D6D: B5 49
00002D6E: 04 08 > bx r1
00002D6F: 1C 47
00002D70: 00 01 > 0x8FFC001
00002D71: 2C C0
00002D72: 04 FF
00002D73: D0 08
00002D75: F0 00
00002D76: 34 00
00002D77: F8 00
00002D78: 20 00
00002D79: 1C 00
00002D7A: FF 00
00002D7B: F7 00
00002D7C: C9 00
00002D7D: FF 00
00002D7E: 10 00
00002D7F: BC 00
00002D80: 01 00
00002D81: BC 00
00002D83: 47 00


00FFC000: FF 00 > new Proc_Delete function
00FFC001: FF 28
00FFC002: FF 0E
00FFC003: FF D0
00FFC004: FF 01
00FFC005: FF 68
00FFC006: FF 00
00FFC007: FF 29
00FFC008: FF 0B
00FFC009: FF D0
00FFC00A: FF 10
00FFC00B: FF B5
00FFC00C: FF 04
00FFC00D: FF 1C
00FFC00E: FF 05
00FFC00F: FF 49
00FFC010: FF 8E
00FFC011: FF 46
00FFC012: FF 00
00FFC013: FF F8
00FFC014: FF 20
00FFC015: FF 1C
00FFC016: FF 04
00FFC017: FF 49
00FFC018: FF 8E
00FFC019: FF 46
00FFC01A: FF 00
00FFC01B: FF F8
00FFC01C: FF 10
00FFC01D: FF BC
00FFC01E: FF 01
00FFC01F: FF BC
00FFC020: FF 00
00FFC021: FF 47
00FFC022: FF 70
00FFC023: FF 47
00FFC024: FF E1
00FFC025: FF 2D
00FFC026: FF 00
00FFC027: FF 08
00FFC028: FF 11
00FFC029: FF 2D
00FFC02A: FF 00
00FFC02B: FF 08


// GBA version
void Proc_Delete(struct Proc *proc)
{
    if (proc != NULL)
    {
        UnlinkProcess(proc);
        DeleteProcessRecursive(proc);
    }
}
// WiiU VC version
void Proc_Delete(struct Proc *proc)
{
    if (proc != NULL && proc->script != NULL)
    {
        UnlinkProcess(proc);
        DeleteProcessRecursive(proc);
    }
}

Conclusion:
Add a judgement to decide whether the first word of the proc is a null pointer when delete a proc


Summary:

  • WiiU VC version of FE7U
  1. Expand max proc number from 64 to 66 in Proc related functions
  2. Remove BG flash effect in spell animation Shine & Ereshkigal
  • WiiU VC version of FE8U
    Add a judgement to function Proc_Delete

Interesting Point
I guess it wanted to nop some instructions but made a mistake in little endian.
C0 46: nop (mov r8, r8)
46 C0: stmia [r0]!, r1-r2, r6

6 Likes

I have no idea what this means but this is cool.

3 Likes

I will analyze it little by little. ROM hacking is such a process from binary to meaning.

1 Like

Is it possible to compare FE8U to the version that’s given through the Ambassador Program on the 3DS?

1 Like

Since GBAFE has a bug caused by procs exhaustion, it seems reasonable to increase the number of procs.
Fimbulvetr’s magic, snow is represented by particles using procs, so if it runs out, it will cause a crash.
I change the routine that generates snow to prevent crashes, but I think it’s reasonable to increase the amount of procs because there is memory left.

Have other bugs in GBAFE been fixed?

mine glitch
FE8U 377A0

Resire glitch
FE8U 2BC2C

1 Like

Interesting. Looking forward to seeing what else you find.

It occurred to me once, that since the procs are allocated in a static pool and there are certainly less than 256 of them, that several pointers in the struct could be converted to byte indexes instead. That would also save some space and allow for more of them, yeah? (Or to support some other hack)

1 Like

All changes are listed here. FE8U only changes one function, Proc_Delete().

1 Like

It depends on whether you can extract gba rom from 3ds dump .cia/.3ds.