Store SPU Block Address

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

0001afc4: 27bdffe8 addiu r29,r29,0xffe8
0001afc8: 00802821 addu r5,r4,r0               volume to set? / callers seem to imply this is actually SPU address?
0001afcc: 3c020007 lui r2,0x0007
0001afd0: 3442efe8 ori r2,r2,0xefe8            0x0007efe8
0001afd4: 24a3eff0 addiu r3,r5,0xeff0          SPU address - 0x1010
0001afd8: 0043102b sltu r2,r2,r3              
0001afdc: 14400009 bne r2,r0,0x0001b004        branch if SPU address is beyond SPU bounds?
0001afe0: afbf0010 sw r31,0x0010(r29)
0001afe4: 0c006483 jal 0x0001920c              Set Voice Volume Left/Right Scaled
0001afe8: 2404ffff addiu r4,r0,0xffff          set volume of channel -1? makes it return p2 >> 0x6 without setting volume
0001afec: 3c018003 lui r1,0x8003
0001aff0: a422ad5c sh r2,-0x52a4(r1)           store address
0001aff4: 3c028003 lui r2,0x8003
0001aff8: 9442ad5c lhu r2,-0x52a4(r2)          end return address >> 6
0001affc: 08006c02 j 0x0001b008
0001b000: 00000000 nop
0001b004: 00001021 addu r2,r0,r0               return 0
0001b008: 8fbf0010 lw r31,0x0010(r29)
0001b00c: 27bd0018 addiu r29,r29,0x0018
0001b010: 03e00008 jr r31
0001b014: 00000000 nop