.include "macros.inc" .section .sdata2 .balign 8 .global lbl_805AF230 lbl_805AF230: # ROM: 0x3FBAD0 .4byte 0x3C010204 .global lbl_805AF234 lbl_805AF234: # ROM: 0x3FBAD4 .4byte 0x34010204 .global lbl_805AF238 lbl_805AF238: # ROM: 0x3FBAD8 .4byte 0x39000000 .global lbl_805AF23C lbl_805AF23C: # ROM: 0x3FBADC .4byte 0x39800000 .global lbl_805AF240 lbl_805AF240: # ROM: 0x3FBAE0 .float 1.0 .global lbl_805AF244 lbl_805AF244: # ROM: 0x3FBAE4 .4byte 0x32800200 .global lbl_805AF248 lbl_805AF248: # ROM: 0x3FBAE8 .float 0.2 .global lbl_805AF24C lbl_805AF24C: # ROM: 0x3FBAEC .4byte 0x38800200 .global lbl_805AF250 lbl_805AF250: # ROM: 0x3FBAF0 .4byte 0x46FFFE00 .4byte 0 .global lbl_805AF258 lbl_805AF258: # ROM: 0x3FBAF8 .4byte 0x43300000 .4byte 0 .global lbl_805AF260 lbl_805AF260: # ROM: 0x3FBB00 .double 4.503601774854144E15 .global lbl_805AF268 lbl_805AF268: # ROM: 0x3FBB08 .4byte 0 .global lbl_805AF26C lbl_805AF26C: # ROM: 0x3FBB0C .4byte 0x44A00000 .section .bss .balign 8 .global synthTicksPerSecond synthTicksPerSecond: .skip 0x240 .global synthInfo synthInfo: .skip 0x214 .global synthMasterFader synthMasterFader: .skip 0x600 .global synthTrackVolume synthTrackVolume: .skip 0x40 .global synthJobTable synthJobTable: .skip 0x180 .global synthAuxAUser synthAuxAUser: .skip 0x20 .global synthAuxACallback synthAuxACallback: .skip 0x20 .global synthAuxBUser synthAuxBUser: .skip 0x20 .global synthAuxBCallback synthAuxBCallback: .skip 0x20 .global synthITDDefault synthITDDefault: .skip 0x10 .global synthGlobalVariable synthGlobalVariable: .skip 0x40 .global inpAuxB inpAuxB: .skip 0x480 .global inpAuxA inpAuxA: .skip 0x480 .section .sbss .balign 8 .global sndActive sndActive: .skip 0x1 .global synthJobTableIndex synthJobTableIndex: .skip 0x3 .global synthAuxBMIDISet synthAuxBMIDISet: .skip 0x8 .global synthAuxBMIDI synthAuxBMIDI: .skip 0x8 .global synthAuxAMIDISet synthAuxAMIDISet: .skip 0x8 .global synthAuxAMIDI synthAuxAMIDI: .skip 0x8 .global synthMasterFaderPauseActiveFlags synthMasterFaderPauseActiveFlags: .skip 0x4 .global synthMasterFaderActiveFlags synthMasterFaderActiveFlags: .skip 0x4 .global synthFlags synthFlags: .skip 0x4 .global synthVoice synthVoice: .skip 0x4 .global synthMessageCallback synthMessageCallback: .skip 0x4 .global synthIdleWaitActive synthIdleWaitActive: .skip 0x8 .global synthRealTime synthRealTime: .skip 0x8 .section .text, "ax" .global synthSetBpm synthSetBpm: /* 80398CA0 00395C00 54 80 06 3E */ clrlwi r0, r4, 0x18 /* 80398CA4 00395C04 28 00 00 FF */ cmplwi r0, 0xff /* 80398CA8 00395C08 40 82 00 08 */ bne lbl_80398CB0 /* 80398CAC 00395C0C 38 80 00 08 */ li r4, 8 lbl_80398CB0: /* 80398CB0 00395C10 54 60 18 38 */ slwi r0, r3, 3 /* 80398CB4 00395C14 3C C0 88 89 */ lis r6, 0x88888889@ha /* 80398CB8 00395C18 1C 00 06 00 */ mulli r0, r0, 0x600 /* 80398CBC 00395C1C 3C 60 80 55 */ lis r3, synthTicksPerSecond@ha /* 80398CC0 00395C20 38 C6 88 89 */ addi r6, r6, 0x88888889@l /* 80398CC4 00395C24 54 84 34 B2 */ rlwinm r4, r4, 6, 0x12, 0x19 /* 80398CC8 00395C28 7C C6 00 16 */ mulhwu r6, r6, r0 /* 80398CCC 00395C2C 38 63 FE 10 */ addi r3, r3, synthTicksPerSecond@l /* 80398CD0 00395C30 54 A0 15 BA */ rlwinm r0, r5, 2, 0x16, 0x1d /* 80398CD4 00395C34 7C 63 22 14 */ add r3, r3, r4 /* 80398CD8 00395C38 54 C4 C9 FE */ srwi r4, r6, 7 /* 80398CDC 00395C3C 7C 83 01 2E */ stwx r4, r3, r0 /* 80398CE0 00395C40 4E 80 00 20 */ blr .global synthGetTicksPerSecond synthGetTicksPerSecond: /* 80398CE4 00395C44 88 03 01 22 */ lbz r0, 0x122(r3) /* 80398CE8 00395C48 38 80 00 08 */ li r4, 8 /* 80398CEC 00395C4C 28 00 00 FF */ cmplwi r0, 0xff /* 80398CF0 00395C50 41 82 00 08 */ beq lbl_80398CF8 /* 80398CF4 00395C54 7C 04 03 78 */ mr r4, r0 lbl_80398CF8: /* 80398CF8 00395C58 88 03 01 23 */ lbz r0, 0x123(r3) /* 80398CFC 00395C5C 3C 60 80 55 */ lis r3, synthTicksPerSecond@ha /* 80398D00 00395C60 54 84 30 32 */ slwi r4, r4, 6 /* 80398D04 00395C64 38 63 FE 10 */ addi r3, r3, synthTicksPerSecond@l /* 80398D08 00395C68 54 00 10 3A */ slwi r0, r0, 2 /* 80398D0C 00395C6C 7C 63 22 14 */ add r3, r3, r4 /* 80398D10 00395C70 7C 63 00 2E */ lwzx r3, r3, r0 /* 80398D14 00395C74 4E 80 00 20 */ blr .global synthInitPortamento synthInitPortamento: /* 80398D18 00395C78 80 83 01 14 */ lwz r4, 0x114(r3) /* 80398D1C 00395C7C 38 C0 00 00 */ li r6, 0 /* 80398D20 00395C80 80 E3 01 18 */ lwz r7, 0x118(r3) /* 80398D24 00395C84 3C 00 00 02 */ lis r0, 2 /* 80398D28 00395C88 7C 85 30 38 */ and r5, r4, r6 /* 80398D2C 00395C8C 7C E0 00 38 */ and r0, r7, r0 /* 80398D30 00395C90 7C 04 32 78 */ xor r4, r0, r6 /* 80398D34 00395C94 7C A0 32 78 */ xor r0, r5, r6 /* 80398D38 00395C98 7C 80 03 79 */ or. r0, r4, r0 /* 80398D3C 00395C9C 4C 82 00 20 */ bnelr /* 80398D40 00395CA0 88 03 01 31 */ lbz r0, 0x131(r3) /* 80398D44 00395CA4 28 00 00 01 */ cmplwi r0, 1 /* 80398D48 00395CA8 40 82 00 30 */ bne lbl_80398D78 /* 80398D4C 00395CAC 38 80 10 00 */ li r4, 0x1000 /* 80398D50 00395CB0 7C A0 32 78 */ xor r0, r5, r6 /* 80398D54 00395CB4 7C E4 20 38 */ and r4, r7, r4 /* 80398D58 00395CB8 7C 84 32 78 */ xor r4, r4, r6 /* 80398D5C 00395CBC 7C 80 03 79 */ or. r0, r4, r0 /* 80398D60 00395CC0 40 82 00 0C */ bne lbl_80398D6C /* 80398D64 00395CC4 90 C3 01 3C */ stw r6, 0x13c(r3) /* 80398D68 00395CC8 48 00 00 18 */ b lbl_80398D80 lbl_80398D6C: /* 80398D6C 00395CCC 80 03 01 34 */ lwz r0, 0x134(r3) /* 80398D70 00395CD0 90 03 01 3C */ stw r0, 0x13c(r3) /* 80398D74 00395CD4 48 00 00 0C */ b lbl_80398D80 lbl_80398D78: /* 80398D78 00395CD8 80 03 01 34 */ lwz r0, 0x134(r3) /* 80398D7C 00395CDC 90 03 01 3C */ stw r0, 0x13c(r3) lbl_80398D80: /* 80398D80 00395CE0 88 03 01 30 */ lbz r0, 0x130(r3) /* 80398D84 00395CE4 54 00 80 1E */ slwi r0, r0, 0x10 /* 80398D88 00395CE8 90 03 01 38 */ stw r0, 0x138(r3) /* 80398D8C 00395CEC 4E 80 00 20 */ blr .global do_voice_portamento do_voice_portamento: /* 80398D90 00395CF0 94 21 FF C0 */ stwu r1, -0x40(r1) /* 80398D94 00395CF4 7C 08 02 A6 */ mflr r0 /* 80398D98 00395CF8 90 01 00 44 */ stw r0, 0x44(r1) /* 80398D9C 00395CFC 39 61 00 40 */ addi r11, r1, 0x40 /* 80398DA0 00395D00 4B FF 0C B9 */ bl _savegpr_18 /* 80398DA4 00395D04 7C 72 1B 78 */ mr r18, r3 /* 80398DA8 00395D08 3C 60 80 55 */ lis r3, synthInfo@ha /* 80398DAC 00395D0C 83 2D AE 78 */ lwz r25, synthVoice@sda21(r13) /* 80398DB0 00395D10 7C 93 23 78 */ mr r19, r4 /* 80398DB4 00395D14 7C B4 2B 78 */ mr r20, r5 /* 80398DB8 00395D18 7C D5 33 78 */ mr r21, r6 /* 80398DBC 00395D1C 7C F6 3B 78 */ mr r22, r7 /* 80398DC0 00395D20 56 5D 06 3E */ clrlwi r29, r18, 0x18 /* 80398DC4 00395D24 3B E3 00 50 */ addi r31, r3, synthInfo@l /* 80398DC8 00395D28 3A E0 00 00 */ li r23, 0 /* 80398DCC 00395D2C 3B 60 FF FF */ li r27, -1 /* 80398DD0 00395D30 3B 80 00 00 */ li r28, 0 /* 80398DD4 00395D34 3B C0 00 00 */ li r30, 0 /* 80398DD8 00395D38 48 00 01 F8 */ b lbl_80398FD0 lbl_80398DDC: /* 80398DDC 00395D3C 88 19 01 1C */ lbz r0, 0x11c(r25) /* 80398DE0 00395D40 28 00 00 00 */ cmplwi r0, 0 /* 80398DE4 00395D44 40 82 01 E0 */ bne lbl_80398FC4 /* 80398DE8 00395D48 80 79 00 F4 */ lwz r3, 0xf4(r25) /* 80398DEC 00395D4C 3C 03 00 01 */ addis r0, r3, 1 /* 80398DF0 00395D50 28 00 FF FF */ cmplwi r0, 0xffff /* 80398DF4 00395D54 41 82 01 D0 */ beq lbl_80398FC4 /* 80398DF8 00395D58 88 79 01 21 */ lbz r3, 0x121(r25) /* 80398DFC 00395D5C 56 60 06 3E */ clrlwi r0, r19, 0x18 /* 80398E00 00395D60 7C 03 00 40 */ cmplw r3, r0 /* 80398E04 00395D64 40 82 01 C0 */ bne lbl_80398FC4 /* 80398E08 00395D68 88 79 01 22 */ lbz r3, 0x122(r25) /* 80398E0C 00395D6C 56 80 06 3E */ clrlwi r0, r20, 0x18 /* 80398E10 00395D70 7C 03 00 40 */ cmplw r3, r0 /* 80398E14 00395D74 40 82 01 B0 */ bne lbl_80398FC4 /* 80398E18 00395D78 80 19 01 14 */ lwz r0, 0x114(r25) /* 80398E1C 00395D7C 38 C0 00 00 */ li r6, 0 /* 80398E20 00395D80 80 79 01 18 */ lwz r3, 0x118(r25) /* 80398E24 00395D84 38 A0 00 02 */ li r5, 2 /* 80398E28 00395D88 7C 04 30 38 */ and r4, r0, r6 /* 80398E2C 00395D8C 7C 65 28 38 */ and r5, r3, r5 /* 80398E30 00395D90 7C A5 32 78 */ xor r5, r5, r6 /* 80398E34 00395D94 7C 84 32 78 */ xor r4, r4, r6 /* 80398E38 00395D98 7C A4 23 79 */ or. r4, r5, r4 /* 80398E3C 00395D9C 41 82 00 08 */ beq lbl_80398E44 /* 80398E40 00395DA0 3A E0 00 01 */ li r23, 1 lbl_80398E44: /* 80398E44 00395DA4 38 80 00 10 */ li r4, 0x10 /* 80398E48 00395DA8 38 C0 00 00 */ li r6, 0 /* 80398E4C 00395DAC 7C 65 20 38 */ and r5, r3, r4 /* 80398E50 00395DB0 7C 04 30 38 */ and r4, r0, r6 /* 80398E54 00395DB4 7C A5 32 78 */ xor r5, r5, r6 /* 80398E58 00395DB8 7C 84 32 78 */ xor r4, r4, r6 /* 80398E5C 00395DBC 7C A4 23 79 */ or. r4, r5, r4 /* 80398E60 00395DC0 41 82 01 64 */ beq lbl_80398FC4 /* 80398E64 00395DC4 38 A0 00 08 */ li r5, 8 /* 80398E68 00395DC8 38 80 01 00 */ li r4, 0x100 /* 80398E6C 00395DCC 7C 63 28 38 */ and r3, r3, r5 /* 80398E70 00395DD0 7C 00 20 38 */ and r0, r0, r4 /* 80398E74 00395DD4 7C 63 2A 78 */ xor r3, r3, r5 /* 80398E78 00395DD8 7C 00 32 78 */ xor r0, r0, r6 /* 80398E7C 00395DDC 7C 60 03 79 */ or. r0, r3, r0 /* 80398E80 00395DE0 41 82 01 44 */ beq lbl_80398FC4 /* 80398E84 00395DE4 7F 83 E3 78 */ mr r3, r28 /* 80398E88 00395DE8 48 01 A3 15 */ bl hwIsActive /* 80398E8C 00395DEC 28 03 00 00 */ cmplwi r3, 0 /* 80398E90 00395DF0 41 82 01 34 */ beq lbl_80398FC4 /* 80398E94 00395DF4 3C 1B 00 01 */ addis r0, r27, 1 /* 80398E98 00395DF8 28 00 FF FF */ cmplwi r0, 0xffff /* 80398E9C 00395DFC 40 82 00 40 */ bne lbl_80398EDC /* 80398EA0 00395E00 3C 80 00 02 */ lis r4, 0x00020002@ha /* 80398EA4 00395E04 80 19 01 14 */ lwz r0, 0x114(r25) /* 80398EA8 00395E08 38 A0 00 00 */ li r5, 0 /* 80398EAC 00395E0C 80 79 01 18 */ lwz r3, 0x118(r25) /* 80398EB0 00395E10 38 84 00 02 */ addi r4, r4, 0x00020002@l /* 80398EB4 00395E14 7C 83 18 38 */ and r3, r4, r3 /* 80398EB8 00395E18 7C A0 00 38 */ and r0, r5, r0 /* 80398EBC 00395E1C 7C 83 1A 78 */ xor r3, r4, r3 /* 80398EC0 00395E20 7C A0 02 78 */ xor r0, r5, r0 /* 80398EC4 00395E24 7C 60 03 79 */ or. r0, r3, r0 /* 80398EC8 00395E28 40 82 00 14 */ bne lbl_80398EDC /* 80398ECC 00395E2C 38 00 00 01 */ li r0, 1 /* 80398ED0 00395E30 38 60 FF FF */ li r3, -1 /* 80398ED4 00395E34 90 16 00 00 */ stw r0, 0(r22) /* 80398ED8 00395E38 48 00 01 40 */ b lbl_80399018 lbl_80398EDC: /* 80398EDC 00395E3C 88 19 01 2E */ lbz r0, 0x12e(r25) /* 80398EE0 00395E40 3C 60 51 EC */ lis r3, 0x51EB851F@ha /* 80398EE4 00395E44 38 83 85 1F */ addi r4, r3, 0x51EB851F@l /* 80398EE8 00395E48 A0 B9 01 2C */ lhz r5, 0x12c(r25) /* 80398EEC 00395E4C 7C 00 07 74 */ extsb r0, r0 /* 80398EF0 00395E50 38 60 00 00 */ li r3, 0 /* 80398EF4 00395E54 54 00 80 1E */ slwi r0, r0, 0x10 /* 80398EF8 00395E58 54 A6 80 1E */ slwi r6, r5, 0x10 /* 80398EFC 00395E5C 7C 84 00 96 */ mulhw r4, r4, r0 /* 80398F00 00395E60 7F 38 CB 78 */ mr r24, r25 /* 80398F04 00395E64 3C 00 00 02 */ lis r0, 2 /* 80398F08 00395E68 7C 84 2E 70 */ srawi r4, r4, 5 /* 80398F0C 00395E6C 54 85 0F FE */ srwi r5, r4, 0x1f /* 80398F10 00395E70 7C 84 2A 14 */ add r4, r4, r5 /* 80398F14 00395E74 7C 86 22 14 */ add r4, r6, r4 /* 80398F18 00395E78 90 99 01 38 */ stw r4, 0x138(r25) /* 80398F1C 00395E7C A0 99 01 2C */ lhz r4, 0x12c(r25) /* 80398F20 00395E80 98 99 01 30 */ stb r4, 0x130(r25) /* 80398F24 00395E84 A0 99 01 2C */ lhz r4, 0x12c(r25) /* 80398F28 00395E88 88 B9 01 2F */ lbz r5, 0x12f(r25) /* 80398F2C 00395E8C 54 84 06 3E */ clrlwi r4, r4, 0x18 /* 80398F30 00395E90 7C 85 20 50 */ subf r4, r5, r4 /* 80398F34 00395E94 7C 9D 22 14 */ add r4, r29, r4 /* 80398F38 00395E98 B0 99 01 2C */ sth r4, 0x12c(r25) /* 80398F3C 00395E9C 9A 59 01 2F */ stb r18, 0x12f(r25) /* 80398F40 00395EA0 98 79 01 2E */ stb r3, 0x12e(r25) /* 80398F44 00395EA4 90 79 01 3C */ stw r3, 0x13c(r25) /* 80398F48 00395EA8 80 99 01 18 */ lwz r4, 0x118(r25) /* 80398F4C 00395EAC 7C 80 03 78 */ or r0, r4, r0 /* 80398F50 00395EB0 90 19 01 18 */ stw r0, 0x118(r25) /* 80398F54 00395EB4 80 0D AE 78 */ lwz r0, synthVoice@sda21(r13) /* 80398F58 00395EB8 7C 60 F2 14 */ add r3, r0, r30 /* 80398F5C 00395EBC 48 00 E7 E5 */ bl vidRemoveVoiceReferences /* 80398F60 00395EC0 3C 1B 00 01 */ addis r0, r27, 1 /* 80398F64 00395EC4 28 00 FF FF */ cmplwi r0, 0xffff /* 80398F68 00395EC8 40 82 00 2C */ bne lbl_80398F94 /* 80398F6C 00395ECC 38 00 FF FF */ li r0, -1 /* 80398F70 00395ED0 7E A4 AB 78 */ mr r4, r21 /* 80398F74 00395ED4 90 19 00 EC */ stw r0, 0xec(r25) /* 80398F78 00395ED8 90 19 00 F0 */ stw r0, 0xf0(r25) /* 80398F7C 00395EDC 80 0D AE 78 */ lwz r0, synthVoice@sda21(r13) /* 80398F80 00395EE0 7C 60 F2 14 */ add r3, r0, r30 /* 80398F84 00395EE4 48 00 EB 21 */ bl vidMakeNew /* 80398F88 00395EE8 83 59 00 F4 */ lwz r26, 0xf4(r25) /* 80398F8C 00395EEC 7C 7B 1B 78 */ mr r27, r3 /* 80398F90 00395EF0 48 00 00 34 */ b lbl_80398FC4 lbl_80398F94: /* 80398F94 00395EF4 57 40 06 3E */ clrlwi r0, r26, 0x18 /* 80398F98 00395EF8 80 D9 00 F4 */ lwz r6, 0xf4(r25) /* 80398F9C 00395EFC 1C 60 04 04 */ mulli r3, r0, 0x404 /* 80398FA0 00395F00 80 AD AE 78 */ lwz r5, synthVoice@sda21(r13) /* 80398FA4 00395F04 38 80 00 00 */ li r4, 0 /* 80398FA8 00395F08 38 03 00 EC */ addi r0, r3, 0xec /* 80398FAC 00395F0C 7C C5 01 2E */ stwx r6, r5, r0 /* 80398FB0 00395F10 93 59 00 F0 */ stw r26, 0xf0(r25) /* 80398FB4 00395F14 80 0D AE 78 */ lwz r0, synthVoice@sda21(r13) /* 80398FB8 00395F18 83 59 00 F4 */ lwz r26, 0xf4(r25) /* 80398FBC 00395F1C 7C 60 F2 14 */ add r3, r0, r30 /* 80398FC0 00395F20 48 00 EA E5 */ bl vidMakeNew lbl_80398FC4: /* 80398FC4 00395F24 3B DE 04 04 */ addi r30, r30, 0x404 /* 80398FC8 00395F28 3B 9C 00 01 */ addi r28, r28, 1 /* 80398FCC 00395F2C 3B 39 04 04 */ addi r25, r25, 0x404 lbl_80398FD0: /* 80398FD0 00395F30 88 1F 02 10 */ lbz r0, 0x210(r31) /* 80398FD4 00395F34 7C 1C 00 40 */ cmplw r28, r0 /* 80398FD8 00395F38 41 80 FE 04 */ blt lbl_80398DDC /* 80398FDC 00395F3C 3C 1B 00 01 */ addis r0, r27, 1 /* 80398FE0 00395F40 28 00 FF FF */ cmplwi r0, 0xffff /* 80398FE4 00395F44 41 82 00 2C */ beq lbl_80399010 /* 80398FE8 00395F48 7F 03 C3 78 */ mr r3, r24 /* 80398FEC 00395F4C 48 00 FE F9 */ bl voiceSetLastStarted /* 80398FF0 00395F50 A0 18 01 2C */ lhz r0, 0x12c(r24) /* 80398FF4 00395F54 88 78 01 21 */ lbz r3, 0x121(r24) /* 80398FF8 00395F58 88 98 01 22 */ lbz r4, 0x122(r24) /* 80398FFC 00395F5C 54 05 06 3E */ clrlwi r5, r0, 0x18 /* 80399000 00395F60 48 01 8D ED */ bl inpSetMidiLastNote /* 80399004 00395F64 38 00 00 00 */ li r0, 0 /* 80399008 00395F68 90 16 00 00 */ stw r0, 0(r22) /* 8039900C 00395F6C 48 00 00 08 */ b lbl_80399014 lbl_80399010: /* 80399010 00395F70 92 F6 00 00 */ stw r23, 0(r22) lbl_80399014: /* 80399014 00395F74 7F 63 DB 78 */ mr r3, r27 lbl_80399018: /* 80399018 00395F78 39 61 00 40 */ addi r11, r1, 0x40 /* 8039901C 00395F7C 4B FF 0A 89 */ bl _restgpr_18 /* 80399020 00395F80 80 01 00 44 */ lwz r0, 0x44(r1) /* 80399024 00395F84 7C 08 03 A6 */ mtlr r0 /* 80399028 00395F88 38 21 00 40 */ addi r1, r1, 0x40 /* 8039902C 00395F8C 4E 80 00 20 */ blr .global StartLayer StartLayer: /* 80399030 00395F90 94 21 FF 80 */ stwu r1, -0x80(r1) /* 80399034 00395F94 7C 08 02 A6 */ mflr r0 /* 80399038 00395F98 90 01 00 84 */ stw r0, 0x84(r1) /* 8039903C 00395F9C 39 61 00 80 */ addi r11, r1, 0x80 /* 80399040 00395FA0 4B FF 0A 09 */ bl _savegpr_14 /* 80399044 00395FA4 8A 61 00 8B */ lbz r19, 0x8b(r1) /* 80399048 00395FA8 7C 8F 23 78 */ mr r15, r4 /* 8039904C 00395FAC 8A 81 00 8F */ lbz r20, 0x8f(r1) /* 80399050 00395FB0 7C B0 2B 78 */ mr r16, r5 /* 80399054 00395FB4 A2 A1 00 92 */ lhz r21, 0x92(r1) /* 80399058 00395FB8 7C D1 33 78 */ mr r17, r6 /* 8039905C 00395FBC A2 C1 00 96 */ lhz r22, 0x96(r1) /* 80399060 00395FC0 7C FD 3B 78 */ mr r29, r7 /* 80399064 00395FC4 99 01 00 28 */ stb r8, 0x28(r1) /* 80399068 00395FC8 7D 3E 4B 78 */ mr r30, r9 /* 8039906C 00395FCC 8A E1 00 9F */ lbz r23, 0x9f(r1) /* 80399070 00395FD0 7D 52 53 78 */ mr r18, r10 /* 80399074 00395FD4 8B 01 00 A3 */ lbz r24, 0xa3(r1) /* 80399078 00395FD8 38 81 00 2A */ addi r4, r1, 0x2a /* 8039907C 00395FDC 83 21 00 A4 */ lwz r25, 0xa4(r1) /* 80399080 00395FE0 39 C0 FF FF */ li r14, -1 /* 80399084 00395FE4 48 00 97 15 */ bl dataGetLayer /* 80399088 00395FE8 7C 7A 1B 79 */ or. r26, r3, r3 /* 8039908C 00395FEC 41 82 03 48 */ beq lbl_803993D4 /* 80399090 00395FF0 57 C0 06 3E */ clrlwi r0, r30, 0x18 /* 80399094 00395FF4 57 BF 06 7E */ clrlwi r31, r29, 0x19 /* 80399098 00395FF8 90 01 00 34 */ stw r0, 0x34(r1) /* 8039909C 00395FFC 57 BD 06 30 */ rlwinm r29, r29, 0, 0x18, 0x18 /* 803990A0 00396000 88 01 00 28 */ lbz r0, 0x28(r1) /* 803990A4 00396004 90 01 00 30 */ stw r0, 0x30(r1) /* 803990A8 00396008 48 00 03 20 */ b lbl_803993C8 lbl_803990AC: /* 803990AC 0039600C A0 7A 00 00 */ lhz r3, 0(r26) /* 803990B0 00396010 28 03 FF FF */ cmplwi r3, 0xffff /* 803990B4 00396014 41 82 03 04 */ beq lbl_803993B8 /* 803990B8 00396018 88 1A 00 02 */ lbz r0, 2(r26) /* 803990BC 0039601C 7C 00 F8 40 */ cmplw r0, r31 /* 803990C0 00396020 41 81 02 F8 */ bgt lbl_803993B8 /* 803990C4 00396024 88 1A 00 03 */ lbz r0, 3(r26) /* 803990C8 00396028 7C 00 F8 40 */ cmplw r0, r31 /* 803990CC 0039602C 41 80 02 EC */ blt lbl_803993B8 /* 803990D0 00396030 88 1A 00 04 */ lbz r0, 4(r26) /* 803990D4 00396034 7C 00 07 74 */ extsb r0, r0 /* 803990D8 00396038 7C 9F 02 14 */ add r4, r31, r0 /* 803990DC 0039603C 2C 04 00 7F */ cmpwi r4, 0x7f /* 803990E0 00396040 40 81 00 0C */ ble lbl_803990EC /* 803990E4 00396044 3B C0 00 7F */ li r30, 0x7f /* 803990E8 00396048 48 00 00 0C */ b lbl_803990F4 lbl_803990EC: /* 803990EC 0039604C 7C 80 FE 70 */ srawi r0, r4, 0x1f /* 803990F0 00396050 7C 9E 00 78 */ andc r30, r4, r0 lbl_803990F4: /* 803990F4 00396054 54 60 04 23 */ rlwinm. r0, r3, 0, 0x10, 0x11 /* 803990F8 00396058 40 82 00 68 */ bne lbl_80399160 /* 803990FC 0039605C 7E 44 93 78 */ mr r4, r18 /* 80399100 00396060 7E 65 9B 78 */ mr r5, r19 /* 80399104 00396064 38 60 00 41 */ li r3, 0x41 /* 80399108 00396068 48 01 88 05 */ bl inpGetMidiCtrl /* 8039910C 0039606C 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 80399110 00396070 28 00 1F 80 */ cmplwi r0, 0x1f80 /* 80399114 00396074 40 81 00 30 */ ble lbl_80399144 /* 80399118 00396078 57 C3 06 7E */ clrlwi r3, r30, 0x19 /* 8039911C 0039607C 7E 44 93 78 */ mr r4, r18 /* 80399120 00396080 7E 65 9B 78 */ mr r5, r19 /* 80399124 00396084 38 E1 00 2C */ addi r7, r1, 0x2c /* 80399128 00396088 38 C0 00 00 */ li r6, 0 /* 8039912C 0039608C 4B FF FC 65 */ bl do_voice_portamento /* 80399130 00396090 80 01 00 2C */ lwz r0, 0x2c(r1) /* 80399134 00396094 7C 7C 1B 78 */ mr r28, r3 /* 80399138 00396098 7C 00 00 34 */ cntlzw r0, r0 /* 8039913C 0039609C 54 00 D9 7E */ srwi r0, r0, 5 /* 80399140 003960A0 48 00 00 0C */ b lbl_8039914C lbl_80399144: /* 80399144 003960A4 3B 80 FF FF */ li r28, -1 /* 80399148 003960A8 38 00 00 01 */ li r0, 1 lbl_8039914C: /* 8039914C 003960AC 28 00 00 00 */ cmplwi r0, 0 /* 80399150 003960B0 41 82 02 68 */ beq lbl_803993B8 /* 80399154 003960B4 3C 1C 00 01 */ addis r0, r28, 1 /* 80399158 003960B8 28 00 FF FF */ cmplwi r0, 0xffff /* 8039915C 003960BC 40 82 01 B4 */ bne lbl_80399310 lbl_80399160: /* 80399160 003960C0 88 7A 00 08 */ lbz r3, 8(r26) /* 80399164 003960C4 54 60 06 31 */ rlwinm. r0, r3, 0, 0x18, 0x18 /* 80399168 003960C8 40 82 00 30 */ bne lbl_80399198 /* 8039916C 003960CC 80 01 00 34 */ lwz r0, 0x34(r1) /* 80399170 003960D0 38 63 FF C0 */ addi r3, r3, -64 /* 80399174 003960D4 7C 63 02 15 */ add. r3, r3, r0 /* 80399178 003960D8 40 80 00 0C */ bge lbl_80399184 /* 8039917C 003960DC 38 00 00 00 */ li r0, 0 /* 80399180 003960E0 48 00 00 1C */ b lbl_8039919C lbl_80399184: /* 80399184 003960E4 2C 03 00 7F */ cmpwi r3, 0x7f /* 80399188 003960E8 38 00 00 7F */ li r0, 0x7f /* 8039918C 003960EC 41 81 00 10 */ bgt lbl_8039919C /* 80399190 003960F0 7C 60 1B 78 */ mr r0, r3 /* 80399194 003960F4 48 00 00 08 */ b lbl_8039919C lbl_80399198: /* 80399198 003960F8 38 00 00 80 */ li r0, 0x80 lbl_8039919C: /* 8039919C 003960FC 3C 60 81 02 */ lis r3, 0x81020409@ha /* 803991A0 00396100 A8 9A 00 06 */ lha r4, 6(r26) /* 803991A4 00396104 38 C3 04 09 */ addi r6, r3, 0x81020409@l /* 803991A8 00396108 88 BA 00 05 */ lbz r5, 5(r26) /* 803991AC 0039610C 80 61 00 30 */ lwz r3, 0x30(r1) /* 803991B0 00396110 7D EF 22 14 */ add r15, r15, r4 /* 803991B4 00396114 7D E4 07 34 */ extsh r4, r15 /* 803991B8 00396118 7C 63 29 D6 */ mullw r3, r3, r5 /* 803991BC 0039611C 2C 04 00 FF */ cmpwi r4, 0xff /* 803991C0 00396120 7C A6 18 96 */ mulhw r5, r6, r3 /* 803991C4 00396124 7C 65 1A 14 */ add r3, r5, r3 /* 803991C8 00396128 7C 63 36 70 */ srawi r3, r3, 6 /* 803991CC 0039612C 54 65 0F FE */ srwi r5, r3, 0x1f /* 803991D0 00396130 7C 63 2A 14 */ add r3, r3, r5 /* 803991D4 00396134 54 68 06 3E */ clrlwi r8, r3, 0x18 /* 803991D8 00396138 40 81 00 0C */ ble lbl_803991E4 /* 803991DC 0039613C 38 80 00 FF */ li r4, 0xff /* 803991E0 00396140 48 00 00 0C */ b lbl_803991EC lbl_803991E4: /* 803991E4 00396144 7C 83 FE 70 */ srawi r3, r4, 0x1f /* 803991E8 00396148 7C 84 18 78 */ andc r4, r4, r3 lbl_803991EC: /* 803991EC 0039614C A0 7A 00 00 */ lhz r3, 0(r26) /* 803991F0 00396150 7C 8F 07 34 */ extsh r15, r4 /* 803991F4 00396154 54 65 04 22 */ rlwinm r5, r3, 0, 0x10, 0x11 /* 803991F8 00396158 2C 05 40 00 */ cmpwi r5, 0x4000 /* 803991FC 0039615C 41 82 00 74 */ beq lbl_80399270 /* 80399200 00396160 40 80 00 10 */ bge lbl_80399210 /* 80399204 00396164 2C 05 00 00 */ cmpwi r5, 0 /* 80399208 00396168 41 82 00 1C */ beq lbl_80399224 /* 8039920C 0039616C 48 00 00 F8 */ b lbl_80399304 lbl_80399210: /* 80399210 00396170 3C 80 00 01 */ lis r4, 0x00008000@ha /* 80399214 00396174 38 84 80 00 */ addi r4, r4, 0x00008000@l /* 80399218 00396178 7C 05 20 00 */ cmpw r5, r4 /* 8039921C 0039617C 41 82 00 A0 */ beq lbl_803992BC /* 80399220 00396180 48 00 00 E4 */ b lbl_80399304 lbl_80399224: /* 80399224 00396184 92 61 00 08 */ stw r19, 8(r1) /* 80399228 00396188 7F C7 EB 78 */ or r7, r30, r29 /* 8039922C 0039618C 39 60 00 00 */ li r11, 0 /* 80399230 00396190 7E 05 83 78 */ mr r5, r16 /* 80399234 00396194 92 81 00 0C */ stw r20, 0xc(r1) /* 80399238 00396198 7E 26 8B 78 */ mr r6, r17 /* 8039923C 0039619C 7E 4A 93 78 */ mr r10, r18 /* 80399240 003961A0 55 E4 06 3E */ clrlwi r4, r15, 0x18 /* 80399244 003961A4 92 A1 00 10 */ stw r21, 0x10(r1) /* 80399248 003961A8 54 E7 06 3E */ clrlwi r7, r7, 0x18 /* 8039924C 003961AC 54 09 06 3E */ clrlwi r9, r0, 0x18 /* 80399250 003961B0 92 C1 00 14 */ stw r22, 0x14(r1) /* 80399254 003961B4 91 61 00 18 */ stw r11, 0x18(r1) /* 80399258 003961B8 92 E1 00 1C */ stw r23, 0x1c(r1) /* 8039925C 003961BC 93 01 00 20 */ stw r24, 0x20(r1) /* 80399260 003961C0 93 21 00 24 */ stw r25, 0x24(r1) /* 80399264 003961C4 48 00 DF 5D */ bl macStart /* 80399268 003961C8 7C 7C 1B 78 */ mr r28, r3 /* 8039926C 003961CC 48 00 00 98 */ b lbl_80399304 lbl_80399270: /* 80399270 003961D0 92 61 00 08 */ stw r19, 8(r1) /* 80399274 003961D4 7F C7 EB 78 */ or r7, r30, r29 /* 80399278 003961D8 39 60 00 00 */ li r11, 0 /* 8039927C 003961DC 7D E4 7B 78 */ mr r4, r15 /* 80399280 003961E0 92 81 00 0C */ stw r20, 0xc(r1) /* 80399284 003961E4 7E 05 83 78 */ mr r5, r16 /* 80399288 003961E8 7E 26 8B 78 */ mr r6, r17 /* 8039928C 003961EC 7E 4A 93 78 */ mr r10, r18 /* 80399290 003961F0 92 A1 00 10 */ stw r21, 0x10(r1) /* 80399294 003961F4 54 E7 06 3E */ clrlwi r7, r7, 0x18 /* 80399298 003961F8 54 09 06 3E */ clrlwi r9, r0, 0x18 /* 8039929C 003961FC 92 C1 00 14 */ stw r22, 0x14(r1) /* 803992A0 00396200 91 61 00 18 */ stw r11, 0x18(r1) /* 803992A4 00396204 92 E1 00 1C */ stw r23, 0x1c(r1) /* 803992A8 00396208 93 01 00 20 */ stw r24, 0x20(r1) /* 803992AC 0039620C 93 21 00 24 */ stw r25, 0x24(r1) /* 803992B0 00396210 48 00 01 41 */ bl StartKeymap /* 803992B4 00396214 7C 7C 1B 78 */ mr r28, r3 /* 803992B8 00396218 48 00 00 4C */ b lbl_80399304 lbl_803992BC: /* 803992BC 0039621C 92 61 00 08 */ stw r19, 8(r1) /* 803992C0 00396220 7F C7 EB 78 */ or r7, r30, r29 /* 803992C4 00396224 39 60 00 00 */ li r11, 0 /* 803992C8 00396228 7D E4 7B 78 */ mr r4, r15 /* 803992CC 0039622C 92 81 00 0C */ stw r20, 0xc(r1) /* 803992D0 00396230 7E 05 83 78 */ mr r5, r16 /* 803992D4 00396234 7E 26 8B 78 */ mr r6, r17 /* 803992D8 00396238 7E 4A 93 78 */ mr r10, r18 /* 803992DC 0039623C 92 A1 00 10 */ stw r21, 0x10(r1) /* 803992E0 00396240 54 E7 06 3E */ clrlwi r7, r7, 0x18 /* 803992E4 00396244 54 09 06 3E */ clrlwi r9, r0, 0x18 /* 803992E8 00396248 92 C1 00 14 */ stw r22, 0x14(r1) /* 803992EC 0039624C 91 61 00 18 */ stw r11, 0x18(r1) /* 803992F0 00396250 92 E1 00 1C */ stw r23, 0x1c(r1) /* 803992F4 00396254 93 01 00 20 */ stw r24, 0x20(r1) /* 803992F8 00396258 93 21 00 24 */ stw r25, 0x24(r1) /* 803992FC 0039625C 4B FF FD 35 */ bl StartLayer /* 80399300 00396260 7C 7C 1B 78 */ mr r28, r3 lbl_80399304: /* 80399304 00396264 3C 1C 00 01 */ addis r0, r28, 1 /* 80399308 00396268 28 00 FF FF */ cmplwi r0, 0xffff /* 8039930C 0039626C 41 82 00 AC */ beq lbl_803993B8 lbl_80399310: /* 80399310 00396270 3C 0E 00 01 */ addis r0, r14, 1 /* 80399314 00396274 28 00 FF FF */ cmplwi r0, 0xffff /* 80399318 00396278 40 82 00 34 */ bne lbl_8039934C /* 8039931C 0039627C 80 01 00 98 */ lwz r0, 0x98(r1) /* 80399320 00396280 28 00 00 00 */ cmplwi r0, 0 /* 80399324 00396284 41 82 00 20 */ beq lbl_80399344 /* 80399328 00396288 57 80 06 3E */ clrlwi r0, r28, 0x18 /* 8039932C 0039628C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 80399330 00396290 1C 00 04 04 */ mulli r0, r0, 0x404 /* 80399334 00396294 7C 63 02 14 */ add r3, r3, r0 /* 80399338 00396298 48 00 E7 59 */ bl vidMakeRoot /* 8039933C 0039629C 7C 6E 1B 78 */ mr r14, r3 /* 80399340 003962A0 48 00 00 34 */ b lbl_80399374 lbl_80399344: /* 80399344 003962A4 7F 8E E3 78 */ mr r14, r28 /* 80399348 003962A8 48 00 00 2C */ b lbl_80399374 lbl_8039934C: /* 8039934C 003962AC 57 63 06 3E */ clrlwi r3, r27, 0x18 /* 80399350 003962B0 57 80 06 3E */ clrlwi r0, r28, 0x18 /* 80399354 003962B4 1C 63 04 04 */ mulli r3, r3, 0x404 /* 80399358 003962B8 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039935C 003962BC 38 63 00 EC */ addi r3, r3, 0xec /* 80399360 003962C0 7F 84 19 2E */ stwx r28, r4, r3 /* 80399364 003962C4 1C 60 04 04 */ mulli r3, r0, 0x404 /* 80399368 003962C8 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039936C 003962CC 38 03 00 F0 */ addi r0, r3, 0xf0 /* 80399370 003962D0 7F 64 01 2E */ stwx r27, r4, r0 lbl_80399374: /* 80399374 003962D4 7F 9B E3 78 */ mr r27, r28 /* 80399378 003962D8 38 80 00 01 */ li r4, 1 /* 8039937C 003962DC 48 00 00 14 */ b lbl_80399390 lbl_80399380: /* 80399380 003962E0 98 85 01 1C */ stb r4, 0x11c(r5) /* 80399384 003962E4 38 06 00 EC */ addi r0, r6, 0xec /* 80399388 003962E8 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039938C 003962EC 7F 63 00 2E */ lwzx r27, r3, r0 lbl_80399390: /* 80399390 003962F0 57 60 06 3E */ clrlwi r0, r27, 0x18 /* 80399394 003962F4 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 80399398 003962F8 1C C0 04 04 */ mulli r6, r0, 0x404 /* 8039939C 003962FC 7C A3 32 14 */ add r5, r3, r6 /* 803993A0 00396300 80 65 00 EC */ lwz r3, 0xec(r5) /* 803993A4 00396304 3C 03 00 01 */ addis r0, r3, 1 /* 803993A8 00396308 28 00 FF FF */ cmplwi r0, 0xffff /* 803993AC 0039630C 40 82 FF D4 */ bne lbl_80399380 /* 803993B0 00396310 38 00 00 01 */ li r0, 1 /* 803993B4 00396314 98 05 01 1C */ stb r0, 0x11c(r5) lbl_803993B8: /* 803993B8 00396318 A0 61 00 2A */ lhz r3, 0x2a(r1) /* 803993BC 0039631C 3B 5A 00 0C */ addi r26, r26, 0xc /* 803993C0 00396320 38 03 FF FF */ addi r0, r3, -1 /* 803993C4 00396324 B0 01 00 2A */ sth r0, 0x2a(r1) lbl_803993C8: /* 803993C8 00396328 A0 01 00 2A */ lhz r0, 0x2a(r1) /* 803993CC 0039632C 28 00 00 00 */ cmplwi r0, 0 /* 803993D0 00396330 40 82 FC DC */ bne lbl_803990AC lbl_803993D4: /* 803993D4 00396334 7D C3 73 78 */ mr r3, r14 /* 803993D8 00396338 39 61 00 80 */ addi r11, r1, 0x80 /* 803993DC 0039633C 4B FF 06 B9 */ bl _restgpr_14 /* 803993E0 00396340 80 01 00 84 */ lwz r0, 0x84(r1) /* 803993E4 00396344 7C 08 03 A6 */ mtlr r0 /* 803993E8 00396348 38 21 00 80 */ addi r1, r1, 0x80 /* 803993EC 0039634C 4E 80 00 20 */ blr .global StartKeymap StartKeymap: /* 803993F0 00396350 94 21 FF 80 */ stwu r1, -0x80(r1) /* 803993F4 00396354 7C 08 02 A6 */ mflr r0 /* 803993F8 00396358 90 01 00 84 */ stw r0, 0x84(r1) /* 803993FC 0039635C 39 61 00 80 */ addi r11, r1, 0x80 /* 80399400 00396360 4B FF 06 4D */ bl _savegpr_15 /* 80399404 00396364 8B A1 00 8B */ lbz r29, 0x8b(r1) /* 80399408 00396368 7C 97 23 78 */ mr r23, r4 /* 8039940C 0039636C 8B C1 00 8F */ lbz r30, 0x8f(r1) /* 80399410 00396370 7C B8 2B 78 */ mr r24, r5 /* 80399414 00396374 A2 41 00 92 */ lhz r18, 0x92(r1) /* 80399418 00396378 7C D9 33 78 */ mr r25, r6 /* 8039941C 0039637C A2 21 00 96 */ lhz r17, 0x96(r1) /* 80399420 00396380 7C F6 3B 78 */ mr r22, r7 /* 80399424 00396384 83 E1 00 98 */ lwz r31, 0x98(r1) /* 80399428 00396388 7D 1A 43 78 */ mr r26, r8 /* 8039942C 0039638C 8A 01 00 9F */ lbz r16, 0x9f(r1) /* 80399430 00396390 7D 3B 4B 78 */ mr r27, r9 /* 80399434 00396394 89 E1 00 A3 */ lbz r15, 0xa3(r1) /* 80399438 00396398 7D 5C 53 78 */ mr r28, r10 /* 8039943C 0039639C 82 61 00 A4 */ lwz r19, 0xa4(r1) /* 80399440 003963A0 48 00 92 ED */ bl dataGetKeymap /* 80399444 003963A4 28 03 00 00 */ cmplwi r3, 0 /* 80399448 003963A8 41 82 01 E8 */ beq lbl_80399630 /* 8039944C 003963AC 56 C4 1D B8 */ rlwinm r4, r22, 3, 0x16, 0x1c /* 80399450 003963B0 56 D5 06 3E */ clrlwi r21, r22, 0x18 /* 80399454 003963B4 7E 83 22 14 */ add r20, r3, r4 /* 80399458 003963B8 56 C5 06 7E */ clrlwi r5, r22, 0x19 /* 8039945C 003963BC A0 14 00 00 */ lhz r0, 0(r20) /* 80399460 003963C0 28 00 FF FF */ cmplwi r0, 0xffff /* 80399464 003963C4 41 82 01 CC */ beq lbl_80399630 /* 80399468 003963C8 54 06 04 22 */ rlwinm r6, r0, 0, 0x10, 0x11 /* 8039946C 003963CC 2C 06 40 00 */ cmpwi r6, 0x4000 /* 80399470 003963D0 41 82 01 C0 */ beq lbl_80399630 /* 80399474 003963D4 88 F4 00 03 */ lbz r7, 3(r20) /* 80399478 003963D8 54 E7 06 31 */ rlwinm. r7, r7, 0, 0x18, 0x18 /* 8039947C 003963DC 40 82 00 40 */ bne lbl_803994BC /* 80399480 003963E0 56 C8 1D 78 */ rlwinm r8, r22, 3, 0x15, 0x1c /* 80399484 003963E4 57 67 06 3E */ clrlwi r7, r27, 0x18 /* 80399488 003963E8 7D 03 42 14 */ add r8, r3, r8 /* 8039948C 003963EC 89 08 00 03 */ lbz r8, 3(r8) /* 80399490 003963F0 39 08 FF C0 */ addi r8, r8, -64 /* 80399494 003963F4 7D 08 3A 15 */ add. r8, r8, r7 /* 80399498 003963F8 40 80 00 0C */ bge lbl_803994A4 /* 8039949C 003963FC 3B 60 00 00 */ li r27, 0 /* 803994A0 00396400 48 00 00 20 */ b lbl_803994C0 lbl_803994A4: /* 803994A4 00396404 2C 08 00 7F */ cmpwi r8, 0x7f /* 803994A8 00396408 40 81 00 0C */ ble lbl_803994B4 /* 803994AC 0039640C 3B 60 00 7F */ li r27, 0x7f /* 803994B0 00396410 48 00 00 10 */ b lbl_803994C0 lbl_803994B4: /* 803994B4 00396414 55 1B 06 3E */ clrlwi r27, r8, 0x18 /* 803994B8 00396418 48 00 00 08 */ b lbl_803994C0 lbl_803994BC: /* 803994BC 0039641C 3B 60 00 80 */ li r27, 0x80 lbl_803994C0: /* 803994C0 00396420 7C E3 22 14 */ add r7, r3, r4 /* 803994C4 00396424 88 E7 00 02 */ lbz r7, 2(r7) /* 803994C8 00396428 7C E7 07 74 */ extsb r7, r7 /* 803994CC 0039642C 7C E5 3A 14 */ add r7, r5, r7 /* 803994D0 00396430 2C 07 00 7F */ cmpwi r7, 0x7f /* 803994D4 00396434 40 81 00 0C */ ble lbl_803994E0 /* 803994D8 00396438 3A C0 00 7F */ li r22, 0x7f /* 803994DC 0039643C 48 00 00 0C */ b lbl_803994E8 lbl_803994E0: /* 803994E0 00396440 7C E5 FE 70 */ srawi r5, r7, 0x1f /* 803994E4 00396444 7C F6 28 78 */ andc r22, r7, r5 lbl_803994E8: /* 803994E8 00396448 7C 63 22 14 */ add r3, r3, r4 /* 803994EC 0039644C A8 63 00 04 */ lha r3, 4(r3) /* 803994F0 00396450 7E F7 1A 14 */ add r23, r23, r3 /* 803994F4 00396454 7E E4 07 34 */ extsh r4, r23 /* 803994F8 00396458 2C 04 00 FF */ cmpwi r4, 0xff /* 803994FC 0039645C 40 81 00 0C */ ble lbl_80399508 /* 80399500 00396460 38 60 00 FF */ li r3, 0xff /* 80399504 00396464 48 00 00 0C */ b lbl_80399510 lbl_80399508: /* 80399508 00396468 7C 83 FE 70 */ srawi r3, r4, 0x1f /* 8039950C 0039646C 7C 83 18 78 */ andc r3, r4, r3 lbl_80399510: /* 80399510 00396470 2C 06 00 00 */ cmpwi r6, 0 /* 80399514 00396474 7C 77 07 34 */ extsh r23, r3 /* 80399518 00396478 40 82 00 C4 */ bne lbl_803995DC /* 8039951C 0039647C 7F 84 E3 78 */ mr r4, r28 /* 80399520 00396480 7F A5 EB 78 */ mr r5, r29 /* 80399524 00396484 38 60 00 41 */ li r3, 0x41 /* 80399528 00396488 48 01 83 E5 */ bl inpGetMidiCtrl /* 8039952C 0039648C 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 80399530 00396490 28 00 1F 80 */ cmplwi r0, 0x1f80 /* 80399534 00396494 40 81 00 2C */ ble lbl_80399560 /* 80399538 00396498 56 C3 06 7E */ clrlwi r3, r22, 0x19 /* 8039953C 0039649C 7F 84 E3 78 */ mr r4, r28 /* 80399540 003964A0 7F A5 EB 78 */ mr r5, r29 /* 80399544 003964A4 7F E6 FB 78 */ mr r6, r31 /* 80399548 003964A8 38 E1 00 28 */ addi r7, r1, 0x28 /* 8039954C 003964AC 4B FF F8 45 */ bl do_voice_portamento /* 80399550 003964B0 80 01 00 28 */ lwz r0, 0x28(r1) /* 80399554 003964B4 7C 00 00 34 */ cntlzw r0, r0 /* 80399558 003964B8 54 00 D9 7E */ srwi r0, r0, 5 /* 8039955C 003964BC 48 00 00 0C */ b lbl_80399568 lbl_80399560: /* 80399560 003964C0 38 60 FF FF */ li r3, -1 /* 80399564 003964C4 38 00 00 01 */ li r0, 1 lbl_80399568: /* 80399568 003964C8 28 00 00 00 */ cmplwi r0, 0 /* 8039956C 003964CC 40 82 00 0C */ bne lbl_80399578 /* 80399570 003964D0 38 60 FF FF */ li r3, -1 /* 80399574 003964D4 48 00 00 C0 */ b lbl_80399634 lbl_80399578: /* 80399578 003964D8 3C 03 00 01 */ addis r0, r3, 1 /* 8039957C 003964DC 28 00 FF FF */ cmplwi r0, 0xffff /* 80399580 003964E0 41 82 00 08 */ beq lbl_80399588 /* 80399584 003964E4 48 00 00 B0 */ b lbl_80399634 lbl_80399588: /* 80399588 003964E8 93 A1 00 08 */ stw r29, 8(r1) /* 8039958C 003964EC 56 A0 06 30 */ rlwinm r0, r21, 0, 0x18, 0x18 /* 80399590 003964F0 7E C0 03 78 */ or r0, r22, r0 /* 80399594 003964F4 57 E3 06 3E */ clrlwi r3, r31, 0x18 /* 80399598 003964F8 93 C1 00 0C */ stw r30, 0xc(r1) /* 8039959C 003964FC 7F 05 C3 78 */ mr r5, r24 /* 803995A0 00396500 7F 26 CB 78 */ mr r6, r25 /* 803995A4 00396504 7F 48 D3 78 */ mr r8, r26 /* 803995A8 00396508 92 41 00 10 */ stw r18, 0x10(r1) /* 803995AC 0039650C 7F 69 DB 78 */ mr r9, r27 /* 803995B0 00396510 7F 8A E3 78 */ mr r10, r28 /* 803995B4 00396514 56 E4 06 3E */ clrlwi r4, r23, 0x18 /* 803995B8 00396518 92 21 00 14 */ stw r17, 0x14(r1) /* 803995BC 0039651C 54 07 06 3E */ clrlwi r7, r0, 0x18 /* 803995C0 00396520 90 61 00 18 */ stw r3, 0x18(r1) /* 803995C4 00396524 92 01 00 1C */ stw r16, 0x1c(r1) /* 803995C8 00396528 91 E1 00 20 */ stw r15, 0x20(r1) /* 803995CC 0039652C 92 61 00 24 */ stw r19, 0x24(r1) /* 803995D0 00396530 A0 74 00 00 */ lhz r3, 0(r20) /* 803995D4 00396534 48 00 DB ED */ bl macStart /* 803995D8 00396538 48 00 00 5C */ b lbl_80399634 lbl_803995DC: /* 803995DC 0039653C 93 A1 00 08 */ stw r29, 8(r1) /* 803995E0 00396540 56 A3 06 30 */ rlwinm r3, r21, 0, 0x18, 0x18 /* 803995E4 00396544 7E C7 1B 78 */ or r7, r22, r3 /* 803995E8 00396548 57 EB 06 3E */ clrlwi r11, r31, 0x18 /* 803995EC 0039654C 93 C1 00 0C */ stw r30, 0xc(r1) /* 803995F0 00396550 7C 03 03 78 */ mr r3, r0 /* 803995F4 00396554 7E E4 BB 78 */ mr r4, r23 /* 803995F8 00396558 7F 05 C3 78 */ mr r5, r24 /* 803995FC 0039655C 92 41 00 10 */ stw r18, 0x10(r1) /* 80399600 00396560 7F 26 CB 78 */ mr r6, r25 /* 80399604 00396564 7F 48 D3 78 */ mr r8, r26 /* 80399608 00396568 7F 69 DB 78 */ mr r9, r27 /* 8039960C 0039656C 92 21 00 14 */ stw r17, 0x14(r1) /* 80399610 00396570 7F 8A E3 78 */ mr r10, r28 /* 80399614 00396574 54 E7 06 3E */ clrlwi r7, r7, 0x18 /* 80399618 00396578 91 61 00 18 */ stw r11, 0x18(r1) /* 8039961C 0039657C 92 01 00 1C */ stw r16, 0x1c(r1) /* 80399620 00396580 91 E1 00 20 */ stw r15, 0x20(r1) /* 80399624 00396584 92 61 00 24 */ stw r19, 0x24(r1) /* 80399628 00396588 4B FF FA 09 */ bl StartLayer /* 8039962C 0039658C 48 00 00 08 */ b lbl_80399634 lbl_80399630: /* 80399630 00396590 38 60 FF FF */ li r3, -1 lbl_80399634: /* 80399634 00396594 39 61 00 80 */ addi r11, r1, 0x80 /* 80399638 00396598 4B FF 04 61 */ bl _restgpr_15 /* 8039963C 0039659C 80 01 00 84 */ lwz r0, 0x84(r1) /* 80399640 003965A0 7C 08 03 A6 */ mtlr r0 /* 80399644 003965A4 38 21 00 80 */ addi r1, r1, 0x80 /* 80399648 003965A8 4E 80 00 20 */ blr .global synthStartSound synthStartSound: /* 8039964C 003965AC 94 21 FF 80 */ stwu r1, -0x80(r1) /* 80399650 003965B0 7C 08 02 A6 */ mflr r0 /* 80399654 003965B4 90 01 00 84 */ stw r0, 0x84(r1) /* 80399658 003965B8 39 61 00 80 */ addi r11, r1, 0x80 /* 8039965C 003965BC 4B FF 03 F1 */ bl _savegpr_15 /* 80399660 003965C0 A8 01 00 9A */ lha r0, 0x9a(r1) /* 80399664 003965C4 7C 7E 1B 78 */ mr r30, r3 /* 80399668 003965C8 8B 41 00 8B */ lbz r26, 0x8b(r1) /* 8039966C 003965CC 7C BF 2B 78 */ mr r31, r5 /* 80399670 003965D0 7C 04 02 14 */ add r0, r4, r0 /* 80399674 003965D4 A3 61 00 8E */ lhz r27, 0x8e(r1) /* 80399678 003965D8 54 15 06 3E */ clrlwi r21, r0, 0x18 /* 8039967C 003965DC A3 81 00 92 */ lhz r28, 0x92(r1) /* 80399680 003965E0 28 15 00 FF */ cmplwi r21, 0xff /* 80399684 003965E4 8A C1 00 97 */ lbz r22, 0x97(r1) /* 80399688 003965E8 8A 41 00 9F */ lbz r18, 0x9f(r1) /* 8039968C 003965EC 7C D3 33 78 */ mr r19, r6 /* 80399690 003965F0 83 A1 00 A0 */ lwz r29, 0xa0(r1) /* 80399694 003965F4 7C F7 3B 78 */ mr r23, r7 /* 80399698 003965F8 7D 14 43 78 */ mr r20, r8 /* 8039969C 003965FC 7D 38 4B 78 */ mr r24, r9 /* 803996A0 00396600 7D 59 53 78 */ mr r25, r10 /* 803996A4 00396604 38 00 00 FF */ li r0, 0xff /* 803996A8 00396608 41 81 00 08 */ bgt lbl_803996B0 /* 803996AC 0039660C 7E A0 AB 78 */ mr r0, r21 lbl_803996B0: /* 803996B0 00396610 57 C4 04 22 */ rlwinm r4, r30, 0, 0x10, 0x11 /* 803996B4 00396614 54 15 06 3E */ clrlwi r21, r0, 0x18 /* 803996B8 00396618 2C 04 40 00 */ cmpwi r4, 0x4000 /* 803996BC 0039661C 41 82 00 E0 */ beq lbl_8039979C /* 803996C0 00396620 40 80 00 10 */ bge lbl_803996D0 /* 803996C4 00396624 2C 04 00 00 */ cmpwi r4, 0 /* 803996C8 00396628 41 82 00 1C */ beq lbl_803996E4 /* 803996CC 0039662C 48 00 03 C0 */ b lbl_80399A8C lbl_803996D0: /* 803996D0 00396630 3C 60 00 01 */ lis r3, 0x00008000@ha /* 803996D4 00396634 38 03 80 00 */ addi r0, r3, 0x00008000@l /* 803996D8 00396638 7C 04 00 00 */ cmpw r4, r0 /* 803996DC 0039663C 41 82 03 18 */ beq lbl_803999F4 /* 803996E0 00396640 48 00 03 AC */ b lbl_80399A8C lbl_803996E4: /* 803996E4 00396644 7F 04 C3 78 */ mr r4, r24 /* 803996E8 00396648 7F 25 CB 78 */ mr r5, r25 /* 803996EC 0039664C 38 60 00 41 */ li r3, 0x41 /* 803996F0 00396650 48 01 82 1D */ bl inpGetMidiCtrl /* 803996F4 00396654 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 803996F8 00396658 28 00 1F 80 */ cmplwi r0, 0x1f80 /* 803996FC 0039665C 40 81 00 2C */ ble lbl_80399728 /* 80399700 00396660 56 63 06 7E */ clrlwi r3, r19, 0x19 /* 80399704 00396664 7F 04 C3 78 */ mr r4, r24 /* 80399708 00396668 7F 25 CB 78 */ mr r5, r25 /* 8039970C 0039666C 38 E1 00 2C */ addi r7, r1, 0x2c /* 80399710 00396670 38 C0 00 01 */ li r6, 1 /* 80399714 00396674 4B FF F6 7D */ bl do_voice_portamento /* 80399718 00396678 80 01 00 2C */ lwz r0, 0x2c(r1) /* 8039971C 0039667C 7C 00 00 34 */ cntlzw r0, r0 /* 80399720 00396680 54 00 D9 7E */ srwi r0, r0, 5 /* 80399724 00396684 48 00 00 0C */ b lbl_80399730 lbl_80399728: /* 80399728 00396688 38 60 FF FF */ li r3, -1 /* 8039972C 0039668C 38 00 00 01 */ li r0, 1 lbl_80399730: /* 80399730 00396690 28 00 00 00 */ cmplwi r0, 0 /* 80399734 00396694 40 82 00 0C */ bne lbl_80399740 /* 80399738 00396698 38 60 FF FF */ li r3, -1 /* 8039973C 0039669C 48 00 03 54 */ b lbl_80399A90 lbl_80399740: /* 80399740 003966A0 3C 03 00 01 */ addis r0, r3, 1 /* 80399744 003966A4 28 00 FF FF */ cmplwi r0, 0xffff /* 80399748 003966A8 41 82 00 08 */ beq lbl_80399750 /* 8039974C 003966AC 48 00 03 44 */ b lbl_80399A90 lbl_80399750: /* 80399750 003966B0 93 21 00 08 */ stw r25, 8(r1) /* 80399754 003966B4 38 00 00 01 */ li r0, 1 /* 80399758 003966B8 7F C3 F3 78 */ mr r3, r30 /* 8039975C 003966BC 7E A4 AB 78 */ mr r4, r21 /* 80399760 003966C0 93 41 00 0C */ stw r26, 0xc(r1) /* 80399764 003966C4 7F E5 FB 78 */ mr r5, r31 /* 80399768 003966C8 7F C6 F3 78 */ mr r6, r30 /* 8039976C 003966CC 7E 67 9B 78 */ mr r7, r19 /* 80399770 003966D0 93 61 00 10 */ stw r27, 0x10(r1) /* 80399774 003966D4 7E E8 BB 78 */ mr r8, r23 /* 80399778 003966D8 7E 89 A3 78 */ mr r9, r20 /* 8039977C 003966DC 7F 0A C3 78 */ mr r10, r24 /* 80399780 003966E0 93 81 00 14 */ stw r28, 0x14(r1) /* 80399784 003966E4 90 01 00 18 */ stw r0, 0x18(r1) /* 80399788 003966E8 92 C1 00 1C */ stw r22, 0x1c(r1) /* 8039978C 003966EC 92 41 00 20 */ stw r18, 0x20(r1) /* 80399790 003966F0 93 A1 00 24 */ stw r29, 0x24(r1) /* 80399794 003966F4 48 00 DA 2D */ bl macStart /* 80399798 003966F8 48 00 02 F8 */ b lbl_80399A90 lbl_8039979C: /* 8039979C 003966FC 7F C3 F3 78 */ mr r3, r30 /* 803997A0 00396700 48 00 8F 8D */ bl dataGetKeymap /* 803997A4 00396704 28 03 00 00 */ cmplwi r3, 0 /* 803997A8 00396708 41 82 01 F8 */ beq lbl_803999A0 /* 803997AC 0039670C 56 64 1D B8 */ rlwinm r4, r19, 3, 0x16, 0x1c /* 803997B0 00396710 56 70 06 3E */ clrlwi r16, r19, 0x18 /* 803997B4 00396714 7E 23 22 14 */ add r17, r3, r4 /* 803997B8 00396718 56 65 06 7E */ clrlwi r5, r19, 0x19 /* 803997BC 0039671C A0 11 00 00 */ lhz r0, 0(r17) /* 803997C0 00396720 28 00 FF FF */ cmplwi r0, 0xffff /* 803997C4 00396724 41 82 01 DC */ beq lbl_803999A0 /* 803997C8 00396728 54 06 04 22 */ rlwinm r6, r0, 0, 0x10, 0x11 /* 803997CC 0039672C 2C 06 40 00 */ cmpwi r6, 0x4000 /* 803997D0 00396730 41 82 01 D0 */ beq lbl_803999A0 /* 803997D4 00396734 88 F1 00 03 */ lbz r7, 3(r17) /* 803997D8 00396738 54 E7 06 31 */ rlwinm. r7, r7, 0, 0x18, 0x18 /* 803997DC 0039673C 40 82 00 40 */ bne lbl_8039981C /* 803997E0 00396740 56 68 1D 78 */ rlwinm r8, r19, 3, 0x15, 0x1c /* 803997E4 00396744 56 87 06 3E */ clrlwi r7, r20, 0x18 /* 803997E8 00396748 7D 03 42 14 */ add r8, r3, r8 /* 803997EC 0039674C 89 08 00 03 */ lbz r8, 3(r8) /* 803997F0 00396750 39 08 FF C0 */ addi r8, r8, -64 /* 803997F4 00396754 7D 08 3A 15 */ add. r8, r8, r7 /* 803997F8 00396758 40 80 00 0C */ bge lbl_80399804 /* 803997FC 0039675C 3A 80 00 00 */ li r20, 0 /* 80399800 00396760 48 00 00 20 */ b lbl_80399820 lbl_80399804: /* 80399804 00396764 2C 08 00 7F */ cmpwi r8, 0x7f /* 80399808 00396768 40 81 00 0C */ ble lbl_80399814 /* 8039980C 0039676C 3A 80 00 7F */ li r20, 0x7f /* 80399810 00396770 48 00 00 10 */ b lbl_80399820 lbl_80399814: /* 80399814 00396774 55 14 06 3E */ clrlwi r20, r8, 0x18 /* 80399818 00396778 48 00 00 08 */ b lbl_80399820 lbl_8039981C: /* 8039981C 0039677C 3A 80 00 80 */ li r20, 0x80 lbl_80399820: /* 80399820 00396780 7C E3 22 14 */ add r7, r3, r4 /* 80399824 00396784 88 E7 00 02 */ lbz r7, 2(r7) /* 80399828 00396788 7C E7 07 74 */ extsb r7, r7 /* 8039982C 0039678C 7C E5 3A 14 */ add r7, r5, r7 /* 80399830 00396790 2C 07 00 7F */ cmpwi r7, 0x7f /* 80399834 00396794 40 81 00 0C */ ble lbl_80399840 /* 80399838 00396798 3A 60 00 7F */ li r19, 0x7f /* 8039983C 0039679C 48 00 00 0C */ b lbl_80399848 lbl_80399840: /* 80399840 003967A0 7C E5 FE 70 */ srawi r5, r7, 0x1f /* 80399844 003967A4 7C F3 28 78 */ andc r19, r7, r5 lbl_80399848: /* 80399848 003967A8 7C 63 22 14 */ add r3, r3, r4 /* 8039984C 003967AC A8 63 00 04 */ lha r3, 4(r3) /* 80399850 003967B0 7C 75 1A 14 */ add r3, r21, r3 /* 80399854 003967B4 7C 64 07 34 */ extsh r4, r3 /* 80399858 003967B8 2C 04 00 FF */ cmpwi r4, 0xff /* 8039985C 003967BC 40 81 00 0C */ ble lbl_80399868 /* 80399860 003967C0 38 60 00 FF */ li r3, 0xff /* 80399864 003967C4 48 00 00 0C */ b lbl_80399870 lbl_80399868: /* 80399868 003967C8 7C 83 FE 70 */ srawi r3, r4, 0x1f /* 8039986C 003967CC 7C 83 18 78 */ andc r3, r4, r3 lbl_80399870: /* 80399870 003967D0 2C 06 00 00 */ cmpwi r6, 0 /* 80399874 003967D4 7C 75 07 34 */ extsh r21, r3 /* 80399878 003967D8 40 82 00 D0 */ bne lbl_80399948 /* 8039987C 003967DC 7F 04 C3 78 */ mr r4, r24 /* 80399880 003967E0 7F 25 CB 78 */ mr r5, r25 /* 80399884 003967E4 56 6F 06 3E */ clrlwi r15, r19, 0x18 /* 80399888 003967E8 38 60 00 41 */ li r3, 0x41 /* 8039988C 003967EC 48 01 80 81 */ bl inpGetMidiCtrl /* 80399890 003967F0 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 80399894 003967F4 28 00 1F 80 */ cmplwi r0, 0x1f80 /* 80399898 003967F8 40 81 00 2C */ ble lbl_803998C4 /* 8039989C 003967FC 55 E3 06 7E */ clrlwi r3, r15, 0x19 /* 803998A0 00396800 7F 04 C3 78 */ mr r4, r24 /* 803998A4 00396804 7F 25 CB 78 */ mr r5, r25 /* 803998A8 00396808 38 E1 00 28 */ addi r7, r1, 0x28 /* 803998AC 0039680C 38 C0 00 01 */ li r6, 1 /* 803998B0 00396810 4B FF F4 E1 */ bl do_voice_portamento /* 803998B4 00396814 80 01 00 28 */ lwz r0, 0x28(r1) /* 803998B8 00396818 7C 00 00 34 */ cntlzw r0, r0 /* 803998BC 0039681C 54 00 D9 7E */ srwi r0, r0, 5 /* 803998C0 00396820 48 00 00 0C */ b lbl_803998CC lbl_803998C4: /* 803998C4 00396824 38 60 FF FF */ li r3, -1 /* 803998C8 00396828 38 00 00 01 */ li r0, 1 lbl_803998CC: /* 803998CC 0039682C 28 00 00 00 */ cmplwi r0, 0 /* 803998D0 00396830 40 82 00 0C */ bne lbl_803998DC /* 803998D4 00396834 39 E0 FF FF */ li r15, -1 /* 803998D8 00396838 48 00 00 CC */ b lbl_803999A4 lbl_803998DC: /* 803998DC 0039683C 3C 03 00 01 */ addis r0, r3, 1 /* 803998E0 00396840 28 00 FF FF */ cmplwi r0, 0xffff /* 803998E4 00396844 41 82 00 0C */ beq lbl_803998F0 /* 803998E8 00396848 7C 6F 1B 78 */ mr r15, r3 /* 803998EC 0039684C 48 00 00 B8 */ b lbl_803999A4 lbl_803998F0: /* 803998F0 00396850 93 21 00 08 */ stw r25, 8(r1) /* 803998F4 00396854 56 00 06 30 */ rlwinm r0, r16, 0, 0x18, 0x18 /* 803998F8 00396858 7E 60 03 78 */ or r0, r19, r0 /* 803998FC 0039685C 38 60 00 01 */ li r3, 1 /* 80399900 00396860 93 41 00 0C */ stw r26, 0xc(r1) /* 80399904 00396864 7F E5 FB 78 */ mr r5, r31 /* 80399908 00396868 7F C6 F3 78 */ mr r6, r30 /* 8039990C 0039686C 7E E8 BB 78 */ mr r8, r23 /* 80399910 00396870 93 61 00 10 */ stw r27, 0x10(r1) /* 80399914 00396874 7E 89 A3 78 */ mr r9, r20 /* 80399918 00396878 7F 0A C3 78 */ mr r10, r24 /* 8039991C 0039687C 56 A4 06 3E */ clrlwi r4, r21, 0x18 /* 80399920 00396880 93 81 00 14 */ stw r28, 0x14(r1) /* 80399924 00396884 54 07 06 3E */ clrlwi r7, r0, 0x18 /* 80399928 00396888 90 61 00 18 */ stw r3, 0x18(r1) /* 8039992C 0039688C 92 C1 00 1C */ stw r22, 0x1c(r1) /* 80399930 00396890 92 41 00 20 */ stw r18, 0x20(r1) /* 80399934 00396894 93 A1 00 24 */ stw r29, 0x24(r1) /* 80399938 00396898 A0 71 00 00 */ lhz r3, 0(r17) /* 8039993C 0039689C 48 00 D8 85 */ bl macStart /* 80399940 003968A0 7C 6F 1B 78 */ mr r15, r3 /* 80399944 003968A4 48 00 00 60 */ b lbl_803999A4 lbl_80399948: /* 80399948 003968A8 93 21 00 08 */ stw r25, 8(r1) /* 8039994C 003968AC 56 03 06 30 */ rlwinm r3, r16, 0, 0x18, 0x18 /* 80399950 003968B0 7E 67 1B 78 */ or r7, r19, r3 /* 80399954 003968B4 39 60 00 01 */ li r11, 1 /* 80399958 003968B8 93 41 00 0C */ stw r26, 0xc(r1) /* 8039995C 003968BC 7C 03 03 78 */ mr r3, r0 /* 80399960 003968C0 7E A4 AB 78 */ mr r4, r21 /* 80399964 003968C4 7F E5 FB 78 */ mr r5, r31 /* 80399968 003968C8 93 61 00 10 */ stw r27, 0x10(r1) /* 8039996C 003968CC 7F C6 F3 78 */ mr r6, r30 /* 80399970 003968D0 7E E8 BB 78 */ mr r8, r23 /* 80399974 003968D4 7E 89 A3 78 */ mr r9, r20 /* 80399978 003968D8 93 81 00 14 */ stw r28, 0x14(r1) /* 8039997C 003968DC 7F 0A C3 78 */ mr r10, r24 /* 80399980 003968E0 54 E7 06 3E */ clrlwi r7, r7, 0x18 /* 80399984 003968E4 91 61 00 18 */ stw r11, 0x18(r1) /* 80399988 003968E8 92 C1 00 1C */ stw r22, 0x1c(r1) /* 8039998C 003968EC 92 41 00 20 */ stw r18, 0x20(r1) /* 80399990 003968F0 93 A1 00 24 */ stw r29, 0x24(r1) /* 80399994 003968F4 4B FF F6 9D */ bl StartLayer /* 80399998 003968F8 7C 6F 1B 78 */ mr r15, r3 /* 8039999C 003968FC 48 00 00 08 */ b lbl_803999A4 lbl_803999A0: /* 803999A0 00396900 39 E0 FF FF */ li r15, -1 lbl_803999A4: /* 803999A4 00396904 3C 0F 00 01 */ addis r0, r15, 1 /* 803999A8 00396908 28 00 FF FF */ cmplwi r0, 0xffff /* 803999AC 0039690C 41 82 00 40 */ beq lbl_803999EC /* 803999B0 00396910 7D E3 7B 78 */ mr r3, r15 /* 803999B4 00396914 48 00 E1 F5 */ bl vidGetInternalId /* 803999B8 00396918 38 80 00 00 */ li r4, 0 /* 803999BC 0039691C 48 00 00 24 */ b lbl_803999E0 lbl_803999C0: /* 803999C0 00396920 54 60 06 3E */ clrlwi r0, r3, 0x18 /* 803999C4 00396924 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 803999C8 00396928 1C A0 04 04 */ mulli r5, r0, 0x404 /* 803999CC 0039692C 38 05 01 1C */ addi r0, r5, 0x11c /* 803999D0 00396930 7C 83 01 AE */ stbx r4, r3, r0 /* 803999D4 00396934 38 05 00 EC */ addi r0, r5, 0xec /* 803999D8 00396938 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 803999DC 0039693C 7C 63 00 2E */ lwzx r3, r3, r0 lbl_803999E0: /* 803999E0 00396940 3C 03 00 01 */ addis r0, r3, 1 /* 803999E4 00396944 28 00 FF FF */ cmplwi r0, 0xffff /* 803999E8 00396948 40 82 FF D8 */ bne lbl_803999C0 lbl_803999EC: /* 803999EC 0039694C 7D E3 7B 78 */ mr r3, r15 /* 803999F0 00396950 48 00 00 A0 */ b lbl_80399A90 lbl_803999F4: /* 803999F4 00396954 93 21 00 08 */ stw r25, 8(r1) /* 803999F8 00396958 38 00 00 01 */ li r0, 1 /* 803999FC 0039695C 7F C3 F3 78 */ mr r3, r30 /* 80399A00 00396960 7E A4 AB 78 */ mr r4, r21 /* 80399A04 00396964 93 41 00 0C */ stw r26, 0xc(r1) /* 80399A08 00396968 7F E5 FB 78 */ mr r5, r31 /* 80399A0C 0039696C 7F C6 F3 78 */ mr r6, r30 /* 80399A10 00396970 7E 67 9B 78 */ mr r7, r19 /* 80399A14 00396974 93 61 00 10 */ stw r27, 0x10(r1) /* 80399A18 00396978 7E E8 BB 78 */ mr r8, r23 /* 80399A1C 0039697C 7E 89 A3 78 */ mr r9, r20 /* 80399A20 00396980 7F 0A C3 78 */ mr r10, r24 /* 80399A24 00396984 93 81 00 14 */ stw r28, 0x14(r1) /* 80399A28 00396988 90 01 00 18 */ stw r0, 0x18(r1) /* 80399A2C 0039698C 92 C1 00 1C */ stw r22, 0x1c(r1) /* 80399A30 00396990 92 41 00 20 */ stw r18, 0x20(r1) /* 80399A34 00396994 93 A1 00 24 */ stw r29, 0x24(r1) /* 80399A38 00396998 4B FF F5 F9 */ bl StartLayer /* 80399A3C 0039699C 7C 6F 1B 78 */ mr r15, r3 /* 80399A40 003969A0 3C 0F 00 01 */ addis r0, r15, 1 /* 80399A44 003969A4 28 00 FF FF */ cmplwi r0, 0xffff /* 80399A48 003969A8 41 82 00 3C */ beq lbl_80399A84 /* 80399A4C 003969AC 48 00 E1 5D */ bl vidGetInternalId /* 80399A50 003969B0 38 80 00 00 */ li r4, 0 /* 80399A54 003969B4 48 00 00 24 */ b lbl_80399A78 lbl_80399A58: /* 80399A58 003969B8 54 60 06 3E */ clrlwi r0, r3, 0x18 /* 80399A5C 003969BC 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 80399A60 003969C0 1C A0 04 04 */ mulli r5, r0, 0x404 /* 80399A64 003969C4 38 05 01 1C */ addi r0, r5, 0x11c /* 80399A68 003969C8 7C 83 01 AE */ stbx r4, r3, r0 /* 80399A6C 003969CC 38 05 00 EC */ addi r0, r5, 0xec /* 80399A70 003969D0 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 80399A74 003969D4 7C 63 00 2E */ lwzx r3, r3, r0 lbl_80399A78: /* 80399A78 003969D8 3C 03 00 01 */ addis r0, r3, 1 /* 80399A7C 003969DC 28 00 FF FF */ cmplwi r0, 0xffff /* 80399A80 003969E0 40 82 FF D8 */ bne lbl_80399A58 lbl_80399A84: /* 80399A84 003969E4 7D E3 7B 78 */ mr r3, r15 /* 80399A88 003969E8 48 00 00 08 */ b lbl_80399A90 lbl_80399A8C: /* 80399A8C 003969EC 38 60 FF FF */ li r3, -1 lbl_80399A90: /* 80399A90 003969F0 39 61 00 80 */ addi r11, r1, 0x80 /* 80399A94 003969F4 4B FF 00 05 */ bl _restgpr_15 /* 80399A98 003969F8 80 01 00 84 */ lwz r0, 0x84(r1) /* 80399A9C 003969FC 7C 08 03 A6 */ mtlr r0 /* 80399AA0 00396A00 38 21 00 80 */ addi r1, r1, 0x80 /* 80399AA4 00396A04 4E 80 00 20 */ blr .global LowPrecisionHandler LowPrecisionHandler: /* 80399AA8 00396A08 94 21 FF D0 */ stwu r1, -0x30(r1) /* 80399AAC 00396A0C 7C 08 02 A6 */ mflr r0 /* 80399AB0 00396A10 90 01 00 34 */ stw r0, 0x34(r1) /* 80399AB4 00396A14 39 61 00 30 */ addi r11, r1, 0x30 /* 80399AB8 00396A18 4B FE FF C5 */ bl _savegpr_27 /* 80399ABC 00396A1C 7C 7B 1B 78 */ mr r27, r3 /* 80399AC0 00396A20 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 80399AC4 00396A24 1C 1B 04 04 */ mulli r0, r27, 0x404 /* 80399AC8 00396A28 7F 84 02 14 */ add r28, r4, r0 /* 80399ACC 00396A2C 48 01 96 D1 */ bl hwIsActive /* 80399AD0 00396A30 28 03 00 00 */ cmplwi r3, 0 /* 80399AD4 00396A34 40 82 00 10 */ bne lbl_80399AE4 /* 80399AD8 00396A38 80 1C 00 34 */ lwz r0, 0x34(r28) /* 80399ADC 00396A3C 28 00 00 00 */ cmplwi r0, 0 /* 80399AE0 00396A40 41 82 06 D8 */ beq lbl_8039A1B8 lbl_80399AE4: /* 80399AE4 00396A44 80 8D AE 88 */ lwz r4, synthRealTime@sda21(r13) /* 80399AE8 00396A48 7F 9E E3 78 */ mr r30, r28 /* 80399AEC 00396A4C 80 AD AE 8C */ lwz r5, synthRealTime+4@sda21(r13) /* 80399AF0 00396A50 3B A0 00 00 */ li r29, 0 /* 80399AF4 00396A54 80 7C 00 28 */ lwz r3, 0x28(r28) /* 80399AF8 00396A58 80 1C 00 24 */ lwz r0, 0x24(r28) /* 80399AFC 00396A5C 7F E3 28 10 */ subfc r31, r3, r5 /* 80399B00 00396A60 90 BC 00 28 */ stw r5, 0x28(r28) /* 80399B04 00396A64 7C 00 21 10 */ subfe r0, r0, r4 /* 80399B08 00396A68 90 9C 00 24 */ stw r4, 0x24(r28) lbl_80399B0C: /* 80399B0C 00396A6C 80 1E 01 C0 */ lwz r0, 0x1c0(r30) /* 80399B10 00396A70 28 00 00 00 */ cmplwi r0, 0 /* 80399B14 00396A74 41 82 00 74 */ beq lbl_80399B88 /* 80399B18 00396A78 80 1E 01 BC */ lwz r0, 0x1bc(r30) /* 80399B1C 00396A7C 7C 00 FA 14 */ add r0, r0, r31 /* 80399B20 00396A80 90 1E 01 BC */ stw r0, 0x1bc(r30) /* 80399B24 00396A84 80 BE 01 C0 */ lwz r5, 0x1c0(r30) /* 80399B28 00396A88 80 9E 01 BC */ lwz r4, 0x1bc(r30) /* 80399B2C 00396A8C 54 A0 C2 3E */ srwi r0, r5, 8 /* 80399B30 00396A90 7C 64 2B 96 */ divwu r3, r4, r5 /* 80399B34 00396A94 7C 63 29 D6 */ mullw r3, r3, r5 /* 80399B38 00396A98 7C 63 20 50 */ subf r3, r3, r4 /* 80399B3C 00396A9C 54 63 20 36 */ slwi r3, r3, 4 /* 80399B40 00396AA0 7C 03 03 96 */ divwu r0, r3, r0 /* 80399B44 00396AA4 54 03 04 3E */ clrlwi r3, r0, 0x10 /* 80399B48 00396AA8 48 01 92 75 */ bl sndSin /* 80399B4C 00396AAC B0 7E 01 C4 */ sth r3, 0x1c4(r30) /* 80399B50 00396AB0 A8 7E 01 C4 */ lha r3, 0x1c4(r30) /* 80399B54 00396AB4 A8 1E 01 C6 */ lha r0, 0x1c6(r30) /* 80399B58 00396AB8 7C 03 00 00 */ cmpw r3, r0 /* 80399B5C 00396ABC 41 82 00 2C */ beq lbl_80399B88 /* 80399B60 00396AC0 B0 7E 01 C6 */ sth r3, 0x1c6(r30) /* 80399B64 00396AC4 38 7D 01 D4 */ addi r3, r29, 0x1d4 /* 80399B68 00396AC8 7C 1C 18 AE */ lbzx r0, r28, r3 /* 80399B6C 00396ACC 28 00 00 00 */ cmplwi r0, 0 /* 80399B70 00396AD0 41 82 00 18 */ beq lbl_80399B88 /* 80399B74 00396AD4 38 00 00 00 */ li r0, 0 /* 80399B78 00396AD8 7C 1C 19 AE */ stbx r0, r28, r3 /* 80399B7C 00396ADC 80 1C 02 14 */ lwz r0, 0x214(r28) /* 80399B80 00396AE0 60 00 1F FF */ ori r0, r0, 0x1fff /* 80399B84 00396AE4 90 1C 02 14 */ stw r0, 0x214(r28) lbl_80399B88: /* 80399B88 00396AE8 3B BD 00 01 */ addi r29, r29, 1 /* 80399B8C 00396AEC 3B DE 00 0C */ addi r30, r30, 0xc /* 80399B90 00396AF0 28 1D 00 02 */ cmplwi r29, 2 /* 80399B94 00396AF4 41 80 FF 78 */ blt lbl_80399B0C /* 80399B98 00396AF8 80 1C 01 14 */ lwz r0, 0x114(r28) /* 80399B9C 00396AFC 38 80 00 00 */ li r4, 0 /* 80399BA0 00396B00 80 BC 01 18 */ lwz r5, 0x118(r28) /* 80399BA4 00396B04 38 60 20 00 */ li r3, 0x2000 /* 80399BA8 00396B08 7C 00 20 38 */ and r0, r0, r4 /* 80399BAC 00396B0C 7C A3 18 38 */ and r3, r5, r3 /* 80399BB0 00396B10 7C 63 22 78 */ xor r3, r3, r4 /* 80399BB4 00396B14 7C 00 22 78 */ xor r0, r0, r4 /* 80399BB8 00396B18 7C 60 03 79 */ or. r0, r3, r0 /* 80399BBC 00396B1C 41 82 00 40 */ beq lbl_80399BFC /* 80399BC0 00396B20 80 1C 01 48 */ lwz r0, 0x148(r28) /* 80399BC4 00396B24 7C 00 FA 14 */ add r0, r0, r31 /* 80399BC8 00396B28 90 1C 01 48 */ stw r0, 0x148(r28) /* 80399BCC 00396B2C 80 BC 01 44 */ lwz r5, 0x144(r28) /* 80399BD0 00396B30 80 9C 01 48 */ lwz r4, 0x148(r28) /* 80399BD4 00396B34 54 A0 C2 3E */ srwi r0, r5, 8 /* 80399BD8 00396B38 7C 64 2B 96 */ divwu r3, r4, r5 /* 80399BDC 00396B3C 7C 63 29 D6 */ mullw r3, r3, r5 /* 80399BE0 00396B40 7C 63 20 50 */ subf r3, r3, r4 /* 80399BE4 00396B44 54 63 20 36 */ slwi r3, r3, 4 /* 80399BE8 00396B48 7C 03 03 96 */ divwu r0, r3, r0 /* 80399BEC 00396B4C 54 03 04 3E */ clrlwi r3, r0, 0x10 /* 80399BF0 00396B50 48 01 91 CD */ bl sndSin /* 80399BF4 00396B54 7C 60 07 34 */ extsh r0, r3 /* 80399BF8 00396B58 90 1C 01 4C */ stw r0, 0x14c(r28) lbl_80399BFC: /* 80399BFC 00396B5C 88 7C 01 B8 */ lbz r3, 0x1b8(r28) /* 80399C00 00396B60 88 1C 01 B9 */ lbz r0, 0x1b9(r28) /* 80399C04 00396B64 7C 60 03 79 */ or. r0, r3, r0 /* 80399C08 00396B68 41 82 00 B0 */ beq lbl_80399CB8 /* 80399C0C 00396B6C 28 03 00 00 */ cmplwi r3, 0 /* 80399C10 00396B70 57 E4 21 36 */ rlwinm r4, r31, 4, 4, 0x1b /* 80399C14 00396B74 57 E5 01 3E */ clrlwi r5, r31, 4 /* 80399C18 00396B78 41 82 00 4C */ beq lbl_80399C64 /* 80399C1C 00396B7C 80 1C 01 B0 */ lwz r0, 0x1b0(r28) /* 80399C20 00396B80 7C 04 00 50 */ subf r0, r4, r0 /* 80399C24 00396B84 90 1C 01 B0 */ stw r0, 0x1b0(r28) /* 80399C28 00396B88 80 1C 01 B0 */ lwz r0, 0x1b0(r28) /* 80399C2C 00396B8C 2C 00 00 00 */ cmpwi r0, 0 /* 80399C30 00396B90 41 81 00 1C */ bgt lbl_80399C4C /* 80399C34 00396B94 88 7C 01 B8 */ lbz r3, 0x1b8(r28) /* 80399C38 00396B98 38 00 00 00 */ li r0, 0 /* 80399C3C 00396B9C 54 63 80 1E */ slwi r3, r3, 0x10 /* 80399C40 00396BA0 90 7C 01 B0 */ stw r3, 0x1b0(r28) /* 80399C44 00396BA4 90 1C 01 A0 */ stw r0, 0x1a0(r28) /* 80399C48 00396BA8 48 00 00 1C */ b lbl_80399C64 lbl_80399C4C: /* 80399C4C 00396BAC 80 1C 01 A8 */ lwz r0, 0x1a8(r28) /* 80399C50 00396BB0 80 7C 01 A0 */ lwz r3, 0x1a0(r28) /* 80399C54 00396BB4 7C 00 66 70 */ srawi r0, r0, 0xc /* 80399C58 00396BB8 7C 00 29 D6 */ mullw r0, r0, r5 /* 80399C5C 00396BBC 7C 03 02 14 */ add r0, r3, r0 /* 80399C60 00396BC0 90 1C 01 A0 */ stw r0, 0x1a0(r28) lbl_80399C64: /* 80399C64 00396BC4 88 1C 01 B9 */ lbz r0, 0x1b9(r28) /* 80399C68 00396BC8 28 00 00 00 */ cmplwi r0, 0 /* 80399C6C 00396BCC 41 82 00 4C */ beq lbl_80399CB8 /* 80399C70 00396BD0 80 1C 01 B4 */ lwz r0, 0x1b4(r28) /* 80399C74 00396BD4 7C 04 00 50 */ subf r0, r4, r0 /* 80399C78 00396BD8 90 1C 01 B4 */ stw r0, 0x1b4(r28) /* 80399C7C 00396BDC 80 1C 01 B4 */ lwz r0, 0x1b4(r28) /* 80399C80 00396BE0 2C 00 00 00 */ cmpwi r0, 0 /* 80399C84 00396BE4 41 81 00 1C */ bgt lbl_80399CA0 /* 80399C88 00396BE8 88 7C 01 B9 */ lbz r3, 0x1b9(r28) /* 80399C8C 00396BEC 38 00 00 00 */ li r0, 0 /* 80399C90 00396BF0 54 63 80 1E */ slwi r3, r3, 0x10 /* 80399C94 00396BF4 90 7C 01 B4 */ stw r3, 0x1b4(r28) /* 80399C98 00396BF8 90 1C 01 A4 */ stw r0, 0x1a4(r28) /* 80399C9C 00396BFC 48 00 00 1C */ b lbl_80399CB8 lbl_80399CA0: /* 80399CA0 00396C00 80 1C 01 AC */ lwz r0, 0x1ac(r28) /* 80399CA4 00396C04 80 7C 01 A4 */ lwz r3, 0x1a4(r28) /* 80399CA8 00396C08 7C 00 66 70 */ srawi r0, r0, 0xc /* 80399CAC 00396C0C 7C 00 29 D6 */ mullw r0, r0, r5 /* 80399CB0 00396C10 7C 03 02 14 */ add r0, r3, r0 /* 80399CB4 00396C14 90 1C 01 A4 */ stw r0, 0x1a4(r28) lbl_80399CB8: /* 80399CB8 00396C18 38 00 00 02 */ li r0, 2 /* 80399CBC 00396C1C 7F 85 E3 78 */ mr r5, r28 /* 80399CC0 00396C20 7C 09 03 A6 */ mtctr r0 lbl_80399CC4: /* 80399CC4 00396C24 80 65 01 70 */ lwz r3, 0x170(r5) /* 80399CC8 00396C28 80 05 01 80 */ lwz r0, 0x180(r5) /* 80399CCC 00396C2C 7C 03 00 40 */ cmplw r3, r0 /* 80399CD0 00396C30 41 82 00 7C */ beq lbl_80399D4C /* 80399CD4 00396C34 80 05 01 88 */ lwz r0, 0x188(r5) /* 80399CD8 00396C38 7C 1F 00 50 */ subf r0, r31, r0 /* 80399CDC 00396C3C 90 05 01 88 */ stw r0, 0x188(r5) /* 80399CE0 00396C40 80 05 01 88 */ lwz r0, 0x188(r5) /* 80399CE4 00396C44 2C 00 00 00 */ cmpwi r0, 0 /* 80399CE8 00396C48 41 81 00 18 */ bgt lbl_80399D00 /* 80399CEC 00396C4C 80 65 01 80 */ lwz r3, 0x180(r5) /* 80399CF0 00396C50 38 00 00 00 */ li r0, 0 /* 80399CF4 00396C54 90 65 01 70 */ stw r3, 0x170(r5) /* 80399CF8 00396C58 90 05 01 88 */ stw r0, 0x188(r5) /* 80399CFC 00396C5C 48 00 00 44 */ b lbl_80399D40 lbl_80399D00: /* 80399D00 00396C60 80 65 01 78 */ lwz r3, 0x178(r5) /* 80399D04 00396C64 54 04 C2 3E */ srwi r4, r0, 8 /* 80399D08 00396C68 80 05 01 80 */ lwz r0, 0x180(r5) /* 80399D0C 00396C6C 7C 64 19 D6 */ mullw r3, r4, r3 /* 80399D10 00396C70 7C 03 00 50 */ subf r0, r3, r0 /* 80399D14 00396C74 90 05 01 70 */ stw r0, 0x170(r5) /* 80399D18 00396C78 80 65 01 70 */ lwz r3, 0x170(r5) /* 80399D1C 00396C7C 2C 03 00 00 */ cmpwi r3, 0 /* 80399D20 00396C80 40 80 00 0C */ bge lbl_80399D2C /* 80399D24 00396C84 38 00 00 00 */ li r0, 0 /* 80399D28 00396C88 48 00 00 14 */ b lbl_80399D3C lbl_80399D2C: /* 80399D2C 00396C8C 3C 00 00 7F */ lis r0, 0x7f /* 80399D30 00396C90 7C 03 00 40 */ cmplw r3, r0 /* 80399D34 00396C94 41 81 00 08 */ bgt lbl_80399D3C /* 80399D38 00396C98 7C 60 1B 78 */ mr r0, r3 lbl_80399D3C: /* 80399D3C 00396C9C 90 05 01 70 */ stw r0, 0x170(r5) lbl_80399D40: /* 80399D40 00396CA0 80 1C 01 14 */ lwz r0, 0x114(r28) /* 80399D44 00396CA4 60 00 20 00 */ ori r0, r0, 0x2000 /* 80399D48 00396CA8 90 1C 01 14 */ stw r0, 0x114(r28) lbl_80399D4C: /* 80399D4C 00396CAC 38 A5 00 04 */ addi r5, r5, 4 /* 80399D50 00396CB0 42 00 FF 74 */ bdnz lbl_80399CC4 /* 80399D54 00396CB4 80 7C 01 14 */ lwz r3, 0x114(r28) /* 80399D58 00396CB8 38 00 02 00 */ li r0, 0x200 /* 80399D5C 00396CBC 80 BC 01 18 */ lwz r5, 0x118(r28) /* 80399D60 00396CC0 38 80 00 00 */ li r4, 0 /* 80399D64 00396CC4 7C 60 00 38 */ and r0, r3, r0 /* 80399D68 00396CC8 7C A3 20 38 */ and r3, r5, r4 /* 80399D6C 00396CCC 7C 63 22 78 */ xor r3, r3, r4 /* 80399D70 00396CD0 7C 00 22 78 */ xor r0, r0, r4 /* 80399D74 00396CD4 7C 60 03 79 */ or. r0, r3, r0 /* 80399D78 00396CD8 41 82 00 3C */ beq lbl_80399DB4 /* 80399D7C 00396CDC 38 7C 01 DC */ addi r3, r28, 0x1dc /* 80399D80 00396CE0 38 81 00 0A */ addi r4, r1, 0xa /* 80399D84 00396CE4 38 A1 00 08 */ addi r5, r1, 8 /* 80399D88 00396CE8 48 00 FB C5 */ bl adsrHandleLowPrecision /* 80399D8C 00396CEC 28 03 00 00 */ cmplwi r3, 0 /* 80399D90 00396CF0 41 82 00 24 */ beq lbl_80399DB4 /* 80399D94 00396CF4 80 BC 01 18 */ lwz r5, 0x118(r28) /* 80399D98 00396CF8 38 00 FF FF */ li r0, -1 /* 80399D9C 00396CFC 80 9C 01 14 */ lwz r4, 0x114(r28) /* 80399DA0 00396D00 38 60 FD FF */ li r3, -513 /* 80399DA4 00396D04 7C A0 00 38 */ and r0, r5, r0 /* 80399DA8 00396D08 90 1C 01 18 */ stw r0, 0x118(r28) /* 80399DAC 00396D0C 7C 80 18 38 */ and r0, r4, r3 /* 80399DB0 00396D10 90 1C 01 14 */ stw r0, 0x114(r28) lbl_80399DB4: /* 80399DB4 00396D14 88 1C 01 2E */ lbz r0, 0x12e(r28) /* 80399DB8 00396D18 3C 80 51 EC */ lis r4, 0x51EB851F@ha /* 80399DBC 00396D1C 3C 60 00 01 */ lis r3, 0x00010030@ha /* 80399DC0 00396D20 A0 FC 01 2C */ lhz r7, 0x12c(r28) /* 80399DC4 00396D24 7C 00 07 74 */ extsb r0, r0 /* 80399DC8 00396D28 38 A4 85 1F */ addi r5, r4, 0x51EB851F@l /* 80399DCC 00396D2C 54 04 80 1E */ slwi r4, r0, 0x10 /* 80399DD0 00396D30 80 1C 01 14 */ lwz r0, 0x114(r28) /* 80399DD4 00396D34 7C C5 20 96 */ mulhw r6, r5, r4 /* 80399DD8 00396D38 80 BC 01 18 */ lwz r5, 0x118(r28) /* 80399DDC 00396D3C 38 80 00 00 */ li r4, 0 /* 80399DE0 00396D40 38 63 00 30 */ addi r3, r3, 0x00010030@l /* 80399DE4 00396D44 7C 00 20 38 */ and r0, r0, r4 /* 80399DE8 00396D48 7C A3 18 38 */ and r3, r5, r3 /* 80399DEC 00396D4C 7C C5 2E 70 */ srawi r5, r6, 5 /* 80399DF0 00396D50 7C 63 22 78 */ xor r3, r3, r4 /* 80399DF4 00396D54 7C 00 22 78 */ xor r0, r0, r4 /* 80399DF8 00396D58 54 E4 80 1E */ slwi r4, r7, 0x10 /* 80399DFC 00396D5C 7C 60 03 79 */ or. r0, r3, r0 /* 80399E00 00396D60 54 A3 0F FE */ srwi r3, r5, 0x1f /* 80399E04 00396D64 7C 65 1A 14 */ add r3, r5, r3 /* 80399E08 00396D68 7F A4 1A 14 */ add r29, r4, r3 /* 80399E0C 00396D6C 41 82 00 24 */ beq lbl_80399E30 /* 80399E10 00396D70 88 1C 01 21 */ lbz r0, 0x121(r28) /* 80399E14 00396D74 28 00 00 FF */ cmplwi r0, 0xff /* 80399E18 00396D78 41 82 00 50 */ beq lbl_80399E68 /* 80399E1C 00396D7C 7F 83 E3 78 */ mr r3, r28 /* 80399E20 00396D80 48 01 85 BD */ bl inpGetPitchBend /* 80399E24 00396D84 B0 7C 01 D8 */ sth r3, 0x1d8(r28) /* 80399E28 00396D88 54 63 04 3E */ clrlwi r3, r3, 0x10 /* 80399E2C 00396D8C 48 00 00 08 */ b lbl_80399E34 lbl_80399E30: /* 80399E30 00396D90 A0 7C 01 D8 */ lhz r3, 0x1d8(r28) lbl_80399E34: /* 80399E34 00396D94 2C 03 20 00 */ cmpwi r3, 0x2000 /* 80399E38 00396D98 41 82 00 30 */ beq lbl_80399E68 /* 80399E3C 00396D9C 34 63 E0 00 */ addic. r3, r3, -8192 /* 80399E40 00396DA0 40 80 00 18 */ bge lbl_80399E58 /* 80399E44 00396DA4 88 1C 01 D6 */ lbz r0, 0x1d6(r28) /* 80399E48 00396DA8 7C 00 19 D6 */ mullw r0, r0, r3 /* 80399E4C 00396DAC 54 00 18 38 */ slwi r0, r0, 3 /* 80399E50 00396DB0 7F BD 02 14 */ add r29, r29, r0 /* 80399E54 00396DB4 48 00 00 14 */ b lbl_80399E68 lbl_80399E58: /* 80399E58 00396DB8 88 1C 01 D7 */ lbz r0, 0x1d7(r28) /* 80399E5C 00396DBC 7C 00 19 D6 */ mullw r0, r0, r3 /* 80399E60 00396DC0 54 00 18 38 */ slwi r0, r0, 3 /* 80399E64 00396DC4 7F BD 02 14 */ add r29, r29, r0 lbl_80399E68: /* 80399E68 00396DC8 80 1C 01 14 */ lwz r0, 0x114(r28) /* 80399E6C 00396DCC 38 80 00 00 */ li r4, 0 /* 80399E70 00396DD0 80 BC 01 18 */ lwz r5, 0x118(r28) /* 80399E74 00396DD4 38 60 20 00 */ li r3, 0x2000 /* 80399E78 00396DD8 7C 00 20 38 */ and r0, r0, r4 /* 80399E7C 00396DDC 7C A3 18 38 */ and r3, r5, r3 /* 80399E80 00396DE0 7C 63 22 78 */ xor r3, r3, r4 /* 80399E84 00396DE4 7C 00 22 78 */ xor r0, r0, r4 /* 80399E88 00396DE8 7C 60 03 79 */ or. r0, r3, r0 /* 80399E8C 00396DEC 41 82 00 A8 */ beq lbl_80399F34 /* 80399E90 00396DF0 7F 83 E3 78 */ mr r3, r28 /* 80399E94 00396DF4 48 01 85 D9 */ bl inpGetModulation /* 80399E98 00396DF8 88 1C 01 41 */ lbz r0, 0x141(r28) /* 80399E9C 00396DFC 3C 80 51 EC */ lis r4, 0x51EB851F@ha /* 80399EA0 00396E00 A8 DC 01 50 */ lha r6, 0x150(r28) /* 80399EA4 00396E04 38 84 85 1F */ addi r4, r4, 0x51EB851F@l /* 80399EA8 00396E08 54 00 40 2E */ slwi r0, r0, 8 /* 80399EAC 00396E0C 88 BC 01 40 */ lbz r5, 0x140(r28) /* 80399EB0 00396E10 7C 84 00 96 */ mulhw r4, r4, r0 /* 80399EB4 00396E14 7C C0 07 35 */ extsh. r0, r6 /* 80399EB8 00396E18 54 A5 40 2E */ slwi r5, r5, 8 /* 80399EBC 00396E1C 7C 80 2E 70 */ srawi r0, r4, 5 /* 80399EC0 00396E20 54 04 0F FE */ srwi r4, r0, 0x1f /* 80399EC4 00396E24 7C 00 22 14 */ add r0, r0, r4 /* 80399EC8 00396E28 7C E5 02 14 */ add r7, r5, r0 /* 80399ECC 00396E2C 41 82 00 18 */ beq lbl_80399EE4 /* 80399ED0 00396E30 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 80399ED4 00396E34 7C 00 3E 70 */ srawi r0, r0, 7 /* 80399ED8 00396E38 7C 06 01 D6 */ mullw r0, r6, r0 /* 80399EDC 00396E3C 7C 00 3E 70 */ srawi r0, r0, 7 /* 80399EE0 00396E40 7C E7 02 14 */ add r7, r7, r0 lbl_80399EE4: /* 80399EE4 00396E44 80 1C 01 14 */ lwz r0, 0x114(r28) /* 80399EE8 00396E48 38 A0 00 00 */ li r5, 0 /* 80399EEC 00396E4C 80 DC 01 18 */ lwz r6, 0x118(r28) /* 80399EF0 00396E50 38 80 40 00 */ li r4, 0x4000 /* 80399EF4 00396E54 7C 00 28 38 */ and r0, r0, r5 /* 80399EF8 00396E58 7C C4 20 38 */ and r4, r6, r4 /* 80399EFC 00396E5C 7C 84 2A 78 */ xor r4, r4, r5 /* 80399F00 00396E60 7C 00 2A 78 */ xor r0, r0, r5 /* 80399F04 00396E64 7C 80 03 79 */ or. r0, r4, r0 /* 80399F08 00396E68 41 82 00 1C */ beq lbl_80399F24 /* 80399F0C 00396E6C 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 80399F10 00396E70 80 7C 01 4C */ lwz r3, 0x14c(r28) /* 80399F14 00396E74 7C 00 3E 70 */ srawi r0, r0, 7 /* 80399F18 00396E78 7C 03 01 D6 */ mullw r0, r3, r0 /* 80399F1C 00396E7C 7C 00 3E 70 */ srawi r0, r0, 7 /* 80399F20 00396E80 48 00 00 08 */ b lbl_80399F28 lbl_80399F24: /* 80399F24 00396E84 80 1C 01 4C */ lwz r0, 0x14c(r28) lbl_80399F28: /* 80399F28 00396E88 7C 07 01 D6 */ mullw r0, r7, r0 /* 80399F2C 00396E8C 7C 00 26 70 */ srawi r0, r0, 4 /* 80399F30 00396E90 7F BD 02 14 */ add r29, r29, r0 lbl_80399F34: /* 80399F34 00396E94 88 9C 01 21 */ lbz r4, 0x121(r28) /* 80399F38 00396E98 28 04 00 FF */ cmplwi r4, 0xff /* 80399F3C 00396E9C 41 82 01 24 */ beq lbl_8039A060 /* 80399F40 00396EA0 88 BC 01 22 */ lbz r5, 0x122(r28) /* 80399F44 00396EA4 38 60 00 41 */ li r3, 0x41 /* 80399F48 00396EA8 48 01 79 C5 */ bl inpGetMidiCtrl /* 80399F4C 00396EAC A0 1C 01 32 */ lhz r0, 0x132(r28) /* 80399F50 00396EB0 54 64 04 3E */ clrlwi r4, r3, 0x10 /* 80399F54 00396EB4 7C 04 00 40 */ cmplw r4, r0 /* 80399F58 00396EB8 40 82 00 30 */ bne lbl_80399F88 /* 80399F5C 00396EBC 3C A0 00 02 */ lis r5, 0x00021000@ha /* 80399F60 00396EC0 80 FC 01 14 */ lwz r7, 0x114(r28) /* 80399F64 00396EC4 80 9C 01 18 */ lwz r4, 0x118(r28) /* 80399F68 00396EC8 38 05 10 00 */ addi r0, r5, 0x00021000@l /* 80399F6C 00396ECC 38 C0 00 00 */ li r6, 0 /* 80399F70 00396ED0 7C 84 00 38 */ and r4, r4, r0 /* 80399F74 00396ED4 7C E0 30 38 */ and r0, r7, r6 /* 80399F78 00396ED8 7C 84 2A 78 */ xor r4, r4, r5 /* 80399F7C 00396EDC 7C 00 32 78 */ xor r0, r0, r6 /* 80399F80 00396EE0 7C 80 03 79 */ or. r0, r4, r0 /* 80399F84 00396EE4 40 82 00 DC */ bne lbl_8039A060 lbl_80399F88: /* 80399F88 00396EE8 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 80399F8C 00396EEC 28 00 1F 80 */ cmplwi r0, 0x1f80 /* 80399F90 00396EF0 41 81 00 28 */ bgt lbl_80399FB8 /* 80399F94 00396EF4 80 DC 01 18 */ lwz r6, 0x118(r28) /* 80399F98 00396EF8 38 00 FB FF */ li r0, -1025 /* 80399F9C 00396EFC 80 BC 01 14 */ lwz r5, 0x114(r28) /* 80399FA0 00396F00 38 80 FF FF */ li r4, -1 /* 80399FA4 00396F04 7C C0 00 38 */ and r0, r6, r0 /* 80399FA8 00396F08 90 1C 01 18 */ stw r0, 0x118(r28) /* 80399FAC 00396F0C 7C A0 20 38 */ and r0, r5, r4 /* 80399FB0 00396F10 90 1C 01 14 */ stw r0, 0x114(r28) /* 80399FB4 00396F14 48 00 00 9C */ b lbl_8039A050 lbl_80399FB8: /* 80399FB8 00396F18 80 9C 01 14 */ lwz r4, 0x114(r28) /* 80399FBC 00396F1C 38 C0 00 00 */ li r6, 0 /* 80399FC0 00396F20 80 FC 01 18 */ lwz r7, 0x118(r28) /* 80399FC4 00396F24 38 00 04 00 */ li r0, 0x400 /* 80399FC8 00396F28 7C 85 30 38 */ and r5, r4, r6 /* 80399FCC 00396F2C 7C E0 00 38 */ and r0, r7, r0 /* 80399FD0 00396F30 7C 04 32 78 */ xor r4, r0, r6 /* 80399FD4 00396F34 7C A0 32 78 */ xor r0, r5, r6 /* 80399FD8 00396F38 7C 80 03 79 */ or. r0, r4, r0 /* 80399FDC 00396F3C 40 82 00 68 */ bne lbl_8039A044 /* 80399FE0 00396F40 3C 80 00 02 */ lis r4, 2 /* 80399FE4 00396F44 7C A0 32 78 */ xor r0, r5, r6 /* 80399FE8 00396F48 7C E4 20 38 */ and r4, r7, r4 /* 80399FEC 00396F4C 7C 84 32 78 */ xor r4, r4, r6 /* 80399FF0 00396F50 7C 80 03 79 */ or. r0, r4, r0 /* 80399FF4 00396F54 40 82 00 50 */ bne lbl_8039A044 /* 80399FF8 00396F58 88 1C 01 31 */ lbz r0, 0x131(r28) /* 80399FFC 00396F5C 28 00 00 01 */ cmplwi r0, 1 /* 8039A000 00396F60 40 82 00 30 */ bne lbl_8039A030 /* 8039A004 00396F64 38 80 10 00 */ li r4, 0x1000 /* 8039A008 00396F68 7C A0 32 78 */ xor r0, r5, r6 /* 8039A00C 00396F6C 7C E4 20 38 */ and r4, r7, r4 /* 8039A010 00396F70 7C 84 32 78 */ xor r4, r4, r6 /* 8039A014 00396F74 7C 80 03 79 */ or. r0, r4, r0 /* 8039A018 00396F78 40 82 00 0C */ bne lbl_8039A024 /* 8039A01C 00396F7C 90 DC 01 3C */ stw r6, 0x13c(r28) /* 8039A020 00396F80 48 00 00 18 */ b lbl_8039A038 lbl_8039A024: /* 8039A024 00396F84 80 1C 01 34 */ lwz r0, 0x134(r28) /* 8039A028 00396F88 90 1C 01 3C */ stw r0, 0x13c(r28) /* 8039A02C 00396F8C 48 00 00 0C */ b lbl_8039A038 lbl_8039A030: /* 8039A030 00396F90 80 1C 01 34 */ lwz r0, 0x134(r28) /* 8039A034 00396F94 90 1C 01 3C */ stw r0, 0x13c(r28) lbl_8039A038: /* 8039A038 00396F98 88 1C 01 30 */ lbz r0, 0x130(r28) /* 8039A03C 00396F9C 54 00 80 1E */ slwi r0, r0, 0x10 /* 8039A040 00396FA0 90 1C 01 38 */ stw r0, 0x138(r28) lbl_8039A044: /* 8039A044 00396FA4 80 1C 01 18 */ lwz r0, 0x118(r28) /* 8039A048 00396FA8 60 00 04 00 */ ori r0, r0, 0x400 /* 8039A04C 00396FAC 90 1C 01 18 */ stw r0, 0x118(r28) lbl_8039A050: /* 8039A050 00396FB0 80 1C 01 18 */ lwz r0, 0x118(r28) /* 8039A054 00396FB4 60 00 10 00 */ ori r0, r0, 0x1000 /* 8039A058 00396FB8 90 1C 01 18 */ stw r0, 0x118(r28) /* 8039A05C 00396FBC B0 7C 01 32 */ sth r3, 0x132(r28) lbl_8039A060: /* 8039A060 00396FC0 80 1C 01 14 */ lwz r0, 0x114(r28) /* 8039A064 00396FC4 38 80 00 00 */ li r4, 0 /* 8039A068 00396FC8 80 BC 01 18 */ lwz r5, 0x118(r28) /* 8039A06C 00396FCC 38 60 04 00 */ li r3, 0x400 /* 8039A070 00396FD0 7C 00 20 38 */ and r0, r0, r4 /* 8039A074 00396FD4 7F BE EB 78 */ mr r30, r29 /* 8039A078 00396FD8 7C A3 18 38 */ and r3, r5, r3 /* 8039A07C 00396FDC 7C 63 22 78 */ xor r3, r3, r4 /* 8039A080 00396FE0 7C 00 22 78 */ xor r0, r0, r4 /* 8039A084 00396FE4 7C 60 03 79 */ or. r0, r3, r0 /* 8039A088 00396FE8 41 82 00 78 */ beq lbl_8039A100 /* 8039A08C 00396FEC 80 7C 01 3C */ lwz r3, 0x13c(r28) /* 8039A090 00396FF0 80 1C 01 34 */ lwz r0, 0x134(r28) /* 8039A094 00396FF4 7C 03 00 50 */ subf r0, r3, r0 /* 8039A098 00396FF8 54 04 C2 3F */ rlwinm. r4, r0, 0x18, 8, 0x1f /* 8039A09C 00396FFC 40 81 00 64 */ ble lbl_8039A100 /* 8039A0A0 00397000 80 7C 01 38 */ lwz r3, 0x138(r28) /* 8039A0A4 00397004 7C 03 E8 50 */ subf r0, r3, r29 /* 8039A0A8 00397008 7C 03 E8 40 */ cmplw r3, r29 /* 8039A0AC 0039700C 7C 00 46 70 */ srawi r0, r0, 8 /* 8039A0B0 00397010 7C 1F 01 D6 */ mullw r0, r31, r0 /* 8039A0B4 00397014 7C 00 23 D6 */ divw r0, r0, r4 /* 8039A0B8 00397018 7C 03 02 14 */ add r0, r3, r0 /* 8039A0BC 0039701C 90 1C 01 38 */ stw r0, 0x138(r28) /* 8039A0C0 00397020 40 80 00 10 */ bge lbl_8039A0D0 /* 8039A0C4 00397024 80 1C 01 38 */ lwz r0, 0x138(r28) /* 8039A0C8 00397028 7C 00 E8 40 */ cmplw r0, r29 /* 8039A0CC 0039702C 41 80 00 18 */ blt lbl_8039A0E4 lbl_8039A0D0: /* 8039A0D0 00397030 7C 03 E8 40 */ cmplw r3, r29 /* 8039A0D4 00397034 40 81 00 24 */ ble lbl_8039A0F8 /* 8039A0D8 00397038 80 1C 01 38 */ lwz r0, 0x138(r28) /* 8039A0DC 0039703C 7C 00 E8 40 */ cmplw r0, r29 /* 8039A0E0 00397040 40 81 00 18 */ ble lbl_8039A0F8 lbl_8039A0E4: /* 8039A0E4 00397044 80 1C 01 3C */ lwz r0, 0x13c(r28) /* 8039A0E8 00397048 83 DC 01 38 */ lwz r30, 0x138(r28) /* 8039A0EC 0039704C 7C 00 FA 14 */ add r0, r0, r31 /* 8039A0F0 00397050 90 1C 01 3C */ stw r0, 0x13c(r28) /* 8039A0F4 00397054 48 00 00 0C */ b lbl_8039A100 lbl_8039A0F8: /* 8039A0F8 00397058 80 1C 01 34 */ lwz r0, 0x134(r28) /* 8039A0FC 0039705C 90 1C 01 3C */ stw r0, 0x13c(r28) lbl_8039A100: /* 8039A100 00397060 80 7C 01 14 */ lwz r3, 0x114(r28) /* 8039A104 00397064 38 00 02 00 */ li r0, 0x200 /* 8039A108 00397068 80 BC 01 18 */ lwz r5, 0x118(r28) /* 8039A10C 0039706C 38 80 00 00 */ li r4, 0 /* 8039A110 00397070 7C 60 00 38 */ and r0, r3, r0 /* 8039A114 00397074 7C A3 20 38 */ and r3, r5, r4 /* 8039A118 00397078 7C 63 22 78 */ xor r3, r3, r4 /* 8039A11C 0039707C 7C 00 22 78 */ xor r0, r0, r4 /* 8039A120 00397080 7C 60 03 79 */ or. r0, r3, r0 /* 8039A124 00397084 41 82 00 1C */ beq lbl_8039A140 /* 8039A128 00397088 80 1C 01 E4 */ lwz r0, 0x1e4(r28) /* 8039A12C 0039708C A8 7C 02 04 */ lha r3, 0x204(r28) /* 8039A130 00397090 7C 00 86 70 */ srawi r0, r0, 0x10 /* 8039A134 00397094 7C 03 01 D6 */ mullw r0, r3, r0 /* 8039A138 00397098 7C 00 3E 70 */ srawi r0, r0, 7 /* 8039A13C 0039709C 7F DE 02 14 */ add r30, r30, r0 lbl_8039A140: /* 8039A140 003970A0 80 9C 01 24 */ lwz r4, 0x124(r28) /* 8039A144 003970A4 57 C3 86 3E */ rlwinm r3, r30, 0x10, 0x18, 0x1f /* 8039A148 003970A8 48 00 EF E5 */ bl sndGetPitch /* 8039A14C 003970AC 57 DE 04 3F */ clrlwi. r30, r30, 0x10 /* 8039A150 003970B0 54 7D 80 1E */ slwi r29, r3, 0x10 /* 8039A154 003970B4 41 82 00 20 */ beq lbl_8039A174 /* 8039A158 003970B8 57 BF 84 3E */ srwi r31, r29, 0x10 /* 8039A15C 003970BC 7F E3 FB 78 */ mr r3, r31 /* 8039A160 003970C0 48 00 EF 91 */ bl sndPitchUpOne /* 8039A164 003970C4 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 8039A168 003970C8 7C 1F 00 50 */ subf r0, r31, r0 /* 8039A16C 003970CC 7C 1E 01 D6 */ mullw r0, r30, r0 /* 8039A170 003970D0 7F BD 02 14 */ add r29, r29, r0 lbl_8039A174: /* 8039A174 003970D4 80 1C 01 A4 */ lwz r0, 0x1a4(r28) /* 8039A178 003970D8 7F 83 E3 78 */ mr r3, r28 /* 8039A17C 003970DC 80 9C 01 A0 */ lwz r4, 0x1a0(r28) /* 8039A180 003970E0 7F A0 EA 14 */ add r29, r0, r29 /* 8039A184 003970E4 7F A4 EA 14 */ add r29, r4, r29 /* 8039A188 003970E8 48 01 82 9D */ bl inpGetDoppler /* 8039A18C 003970EC 54 63 04 3E */ clrlwi r3, r3, 0x10 /* 8039A190 003970F0 57 A0 84 3E */ srwi r0, r29, 0x10 /* 8039A194 003970F4 7C 00 19 D6 */ mullw r0, r0, r3 /* 8039A198 003970F8 7F 63 DB 78 */ mr r3, r27 /* 8039A19C 003970FC 54 04 9C 3E */ rlwinm r4, r0, 0x13, 0x10, 0x1f /* 8039A1A0 00397100 B0 9C 02 06 */ sth r4, 0x206(r28) /* 8039A1A4 00397104 48 01 94 B9 */ bl hwSetPitch /* 8039A1A8 00397108 7F 83 E3 78 */ mr r3, r28 /* 8039A1AC 0039710C 38 80 00 00 */ li r4, 0 /* 8039A1B0 00397110 38 A0 0F 00 */ li r5, 0xf00 /* 8039A1B4 00397114 48 00 07 35 */ bl synthAddJob lbl_8039A1B8: /* 8039A1B8 00397118 88 1C 00 A8 */ lbz r0, 0xa8(r28) /* 8039A1BC 0039711C 28 00 00 00 */ cmplwi r0, 0 /* 8039A1C0 00397120 41 82 00 14 */ beq lbl_8039A1D4 /* 8039A1C4 00397124 38 60 00 00 */ li r3, 0 /* 8039A1C8 00397128 38 00 1F FF */ li r0, 0x1fff /* 8039A1CC 0039712C 98 7C 00 A8 */ stb r3, 0xa8(r28) /* 8039A1D0 00397130 90 1C 02 14 */ stw r0, 0x214(r28) lbl_8039A1D4: /* 8039A1D4 00397134 39 61 00 30 */ addi r11, r1, 0x30 /* 8039A1D8 00397138 4B FE F8 F1 */ bl _restgpr_27 /* 8039A1DC 0039713C 80 01 00 34 */ lwz r0, 0x34(r1) /* 8039A1E0 00397140 7C 08 03 A6 */ mtlr r0 /* 8039A1E4 00397144 38 21 00 30 */ addi r1, r1, 0x30 /* 8039A1E8 00397148 4E 80 00 20 */ blr .fn ZeroOffsetHandler, local /* 8039A1EC 0039714C 94 21 FF 60 */ stwu r1, -0xa0(r1) /* 8039A1F0 00397150 7C 08 02 A6 */ mflr r0 /* 8039A1F4 00397154 90 01 00 A4 */ stw r0, 0xa4(r1) /* 8039A1F8 00397158 DB E1 00 90 */ stfd f31, 0x90(r1) /* 8039A1FC 0039715C F3 E1 00 98 */ psq_st f31, 152(r1), 0, qr0 /* 8039A200 00397160 DB C1 00 80 */ stfd f30, 0x80(r1) /* 8039A204 00397164 F3 C1 00 88 */ psq_st f30, 136(r1), 0, qr0 /* 8039A208 00397168 DB A1 00 70 */ stfd f29, 0x70(r1) /* 8039A20C 0039716C F3 A1 00 78 */ psq_st f29, 120(r1), 0, qr0 /* 8039A210 00397170 DB 81 00 60 */ stfd f28, 0x60(r1) /* 8039A214 00397174 F3 81 00 68 */ psq_st f28, 104(r1), 0, qr0 /* 8039A218 00397178 93 E1 00 5C */ stw r31, 0x5c(r1) /* 8039A21C 0039717C 93 C1 00 58 */ stw r30, 0x58(r1) /* 8039A220 00397180 93 A1 00 54 */ stw r29, 0x54(r1) /* 8039A224 00397184 93 81 00 50 */ stw r28, 0x50(r1) /* 8039A228 00397188 7C 7D 1B 78 */ mr r29, r3 /* 8039A22C 0039718C 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039A230 00397190 1C 1D 04 04 */ mulli r0, r29, 0x404 /* 8039A234 00397194 7F C4 02 14 */ add r30, r4, r0 /* 8039A238 00397198 48 01 8F 65 */ bl hwIsActive /* 8039A23C 0039719C 28 03 00 00 */ cmplwi r3, 0 /* 8039A240 003971A0 40 82 00 10 */ bne lbl_8039A250 /* 8039A244 003971A4 80 1E 00 34 */ lwz r0, 0x34(r30) /* 8039A248 003971A8 28 00 00 00 */ cmplwi r0, 0 /* 8039A24C 003971AC 41 82 06 40 */ beq lbl_8039A88C lbl_8039A250: /* 8039A250 003971B0 80 CD AE 88 */ lwz r6, synthRealTime@sda21(r13) /* 8039A254 003971B4 3C 60 00 01 */ lis r3, 0x00008000@ha /* 8039A258 003971B8 80 ED AE 8C */ lwz r7, synthRealTime+4@sda21(r13) /* 8039A25C 003971BC 38 63 80 00 */ addi r3, r3, 0x00008000@l /* 8039A260 003971C0 80 BE 00 30 */ lwz r5, 0x30(r30) /* 8039A264 003971C4 38 80 00 00 */ li r4, 0 /* 8039A268 003971C8 80 1E 00 2C */ lwz r0, 0x2c(r30) /* 8039A26C 003971CC 7F E5 38 10 */ subfc r31, r5, r7 /* 8039A270 003971D0 90 FE 00 30 */ stw r7, 0x30(r30) /* 8039A274 003971D4 7C 00 31 10 */ subfe r0, r0, r6 /* 8039A278 003971D8 90 DE 00 2C */ stw r6, 0x2c(r30) /* 8039A27C 003971DC 80 BE 01 14 */ lwz r5, 0x114(r30) /* 8039A280 003971E0 80 DE 01 18 */ lwz r6, 0x118(r30) /* 8039A284 003971E4 7C A0 20 38 */ and r0, r5, r4 /* 8039A288 003971E8 7C C3 18 38 */ and r3, r6, r3 /* 8039A28C 003971EC 7C 63 22 78 */ xor r3, r3, r4 /* 8039A290 003971F0 7C 00 22 78 */ xor r0, r0, r4 /* 8039A294 003971F4 7C 60 03 79 */ or. r0, r3, r0 /* 8039A298 003971F8 41 82 00 AC */ beq lbl_8039A344 /* 8039A29C 003971FC 80 7E 01 94 */ lwz r3, 0x194(r30) /* 8039A2A0 00397200 57 E0 C2 3E */ srwi r0, r31, 8 /* 8039A2A4 00397204 80 9E 01 9C */ lwz r4, 0x19c(r30) /* 8039A2A8 00397208 7C 03 01 D6 */ mullw r0, r3, r0 /* 8039A2AC 0039720C 7C 04 02 14 */ add r0, r4, r0 /* 8039A2B0 00397210 90 1E 01 9C */ stw r0, 0x19c(r30) /* 8039A2B4 00397214 80 1E 01 94 */ lwz r0, 0x194(r30) /* 8039A2B8 00397218 2C 00 00 00 */ cmpwi r0, 0 /* 8039A2BC 0039721C 40 80 00 40 */ bge lbl_8039A2FC /* 8039A2C0 00397220 80 7E 01 98 */ lwz r3, 0x198(r30) /* 8039A2C4 00397224 80 1E 01 9C */ lwz r0, 0x19c(r30) /* 8039A2C8 00397228 7C 03 00 00 */ cmpw r3, r0 /* 8039A2CC 0039722C 41 80 00 68 */ blt lbl_8039A334 /* 8039A2D0 00397230 90 7E 01 9C */ stw r3, 0x19c(r30) /* 8039A2D4 00397234 3C 60 FF FF */ lis r3, 0xFFFF7FFF@ha /* 8039A2D8 00397238 38 03 7F FF */ addi r0, r3, 0xFFFF7FFF@l /* 8039A2DC 0039723C 38 60 FF FF */ li r3, -1 /* 8039A2E0 00397240 80 BE 01 18 */ lwz r5, 0x118(r30) /* 8039A2E4 00397244 80 9E 01 14 */ lwz r4, 0x114(r30) /* 8039A2E8 00397248 7C A0 00 38 */ and r0, r5, r0 /* 8039A2EC 0039724C 90 1E 01 18 */ stw r0, 0x118(r30) /* 8039A2F0 00397250 7C 80 18 38 */ and r0, r4, r3 /* 8039A2F4 00397254 90 1E 01 14 */ stw r0, 0x114(r30) /* 8039A2F8 00397258 48 00 00 3C */ b lbl_8039A334 lbl_8039A2FC: /* 8039A2FC 0039725C 80 7E 01 98 */ lwz r3, 0x198(r30) /* 8039A300 00397260 80 1E 01 9C */ lwz r0, 0x19c(r30) /* 8039A304 00397264 7C 03 00 00 */ cmpw r3, r0 /* 8039A308 00397268 41 81 00 2C */ bgt lbl_8039A334 /* 8039A30C 0039726C 90 7E 01 9C */ stw r3, 0x19c(r30) /* 8039A310 00397270 3C 60 FF FF */ lis r3, 0xFFFF7FFF@ha /* 8039A314 00397274 38 03 7F FF */ addi r0, r3, 0xFFFF7FFF@l /* 8039A318 00397278 38 60 FF FF */ li r3, -1 /* 8039A31C 0039727C 80 BE 01 18 */ lwz r5, 0x118(r30) /* 8039A320 00397280 80 9E 01 14 */ lwz r4, 0x114(r30) /* 8039A324 00397284 7C A0 00 38 */ and r0, r5, r0 /* 8039A328 00397288 90 1E 01 18 */ stw r0, 0x118(r30) /* 8039A32C 0039728C 7C 80 18 38 */ and r0, r4, r3 /* 8039A330 00397290 90 1E 01 14 */ stw r0, 0x114(r30) lbl_8039A334: /* 8039A334 00397294 80 7E 01 9C */ lwz r3, 0x19c(r30) /* 8039A338 00397298 38 00 00 01 */ li r0, 1 /* 8039A33C 0039729C 90 7E 01 54 */ stw r3, 0x154(r30) /* 8039A340 003972A0 48 00 00 24 */ b lbl_8039A364 lbl_8039A344: /* 8039A344 003972A4 38 00 10 00 */ li r0, 0x1000 /* 8039A348 003972A8 7C C3 20 38 */ and r3, r6, r4 /* 8039A34C 003972AC 7C A0 00 38 */ and r0, r5, r0 /* 8039A350 003972B0 7C 63 22 78 */ xor r3, r3, r4 /* 8039A354 003972B4 7C 00 22 78 */ xor r0, r0, r4 /* 8039A358 003972B8 7C 60 03 78 */ or r0, r3, r0 /* 8039A35C 003972BC 30 60 FF FF */ addic r3, r0, -1 /* 8039A360 003972C0 7C 03 01 10 */ subfe r0, r3, r0 lbl_8039A364: /* 8039A364 003972C4 80 9E 01 18 */ lwz r4, 0x118(r30) /* 8039A368 003972C8 38 60 FF FF */ li r3, -1 /* 8039A36C 003972CC 80 DE 01 14 */ lwz r6, 0x114(r30) /* 8039A370 003972D0 38 A0 EF FF */ li r5, -4097 /* 8039A374 003972D4 7C 84 18 38 */ and r4, r4, r3 /* 8039A378 003972D8 3C 60 80 55 */ lis r3, synthMasterFader@ha /* 8039A37C 003972DC 90 9E 01 18 */ stw r4, 0x118(r30) /* 8039A380 003972E0 7C C4 28 38 */ and r4, r6, r5 /* 8039A384 003972E4 38 A3 02 64 */ addi r5, r3, synthMasterFader@l /* 8039A388 003972E8 90 9E 01 14 */ stw r4, 0x114(r30) /* 8039A38C 003972EC 88 DE 01 1D */ lbz r6, 0x11d(r30) /* 8039A390 003972F0 88 7E 01 1E */ lbz r3, 0x11e(r30) /* 8039A394 003972F4 7C 86 00 D0 */ neg r4, r6 /* 8039A398 003972F8 89 1E 01 20 */ lbz r8, 0x120(r30) /* 8039A39C 003972FC 1C E3 00 30 */ mulli r7, r3, 0x30 /* 8039A3A0 00397300 7C 83 33 78 */ or r3, r4, r6 /* 8039A3A4 00397304 28 08 00 FF */ cmplwi r8, 0xff /* 8039A3A8 00397308 54 63 0F FE */ srwi r3, r3, 0x1f /* 8039A3AC 0039730C 7C 05 3C 2E */ lfsx f0, r5, r7 /* 8039A3B0 00397310 38 63 00 15 */ addi r3, r3, 0x15 /* 8039A3B4 00397314 7C 85 3A 14 */ add r4, r5, r7 /* 8039A3B8 00397318 1C 63 00 30 */ mulli r3, r3, 0x30 /* 8039A3BC 0039731C C0 24 00 14 */ lfs f1, 0x14(r4) /* 8039A3C0 00397320 EC 21 00 32 */ fmuls f1, f1, f0 /* 8039A3C4 00397324 7C 05 1C 2E */ lfsx f0, r5, r3 /* 8039A3C8 00397328 EC 61 00 32 */ fmuls f3, f1, f0 /* 8039A3CC 0039732C 41 82 00 38 */ beq lbl_8039A404 /* 8039A3D0 00397330 3C 80 80 55 */ lis r4, synthTrackVolume@ha /* 8039A3D4 00397334 3C 60 43 30 */ lis r3, 0x4330 /* 8039A3D8 00397338 38 84 08 64 */ addi r4, r4, synthTrackVolume@l /* 8039A3DC 0039733C 90 61 00 08 */ stw r3, 8(r1) /* 8039A3E0 00397340 7C 64 40 AE */ lbzx r3, r4, r8 /* 8039A3E4 00397344 C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039A3E8 00397348 90 61 00 0C */ stw r3, 0xc(r1) /* 8039A3EC 0039734C C0 42 D5 10 */ lfs f2, lbl_805AF230@sda21(r2) /* 8039A3F0 00397350 C8 01 00 08 */ lfd f0, 8(r1) /* 8039A3F4 00397354 EC 00 08 28 */ fsubs f0, f0, f1 /* 8039A3F8 00397358 EC 03 00 32 */ fmuls f0, f3, f0 /* 8039A3FC 0039735C EF E2 00 32 */ fmuls f31, f2, f0 /* 8039A400 00397360 48 00 00 08 */ b lbl_8039A408 lbl_8039A404: /* 8039A404 00397364 FF E0 18 90 */ fmr f31, f3 lbl_8039A408: /* 8039A408 00397368 C0 1E 01 5C */ lfs f0, 0x15c(r30) /* 8039A40C 0039736C FC 1F 00 00 */ fcmpu cr0, f31, f0 /* 8039A410 00397370 41 82 00 0C */ beq lbl_8039A41C /* 8039A414 00397374 D3 FE 01 5C */ stfs f31, 0x15c(r30) /* 8039A418 00397378 38 00 00 01 */ li r0, 1 lbl_8039A41C: /* 8039A41C 0039737C 80 9E 01 54 */ lwz r4, 0x154(r30) /* 8039A420 00397380 3C 60 43 30 */ lis r3, 0x4330 /* 8039A424 00397384 90 61 00 08 */ stw r3, 8(r1) /* 8039A428 00397388 C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039A42C 0039738C 90 81 00 0C */ stw r4, 0xc(r1) /* 8039A430 00397390 C0 42 D5 14 */ lfs f2, lbl_805AF234@sda21(r2) /* 8039A434 00397394 C8 01 00 08 */ lfd f0, 8(r1) /* 8039A438 00397398 A0 9E 01 6C */ lhz r4, 0x16c(r30) /* 8039A43C 0039739C EC 00 08 28 */ fsubs f0, f0, f1 /* 8039A440 003973A0 A0 7E 01 6E */ lhz r3, 0x16e(r30) /* 8039A444 003973A4 7C 83 1B 79 */ or. r3, r4, r3 /* 8039A448 003973A8 EF C2 00 32 */ fmuls f30, f2, f0 /* 8039A44C 003973AC 41 82 01 18 */ beq lbl_8039A564 /* 8039A450 003973B0 7F C3 F3 78 */ mr r3, r30 /* 8039A454 003973B4 48 01 80 19 */ bl inpGetModulation /* 8039A458 003973B8 7C 7C 1B 78 */ mr r28, r3 /* 8039A45C 003973BC 7F C3 F3 78 */ mr r3, r30 /* 8039A460 003973C0 48 01 81 BD */ bl inpGetTremolo /* 8039A464 003973C4 7C 63 07 34 */ extsh r3, r3 /* 8039A468 003973C8 3C A0 43 30 */ lis r5, 0x4330 /* 8039A46C 003973CC 38 03 E0 00 */ addi r0, r3, -8192 /* 8039A470 003973D0 57 83 04 3E */ clrlwi r3, r28, 0x10 /* 8039A474 003973D4 20 00 20 00 */ subfic r0, r0, 0x2000 /* 8039A478 003973D8 A0 9E 01 6C */ lhz r4, 0x16c(r30) /* 8039A47C 003973DC 7C 06 0E 70 */ srawi r6, r0, 1 /* 8039A480 003973E0 A0 1E 01 6E */ lhz r0, 0x16e(r30) /* 8039A484 003973E4 20 C6 20 00 */ subfic r6, r6, 0x2000 /* 8039A488 003973E8 90 61 00 1C */ stw r3, 0x1c(r1) /* 8039A48C 003973EC 20 00 10 00 */ subfic r0, r0, 0x1000 /* 8039A490 003973F0 C8 C2 D5 40 */ lfd f6, lbl_805AF260@sda21(r2) /* 8039A494 003973F4 6C 00 80 00 */ xoris r0, r0, 0x8000 /* 8039A498 003973F8 90 A1 00 18 */ stw r5, 0x18(r1) /* 8039A49C 003973FC 6C C3 80 00 */ xoris r3, r6, 0x8000 /* 8039A4A0 00397400 C8 82 D5 38 */ lfd f4, lbl_805AF258@sda21(r2) /* 8039A4A4 00397404 90 01 00 24 */ stw r0, 0x24(r1) /* 8039A4A8 00397408 C8 01 00 18 */ lfd f0, 0x18(r1) /* 8039A4AC 0039740C 90 A1 00 20 */ stw r5, 0x20(r1) /* 8039A4B0 00397410 EC 20 20 28 */ fsubs f1, f0, f4 /* 8039A4B4 00397414 C0 42 D5 24 */ lfs f2, lbl_805AF244@sda21(r2) /* 8039A4B8 00397418 C8 01 00 20 */ lfd f0, 0x20(r1) /* 8039A4BC 0039741C 90 81 00 14 */ stw r4, 0x14(r1) /* 8039A4C0 00397420 EC 00 30 28 */ fsubs f0, f0, f6 /* 8039A4C4 00397424 C0 62 D5 20 */ lfs f3, lbl_805AF240@sda21(r2) /* 8039A4C8 00397428 90 A1 00 10 */ stw r5, 0x10(r1) /* 8039A4CC 0039742C C0 A2 D5 1C */ lfs f5, lbl_805AF23C@sda21(r2) /* 8039A4D0 00397430 EC 01 00 32 */ fmuls f0, f1, f0 /* 8039A4D4 00397434 C8 21 00 10 */ lfd f1, 0x10(r1) /* 8039A4D8 00397438 90 61 00 0C */ stw r3, 0xc(r1) /* 8039A4DC 0039743C EC 21 20 28 */ fsubs f1, f1, f4 /* 8039A4E0 00397440 C0 82 D5 18 */ lfs f4, lbl_805AF238@sda21(r2) /* 8039A4E4 00397444 EC 02 00 32 */ fmuls f0, f2, f0 /* 8039A4E8 00397448 90 A1 00 08 */ stw r5, 8(r1) /* 8039A4EC 0039744C C0 FE 01 68 */ lfs f7, 0x168(r30) /* 8039A4F0 00397450 EC 03 00 28 */ fsubs f0, f3, f0 /* 8039A4F4 00397454 C8 41 00 08 */ lfd f2, 8(r1) /* 8039A4F8 00397458 EC 42 30 28 */ fsubs f2, f2, f6 /* 8039A4FC 0039745C EC 01 00 32 */ fmuls f0, f1, f0 /* 8039A500 00397460 EC 44 00 B2 */ fmuls f2, f4, f2 /* 8039A504 00397464 EC 25 00 32 */ fmuls f1, f5, f0 /* 8039A508 00397468 FC 07 08 40 */ fcmpo cr0, f7, f1 /* 8039A50C 0039746C 40 80 00 20 */ bge lbl_8039A52C /* 8039A510 00397470 C0 02 D5 28 */ lfs f0, lbl_805AF248@sda21(r2) /* 8039A514 00397474 EC 07 00 2A */ fadds f0, f7, f0 /* 8039A518 00397478 FC 00 08 40 */ fcmpo cr0, f0, f1 /* 8039A51C 0039747C D0 1E 01 68 */ stfs f0, 0x168(r30) /* 8039A520 00397480 40 81 00 28 */ ble lbl_8039A548 /* 8039A524 00397484 D0 3E 01 68 */ stfs f1, 0x168(r30) /* 8039A528 00397488 48 00 00 20 */ b lbl_8039A548 lbl_8039A52C: /* 8039A52C 0039748C 40 81 00 1C */ ble lbl_8039A548 /* 8039A530 00397490 C0 02 D5 28 */ lfs f0, lbl_805AF248@sda21(r2) /* 8039A534 00397494 EC 07 00 28 */ fsubs f0, f7, f0 /* 8039A538 00397498 FC 00 08 40 */ fcmpo cr0, f0, f1 /* 8039A53C 0039749C D0 1E 01 68 */ stfs f0, 0x168(r30) /* 8039A540 003974A0 40 80 00 08 */ bge lbl_8039A548 /* 8039A544 003974A4 D0 3E 01 68 */ stfs f1, 0x168(r30) lbl_8039A548: /* 8039A548 003974A8 C0 22 D5 20 */ lfs f1, lbl_805AF240@sda21(r2) /* 8039A54C 003974AC 38 00 00 01 */ li r0, 1 /* 8039A550 003974B0 C0 1E 01 68 */ lfs f0, 0x168(r30) /* 8039A554 003974B4 EC 01 00 28 */ fsubs f0, f1, f0 /* 8039A558 003974B8 EC 02 00 32 */ fmuls f0, f2, f0 /* 8039A55C 003974BC EC 01 00 28 */ fsubs f0, f1, f0 /* 8039A560 003974C0 EF DE 00 32 */ fmuls f30, f30, f0 lbl_8039A564: /* 8039A564 003974C4 80 ED AE 74 */ lwz r7, synthFlags@sda21(r13) /* 8039A568 003974C8 54 E3 07 FF */ clrlwi. r3, r7, 0x1f /* 8039A56C 003974CC 40 82 00 EC */ bne lbl_8039A658 /* 8039A570 003974D0 80 9E 01 14 */ lwz r4, 0x114(r30) /* 8039A574 003974D4 38 60 20 00 */ li r3, 0x2000 /* 8039A578 003974D8 80 DE 01 18 */ lwz r6, 0x118(r30) /* 8039A57C 003974DC 38 A0 00 00 */ li r5, 0 /* 8039A580 003974E0 7C 83 18 38 */ and r3, r4, r3 /* 8039A584 003974E4 7C C4 28 38 */ and r4, r6, r5 /* 8039A588 003974E8 7C 84 2A 78 */ xor r4, r4, r5 /* 8039A58C 003974EC 7C 63 2A 78 */ xor r3, r3, r5 /* 8039A590 003974F0 7C 83 1B 79 */ or. r3, r4, r3 /* 8039A594 003974F4 40 82 00 10 */ bne lbl_8039A5A4 /* 8039A598 003974F8 80 7E 02 14 */ lwz r3, 0x214(r30) /* 8039A59C 003974FC 54 63 07 7D */ rlwinm. r3, r3, 0, 0x1d, 0x1e /* 8039A5A0 00397500 41 82 00 A8 */ beq lbl_8039A648 lbl_8039A5A4: /* 8039A5A4 00397504 80 7E 01 18 */ lwz r3, 0x118(r30) /* 8039A5A8 00397508 38 00 FF FF */ li r0, -1 /* 8039A5AC 0039750C 80 BE 01 14 */ lwz r5, 0x114(r30) /* 8039A5B0 00397510 38 80 DF FF */ li r4, -8193 /* 8039A5B4 00397514 7C 60 00 38 */ and r0, r3, r0 /* 8039A5B8 00397518 7F C3 F3 78 */ mr r3, r30 /* 8039A5BC 0039751C 90 1E 01 18 */ stw r0, 0x118(r30) /* 8039A5C0 00397520 7C A0 20 38 */ and r0, r5, r4 /* 8039A5C4 00397524 90 1E 01 14 */ stw r0, 0x114(r30) /* 8039A5C8 00397528 48 01 7D 85 */ bl inpGetPanning /* 8039A5CC 0039752C 54 63 04 3E */ clrlwi r3, r3, 0x10 /* 8039A5D0 00397530 80 1E 01 70 */ lwz r0, 0x170(r30) /* 8039A5D4 00397534 38 63 E0 00 */ addi r3, r3, -8192 /* 8039A5D8 00397538 54 63 48 2C */ slwi r3, r3, 9 /* 8039A5DC 0039753C 7C 60 1A 15 */ add. r3, r0, r3 /* 8039A5E0 00397540 40 80 00 0C */ bge lbl_8039A5EC /* 8039A5E4 00397544 38 00 00 00 */ li r0, 0 /* 8039A5E8 00397548 48 00 00 14 */ b lbl_8039A5FC lbl_8039A5EC: /* 8039A5EC 0039754C 3C 00 00 7F */ lis r0, 0x7f /* 8039A5F0 00397550 7C 03 00 00 */ cmpw r3, r0 /* 8039A5F4 00397554 41 81 00 08 */ bgt lbl_8039A5FC /* 8039A5F8 00397558 7C 60 1B 78 */ mr r0, r3 lbl_8039A5FC: /* 8039A5FC 0039755C 90 1E 01 60 */ stw r0, 0x160(r30) /* 8039A600 00397560 80 0D AE 74 */ lwz r0, synthFlags@sda21(r13) /* 8039A604 00397564 54 00 07 BD */ rlwinm. r0, r0, 0, 0x1e, 0x1e /* 8039A608 00397568 41 82 00 30 */ beq lbl_8039A638 /* 8039A60C 0039756C 7F C3 F3 78 */ mr r3, r30 /* 8039A610 00397570 48 01 7D 85 */ bl inpGetSurPanning /* 8039A614 00397574 80 9E 01 74 */ lwz r4, 0x174(r30) /* 8039A618 00397578 54 63 49 EC */ rlwinm r3, r3, 9, 7, 0x16 /* 8039A61C 0039757C 3C 00 00 7F */ lis r0, 0x7f /* 8039A620 00397580 7C 64 1A 14 */ add r3, r4, r3 /* 8039A624 00397584 7C 03 00 40 */ cmplw r3, r0 /* 8039A628 00397588 90 7E 01 64 */ stw r3, 0x164(r30) /* 8039A62C 0039758C 40 81 00 14 */ ble lbl_8039A640 /* 8039A630 00397590 90 1E 01 64 */ stw r0, 0x164(r30) /* 8039A634 00397594 48 00 00 0C */ b lbl_8039A640 lbl_8039A638: /* 8039A638 00397598 38 00 00 00 */ li r0, 0 /* 8039A63C 0039759C 90 1E 01 64 */ stw r0, 0x164(r30) lbl_8039A640: /* 8039A640 003975A0 38 00 00 01 */ li r0, 1 /* 8039A644 003975A4 48 00 00 68 */ b lbl_8039A6AC lbl_8039A648: /* 8039A648 003975A8 54 E3 07 BD */ rlwinm. r3, r7, 0, 0x1e, 0x1e /* 8039A64C 003975AC 40 82 00 60 */ bne lbl_8039A6AC /* 8039A650 003975B0 90 BE 01 64 */ stw r5, 0x164(r30) /* 8039A654 003975B4 48 00 00 58 */ b lbl_8039A6AC lbl_8039A658: /* 8039A658 003975B8 3C 60 00 40 */ lis r3, 0x40 /* 8039A65C 003975BC 39 20 00 00 */ li r9, 0 /* 8039A660 003975C0 90 7E 01 60 */ stw r3, 0x160(r30) /* 8039A664 003975C4 38 A0 20 00 */ li r5, 0x2000 /* 8039A668 003975C8 38 80 FF FF */ li r4, -1 /* 8039A66C 003975CC 38 60 DF FF */ li r3, -8193 /* 8039A670 003975D0 91 3E 01 64 */ stw r9, 0x164(r30) /* 8039A674 003975D4 80 FE 01 14 */ lwz r7, 0x114(r30) /* 8039A678 003975D8 81 1E 01 18 */ lwz r8, 0x118(r30) /* 8039A67C 003975DC 7C E6 28 38 */ and r6, r7, r5 /* 8039A680 003975E0 7C E3 18 38 */ and r3, r7, r3 /* 8039A684 003975E4 7D 05 48 38 */ and r5, r8, r9 /* 8039A688 003975E8 7D 04 20 38 */ and r4, r8, r4 /* 8039A68C 003975EC 90 9E 01 18 */ stw r4, 0x118(r30) /* 8039A690 003975F0 7C A5 4A 78 */ xor r5, r5, r9 /* 8039A694 003975F4 7C C4 4A 78 */ xor r4, r6, r9 /* 8039A698 003975F8 7C A4 23 78 */ or r4, r5, r4 /* 8039A69C 003975FC 90 7E 01 14 */ stw r3, 0x114(r30) /* 8039A6A0 00397600 30 A4 FF FF */ addic r5, r4, -1 /* 8039A6A4 00397604 7C 85 21 10 */ subfe r4, r5, r4 /* 8039A6A8 00397608 7C 00 23 78 */ or r0, r0, r4 lbl_8039A6AC: /* 8039A6AC 0039760C 28 00 00 00 */ cmplwi r0, 0 /* 8039A6B0 00397610 40 82 00 10 */ bne lbl_8039A6C0 /* 8039A6B4 00397614 80 1E 02 14 */ lwz r0, 0x214(r30) /* 8039A6B8 00397618 70 00 0F 01 */ andi. r0, r0, 0xf01 /* 8039A6BC 0039761C 41 82 01 74 */ beq lbl_8039A830 lbl_8039A6C0: /* 8039A6C0 00397620 7F C3 F3 78 */ mr r3, r30 /* 8039A6C4 00397624 48 01 7C 41 */ bl inpGetVolume /* 8039A6C8 00397628 54 63 04 3E */ clrlwi r3, r3, 0x10 /* 8039A6CC 0039762C 3C 00 43 30 */ lis r0, 0x4330 /* 8039A6D0 00397630 90 61 00 24 */ stw r3, 0x24(r1) /* 8039A6D4 00397634 EC 3E 07 F2 */ fmuls f1, f30, f31 /* 8039A6D8 00397638 C8 62 D5 38 */ lfd f3, lbl_805AF258@sda21(r2) /* 8039A6DC 0039763C 7F C3 F3 78 */ mr r3, r30 /* 8039A6E0 00397640 90 01 00 20 */ stw r0, 0x20(r1) /* 8039A6E4 00397644 C0 02 D5 2C */ lfs f0, lbl_805AF24C@sda21(r2) /* 8039A6E8 00397648 C8 41 00 20 */ lfd f2, 0x20(r1) /* 8039A6EC 0039764C EC 42 18 28 */ fsubs f2, f2, f3 /* 8039A6F0 00397650 EC 21 00 B2 */ fmuls f1, f1, f2 /* 8039A6F4 00397654 EF E0 00 72 */ fmuls f31, f0, f1 /* 8039A6F8 00397658 48 01 7E 4D */ bl inpGetReverb /* 8039A6FC 0039765C 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 8039A700 00397660 3C 80 43 30 */ lis r4, 0x4330 /* 8039A704 00397664 90 01 00 1C */ stw r0, 0x1c(r1) /* 8039A708 00397668 7F C3 F3 78 */ mr r3, r30 /* 8039A70C 0039766C 88 1E 01 90 */ lbz r0, 0x190(r30) /* 8039A710 00397670 90 81 00 18 */ stw r4, 0x18(r1) /* 8039A714 00397674 C8 82 D5 38 */ lfd f4, lbl_805AF258@sda21(r2) /* 8039A718 00397678 C8 01 00 18 */ lfd f0, 0x18(r1) /* 8039A71C 0039767C 90 01 00 14 */ stw r0, 0x14(r1) /* 8039A720 00397680 EC 20 20 28 */ fsubs f1, f0, f4 /* 8039A724 00397684 C0 42 D5 2C */ lfs f2, lbl_805AF24C@sda21(r2) /* 8039A728 00397688 90 81 00 10 */ stw r4, 0x10(r1) /* 8039A72C 0039768C C0 02 D5 10 */ lfs f0, lbl_805AF230@sda21(r2) /* 8039A730 00397690 EC 7F 00 72 */ fmuls f3, f31, f1 /* 8039A734 00397694 C8 21 00 10 */ lfd f1, 0x10(r1) /* 8039A738 00397698 EC 21 20 28 */ fsubs f1, f1, f4 /* 8039A73C 0039769C EC 42 00 F2 */ fmuls f2, f2, f3 /* 8039A740 003976A0 EC 21 00 B2 */ fmuls f1, f1, f2 /* 8039A744 003976A4 EF A0 00 72 */ fmuls f29, f0, f1 /* 8039A748 003976A8 48 01 7D B5 */ bl inpGetPreAuxA /* 8039A74C 003976AC 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 8039A750 003976B0 3C 80 43 30 */ lis r4, 0x4330 /* 8039A754 003976B4 90 01 00 0C */ stw r0, 0xc(r1) /* 8039A758 003976B8 7F C3 F3 78 */ mr r3, r30 /* 8039A75C 003976BC 88 1E 01 91 */ lbz r0, 0x191(r30) /* 8039A760 003976C0 90 81 00 08 */ stw r4, 8(r1) /* 8039A764 003976C4 C8 82 D5 38 */ lfd f4, lbl_805AF258@sda21(r2) /* 8039A768 003976C8 C8 01 00 08 */ lfd f0, 8(r1) /* 8039A76C 003976CC 90 01 00 2C */ stw r0, 0x2c(r1) /* 8039A770 003976D0 EC 00 20 28 */ fsubs f0, f0, f4 /* 8039A774 003976D4 C0 42 D5 2C */ lfs f2, lbl_805AF24C@sda21(r2) /* 8039A778 003976D8 90 81 00 28 */ stw r4, 0x28(r1) /* 8039A77C 003976DC C0 22 D5 10 */ lfs f1, lbl_805AF230@sda21(r2) /* 8039A780 003976E0 EC 7E 00 32 */ fmuls f3, f30, f0 /* 8039A784 003976E4 C8 01 00 28 */ lfd f0, 0x28(r1) /* 8039A788 003976E8 EC 00 20 28 */ fsubs f0, f0, f4 /* 8039A78C 003976EC EC 42 00 F2 */ fmuls f2, f2, f3 /* 8039A790 003976F0 EC 01 00 32 */ fmuls f0, f1, f0 /* 8039A794 003976F4 EC 22 E8 2A */ fadds f1, f2, f29 /* 8039A798 003976F8 EF 80 08 2A */ fadds f28, f0, f1 /* 8039A79C 003976FC 48 01 7E 39 */ bl inpGetPostAuxB /* 8039A7A0 00397700 54 63 04 3E */ clrlwi r3, r3, 0x10 /* 8039A7A4 00397704 3C 00 43 30 */ lis r0, 0x4330 /* 8039A7A8 00397708 90 61 00 34 */ stw r3, 0x34(r1) /* 8039A7AC 0039770C 7F C3 F3 78 */ mr r3, r30 /* 8039A7B0 00397710 C8 42 D5 38 */ lfd f2, lbl_805AF258@sda21(r2) /* 8039A7B4 00397714 90 01 00 30 */ stw r0, 0x30(r1) /* 8039A7B8 00397718 C0 02 D5 2C */ lfs f0, lbl_805AF24C@sda21(r2) /* 8039A7BC 0039771C C8 21 00 30 */ lfd f1, 0x30(r1) /* 8039A7C0 00397720 EC 21 10 28 */ fsubs f1, f1, f2 /* 8039A7C4 00397724 EC 3F 00 72 */ fmuls f1, f31, f1 /* 8039A7C8 00397728 EF A0 00 72 */ fmuls f29, f0, f1 /* 8039A7CC 0039772C 48 01 7D C1 */ bl inpGetPreAuxB /* 8039A7D0 00397730 54 63 04 3E */ clrlwi r3, r3, 0x10 /* 8039A7D4 00397734 3C 00 43 30 */ lis r0, 0x4330 /* 8039A7D8 00397738 90 61 00 3C */ stw r3, 0x3c(r1) /* 8039A7DC 0039773C FC 20 F8 90 */ fmr f1, f31 /* 8039A7E0 00397740 C0 02 D5 30 */ lfs f0, lbl_805AF250@sda21(r2) /* 8039A7E4 00397744 FC 40 E0 90 */ fmr f2, f28 /* 8039A7E8 00397748 90 01 00 38 */ stw r0, 0x38(r1) /* 8039A7EC 0039774C 7F A3 EB 78 */ mr r3, r29 /* 8039A7F0 00397750 EC 00 07 F2 */ fmuls f0, f0, f31 /* 8039A7F4 00397754 C8 A2 D5 38 */ lfd f5, lbl_805AF258@sda21(r2) /* 8039A7F8 00397758 C8 81 00 38 */ lfd f4, 0x38(r1) /* 8039A7FC 0039775C FC 00 00 1E */ fctiwz f0, f0 /* 8039A800 00397760 C0 62 D5 2C */ lfs f3, lbl_805AF24C@sda21(r2) /* 8039A804 00397764 EC 84 28 28 */ fsubs f4, f4, f5 /* 8039A808 00397768 D8 01 00 40 */ stfd f0, 0x40(r1) /* 8039A80C 0039776C EC 9E 01 32 */ fmuls f4, f30, f4 /* 8039A810 00397770 80 01 00 44 */ lwz r0, 0x44(r1) /* 8039A814 00397774 B0 1E 04 00 */ sth r0, 0x400(r30) /* 8039A818 00397778 EC 03 01 32 */ fmuls f0, f3, f4 /* 8039A81C 0039777C 88 9E 01 92 */ lbz r4, 0x192(r30) /* 8039A820 00397780 EC 60 E8 2A */ fadds f3, f0, f29 /* 8039A824 00397784 80 BE 01 60 */ lwz r5, 0x160(r30) /* 8039A828 00397788 80 DE 01 64 */ lwz r6, 0x164(r30) /* 8039A82C 0039778C 48 01 8F 5D */ bl hwSetVolume lbl_8039A830: /* 8039A830 00397790 80 7E 01 10 */ lwz r3, 0x110(r30) /* 8039A834 00397794 28 03 00 00 */ cmplwi r3, 0 /* 8039A838 00397798 41 82 00 38 */ beq lbl_8039A870 /* 8039A83C 0039779C A0 1E 01 0E */ lhz r0, 0x10e(r30) /* 8039A840 003977A0 7C 00 F9 D6 */ mullw r0, r0, r31 /* 8039A844 003977A4 7C 00 18 51 */ subf. r0, r0, r3 /* 8039A848 003977A8 90 1E 01 10 */ stw r0, 0x110(r30) /* 8039A84C 003977AC 40 80 00 0C */ bge lbl_8039A858 /* 8039A850 003977B0 38 00 00 00 */ li r0, 0 /* 8039A854 003977B4 90 1E 01 10 */ stw r0, 0x110(r30) lbl_8039A858: /* 8039A858 003977B8 80 1E 01 10 */ lwz r0, 0x110(r30) /* 8039A85C 003977BC 7F A3 EB 78 */ mr r3, r29 /* 8039A860 003977C0 88 BE 01 0C */ lbz r5, 0x10c(r30) /* 8039A864 003977C4 54 04 8B FE */ srwi r4, r0, 0xf /* 8039A868 003977C8 50 A4 C0 0E */ rlwimi r4, r5, 0x18, 0, 7 /* 8039A86C 003977CC 48 01 89 59 */ bl hwSetPriority lbl_8039A870: /* 8039A870 003977D0 48 01 89 25 */ bl hwGetTimeOffset /* 8039A874 003977D4 54 60 06 3E */ clrlwi r0, r3, 0x18 /* 8039A878 003977D8 7F C3 F3 78 */ mr r3, r30 /* 8039A87C 003977DC 20 00 00 05 */ subfic r0, r0, 5 /* 8039A880 003977E0 38 80 00 01 */ li r4, 1 /* 8039A884 003977E4 54 05 40 2E */ slwi r5, r0, 8 /* 8039A888 003977E8 48 00 00 61 */ bl synthAddJob lbl_8039A88C: /* 8039A88C 003977EC 88 1E 00 A8 */ lbz r0, 0xa8(r30) /* 8039A890 003977F0 28 00 00 00 */ cmplwi r0, 0 /* 8039A894 003977F4 41 82 00 14 */ beq lbl_8039A8A8 /* 8039A898 003977F8 38 60 00 00 */ li r3, 0 /* 8039A89C 003977FC 38 00 1F FF */ li r0, 0x1fff /* 8039A8A0 00397800 98 7E 00 A8 */ stb r3, 0xa8(r30) /* 8039A8A4 00397804 90 1E 02 14 */ stw r0, 0x214(r30) lbl_8039A8A8: /* 8039A8A8 00397808 E3 E1 00 98 */ psq_l f31, 152(r1), 0, qr0 /* 8039A8AC 0039780C CB E1 00 90 */ lfd f31, 0x90(r1) /* 8039A8B0 00397810 E3 C1 00 88 */ psq_l f30, 136(r1), 0, qr0 /* 8039A8B4 00397814 CB C1 00 80 */ lfd f30, 0x80(r1) /* 8039A8B8 00397818 E3 A1 00 78 */ psq_l f29, 120(r1), 0, qr0 /* 8039A8BC 0039781C CB A1 00 70 */ lfd f29, 0x70(r1) /* 8039A8C0 00397820 E3 81 00 68 */ psq_l f28, 104(r1), 0, qr0 /* 8039A8C4 00397824 CB 81 00 60 */ lfd f28, 0x60(r1) /* 8039A8C8 00397828 83 E1 00 5C */ lwz r31, 0x5c(r1) /* 8039A8CC 0039782C 83 C1 00 58 */ lwz r30, 0x58(r1) /* 8039A8D0 00397830 83 A1 00 54 */ lwz r29, 0x54(r1) /* 8039A8D4 00397834 80 01 00 A4 */ lwz r0, 0xa4(r1) /* 8039A8D8 00397838 83 81 00 50 */ lwz r28, 0x50(r1) /* 8039A8DC 0039783C 7C 08 03 A6 */ mtlr r0 /* 8039A8E0 00397840 38 21 00 A0 */ addi r1, r1, 0xa0 /* 8039A8E4 00397844 4E 80 00 20 */ blr .endfn ZeroOffsetHandler .global synthAddJob synthAddJob: /* 8039A8E8 00397848 88 0D AE 49 */ lbz r0, synthJobTableIndex@sda21(r13) /* 8039A8EC 0039784C 54 A6 C2 3E */ srwi r6, r5, 8 /* 8039A8F0 00397850 3C A0 80 55 */ lis r5, synthJobTable@ha /* 8039A8F4 00397854 2C 04 00 01 */ cmpwi r4, 1 /* 8039A8F8 00397858 7C 06 02 14 */ add r0, r6, r0 /* 8039A8FC 0039785C 54 08 06 FE */ clrlwi r8, r0, 0x1b /* 8039A900 00397860 38 05 08 A4 */ addi r0, r5, synthJobTable@l /* 8039A904 00397864 1C A8 00 0C */ mulli r5, r8, 0xc /* 8039A908 00397868 7C A0 2A 14 */ add r5, r0, r5 /* 8039A90C 0039786C 41 82 00 84 */ beq lbl_8039A990 /* 8039A910 00397870 40 80 00 10 */ bge lbl_8039A920 /* 8039A914 00397874 2C 04 00 00 */ cmpwi r4, 0 /* 8039A918 00397878 40 80 00 14 */ bge lbl_8039A92C /* 8039A91C 0039787C 48 00 00 F0 */ b lbl_8039AA0C lbl_8039A920: /* 8039A920 00397880 2C 04 00 03 */ cmpwi r4, 3 /* 8039A924 00397884 40 80 00 E8 */ bge lbl_8039AA0C /* 8039A928 00397888 48 00 00 D0 */ b lbl_8039A9F8 lbl_8039A92C: /* 8039A92C 0039788C 88 03 00 09 */ lbz r0, 9(r3) /* 8039A930 00397890 7C 64 1B 78 */ mr r4, r3 /* 8039A934 00397894 28 00 00 FF */ cmplwi r0, 0xff /* 8039A938 00397898 41 82 00 50 */ beq lbl_8039A988 /* 8039A93C 0039789C 7C 00 40 40 */ cmplw r0, r8 /* 8039A940 003978A0 4D 82 00 20 */ beqlr /* 8039A944 003978A4 80 C3 00 00 */ lwz r6, 0(r3) /* 8039A948 003978A8 28 06 00 00 */ cmplwi r6, 0 /* 8039A94C 003978AC 41 82 00 0C */ beq lbl_8039A958 /* 8039A950 003978B0 80 03 00 04 */ lwz r0, 4(r3) /* 8039A954 003978B4 90 06 00 04 */ stw r0, 4(r6) lbl_8039A958: /* 8039A958 003978B8 80 C3 00 04 */ lwz r6, 4(r3) /* 8039A95C 003978BC 28 06 00 00 */ cmplwi r6, 0 /* 8039A960 003978C0 41 82 00 10 */ beq lbl_8039A970 /* 8039A964 003978C4 80 03 00 00 */ lwz r0, 0(r3) /* 8039A968 003978C8 90 06 00 00 */ stw r0, 0(r6) /* 8039A96C 003978CC 48 00 00 1C */ b lbl_8039A988 lbl_8039A970: /* 8039A970 003978D0 88 03 00 09 */ lbz r0, 9(r3) /* 8039A974 003978D4 3C C0 80 55 */ lis r6, synthJobTable@ha /* 8039A978 003978D8 80 E3 00 00 */ lwz r7, 0(r3) /* 8039A97C 003978DC 38 66 08 A4 */ addi r3, r6, synthJobTable@l /* 8039A980 003978E0 1C 00 00 0C */ mulli r0, r0, 0xc /* 8039A984 003978E4 7C E3 01 2E */ stwx r7, r3, r0 lbl_8039A988: /* 8039A988 003978E8 7C A7 2B 78 */ mr r7, r5 /* 8039A98C 003978EC 48 00 00 80 */ b lbl_8039AA0C lbl_8039A990: /* 8039A990 003978F0 38 83 00 0C */ addi r4, r3, 0xc /* 8039A994 003978F4 88 03 00 15 */ lbz r0, 0x15(r3) /* 8039A998 003978F8 28 00 00 FF */ cmplwi r0, 0xff /* 8039A99C 003978FC 41 82 00 54 */ beq lbl_8039A9F0 /* 8039A9A0 00397900 7C 00 40 40 */ cmplw r0, r8 /* 8039A9A4 00397904 4D 82 00 20 */ beqlr /* 8039A9A8 00397908 80 64 00 00 */ lwz r3, 0(r4) /* 8039A9AC 0039790C 28 03 00 00 */ cmplwi r3, 0 /* 8039A9B0 00397910 41 82 00 0C */ beq lbl_8039A9BC /* 8039A9B4 00397914 80 04 00 04 */ lwz r0, 4(r4) /* 8039A9B8 00397918 90 03 00 04 */ stw r0, 4(r3) lbl_8039A9BC: /* 8039A9BC 0039791C 80 64 00 04 */ lwz r3, 4(r4) /* 8039A9C0 00397920 28 03 00 00 */ cmplwi r3, 0 /* 8039A9C4 00397924 41 82 00 10 */ beq lbl_8039A9D4 /* 8039A9C8 00397928 80 04 00 00 */ lwz r0, 0(r4) /* 8039A9CC 0039792C 90 03 00 00 */ stw r0, 0(r3) /* 8039A9D0 00397930 48 00 00 20 */ b lbl_8039A9F0 lbl_8039A9D4: /* 8039A9D4 00397934 88 04 00 09 */ lbz r0, 9(r4) /* 8039A9D8 00397938 3C 60 80 55 */ lis r3, synthJobTable@ha /* 8039A9DC 0039793C 38 63 08 A4 */ addi r3, r3, synthJobTable@l /* 8039A9E0 00397940 80 C4 00 00 */ lwz r6, 0(r4) /* 8039A9E4 00397944 1C 00 00 0C */ mulli r0, r0, 0xc /* 8039A9E8 00397948 7C 63 02 14 */ add r3, r3, r0 /* 8039A9EC 0039794C 90 C3 00 08 */ stw r6, 8(r3) lbl_8039A9F0: /* 8039A9F0 00397950 38 E5 00 08 */ addi r7, r5, 8 /* 8039A9F4 00397954 48 00 00 18 */ b lbl_8039AA0C lbl_8039A9F8: /* 8039A9F8 00397958 38 83 00 18 */ addi r4, r3, 0x18 /* 8039A9FC 0039795C 88 03 00 21 */ lbz r0, 0x21(r3) /* 8039AA00 00397960 28 00 00 FF */ cmplwi r0, 0xff /* 8039AA04 00397964 4C 82 00 20 */ bnelr /* 8039AA08 00397968 38 E5 00 04 */ addi r7, r5, 4 lbl_8039AA0C: /* 8039AA0C 0039796C 99 04 00 09 */ stb r8, 9(r4) /* 8039AA10 00397970 80 07 00 00 */ lwz r0, 0(r7) /* 8039AA14 00397974 28 00 00 00 */ cmplwi r0, 0 /* 8039AA18 00397978 90 04 00 00 */ stw r0, 0(r4) /* 8039AA1C 0039797C 41 82 00 0C */ beq lbl_8039AA28 /* 8039AA20 00397980 80 67 00 00 */ lwz r3, 0(r7) /* 8039AA24 00397984 90 83 00 04 */ stw r4, 4(r3) lbl_8039AA28: /* 8039AA28 00397988 38 00 00 00 */ li r0, 0 /* 8039AA2C 0039798C 90 04 00 04 */ stw r0, 4(r4) /* 8039AA30 00397990 90 87 00 00 */ stw r4, 0(r7) /* 8039AA34 00397994 4E 80 00 20 */ blr .global synthStartSynthJobHandling synthStartSynthJobHandling: /* 8039AA38 00397998 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8039AA3C 0039799C 7C 08 02 A6 */ mflr r0 /* 8039AA40 003979A0 38 80 00 00 */ li r4, 0 /* 8039AA44 003979A4 38 A0 00 00 */ li r5, 0 /* 8039AA48 003979A8 90 01 00 14 */ stw r0, 0x14(r1) /* 8039AA4C 003979AC 93 E1 00 0C */ stw r31, 0xc(r1) /* 8039AA50 003979B0 7C 7F 1B 78 */ mr r31, r3 /* 8039AA54 003979B4 80 0D AE 88 */ lwz r0, synthRealTime@sda21(r13) /* 8039AA58 003979B8 80 CD AE 8C */ lwz r6, synthRealTime+4@sda21(r13) /* 8039AA5C 003979BC 90 C3 00 28 */ stw r6, 0x28(r3) /* 8039AA60 003979C0 90 03 00 24 */ stw r0, 0x24(r3) /* 8039AA64 003979C4 80 0D AE 88 */ lwz r0, synthRealTime@sda21(r13) /* 8039AA68 003979C8 80 CD AE 8C */ lwz r6, synthRealTime+4@sda21(r13) /* 8039AA6C 003979CC 90 C3 00 30 */ stw r6, 0x30(r3) /* 8039AA70 003979D0 90 03 00 2C */ stw r0, 0x2c(r3) /* 8039AA74 003979D4 4B FF FE 75 */ bl synthAddJob /* 8039AA78 003979D8 7F E3 FB 78 */ mr r3, r31 /* 8039AA7C 003979DC 38 80 00 01 */ li r4, 1 /* 8039AA80 003979E0 38 A0 00 00 */ li r5, 0 /* 8039AA84 003979E4 4B FF FE 65 */ bl synthAddJob /* 8039AA88 003979E8 80 01 00 14 */ lwz r0, 0x14(r1) /* 8039AA8C 003979EC 83 E1 00 0C */ lwz r31, 0xc(r1) /* 8039AA90 003979F0 7C 08 03 A6 */ mtlr r0 /* 8039AA94 003979F4 38 21 00 10 */ addi r1, r1, 0x10 /* 8039AA98 003979F8 4E 80 00 20 */ blr .global synthForceLowPrecisionUpdate synthForceLowPrecisionUpdate: /* 8039AA9C 003979FC 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8039AAA0 00397A00 7C 08 02 A6 */ mflr r0 /* 8039AAA4 00397A04 38 80 00 00 */ li r4, 0 /* 8039AAA8 00397A08 38 A0 00 00 */ li r5, 0 /* 8039AAAC 00397A0C 90 01 00 14 */ stw r0, 0x14(r1) /* 8039AAB0 00397A10 93 E1 00 0C */ stw r31, 0xc(r1) /* 8039AAB4 00397A14 7C 7F 1B 78 */ mr r31, r3 /* 8039AAB8 00397A18 4B FF FE 31 */ bl synthAddJob /* 8039AABC 00397A1C 7F E3 FB 78 */ mr r3, r31 /* 8039AAC0 00397A20 38 80 00 01 */ li r4, 1 /* 8039AAC4 00397A24 38 A0 00 00 */ li r5, 0 /* 8039AAC8 00397A28 4B FF FE 21 */ bl synthAddJob /* 8039AACC 00397A2C 80 01 00 14 */ lwz r0, 0x14(r1) /* 8039AAD0 00397A30 83 E1 00 0C */ lwz r31, 0xc(r1) /* 8039AAD4 00397A34 7C 08 03 A6 */ mtlr r0 /* 8039AAD8 00397A38 38 21 00 10 */ addi r1, r1, 0x10 /* 8039AADC 00397A3C 4E 80 00 20 */ blr .global synthKeyStateUpdate synthKeyStateUpdate: /* 8039AAE0 00397A40 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8039AAE4 00397A44 7C 08 02 A6 */ mflr r0 /* 8039AAE8 00397A48 38 80 00 02 */ li r4, 2 /* 8039AAEC 00397A4C 38 A0 00 00 */ li r5, 0 /* 8039AAF0 00397A50 90 01 00 14 */ stw r0, 0x14(r1) /* 8039AAF4 00397A54 4B FF FD F5 */ bl synthAddJob /* 8039AAF8 00397A58 80 01 00 14 */ lwz r0, 0x14(r1) /* 8039AAFC 00397A5C 7C 08 03 A6 */ mtlr r0 /* 8039AB00 00397A60 38 21 00 10 */ addi r1, r1, 0x10 /* 8039AB04 00397A64 4E 80 00 20 */ blr .global synthHandle synthHandle: /* 8039AB08 00397A68 94 21 FF B0 */ stwu r1, -0x50(r1) /* 8039AB0C 00397A6C 7C 08 02 A6 */ mflr r0 /* 8039AB10 00397A70 90 01 00 54 */ stw r0, 0x54(r1) /* 8039AB14 00397A74 39 61 00 50 */ addi r11, r1, 0x50 /* 8039AB18 00397A78 4B FE EF 49 */ bl _savegpr_20 /* 8039AB1C 00397A7C 3C 80 80 55 */ lis r4, synthTicksPerSecond@ha /* 8039AB20 00397A80 7C 79 1B 78 */ mr r25, r3 /* 8039AB24 00397A84 3B E4 FE 10 */ addi r31, r4, synthTicksPerSecond@l /* 8039AB28 00397A88 38 9F 02 40 */ addi r4, r31, 0x240 /* 8039AB2C 00397A8C 80 04 00 04 */ lwz r0, 4(r4) /* 8039AB30 00397A90 28 00 00 00 */ cmplwi r0, 0 /* 8039AB34 00397A94 41 82 04 CC */ beq lbl_8039B000 /* 8039AB38 00397A98 48 00 BF ED */ bl macHandle /* 8039AB3C 00397A9C 88 0D AE 49 */ lbz r0, synthJobTableIndex@sda21(r13) /* 8039AB40 00397AA0 3B DF 0A 94 */ addi r30, r31, 0xa94 /* 8039AB44 00397AA4 3B 40 00 FF */ li r26, 0xff /* 8039AB48 00397AA8 1C 00 00 0C */ mulli r0, r0, 0xc /* 8039AB4C 00397AAC 7F DE 02 14 */ add r30, r30, r0 /* 8039AB50 00397AB0 80 7E 00 00 */ lwz r3, 0(r30) /* 8039AB54 00397AB4 48 00 00 30 */ b lbl_8039AB84 lbl_8039AB58: /* 8039AB58 00397AB8 83 63 00 00 */ lwz r27, 0(r3) /* 8039AB5C 00397ABC 9B 43 00 09 */ stb r26, 9(r3) /* 8039AB60 00397AC0 88 63 00 08 */ lbz r3, 8(r3) /* 8039AB64 00397AC4 80 AD AE 78 */ lwz r5, synthVoice@sda21(r13) /* 8039AB68 00397AC8 1C 83 04 04 */ mulli r4, r3, 0x404 /* 8039AB6C 00397ACC 38 04 01 1C */ addi r0, r4, 0x11c /* 8039AB70 00397AD0 7C 05 00 AE */ lbzx r0, r5, r0 /* 8039AB74 00397AD4 28 00 00 00 */ cmplwi r0, 0 /* 8039AB78 00397AD8 40 82 00 08 */ bne lbl_8039AB80 /* 8039AB7C 00397ADC 4B FF EF 2D */ bl LowPrecisionHandler lbl_8039AB80: /* 8039AB80 00397AE0 7F 63 DB 78 */ mr r3, r27 lbl_8039AB84: /* 8039AB84 00397AE4 28 03 00 00 */ cmplwi r3, 0 /* 8039AB88 00397AE8 40 82 FF D0 */ bne lbl_8039AB58 /* 8039AB8C 00397AEC 38 00 00 00 */ li r0, 0 /* 8039AB90 00397AF0 3B 9E 00 04 */ addi r28, r30, 4 /* 8039AB94 00397AF4 90 1E 00 00 */ stw r0, 0(r30) /* 8039AB98 00397AF8 80 7E 00 04 */ lwz r3, 4(r30) /* 8039AB9C 00397AFC 48 00 01 84 */ b lbl_8039AD20 lbl_8039ABA0: /* 8039ABA0 00397B00 83 A3 00 00 */ lwz r29, 0(r3) /* 8039ABA4 00397B04 38 00 00 FF */ li r0, 0xff /* 8039ABA8 00397B08 98 03 00 09 */ stb r0, 9(r3) /* 8039ABAC 00397B0C 8B 43 00 08 */ lbz r26, 8(r3) /* 8039ABB0 00397B10 80 AD AE 78 */ lwz r5, synthVoice@sda21(r13) /* 8039ABB4 00397B14 1C 9A 04 04 */ mulli r4, r26, 0x404 /* 8039ABB8 00397B18 38 04 01 1C */ addi r0, r4, 0x11c /* 8039ABBC 00397B1C 7C 05 00 AE */ lbzx r0, r5, r0 /* 8039ABC0 00397B20 28 00 00 00 */ cmplwi r0, 0 /* 8039ABC4 00397B24 40 82 01 58 */ bne lbl_8039AD1C /* 8039ABC8 00397B28 7F 43 D3 78 */ mr r3, r26 /* 8039ABCC 00397B2C 7F 65 22 14 */ add r27, r5, r4 /* 8039ABD0 00397B30 48 01 85 CD */ bl hwIsActive /* 8039ABD4 00397B34 28 03 00 00 */ cmplwi r3, 0 /* 8039ABD8 00397B38 40 82 00 10 */ bne lbl_8039ABE8 /* 8039ABDC 00397B3C 80 1B 00 34 */ lwz r0, 0x34(r27) /* 8039ABE0 00397B40 28 00 00 00 */ cmplwi r0, 0 /* 8039ABE4 00397B44 41 82 01 1C */ beq lbl_8039AD00 lbl_8039ABE8: /* 8039ABE8 00397B48 7F 63 DB 78 */ mr r3, r27 /* 8039ABEC 00397B4C 48 01 78 C9 */ bl inpGetPedal /* 8039ABF0 00397B50 54 60 04 3E */ clrlwi r0, r3, 0x10 /* 8039ABF4 00397B54 7F 63 DB 78 */ mr r3, r27 /* 8039ABF8 00397B58 20 00 1F 80 */ subfic r0, r0, 0x1f80 /* 8039ABFC 00397B5C 54 04 0F FE */ srwi r4, r0, 0x1f /* 8039AC00 00397B60 48 00 C2 11 */ bl macSetPedalState /* 8039AC04 00397B64 80 BB 01 14 */ lwz r5, 0x114(r27) /* 8039AC08 00397B68 38 80 00 00 */ li r4, 0 /* 8039AC0C 00397B6C 80 DB 01 18 */ lwz r6, 0x118(r27) /* 8039AC10 00397B70 38 60 00 20 */ li r3, 0x20 /* 8039AC14 00397B74 7C A0 20 38 */ and r0, r5, r4 /* 8039AC18 00397B78 7C C3 18 38 */ and r3, r6, r3 /* 8039AC1C 00397B7C 7C 63 22 78 */ xor r3, r3, r4 /* 8039AC20 00397B80 7C 00 22 78 */ xor r0, r0, r4 /* 8039AC24 00397B84 7C 60 03 79 */ or. r0, r3, r0 /* 8039AC28 00397B88 41 82 00 34 */ beq lbl_8039AC5C /* 8039AC2C 00397B8C 38 00 FF DF */ li r0, -33 /* 8039AC30 00397B90 38 80 FF FF */ li r4, -1 /* 8039AC34 00397B94 7C C0 00 38 */ and r0, r6, r0 /* 8039AC38 00397B98 7F 43 D3 78 */ mr r3, r26 /* 8039AC3C 00397B9C 90 1B 01 18 */ stw r0, 0x118(r27) /* 8039AC40 00397BA0 7C A0 20 38 */ and r0, r5, r4 /* 8039AC44 00397BA4 90 1B 01 14 */ stw r0, 0x114(r27) /* 8039AC48 00397BA8 80 1B 01 18 */ lwz r0, 0x118(r27) /* 8039AC4C 00397BAC 60 00 00 10 */ ori r0, r0, 0x10 /* 8039AC50 00397BB0 90 1B 01 18 */ stw r0, 0x118(r27) /* 8039AC54 00397BB4 88 9B 01 1F */ lbz r4, 0x11f(r27) /* 8039AC58 00397BB8 48 01 89 A1 */ bl hwStart lbl_8039AC5C: /* 8039AC5C 00397BBC 80 DB 01 14 */ lwz r6, 0x114(r27) /* 8039AC60 00397BC0 38 00 01 00 */ li r0, 0x100 /* 8039AC64 00397BC4 80 FB 01 18 */ lwz r7, 0x118(r27) /* 8039AC68 00397BC8 38 A0 00 90 */ li r5, 0x90 /* 8039AC6C 00397BCC 7C C4 00 38 */ and r4, r6, r0 /* 8039AC70 00397BD0 38 00 00 00 */ li r0, 0 /* 8039AC74 00397BD4 7C E3 28 38 */ and r3, r7, r5 /* 8039AC78 00397BD8 7C 63 2A 78 */ xor r3, r3, r5 /* 8039AC7C 00397BDC 7C 80 02 78 */ xor r0, r4, r0 /* 8039AC80 00397BE0 7C 60 03 79 */ or. r0, r3, r0 /* 8039AC84 00397BE4 40 82 00 7C */ bne lbl_8039AD00 /* 8039AC88 00397BE8 38 00 FF 6F */ li r0, -145 /* 8039AC8C 00397BEC 38 80 FF FF */ li r4, -1 /* 8039AC90 00397BF0 7C E0 00 38 */ and r0, r7, r0 /* 8039AC94 00397BF4 7F 43 D3 78 */ mr r3, r26 /* 8039AC98 00397BF8 90 1B 01 18 */ stw r0, 0x118(r27) /* 8039AC9C 00397BFC 7C C0 20 38 */ and r0, r6, r4 /* 8039ACA0 00397C00 90 1B 01 14 */ stw r0, 0x114(r27) /* 8039ACA4 00397C04 48 01 89 91 */ bl hwKeyOff /* 8039ACA8 00397C08 80 7B 01 14 */ lwz r3, 0x114(r27) /* 8039ACAC 00397C0C 38 00 02 00 */ li r0, 0x200 /* 8039ACB0 00397C10 80 BB 01 18 */ lwz r5, 0x118(r27) /* 8039ACB4 00397C14 38 80 00 00 */ li r4, 0 /* 8039ACB8 00397C18 7C 60 00 38 */ and r0, r3, r0 /* 8039ACBC 00397C1C 7C A3 20 38 */ and r3, r5, r4 /* 8039ACC0 00397C20 7C 63 22 78 */ xor r3, r3, r4 /* 8039ACC4 00397C24 7C 00 22 78 */ xor r0, r0, r4 /* 8039ACC8 00397C28 7C 60 03 79 */ or. r0, r3, r0 /* 8039ACCC 00397C2C 41 82 00 34 */ beq lbl_8039AD00 /* 8039ACD0 00397C30 38 7B 01 DC */ addi r3, r27, 0x1dc /* 8039ACD4 00397C34 48 00 E9 79 */ bl adsrRelease /* 8039ACD8 00397C38 28 03 00 00 */ cmplwi r3, 0 /* 8039ACDC 00397C3C 41 82 00 24 */ beq lbl_8039AD00 /* 8039ACE0 00397C40 80 BB 01 18 */ lwz r5, 0x118(r27) /* 8039ACE4 00397C44 38 00 FF FF */ li r0, -1 /* 8039ACE8 00397C48 80 9B 01 14 */ lwz r4, 0x114(r27) /* 8039ACEC 00397C4C 38 60 FD FF */ li r3, -513 /* 8039ACF0 00397C50 7C A0 00 38 */ and r0, r5, r0 /* 8039ACF4 00397C54 90 1B 01 18 */ stw r0, 0x118(r27) /* 8039ACF8 00397C58 7C 80 18 38 */ and r0, r4, r3 /* 8039ACFC 00397C5C 90 1B 01 14 */ stw r0, 0x114(r27) lbl_8039AD00: /* 8039AD00 00397C60 88 1B 00 A8 */ lbz r0, 0xa8(r27) /* 8039AD04 00397C64 28 00 00 00 */ cmplwi r0, 0 /* 8039AD08 00397C68 41 82 00 14 */ beq lbl_8039AD1C /* 8039AD0C 00397C6C 38 60 00 00 */ li r3, 0 /* 8039AD10 00397C70 38 00 1F FF */ li r0, 0x1fff /* 8039AD14 00397C74 98 7B 00 A8 */ stb r3, 0xa8(r27) /* 8039AD18 00397C78 90 1B 02 14 */ stw r0, 0x214(r27) lbl_8039AD1C: /* 8039AD1C 00397C7C 7F A3 EB 78 */ mr r3, r29 lbl_8039AD20: /* 8039AD20 00397C80 28 03 00 00 */ cmplwi r3, 0 /* 8039AD24 00397C84 40 82 FE 7C */ bne lbl_8039ABA0 /* 8039AD28 00397C88 38 00 00 00 */ li r0, 0 /* 8039AD2C 00397C8C 3B BE 00 08 */ addi r29, r30, 8 /* 8039AD30 00397C90 90 1C 00 00 */ stw r0, 0(r28) /* 8039AD34 00397C94 3B 40 00 FF */ li r26, 0xff /* 8039AD38 00397C98 80 7E 00 08 */ lwz r3, 8(r30) /* 8039AD3C 00397C9C 48 00 00 30 */ b lbl_8039AD6C lbl_8039AD40: /* 8039AD40 00397CA0 83 63 00 00 */ lwz r27, 0(r3) /* 8039AD44 00397CA4 9B 43 00 09 */ stb r26, 9(r3) /* 8039AD48 00397CA8 88 63 00 08 */ lbz r3, 8(r3) /* 8039AD4C 00397CAC 80 AD AE 78 */ lwz r5, synthVoice@sda21(r13) /* 8039AD50 00397CB0 1C 83 04 04 */ mulli r4, r3, 0x404 /* 8039AD54 00397CB4 38 04 01 1C */ addi r0, r4, 0x11c /* 8039AD58 00397CB8 7C 05 00 AE */ lbzx r0, r5, r0 /* 8039AD5C 00397CBC 28 00 00 00 */ cmplwi r0, 0 /* 8039AD60 00397CC0 40 82 00 08 */ bne lbl_8039AD68 /* 8039AD64 00397CC4 4B FF F4 89 */ bl ZeroOffsetHandler lbl_8039AD68: /* 8039AD68 00397CC8 7F 63 DB 78 */ mr r3, r27 lbl_8039AD6C: /* 8039AD6C 00397CCC 28 03 00 00 */ cmplwi r3, 0 /* 8039AD70 00397CD0 40 82 FF D0 */ bne lbl_8039AD40 /* 8039AD74 00397CD4 88 6D AE 49 */ lbz r3, synthJobTableIndex@sda21(r13) /* 8039AD78 00397CD8 38 00 00 00 */ li r0, 0 /* 8039AD7C 00397CDC 90 1D 00 00 */ stw r0, 0(r29) /* 8039AD80 00397CE0 38 03 00 01 */ addi r0, r3, 1 /* 8039AD84 00397CE4 54 00 06 FE */ clrlwi r0, r0, 0x1b /* 8039AD88 00397CE8 98 0D AE 49 */ stb r0, synthJobTableIndex@sda21(r13) /* 8039AD8C 00397CEC 48 01 84 09 */ bl hwGetTimeOffset /* 8039AD90 00397CF0 54 60 06 3F */ clrlwi. r0, r3, 0x18 /* 8039AD94 00397CF4 40 82 02 50 */ bne lbl_8039AFE4 /* 8039AD98 00397CF8 80 6D AE 70 */ lwz r3, synthMasterFaderActiveFlags@sda21(r13) /* 8039AD9C 00397CFC 80 0D AE 6C */ lwz r0, synthMasterFaderPauseActiveFlags@sda21(r13) /* 8039ADA0 00397D00 7C 60 03 79 */ or. r0, r3, r0 /* 8039ADA4 00397D04 41 82 01 48 */ beq lbl_8039AEEC /* 8039ADA8 00397D08 3A 9F 04 54 */ addi r20, r31, 0x454 /* 8039ADAC 00397D0C 3A A0 00 00 */ li r21, 0 /* 8039ADB0 00397D10 3A C0 00 01 */ li r22, 1 lbl_8039ADB4: /* 8039ADB4 00397D14 80 0D AE 70 */ lwz r0, synthMasterFaderActiveFlags@sda21(r13) /* 8039ADB8 00397D18 7C 00 B0 39 */ and. r0, r0, r22 /* 8039ADBC 00397D1C 41 82 00 B4 */ beq lbl_8039AE70 /* 8039ADC0 00397D20 C0 74 00 04 */ lfs f3, 4(r20) /* 8039ADC4 00397D24 C0 14 00 08 */ lfs f0, 8(r20) /* 8039ADC8 00397D28 C0 54 00 0C */ lfs f2, 0xc(r20) /* 8039ADCC 00397D2C EC 23 00 28 */ fsubs f1, f3, f0 /* 8039ADD0 00397D30 C0 02 D5 48 */ lfs f0, lbl_805AF268@sda21(r2) /* 8039ADD4 00397D34 EC 22 00 72 */ fmuls f1, f2, f1 /* 8039ADD8 00397D38 EC 23 08 28 */ fsubs f1, f3, f1 /* 8039ADDC 00397D3C D0 34 00 00 */ stfs f1, 0(r20) /* 8039ADE0 00397D40 C0 54 00 0C */ lfs f2, 0xc(r20) /* 8039ADE4 00397D44 C0 34 00 10 */ lfs f1, 0x10(r20) /* 8039ADE8 00397D48 EC 22 08 28 */ fsubs f1, f2, f1 /* 8039ADEC 00397D4C FC 01 00 40 */ fcmpo cr0, f1, f0 /* 8039ADF0 00397D50 D0 34 00 0C */ stfs f1, 0xc(r20) /* 8039ADF4 00397D54 4C 40 13 82 */ cror 2, 0, 2 /* 8039ADF8 00397D58 40 82 00 78 */ bne lbl_8039AE70 /* 8039ADFC 00397D5C C0 14 00 04 */ lfs f0, 4(r20) /* 8039AE00 00397D60 D0 14 00 00 */ stfs f0, 0(r20) /* 8039AE04 00397D64 88 14 00 2C */ lbz r0, 0x2c(r20) /* 8039AE08 00397D68 2C 00 00 02 */ cmpwi r0, 2 /* 8039AE0C 00397D6C 41 82 00 2C */ beq lbl_8039AE38 /* 8039AE10 00397D70 40 80 00 10 */ bge lbl_8039AE20 /* 8039AE14 00397D74 2C 00 00 01 */ cmpwi r0, 1 /* 8039AE18 00397D78 40 80 00 14 */ bge lbl_8039AE2C /* 8039AE1C 00397D7C 48 00 00 38 */ b lbl_8039AE54 lbl_8039AE20: /* 8039AE20 00397D80 2C 00 00 04 */ cmpwi r0, 4 /* 8039AE24 00397D84 40 80 00 30 */ bge lbl_8039AE54 /* 8039AE28 00397D88 48 00 00 1C */ b lbl_8039AE44 lbl_8039AE2C: /* 8039AE2C 00397D8C 80 74 00 28 */ lwz r3, 0x28(r20) /* 8039AE30 00397D90 4B FF AD 0D */ bl seqStop /* 8039AE34 00397D94 48 00 00 20 */ b lbl_8039AE54 lbl_8039AE38: /* 8039AE38 00397D98 80 74 00 28 */ lwz r3, 0x28(r20) /* 8039AE3C 00397D9C 4B FF AA 85 */ bl seqPause /* 8039AE40 00397DA0 48 00 00 14 */ b lbl_8039AE54 lbl_8039AE44: /* 8039AE44 00397DA4 80 74 00 28 */ lwz r3, 0x28(r20) /* 8039AE48 00397DA8 38 80 00 00 */ li r4, 0 /* 8039AE4C 00397DAC 38 A0 00 00 */ li r5, 0 /* 8039AE50 00397DB0 4B FF B2 19 */ bl seqMute lbl_8039AE54: /* 8039AE54 00397DB4 80 0D AE 70 */ lwz r0, synthMasterFaderActiveFlags@sda21(r13) /* 8039AE58 00397DB8 7C 00 B0 79 */ andc. r0, r0, r22 /* 8039AE5C 00397DBC 90 0D AE 70 */ stw r0, synthMasterFaderActiveFlags@sda21(r13) /* 8039AE60 00397DC0 40 82 00 10 */ bne lbl_8039AE70 /* 8039AE64 00397DC4 80 0D AE 6C */ lwz r0, synthMasterFaderPauseActiveFlags@sda21(r13) /* 8039AE68 00397DC8 28 00 00 00 */ cmplwi r0, 0 /* 8039AE6C 00397DCC 41 82 00 80 */ beq lbl_8039AEEC lbl_8039AE70: /* 8039AE70 00397DD0 80 6D AE 6C */ lwz r3, synthMasterFaderPauseActiveFlags@sda21(r13) /* 8039AE74 00397DD4 7C 60 B0 39 */ and. r0, r3, r22 /* 8039AE78 00397DD8 41 82 00 60 */ beq lbl_8039AED8 /* 8039AE7C 00397DDC C0 74 00 18 */ lfs f3, 0x18(r20) /* 8039AE80 00397DE0 C0 14 00 1C */ lfs f0, 0x1c(r20) /* 8039AE84 00397DE4 C0 54 00 20 */ lfs f2, 0x20(r20) /* 8039AE88 00397DE8 EC 23 00 28 */ fsubs f1, f3, f0 /* 8039AE8C 00397DEC C0 02 D5 48 */ lfs f0, lbl_805AF268@sda21(r2) /* 8039AE90 00397DF0 EC 22 00 72 */ fmuls f1, f2, f1 /* 8039AE94 00397DF4 EC 23 08 28 */ fsubs f1, f3, f1 /* 8039AE98 00397DF8 D0 34 00 14 */ stfs f1, 0x14(r20) /* 8039AE9C 00397DFC C0 54 00 20 */ lfs f2, 0x20(r20) /* 8039AEA0 00397E00 C0 34 00 24 */ lfs f1, 0x24(r20) /* 8039AEA4 00397E04 EC 22 08 28 */ fsubs f1, f2, f1 /* 8039AEA8 00397E08 FC 01 00 40 */ fcmpo cr0, f1, f0 /* 8039AEAC 00397E0C D0 34 00 20 */ stfs f1, 0x20(r20) /* 8039AEB0 00397E10 4C 40 13 82 */ cror 2, 0, 2 /* 8039AEB4 00397E14 40 82 00 24 */ bne lbl_8039AED8 /* 8039AEB8 00397E18 7C 60 B0 79 */ andc. r0, r3, r22 /* 8039AEBC 00397E1C C0 14 00 18 */ lfs f0, 0x18(r20) /* 8039AEC0 00397E20 D0 14 00 14 */ stfs f0, 0x14(r20) /* 8039AEC4 00397E24 90 0D AE 6C */ stw r0, synthMasterFaderPauseActiveFlags@sda21(r13) /* 8039AEC8 00397E28 40 82 00 10 */ bne lbl_8039AED8 /* 8039AECC 00397E2C 80 0D AE 70 */ lwz r0, synthMasterFaderActiveFlags@sda21(r13) /* 8039AED0 00397E30 28 00 00 00 */ cmplwi r0, 0 /* 8039AED4 00397E34 41 82 00 18 */ beq lbl_8039AEEC lbl_8039AED8: /* 8039AED8 00397E38 3A B5 00 01 */ addi r21, r21, 1 /* 8039AEDC 00397E3C 56 D6 08 3C */ slwi r22, r22, 1 /* 8039AEE0 00397E40 28 15 00 20 */ cmplwi r21, 0x20 /* 8039AEE4 00397E44 3A 94 00 30 */ addi r20, r20, 0x30 /* 8039AEE8 00397E48 41 80 FE CC */ blt lbl_8039ADB4 lbl_8039AEEC: /* 8039AEEC 00397E4C 3B BF 0C 14 */ addi r29, r31, 0xc14 /* 8039AEF0 00397E50 3B DF 0C 34 */ addi r30, r31, 0xc34 /* 8039AEF4 00397E54 3A FF 0C 54 */ addi r23, r31, 0xc54 /* 8039AEF8 00397E58 3A DF 0C 74 */ addi r22, r31, 0xc74 /* 8039AEFC 00397E5C 3A 80 00 00 */ li r20, 0 /* 8039AF00 00397E60 3B 6D AE 64 */ addi r27, r13, synthAuxAMIDI@sda21 /* 8039AF04 00397E64 3B 8D AE 5C */ addi r28, r13, synthAuxAMIDISet@sda21 /* 8039AF08 00397E68 3B ED AE 54 */ addi r31, r13, synthAuxBMIDI@sda21 /* 8039AF0C 00397E6C 3B 0D AE 4C */ addi r24, r13, synthAuxBMIDISet@sda21 lbl_8039AF10: /* 8039AF10 00397E70 88 1B 00 00 */ lbz r0, 0(r27) /* 8039AF14 00397E74 28 00 00 FF */ cmplwi r0, 0xff /* 8039AF18 00397E78 41 82 00 4C */ beq lbl_8039AF64 /* 8039AF1C 00397E7C 3A A0 00 00 */ li r21, 0 /* 8039AF20 00397E80 3B 41 00 14 */ addi r26, r1, 0x14 lbl_8039AF24: /* 8039AF24 00397E84 88 BB 00 00 */ lbz r5, 0(r27) /* 8039AF28 00397E88 56 83 06 3E */ clrlwi r3, r20, 0x18 /* 8039AF2C 00397E8C 88 DC 00 00 */ lbz r6, 0(r28) /* 8039AF30 00397E90 56 A4 06 3E */ clrlwi r4, r21, 0x18 /* 8039AF34 00397E94 48 01 77 31 */ bl inpGetAuxA /* 8039AF38 00397E98 3A B5 00 01 */ addi r21, r21, 1 /* 8039AF3C 00397E9C B0 7A 00 00 */ sth r3, 0(r26) /* 8039AF40 00397EA0 28 15 00 04 */ cmplwi r21, 4 /* 8039AF44 00397EA4 3B 5A 00 02 */ addi r26, r26, 2 /* 8039AF48 00397EA8 41 80 FF DC */ blt lbl_8039AF24 /* 8039AF4C 00397EAC 81 9E 00 00 */ lwz r12, 0(r30) /* 8039AF50 00397EB0 38 81 00 14 */ addi r4, r1, 0x14 /* 8039AF54 00397EB4 80 BD 00 00 */ lwz r5, 0(r29) /* 8039AF58 00397EB8 38 60 00 01 */ li r3, 1 /* 8039AF5C 00397EBC 7D 89 03 A6 */ mtctr r12 /* 8039AF60 00397EC0 4E 80 04 21 */ bctrl lbl_8039AF64: /* 8039AF64 00397EC4 88 1F 00 00 */ lbz r0, 0(r31) /* 8039AF68 00397EC8 28 00 00 FF */ cmplwi r0, 0xff /* 8039AF6C 00397ECC 41 82 00 4C */ beq lbl_8039AFB8 /* 8039AF70 00397ED0 3A A0 00 00 */ li r21, 0 /* 8039AF74 00397ED4 3B 41 00 08 */ addi r26, r1, 8 lbl_8039AF78: /* 8039AF78 00397ED8 88 BF 00 00 */ lbz r5, 0(r31) /* 8039AF7C 00397EDC 56 83 06 3E */ clrlwi r3, r20, 0x18 /* 8039AF80 00397EE0 88 D8 00 00 */ lbz r6, 0(r24) /* 8039AF84 00397EE4 56 A4 06 3E */ clrlwi r4, r21, 0x18 /* 8039AF88 00397EE8 48 01 77 91 */ bl inpGetAuxB /* 8039AF8C 00397EEC 3A B5 00 01 */ addi r21, r21, 1 /* 8039AF90 00397EF0 B0 7A 00 00 */ sth r3, 0(r26) /* 8039AF94 00397EF4 28 15 00 04 */ cmplwi r21, 4 /* 8039AF98 00397EF8 3B 5A 00 02 */ addi r26, r26, 2 /* 8039AF9C 00397EFC 41 80 FF DC */ blt lbl_8039AF78 /* 8039AFA0 00397F00 81 96 00 00 */ lwz r12, 0(r22) /* 8039AFA4 00397F04 38 81 00 08 */ addi r4, r1, 8 /* 8039AFA8 00397F08 80 B7 00 00 */ lwz r5, 0(r23) /* 8039AFAC 00397F0C 38 60 00 01 */ li r3, 1 /* 8039AFB0 00397F10 7D 89 03 A6 */ mtctr r12 /* 8039AFB4 00397F14 4E 80 04 21 */ bctrl lbl_8039AFB8: /* 8039AFB8 00397F18 3A 94 00 01 */ addi r20, r20, 1 /* 8039AFBC 00397F1C 3B 9C 00 01 */ addi r28, r28, 1 /* 8039AFC0 00397F20 28 14 00 08 */ cmplwi r20, 8 /* 8039AFC4 00397F24 3B BD 00 04 */ addi r29, r29, 4 /* 8039AFC8 00397F28 3B DE 00 04 */ addi r30, r30, 4 /* 8039AFCC 00397F2C 3B FF 00 01 */ addi r31, r31, 1 /* 8039AFD0 00397F30 3B 18 00 01 */ addi r24, r24, 1 /* 8039AFD4 00397F34 3A F7 00 04 */ addi r23, r23, 4 /* 8039AFD8 00397F38 3A D6 00 04 */ addi r22, r22, 4 /* 8039AFDC 00397F3C 3B 7B 00 01 */ addi r27, r27, 1 /* 8039AFE0 00397F40 41 80 FF 30 */ blt lbl_8039AF10 lbl_8039AFE4: /* 8039AFE4 00397F44 48 01 8F 21 */ bl hwFrameDone /* 8039AFE8 00397F48 80 6D AE 8C */ lwz r3, synthRealTime+4@sda21(r13) /* 8039AFEC 00397F4C 80 0D AE 88 */ lwz r0, synthRealTime@sda21(r13) /* 8039AFF0 00397F50 7C 63 C8 14 */ addc r3, r3, r25 /* 8039AFF4 00397F54 7C 00 01 94 */ addze r0, r0 /* 8039AFF8 00397F58 90 6D AE 8C */ stw r3, synthRealTime+4@sda21(r13) /* 8039AFFC 00397F5C 90 0D AE 88 */ stw r0, synthRealTime@sda21(r13) lbl_8039B000: /* 8039B000 00397F60 39 61 00 50 */ addi r11, r1, 0x50 /* 8039B004 00397F64 4B FE EA A9 */ bl _restgpr_20 /* 8039B008 00397F68 80 01 00 54 */ lwz r0, 0x54(r1) /* 8039B00C 00397F6C 7C 08 03 A6 */ mtlr r0 /* 8039B010 00397F70 38 21 00 50 */ addi r1, r1, 0x50 /* 8039B014 00397F74 4E 80 00 20 */ blr .global synthFXGetMaxVoices synthFXGetMaxVoices: /* 8039B018 00397F78 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8039B01C 00397F7C 7C 08 02 A6 */ mflr r0 /* 8039B020 00397F80 90 01 00 14 */ stw r0, 0x14(r1) /* 8039B024 00397F84 48 00 78 01 */ bl dataGetFX /* 8039B028 00397F88 28 03 00 00 */ cmplwi r3, 0 /* 8039B02C 00397F8C 41 82 00 0C */ beq lbl_8039B038 /* 8039B030 00397F90 88 63 00 04 */ lbz r3, 4(r3) /* 8039B034 00397F94 48 00 00 08 */ b lbl_8039B03C lbl_8039B038: /* 8039B038 00397F98 38 60 00 00 */ li r3, 0 lbl_8039B03C: /* 8039B03C 00397F9C 80 01 00 14 */ lwz r0, 0x14(r1) /* 8039B040 00397FA0 7C 08 03 A6 */ mtlr r0 /* 8039B044 00397FA4 38 21 00 10 */ addi r1, r1, 0x10 /* 8039B048 00397FA8 4E 80 00 20 */ blr .global synthFXStart synthFXStart: /* 8039B04C 00397FAC 94 21 FF C0 */ stwu r1, -0x40(r1) /* 8039B050 00397FB0 7C 08 02 A6 */ mflr r0 /* 8039B054 00397FB4 90 01 00 44 */ stw r0, 0x44(r1) /* 8039B058 00397FB8 39 61 00 40 */ addi r11, r1, 0x40 /* 8039B05C 00397FBC 4B FE EA 21 */ bl _savegpr_27 /* 8039B060 00397FC0 7C 9B 23 78 */ mr r27, r4 /* 8039B064 00397FC4 7C BC 2B 78 */ mr r28, r5 /* 8039B068 00397FC8 7C DD 33 78 */ mr r29, r6 /* 8039B06C 00397FCC 7C FE 3B 78 */ mr r30, r7 /* 8039B070 00397FD0 3B E0 FF FF */ li r31, -1 /* 8039B074 00397FD4 48 00 77 B1 */ bl dataGetFX /* 8039B078 00397FD8 7C 65 1B 79 */ or. r5, r3, r3 /* 8039B07C 00397FDC 41 82 00 7C */ beq lbl_8039B0F8 /* 8039B080 00397FE0 57 60 06 3E */ clrlwi r0, r27, 0x18 /* 8039B084 00397FE4 28 00 00 FF */ cmplwi r0, 0xff /* 8039B088 00397FE8 40 82 00 08 */ bne lbl_8039B090 /* 8039B08C 00397FEC 8B 65 00 06 */ lbz r27, 6(r5) lbl_8039B090: /* 8039B090 00397FF0 57 80 06 3E */ clrlwi r0, r28, 0x18 /* 8039B094 00397FF4 28 00 00 FF */ cmplwi r0, 0xff /* 8039B098 00397FF8 40 82 00 08 */ bne lbl_8039B0A0 /* 8039B09C 00397FFC 8B 85 00 07 */ lbz r28, 7(r5) lbl_8039B0A0: /* 8039B0A0 00398000 38 60 00 00 */ li r3, 0 /* 8039B0A4 00398004 38 00 00 FF */ li r0, 0xff /* 8039B0A8 00398008 90 61 00 08 */ stw r3, 8(r1) /* 8039B0AC 0039800C 7F 67 DB 78 */ mr r7, r27 /* 8039B0B0 00398010 7F 88 E3 78 */ mr r8, r28 /* 8039B0B4 00398014 39 20 00 FF */ li r9, 0xff /* 8039B0B8 00398018 90 61 00 0C */ stw r3, 0xc(r1) /* 8039B0BC 0039801C 39 40 00 FF */ li r10, 0xff /* 8039B0C0 00398020 90 01 00 10 */ stw r0, 0x10(r1) /* 8039B0C4 00398024 88 05 00 09 */ lbz r0, 9(r5) /* 8039B0C8 00398028 90 01 00 14 */ stw r0, 0x14(r1) /* 8039B0CC 0039802C 90 61 00 18 */ stw r3, 0x18(r1) /* 8039B0D0 00398030 93 A1 00 1C */ stw r29, 0x1c(r1) /* 8039B0D4 00398034 93 C1 00 20 */ stw r30, 0x20(r1) /* 8039B0D8 00398038 88 05 00 08 */ lbz r0, 8(r5) /* 8039B0DC 0039803C A0 65 00 02 */ lhz r3, 2(r5) /* 8039B0E0 00398040 60 00 00 80 */ ori r0, r0, 0x80 /* 8039B0E4 00398044 88 85 00 05 */ lbz r4, 5(r5) /* 8039B0E8 00398048 88 A5 00 04 */ lbz r5, 4(r5) /* 8039B0EC 0039804C 54 06 06 3E */ clrlwi r6, r0, 0x18 /* 8039B0F0 00398050 4B FF E5 5D */ bl synthStartSound /* 8039B0F4 00398054 7C 7F 1B 78 */ mr r31, r3 lbl_8039B0F8: /* 8039B0F8 00398058 7F E3 FB 78 */ mr r3, r31 /* 8039B0FC 0039805C 39 61 00 40 */ addi r11, r1, 0x40 /* 8039B100 00398060 4B FE E9 C9 */ bl _restgpr_27 /* 8039B104 00398064 80 01 00 44 */ lwz r0, 0x44(r1) /* 8039B108 00398068 7C 08 03 A6 */ mtlr r0 /* 8039B10C 0039806C 38 21 00 40 */ addi r1, r1, 0x40 /* 8039B110 00398070 4E 80 00 20 */ blr .global synthFXSetCtrl synthFXSetCtrl: /* 8039B114 00398074 94 21 FF E0 */ stwu r1, -0x20(r1) /* 8039B118 00398078 7C 08 02 A6 */ mflr r0 /* 8039B11C 0039807C 90 01 00 24 */ stw r0, 0x24(r1) /* 8039B120 00398080 93 E1 00 1C */ stw r31, 0x1c(r1) /* 8039B124 00398084 7C BF 2B 78 */ mr r31, r5 /* 8039B128 00398088 93 C1 00 18 */ stw r30, 0x18(r1) /* 8039B12C 0039808C 7C 9E 23 78 */ mr r30, r4 /* 8039B130 00398090 93 A1 00 14 */ stw r29, 0x14(r1) /* 8039B134 00398094 93 81 00 10 */ stw r28, 0x10(r1) /* 8039B138 00398098 3B 80 00 00 */ li r28, 0 /* 8039B13C 0039809C 48 00 CA 6D */ bl vidGetInternalId /* 8039B140 003980A0 48 00 00 88 */ b lbl_8039B1C8 lbl_8039B144: /* 8039B144 003980A4 54 64 06 3E */ clrlwi r4, r3, 0x18 /* 8039B148 003980A8 80 0D AE 78 */ lwz r0, synthVoice@sda21(r13) /* 8039B14C 003980AC 1F A4 04 04 */ mulli r29, r4, 0x404 /* 8039B150 003980B0 7C E0 EA 14 */ add r7, r0, r29 /* 8039B154 003980B4 80 07 00 F4 */ lwz r0, 0xf4(r7) /* 8039B158 003980B8 7C 03 00 40 */ cmplw r3, r0 /* 8039B15C 003980BC 40 82 00 64 */ bne lbl_8039B1C0 /* 8039B160 003980C0 80 07 01 14 */ lwz r0, 0x114(r7) /* 8039B164 003980C4 38 A0 00 00 */ li r5, 0 /* 8039B168 003980C8 80 C7 01 18 */ lwz r6, 0x118(r7) /* 8039B16C 003980CC 38 60 00 02 */ li r3, 2 /* 8039B170 003980D0 7C 00 28 38 */ and r0, r0, r5 /* 8039B174 003980D4 7C C3 18 38 */ and r3, r6, r3 /* 8039B178 003980D8 7C 63 2A 78 */ xor r3, r3, r5 /* 8039B17C 003980DC 7C 00 2A 78 */ xor r0, r0, r5 /* 8039B180 003980E0 7C 60 03 79 */ or. r0, r3, r0 /* 8039B184 003980E4 41 82 00 18 */ beq lbl_8039B19C /* 8039B188 003980E8 88 A7 02 0B */ lbz r5, 0x20b(r7) /* 8039B18C 003980EC 7F C3 F3 78 */ mr r3, r30 /* 8039B190 003980F0 7F E6 FB 78 */ mr r6, r31 /* 8039B194 003980F4 48 01 5F 5D */ bl inpSetMidiCtrl /* 8039B198 003980F8 48 00 00 14 */ b lbl_8039B1AC lbl_8039B19C: /* 8039B19C 003980FC 88 A7 01 22 */ lbz r5, 0x122(r7) /* 8039B1A0 00398100 7F C3 F3 78 */ mr r3, r30 /* 8039B1A4 00398104 7F E6 FB 78 */ mr r6, r31 /* 8039B1A8 00398108 48 01 5F 49 */ bl inpSetMidiCtrl lbl_8039B1AC: /* 8039B1AC 0039810C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039B1B0 00398110 38 1D 00 EC */ addi r0, r29, 0xec /* 8039B1B4 00398114 3B 80 00 01 */ li r28, 1 /* 8039B1B8 00398118 7C 63 00 2E */ lwzx r3, r3, r0 /* 8039B1BC 0039811C 48 00 00 0C */ b lbl_8039B1C8 lbl_8039B1C0: /* 8039B1C0 00398120 7F 83 E3 78 */ mr r3, r28 /* 8039B1C4 00398124 48 00 00 14 */ b lbl_8039B1D8 lbl_8039B1C8: /* 8039B1C8 00398128 3C 03 00 01 */ addis r0, r3, 1 /* 8039B1CC 0039812C 28 00 FF FF */ cmplwi r0, 0xffff /* 8039B1D0 00398130 40 82 FF 74 */ bne lbl_8039B144 /* 8039B1D4 00398134 7F 83 E3 78 */ mr r3, r28 lbl_8039B1D8: /* 8039B1D8 00398138 80 01 00 24 */ lwz r0, 0x24(r1) /* 8039B1DC 0039813C 83 E1 00 1C */ lwz r31, 0x1c(r1) /* 8039B1E0 00398140 83 C1 00 18 */ lwz r30, 0x18(r1) /* 8039B1E4 00398144 83 A1 00 14 */ lwz r29, 0x14(r1) /* 8039B1E8 00398148 83 81 00 10 */ lwz r28, 0x10(r1) /* 8039B1EC 0039814C 7C 08 03 A6 */ mtlr r0 /* 8039B1F0 00398150 38 21 00 20 */ addi r1, r1, 0x20 /* 8039B1F4 00398154 4E 80 00 20 */ blr .global synthFXSetCtrl14 synthFXSetCtrl14: /* 8039B1F8 00398158 94 21 FF E0 */ stwu r1, -0x20(r1) /* 8039B1FC 0039815C 7C 08 02 A6 */ mflr r0 /* 8039B200 00398160 90 01 00 24 */ stw r0, 0x24(r1) /* 8039B204 00398164 93 E1 00 1C */ stw r31, 0x1c(r1) /* 8039B208 00398168 7C BF 2B 78 */ mr r31, r5 /* 8039B20C 0039816C 93 C1 00 18 */ stw r30, 0x18(r1) /* 8039B210 00398170 7C 9E 23 78 */ mr r30, r4 /* 8039B214 00398174 93 A1 00 14 */ stw r29, 0x14(r1) /* 8039B218 00398178 93 81 00 10 */ stw r28, 0x10(r1) /* 8039B21C 0039817C 3B 80 00 00 */ li r28, 0 /* 8039B220 00398180 48 00 C9 89 */ bl vidGetInternalId /* 8039B224 00398184 48 00 00 88 */ b lbl_8039B2AC lbl_8039B228: /* 8039B228 00398188 54 64 06 3E */ clrlwi r4, r3, 0x18 /* 8039B22C 0039818C 80 0D AE 78 */ lwz r0, synthVoice@sda21(r13) /* 8039B230 00398190 1F A4 04 04 */ mulli r29, r4, 0x404 /* 8039B234 00398194 7C E0 EA 14 */ add r7, r0, r29 /* 8039B238 00398198 80 07 00 F4 */ lwz r0, 0xf4(r7) /* 8039B23C 0039819C 7C 03 00 40 */ cmplw r3, r0 /* 8039B240 003981A0 40 82 00 64 */ bne lbl_8039B2A4 /* 8039B244 003981A4 80 07 01 14 */ lwz r0, 0x114(r7) /* 8039B248 003981A8 38 A0 00 00 */ li r5, 0 /* 8039B24C 003981AC 80 C7 01 18 */ lwz r6, 0x118(r7) /* 8039B250 003981B0 38 60 00 02 */ li r3, 2 /* 8039B254 003981B4 7C 00 28 38 */ and r0, r0, r5 /* 8039B258 003981B8 7C C3 18 38 */ and r3, r6, r3 /* 8039B25C 003981BC 7C 63 2A 78 */ xor r3, r3, r5 /* 8039B260 003981C0 7C 00 2A 78 */ xor r0, r0, r5 /* 8039B264 003981C4 7C 60 03 79 */ or. r0, r3, r0 /* 8039B268 003981C8 41 82 00 18 */ beq lbl_8039B280 /* 8039B26C 003981CC 88 A7 02 0B */ lbz r5, 0x20b(r7) /* 8039B270 003981D0 7F C3 F3 78 */ mr r3, r30 /* 8039B274 003981D4 7F E6 FB 78 */ mr r6, r31 /* 8039B278 003981D8 48 01 64 81 */ bl inpSetMidiCtrl14 /* 8039B27C 003981DC 48 00 00 14 */ b lbl_8039B290 lbl_8039B280: /* 8039B280 003981E0 88 A7 01 22 */ lbz r5, 0x122(r7) /* 8039B284 003981E4 7F C3 F3 78 */ mr r3, r30 /* 8039B288 003981E8 7F E6 FB 78 */ mr r6, r31 /* 8039B28C 003981EC 48 01 64 6D */ bl inpSetMidiCtrl14 lbl_8039B290: /* 8039B290 003981F0 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039B294 003981F4 38 1D 00 EC */ addi r0, r29, 0xec /* 8039B298 003981F8 3B 80 00 01 */ li r28, 1 /* 8039B29C 003981FC 7C 63 00 2E */ lwzx r3, r3, r0 /* 8039B2A0 00398200 48 00 00 0C */ b lbl_8039B2AC lbl_8039B2A4: /* 8039B2A4 00398204 7F 83 E3 78 */ mr r3, r28 /* 8039B2A8 00398208 48 00 00 14 */ b lbl_8039B2BC lbl_8039B2AC: /* 8039B2AC 0039820C 3C 03 00 01 */ addis r0, r3, 1 /* 8039B2B0 00398210 28 00 FF FF */ cmplwi r0, 0xffff /* 8039B2B4 00398214 40 82 FF 74 */ bne lbl_8039B228 /* 8039B2B8 00398218 7F 83 E3 78 */ mr r3, r28 lbl_8039B2BC: /* 8039B2BC 0039821C 80 01 00 24 */ lwz r0, 0x24(r1) /* 8039B2C0 00398220 83 E1 00 1C */ lwz r31, 0x1c(r1) /* 8039B2C4 00398224 83 C1 00 18 */ lwz r30, 0x18(r1) /* 8039B2C8 00398228 83 A1 00 14 */ lwz r29, 0x14(r1) /* 8039B2CC 0039822C 83 81 00 10 */ lwz r28, 0x10(r1) /* 8039B2D0 00398230 7C 08 03 A6 */ mtlr r0 /* 8039B2D4 00398234 38 21 00 20 */ addi r1, r1, 0x20 /* 8039B2D8 00398238 4E 80 00 20 */ blr .global synthFXCloneMidiSetup synthFXCloneMidiSetup: /* 8039B2DC 0039823C 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8039B2E0 00398240 7C 08 02 A6 */ mflr r0 /* 8039B2E4 00398244 90 01 00 14 */ stw r0, 0x14(r1) /* 8039B2E8 00398248 93 E1 00 0C */ stw r31, 0xc(r1) /* 8039B2EC 0039824C 7C 9F 23 78 */ mr r31, r4 /* 8039B2F0 00398250 7F E5 FB 78 */ mr r5, r31 /* 8039B2F4 00398254 93 C1 00 08 */ stw r30, 8(r1) /* 8039B2F8 00398258 7C 7E 1B 78 */ mr r30, r3 /* 8039B2FC 0039825C 7F C4 F3 78 */ mr r4, r30 /* 8039B300 00398260 38 60 00 07 */ li r3, 7 /* 8039B304 00398264 48 01 69 D5 */ bl inpFXCopyCtrl /* 8039B308 00398268 7F C4 F3 78 */ mr r4, r30 /* 8039B30C 0039826C 7F E5 FB 78 */ mr r5, r31 /* 8039B310 00398270 38 60 00 0A */ li r3, 0xa /* 8039B314 00398274 48 01 69 C5 */ bl inpFXCopyCtrl /* 8039B318 00398278 7F C4 F3 78 */ mr r4, r30 /* 8039B31C 0039827C 7F E5 FB 78 */ mr r5, r31 /* 8039B320 00398280 38 60 00 5B */ li r3, 0x5b /* 8039B324 00398284 48 01 69 B5 */ bl inpFXCopyCtrl /* 8039B328 00398288 7F C4 F3 78 */ mr r4, r30 /* 8039B32C 0039828C 7F E5 FB 78 */ mr r5, r31 /* 8039B330 00398290 38 60 00 80 */ li r3, 0x80 /* 8039B334 00398294 48 01 69 A5 */ bl inpFXCopyCtrl /* 8039B338 00398298 7F C4 F3 78 */ mr r4, r30 /* 8039B33C 0039829C 7F E5 FB 78 */ mr r5, r31 /* 8039B340 003982A0 38 60 00 84 */ li r3, 0x84 /* 8039B344 003982A4 48 01 69 95 */ bl inpFXCopyCtrl /* 8039B348 003982A8 80 01 00 14 */ lwz r0, 0x14(r1) /* 8039B34C 003982AC 83 E1 00 0C */ lwz r31, 0xc(r1) /* 8039B350 003982B0 83 C1 00 08 */ lwz r30, 8(r1) /* 8039B354 003982B4 7C 08 03 A6 */ mtlr r0 /* 8039B358 003982B8 38 21 00 10 */ addi r1, r1, 0x10 /* 8039B35C 003982BC 4E 80 00 20 */ blr .global synthSendKeyOff synthSendKeyOff: /* 8039B360 003982C0 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8039B364 003982C4 7C 08 02 A6 */ mflr r0 /* 8039B368 003982C8 90 01 00 14 */ stw r0, 0x14(r1) /* 8039B36C 003982CC 93 E1 00 0C */ stw r31, 0xc(r1) /* 8039B370 003982D0 93 C1 00 08 */ stw r30, 8(r1) /* 8039B374 003982D4 3B C0 00 00 */ li r30, 0 /* 8039B378 003982D8 88 0D AE 48 */ lbz r0, sndActive@sda21(r13) /* 8039B37C 003982DC 28 00 00 00 */ cmplwi r0, 0 /* 8039B380 003982E0 41 82 00 4C */ beq lbl_8039B3CC /* 8039B384 003982E4 48 00 C8 25 */ bl vidGetInternalId /* 8039B388 003982E8 48 00 00 38 */ b lbl_8039B3C0 lbl_8039B38C: /* 8039B38C 003982EC 54 60 06 3E */ clrlwi r0, r3, 0x18 /* 8039B390 003982F0 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039B394 003982F4 1F E0 04 04 */ mulli r31, r0, 0x404 /* 8039B398 003982F8 7C 84 FA 14 */ add r4, r4, r31 /* 8039B39C 003982FC 80 04 00 F4 */ lwz r0, 0xf4(r4) /* 8039B3A0 00398300 7C 03 00 40 */ cmplw r3, r0 /* 8039B3A4 00398304 40 82 00 10 */ bne lbl_8039B3B4 /* 8039B3A8 00398308 7C 83 23 78 */ mr r3, r4 /* 8039B3AC 0039830C 48 00 B9 75 */ bl macSetExternalKeyoff /* 8039B3B0 00398310 3B C0 00 01 */ li r30, 1 lbl_8039B3B4: /* 8039B3B4 00398314 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039B3B8 00398318 38 1F 00 EC */ addi r0, r31, 0xec /* 8039B3BC 0039831C 7C 63 00 2E */ lwzx r3, r3, r0 lbl_8039B3C0: /* 8039B3C0 00398320 3C 03 00 01 */ addis r0, r3, 1 /* 8039B3C4 00398324 28 00 FF FF */ cmplwi r0, 0xffff /* 8039B3C8 00398328 40 82 FF C4 */ bne lbl_8039B38C lbl_8039B3CC: /* 8039B3CC 0039832C 80 01 00 14 */ lwz r0, 0x14(r1) /* 8039B3D0 00398330 7F C3 F3 78 */ mr r3, r30 /* 8039B3D4 00398334 83 E1 00 0C */ lwz r31, 0xc(r1) /* 8039B3D8 00398338 83 C1 00 08 */ lwz r30, 8(r1) /* 8039B3DC 0039833C 7C 08 03 A6 */ mtlr r0 /* 8039B3E0 00398340 38 21 00 10 */ addi r1, r1, 0x10 /* 8039B3E4 00398344 4E 80 00 20 */ blr .global synthVolume synthVolume: /* 8039B3E8 00398348 94 21 FF B0 */ stwu r1, -0x50(r1) /* 8039B3EC 0039834C 7C 08 02 A6 */ mflr r0 /* 8039B3F0 00398350 90 01 00 54 */ stw r0, 0x54(r1) /* 8039B3F4 00398354 DB E1 00 40 */ stfd f31, 0x40(r1) /* 8039B3F8 00398358 F3 E1 00 48 */ psq_st f31, 72(r1), 0, qr0 /* 8039B3FC 0039835C 39 61 00 40 */ addi r11, r1, 0x40 /* 8039B400 00398360 4B FE E6 7D */ bl _savegpr_27 /* 8039B404 00398364 54 80 04 3F */ clrlwi. r0, r4, 0x10 /* 8039B408 00398368 7C 7B 1B 78 */ mr r27, r3 /* 8039B40C 0039836C 7C BD 2B 78 */ mr r29, r5 /* 8039B410 00398370 7C DE 33 78 */ mr r30, r6 /* 8039B414 00398374 7C FC 3B 78 */ mr r28, r7 /* 8039B418 00398378 90 01 00 08 */ stw r0, 8(r1) /* 8039B41C 0039837C 41 82 00 0C */ beq lbl_8039B428 /* 8039B420 00398380 38 61 00 08 */ addi r3, r1, 8 /* 8039B424 00398384 48 01 7A C9 */ bl sndConvertMs lbl_8039B428: /* 8039B428 00398388 57 BF 06 3E */ clrlwi r31, r29, 0x18 /* 8039B42C 0039838C 2C 1F 00 FD */ cmpwi r31, 0xfd /* 8039B430 00398390 41 82 02 7C */ beq lbl_8039B6AC /* 8039B434 00398394 40 80 00 1C */ bge lbl_8039B450 /* 8039B438 00398398 2C 1F 00 FB */ cmpwi r31, 0xfb /* 8039B43C 0039839C 41 82 02 68 */ beq lbl_8039B6A4 /* 8039B440 003983A0 40 80 01 40 */ bge lbl_8039B580 /* 8039B444 003983A4 2C 1F 00 FA */ cmpwi r31, 0xfa /* 8039B448 003983A8 40 80 02 54 */ bge lbl_8039B69C /* 8039B44C 003983AC 48 00 03 84 */ b lbl_8039B7D0 lbl_8039B450: /* 8039B450 003983B0 2C 1F 00 FF */ cmpwi r31, 0xff /* 8039B454 003983B4 41 82 00 0C */ beq lbl_8039B460 /* 8039B458 003983B8 40 80 03 78 */ bge lbl_8039B7D0 /* 8039B45C 003983BC 48 00 02 58 */ b lbl_8039B6B4 lbl_8039B460: /* 8039B460 003983C0 57 63 06 3E */ clrlwi r3, r27, 0x18 /* 8039B464 003983C4 3C 00 43 30 */ lis r0, 0x4330 /* 8039B468 003983C8 90 61 00 14 */ stw r3, 0x14(r1) /* 8039B46C 003983CC 3C 60 80 55 */ lis r3, synthMasterFader@ha /* 8039B470 003983D0 38 63 02 64 */ addi r3, r3, synthMasterFader@l /* 8039B474 003983D4 C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039B478 003983D8 90 01 00 10 */ stw r0, 0x10(r1) /* 8039B47C 003983DC 7C 7D 1B 78 */ mr r29, r3 /* 8039B480 003983E0 C0 42 D5 10 */ lfs f2, lbl_805AF230@sda21(r2) /* 8039B484 003983E4 3B 80 00 00 */ li r28, 0 /* 8039B488 003983E8 C8 01 00 10 */ lfd f0, 0x10(r1) /* 8039B48C 003983EC EC 00 08 28 */ fsubs f0, f0, f1 /* 8039B490 003983F0 EF E2 00 32 */ fmuls f31, f2, f0 lbl_8039B494: /* 8039B494 003983F4 88 1D 00 2D */ lbz r0, 0x2d(r29) /* 8039B498 003983F8 28 00 00 00 */ cmplwi r0, 0 /* 8039B49C 003983FC 41 82 00 0C */ beq lbl_8039B4A8 /* 8039B4A0 00398400 28 00 00 01 */ cmplwi r0, 1 /* 8039B4A4 00398404 40 82 00 C8 */ bne lbl_8039B56C lbl_8039B4A8: /* 8039B4A8 00398408 80 61 00 08 */ lwz r3, 8(r1) /* 8039B4AC 0039840C 38 00 FF FF */ li r0, -1 /* 8039B4B0 00398410 9B DD 00 2C */ stb r30, 0x2c(r29) /* 8039B4B4 00398414 28 03 00 00 */ cmplwi r3, 0 /* 8039B4B8 00398418 90 1D 00 28 */ stw r0, 0x28(r29) /* 8039B4BC 0039841C 41 82 00 40 */ beq lbl_8039B4FC /* 8039B4C0 00398420 3C 00 43 30 */ lis r0, 0x4330 /* 8039B4C4 00398424 C0 7D 00 00 */ lfs f3, 0(r29) /* 8039B4C8 00398428 90 61 00 14 */ stw r3, 0x14(r1) /* 8039B4CC 0039842C C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039B4D0 00398430 90 01 00 10 */ stw r0, 0x10(r1) /* 8039B4D4 00398434 C0 42 D5 4C */ lfs f2, lbl_805AF26C@sda21(r2) /* 8039B4D8 00398438 C8 01 00 10 */ lfd f0, 0x10(r1) /* 8039B4DC 0039843C D0 7D 00 08 */ stfs f3, 8(r29) /* 8039B4E0 00398440 EC 00 08 28 */ fsubs f0, f0, f1 /* 8039B4E4 00398444 C0 22 D5 20 */ lfs f1, lbl_805AF240@sda21(r2) /* 8039B4E8 00398448 D3 FD 00 04 */ stfs f31, 4(r29) /* 8039B4EC 0039844C EC 02 00 24 */ fdivs f0, f2, f0 /* 8039B4F0 00398450 D0 3D 00 0C */ stfs f1, 0xc(r29) /* 8039B4F4 00398454 D0 1D 00 10 */ stfs f0, 0x10(r29) /* 8039B4F8 00398458 48 00 00 60 */ b lbl_8039B558 lbl_8039B4FC: /* 8039B4FC 0039845C D3 FD 00 04 */ stfs f31, 4(r29) /* 8039B500 00398460 D3 FD 00 00 */ stfs f31, 0(r29) /* 8039B504 00398464 80 7D 00 28 */ lwz r3, 0x28(r29) /* 8039B508 00398468 3C 03 00 01 */ addis r0, r3, 1 /* 8039B50C 0039846C 28 00 FF FF */ cmplwi r0, 0xffff /* 8039B510 00398470 41 82 00 48 */ beq lbl_8039B558 /* 8039B514 00398474 88 1D 00 2C */ lbz r0, 0x2c(r29) /* 8039B518 00398478 2C 00 00 02 */ cmpwi r0, 2 /* 8039B51C 0039847C 41 82 00 28 */ beq lbl_8039B544 /* 8039B520 00398480 40 80 00 10 */ bge lbl_8039B530 /* 8039B524 00398484 2C 00 00 01 */ cmpwi r0, 1 /* 8039B528 00398488 40 80 00 14 */ bge lbl_8039B53C /* 8039B52C 0039848C 48 00 00 2C */ b lbl_8039B558 lbl_8039B530: /* 8039B530 00398490 2C 00 00 04 */ cmpwi r0, 4 /* 8039B534 00398494 40 80 00 24 */ bge lbl_8039B558 /* 8039B538 00398498 48 00 00 14 */ b lbl_8039B54C lbl_8039B53C: /* 8039B53C 0039849C 4B FF A6 01 */ bl seqStop /* 8039B540 003984A0 48 00 00 18 */ b lbl_8039B558 lbl_8039B544: /* 8039B544 003984A4 4B FF A3 7D */ bl seqPause /* 8039B548 003984A8 48 00 00 10 */ b lbl_8039B558 lbl_8039B54C: /* 8039B54C 003984AC 38 80 00 00 */ li r4, 0 /* 8039B550 003984B0 38 A0 00 00 */ li r5, 0 /* 8039B554 003984B4 4B FF AB 15 */ bl seqMute lbl_8039B558: /* 8039B558 003984B8 38 00 00 01 */ li r0, 1 /* 8039B55C 003984BC 80 6D AE 70 */ lwz r3, synthMasterFaderActiveFlags@sda21(r13) /* 8039B560 003984C0 7C 00 E0 30 */ slw r0, r0, r28 /* 8039B564 003984C4 7C 60 03 78 */ or r0, r3, r0 /* 8039B568 003984C8 90 0D AE 70 */ stw r0, synthMasterFaderActiveFlags@sda21(r13) lbl_8039B56C: /* 8039B56C 003984CC 3B 9C 00 01 */ addi r28, r28, 1 /* 8039B570 003984D0 3B BD 00 30 */ addi r29, r29, 0x30 /* 8039B574 003984D4 28 1C 00 20 */ cmplwi r28, 0x20 /* 8039B578 003984D8 41 80 FF 1C */ blt lbl_8039B494 /* 8039B57C 003984DC 48 00 03 7C */ b lbl_8039B8F8 lbl_8039B580: /* 8039B580 003984E0 57 63 06 3E */ clrlwi r3, r27, 0x18 /* 8039B584 003984E4 3C 00 43 30 */ lis r0, 0x4330 /* 8039B588 003984E8 90 61 00 14 */ stw r3, 0x14(r1) /* 8039B58C 003984EC 3C 60 80 55 */ lis r3, synthMasterFader@ha /* 8039B590 003984F0 C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039B594 003984F4 3B A3 02 64 */ addi r29, r3, synthMasterFader@l /* 8039B598 003984F8 90 01 00 10 */ stw r0, 0x10(r1) /* 8039B59C 003984FC 3B 80 00 00 */ li r28, 0 /* 8039B5A0 00398500 C0 42 D5 10 */ lfs f2, lbl_805AF230@sda21(r2) /* 8039B5A4 00398504 C8 01 00 10 */ lfd f0, 0x10(r1) /* 8039B5A8 00398508 EC 00 08 28 */ fsubs f0, f0, f1 /* 8039B5AC 0039850C EF E2 00 32 */ fmuls f31, f2, f0 lbl_8039B5B0: /* 8039B5B0 00398510 88 1D 00 2D */ lbz r0, 0x2d(r29) /* 8039B5B4 00398514 28 00 00 02 */ cmplwi r0, 2 /* 8039B5B8 00398518 41 82 00 0C */ beq lbl_8039B5C4 /* 8039B5BC 0039851C 28 00 00 03 */ cmplwi r0, 3 /* 8039B5C0 00398520 40 82 00 C8 */ bne lbl_8039B688 lbl_8039B5C4: /* 8039B5C4 00398524 80 61 00 08 */ lwz r3, 8(r1) /* 8039B5C8 00398528 38 00 FF FF */ li r0, -1 /* 8039B5CC 0039852C 9B DD 00 2C */ stb r30, 0x2c(r29) /* 8039B5D0 00398530 28 03 00 00 */ cmplwi r3, 0 /* 8039B5D4 00398534 90 1D 00 28 */ stw r0, 0x28(r29) /* 8039B5D8 00398538 41 82 00 40 */ beq lbl_8039B618 /* 8039B5DC 0039853C 3C 00 43 30 */ lis r0, 0x4330 /* 8039B5E0 00398540 C0 7D 00 00 */ lfs f3, 0(r29) /* 8039B5E4 00398544 90 61 00 14 */ stw r3, 0x14(r1) /* 8039B5E8 00398548 C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039B5EC 0039854C 90 01 00 10 */ stw r0, 0x10(r1) /* 8039B5F0 00398550 C0 42 D5 4C */ lfs f2, lbl_805AF26C@sda21(r2) /* 8039B5F4 00398554 C8 01 00 10 */ lfd f0, 0x10(r1) /* 8039B5F8 00398558 D0 7D 00 08 */ stfs f3, 8(r29) /* 8039B5FC 0039855C EC 00 08 28 */ fsubs f0, f0, f1 /* 8039B600 00398560 C0 22 D5 20 */ lfs f1, lbl_805AF240@sda21(r2) /* 8039B604 00398564 D3 FD 00 04 */ stfs f31, 4(r29) /* 8039B608 00398568 EC 02 00 24 */ fdivs f0, f2, f0 /* 8039B60C 0039856C D0 3D 00 0C */ stfs f1, 0xc(r29) /* 8039B610 00398570 D0 1D 00 10 */ stfs f0, 0x10(r29) /* 8039B614 00398574 48 00 00 60 */ b lbl_8039B674 lbl_8039B618: /* 8039B618 00398578 D3 FD 00 04 */ stfs f31, 4(r29) /* 8039B61C 0039857C D3 FD 00 00 */ stfs f31, 0(r29) /* 8039B620 00398580 80 7D 00 28 */ lwz r3, 0x28(r29) /* 8039B624 00398584 3C 03 00 01 */ addis r0, r3, 1 /* 8039B628 00398588 28 00 FF FF */ cmplwi r0, 0xffff /* 8039B62C 0039858C 41 82 00 48 */ beq lbl_8039B674 /* 8039B630 00398590 88 1D 00 2C */ lbz r0, 0x2c(r29) /* 8039B634 00398594 2C 00 00 02 */ cmpwi r0, 2 /* 8039B638 00398598 41 82 00 28 */ beq lbl_8039B660 /* 8039B63C 0039859C 40 80 00 10 */ bge lbl_8039B64C /* 8039B640 003985A0 2C 00 00 01 */ cmpwi r0, 1 /* 8039B644 003985A4 40 80 00 14 */ bge lbl_8039B658 /* 8039B648 003985A8 48 00 00 2C */ b lbl_8039B674 lbl_8039B64C: /* 8039B64C 003985AC 2C 00 00 04 */ cmpwi r0, 4 /* 8039B650 003985B0 40 80 00 24 */ bge lbl_8039B674 /* 8039B654 003985B4 48 00 00 14 */ b lbl_8039B668 lbl_8039B658: /* 8039B658 003985B8 4B FF A4 E5 */ bl seqStop /* 8039B65C 003985BC 48 00 00 18 */ b lbl_8039B674 lbl_8039B660: /* 8039B660 003985C0 4B FF A2 61 */ bl seqPause /* 8039B664 003985C4 48 00 00 10 */ b lbl_8039B674 lbl_8039B668: /* 8039B668 003985C8 38 80 00 00 */ li r4, 0 /* 8039B66C 003985CC 38 A0 00 00 */ li r5, 0 /* 8039B670 003985D0 4B FF A9 F9 */ bl seqMute lbl_8039B674: /* 8039B674 003985D4 38 00 00 01 */ li r0, 1 /* 8039B678 003985D8 80 6D AE 70 */ lwz r3, synthMasterFaderActiveFlags@sda21(r13) /* 8039B67C 003985DC 7C 00 E0 30 */ slw r0, r0, r28 /* 8039B680 003985E0 7C 60 03 78 */ or r0, r3, r0 /* 8039B684 003985E4 90 0D AE 70 */ stw r0, synthMasterFaderActiveFlags@sda21(r13) lbl_8039B688: /* 8039B688 003985E8 3B 9C 00 01 */ addi r28, r28, 1 /* 8039B68C 003985EC 3B BD 00 30 */ addi r29, r29, 0x30 /* 8039B690 003985F0 28 1C 00 20 */ cmplwi r28, 0x20 /* 8039B694 003985F4 41 80 FF 1C */ blt lbl_8039B5B0 /* 8039B698 003985F8 48 00 02 60 */ b lbl_8039B8F8 lbl_8039B69C: /* 8039B69C 003985FC 38 80 00 02 */ li r4, 2 /* 8039B6A0 00398600 48 00 00 18 */ b lbl_8039B6B8 lbl_8039B6A4: /* 8039B6A4 00398604 38 80 00 03 */ li r4, 3 /* 8039B6A8 00398608 48 00 00 10 */ b lbl_8039B6B8 lbl_8039B6AC: /* 8039B6AC 0039860C 38 80 00 00 */ li r4, 0 /* 8039B6B0 00398610 48 00 00 08 */ b lbl_8039B6B8 lbl_8039B6B4: /* 8039B6B4 00398614 38 80 00 01 */ li r4, 1 lbl_8039B6B8: /* 8039B6B8 00398618 57 63 06 3E */ clrlwi r3, r27, 0x18 /* 8039B6BC 0039861C 3C 00 43 30 */ lis r0, 0x4330 /* 8039B6C0 00398620 90 61 00 14 */ stw r3, 0x14(r1) /* 8039B6C4 00398624 3C 60 80 55 */ lis r3, synthMasterFader@ha /* 8039B6C8 00398628 C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039B6CC 0039862C 3B A3 02 64 */ addi r29, r3, synthMasterFader@l /* 8039B6D0 00398630 90 01 00 10 */ stw r0, 0x10(r1) /* 8039B6D4 00398634 54 9F 06 3E */ clrlwi r31, r4, 0x18 /* 8039B6D8 00398638 C0 42 D5 10 */ lfs f2, lbl_805AF230@sda21(r2) /* 8039B6DC 0039863C 3B 80 00 00 */ li r28, 0 /* 8039B6E0 00398640 C8 01 00 10 */ lfd f0, 0x10(r1) /* 8039B6E4 00398644 EC 00 08 28 */ fsubs f0, f0, f1 /* 8039B6E8 00398648 EF E2 00 32 */ fmuls f31, f2, f0 lbl_8039B6EC: /* 8039B6EC 0039864C 88 1D 00 2D */ lbz r0, 0x2d(r29) /* 8039B6F0 00398650 7C 00 F8 40 */ cmplw r0, r31 /* 8039B6F4 00398654 40 82 00 C8 */ bne lbl_8039B7BC /* 8039B6F8 00398658 80 61 00 08 */ lwz r3, 8(r1) /* 8039B6FC 0039865C 38 00 FF FF */ li r0, -1 /* 8039B700 00398660 9B DD 00 2C */ stb r30, 0x2c(r29) /* 8039B704 00398664 28 03 00 00 */ cmplwi r3, 0 /* 8039B708 00398668 90 1D 00 28 */ stw r0, 0x28(r29) /* 8039B70C 0039866C 41 82 00 40 */ beq lbl_8039B74C /* 8039B710 00398670 3C 00 43 30 */ lis r0, 0x4330 /* 8039B714 00398674 C0 7D 00 00 */ lfs f3, 0(r29) /* 8039B718 00398678 90 61 00 14 */ stw r3, 0x14(r1) /* 8039B71C 0039867C C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039B720 00398680 90 01 00 10 */ stw r0, 0x10(r1) /* 8039B724 00398684 C0 42 D5 4C */ lfs f2, lbl_805AF26C@sda21(r2) /* 8039B728 00398688 C8 01 00 10 */ lfd f0, 0x10(r1) /* 8039B72C 0039868C D0 7D 00 08 */ stfs f3, 8(r29) /* 8039B730 00398690 EC 00 08 28 */ fsubs f0, f0, f1 /* 8039B734 00398694 C0 22 D5 20 */ lfs f1, lbl_805AF240@sda21(r2) /* 8039B738 00398698 D3 FD 00 04 */ stfs f31, 4(r29) /* 8039B73C 0039869C EC 02 00 24 */ fdivs f0, f2, f0 /* 8039B740 003986A0 D0 3D 00 0C */ stfs f1, 0xc(r29) /* 8039B744 003986A4 D0 1D 00 10 */ stfs f0, 0x10(r29) /* 8039B748 003986A8 48 00 00 60 */ b lbl_8039B7A8 lbl_8039B74C: /* 8039B74C 003986AC D3 FD 00 04 */ stfs f31, 4(r29) /* 8039B750 003986B0 D3 FD 00 00 */ stfs f31, 0(r29) /* 8039B754 003986B4 80 7D 00 28 */ lwz r3, 0x28(r29) /* 8039B758 003986B8 3C 03 00 01 */ addis r0, r3, 1 /* 8039B75C 003986BC 28 00 FF FF */ cmplwi r0, 0xffff /* 8039B760 003986C0 41 82 00 48 */ beq lbl_8039B7A8 /* 8039B764 003986C4 88 1D 00 2C */ lbz r0, 0x2c(r29) /* 8039B768 003986C8 2C 00 00 02 */ cmpwi r0, 2 /* 8039B76C 003986CC 41 82 00 28 */ beq lbl_8039B794 /* 8039B770 003986D0 40 80 00 10 */ bge lbl_8039B780 /* 8039B774 003986D4 2C 00 00 01 */ cmpwi r0, 1 /* 8039B778 003986D8 40 80 00 14 */ bge lbl_8039B78C /* 8039B77C 003986DC 48 00 00 2C */ b lbl_8039B7A8 lbl_8039B780: /* 8039B780 003986E0 2C 00 00 04 */ cmpwi r0, 4 /* 8039B784 003986E4 40 80 00 24 */ bge lbl_8039B7A8 /* 8039B788 003986E8 48 00 00 14 */ b lbl_8039B79C lbl_8039B78C: /* 8039B78C 003986EC 4B FF A3 B1 */ bl seqStop /* 8039B790 003986F0 48 00 00 18 */ b lbl_8039B7A8 lbl_8039B794: /* 8039B794 003986F4 4B FF A1 2D */ bl seqPause /* 8039B798 003986F8 48 00 00 10 */ b lbl_8039B7A8 lbl_8039B79C: /* 8039B79C 003986FC 38 80 00 00 */ li r4, 0 /* 8039B7A0 00398700 38 A0 00 00 */ li r5, 0 /* 8039B7A4 00398704 4B FF A8 C5 */ bl seqMute lbl_8039B7A8: /* 8039B7A8 00398708 38 00 00 01 */ li r0, 1 /* 8039B7AC 0039870C 80 6D AE 70 */ lwz r3, synthMasterFaderActiveFlags@sda21(r13) /* 8039B7B0 00398710 7C 00 E0 30 */ slw r0, r0, r28 /* 8039B7B4 00398714 7C 60 03 78 */ or r0, r3, r0 /* 8039B7B8 00398718 90 0D AE 70 */ stw r0, synthMasterFaderActiveFlags@sda21(r13) lbl_8039B7BC: /* 8039B7BC 0039871C 3B 9C 00 01 */ addi r28, r28, 1 /* 8039B7C0 00398720 3B BD 00 30 */ addi r29, r29, 0x30 /* 8039B7C4 00398724 28 1C 00 20 */ cmplwi r28, 0x20 /* 8039B7C8 00398728 41 80 FF 24 */ blt lbl_8039B6EC /* 8039B7CC 0039872C 48 00 01 2C */ b lbl_8039B8F8 lbl_8039B7D0: /* 8039B7D0 00398730 57 A0 06 3E */ clrlwi r0, r29, 0x18 /* 8039B7D4 00398734 3C 60 80 55 */ lis r3, synthMasterFader@ha /* 8039B7D8 00398738 1C C0 00 30 */ mulli r6, r0, 0x30 /* 8039B7DC 0039873C 80 81 00 08 */ lwz r4, 8(r1) /* 8039B7E0 00398740 38 A3 02 64 */ addi r5, r3, synthMasterFader@l /* 8039B7E4 00398744 28 04 00 00 */ cmplwi r4, 0 /* 8039B7E8 00398748 7D 05 32 14 */ add r8, r5, r6 /* 8039B7EC 0039874C 9B C8 00 2C */ stb r30, 0x2c(r8) /* 8039B7F0 00398750 7D 07 43 78 */ mr r7, r8 /* 8039B7F4 00398754 38 E7 00 28 */ addi r7, r7, 0x28 /* 8039B7F8 00398758 93 88 00 28 */ stw r28, 0x28(r8) /* 8039B7FC 0039875C 39 08 00 2C */ addi r8, r8, 0x2c /* 8039B800 00398760 41 82 00 60 */ beq lbl_8039B860 /* 8039B804 00398764 3C 00 43 30 */ lis r0, 0x4330 /* 8039B808 00398768 57 63 06 3E */ clrlwi r3, r27, 0x18 /* 8039B80C 0039876C 90 81 00 1C */ stw r4, 0x1c(r1) /* 8039B810 00398770 7C 85 32 14 */ add r4, r5, r6 /* 8039B814 00398774 7C A5 34 2E */ lfsx f5, r5, r6 /* 8039B818 00398778 90 01 00 18 */ stw r0, 0x18(r1) /* 8039B81C 0039877C C8 62 D5 38 */ lfd f3, lbl_805AF258@sda21(r2) /* 8039B820 00398780 C8 01 00 18 */ lfd f0, 0x18(r1) /* 8039B824 00398784 C0 22 D5 4C */ lfs f1, lbl_805AF26C@sda21(r2) /* 8039B828 00398788 EC 00 18 28 */ fsubs f0, f0, f3 /* 8039B82C 0039878C 90 61 00 14 */ stw r3, 0x14(r1) /* 8039B830 00398790 C0 82 D5 10 */ lfs f4, lbl_805AF230@sda21(r2) /* 8039B834 00398794 90 01 00 10 */ stw r0, 0x10(r1) /* 8039B838 00398798 EC 01 00 24 */ fdivs f0, f1, f0 /* 8039B83C 0039879C C0 22 D5 20 */ lfs f1, lbl_805AF240@sda21(r2) /* 8039B840 003987A0 C8 41 00 10 */ lfd f2, 0x10(r1) /* 8039B844 003987A4 D0 A4 00 08 */ stfs f5, 8(r4) /* 8039B848 003987A8 EC 42 18 28 */ fsubs f2, f2, f3 /* 8039B84C 003987AC EC 44 00 B2 */ fmuls f2, f4, f2 /* 8039B850 003987B0 D0 44 00 04 */ stfs f2, 4(r4) /* 8039B854 003987B4 D0 24 00 0C */ stfs f1, 0xc(r4) /* 8039B858 003987B8 D0 04 00 10 */ stfs f0, 0x10(r4) /* 8039B85C 003987BC 48 00 00 88 */ b lbl_8039B8E4 lbl_8039B860: /* 8039B860 003987C0 57 63 06 3E */ clrlwi r3, r27, 0x18 /* 8039B864 003987C4 3C 00 43 30 */ lis r0, 0x4330 /* 8039B868 003987C8 90 61 00 1C */ stw r3, 0x1c(r1) /* 8039B86C 003987CC 7C 65 32 14 */ add r3, r5, r6 /* 8039B870 003987D0 C8 22 D5 38 */ lfd f1, lbl_805AF258@sda21(r2) /* 8039B874 003987D4 90 01 00 18 */ stw r0, 0x18(r1) /* 8039B878 003987D8 C0 42 D5 10 */ lfs f2, lbl_805AF230@sda21(r2) /* 8039B87C 003987DC C8 01 00 18 */ lfd f0, 0x18(r1) /* 8039B880 003987E0 EC 00 08 28 */ fsubs f0, f0, f1 /* 8039B884 003987E4 EC 02 00 32 */ fmuls f0, f2, f0 /* 8039B888 003987E8 D0 03 00 04 */ stfs f0, 4(r3) /* 8039B88C 003987EC 7C 05 35 2E */ stfsx f0, r5, r6 /* 8039B890 003987F0 80 67 00 00 */ lwz r3, 0(r7) /* 8039B894 003987F4 3C 03 00 01 */ addis r0, r3, 1 /* 8039B898 003987F8 28 00 FF FF */ cmplwi r0, 0xffff /* 8039B89C 003987FC 41 82 00 48 */ beq lbl_8039B8E4 /* 8039B8A0 00398800 88 08 00 00 */ lbz r0, 0(r8) /* 8039B8A4 00398804 2C 00 00 02 */ cmpwi r0, 2 /* 8039B8A8 00398808 41 82 00 28 */ beq lbl_8039B8D0 /* 8039B8AC 0039880C 40 80 00 10 */ bge lbl_8039B8BC /* 8039B8B0 00398810 2C 00 00 01 */ cmpwi r0, 1 /* 8039B8B4 00398814 40 80 00 14 */ bge lbl_8039B8C8 /* 8039B8B8 00398818 48 00 00 2C */ b lbl_8039B8E4 lbl_8039B8BC: /* 8039B8BC 0039881C 2C 00 00 04 */ cmpwi r0, 4 /* 8039B8C0 00398820 40 80 00 24 */ bge lbl_8039B8E4 /* 8039B8C4 00398824 48 00 00 14 */ b lbl_8039B8D8 lbl_8039B8C8: /* 8039B8C8 00398828 4B FF A2 75 */ bl seqStop /* 8039B8CC 0039882C 48 00 00 18 */ b lbl_8039B8E4 lbl_8039B8D0: /* 8039B8D0 00398830 4B FF 9F F1 */ bl seqPause /* 8039B8D4 00398834 48 00 00 10 */ b lbl_8039B8E4 lbl_8039B8D8: /* 8039B8D8 00398838 38 80 00 00 */ li r4, 0 /* 8039B8DC 0039883C 38 A0 00 00 */ li r5, 0 /* 8039B8E0 00398840 4B FF A7 89 */ bl seqMute lbl_8039B8E4: /* 8039B8E4 00398844 38 00 00 01 */ li r0, 1 /* 8039B8E8 00398848 80 6D AE 70 */ lwz r3, synthMasterFaderActiveFlags@sda21(r13) /* 8039B8EC 0039884C 7C 00 F8 30 */ slw r0, r0, r31 /* 8039B8F0 00398850 7C 60 03 78 */ or r0, r3, r0 /* 8039B8F4 00398854 90 0D AE 70 */ stw r0, synthMasterFaderActiveFlags@sda21(r13) lbl_8039B8F8: /* 8039B8F8 00398858 E3 E1 00 48 */ psq_l f31, 72(r1), 0, qr0 /* 8039B8FC 0039885C 39 61 00 40 */ addi r11, r1, 0x40 /* 8039B900 00398860 CB E1 00 40 */ lfd f31, 0x40(r1) /* 8039B904 00398864 4B FE E1 C5 */ bl _restgpr_27 /* 8039B908 00398868 80 01 00 54 */ lwz r0, 0x54(r1) /* 8039B90C 0039886C 7C 08 03 A6 */ mtlr r0 /* 8039B910 00398870 38 21 00 50 */ addi r1, r1, 0x50 /* 8039B914 00398874 4E 80 00 20 */ blr .global synthIsFadeOutActive synthIsFadeOutActive: /* 8039B918 00398878 54 65 06 3E */ clrlwi r5, r3, 0x18 /* 8039B91C 0039887C 3C 60 80 55 */ lis r3, synthMasterFader@ha /* 8039B920 00398880 1C 85 00 30 */ mulli r4, r5, 0x30 /* 8039B924 00398884 38 03 02 64 */ addi r0, r3, synthMasterFader@l /* 8039B928 00398888 7C 80 22 14 */ add r4, r0, r4 /* 8039B92C 0039888C 88 04 00 2D */ lbz r0, 0x2d(r4) /* 8039B930 00398890 28 00 00 04 */ cmplwi r0, 4 /* 8039B934 00398894 41 82 00 30 */ beq lbl_8039B964 /* 8039B938 00398898 38 00 00 01 */ li r0, 1 /* 8039B93C 0039889C 80 6D AE 70 */ lwz r3, synthMasterFaderActiveFlags@sda21(r13) /* 8039B940 003988A0 7C 00 28 30 */ slw r0, r0, r5 /* 8039B944 003988A4 7C 60 00 39 */ and. r0, r3, r0 /* 8039B948 003988A8 41 82 00 1C */ beq lbl_8039B964 /* 8039B94C 003988AC C0 24 00 08 */ lfs f1, 8(r4) /* 8039B950 003988B0 C0 04 00 04 */ lfs f0, 4(r4) /* 8039B954 003988B4 FC 01 00 40 */ fcmpo cr0, f1, f0 /* 8039B958 003988B8 40 81 00 0C */ ble lbl_8039B964 /* 8039B95C 003988BC 38 60 00 01 */ li r3, 1 /* 8039B960 003988C0 4E 80 00 20 */ blr lbl_8039B964: /* 8039B964 003988C4 38 60 00 00 */ li r3, 0 /* 8039B968 003988C8 4E 80 00 20 */ blr .global synthSetMusicVolumeType synthSetMusicVolumeType: /* 8039B96C 003988CC 88 0D AE 48 */ lbz r0, sndActive@sda21(r13) /* 8039B970 003988D0 28 00 00 00 */ cmplwi r0, 0 /* 8039B974 003988D4 4D 82 00 20 */ beqlr /* 8039B978 003988D8 54 60 06 3E */ clrlwi r0, r3, 0x18 /* 8039B97C 003988DC 3C 60 80 55 */ lis r3, synthMasterFader@ha /* 8039B980 003988E0 1C 00 00 30 */ mulli r0, r0, 0x30 /* 8039B984 003988E4 38 63 02 64 */ addi r3, r3, synthMasterFader@l /* 8039B988 003988E8 7C 63 02 14 */ add r3, r3, r0 /* 8039B98C 003988EC 98 83 00 2D */ stb r4, 0x2d(r3) /* 8039B990 003988F0 4E 80 00 20 */ blr .fn synthHWMessageHandler, local /* 8039B994 003988F4 94 21 FF E0 */ stwu r1, -0x20(r1) /* 8039B998 003988F8 7C 08 02 A6 */ mflr r0 /* 8039B99C 003988FC 2C 03 00 02 */ cmpwi r3, 2 /* 8039B9A0 00398900 90 01 00 24 */ stw r0, 0x24(r1) /* 8039B9A4 00398904 93 E1 00 1C */ stw r31, 0x1c(r1) /* 8039B9A8 00398908 93 C1 00 18 */ stw r30, 0x18(r1) /* 8039B9AC 0039890C 3B C0 00 00 */ li r30, 0 /* 8039B9B0 00398910 93 A1 00 14 */ stw r29, 0x14(r1) /* 8039B9B4 00398914 7C 9D 23 78 */ mr r29, r4 /* 8039B9B8 00398918 41 82 00 70 */ beq lbl_8039BA28 /* 8039B9BC 0039891C 40 80 00 14 */ bge lbl_8039B9D0 /* 8039B9C0 00398920 2C 03 00 00 */ cmpwi r3, 0 /* 8039B9C4 00398924 41 82 00 18 */ beq lbl_8039B9DC /* 8039B9C8 00398928 40 80 00 54 */ bge lbl_8039BA1C /* 8039B9CC 0039892C 48 00 00 78 */ b lbl_8039BA44 lbl_8039B9D0: /* 8039B9D0 00398930 2C 03 00 04 */ cmpwi r3, 4 /* 8039B9D4 00398934 40 80 00 70 */ bge lbl_8039BA44 /* 8039B9D8 00398938 48 00 00 60 */ b lbl_8039BA38 lbl_8039B9DC: /* 8039B9DC 0039893C 57 A3 06 3E */ clrlwi r3, r29, 0x18 /* 8039B9E0 00398940 80 0D AE 78 */ lwz r0, synthVoice@sda21(r13) /* 8039B9E4 00398944 1F E3 04 04 */ mulli r31, r3, 0x404 /* 8039B9E8 00398948 7C 80 FA 14 */ add r4, r0, r31 /* 8039B9EC 0039894C 88 04 01 1C */ lbz r0, 0x11c(r4) /* 8039B9F0 00398950 28 00 00 00 */ cmplwi r0, 0 /* 8039B9F4 00398954 40 82 00 50 */ bne lbl_8039BA44 /* 8039B9F8 00398958 48 01 85 31 */ bl hwGetVirtualSampleID /* 8039B9FC 0039895C 48 00 E2 D9 */ bl vsSampleEndNotify /* 8039BA00 00398960 80 0D AE 78 */ lwz r0, synthVoice@sda21(r13) /* 8039BA04 00398964 7C 60 FA 14 */ add r3, r0, r31 /* 8039BA08 00398968 80 03 00 F4 */ lwz r0, 0xf4(r3) /* 8039BA0C 0039896C 7C 1D 00 40 */ cmplw r29, r0 /* 8039BA10 00398970 40 82 00 34 */ bne lbl_8039BA44 /* 8039BA14 00398974 48 00 B2 61 */ bl macSampleEndNotify /* 8039BA18 00398978 48 00 00 2C */ b lbl_8039BA44 lbl_8039BA1C: /* 8039BA1C 0039897C 57 A3 06 3E */ clrlwi r3, r29, 0x18 /* 8039BA20 00398980 48 00 CF FD */ bl voiceKill /* 8039BA24 00398984 48 00 00 20 */ b lbl_8039BA44 lbl_8039BA28: /* 8039BA28 00398988 57 A3 06 3E */ clrlwi r3, r29, 0x18 /* 8039BA2C 0039898C 48 00 E0 61 */ bl vsSampleStartNotify /* 8039BA30 00398990 7C 7E 1B 78 */ mr r30, r3 /* 8039BA34 00398994 48 00 00 10 */ b lbl_8039BA44 lbl_8039BA38: /* 8039BA38 00398998 57 A3 06 3E */ clrlwi r3, r29, 0x18 /* 8039BA3C 0039899C 48 01 84 ED */ bl hwGetVirtualSampleID /* 8039BA40 003989A0 48 00 E2 95 */ bl vsSampleEndNotify lbl_8039BA44: /* 8039BA44 003989A4 80 01 00 24 */ lwz r0, 0x24(r1) /* 8039BA48 003989A8 7F C3 F3 78 */ mr r3, r30 /* 8039BA4C 003989AC 83 E1 00 1C */ lwz r31, 0x1c(r1) /* 8039BA50 003989B0 83 C1 00 18 */ lwz r30, 0x18(r1) /* 8039BA54 003989B4 83 A1 00 14 */ lwz r29, 0x14(r1) /* 8039BA58 003989B8 7C 08 03 A6 */ mtlr r0 /* 8039BA5C 003989BC 38 21 00 20 */ addi r1, r1, 0x20 /* 8039BA60 003989C0 4E 80 00 20 */ blr .endfn synthHWMessageHandler .global synthInit synthInit: /* 8039BA64 003989C4 94 21 FF B0 */ stwu r1, -0x50(r1) /* 8039BA68 003989C8 7C 08 02 A6 */ mflr r0 /* 8039BA6C 003989CC 90 01 00 54 */ stw r0, 0x54(r1) /* 8039BA70 003989D0 39 61 00 50 */ addi r11, r1, 0x50 /* 8039BA74 003989D4 4B FE DF D5 */ bl _savegpr_14 /* 8039BA78 003989D8 7C 8F 23 78 */ mr r15, r4 /* 8039BA7C 003989DC 3C 80 80 55 */ lis r4, synthTicksPerSecond@ha /* 8039BA80 003989E0 3B E4 FE 10 */ addi r31, r4, synthTicksPerSecond@l /* 8039BA84 003989E4 38 A0 00 00 */ li r5, 0 /* 8039BA88 003989E8 1D CF 04 04 */ mulli r14, r15, 0x404 /* 8039BA8C 003989EC 38 00 18 00 */ li r0, 0x1800 /* 8039BA90 003989F0 38 9F 00 00 */ addi r4, r31, 0 /* 8039BA94 003989F4 90 7F 02 40 */ stw r3, 0x240(r31) /* 8039BA98 003989F8 90 AD AE 8C */ stw r5, synthRealTime+4@sda21(r13) /* 8039BA9C 003989FC 7D C3 73 78 */ mr r3, r14 /* 8039BAA0 00398A00 90 AD AE 88 */ stw r5, synthRealTime@sda21(r13) /* 8039BAA4 00398A04 90 04 02 00 */ stw r0, 0x200(r4) /* 8039BAA8 00398A08 90 AD AE 74 */ stw r5, synthFlags@sda21(r13) /* 8039BAAC 00398A0C 90 AD AE 7C */ stw r5, synthMessageCallback@sda21(r13) /* 8039BAB0 00398A10 48 01 96 85 */ bl salMalloc /* 8039BAB4 00398A14 90 6D AE 78 */ stw r3, synthVoice@sda21(r13) /* 8039BAB8 00398A18 7D C5 73 78 */ mr r5, r14 /* 8039BABC 00398A1C 38 80 00 00 */ li r4, 0 /* 8039BAC0 00398A20 4B C6 78 E9 */ bl memset /* 8039BAC4 00398A24 38 C0 00 00 */ li r6, 0 /* 8039BAC8 00398A28 38 A0 00 00 */ li r5, 0 /* 8039BACC 00398A2C 3E 60 00 40 */ lis r19, 0x40 /* 8039BAD0 00398A30 7D E9 03 A6 */ mtctr r15 /* 8039BAD4 00398A34 28 0F 00 00 */ cmplwi r15, 0 /* 8039BAD8 00398A38 40 81 01 E8 */ ble lbl_8039BCC0 lbl_8039BADC: /* 8039BADC 00398A3C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BAE0 00398A40 38 05 00 F4 */ addi r0, r5, 0xf4 /* 8039BAE4 00398A44 38 80 FF FF */ li r4, -1 /* 8039BAE8 00398A48 39 25 01 14 */ addi r9, r5, 0x114 /* 8039BAEC 00398A4C 7C 83 01 2E */ stwx r4, r3, r0 /* 8039BAF0 00398A50 38 80 00 00 */ li r4, 0 /* 8039BAF4 00398A54 39 05 01 10 */ addi r8, r5, 0x110 /* 8039BAF8 00398A58 38 65 01 0C */ addi r3, r5, 0x10c /* 8039BAFC 00398A5C 81 4D AE 78 */ lwz r10, synthVoice@sda21(r13) /* 8039BB00 00398A60 38 E5 01 21 */ addi r7, r5, 0x121 /* 8039BB04 00398A64 38 00 00 FF */ li r0, 0xff /* 8039BB08 00398A68 39 C5 01 54 */ addi r14, r5, 0x154 /* 8039BB0C 00398A6C 7D 2A 4A 14 */ add r9, r10, r9 /* 8039BB10 00398A70 39 E5 01 92 */ addi r15, r5, 0x192 /* 8039BB14 00398A74 90 89 00 04 */ stw r4, 4(r9) /* 8039BB18 00398A78 3A 25 01 90 */ addi r17, r5, 0x190 /* 8039BB1C 00398A7C 3A 00 00 80 */ li r16, 0x80 /* 8039BB20 00398A80 3A 45 01 91 */ addi r18, r5, 0x191 /* 8039BB24 00398A84 90 89 00 00 */ stw r4, 0(r9) /* 8039BB28 00398A88 3A 85 01 80 */ addi r20, r5, 0x180 /* 8039BB2C 00398A8C 3A A5 01 70 */ addi r21, r5, 0x170 /* 8039BB30 00398A90 3A C5 01 84 */ addi r22, r5, 0x184 /* 8039BB34 00398A94 81 2D AE 78 */ lwz r9, synthVoice@sda21(r13) /* 8039BB38 00398A98 3A E5 01 74 */ addi r23, r5, 0x174 /* 8039BB3C 00398A9C 3B 05 01 A0 */ addi r24, r5, 0x1a0 /* 8039BB40 00398AA0 3B 25 01 A4 */ addi r25, r5, 0x1a4 /* 8039BB44 00398AA4 7C 89 41 2E */ stwx r4, r9, r8 /* 8039BB48 00398AA8 3B 45 01 B8 */ addi r26, r5, 0x1b8 /* 8039BB4C 00398AAC 3B 65 01 B9 */ addi r27, r5, 0x1b9 /* 8039BB50 00398AB0 3B 85 01 1C */ addi r28, r5, 0x11c /* 8039BB54 00398AB4 81 0D AE 78 */ lwz r8, synthVoice@sda21(r13) /* 8039BB58 00398AB8 3B A5 01 1E */ addi r29, r5, 0x11e /* 8039BB5C 00398ABC 3B C5 01 04 */ addi r30, r5, 0x104 /* 8039BB60 00398AC0 39 85 01 93 */ addi r12, r5, 0x193 /* 8039BB64 00398AC4 7C 88 19 AE */ stbx r4, r8, r3 /* 8039BB68 00398AC8 39 65 01 C0 */ addi r11, r5, 0x1c0 /* 8039BB6C 00398ACC 39 45 01 C4 */ addi r10, r5, 0x1c4 /* 8039BB70 00398AD0 39 05 01 C6 */ addi r8, r5, 0x1c6 /* 8039BB74 00398AD4 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BB78 00398AD8 39 20 7F FF */ li r9, 0x7fff /* 8039BB7C 00398ADC 7C 03 39 AE */ stbx r0, r3, r7 /* 8039BB80 00398AE0 38 E5 01 CC */ addi r7, r5, 0x1cc /* 8039BB84 00398AE4 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BB88 00398AE8 7C 83 71 2E */ stwx r4, r3, r14 /* 8039BB8C 00398AEC 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BB90 00398AF0 7C 83 79 AE */ stbx r4, r3, r15 /* 8039BB94 00398AF4 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BB98 00398AF8 7E 03 89 AE */ stbx r16, r3, r17 /* 8039BB9C 00398AFC 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBA0 00398B00 7C 83 91 AE */ stbx r4, r3, r18 /* 8039BBA4 00398B04 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBA8 00398B08 7E 63 A1 2E */ stwx r19, r3, r20 /* 8039BBAC 00398B0C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBB0 00398B10 7E 63 A9 2E */ stwx r19, r3, r21 /* 8039BBB4 00398B14 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBB8 00398B18 7C 83 B1 2E */ stwx r4, r3, r22 /* 8039BBBC 00398B1C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBC0 00398B20 7C 83 B9 2E */ stwx r4, r3, r23 /* 8039BBC4 00398B24 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBC8 00398B28 7C 83 C1 2E */ stwx r4, r3, r24 /* 8039BBCC 00398B2C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBD0 00398B30 7C 83 C9 2E */ stwx r4, r3, r25 /* 8039BBD4 00398B34 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBD8 00398B38 7C 83 D1 AE */ stbx r4, r3, r26 /* 8039BBDC 00398B3C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBE0 00398B40 7C 83 D9 AE */ stbx r4, r3, r27 /* 8039BBE4 00398B44 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBE8 00398B48 7C 83 E1 AE */ stbx r4, r3, r28 /* 8039BBEC 00398B4C 38 60 00 17 */ li r3, 0x17 /* 8039BBF0 00398B50 81 CD AE 78 */ lwz r14, synthVoice@sda21(r13) /* 8039BBF4 00398B54 7C 6E E9 AE */ stbx r3, r14, r29 /* 8039BBF8 00398B58 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BBFC 00398B5C 7C 83 F1 AE */ stbx r4, r3, r30 /* 8039BC00 00398B60 38 60 00 01 */ li r3, 1 /* 8039BC04 00398B64 81 CD AE 78 */ lwz r14, synthVoice@sda21(r13) /* 8039BC08 00398B68 7C 6E 61 AE */ stbx r3, r14, r12 /* 8039BC0C 00398B6C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BC10 00398B70 7C 83 59 2E */ stwx r4, r3, r11 /* 8039BC14 00398B74 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BC18 00398B78 7C 83 53 2E */ sthx r4, r3, r10 /* 8039BC1C 00398B7C 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BC20 00398B80 7D 23 43 2E */ sthx r9, r3, r8 /* 8039BC24 00398B84 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BC28 00398B88 7C 83 39 2E */ stwx r4, r3, r7 /* 8039BC2C 00398B8C 81 0D AE 78 */ lwz r8, synthVoice@sda21(r13) /* 8039BC30 00398B90 38 E5 01 D0 */ addi r7, r5, 0x1d0 /* 8039BC34 00398B94 38 65 01 D2 */ addi r3, r5, 0x1d2 /* 8039BC38 00398B98 3A 05 01 3C */ addi r16, r5, 0x13c /* 8039BC3C 00398B9C 7C 88 3B 2E */ sthx r4, r8, r7 /* 8039BC40 00398BA0 3A 20 64 00 */ li r17, 0x6400 /* 8039BC44 00398BA4 39 E5 01 31 */ addi r15, r5, 0x131 /* 8039BC48 00398BA8 39 C5 01 1F */ addi r14, r5, 0x11f /* 8039BC4C 00398BAC 80 ED AE 78 */ lwz r7, synthVoice@sda21(r13) /* 8039BC50 00398BB0 39 85 00 08 */ addi r12, r5, 8 /* 8039BC54 00398BB4 39 65 00 09 */ addi r11, r5, 9 /* 8039BC58 00398BB8 39 45 00 14 */ addi r10, r5, 0x14 /* 8039BC5C 00398BBC 7D 27 1B 2E */ sthx r9, r7, r3 /* 8039BC60 00398BC0 39 05 00 15 */ addi r8, r5, 0x15 /* 8039BC64 00398BC4 38 E5 00 20 */ addi r7, r5, 0x20 /* 8039BC68 00398BC8 38 65 00 21 */ addi r3, r5, 0x21 /* 8039BC6C 00398BCC 81 2D AE 78 */ lwz r9, synthVoice@sda21(r13) /* 8039BC70 00398BD0 38 A5 04 04 */ addi r5, r5, 0x404 /* 8039BC74 00398BD4 7E 29 81 2E */ stwx r17, r9, r16 /* 8039BC78 00398BD8 81 2D AE 78 */ lwz r9, synthVoice@sda21(r13) /* 8039BC7C 00398BDC 7C 89 79 AE */ stbx r4, r9, r15 /* 8039BC80 00398BE0 81 2D AE 78 */ lwz r9, synthVoice@sda21(r13) /* 8039BC84 00398BE4 7C 89 71 AE */ stbx r4, r9, r14 /* 8039BC88 00398BE8 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039BC8C 00398BEC 7C C4 61 AE */ stbx r6, r4, r12 /* 8039BC90 00398BF0 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039BC94 00398BF4 7C 04 59 AE */ stbx r0, r4, r11 /* 8039BC98 00398BF8 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039BC9C 00398BFC 7C C4 51 AE */ stbx r6, r4, r10 /* 8039BCA0 00398C00 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039BCA4 00398C04 7C 04 41 AE */ stbx r0, r4, r8 /* 8039BCA8 00398C08 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039BCAC 00398C0C 7C C4 39 AE */ stbx r6, r4, r7 /* 8039BCB0 00398C10 38 C6 00 01 */ addi r6, r6, 1 /* 8039BCB4 00398C14 80 8D AE 78 */ lwz r4, synthVoice@sda21(r13) /* 8039BCB8 00398C18 7C 04 19 AE */ stbx r0, r4, r3 /* 8039BCBC 00398C1C 42 00 FE 20 */ bdnz lbl_8039BADC lbl_8039BCC0: /* 8039BCC0 00398C20 38 00 00 02 */ li r0, 2 /* 8039BCC4 00398C24 38 7F 04 54 */ addi r3, r31, 0x454 /* 8039BCC8 00398C28 C0 22 D5 48 */ lfs f1, lbl_805AF268@sda21(r2) /* 8039BCCC 00398C2C C0 02 D5 20 */ lfs f0, lbl_805AF240@sda21(r2) /* 8039BCD0 00398C30 7C 09 03 A6 */ mtctr r0 lbl_8039BCD4: /* 8039BCD4 00398C34 D0 23 00 00 */ stfs f1, 0(r3) /* 8039BCD8 00398C38 38 00 00 04 */ li r0, 4 /* 8039BCDC 00398C3C D0 03 00 14 */ stfs f0, 0x14(r3) /* 8039BCE0 00398C40 98 03 00 2D */ stb r0, 0x2d(r3) /* 8039BCE4 00398C44 D0 23 00 30 */ stfs f1, 0x30(r3) /* 8039BCE8 00398C48 D0 03 00 44 */ stfs f0, 0x44(r3) /* 8039BCEC 00398C4C 98 03 00 5D */ stb r0, 0x5d(r3) /* 8039BCF0 00398C50 D0 23 00 60 */ stfs f1, 0x60(r3) /* 8039BCF4 00398C54 D0 03 00 74 */ stfs f0, 0x74(r3) /* 8039BCF8 00398C58 98 03 00 8D */ stb r0, 0x8d(r3) /* 8039BCFC 00398C5C D0 23 00 90 */ stfs f1, 0x90(r3) /* 8039BD00 00398C60 D0 03 00 A4 */ stfs f0, 0xa4(r3) /* 8039BD04 00398C64 98 03 00 BD */ stb r0, 0xbd(r3) /* 8039BD08 00398C68 D0 23 00 C0 */ stfs f1, 0xc0(r3) /* 8039BD0C 00398C6C D0 03 00 D4 */ stfs f0, 0xd4(r3) /* 8039BD10 00398C70 98 03 00 ED */ stb r0, 0xed(r3) /* 8039BD14 00398C74 D0 23 00 F0 */ stfs f1, 0xf0(r3) /* 8039BD18 00398C78 D0 03 01 04 */ stfs f0, 0x104(r3) /* 8039BD1C 00398C7C 98 03 01 1D */ stb r0, 0x11d(r3) /* 8039BD20 00398C80 D0 23 01 20 */ stfs f1, 0x120(r3) /* 8039BD24 00398C84 D0 03 01 34 */ stfs f0, 0x134(r3) /* 8039BD28 00398C88 98 03 01 4D */ stb r0, 0x14d(r3) /* 8039BD2C 00398C8C D0 23 01 50 */ stfs f1, 0x150(r3) /* 8039BD30 00398C90 D0 03 01 64 */ stfs f0, 0x164(r3) /* 8039BD34 00398C94 98 03 01 7D */ stb r0, 0x17d(r3) /* 8039BD38 00398C98 D0 23 01 80 */ stfs f1, 0x180(r3) /* 8039BD3C 00398C9C D0 03 01 94 */ stfs f0, 0x194(r3) /* 8039BD40 00398CA0 98 03 01 AD */ stb r0, 0x1ad(r3) /* 8039BD44 00398CA4 D0 23 01 B0 */ stfs f1, 0x1b0(r3) /* 8039BD48 00398CA8 D0 03 01 C4 */ stfs f0, 0x1c4(r3) /* 8039BD4C 00398CAC 98 03 01 DD */ stb r0, 0x1dd(r3) /* 8039BD50 00398CB0 D0 23 01 E0 */ stfs f1, 0x1e0(r3) /* 8039BD54 00398CB4 D0 03 01 F4 */ stfs f0, 0x1f4(r3) /* 8039BD58 00398CB8 98 03 02 0D */ stb r0, 0x20d(r3) /* 8039BD5C 00398CBC D0 23 02 10 */ stfs f1, 0x210(r3) /* 8039BD60 00398CC0 D0 03 02 24 */ stfs f0, 0x224(r3) /* 8039BD64 00398CC4 98 03 02 3D */ stb r0, 0x23d(r3) /* 8039BD68 00398CC8 D0 23 02 40 */ stfs f1, 0x240(r3) /* 8039BD6C 00398CCC D0 03 02 54 */ stfs f0, 0x254(r3) /* 8039BD70 00398CD0 98 03 02 6D */ stb r0, 0x26d(r3) /* 8039BD74 00398CD4 D0 23 02 70 */ stfs f1, 0x270(r3) /* 8039BD78 00398CD8 D0 03 02 84 */ stfs f0, 0x284(r3) /* 8039BD7C 00398CDC 98 03 02 9D */ stb r0, 0x29d(r3) /* 8039BD80 00398CE0 D0 23 02 A0 */ stfs f1, 0x2a0(r3) /* 8039BD84 00398CE4 D0 03 02 B4 */ stfs f0, 0x2b4(r3) /* 8039BD88 00398CE8 98 03 02 CD */ stb r0, 0x2cd(r3) /* 8039BD8C 00398CEC D0 23 02 D0 */ stfs f1, 0x2d0(r3) /* 8039BD90 00398CF0 D0 03 02 E4 */ stfs f0, 0x2e4(r3) /* 8039BD94 00398CF4 98 03 02 FD */ stb r0, 0x2fd(r3) /* 8039BD98 00398CF8 38 63 03 00 */ addi r3, r3, 0x300 /* 8039BD9C 00398CFC 42 00 FF 38 */ bdnz lbl_8039BCD4 /* 8039BDA0 00398D00 C0 02 D5 20 */ lfs f0, lbl_805AF240@sda21(r2) /* 8039BDA4 00398D04 38 9F 04 54 */ addi r4, r31, 0x454 /* 8039BDA8 00398D08 38 A0 00 00 */ li r5, 0 /* 8039BDAC 00398D0C 38 00 00 01 */ li r0, 1 /* 8039BDB0 00398D10 90 AD AE 70 */ stw r5, synthMasterFaderActiveFlags@sda21(r13) /* 8039BDB4 00398D14 38 60 00 00 */ li r3, 0 /* 8039BDB8 00398D18 90 AD AE 6C */ stw r5, synthMasterFaderPauseActiveFlags@sda21(r13) /* 8039BDBC 00398D1C 98 04 05 FD */ stb r0, 0x5fd(r4) /* 8039BDC0 00398D20 98 A4 04 7D */ stb r5, 0x47d(r4) /* 8039BDC4 00398D24 98 A4 04 AD */ stb r5, 0x4ad(r4) /* 8039BDC8 00398D28 98 A4 04 DD */ stb r5, 0x4dd(r4) /* 8039BDCC 00398D2C 98 A4 05 0D */ stb r5, 0x50d(r4) /* 8039BDD0 00398D30 98 A4 05 3D */ stb r5, 0x53d(r4) /* 8039BDD4 00398D34 98 A4 05 6D */ stb r5, 0x56d(r4) /* 8039BDD8 00398D38 98 A4 05 9D */ stb r5, 0x59d(r4) /* 8039BDDC 00398D3C 98 A4 05 CD */ stb r5, 0x5cd(r4) /* 8039BDE0 00398D40 D0 04 03 F0 */ stfs f0, 0x3f0(r4) /* 8039BDE4 00398D44 D0 04 04 20 */ stfs f0, 0x420(r4) /* 8039BDE8 00398D48 48 01 69 E5 */ bl inpInit /* 8039BDEC 00398D4C 39 00 00 00 */ li r8, 0 /* 8039BDF0 00398D50 38 FF 0C 94 */ addi r7, r31, 0xc94 /* 8039BDF4 00398D54 38 DF 0C 34 */ addi r6, r31, 0xc34 /* 8039BDF8 00398D58 38 9F 0C 74 */ addi r4, r31, 0xc74 /* 8039BDFC 00398D5C 38 00 00 FF */ li r0, 0xff /* 8039BE00 00398D60 38 AD AE 64 */ addi r5, r13, synthAuxAMIDI@sda21 /* 8039BE04 00398D64 38 6D AE 54 */ addi r3, r13, synthAuxBMIDI@sda21 /* 8039BE08 00398D68 91 1F 0C 34 */ stw r8, 0xc34(r31) /* 8039BE0C 00398D6C 98 0D AE 64 */ stb r0, synthAuxAMIDI@sda21(r13) /* 8039BE10 00398D70 91 1F 0C 74 */ stw r8, 0xc74(r31) /* 8039BE14 00398D74 98 0D AE 54 */ stb r0, synthAuxBMIDI@sda21(r13) /* 8039BE18 00398D78 99 07 00 01 */ stb r8, 1(r7) /* 8039BE1C 00398D7C 99 1F 0C 94 */ stb r8, 0xc94(r31) /* 8039BE20 00398D80 91 06 00 04 */ stw r8, 4(r6) /* 8039BE24 00398D84 98 05 00 01 */ stb r0, 1(r5) /* 8039BE28 00398D88 91 04 00 04 */ stw r8, 4(r4) /* 8039BE2C 00398D8C 98 03 00 01 */ stb r0, 1(r3) /* 8039BE30 00398D90 99 07 00 03 */ stb r8, 3(r7) /* 8039BE34 00398D94 99 07 00 02 */ stb r8, 2(r7) /* 8039BE38 00398D98 91 06 00 08 */ stw r8, 8(r6) /* 8039BE3C 00398D9C 98 05 00 02 */ stb r0, 2(r5) /* 8039BE40 00398DA0 91 04 00 08 */ stw r8, 8(r4) /* 8039BE44 00398DA4 98 03 00 02 */ stb r0, 2(r3) /* 8039BE48 00398DA8 99 07 00 05 */ stb r8, 5(r7) /* 8039BE4C 00398DAC 99 07 00 04 */ stb r8, 4(r7) /* 8039BE50 00398DB0 91 06 00 0C */ stw r8, 0xc(r6) /* 8039BE54 00398DB4 98 05 00 03 */ stb r0, 3(r5) /* 8039BE58 00398DB8 91 04 00 0C */ stw r8, 0xc(r4) /* 8039BE5C 00398DBC 98 03 00 03 */ stb r0, 3(r3) /* 8039BE60 00398DC0 99 07 00 07 */ stb r8, 7(r7) /* 8039BE64 00398DC4 99 07 00 06 */ stb r8, 6(r7) /* 8039BE68 00398DC8 91 06 00 10 */ stw r8, 0x10(r6) /* 8039BE6C 00398DCC 98 05 00 04 */ stb r0, 4(r5) /* 8039BE70 00398DD0 91 04 00 10 */ stw r8, 0x10(r4) /* 8039BE74 00398DD4 98 03 00 04 */ stb r0, 4(r3) /* 8039BE78 00398DD8 99 07 00 09 */ stb r8, 9(r7) /* 8039BE7C 00398DDC 99 07 00 08 */ stb r8, 8(r7) /* 8039BE80 00398DE0 91 06 00 14 */ stw r8, 0x14(r6) /* 8039BE84 00398DE4 98 05 00 05 */ stb r0, 5(r5) /* 8039BE88 00398DE8 91 04 00 14 */ stw r8, 0x14(r4) /* 8039BE8C 00398DEC 98 03 00 05 */ stb r0, 5(r3) /* 8039BE90 00398DF0 99 07 00 0B */ stb r8, 0xb(r7) /* 8039BE94 00398DF4 99 07 00 0A */ stb r8, 0xa(r7) /* 8039BE98 00398DF8 91 06 00 18 */ stw r8, 0x18(r6) /* 8039BE9C 00398DFC 98 05 00 06 */ stb r0, 6(r5) /* 8039BEA0 00398E00 91 04 00 18 */ stw r8, 0x18(r4) /* 8039BEA4 00398E04 98 03 00 06 */ stb r0, 6(r3) /* 8039BEA8 00398E08 99 07 00 0D */ stb r8, 0xd(r7) /* 8039BEAC 00398E0C 99 07 00 0C */ stb r8, 0xc(r7) /* 8039BEB0 00398E10 91 06 00 1C */ stw r8, 0x1c(r6) /* 8039BEB4 00398E14 98 05 00 07 */ stb r0, 7(r5) /* 8039BEB8 00398E18 91 04 00 1C */ stw r8, 0x1c(r4) /* 8039BEBC 00398E1C 98 03 00 07 */ stb r0, 7(r3) /* 8039BEC0 00398E20 99 07 00 0F */ stb r8, 0xf(r7) /* 8039BEC4 00398E24 99 07 00 0E */ stb r8, 0xe(r7) /* 8039BEC8 00398E28 48 00 B7 31 */ bl macInit /* 8039BECC 00398E2C 48 00 B7 95 */ bl vidInit /* 8039BED0 00398E30 48 00 C5 99 */ bl synthInitAllocationAids /* 8039BED4 00398E34 38 7F 0C A4 */ addi r3, r31, 0xca4 /* 8039BED8 00398E38 38 00 00 00 */ li r0, 0 /* 8039BEDC 00398E3C 90 03 00 00 */ stw r0, 0(r3) /* 8039BEE0 00398E40 90 03 00 04 */ stw r0, 4(r3) /* 8039BEE4 00398E44 90 03 00 08 */ stw r0, 8(r3) /* 8039BEE8 00398E48 90 03 00 0C */ stw r0, 0xc(r3) /* 8039BEEC 00398E4C 90 03 00 10 */ stw r0, 0x10(r3) /* 8039BEF0 00398E50 90 03 00 14 */ stw r0, 0x14(r3) /* 8039BEF4 00398E54 90 03 00 18 */ stw r0, 0x18(r3) /* 8039BEF8 00398E58 90 03 00 1C */ stw r0, 0x1c(r3) /* 8039BEFC 00398E5C 90 03 00 20 */ stw r0, 0x20(r3) /* 8039BF00 00398E60 90 03 00 24 */ stw r0, 0x24(r3) /* 8039BF04 00398E64 90 03 00 28 */ stw r0, 0x28(r3) /* 8039BF08 00398E68 90 03 00 2C */ stw r0, 0x2c(r3) /* 8039BF0C 00398E6C 90 03 00 30 */ stw r0, 0x30(r3) /* 8039BF10 00398E70 90 03 00 34 */ stw r0, 0x34(r3) /* 8039BF14 00398E74 90 03 00 38 */ stw r0, 0x38(r3) /* 8039BF18 00398E78 90 03 00 3C */ stw r0, 0x3c(r3) /* 8039BF1C 00398E7C 48 00 D0 91 */ bl voiceInitLastStarted /* 8039BF20 00398E80 38 80 00 00 */ li r4, 0 /* 8039BF24 00398E84 48 00 00 7C */ b lbl_8039BFA0 lbl_8039BF28: /* 8039BF28 00398E88 54 80 06 3E */ clrlwi r0, r4, 0x18 /* 8039BF2C 00398E8C 38 BF 0A 94 */ addi r5, r31, 0xa94 /* 8039BF30 00398E90 1C 00 00 0C */ mulli r0, r0, 0xc /* 8039BF34 00398E94 38 60 00 00 */ li r3, 0 /* 8039BF38 00398E98 38 84 00 08 */ addi r4, r4, 8 /* 8039BF3C 00398E9C 7C A5 02 14 */ add r5, r5, r0 /* 8039BF40 00398EA0 90 65 00 00 */ stw r3, 0(r5) /* 8039BF44 00398EA4 90 65 00 04 */ stw r3, 4(r5) /* 8039BF48 00398EA8 90 65 00 08 */ stw r3, 8(r5) /* 8039BF4C 00398EAC 90 65 00 0C */ stw r3, 0xc(r5) /* 8039BF50 00398EB0 90 65 00 10 */ stw r3, 0x10(r5) /* 8039BF54 00398EB4 90 65 00 14 */ stw r3, 0x14(r5) /* 8039BF58 00398EB8 90 65 00 18 */ stw r3, 0x18(r5) /* 8039BF5C 00398EBC 90 65 00 1C */ stw r3, 0x1c(r5) /* 8039BF60 00398EC0 90 65 00 20 */ stw r3, 0x20(r5) /* 8039BF64 00398EC4 90 65 00 24 */ stw r3, 0x24(r5) /* 8039BF68 00398EC8 90 65 00 28 */ stw r3, 0x28(r5) /* 8039BF6C 00398ECC 90 65 00 2C */ stw r3, 0x2c(r5) /* 8039BF70 00398ED0 90 65 00 30 */ stw r3, 0x30(r5) /* 8039BF74 00398ED4 90 65 00 34 */ stw r3, 0x34(r5) /* 8039BF78 00398ED8 90 65 00 38 */ stw r3, 0x38(r5) /* 8039BF7C 00398EDC 90 65 00 3C */ stw r3, 0x3c(r5) /* 8039BF80 00398EE0 90 65 00 40 */ stw r3, 0x40(r5) /* 8039BF84 00398EE4 90 65 00 44 */ stw r3, 0x44(r5) /* 8039BF88 00398EE8 90 65 00 48 */ stw r3, 0x48(r5) /* 8039BF8C 00398EEC 90 65 00 4C */ stw r3, 0x4c(r5) /* 8039BF90 00398EF0 90 65 00 50 */ stw r3, 0x50(r5) /* 8039BF94 00398EF4 90 65 00 54 */ stw r3, 0x54(r5) /* 8039BF98 00398EF8 90 65 00 58 */ stw r3, 0x58(r5) /* 8039BF9C 00398EFC 90 65 00 5C */ stw r3, 0x5c(r5) lbl_8039BFA0: /* 8039BFA0 00398F00 54 80 06 3E */ clrlwi r0, r4, 0x18 /* 8039BFA4 00398F04 28 00 00 20 */ cmplwi r0, 0x20 /* 8039BFA8 00398F08 41 80 FF 80 */ blt lbl_8039BF28 /* 8039BFAC 00398F0C 38 00 00 00 */ li r0, 0 /* 8039BFB0 00398F10 3C 60 80 3A */ lis r3, synthHWMessageHandler@ha /* 8039BFB4 00398F14 98 0D AE 49 */ stb r0, synthJobTableIndex@sda21(r13) /* 8039BFB8 00398F18 38 63 B9 94 */ addi r3, r3, synthHWMessageHandler@l /* 8039BFBC 00398F1C 48 01 72 01 */ bl hwSetMesgCallback /* 8039BFC0 00398F20 39 61 00 50 */ addi r11, r1, 0x50 /* 8039BFC4 00398F24 4B FE DA D1 */ bl _restgpr_14 /* 8039BFC8 00398F28 80 01 00 54 */ lwz r0, 0x54(r1) /* 8039BFCC 00398F2C 7C 08 03 A6 */ mtlr r0 /* 8039BFD0 00398F30 38 21 00 50 */ addi r1, r1, 0x50 /* 8039BFD4 00398F34 4E 80 00 20 */ blr .global synthExit synthExit: /* 8039BFD8 00398F38 94 21 FF F0 */ stwu r1, -0x10(r1) /* 8039BFDC 00398F3C 7C 08 02 A6 */ mflr r0 /* 8039BFE0 00398F40 90 01 00 14 */ stw r0, 0x14(r1) /* 8039BFE4 00398F44 80 6D AE 78 */ lwz r3, synthVoice@sda21(r13) /* 8039BFE8 00398F48 48 01 91 75 */ bl salFree /* 8039BFEC 00398F4C 80 01 00 14 */ lwz r0, 0x14(r1) /* 8039BFF0 00398F50 7C 08 03 A6 */ mtlr r0 /* 8039BFF4 00398F54 38 21 00 10 */ addi r1, r1, 0x10 /* 8039BFF8 00398F58 4E 80 00 20 */ blr