Final Fantasy Hacktics

Modding => Help! => Topic started by: stardragoon9 on October 11, 2018, 11:54:56 am

Title: Unaligned offset at address xxxx
Post by: stardragoon9 on October 11, 2018, 11:54:56 am
When i try to use "Equip X Hack" from Razele,i got this error message from FFTorgASM.

What is this error about?Would it mess up the game?Should i ignore it?

Same goes for Pokeytax's "Inherent R/S/M Limitation Hack"
Title: Re: Unaligned offset at address xxxx
Post by: xjamxx on October 11, 2018, 12:25:02 pm
Ignore. The warning in this case is cuz:
lw r2,0x004a(r4)
nop
or r2,r2,r3
sw r2,0x004a(r4)

'lw' and 'sw' asm instrucctions load and save 32 bits in memory and if you start from 0000 then aligned address should be xxx0 - xxx4 - xxx8 - xxxc. The author of that hack put xxxa to modify two 32 bits aligned slots in memory with a single instruction (16 bit of one slot and 16 bit of another). It may not be the best practice, but it save code space.

UPDATE: didn't know that Glain, i guess i haven't play on my console for more than 18 years. But if Glain says so, then just don't use it if u are going for console.
I never bother to asm the 'event instruction upgrade' hack, but from what i recall it had some offset not aligned, so that hack won't work with consoles too?
Title: Re: Unaligned offset at address xxxx
Post by: stardragoon9 on October 11, 2018, 01:47:29 pm
Quote from: xjamxx on October 11, 2018, 12:25:02 pm
Ignore. The warning in this case is cuz:
lw r2,0x004a(r4)
nop
or r2,r2,r3
sw r2,0x004a(r4)

'lw' and 'sw' asm instrucctions load and save 32 bits in memory and if you start from 0000 then aligned address should be xxx0 - xxx4 - xxx8 - xxxc. The author of that hack put xxxa to modify two 32 bits aligned slots in memory with a single instruction (16 bit of one slot and 16 bit of another). It may not be the best practice, but it save code space.


Thanks,i'll ignore it and use the hack!

BTW I tried really hard to understand the "reason" part but failed :oops: I'm a complete idiot when it comes to assembly language  :(
Title: Re: Unaligned offset at address xxxx
Post by: Glain on October 11, 2018, 04:40:11 pm
This will cause the game to crash on console.  Some emulators may allow it.  Use at your own risk.

EDIT - The hardware doesn't allow doing unaligned loads and stores using lw/lh/lhu and sw/sh.  I wouldn't recommend using any hack that does it.  Any emulator that does allow it is not emulating the hardware correctly.
Unaligned loads/stores of 4-byte values can be done with lwl/lwr/swl/swr but you need to use 2 instructions a shot.

EDIT - Event Instruction Upgrade v1.13 doesn't have unaligned loads/stores.
Title: Re: Unaligned offset at address xxxx
Post by: Pride on October 12, 2018, 10:56:44 pm
This one should be correct
Title: Re: Unaligned offset at address xxxx
Post by: stardragoon9 on October 13, 2018, 04:10:55 am
Quote from: Glain on October 11, 2018, 04:40:11 pm
This will cause the game to crash on console.  Some emulators may allow it.  Use at your own risk.

EDIT - The hardware doesn't allow doing unaligned loads and stores using lw/lh/lhu and sw/sh.  I wouldn't recommend using any hack that does it.  Any emulator that does allow it is not emulating the hardware correctly.
Unaligned loads/stores of 4-byte values can be done with lwl/lwr/swl/swr but you need to use 2 instructions a shot.

EDIT - Event Instruction Upgrade v1.13 doesn't have unaligned loads/stores.


Got it
Title: Re: Unaligned offset at address xxxx
Post by: stardragoon9 on October 13, 2018, 04:11:09 am
Quote from: Pride on October 12, 2018, 10:56:44 pm
This one should be correct


Thank you!