Find space for SMD to MUS

From Final Fantasy Hacktics Wiki
(Redirected from 00014278 - 00014354)
Jump to navigation Jump to search

p1 = Size needed for current Music file
00014278: 27bdffe8 addiu r29,r29,0xffe8
0001427c: 00802821 addu r5,r4,r0                num channel var
00014280: 24a2000f addiu r2,r5,0x000f           
00014284: 2403fff0 addiu r3,r0,0xfff0
00014288: 8f840040 lw r4,0x0040(r28)            0x40 global variable (0x800370bc?)
0001428c: 00431024 and r2,r2,r3                 round up num channel var
00014290: afbf0014 sw r31,0x0014(r29)
00014294: afb00010 sw r16,0x0010(r29)
00014298: 8c83000c lw r3,0x000c(r4)
0001429c: 00000000 nop
000142a0: 1060000c beq r3,r0,0x000142d4
000142a4: 24460010 addiu r6,r2,0x0010           num channel var + 0x10
000142a8: 8c83000c lw r3,0x000c(r4)
000142ac: 8c820008 lw r2,0x0008(r4)             pointer to SMD data?
000142b0: 00000000 nop
000142b4: 00621023 subu r2,r3,r2
000142b8: 0046102b sltu r2,r2,r6                
000142bc: 1040000c beq r2,r0,0x000142f0         branch if less than?
000142c0: 00000000 nop
000142c4: 8c62000c lw r2,0x000c(r3)
000142c8: 00000000 nop
000142cc: 1440fff6 bne r2,r0,0x000142a8
000142d0: 00602021 addu r4,r3,r0
000142d4: 8f8300a8 lw r3,0x00a8(r28)
000142d8: 8c820008 lw r2,0x0008(r4)
000142dc: 00000000 nop
000142e0: 00621023 subu r2,r3,r2
000142e4: 0046102b sltu r2,r2,r6
000142e8: 14400015 bne r2,r0,0x00014340
000142ec: 00000000 nop
000142f0: 8c820008 lw r2,0x0008(r4)
000142f4: 2403fff0 addiu r3,r0,0xfff0
000142f8: 2442000f addiu r2,r2,0x000f
000142fc: 00431024 and r2,r2,r3
00014300: 24500010 addiu r16,r2,0x0010
00014304: 02051821 addu r3,r16,r5
00014308: ac430008 sw r3,0x0008(r2)
0001430c: 34030002 ori r3,r0,0x0002
00014310: ac40000c sw r0,0x000c(r2)
00014314: ac400004 sw r0,0x0004(r2)
00014318: a4430000 sh r3,0x0000(r2)
0001431c: a4400002 sh r0,0x0002(r2)
00014320: 8c83000c lw r3,0x000c(r4)
00014324: 00000000 nop
00014328: ac43000c sw r3,0x000c(r2)
0001432c: ac82000c sw r2,0x000c(r4)
00014330: 0c005134 jal 0x000144d0
00014334: 02002021 addu r4,r16,r0
00014338: 080050d1 j 0x00014344
0001433c: 02001021 addu r2,r16,r0
00014340: 00001021 addu r2,r0,r0
00014344: 8fbf0014 lw r31,0x0014(r29)
00014348: 8fb00010 lw r16,0x0010(r29)
0001434c: 27bd0018 addiu r29,r29,0x0018
00014350: 03e00008 jr r31
00014354: 00000000 nop