prime/asm/Dolphin/vi.s

2459 lines
114 KiB
ArmAsm
Raw Normal View History

.include "macros.inc"
.section .bss
.balign 8
lbl_80542040:
.skip 0xF0
lbl_80542130:
.skip 0x58
.section .data, "wa"
.balign 8
.global lbl_803F23A8
lbl_803F23A8:
# ROM: 0x3EF3A8
.asciz "<< Dolphin SDK - VI\trelease build: Sep 5 2002 05:33:13 (0x2301) >>"
.4byte 0x060000F0
.4byte 0x00180019
.4byte 0x00030002
.4byte 0x0C0D0C0D
.4byte 0x02080207
.4byte 0x02080207
.4byte 0x020D01AD
.4byte 0x404769A2
.4byte 0x01757A00
.4byte 0x019C0600
.4byte 0x00F00018
.4byte 0x00180004
.4byte 0x00040C0C
.4byte 0x0C0C0208
.4byte 0x02080208
.4byte 0x0208020E
.4byte 0x01AD4047
.4byte 0x69A20175
.4byte 0x7A00019C
.4byte 0x0500011F
.4byte 0x00230024
.4byte 0x00010000
.4byte 0x0D0C0B0A
.4byte 0x026B026A
.4byte 0x0269026C
.4byte 0x027101B0
.4byte 0x404B6AAC
.4byte 0x017C8500
.4byte 0x01A40500
.4byte 0x011F0021
.4byte 0x00210002
.4byte 0x00020D0B
.4byte 0x0D0B026B
.4byte 0x026D026B
.4byte 0x026D0270
.4byte 0x01B0404B
.4byte 0x6AAC017C
.4byte 0x850001A4
.4byte 0x060000F0
.4byte 0x00180019
.4byte 0x00030002
.4byte 0x100F0E0D
.4byte 0x02060205
.4byte 0x02040207
.4byte 0x020D01AD
.4byte 0x404E70A2
.4byte 0x01757A00
.4byte 0x019C0600
.4byte 0x00F00018
.4byte 0x00180004
.4byte 0x0004100E
.4byte 0x100E0206
.4byte 0x02080206
.4byte 0x0208020E
.4byte 0x01AD404E
.4byte 0x70A20175
.4byte 0x7A00019C
.4byte 0x0C0001E0
.4byte 0x00300030
.4byte 0x00060006
.4byte 0x18181818
.4byte 0x040E040E
.4byte 0x040E040E
.4byte 0x041A01AD
.4byte 0x404769A2
.4byte 0x01757A00
.4byte 0x019C0C00
.4byte 0x01E0002C
.4byte 0x002C000A
.4byte 0x000A1818
.4byte 0x1818040E
.4byte 0x040E040E
.4byte 0x040E041A
.4byte 0x01AD4047
.4byte 0x69A8017B
.4byte 0x7A00019C
.4byte 0x060000F1
.4byte 0x00180019
.4byte 0x00010000
.4byte 0x0C0D0C0D
.4byte 0x02080207
.4byte 0x02080207
.4byte 0x020D01AD
.4byte 0x4047699F
.4byte 0x01727A00
.4byte 0x019C0C00
.4byte 0x01E00030
.4byte 0x00300006
.4byte 0x00061818
.4byte 0x1818040E
.4byte 0x040E040E
.4byte 0x040E041A
.4byte 0x01AD4047
.4byte 0x69B40187
.4byte 0x7A00019C
.4byte 0x01F001DC
.4byte 0x01AE0174
.4byte 0x012900DB
.4byte 0x008E0046
.4byte 0x000C00E2
.4byte 0x00CB00C0
.4byte 0x00C400CF
.4byte 0x00DE00EC
.4byte 0x00FC0008
.4byte 0x000F0013
.4byte 0x0013000F
.4byte 0x000C0008
.4byte 0x00010000
.global lbl_803F259C
lbl_803F259C:
# ROM: 0x3EF59C
.4byte lbl_80387964
.4byte lbl_8038796C
.4byte lbl_803879A4
.4byte lbl_803879AC
.4byte lbl_80387974
.4byte lbl_8038797C
.4byte lbl_803879D4
.4byte lbl_803879D4
.4byte lbl_80387994
.4byte lbl_8038799C
.4byte lbl_803879D4
.4byte lbl_803879D4
.4byte lbl_803879D4
.4byte lbl_803879D4
.4byte lbl_803879D4
.4byte lbl_803879D4
.4byte lbl_803879B4
.4byte lbl_803879BC
.4byte lbl_803879D4
.4byte lbl_803879D4
.4byte lbl_80387984
.4byte lbl_8038798C
.4byte lbl_803879D4
.4byte lbl_803879D4
.4byte lbl_803879C4
.4byte lbl_803879D4
.4byte lbl_803879CC
.asciz "***************************************\n"
.balign 4
.asciz " ! ! ! C A U T I O N ! ! ! \n"
.balign 4
.asciz "This TV format \"DEBUG_PAL\" is only for \n"
.balign 4
.asciz "temporary solution until PAL DAC board \n"
.balign 4
.asciz "is available. Please do NOT use this \n"
.balign 4
.asciz "mode in real games!!! \n"
.balign 4
.asciz "VIConfigure(): Tried to change mode from (%d) to (%d), which is forbidden\n"
.balign 4
.global lbl_803F275C
lbl_803F275C:
# ROM: 0x3EF75C
.4byte lbl_80389510
.4byte lbl_80389518
.4byte lbl_80389520
.4byte lbl_80389510
.4byte lbl_80389518
.4byte lbl_80389520
.4byte lbl_80389510
.section .sdata
.balign 8
.global lbl_805A8B78
lbl_805A8B78:
# ROM: 0x3F6518
.4byte lbl_803F23A8
.global lbl_805A8B7C
lbl_805A8B7C:
# ROM: 0x3F651C
.asciz "vi.c"
.balign 4
.4byte 0
.section .sbss, "wa"
.balign 8
lbl_805A9958:
.skip 0x4
lbl_805A995C:
.skip 0x4
lbl_805A9960:
.skip 0x4
lbl_805A9964:
.skip 0x8
lbl_805A996C:
.skip 0x4
lbl_805A9970:
.skip 0x4
lbl_805A9974:
.skip 0x4
lbl_805A9978:
.skip 0x2
lbl_805A997A:
.skip 0x2
lbl_805A997C:
.skip 0x4
lbl_805A9980:
.skip 0x4
lbl_805A9984:
.skip 0x4
lbl_805A9988:
.skip 0x8
lbl_805A9990:
.skip 0x4
lbl_805A9994:
.skip 0x4
lbl_805A9998:
.skip 0x4
lbl_805A999C:
.skip 0x4
lbl_805A99A0:
.skip 0x4
lbl_805A99A4:
.skip 0x4
lbl_805A99A8:
.skip 0x4
lbl_805A99AC:
.skip 0x4
.section .text, "ax"
.global __VIRetraceHandler
__VIRetraceHandler:
/* 80387684 003845E4 7C 08 02 A6 */ mflr r0
/* 80387688 003845E8 3C 60 CC 00 */ lis r3, 0xCC002000@ha
/* 8038768C 003845EC 90 01 00 04 */ stw r0, 4(r1)
/* 80387690 003845F0 38 A3 20 00 */ addi r5, r3, 0xCC002000@l
/* 80387694 003845F4 3C 60 80 54 */ lis r3, lbl_80542040@ha
/* 80387698 003845F8 94 21 FD 08 */ stwu r1, -0x2f8(r1)
/* 8038769C 003845FC 38 E0 00 00 */ li r7, 0
/* 803876A0 00384600 BF 61 02 E4 */ stmw r27, 0x2e4(r1)
/* 803876A4 00384604 3B C4 00 00 */ addi r30, r4, 0
/* 803876A8 00384608 3B E3 20 40 */ addi r31, r3, lbl_80542040@l
/* 803876AC 0038460C A4 C5 00 30 */ lhzu r6, 0x30(r5)
/* 803876B0 00384610 54 C0 04 21 */ rlwinm. r0, r6, 0, 0x10, 0x10
/* 803876B4 00384614 41 82 00 10 */ beq lbl_803876C4
/* 803876B8 00384618 54 C0 04 5E */ rlwinm r0, r6, 0, 0x11, 0xf
/* 803876BC 0038461C B0 05 00 00 */ sth r0, 0(r5)
/* 803876C0 00384620 60 E7 00 01 */ ori r7, r7, 1
lbl_803876C4:
/* 803876C4 00384624 3C 60 CC 00 */ lis r3, 0xCC002034@ha
/* 803876C8 00384628 A4 83 20 34 */ lhzu r4, 0xCC002034@l(r3)
/* 803876CC 0038462C 54 80 04 21 */ rlwinm. r0, r4, 0, 0x10, 0x10
/* 803876D0 00384630 41 82 00 10 */ beq lbl_803876E0
/* 803876D4 00384634 54 80 04 5E */ rlwinm r0, r4, 0, 0x11, 0xf
/* 803876D8 00384638 B0 03 00 00 */ sth r0, 0(r3)
/* 803876DC 0038463C 60 E7 00 02 */ ori r7, r7, 2
lbl_803876E0:
/* 803876E0 00384640 3C 60 CC 00 */ lis r3, 0xCC002038@ha
/* 803876E4 00384644 A4 83 20 38 */ lhzu r4, 0xCC002038@l(r3)
/* 803876E8 00384648 54 80 04 21 */ rlwinm. r0, r4, 0, 0x10, 0x10
/* 803876EC 0038464C 41 82 00 10 */ beq lbl_803876FC
/* 803876F0 00384650 54 80 04 5E */ rlwinm r0, r4, 0, 0x11, 0xf
/* 803876F4 00384654 B0 03 00 00 */ sth r0, 0(r3)
/* 803876F8 00384658 60 E7 00 04 */ ori r7, r7, 4
lbl_803876FC:
/* 803876FC 0038465C 3C 60 CC 00 */ lis r3, 0xCC00203C@ha
/* 80387700 00384660 A4 83 20 3C */ lhzu r4, 0xCC00203C@l(r3)
/* 80387704 00384664 54 80 04 21 */ rlwinm. r0, r4, 0, 0x10, 0x10
/* 80387708 00384668 41 82 00 10 */ beq lbl_80387718
/* 8038770C 0038466C 54 80 04 5E */ rlwinm r0, r4, 0, 0x11, 0xf
/* 80387710 00384670 B0 03 00 00 */ sth r0, 0(r3)
/* 80387714 00384674 60 E7 00 08 */ ori r7, r7, 8
lbl_80387718:
/* 80387718 00384678 54 E0 07 7B */ rlwinm. r0, r7, 0, 0x1d, 0x1d
/* 8038771C 0038467C 40 82 00 0C */ bne lbl_80387728
/* 80387720 00384680 54 E0 07 39 */ rlwinm. r0, r7, 0, 0x1c, 0x1c
/* 80387724 00384684 41 82 00 10 */ beq lbl_80387734
lbl_80387728:
/* 80387728 00384688 7F C3 F3 78 */ mr r3, r30
/* 8038772C 0038468C 4B FF 7C F1 */ bl OSSetCurrentContext
/* 80387730 00384690 48 00 01 70 */ b lbl_803878A0
lbl_80387734:
/* 80387734 00384694 80 8D AD 9C */ lwz r4, lbl_805A995C@sda21(r13)
/* 80387738 00384698 38 61 00 18 */ addi r3, r1, 0x18
/* 8038773C 0038469C 38 04 00 01 */ addi r0, r4, 1
/* 80387740 003846A0 90 0D AD 9C */ stw r0, lbl_805A995C@sda21(r13)
/* 80387744 003846A4 4B FF 7E D1 */ bl OSClearContext
/* 80387748 003846A8 38 61 00 18 */ addi r3, r1, 0x18
/* 8038774C 003846AC 4B FF 7C D1 */ bl OSSetCurrentContext
/* 80387750 003846B0 81 8D AD AC */ lwz r12, lbl_805A996C@sda21(r13)
/* 80387754 003846B4 28 0C 00 00 */ cmplwi r12, 0
/* 80387758 003846B8 41 82 00 10 */ beq lbl_80387768
/* 8038775C 003846BC 80 6D AD 9C */ lwz r3, lbl_805A995C@sda21(r13)
/* 80387760 003846C0 7D 88 03 A6 */ mtlr r12
/* 80387764 003846C4 4E 80 00 21 */ blrl
lbl_80387768:
/* 80387768 003846C8 80 0D AD A0 */ lwz r0, lbl_805A9960@sda21(r13)
/* 8038776C 003846CC 28 00 00 00 */ cmplwi r0, 0
/* 80387770 003846D0 41 82 00 F4 */ beq lbl_80387864
/* 80387774 003846D4 80 0D AD C8 */ lwz r0, lbl_805A9988@sda21(r13)
/* 80387778 003846D8 28 00 00 01 */ cmplwi r0, 1
/* 8038777C 003846DC 40 82 00 10 */ bne lbl_8038778C
/* 80387780 003846E0 48 00 1B B1 */ bl getCurrentFieldEvenOdd
/* 80387784 003846E4 28 03 00 00 */ cmplwi r3, 0
/* 80387788 003846E8 41 82 00 C4 */ beq lbl_8038784C
lbl_8038778C:
/* 8038778C 003846EC 3C 60 CC 00 */ lis r3, 0xCC002000@ha
/* 80387790 003846F0 3B A3 20 00 */ addi r29, r3, 0xCC002000@l
/* 80387794 003846F4 48 00 00 78 */ b lbl_8038780C
lbl_80387798:
/* 80387798 003846F8 80 6D AD D0 */ lwz r3, lbl_805A9990@sda21(r13)
/* 8038779C 003846FC 38 A0 00 20 */ li r5, 0x20
/* 803877A0 00384700 83 6D AD D4 */ lwz r27, lbl_805A9994@sda21(r13)
/* 803877A4 00384704 38 9B 00 00 */ addi r4, r27, 0
/* 803877A8 00384708 48 00 27 71 */ bl __shr2u
/* 803877AC 0038470C 7C 84 00 34 */ cntlzw r4, r4
/* 803877B0 00384710 2C 04 00 20 */ cmpwi r4, 0x20
/* 803877B4 00384714 38 00 FF FF */ li r0, -1
/* 803877B8 00384718 7F 60 00 38 */ and r0, r27, r0
/* 803877BC 0038471C 40 80 00 08 */ bge lbl_803877C4
/* 803877C0 00384720 48 00 00 0C */ b lbl_803877CC
lbl_803877C4:
/* 803877C4 00384724 7C 03 00 34 */ cntlzw r3, r0
/* 803877C8 00384728 38 83 00 20 */ addi r4, r3, 0x20
lbl_803877CC:
/* 803877CC 0038472C 54 86 08 3C */ slwi r6, r4, 1
/* 803877D0 00384730 7C 7F 32 14 */ add r3, r31, r6
/* 803877D4 00384734 A0 03 00 78 */ lhz r0, 0x78(r3)
/* 803877D8 00384738 20 A4 00 3F */ subfic r5, r4, 0x3f
/* 803877DC 0038473C 38 60 00 00 */ li r3, 0
/* 803877E0 00384740 7C 1D 33 2E */ sthx r0, r29, r6
/* 803877E4 00384744 38 80 00 01 */ li r4, 1
/* 803877E8 00384748 48 00 27 0D */ bl __shl2i
/* 803877EC 0038474C 80 0D AD D0 */ lwz r0, lbl_805A9990@sda21(r13)
/* 803877F0 00384750 7C 65 18 F8 */ nor r5, r3, r3
/* 803877F4 00384754 7C 84 20 F8 */ nor r4, r4, r4
/* 803877F8 00384758 80 6D AD D4 */ lwz r3, lbl_805A9994@sda21(r13)
/* 803877FC 0038475C 7C 00 28 38 */ and r0, r0, r5
/* 80387800 00384760 7C 63 20 38 */ and r3, r3, r4
/* 80387804 00384764 90 6D AD D4 */ stw r3, lbl_805A9994@sda21(r13)
/* 80387808 00384768 90 0D AD D0 */ stw r0, lbl_805A9990@sda21(r13)
lbl_8038780C:
/* 8038780C 0038476C 80 0D AD D0 */ lwz r0, lbl_805A9990@sda21(r13)
/* 80387810 00384770 38 80 00 00 */ li r4, 0
/* 80387814 00384774 80 6D AD D4 */ lwz r3, lbl_805A9994@sda21(r13)
/* 80387818 00384778 7C 00 22 78 */ xor r0, r0, r4
/* 8038781C 0038477C 7C 63 22 78 */ xor r3, r3, r4
/* 80387820 00384780 7C 60 03 79 */ or. r0, r3, r0
/* 80387824 00384784 40 82 FF 74 */ bne lbl_80387798
/* 80387828 00384788 90 8D AD C8 */ stw r4, lbl_805A9988@sda21(r13)
/* 8038782C 0038478C 38 80 00 01 */ li r4, 1
/* 80387830 00384790 80 0D AD E0 */ lwz r0, lbl_805A99A0@sda21(r13)
/* 80387834 00384794 80 7F 01 44 */ lwz r3, 0x144(r31)
/* 80387838 00384798 90 6D AD D8 */ stw r3, lbl_805A9998@sda21(r13)
/* 8038783C 0038479C 80 7F 01 18 */ lwz r3, 0x118(r31)
/* 80387840 003847A0 90 6D AD DC */ stw r3, lbl_805A999C@sda21(r13)
/* 80387844 003847A4 90 0D AD E4 */ stw r0, lbl_805A99A4@sda21(r13)
/* 80387848 003847A8 48 00 00 08 */ b lbl_80387850
lbl_8038784C:
/* 8038784C 003847AC 38 80 00 00 */ li r4, 0
lbl_80387850:
/* 80387850 003847B0 2C 04 00 00 */ cmpwi r4, 0
/* 80387854 003847B4 41 82 00 10 */ beq lbl_80387864
/* 80387858 003847B8 38 00 00 00 */ li r0, 0
/* 8038785C 003847BC 90 0D AD A0 */ stw r0, lbl_805A9960@sda21(r13)
/* 80387860 003847C0 48 03 87 91 */ bl SIRefreshSamplingRate
lbl_80387864:
/* 80387864 003847C4 80 0D AD B0 */ lwz r0, lbl_805A9970@sda21(r13)
/* 80387868 003847C8 28 00 00 00 */ cmplwi r0, 0
/* 8038786C 003847CC 41 82 00 1C */ beq lbl_80387888
/* 80387870 003847D0 38 61 00 18 */ addi r3, r1, 0x18
/* 80387874 003847D4 4B FF 7D A1 */ bl OSClearContext
/* 80387878 003847D8 81 8D AD B0 */ lwz r12, lbl_805A9970@sda21(r13)
/* 8038787C 003847DC 80 6D AD 9C */ lwz r3, lbl_805A995C@sda21(r13)
/* 80387880 003847E0 7D 88 03 A6 */ mtlr r12
/* 80387884 003847E4 4E 80 00 21 */ blrl
lbl_80387888:
/* 80387888 003847E8 38 6D AD A4 */ addi r3, r13, lbl_805A9964@sda21
/* 8038788C 003847EC 4B FF D9 6D */ bl OSWakeupThread
/* 80387890 003847F0 38 61 00 18 */ addi r3, r1, 0x18
/* 80387894 003847F4 4B FF 7D 81 */ bl OSClearContext
/* 80387898 003847F8 7F C3 F3 78 */ mr r3, r30
/* 8038789C 003847FC 4B FF 7B 81 */ bl OSSetCurrentContext
lbl_803878A0:
/* 803878A0 00384800 BB 61 02 E4 */ lmw r27, 0x2e4(r1)
/* 803878A4 00384804 80 01 02 FC */ lwz r0, 0x2fc(r1)
/* 803878A8 00384808 38 21 02 F8 */ addi r1, r1, 0x2f8
/* 803878AC 0038480C 7C 08 03 A6 */ mtlr r0
/* 803878B0 00384810 4E 80 00 20 */ blr
.global VISetPreRetraceCallback
VISetPreRetraceCallback:
/* 803878B4 00384814 7C 08 02 A6 */ mflr r0
/* 803878B8 00384818 90 01 00 04 */ stw r0, 4(r1)
/* 803878BC 0038481C 94 21 FF E8 */ stwu r1, -0x18(r1)
/* 803878C0 00384820 93 E1 00 14 */ stw r31, 0x14(r1)
/* 803878C4 00384824 93 C1 00 10 */ stw r30, 0x10(r1)
/* 803878C8 00384828 7C 7E 1B 78 */ mr r30, r3
/* 803878CC 0038482C 83 ED AD AC */ lwz r31, lbl_805A996C@sda21(r13)
/* 803878D0 00384830 4B FF 9D 91 */ bl OSDisableInterrupts
/* 803878D4 00384834 93 CD AD AC */ stw r30, lbl_805A996C@sda21(r13)
/* 803878D8 00384838 4B FF 9D B1 */ bl OSRestoreInterrupts
/* 803878DC 0038483C 7F E3 FB 78 */ mr r3, r31
/* 803878E0 00384840 80 01 00 1C */ lwz r0, 0x1c(r1)
/* 803878E4 00384844 83 E1 00 14 */ lwz r31, 0x14(r1)
/* 803878E8 00384848 83 C1 00 10 */ lwz r30, 0x10(r1)
/* 803878EC 0038484C 38 21 00 18 */ addi r1, r1, 0x18
/* 803878F0 00384850 7C 08 03 A6 */ mtlr r0
/* 803878F4 00384854 4E 80 00 20 */ blr
.global VISetPostRetraceCallback
VISetPostRetraceCallback:
/* 803878F8 00384858 7C 08 02 A6 */ mflr r0
/* 803878FC 0038485C 90 01 00 04 */ stw r0, 4(r1)
/* 80387900 00384860 94 21 FF E8 */ stwu r1, -0x18(r1)
/* 80387904 00384864 93 E1 00 14 */ stw r31, 0x14(r1)
/* 80387908 00384868 93 C1 00 10 */ stw r30, 0x10(r1)
/* 8038790C 0038486C 7C 7E 1B 78 */ mr r30, r3
/* 80387910 00384870 83 ED AD B0 */ lwz r31, lbl_805A9970@sda21(r13)
/* 80387914 00384874 4B FF 9D 4D */ bl OSDisableInterrupts
/* 80387918 00384878 93 CD AD B0 */ stw r30, lbl_805A9970@sda21(r13)
/* 8038791C 0038487C 4B FF 9D 6D */ bl OSRestoreInterrupts
/* 80387920 00384880 7F E3 FB 78 */ mr r3, r31
/* 80387924 00384884 80 01 00 1C */ lwz r0, 0x1c(r1)
/* 80387928 00384888 83 E1 00 14 */ lwz r31, 0x14(r1)
/* 8038792C 0038488C 83 C1 00 10 */ lwz r30, 0x10(r1)
/* 80387930 00384890 38 21 00 18 */ addi r1, r1, 0x18
/* 80387934 00384894 7C 08 03 A6 */ mtlr r0
/* 80387938 00384898 4E 80 00 20 */ blr
.global getTiming
getTiming:
/* 8038793C 0038489C 28 03 00 1A */ cmplwi r3, 0x1a
/* 80387940 003848A0 3C 80 80 3F */ lis r4, lbl_803F23A8@ha
/* 80387944 003848A4 38 A4 23 A8 */ addi r5, r4, lbl_803F23A8@l
/* 80387948 003848A8 41 81 00 8C */ bgt lbl_803879D4
/* 8038794C 003848AC 3C 80 80 3F */ lis r4, lbl_803F259C@ha
/* 80387950 003848B0 38 84 25 9C */ addi r4, r4, lbl_803F259C@l
/* 80387954 003848B4 54 60 10 3A */ slwi r0, r3, 2
/* 80387958 003848B8 7C 04 00 2E */ lwzx r0, r4, r0
/* 8038795C 003848BC 7C 09 03 A6 */ mtctr r0
/* 80387960 003848C0 4E 80 04 20 */ bctr
lbl_80387964:
/* 80387964 003848C4 38 65 00 44 */ addi r3, r5, 0x44
/* 80387968 003848C8 4E 80 00 20 */ blr
lbl_8038796C:
/* 8038796C 003848CC 38 65 00 6A */ addi r3, r5, 0x6a
/* 80387970 003848D0 4E 80 00 20 */ blr
lbl_80387974:
/* 80387974 003848D4 38 65 00 90 */ addi r3, r5, 0x90
/* 80387978 003848D8 4E 80 00 20 */ blr
lbl_8038797C:
/* 8038797C 003848DC 38 65 00 B6 */ addi r3, r5, 0xb6
/* 80387980 003848E0 4E 80 00 20 */ blr
lbl_80387984:
/* 80387984 003848E4 38 65 00 44 */ addi r3, r5, 0x44
/* 80387988 003848E8 4E 80 00 20 */ blr
lbl_8038798C:
/* 8038798C 003848EC 38 65 00 6A */ addi r3, r5, 0x6a
/* 80387990 003848F0 4E 80 00 20 */ blr
lbl_80387994:
/* 80387994 003848F4 38 65 00 DC */ addi r3, r5, 0xdc
/* 80387998 003848F8 4E 80 00 20 */ blr
lbl_8038799C:
/* 8038799C 003848FC 38 65 01 02 */ addi r3, r5, 0x102
/* 803879A0 00384900 4E 80 00 20 */ blr
lbl_803879A4:
/* 803879A4 00384904 38 65 01 28 */ addi r3, r5, 0x128
/* 803879A8 00384908 4E 80 00 20 */ blr
lbl_803879AC:
/* 803879AC 0038490C 38 65 01 4E */ addi r3, r5, 0x14e
/* 803879B0 00384910 4E 80 00 20 */ blr
lbl_803879B4:
/* 803879B4 00384914 38 65 00 90 */ addi r3, r5, 0x90
/* 803879B8 00384918 4E 80 00 20 */ blr
lbl_803879BC:
/* 803879BC 0038491C 38 65 00 B6 */ addi r3, r5, 0xb6
/* 803879C0 00384920 4E 80 00 20 */ blr
lbl_803879C4:
/* 803879C4 00384924 38 65 01 74 */ addi r3, r5, 0x174
/* 803879C8 00384928 4E 80 00 20 */ blr
lbl_803879CC:
/* 803879CC 0038492C 38 65 01 9A */ addi r3, r5, 0x19a
/* 803879D0 00384930 4E 80 00 20 */ blr
lbl_803879D4:
/* 803879D4 00384934 38 60 00 00 */ li r3, 0
/* 803879D8 00384938 4E 80 00 20 */ blr
.global __VIInit
__VIInit:
/* 803879DC 0038493C 7C 08 02 A6 */ mflr r0
/* 803879E0 00384940 90 01 00 04 */ stw r0, 4(r1)
/* 803879E4 00384944 94 21 FF D0 */ stwu r1, -0x30(r1)
/* 803879E8 00384948 93 E1 00 2C */ stw r31, 0x2c(r1)
/* 803879EC 0038494C 54 7F F0 BE */ srwi r31, r3, 2
/* 803879F0 00384950 93 C1 00 28 */ stw r30, 0x28(r1)
/* 803879F4 00384954 93 A1 00 24 */ stw r29, 0x24(r1)
/* 803879F8 00384958 3B A3 00 00 */ addi r29, r3, 0
/* 803879FC 0038495C 3C 60 80 00 */ lis r3, 0x800000CC@ha
/* 80387A00 00384960 93 E3 00 CC */ stw r31, 0x800000CC@l(r3)
/* 80387A04 00384964 38 7D 00 00 */ addi r3, r29, 0
/* 80387A08 00384968 57 BE 07 BC */ rlwinm r30, r29, 0, 0x1e, 0x1e
/* 80387A0C 0038496C 4B FF FF 31 */ bl getTiming
/* 80387A10 00384970 3C 80 CC 00 */ lis r4, 0xCC002000@ha
/* 80387A14 00384974 38 00 00 02 */ li r0, 2
/* 80387A18 00384978 38 A4 20 00 */ addi r5, r4, 0xCC002000@l
/* 80387A1C 0038497C B4 05 00 02 */ sthu r0, 2(r5)
/* 80387A20 00384980 38 00 00 00 */ li r0, 0
/* 80387A24 00384984 90 01 00 1C */ stw r0, 0x1c(r1)
/* 80387A28 00384988 80 01 00 1C */ lwz r0, 0x1c(r1)
/* 80387A2C 0038498C 28 00 03 E8 */ cmplwi r0, 0x3e8
/* 80387A30 00384990 40 80 00 20 */ bge lbl_80387A50
/* 80387A34 00384994 48 00 00 10 */ b lbl_80387A44
lbl_80387A38:
/* 80387A38 00384998 80 81 00 1C */ lwz r4, 0x1c(r1)
/* 80387A3C 0038499C 38 04 00 08 */ addi r0, r4, 8
/* 80387A40 003849A0 90 01 00 1C */ stw r0, 0x1c(r1)
lbl_80387A44:
/* 80387A44 003849A4 80 01 00 1C */ lwz r0, 0x1c(r1)
/* 80387A48 003849A8 28 00 03 E8 */ cmplwi r0, 0x3e8
/* 80387A4C 003849AC 41 80 FF EC */ blt lbl_80387A38
lbl_80387A50:
/* 80387A50 003849B0 38 00 00 00 */ li r0, 0
/* 80387A54 003849B4 B0 05 00 00 */ sth r0, 0(r5)
/* 80387A58 003849B8 3D 80 CC 00 */ lis r12, 0xCC002006@ha
/* 80387A5C 003849BC 39 00 28 28 */ li r8, 0x2828
/* 80387A60 003849C0 A0 C3 00 1A */ lhz r6, 0x1a(r3)
/* 80387A64 003849C4 38 E0 00 01 */ li r7, 1
/* 80387A68 003849C8 2C 1D 00 02 */ cmpwi r29, 2
/* 80387A6C 003849CC B0 CC 20 06 */ sth r6, 0xCC002006@l(r12)
/* 80387A70 003849D0 38 C0 10 01 */ li r6, 0x1001
/* 80387A74 003849D4 38 8C 20 00 */ addi r4, r12, 0x2000
/* 80387A78 003849D8 89 23 00 1D */ lbz r9, 0x1d(r3)
/* 80387A7C 003849DC 89 43 00 1E */ lbz r10, 0x1e(r3)
/* 80387A80 003849E0 51 2A 44 2E */ rlwimi r10, r9, 8, 0x10, 0x17
/* 80387A84 003849E4 B1 4C 20 04 */ sth r10, 0x2004(r12)
/* 80387A88 003849E8 89 23 00 1F */ lbz r9, 0x1f(r3)
/* 80387A8C 003849EC 89 43 00 1C */ lbz r10, 0x1c(r3)
/* 80387A90 003849F0 55 29 38 30 */ slwi r9, r9, 7
/* 80387A94 003849F4 7D 49 4B 78 */ or r9, r10, r9
/* 80387A98 003849F8 B1 2C 20 0A */ sth r9, 0x200a(r12)
/* 80387A9C 003849FC A1 23 00 20 */ lhz r9, 0x20(r3)
/* 80387AA0 00384A00 55 29 0C 3C */ rlwinm r9, r9, 1, 0x10, 0x1e
/* 80387AA4 00384A04 B1 2C 20 08 */ sth r9, 0x2008(r12)
/* 80387AA8 00384A08 A1 23 00 02 */ lhz r9, 2(r3)
/* 80387AAC 00384A0C 89 63 00 00 */ lbz r11, 0(r3)
/* 80387AB0 00384A10 55 29 08 3C */ slwi r9, r9, 1
/* 80387AB4 00384A14 A1 43 00 04 */ lhz r10, 4(r3)
/* 80387AB8 00384A18 39 29 FF FE */ addi r9, r9, -2
/* 80387ABC 00384A1C B1 6C 20 00 */ sth r11, 0x2000(r12)
/* 80387AC0 00384A20 7D 2A 4A 14 */ add r9, r10, r9
/* 80387AC4 00384A24 B1 2C 20 0E */ sth r9, 0x200e(r12)
/* 80387AC8 00384A28 A1 23 00 08 */ lhz r9, 8(r3)
/* 80387ACC 00384A2C 39 29 00 02 */ addi r9, r9, 2
/* 80387AD0 00384A30 B1 2C 20 0C */ sth r9, 0x200c(r12)
/* 80387AD4 00384A34 A1 23 00 02 */ lhz r9, 2(r3)
/* 80387AD8 00384A38 A1 43 00 06 */ lhz r10, 6(r3)
/* 80387ADC 00384A3C 55 29 08 3C */ slwi r9, r9, 1
/* 80387AE0 00384A40 39 29 FF FE */ addi r9, r9, -2
/* 80387AE4 00384A44 7D 2A 4A 14 */ add r9, r10, r9
/* 80387AE8 00384A48 B1 2C 20 12 */ sth r9, 0x2012(r12)
/* 80387AEC 00384A4C A1 23 00 0A */ lhz r9, 0xa(r3)
/* 80387AF0 00384A50 39 29 00 02 */ addi r9, r9, 2
/* 80387AF4 00384A54 B1 2C 20 10 */ sth r9, 0x2010(r12)
/* 80387AF8 00384A58 A1 23 00 10 */ lhz r9, 0x10(r3)
/* 80387AFC 00384A5C 89 43 00 0C */ lbz r10, 0xc(r3)
/* 80387B00 00384A60 55 29 28 34 */ slwi r9, r9, 5
/* 80387B04 00384A64 7D 49 4B 78 */ or r9, r10, r9
/* 80387B08 00384A68 B1 2C 20 16 */ sth r9, 0x2016(r12)
/* 80387B0C 00384A6C A1 23 00 14 */ lhz r9, 0x14(r3)
/* 80387B10 00384A70 89 43 00 0E */ lbz r10, 0xe(r3)
/* 80387B14 00384A74 55 29 28 34 */ slwi r9, r9, 5
/* 80387B18 00384A78 7D 49 4B 78 */ or r9, r10, r9
/* 80387B1C 00384A7C B1 2C 20 14 */ sth r9, 0x2014(r12)
/* 80387B20 00384A80 A1 23 00 12 */ lhz r9, 0x12(r3)
/* 80387B24 00384A84 89 43 00 0D */ lbz r10, 0xd(r3)
/* 80387B28 00384A88 55 29 28 34 */ slwi r9, r9, 5
/* 80387B2C 00384A8C 7D 49 4B 78 */ or r9, r10, r9
/* 80387B30 00384A90 B1 2C 20 1A */ sth r9, 0x201a(r12)
/* 80387B34 00384A94 A1 23 00 16 */ lhz r9, 0x16(r3)
/* 80387B38 00384A98 89 43 00 0F */ lbz r10, 0xf(r3)
/* 80387B3C 00384A9C 55 29 28 34 */ slwi r9, r9, 5
/* 80387B40 00384AA0 7D 49 4B 78 */ or r9, r10, r9
/* 80387B44 00384AA4 B1 2C 20 18 */ sth r9, 0x2018(r12)
/* 80387B48 00384AA8 B1 0C 20 48 */ sth r8, 0x2048(r12)
/* 80387B4C 00384AAC B0 EC 20 36 */ sth r7, 0x2036(r12)
/* 80387B50 00384AB0 B0 CC 20 34 */ sth r6, 0x2034(r12)
/* 80387B54 00384AB4 A0 C3 00 18 */ lhz r6, 0x18(r3)
/* 80387B58 00384AB8 A0 63 00 1A */ lhz r3, 0x1a(r3)
/* 80387B5C 00384ABC 7C C6 0E 70 */ srawi r6, r6, 1
/* 80387B60 00384AC0 38 63 00 01 */ addi r3, r3, 1
/* 80387B64 00384AC4 7C C6 01 94 */ addze r6, r6
/* 80387B68 00384AC8 B0 6C 20 32 */ sth r3, 0x2032(r12)
/* 80387B6C 00384ACC 38 C6 00 01 */ addi r6, r6, 1
/* 80387B70 00384AD0 60 C3 10 00 */ ori r3, r6, 0x1000
/* 80387B74 00384AD4 B0 6C 20 30 */ sth r3, 0x2030(r12)
/* 80387B78 00384AD8 41 82 00 30 */ beq lbl_80387BA8
/* 80387B7C 00384ADC 2C 1D 00 03 */ cmpwi r29, 3
/* 80387B80 00384AE0 41 82 00 28 */ beq lbl_80387BA8
/* 80387B84 00384AE4 2C 1D 00 1A */ cmpwi r29, 0x1a
/* 80387B88 00384AE8 41 82 00 20 */ beq lbl_80387BA8
/* 80387B8C 00384AEC 57 C3 10 3A */ slwi r3, r30, 2
/* 80387B90 00384AF0 60 66 00 01 */ ori r6, r3, 1
/* 80387B94 00384AF4 57 E3 40 2E */ slwi r3, r31, 8
/* 80387B98 00384AF8 7C C3 1B 78 */ or r3, r6, r3
/* 80387B9C 00384AFC B0 65 00 00 */ sth r3, 0(r5)
/* 80387BA0 00384B00 B0 04 00 6C */ sth r0, 0x6c(r4)
/* 80387BA4 00384B04 48 00 00 1C */ b lbl_80387BC0
lbl_80387BA8:
/* 80387BA8 00384B08 57 E0 40 2E */ slwi r0, r31, 8
/* 80387BAC 00384B0C 60 00 00 05 */ ori r0, r0, 5
/* 80387BB0 00384B10 B0 05 00 00 */ sth r0, 0(r5)
/* 80387BB4 00384B14 3C 60 CC 00 */ lis r3, 0xCC00206C@ha
/* 80387BB8 00384B18 38 00 00 01 */ li r0, 1
/* 80387BBC 00384B1C B0 03 20 6C */ sth r0, 0xCC00206C@l(r3)
lbl_80387BC0:
/* 80387BC0 00384B20 80 01 00 34 */ lwz r0, 0x34(r1)
/* 80387BC4 00384B24 83 E1 00 2C */ lwz r31, 0x2c(r1)
/* 80387BC8 00384B28 83 C1 00 28 */ lwz r30, 0x28(r1)
/* 80387BCC 00384B2C 83 A1 00 24 */ lwz r29, 0x24(r1)
/* 80387BD0 00384B30 38 21 00 30 */ addi r1, r1, 0x30
/* 80387BD4 00384B34 7C 08 03 A6 */ mtlr r0
/* 80387BD8 00384B38 4E 80 00 20 */ blr
.global VIInit
VIInit:
/* 80387BDC 00384B3C 7C 08 02 A6 */ mflr r0
/* 80387BE0 00384B40 3C 80 80 3F */ lis r4, lbl_803F23A8@ha
/* 80387BE4 00384B44 90 01 00 04 */ stw r0, 4(r1)
/* 80387BE8 00384B48 3C 60 80 54 */ lis r3, lbl_80542040@ha
/* 80387BEC 00384B4C 94 21 FF E8 */ stwu r1, -0x18(r1)
/* 80387BF0 00384B50 93 E1 00 14 */ stw r31, 0x14(r1)
/* 80387BF4 00384B54 93 C1 00 10 */ stw r30, 0x10(r1)
/* 80387BF8 00384B58 3B C3 20 40 */ addi r30, r3, lbl_80542040@l
/* 80387BFC 00384B5C 93 A1 00 0C */ stw r29, 0xc(r1)
/* 80387C00 00384B60 3B A4 23 A8 */ addi r29, r4, lbl_803F23A8@l
/* 80387C04 00384B64 93 81 00 08 */ stw r28, 8(r1)
/* 80387C08 00384B68 80 0D AD 98 */ lwz r0, lbl_805A9958@sda21(r13)
/* 80387C0C 00384B6C 2C 00 00 00 */ cmpwi r0, 0
/* 80387C10 00384B70 40 82 04 5C */ bne lbl_8038806C
/* 80387C14 00384B74 80 6D 9F B8 */ lwz r3, lbl_805A8B78@sda21(r13)
/* 80387C18 00384B78 4B FF 64 21 */ bl OSRegisterVersion
/* 80387C1C 00384B7C 38 00 00 01 */ li r0, 1
/* 80387C20 00384B80 90 0D AD 98 */ stw r0, lbl_805A9958@sda21(r13)
/* 80387C24 00384B84 3C 60 CC 00 */ lis r3, 0xCC002000@ha
/* 80387C28 00384B88 3B 83 20 00 */ addi r28, r3, 0xCC002000@l
/* 80387C2C 00384B8C 90 0D AD B4 */ stw r0, lbl_805A9974@sda21(r13)
/* 80387C30 00384B90 A4 1C 00 02 */ lhzu r0, 2(r28)
/* 80387C34 00384B94 54 00 07 FF */ clrlwi. r0, r0, 0x1f
/* 80387C38 00384B98 40 82 00 0C */ bne lbl_80387C44
/* 80387C3C 00384B9C 38 60 00 00 */ li r3, 0
/* 80387C40 00384BA0 4B FF FD 9D */ bl __VIInit
lbl_80387C44:
/* 80387C44 00384BA4 3B E0 00 00 */ li r31, 0
/* 80387C48 00384BA8 93 ED AD 9C */ stw r31, lbl_805A995C@sda21(r13)
/* 80387C4C 00384BAC 3C 60 CC 00 */ lis r3, 0xCC002000@ha
/* 80387C50 00384BB0 38 63 20 00 */ addi r3, r3, 0xCC002000@l
/* 80387C54 00384BB4 93 ED AD C4 */ stw r31, lbl_805A9984@sda21(r13)
/* 80387C58 00384BB8 38 00 02 80 */ li r0, 0x280
/* 80387C5C 00384BBC 93 ED AD C0 */ stw r31, lbl_805A9980@sda21(r13)
/* 80387C60 00384BC0 93 ED AD D4 */ stw r31, lbl_805A9994@sda21(r13)
/* 80387C64 00384BC4 93 ED AD D0 */ stw r31, lbl_805A9990@sda21(r13)
/* 80387C68 00384BC8 93 ED AD BC */ stw r31, lbl_805A997C@sda21(r13)
/* 80387C6C 00384BCC 93 ED AD C8 */ stw r31, lbl_805A9988@sda21(r13)
/* 80387C70 00384BD0 93 ED AD A0 */ stw r31, lbl_805A9960@sda21(r13)
/* 80387C74 00384BD4 A0 BD 01 C2 */ lhz r5, 0x1c2(r29)
/* 80387C78 00384BD8 A0 DD 01 C0 */ lhz r6, 0x1c0(r29)
/* 80387C7C 00384BDC 54 A5 54 2A */ rlwinm r5, r5, 0xa, 0x10, 0x15
/* 80387C80 00384BE0 7C C5 2B 78 */ or r5, r6, r5
/* 80387C84 00384BE4 B0 A3 00 4E */ sth r5, 0x4e(r3)
/* 80387C88 00384BE8 A0 DD 01 C2 */ lhz r6, 0x1c2(r29)
/* 80387C8C 00384BEC A0 BD 01 C4 */ lhz r5, 0x1c4(r29)
/* 80387C90 00384BF0 7C C6 36 70 */ srawi r6, r6, 6
/* 80387C94 00384BF4 54 A5 20 36 */ slwi r5, r5, 4
/* 80387C98 00384BF8 7C C5 2B 78 */ or r5, r6, r5
/* 80387C9C 00384BFC B0 A3 00 4C */ sth r5, 0x4c(r3)
/* 80387CA0 00384C00 A0 BD 01 C8 */ lhz r5, 0x1c8(r29)
/* 80387CA4 00384C04 A0 DD 01 C6 */ lhz r6, 0x1c6(r29)
/* 80387CA8 00384C08 54 A5 54 2A */ rlwinm r5, r5, 0xa, 0x10, 0x15
/* 80387CAC 00384C0C 7C C5 2B 78 */ or r5, r6, r5
/* 80387CB0 00384C10 B0 A3 00 52 */ sth r5, 0x52(r3)
/* 80387CB4 00384C14 A0 DD 01 C8 */ lhz r6, 0x1c8(r29)
/* 80387CB8 00384C18 A0 BD 01 CA */ lhz r5, 0x1ca(r29)
/* 80387CBC 00384C1C 7C C6 36 70 */ srawi r6, r6, 6
/* 80387CC0 00384C20 54 A5 20 36 */ slwi r5, r5, 4
/* 80387CC4 00384C24 7C C5 2B 78 */ or r5, r6, r5
/* 80387CC8 00384C28 B0 A3 00 50 */ sth r5, 0x50(r3)
/* 80387CCC 00384C2C A0 BD 01 CE */ lhz r5, 0x1ce(r29)
/* 80387CD0 00384C30 A0 DD 01 CC */ lhz r6, 0x1cc(r29)
/* 80387CD4 00384C34 54 A5 54 2A */ rlwinm r5, r5, 0xa, 0x10, 0x15
/* 80387CD8 00384C38 7C C5 2B 78 */ or r5, r6, r5
/* 80387CDC 00384C3C B0 A3 00 56 */ sth r5, 0x56(r3)
/* 80387CE0 00384C40 A0 BD 01 CE */ lhz r5, 0x1ce(r29)
/* 80387CE4 00384C44 A0 9D 01 D0 */ lhz r4, 0x1d0(r29)
/* 80387CE8 00384C48 7C A5 36 70 */ srawi r5, r5, 6
/* 80387CEC 00384C4C 54 84 20 36 */ slwi r4, r4, 4
/* 80387CF0 00384C50 7C A4 23 78 */ or r4, r5, r4
/* 80387CF4 00384C54 B0 83 00 54 */ sth r4, 0x54(r3)
/* 80387CF8 00384C58 A0 9D 01 D4 */ lhz r4, 0x1d4(r29)
/* 80387CFC 00384C5C A0 BD 01 D2 */ lhz r5, 0x1d2(r29)
/* 80387D00 00384C60 54 84 40 2E */ slwi r4, r4, 8
/* 80387D04 00384C64 7C A4 23 78 */ or r4, r5, r4
/* 80387D08 00384C68 B0 83 00 5A */ sth r4, 0x5a(r3)
/* 80387D0C 00384C6C A0 9D 01 D8 */ lhz r4, 0x1d8(r29)
/* 80387D10 00384C70 A0 BD 01 D6 */ lhz r5, 0x1d6(r29)
/* 80387D14 00384C74 54 84 40 2E */ slwi r4, r4, 8
/* 80387D18 00384C78 7C A4 23 78 */ or r4, r5, r4
/* 80387D1C 00384C7C B0 83 00 58 */ sth r4, 0x58(r3)
/* 80387D20 00384C80 A0 9D 01 DC */ lhz r4, 0x1dc(r29)
/* 80387D24 00384C84 A0 BD 01 DA */ lhz r5, 0x1da(r29)
/* 80387D28 00384C88 54 84 40 2E */ slwi r4, r4, 8
/* 80387D2C 00384C8C 7C A4 23 78 */ or r4, r5, r4
/* 80387D30 00384C90 B0 83 00 5E */ sth r4, 0x5e(r3)
/* 80387D34 00384C94 A0 9D 01 E0 */ lhz r4, 0x1e0(r29)
/* 80387D38 00384C98 A0 BD 01 DE */ lhz r5, 0x1de(r29)
/* 80387D3C 00384C9C 54 84 40 2E */ slwi r4, r4, 8
/* 80387D40 00384CA0 7C A4 23 78 */ or r4, r5, r4
/* 80387D44 00384CA4 B0 83 00 5C */ sth r4, 0x5c(r3)
/* 80387D48 00384CA8 A0 9D 01 E4 */ lhz r4, 0x1e4(r29)
/* 80387D4C 00384CAC A0 BD 01 E2 */ lhz r5, 0x1e2(r29)
/* 80387D50 00384CB0 54 84 40 2E */ slwi r4, r4, 8
/* 80387D54 00384CB4 7C A4 23 78 */ or r4, r5, r4
/* 80387D58 00384CB8 B0 83 00 62 */ sth r4, 0x62(r3)
/* 80387D5C 00384CBC A0 9D 01 E8 */ lhz r4, 0x1e8(r29)
/* 80387D60 00384CC0 A0 BD 01 E6 */ lhz r5, 0x1e6(r29)
/* 80387D64 00384CC4 54 84 40 2E */ slwi r4, r4, 8
/* 80387D68 00384CC8 7C A4 23 78 */ or r4, r5, r4
/* 80387D6C 00384CCC B0 83 00 60 */ sth r4, 0x60(r3)
/* 80387D70 00384CD0 A0 9D 01 EC */ lhz r4, 0x1ec(r29)
/* 80387D74 00384CD4 A0 BD 01 EA */ lhz r5, 0x1ea(r29)
/* 80387D78 00384CD8 54 84 40 2E */ slwi r4, r4, 8
/* 80387D7C 00384CDC 7C A4 23 78 */ or r4, r5, r4
/* 80387D80 00384CE0 B0 83 00 66 */ sth r4, 0x66(r3)
/* 80387D84 00384CE4 A0 9D 01 F0 */ lhz r4, 0x1f0(r29)
/* 80387D88 00384CE8 A0 BD 01 EE */ lhz r5, 0x1ee(r29)
/* 80387D8C 00384CEC 54 84 40 2E */ slwi r4, r4, 8
/* 80387D90 00384CF0 7C A4 23 78 */ or r4, r5, r4
/* 80387D94 00384CF4 B0 83 00 64 */ sth r4, 0x64(r3)
/* 80387D98 00384CF8 B0 03 00 70 */ sth r0, 0x70(r3)
/* 80387D9C 00384CFC 4B FF BD 39 */ bl __OSLockSram
/* 80387DA0 00384D00 88 03 00 10 */ lbz r0, 0x10(r3)
/* 80387DA4 00384D04 38 60 00 00 */ li r3, 0
/* 80387DA8 00384D08 7C 00 07 74 */ extsb r0, r0
/* 80387DAC 00384D0C B3 ED AD BA */ sth r31, lbl_805A997A@sda21(r13)
/* 80387DB0 00384D10 B0 0D AD B8 */ sth r0, lbl_805A9978@sda21(r13)
/* 80387DB4 00384D14 4B FF C0 E1 */ bl __OSUnlockSram
/* 80387DB8 00384D18 A3 BC 00 00 */ lhz r29, 0(r28)
/* 80387DBC 00384D1C 3C 60 80 00 */ lis r3, 0x800000CC@ha
/* 80387DC0 00384D20 80 63 00 CC */ lwz r3, 0x800000CC@l(r3)
/* 80387DC4 00384D24 38 9E 01 14 */ addi r4, r30, 0x114
/* 80387DC8 00384D28 57 A0 F7 FE */ rlwinm r0, r29, 0x1e, 0x1f, 0x1f
/* 80387DCC 00384D2C 90 1E 01 14 */ stw r0, 0x114(r30)
/* 80387DD0 00384D30 57 A0 C7 BE */ rlwinm r0, r29, 0x18, 0x1e, 0x1f
/* 80387DD4 00384D34 28 03 00 01 */ cmplwi r3, 1
/* 80387DD8 00384D38 90 1E 01 18 */ stw r0, 0x118(r30)
/* 80387DDC 00384D3C 3B 9E 01 18 */ addi r28, r30, 0x118
/* 80387DE0 00384D40 40 82 00 18 */ bne lbl_80387DF8
/* 80387DE4 00384D44 80 1C 00 00 */ lwz r0, 0(r28)
/* 80387DE8 00384D48 28 00 00 00 */ cmplwi r0, 0
/* 80387DEC 00384D4C 40 82 00 0C */ bne lbl_80387DF8
/* 80387DF0 00384D50 38 00 00 05 */ li r0, 5
/* 80387DF4 00384D54 90 1C 00 00 */ stw r0, 0(r28)
lbl_80387DF8:
/* 80387DF8 00384D58 80 7C 00 00 */ lwz r3, 0(r28)
/* 80387DFC 00384D5C 28 03 00 03 */ cmplwi r3, 3
/* 80387E00 00384D60 40 82 00 08 */ bne lbl_80387E08
/* 80387E04 00384D64 38 60 00 00 */ li r3, 0
lbl_80387E08:
/* 80387E08 00384D68 80 04 00 00 */ lwz r0, 0(r4)
/* 80387E0C 00384D6C 54 63 10 3A */ slwi r3, r3, 2
/* 80387E10 00384D70 7C 63 02 14 */ add r3, r3, r0
/* 80387E14 00384D74 4B FF FB 29 */ bl getTiming
/* 80387E18 00384D78 90 7E 01 44 */ stw r3, 0x144(r30)
/* 80387E1C 00384D7C 38 9E 01 44 */ addi r4, r30, 0x144
/* 80387E20 00384D80 38 00 02 80 */ li r0, 0x280
/* 80387E24 00384D84 B3 BE 00 02 */ sth r29, 2(r30)
/* 80387E28 00384D88 39 00 00 00 */ li r8, 0
/* 80387E2C 00384D8C 38 DE 00 F6 */ addi r6, r30, 0xf6
/* 80387E30 00384D90 80 84 00 00 */ lwz r4, 0(r4)
/* 80387E34 00384D94 38 7E 00 F2 */ addi r3, r30, 0xf2
/* 80387E38 00384D98 90 8D AD D8 */ stw r4, lbl_805A9998@sda21(r13)
/* 80387E3C 00384D9C 80 9C 00 00 */ lwz r4, 0(r28)
/* 80387E40 00384DA0 90 8D AD DC */ stw r4, lbl_805A999C@sda21(r13)
/* 80387E44 00384DA4 B0 1E 00 F4 */ sth r0, 0xf4(r30)
/* 80387E48 00384DA8 80 8D AD D8 */ lwz r4, lbl_805A9998@sda21(r13)
/* 80387E4C 00384DAC A4 04 00 02 */ lhzu r0, 2(r4)
/* 80387E50 00384DB0 54 00 0C 3C */ rlwinm r0, r0, 1, 0x10, 0x1e
/* 80387E54 00384DB4 B0 1E 00 F6 */ sth r0, 0xf6(r30)
/* 80387E58 00384DB8 A0 1E 00 F4 */ lhz r0, 0xf4(r30)
/* 80387E5C 00384DBC 20 00 02 D0 */ subfic r0, r0, 0x2d0
/* 80387E60 00384DC0 7C 00 0E 70 */ srawi r0, r0, 1
/* 80387E64 00384DC4 7C 00 01 94 */ addze r0, r0
/* 80387E68 00384DC8 B0 1E 00 F0 */ sth r0, 0xf0(r30)
/* 80387E6C 00384DCC B1 1E 00 F2 */ sth r8, 0xf2(r30)
/* 80387E70 00384DD0 A0 1E 00 F4 */ lhz r0, 0xf4(r30)
/* 80387E74 00384DD4 A8 FE 00 F0 */ lha r7, 0xf0(r30)
/* 80387E78 00384DD8 A8 AD AD B8 */ lha r5, lbl_805A9978@sda21(r13)
/* 80387E7C 00384DDC 20 00 02 D0 */ subfic r0, r0, 0x2d0
/* 80387E80 00384DE0 A1 24 00 00 */ lhz r9, 0(r4)
/* 80387E84 00384DE4 7C A7 2A 14 */ add r5, r7, r5
/* 80387E88 00384DE8 7C 05 00 00 */ cmpw r5, r0
/* 80387E8C 00384DEC 40 81 00 08 */ ble lbl_80387E94
/* 80387E90 00384DF0 48 00 00 18 */ b lbl_80387EA8
lbl_80387E94:
/* 80387E94 00384DF4 2C 05 00 00 */ cmpwi r5, 0
/* 80387E98 00384DF8 40 80 00 08 */ bge lbl_80387EA0
/* 80387E9C 00384DFC 48 00 00 08 */ b lbl_80387EA4
lbl_80387EA0:
/* 80387EA0 00384E00 7C A8 2B 78 */ mr r8, r5
lbl_80387EA4:
/* 80387EA4 00384E04 7D 00 43 78 */ mr r0, r8
lbl_80387EA8:
/* 80387EA8 00384E08 B0 1E 00 F8 */ sth r0, 0xf8(r30)
/* 80387EAC 00384E0C 39 1E 01 10 */ addi r8, r30, 0x110
/* 80387EB0 00384E10 80 1E 01 10 */ lwz r0, 0x110(r30)
/* 80387EB4 00384E14 2C 00 00 00 */ cmpwi r0, 0
/* 80387EB8 00384E18 40 82 00 0C */ bne lbl_80387EC4
/* 80387EBC 00384E1C 39 60 00 02 */ li r11, 2
/* 80387EC0 00384E20 48 00 00 08 */ b lbl_80387EC8
lbl_80387EC4:
/* 80387EC4 00384E24 39 60 00 01 */ li r11, 1
lbl_80387EC8:
/* 80387EC8 00384E28 A0 03 00 00 */ lhz r0, 0(r3)
/* 80387ECC 00384E2C A8 AD AD BA */ lha r5, lbl_805A997A@sda21(r13)
/* 80387ED0 00384E30 7C 07 07 34 */ extsh r7, r0
/* 80387ED4 00384E34 54 00 07 FE */ clrlwi r0, r0, 0x1f
/* 80387ED8 00384E38 7C E7 2A 14 */ add r7, r7, r5
/* 80387EDC 00384E3C 7C 07 00 00 */ cmpw r7, r0
/* 80387EE0 00384E40 40 81 00 08 */ ble lbl_80387EE8
/* 80387EE4 00384E44 48 00 00 08 */ b lbl_80387EEC
lbl_80387EE8:
/* 80387EE8 00384E48 7C 07 03 78 */ mr r7, r0
lbl_80387EEC:
/* 80387EEC 00384E4C B0 FE 00 FA */ sth r7, 0xfa(r30)
/* 80387EF0 00384E50 7D 27 07 34 */ extsh r7, r9
/* 80387EF4 00384E54 54 E7 08 3C */ slwi r7, r7, 1
/* 80387EF8 00384E58 A3 86 00 00 */ lhz r28, 0(r6)
/* 80387EFC 00384E5C 7D 80 38 50 */ subf r12, r0, r7
/* 80387F00 00384E60 A9 43 00 00 */ lha r10, 0(r3)
/* 80387F04 00384E64 7F 87 07 34 */ extsh r7, r28
/* 80387F08 00384E68 7D 27 2A 14 */ add r9, r7, r5
/* 80387F0C 00384E6C 7D 2A 4A 14 */ add r9, r10, r9
/* 80387F10 00384E70 7C EC 48 51 */ subf. r7, r12, r9
/* 80387F14 00384E74 40 81 00 0C */ ble lbl_80387F20
/* 80387F18 00384E78 7D 2C 48 50 */ subf r9, r12, r9
/* 80387F1C 00384E7C 48 00 00 08 */ b lbl_80387F24
lbl_80387F20:
/* 80387F20 00384E80 39 20 00 00 */ li r9, 0
lbl_80387F24:
/* 80387F24 00384E84 7D 4A 2A 14 */ add r10, r10, r5
/* 80387F28 00384E88 7C E0 50 51 */ subf. r7, r0, r10
/* 80387F2C 00384E8C 40 80 00 0C */ bge lbl_80387F38
/* 80387F30 00384E90 7C E0 50 50 */ subf r7, r0, r10
/* 80387F34 00384E94 48 00 00 08 */ b lbl_80387F3C
lbl_80387F38:
/* 80387F38 00384E98 38 E0 00 00 */ li r7, 0
lbl_80387F3C:
/* 80387F3C 00384E9C 7C FC 3A 14 */ add r7, r28, r7
/* 80387F40 00384EA0 7C E9 38 50 */ subf r7, r9, r7
/* 80387F44 00384EA4 B0 FE 00 FC */ sth r7, 0xfc(r30)
/* 80387F48 00384EA8 A8 E3 00 00 */ lha r7, 0(r3)
/* 80387F4C 00384EAC 7D 27 2A 14 */ add r9, r7, r5
/* 80387F50 00384EB0 7C E0 48 51 */ subf. r7, r0, r9
/* 80387F54 00384EB4 40 80 00 0C */ bge lbl_80387F60
/* 80387F58 00384EB8 7C E0 48 50 */ subf r7, r0, r9
/* 80387F5C 00384EBC 48 00 00 08 */ b lbl_80387F64
lbl_80387F60:
/* 80387F60 00384EC0 38 E0 00 00 */ li r7, 0
lbl_80387F64:
/* 80387F64 00384EC4 7D 47 5B D6 */ divw r10, r7, r11
/* 80387F68 00384EC8 38 FE 01 08 */ addi r7, r30, 0x108
/* 80387F6C 00384ECC A1 3E 01 08 */ lhz r9, 0x108(r30)
/* 80387F70 00384ED0 7D 2A 48 50 */ subf r9, r10, r9
/* 80387F74 00384ED4 B1 3E 00 FE */ sth r9, 0xfe(r30)
/* 80387F78 00384ED8 A8 C6 00 00 */ lha r6, 0(r6)
/* 80387F7C 00384EDC A9 23 00 00 */ lha r9, 0(r3)
/* 80387F80 00384EE0 7C C6 2A 14 */ add r6, r6, r5
/* 80387F84 00384EE4 7C C9 32 14 */ add r6, r9, r6
/* 80387F88 00384EE8 7C 6C 30 51 */ subf. r3, r12, r6
/* 80387F8C 00384EEC 40 81 00 0C */ ble lbl_80387F98
/* 80387F90 00384EF0 7C CC 30 50 */ subf r6, r12, r6
/* 80387F94 00384EF4 48 00 00 08 */ b lbl_80387F9C
lbl_80387F98:
/* 80387F98 00384EF8 38 C0 00 00 */ li r6, 0
lbl_80387F9C:
/* 80387F9C 00384EFC 7C A9 2A 14 */ add r5, r9, r5
/* 80387FA0 00384F00 7C 60 28 51 */ subf. r3, r0, r5
/* 80387FA4 00384F04 40 80 00 0C */ bge lbl_80387FB0
/* 80387FA8 00384F08 7C 00 28 50 */ subf r0, r0, r5
/* 80387FAC 00384F0C 48 00 00 08 */ b lbl_80387FB4
lbl_80387FB0:
/* 80387FB0 00384F10 38 00 00 00 */ li r0, 0
lbl_80387FB4:
/* 80387FB4 00384F14 7C 00 5B D6 */ divw r0, r0, r11
/* 80387FB8 00384F18 A0 7E 01 0C */ lhz r3, 0x10c(r30)
/* 80387FBC 00384F1C 7C 03 02 14 */ add r0, r3, r0
/* 80387FC0 00384F20 7C A6 5B D6 */ divw r5, r6, r11
/* 80387FC4 00384F24 7C 05 00 50 */ subf r0, r5, r0
/* 80387FC8 00384F28 B0 1E 01 00 */ sth r0, 0x100(r30)
/* 80387FCC 00384F2C 39 20 02 80 */ li r9, 0x280
/* 80387FD0 00384F30 3B 80 00 00 */ li r28, 0
/* 80387FD4 00384F34 B1 3E 01 02 */ sth r9, 0x102(r30)
/* 80387FD8 00384F38 38 A0 00 28 */ li r5, 0x28
/* 80387FDC 00384F3C 38 00 00 01 */ li r0, 1
/* 80387FE0 00384F40 A0 C4 00 00 */ lhz r6, 0(r4)
/* 80387FE4 00384F44 38 6D AD A4 */ addi r3, r13, lbl_805A9964@sda21
/* 80387FE8 00384F48 54 C6 0C 3C */ rlwinm r6, r6, 1, 0x10, 0x1e
/* 80387FEC 00384F4C B0 DE 01 04 */ sth r6, 0x104(r30)
/* 80387FF0 00384F50 B3 9E 01 06 */ sth r28, 0x106(r30)
/* 80387FF4 00384F54 B3 87 00 00 */ sth r28, 0(r7)
/* 80387FF8 00384F58 B1 3E 01 0A */ sth r9, 0x10a(r30)
/* 80387FFC 00384F5C A0 84 00 00 */ lhz r4, 0(r4)
/* 80388000 00384F60 54 84 0C 3C */ rlwinm r4, r4, 1, 0x10, 0x1e
/* 80388004 00384F64 B0 9E 01 0C */ sth r4, 0x10c(r30)
/* 80388008 00384F68 93 88 00 00 */ stw r28, 0(r8)
/* 8038800C 00384F6C 98 BE 01 1C */ stb r5, 0x11c(r30)
/* 80388010 00384F70 98 BE 01 1D */ stb r5, 0x11d(r30)
/* 80388014 00384F74 98 BE 01 1E */ stb r5, 0x11e(r30)
/* 80388018 00384F78 9B 9E 01 2C */ stb r28, 0x12c(r30)
/* 8038801C 00384F7C 90 1E 01 30 */ stw r0, 0x130(r30)
/* 80388020 00384F80 93 9E 01 34 */ stw r28, 0x134(r30)
/* 80388024 00384F84 4B FF C5 A1 */ bl OSInitThreadQueue
/* 80388028 00384F88 3C 60 CC 00 */ lis r3, 0xCC002030@ha
/* 8038802C 00384F8C A0 03 20 30 */ lhz r0, 0xCC002030@l(r3)
/* 80388030 00384F90 38 83 20 00 */ addi r4, r3, 0x2000
/* 80388034 00384F94 38 A3 20 00 */ addi r5, r3, 0x2000
/* 80388038 00384F98 54 00 04 7E */ clrlwi r0, r0, 0x11
/* 8038803C 00384F9C B0 04 00 30 */ sth r0, 0x30(r4)
/* 80388040 00384FA0 3C 60 80 38 */ lis r3, __VIRetraceHandler@ha
/* 80388044 00384FA4 38 83 76 84 */ addi r4, r3, __VIRetraceHandler@l
/* 80388048 00384FA8 A0 05 00 34 */ lhz r0, 0x34(r5)
/* 8038804C 00384FAC 38 60 00 18 */ li r3, 0x18
/* 80388050 00384FB0 54 00 04 7E */ clrlwi r0, r0, 0x11
/* 80388054 00384FB4 B0 05 00 34 */ sth r0, 0x34(r5)
/* 80388058 00384FB8 93 8D AD AC */ stw r28, lbl_805A996C@sda21(r13)
/* 8038805C 00384FBC 93 8D AD B0 */ stw r28, lbl_805A9970@sda21(r13)
/* 80388060 00384FC0 4B FF 96 4D */ bl __OSSetInterruptHandler
/* 80388064 00384FC4 38 60 00 80 */ li r3, 0x80
/* 80388068 00384FC8 4B FF 9A 49 */ bl __OSUnmaskInterrupts
lbl_8038806C:
/* 8038806C 00384FCC 80 01 00 1C */ lwz r0, 0x1c(r1)
/* 80388070 00384FD0 83 E1 00 14 */ lwz r31, 0x14(r1)
/* 80388074 00384FD4 83 C1 00 10 */ lwz r30, 0x10(r1)
/* 80388078 00384FD8 83 A1 00 0C */ lwz r29, 0xc(r1)
/* 8038807C 00384FDC 83 81 00 08 */ lwz r28, 8(r1)
/* 80388080 00384FE0 38 21 00 18 */ addi r1, r1, 0x18
/* 80388084 00384FE4 7C 08 03 A6 */ mtlr r0
/* 80388088 00384FE8 4E 80 00 20 */ blr
.global VIWaitForRetrace
VIWaitForRetrace:
/* 8038808C 00384FEC 7C 08 02 A6 */ mflr r0
/* 80388090 00384FF0 90 01 00 04 */ stw r0, 4(r1)
/* 80388094 00384FF4 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 80388098 00384FF8 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8038809C 00384FFC 93 C1 00 08 */ stw r30, 8(r1)
/* 803880A0 00385000 4B FF 95 C1 */ bl OSDisableInterrupts
/* 803880A4 00385004 83 CD AD 9C */ lwz r30, lbl_805A995C@sda21(r13)
/* 803880A8 00385008 7C 7F 1B 78 */ mr r31, r3
lbl_803880AC:
/* 803880AC 0038500C 38 6D AD A4 */ addi r3, r13, lbl_805A9964@sda21
/* 803880B0 00385010 4B FF D0 5D */ bl OSSleepThread
/* 803880B4 00385014 80 0D AD 9C */ lwz r0, lbl_805A995C@sda21(r13)
/* 803880B8 00385018 7C 1E 00 40 */ cmplw r30, r0
/* 803880BC 0038501C 41 82 FF F0 */ beq lbl_803880AC
/* 803880C0 00385020 7F E3 FB 78 */ mr r3, r31
/* 803880C4 00385024 4B FF 95 C5 */ bl OSRestoreInterrupts
/* 803880C8 00385028 80 01 00 14 */ lwz r0, 0x14(r1)
/* 803880CC 0038502C 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 803880D0 00385030 83 C1 00 08 */ lwz r30, 8(r1)
/* 803880D4 00385034 38 21 00 10 */ addi r1, r1, 0x10
/* 803880D8 00385038 7C 08 03 A6 */ mtlr r0
/* 803880DC 0038503C 4E 80 00 20 */ blr
.global setFbbRegs
setFbbRegs:
/* 803880E0 00385040 94 21 FF B8 */ stwu r1, -0x48(r1)
/* 803880E4 00385044 3D 20 80 54 */ lis r9, lbl_80542040@ha
/* 803880E8 00385048 39 29 20 40 */ addi r9, r9, lbl_80542040@l
/* 803880EC 0038504C 93 E1 00 44 */ stw r31, 0x44(r1)
/* 803880F0 00385050 89 03 00 2C */ lbz r8, 0x2c(r3)
/* 803880F4 00385054 A0 03 00 0E */ lhz r0, 0xe(r3)
/* 803880F8 00385058 55 1F 28 34 */ slwi r31, r8, 5
/* 803880FC 0038505C A1 03 00 16 */ lhz r8, 0x16(r3)
/* 80388100 00385060 7C 1F 01 D6 */ mullw r0, r31, r0
/* 80388104 00385064 81 63 00 20 */ lwz r11, 0x20(r3)
/* 80388108 00385068 81 43 00 30 */ lwz r10, 0x30(r3)
/* 8038810C 0038506C A1 83 00 0A */ lhz r12, 0xa(r3)
/* 80388110 00385070 55 08 08 34 */ rlwinm r8, r8, 1, 0, 0x1a
/* 80388114 00385074 7C 08 02 14 */ add r0, r8, r0
/* 80388118 00385078 7C 0A 02 14 */ add r0, r10, r0
/* 8038811C 0038507C 2C 0B 00 00 */ cmpwi r11, 0
/* 80388120 00385080 90 04 00 00 */ stw r0, 0(r4)
/* 80388124 00385084 40 82 00 0C */ bne lbl_80388130
/* 80388128 00385088 81 04 00 00 */ lwz r8, 0(r4)
/* 8038812C 0038508C 48 00 00 0C */ b lbl_80388138
lbl_80388130:
/* 80388130 00385090 80 04 00 00 */ lwz r0, 0(r4)
/* 80388134 00385094 7D 00 FA 14 */ add r8, r0, r31
lbl_80388138:
/* 80388138 00385098 7D 80 0E 70 */ srawi r0, r12, 1
/* 8038813C 0038509C 91 05 00 00 */ stw r8, 0(r5)
/* 80388140 003850A0 7C 00 01 94 */ addze r0, r0
/* 80388144 003850A4 54 00 08 3C */ slwi r0, r0, 1
/* 80388148 003850A8 7C 00 60 10 */ subfc r0, r0, r12
/* 8038814C 003850AC 2C 00 00 01 */ cmpwi r0, 1
/* 80388150 003850B0 40 82 00 14 */ bne lbl_80388164
/* 80388154 003850B4 81 04 00 00 */ lwz r8, 0(r4)
/* 80388158 003850B8 80 05 00 00 */ lwz r0, 0(r5)
/* 8038815C 003850BC 90 04 00 00 */ stw r0, 0(r4)
/* 80388160 003850C0 91 05 00 00 */ stw r8, 0(r5)
lbl_80388164:
/* 80388164 003850C4 80 04 00 00 */ lwz r0, 0(r4)
/* 80388168 003850C8 54 00 00 BE */ clrlwi r0, r0, 2
/* 8038816C 003850CC 90 04 00 00 */ stw r0, 0(r4)
/* 80388170 003850D0 80 05 00 00 */ lwz r0, 0(r5)
/* 80388174 003850D4 54 00 00 BE */ clrlwi r0, r0, 2
/* 80388178 003850D8 90 05 00 00 */ stw r0, 0(r5)
/* 8038817C 003850DC 80 03 00 44 */ lwz r0, 0x44(r3)
/* 80388180 003850E0 2C 00 00 00 */ cmpwi r0, 0
/* 80388184 003850E4 41 82 00 90 */ beq lbl_80388214
/* 80388188 003850E8 89 03 00 2C */ lbz r8, 0x2c(r3)
/* 8038818C 003850EC A0 03 00 0E */ lhz r0, 0xe(r3)
/* 80388190 003850F0 55 1F 28 34 */ slwi r31, r8, 5
/* 80388194 003850F4 A1 03 00 16 */ lhz r8, 0x16(r3)
/* 80388198 003850F8 7C 1F 01 D6 */ mullw r0, r31, r0
/* 8038819C 003850FC 81 63 00 20 */ lwz r11, 0x20(r3)
/* 803881A0 00385100 81 43 00 48 */ lwz r10, 0x48(r3)
/* 803881A4 00385104 A1 83 00 0A */ lhz r12, 0xa(r3)
/* 803881A8 00385108 55 08 08 34 */ rlwinm r8, r8, 1, 0, 0x1a
/* 803881AC 0038510C 7C 08 02 14 */ add r0, r8, r0
/* 803881B0 00385110 7C 0A 02 14 */ add r0, r10, r0
/* 803881B4 00385114 2C 0B 00 00 */ cmpwi r11, 0
/* 803881B8 00385118 90 06 00 00 */ stw r0, 0(r6)
/* 803881BC 0038511C 40 82 00 0C */ bne lbl_803881C8
/* 803881C0 00385120 81 06 00 00 */ lwz r8, 0(r6)
/* 803881C4 00385124 48 00 00 0C */ b lbl_803881D0
lbl_803881C8:
/* 803881C8 00385128 80 06 00 00 */ lwz r0, 0(r6)
/* 803881CC 0038512C 7D 00 FA 14 */ add r8, r0, r31
lbl_803881D0:
/* 803881D0 00385130 7D 80 0E 70 */ srawi r0, r12, 1
/* 803881D4 00385134 91 07 00 00 */ stw r8, 0(r7)
/* 803881D8 00385138 7C 00 01 94 */ addze r0, r0
/* 803881DC 0038513C 54 00 08 3C */ slwi r0, r0, 1
/* 803881E0 00385140 7C 00 60 10 */ subfc r0, r0, r12
/* 803881E4 00385144 2C 00 00 01 */ cmpwi r0, 1
/* 803881E8 00385148 40 82 00 14 */ bne lbl_803881FC
/* 803881EC 0038514C 81 06 00 00 */ lwz r8, 0(r6)
/* 803881F0 00385150 80 07 00 00 */ lwz r0, 0(r7)
/* 803881F4 00385154 90 06 00 00 */ stw r0, 0(r6)
/* 803881F8 00385158 91 07 00 00 */ stw r8, 0(r7)
lbl_803881FC:
/* 803881FC 0038515C 80 06 00 00 */ lwz r0, 0(r6)
/* 80388200 00385160 54 00 00 BE */ clrlwi r0, r0, 2
/* 80388204 00385164 90 06 00 00 */ stw r0, 0(r6)
/* 80388208 00385168 80 07 00 00 */ lwz r0, 0(r7)
/* 8038820C 0038516C 54 00 00 BE */ clrlwi r0, r0, 2
/* 80388210 00385170 90 07 00 00 */ stw r0, 0(r7)
lbl_80388214:
/* 80388214 00385174 80 04 00 00 */ lwz r0, 0(r4)
/* 80388218 00385178 3D 00 01 00 */ lis r8, 0x100
/* 8038821C 0038517C 7C 00 40 40 */ cmplw r0, r8
/* 80388220 00385180 40 80 00 30 */ bge lbl_80388250
/* 80388224 00385184 80 05 00 00 */ lwz r0, 0(r5)
/* 80388228 00385188 7C 00 40 40 */ cmplw r0, r8
/* 8038822C 0038518C 40 80 00 24 */ bge lbl_80388250
/* 80388230 00385190 80 06 00 00 */ lwz r0, 0(r6)
/* 80388234 00385194 7C 00 40 40 */ cmplw r0, r8
/* 80388238 00385198 40 80 00 18 */ bge lbl_80388250
/* 8038823C 0038519C 80 07 00 00 */ lwz r0, 0(r7)
/* 80388240 003851A0 7C 00 40 40 */ cmplw r0, r8
/* 80388244 003851A4 40 80 00 0C */ bge lbl_80388250
/* 80388248 003851A8 39 40 00 00 */ li r10, 0
/* 8038824C 003851AC 48 00 00 08 */ b lbl_80388254
lbl_80388250:
/* 80388250 003851B0 39 40 00 01 */ li r10, 1
lbl_80388254:
/* 80388254 003851B4 28 0A 00 00 */ cmplwi r10, 0
/* 80388258 003851B8 41 82 00 34 */ beq lbl_8038828C
/* 8038825C 003851BC 80 04 00 00 */ lwz r0, 0(r4)
/* 80388260 003851C0 54 00 D9 7E */ srwi r0, r0, 5
/* 80388264 003851C4 90 04 00 00 */ stw r0, 0(r4)
/* 80388268 003851C8 80 05 00 00 */ lwz r0, 0(r5)
/* 8038826C 003851CC 54 00 D9 7E */ srwi r0, r0, 5
/* 80388270 003851D0 90 05 00 00 */ stw r0, 0(r5)
/* 80388274 003851D4 80 06 00 00 */ lwz r0, 0(r6)
/* 80388278 003851D8 54 00 D9 7E */ srwi r0, r0, 5
/* 8038827C 003851DC 90 06 00 00 */ stw r0, 0(r6)
/* 80388280 003851E0 80 07 00 00 */ lwz r0, 0(r7)
/* 80388284 003851E4 54 00 D9 7E */ srwi r0, r0, 5
/* 80388288 003851E8 90 07 00 00 */ stw r0, 0(r7)
lbl_8038828C:
/* 8038828C 003851EC 80 04 00 00 */ lwz r0, 0(r4)
/* 80388290 003851F0 55 4B 60 26 */ slwi r11, r10, 0xc
/* 80388294 003851F4 3D 00 00 01 */ lis r8, 1
/* 80388298 003851F8 B0 09 00 1E */ sth r0, 0x1e(r9)
/* 8038829C 003851FC 3C 00 00 02 */ lis r0, 2
/* 803882A0 00385200 81 4D AD C0 */ lwz r10, lbl_805A9980@sda21(r13)
/* 803882A4 00385204 81 8D AD C4 */ lwz r12, lbl_805A9984@sda21(r13)
/* 803882A8 00385208 7D 4A 43 78 */ or r10, r10, r8
/* 803882AC 0038520C 91 8D AD C4 */ stw r12, lbl_805A9984@sda21(r13)
/* 803882B0 00385210 91 4D AD C0 */ stw r10, lbl_805A9980@sda21(r13)
/* 803882B4 00385214 81 44 00 00 */ lwz r10, 0(r4)
/* 803882B8 00385218 88 83 00 3C */ lbz r4, 0x3c(r3)
/* 803882BC 0038521C 55 4A 84 3E */ srwi r10, r10, 0x10
/* 803882C0 00385220 54 84 40 2E */ slwi r4, r4, 8
/* 803882C4 00385224 7D 44 23 78 */ or r4, r10, r4
/* 803882C8 00385228 7D 64 23 78 */ or r4, r11, r4
/* 803882CC 0038522C B0 89 00 1C */ sth r4, 0x1c(r9)
/* 803882D0 00385230 80 8D AD C0 */ lwz r4, lbl_805A9980@sda21(r13)
/* 803882D4 00385234 81 4D AD C4 */ lwz r10, lbl_805A9984@sda21(r13)
/* 803882D8 00385238 7C 80 03 78 */ or r0, r4, r0
/* 803882DC 0038523C 91 4D AD C4 */ stw r10, lbl_805A9984@sda21(r13)
/* 803882E0 00385240 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 803882E4 00385244 80 05 00 00 */ lwz r0, 0(r5)
/* 803882E8 00385248 B0 09 00 26 */ sth r0, 0x26(r9)
/* 803882EC 0038524C 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 803882F0 00385250 80 8D AD C4 */ lwz r4, lbl_805A9984@sda21(r13)
/* 803882F4 00385254 60 00 10 00 */ ori r0, r0, 0x1000
/* 803882F8 00385258 90 8D AD C4 */ stw r4, lbl_805A9984@sda21(r13)
/* 803882FC 0038525C 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388300 00385260 80 05 00 00 */ lwz r0, 0(r5)
/* 80388304 00385264 54 00 84 3E */ srwi r0, r0, 0x10
/* 80388308 00385268 B0 09 00 24 */ sth r0, 0x24(r9)
/* 8038830C 0038526C 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388310 00385270 80 8D AD C4 */ lwz r4, lbl_805A9984@sda21(r13)
/* 80388314 00385274 60 00 20 00 */ ori r0, r0, 0x2000
/* 80388318 00385278 90 8D AD C4 */ stw r4, lbl_805A9984@sda21(r13)
/* 8038831C 0038527C 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388320 00385280 80 03 00 44 */ lwz r0, 0x44(r3)
/* 80388324 00385284 2C 00 00 00 */ cmpwi r0, 0
/* 80388328 00385288 41 82 00 80 */ beq lbl_803883A8
/* 8038832C 0038528C 80 66 00 00 */ lwz r3, 0(r6)
/* 80388330 00385290 38 08 80 00 */ addi r0, r8, -32768
/* 80388334 00385294 B0 69 00 22 */ sth r3, 0x22(r9)
/* 80388338 00385298 80 6D AD C0 */ lwz r3, lbl_805A9980@sda21(r13)
/* 8038833C 0038529C 80 8D AD C4 */ lwz r4, lbl_805A9984@sda21(r13)
/* 80388340 003852A0 60 63 40 00 */ ori r3, r3, 0x4000
/* 80388344 003852A4 90 8D AD C4 */ stw r4, lbl_805A9984@sda21(r13)
/* 80388348 003852A8 90 6D AD C0 */ stw r3, lbl_805A9980@sda21(r13)
/* 8038834C 003852AC 80 66 00 00 */ lwz r3, 0(r6)
/* 80388350 003852B0 54 63 84 3E */ srwi r3, r3, 0x10
/* 80388354 003852B4 B0 69 00 20 */ sth r3, 0x20(r9)
/* 80388358 003852B8 80 6D AD C0 */ lwz r3, lbl_805A9980@sda21(r13)
/* 8038835C 003852BC 80 8D AD C4 */ lwz r4, lbl_805A9984@sda21(r13)
/* 80388360 003852C0 7C 60 03 78 */ or r0, r3, r0
/* 80388364 003852C4 90 8D AD C4 */ stw r4, lbl_805A9984@sda21(r13)
/* 80388368 003852C8 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 8038836C 003852CC 80 07 00 00 */ lwz r0, 0(r7)
/* 80388370 003852D0 B0 09 00 2A */ sth r0, 0x2a(r9)
/* 80388374 003852D4 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388378 003852D8 80 6D AD C4 */ lwz r3, lbl_805A9984@sda21(r13)
/* 8038837C 003852DC 60 00 04 00 */ ori r0, r0, 0x400
/* 80388380 003852E0 90 6D AD C4 */ stw r3, lbl_805A9984@sda21(r13)
/* 80388384 003852E4 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388388 003852E8 80 07 00 00 */ lwz r0, 0(r7)
/* 8038838C 003852EC 54 00 84 3E */ srwi r0, r0, 0x10
/* 80388390 003852F0 B0 09 00 28 */ sth r0, 0x28(r9)
/* 80388394 003852F4 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388398 003852F8 80 6D AD C4 */ lwz r3, lbl_805A9984@sda21(r13)
/* 8038839C 003852FC 60 00 08 00 */ ori r0, r0, 0x800
/* 803883A0 00385300 90 6D AD C4 */ stw r3, lbl_805A9984@sda21(r13)
/* 803883A4 00385304 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
lbl_803883A8:
/* 803883A8 00385308 83 E1 00 44 */ lwz r31, 0x44(r1)
/* 803883AC 0038530C 38 21 00 48 */ addi r1, r1, 0x48
/* 803883B0 00385310 4E 80 00 20 */ blr
.global setVerticalRegs
setVerticalRegs:
/* 803883B4 00385314 94 21 FF D8 */ stwu r1, -0x28(r1)
/* 803883B8 00385318 3D 60 80 54 */ lis r11, lbl_80542040@ha
/* 803883BC 0038531C 39 6B 20 40 */ addi r11, r11, lbl_80542040@l
/* 803883C0 00385320 93 E1 00 24 */ stw r31, 0x24(r1)
/* 803883C4 00385324 83 E1 00 30 */ lwz r31, 0x30(r1)
/* 803883C8 00385328 93 C1 00 20 */ stw r30, 0x20(r1)
/* 803883CC 0038532C 93 A1 00 1C */ stw r29, 0x1c(r1)
/* 803883D0 00385330 A0 0B 00 6C */ lhz r0, 0x6c(r11)
/* 803883D4 00385334 54 00 07 FF */ clrlwi. r0, r0, 0x1f
/* 803883D8 00385338 41 82 00 10 */ beq lbl_803883E8
/* 803883DC 0038533C 39 80 00 01 */ li r12, 1
/* 803883E0 00385340 3B A0 00 02 */ li r29, 2
/* 803883E4 00385344 48 00 00 0C */ b lbl_803883F0
lbl_803883E8:
/* 803883E8 00385348 39 80 00 02 */ li r12, 2
/* 803883EC 0038534C 3B A0 00 01 */ li r29, 1
lbl_803883F0:
/* 803883F0 00385350 54 7E 04 3E */ clrlwi r30, r3, 0x10
/* 803883F4 00385354 7F C0 0E 70 */ srawi r0, r30, 1
/* 803883F8 00385358 7C 00 01 94 */ addze r0, r0
/* 803883FC 0038535C 54 00 08 3C */ slwi r0, r0, 1
/* 80388400 00385360 7C 00 F0 11 */ subfc. r0, r0, r30
/* 80388404 00385364 40 82 00 3C */ bne lbl_80388440
/* 80388408 00385368 55 83 04 3E */ clrlwi r3, r12, 0x10
/* 8038840C 0038536C 54 C0 04 3E */ clrlwi r0, r6, 0x10
/* 80388410 00385370 7C 03 01 D6 */ mullw r0, r3, r0
/* 80388414 00385374 54 83 04 3E */ clrlwi r3, r4, 0x10
/* 80388418 00385378 7C 03 00 50 */ subf r0, r3, r0
/* 8038841C 0038537C 57 A3 04 3E */ clrlwi r3, r29, 0x10
/* 80388420 00385380 7F A3 F1 D6 */ mullw r29, r3, r30
/* 80388424 00385384 7C 1E 00 50 */ subf r0, r30, r0
/* 80388428 00385388 7F C3 01 D6 */ mullw r30, r3, r0
/* 8038842C 0038538C 7C 07 EA 14 */ add r0, r7, r29
/* 80388430 00385390 7C C9 F2 14 */ add r6, r9, r30
/* 80388434 00385394 7C 68 EA 14 */ add r3, r8, r29
/* 80388438 00385398 7C EA F2 14 */ add r7, r10, r30
/* 8038843C 0038539C 48 00 00 38 */ b lbl_80388474
lbl_80388440:
/* 80388440 003853A0 55 83 04 3E */ clrlwi r3, r12, 0x10
/* 80388444 003853A4 54 C0 04 3E */ clrlwi r0, r6, 0x10
/* 80388448 003853A8 7C 03 01 D6 */ mullw r0, r3, r0
/* 8038844C 003853AC 54 83 04 3E */ clrlwi r3, r4, 0x10
/* 80388450 003853B0 7C 03 00 50 */ subf r0, r3, r0
/* 80388454 003853B4 57 A3 04 3E */ clrlwi r3, r29, 0x10
/* 80388458 003853B8 7F A3 F1 D6 */ mullw r29, r3, r30
/* 8038845C 003853BC 7C 1E 00 50 */ subf r0, r30, r0
/* 80388460 003853C0 7F C3 01 D6 */ mullw r30, r3, r0
/* 80388464 003853C4 7C 08 EA 14 */ add r0, r8, r29
/* 80388468 003853C8 7C CA F2 14 */ add r6, r10, r30
/* 8038846C 003853CC 7C 67 EA 14 */ add r3, r7, r29
/* 80388470 003853D0 7C E9 F2 14 */ add r7, r9, r30
lbl_80388474:
/* 80388474 003853D4 54 88 04 3E */ clrlwi r8, r4, 0x10
/* 80388478 003853D8 55 84 04 3E */ clrlwi r4, r12, 0x10
/* 8038847C 003853DC 7C 88 23 D6 */ divw r4, r8, r4
/* 80388480 003853E0 2C 1F 00 00 */ cmpwi r31, 0
/* 80388484 003853E4 54 84 04 3E */ clrlwi r4, r4, 0x10
/* 80388488 003853E8 41 82 00 20 */ beq lbl_803884A8
/* 8038848C 003853EC 54 84 08 3C */ slwi r4, r4, 1
/* 80388490 003853F0 38 84 FF FE */ addi r4, r4, -2
/* 80388494 003853F4 7C 00 22 14 */ add r0, r0, r4
/* 80388498 003853F8 7C 63 22 14 */ add r3, r3, r4
/* 8038849C 003853FC 38 80 00 00 */ li r4, 0
/* 803884A0 00385400 38 C6 00 02 */ addi r6, r6, 2
/* 803884A4 00385404 38 E7 00 02 */ addi r7, r7, 2
lbl_803884A8:
/* 803884A8 00385408 54 A5 06 3E */ clrlwi r5, r5, 0x18
/* 803884AC 0038540C 54 84 23 36 */ rlwinm r4, r4, 4, 0xc, 0x1b
/* 803884B0 00385410 7C A4 23 78 */ or r4, r5, r4
/* 803884B4 00385414 B0 8B 00 00 */ sth r4, 0(r11)
/* 803884B8 00385418 3C 80 80 00 */ lis r4, 0x8000
/* 803884BC 0038541C 3D 20 01 00 */ lis r9, 0x100
/* 803884C0 00385420 80 AD AD C0 */ lwz r5, lbl_805A9980@sda21(r13)
/* 803884C4 00385424 3D 00 02 00 */ lis r8, 0x200
/* 803884C8 00385428 81 4D AD C4 */ lwz r10, lbl_805A9984@sda21(r13)
/* 803884CC 0038542C 7C A4 23 78 */ or r4, r5, r4
/* 803884D0 00385430 3C A0 00 40 */ lis r5, 0x40
/* 803884D4 00385434 91 4D AD C4 */ stw r10, lbl_805A9984@sda21(r13)
/* 803884D8 00385438 90 8D AD C0 */ stw r4, lbl_805A9980@sda21(r13)
/* 803884DC 0038543C 3C 80 00 80 */ lis r4, 0x80
/* 803884E0 00385440 B0 0B 00 0E */ sth r0, 0xe(r11)
/* 803884E4 00385444 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 803884E8 00385448 81 4D AD C4 */ lwz r10, lbl_805A9984@sda21(r13)
/* 803884EC 0038544C 7C 00 4B 78 */ or r0, r0, r9
/* 803884F0 00385450 91 4D AD C4 */ stw r10, lbl_805A9984@sda21(r13)
/* 803884F4 00385454 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 803884F8 00385458 B0 CB 00 0C */ sth r6, 0xc(r11)
/* 803884FC 0038545C 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388500 00385460 80 CD AD C4 */ lwz r6, lbl_805A9984@sda21(r13)
/* 80388504 00385464 7C 00 43 78 */ or r0, r0, r8
/* 80388508 00385468 90 CD AD C4 */ stw r6, lbl_805A9984@sda21(r13)
/* 8038850C 0038546C 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388510 00385470 B0 6B 00 12 */ sth r3, 0x12(r11)
/* 80388514 00385474 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388518 00385478 80 6D AD C4 */ lwz r3, lbl_805A9984@sda21(r13)
/* 8038851C 0038547C 7C 00 2B 78 */ or r0, r0, r5
/* 80388520 00385480 90 6D AD C4 */ stw r3, lbl_805A9984@sda21(r13)
/* 80388524 00385484 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388528 00385488 B0 EB 00 10 */ sth r7, 0x10(r11)
/* 8038852C 0038548C 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388530 00385490 80 6D AD C4 */ lwz r3, lbl_805A9984@sda21(r13)
/* 80388534 00385494 7C 00 23 78 */ or r0, r0, r4
/* 80388538 00385498 90 6D AD C4 */ stw r3, lbl_805A9984@sda21(r13)
/* 8038853C 0038549C 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388540 003854A0 83 E1 00 24 */ lwz r31, 0x24(r1)
/* 80388544 003854A4 83 C1 00 20 */ lwz r30, 0x20(r1)
/* 80388548 003854A8 83 A1 00 1C */ lwz r29, 0x1c(r1)
/* 8038854C 003854AC 38 21 00 28 */ addi r1, r1, 0x28
/* 80388550 003854B0 4E 80 00 20 */ blr
.global VIConfigure
VIConfigure:
/* 80388554 003854B4 7C 08 02 A6 */ mflr r0
/* 80388558 003854B8 3C A0 80 3F */ lis r5, lbl_803F23A8@ha
/* 8038855C 003854BC 90 01 00 04 */ stw r0, 4(r1)
/* 80388560 003854C0 3C 80 80 54 */ lis r4, lbl_80542040@ha
/* 80388564 003854C4 94 21 FF 88 */ stwu r1, -0x78(r1)
/* 80388568 003854C8 BD C1 00 30 */ stmw r14, 0x30(r1)
/* 8038856C 003854CC 3B E3 00 00 */ addi r31, r3, 0
/* 80388570 003854D0 39 E5 23 A8 */ addi r15, r5, lbl_803F23A8@l
/* 80388574 003854D4 3B A4 20 40 */ addi r29, r4, lbl_80542040@l
/* 80388578 003854D8 4B FF 90 E9 */ bl OSDisableInterrupts
/* 8038857C 003854DC 80 9F 00 00 */ lwz r4, 0(r31)
/* 80388580 003854E0 3B 9D 01 14 */ addi r28, r29, 0x114
/* 80388584 003854E4 80 1D 01 14 */ lwz r0, 0x114(r29)
/* 80388588 003854E8 39 C3 00 00 */ addi r14, r3, 0
/* 8038858C 003854EC 54 84 07 BE */ clrlwi r4, r4, 0x1e
/* 80388590 003854F0 7C 00 20 40 */ cmplw r0, r4
/* 80388594 003854F4 41 82 00 10 */ beq lbl_803885A4
/* 80388598 003854F8 38 00 00 01 */ li r0, 1
/* 8038859C 003854FC 90 0D AD BC */ stw r0, lbl_805A997C@sda21(r13)
/* 803885A0 00385500 90 9C 00 00 */ stw r4, 0(r28)
lbl_803885A4:
/* 803885A4 00385504 80 1F 00 00 */ lwz r0, 0(r31)
/* 803885A8 00385508 3C 60 80 00 */ lis r3, 0x800000CC@ha
/* 803885AC 0038550C 82 03 00 CC */ lwz r16, 0x800000CC@l(r3)
/* 803885B0 00385510 54 00 F0 BE */ srwi r0, r0, 2
/* 803885B4 00385514 28 00 00 04 */ cmplwi r0, 4
/* 803885B8 00385518 7C 11 03 78 */ mr r17, r0
/* 803885BC 0038551C 40 82 00 6C */ bne lbl_80388628
/* 803885C0 00385520 80 0D AD EC */ lwz r0, lbl_805A99AC@sda21(r13)
/* 803885C4 00385524 28 00 00 00 */ cmplwi r0, 0
/* 803885C8 00385528 40 82 00 60 */ bne lbl_80388628
/* 803885CC 0038552C 38 00 00 01 */ li r0, 1
/* 803885D0 00385530 4C C6 31 82 */ crclr 6
/* 803885D4 00385534 90 0D AD EC */ stw r0, lbl_805A99AC@sda21(r13)
/* 803885D8 00385538 38 6F 02 60 */ addi r3, r15, 0x260
/* 803885DC 0038553C 4B FF 73 D1 */ bl OSReport
/* 803885E0 00385540 38 6F 02 8C */ addi r3, r15, 0x28c
/* 803885E4 00385544 4C C6 31 82 */ crclr 6
/* 803885E8 00385548 4B FF 73 C5 */ bl OSReport
/* 803885EC 0038554C 38 6F 02 B8 */ addi r3, r15, 0x2b8
/* 803885F0 00385550 4C C6 31 82 */ crclr 6
/* 803885F4 00385554 4B FF 73 B9 */ bl OSReport
/* 803885F8 00385558 38 6F 02 E4 */ addi r3, r15, 0x2e4
/* 803885FC 0038555C 4C C6 31 82 */ crclr 6
/* 80388600 00385560 4B FF 73 AD */ bl OSReport
/* 80388604 00385564 38 6F 03 10 */ addi r3, r15, 0x310
/* 80388608 00385568 4C C6 31 82 */ crclr 6
/* 8038860C 0038556C 4B FF 73 A1 */ bl OSReport
/* 80388610 00385570 38 6F 03 3C */ addi r3, r15, 0x33c
/* 80388614 00385574 4C C6 31 82 */ crclr 6
/* 80388618 00385578 4B FF 73 95 */ bl OSReport
/* 8038861C 0038557C 38 6F 02 60 */ addi r3, r15, 0x260
/* 80388620 00385580 4C C6 31 82 */ crclr 6
/* 80388624 00385584 4B FF 73 89 */ bl OSReport
lbl_80388628:
/* 80388628 00385588 2C 10 00 02 */ cmpwi r16, 2
/* 8038862C 0038558C 41 82 00 30 */ beq lbl_8038865C
/* 80388630 00385590 40 80 00 14 */ bge lbl_80388644
/* 80388634 00385594 2C 10 00 00 */ cmpwi r16, 0
/* 80388638 00385598 41 82 00 24 */ beq lbl_8038865C
/* 8038863C 0038559C 40 80 00 3C */ bge lbl_80388678
/* 80388640 003855A0 48 00 00 48 */ b lbl_80388688
lbl_80388644:
/* 80388644 003855A4 2C 10 00 06 */ cmpwi r16, 6
/* 80388648 003855A8 41 82 00 14 */ beq lbl_8038865C
/* 8038864C 003855AC 40 80 00 3C */ bge lbl_80388688
/* 80388650 003855B0 2C 10 00 05 */ cmpwi r16, 5
/* 80388654 003855B4 40 80 00 24 */ bge lbl_80388678
/* 80388658 003855B8 48 00 00 30 */ b lbl_80388688
lbl_8038865C:
/* 8038865C 003855BC 28 11 00 00 */ cmplwi r17, 0
/* 80388660 003855C0 41 82 00 44 */ beq lbl_803886A4
/* 80388664 003855C4 28 11 00 02 */ cmplwi r17, 2
/* 80388668 003855C8 41 82 00 3C */ beq lbl_803886A4
/* 8038866C 003855CC 28 11 00 06 */ cmplwi r17, 6
/* 80388670 003855D0 40 82 00 18 */ bne lbl_80388688
/* 80388674 003855D4 48 00 00 30 */ b lbl_803886A4
lbl_80388678:
/* 80388678 003855D8 28 11 00 01 */ cmplwi r17, 1
/* 8038867C 003855DC 41 82 00 28 */ beq lbl_803886A4
/* 80388680 003855E0 28 11 00 05 */ cmplwi r17, 5
/* 80388684 003855E4 41 82 00 20 */ beq lbl_803886A4
lbl_80388688:
/* 80388688 003855E8 38 D0 00 00 */ addi r6, r16, 0
/* 8038868C 003855EC 4C C6 31 82 */ crclr 6
/* 80388690 003855F0 38 F1 00 00 */ addi r7, r17, 0
/* 80388694 003855F4 38 AF 03 68 */ addi r5, r15, 0x368
/* 80388698 003855F8 38 6D 9F BC */ addi r3, r13, lbl_805A8B7C@sda21
/* 8038869C 003855FC 38 80 07 5C */ li r4, 0x75c
/* 803886A0 00385600 4B FF 73 8D */ bl OSPanic
lbl_803886A4:
/* 803886A4 00385604 28 11 00 00 */ cmplwi r17, 0
/* 803886A8 00385608 41 82 00 0C */ beq lbl_803886B4
/* 803886AC 0038560C 28 11 00 02 */ cmplwi r17, 2
/* 803886B0 00385610 40 82 00 0C */ bne lbl_803886BC
lbl_803886B4:
/* 803886B4 00385614 92 1D 01 18 */ stw r16, 0x118(r29)
/* 803886B8 00385618 48 00 00 08 */ b lbl_803886C0
lbl_803886BC:
/* 803886BC 0038561C 92 3D 01 18 */ stw r17, 0x118(r29)
lbl_803886C0:
/* 803886C0 00385620 A0 1F 00 0A */ lhz r0, 0xa(r31)
/* 803886C4 00385624 B0 1D 00 F0 */ sth r0, 0xf0(r29)
/* 803886C8 00385628 80 1C 00 00 */ lwz r0, 0(r28)
/* 803886CC 0038562C 28 00 00 01 */ cmplwi r0, 1
/* 803886D0 00385630 40 82 00 10 */ bne lbl_803886E0
/* 803886D4 00385634 A0 1F 00 0C */ lhz r0, 0xc(r31)
/* 803886D8 00385638 54 00 0C 3C */ rlwinm r0, r0, 1, 0x10, 0x1e
/* 803886DC 0038563C 48 00 00 08 */ b lbl_803886E4
lbl_803886E0:
/* 803886E0 00385640 A0 1F 00 0C */ lhz r0, 0xc(r31)
lbl_803886E4:
/* 803886E4 00385644 B0 1D 00 F2 */ sth r0, 0xf2(r29)
/* 803886E8 00385648 3A FD 00 F2 */ addi r23, r29, 0xf2
/* 803886EC 0038564C 3B 1D 00 F4 */ addi r24, r29, 0xf4
/* 803886F0 00385650 A0 1F 00 0E */ lhz r0, 0xe(r31)
/* 803886F4 00385654 3B 7D 01 02 */ addi r27, r29, 0x102
/* 803886F8 00385658 3B 3D 01 10 */ addi r25, r29, 0x110
/* 803886FC 0038565C B0 1D 00 F4 */ sth r0, 0xf4(r29)
/* 80388700 00385660 38 00 00 00 */ li r0, 0
/* 80388704 00385664 3A 1D 01 0A */ addi r16, r29, 0x10a
/* 80388708 00385668 A0 7F 00 04 */ lhz r3, 4(r31)
/* 8038870C 0038566C 3B 5D 01 0C */ addi r26, r29, 0x10c
/* 80388710 00385670 39 FD 01 06 */ addi r15, r29, 0x106
/* 80388714 00385674 B0 7D 01 02 */ sth r3, 0x102(r29)
/* 80388718 00385678 3A 3D 01 08 */ addi r17, r29, 0x108
/* 8038871C 0038567C A0 7F 00 08 */ lhz r3, 8(r31)
/* 80388720 00385680 B0 7D 01 04 */ sth r3, 0x104(r29)
/* 80388724 00385684 80 7F 00 14 */ lwz r3, 0x14(r31)
/* 80388728 00385688 90 7D 01 10 */ stw r3, 0x110(r29)
/* 8038872C 0038568C A0 7D 01 02 */ lhz r3, 0x102(r29)
/* 80388730 00385690 B0 7D 01 0A */ sth r3, 0x10a(r29)
/* 80388734 00385694 A0 7D 01 04 */ lhz r3, 0x104(r29)
/* 80388738 00385698 B0 7D 01 0C */ sth r3, 0x10c(r29)
/* 8038873C 0038569C B0 1D 01 06 */ sth r0, 0x106(r29)
/* 80388740 003856A0 B0 1D 01 08 */ sth r0, 0x108(r29)
/* 80388744 003856A4 80 1C 00 00 */ lwz r0, 0(r28)
/* 80388748 003856A8 28 00 00 02 */ cmplwi r0, 2
/* 8038874C 003856AC 40 82 00 0C */ bne lbl_80388758
/* 80388750 003856B0 A0 1A 00 00 */ lhz r0, 0(r26)
/* 80388754 003856B4 48 00 00 30 */ b lbl_80388784
lbl_80388758:
/* 80388758 003856B8 28 00 00 03 */ cmplwi r0, 3
/* 8038875C 003856BC 40 82 00 0C */ bne lbl_80388768
/* 80388760 003856C0 A0 1A 00 00 */ lhz r0, 0(r26)
/* 80388764 003856C4 48 00 00 20 */ b lbl_80388784
lbl_80388768:
/* 80388768 003856C8 80 19 00 00 */ lwz r0, 0(r25)
/* 8038876C 003856CC 2C 00 00 00 */ cmpwi r0, 0
/* 80388770 003856D0 40 82 00 10 */ bne lbl_80388780
/* 80388774 003856D4 A0 1A 00 00 */ lhz r0, 0(r26)
/* 80388778 003856D8 54 00 0C 3C */ rlwinm r0, r0, 1, 0x10, 0x1e
/* 8038877C 003856DC 48 00 00 08 */ b lbl_80388784
lbl_80388780:
/* 80388780 003856E0 A0 1A 00 00 */ lhz r0, 0(r26)
lbl_80388784:
/* 80388784 003856E4 3A DD 00 F6 */ addi r22, r29, 0xf6
/* 80388788 003856E8 B0 1D 00 F6 */ sth r0, 0xf6(r29)
/* 8038878C 003856EC 80 1C 00 00 */ lwz r0, 0(r28)
/* 80388790 003856F0 28 00 00 03 */ cmplwi r0, 3
/* 80388794 003856F4 40 82 00 0C */ bne lbl_803887A0
/* 80388798 003856F8 38 00 00 01 */ li r0, 1
/* 8038879C 003856FC 48 00 00 08 */ b lbl_803887A4
lbl_803887A0:
/* 803887A0 00385700 38 00 00 00 */ li r0, 0
lbl_803887A4:
/* 803887A4 00385704 3A 5D 01 34 */ addi r18, r29, 0x134
/* 803887A8 00385708 90 1D 01 34 */ stw r0, 0x134(r29)
/* 803887AC 0038570C 3A BD 01 18 */ addi r21, r29, 0x118
/* 803887B0 00385710 80 7D 01 18 */ lwz r3, 0x118(r29)
/* 803887B4 00385714 80 1C 00 00 */ lwz r0, 0(r28)
/* 803887B8 00385718 54 63 10 3A */ slwi r3, r3, 2
/* 803887BC 0038571C 7C 63 02 14 */ add r3, r3, r0
/* 803887C0 00385720 4B FF F1 7D */ bl getTiming
/* 803887C4 00385724 7C 7E 1B 78 */ mr r30, r3
/* 803887C8 00385728 93 DD 01 44 */ stw r30, 0x144(r29)
/* 803887CC 0038572C A0 18 00 00 */ lhz r0, 0(r24)
/* 803887D0 00385730 A8 9D 00 F0 */ lha r4, 0xf0(r29)
/* 803887D4 00385734 A8 6D AD B8 */ lha r3, lbl_805A9978@sda21(r13)
/* 803887D8 00385738 20 A0 02 D0 */ subfic r5, r0, 0x2d0
/* 803887DC 0038573C A0 1E 00 02 */ lhz r0, 2(r30)
/* 803887E0 00385740 7C 64 1A 14 */ add r3, r4, r3
/* 803887E4 00385744 7C 03 28 00 */ cmpw r3, r5
/* 803887E8 00385748 40 81 00 08 */ ble lbl_803887F0
/* 803887EC 0038574C 48 00 00 14 */ b lbl_80388800
lbl_803887F0:
/* 803887F0 00385750 2C 03 00 00 */ cmpwi r3, 0
/* 803887F4 00385754 40 80 00 08 */ bge lbl_803887FC
/* 803887F8 00385758 38 60 00 00 */ li r3, 0
lbl_803887FC:
/* 803887FC 0038575C 7C 65 1B 78 */ mr r5, r3
lbl_80388800:
/* 80388800 00385760 B0 BD 00 F8 */ sth r5, 0xf8(r29)
/* 80388804 00385764 38 7D 00 F8 */ addi r3, r29, 0xf8
/* 80388808 00385768 80 99 00 00 */ lwz r4, 0(r25)
/* 8038880C 0038576C 2C 04 00 00 */ cmpwi r4, 0
/* 80388810 00385770 40 82 00 0C */ bne lbl_8038881C
/* 80388814 00385774 38 80 00 02 */ li r4, 2
/* 80388818 00385778 48 00 00 08 */ b lbl_80388820
lbl_8038881C:
/* 8038881C 0038577C 38 80 00 01 */ li r4, 1
lbl_80388820:
/* 80388820 00385780 A0 B7 00 00 */ lhz r5, 0(r23)
/* 80388824 00385784 A8 CD AD BA */ lha r6, lbl_805A997A@sda21(r13)
/* 80388828 00385788 7C A7 07 34 */ extsh r7, r5
/* 8038882C 0038578C 54 A5 07 FE */ clrlwi r5, r5, 0x1f
/* 80388830 00385790 7C E7 32 14 */ add r7, r7, r6
/* 80388834 00385794 7C 07 28 00 */ cmpw r7, r5
/* 80388838 00385798 40 81 00 08 */ ble lbl_80388840
/* 8038883C 0038579C 48 00 00 08 */ b lbl_80388844
lbl_80388840:
/* 80388840 003857A0 7C A7 2B 78 */ mr r7, r5
lbl_80388844:
/* 80388844 003857A4 B0 FD 00 FA */ sth r7, 0xfa(r29)
/* 80388848 003857A8 7C 00 07 34 */ extsh r0, r0
/* 8038884C 003857AC 54 00 08 3C */ slwi r0, r0, 1
/* 80388850 003857B0 A1 16 00 00 */ lhz r8, 0(r22)
/* 80388854 003857B4 7C 05 00 50 */ subf r0, r5, r0
/* 80388858 003857B8 A8 F7 00 00 */ lha r7, 0(r23)
/* 8038885C 003857BC 3A 7D 00 FA */ addi r19, r29, 0xfa
/* 80388860 003857C0 7D 09 07 34 */ extsh r9, r8
/* 80388864 003857C4 7D 49 32 14 */ add r10, r9, r6
/* 80388868 003857C8 7D 47 52 14 */ add r10, r7, r10
/* 8038886C 003857CC 7D 20 50 51 */ subf. r9, r0, r10
/* 80388870 003857D0 40 81 00 0C */ ble lbl_8038887C
/* 80388874 003857D4 7D 20 50 50 */ subf r9, r0, r10
/* 80388878 003857D8 48 00 00 08 */ b lbl_80388880
lbl_8038887C:
/* 8038887C 003857DC 39 20 00 00 */ li r9, 0
lbl_80388880:
/* 80388880 003857E0 7D 47 32 14 */ add r10, r7, r6
/* 80388884 003857E4 7C E5 50 51 */ subf. r7, r5, r10
/* 80388888 003857E8 40 80 00 0C */ bge lbl_80388894
/* 8038888C 003857EC 7C E5 50 50 */ subf r7, r5, r10
/* 80388890 003857F0 48 00 00 08 */ b lbl_80388898
lbl_80388894:
/* 80388894 003857F4 38 E0 00 00 */ li r7, 0
lbl_80388898:
/* 80388898 003857F8 7C E8 3A 14 */ add r7, r8, r7
/* 8038889C 003857FC 7C E9 38 50 */ subf r7, r9, r7
/* 803888A0 00385800 3A 9D 00 FC */ addi r20, r29, 0xfc
/* 803888A4 00385804 B0 FD 00 FC */ sth r7, 0xfc(r29)
/* 803888A8 00385808 A8 F7 00 00 */ lha r7, 0(r23)
/* 803888AC 0038580C 7D 07 32 14 */ add r8, r7, r6
/* 803888B0 00385810 7C E5 40 51 */ subf. r7, r5, r8
/* 803888B4 00385814 40 80 00 0C */ bge lbl_803888C0
/* 803888B8 00385818 7C E5 40 50 */ subf r7, r5, r8
/* 803888BC 0038581C 48 00 00 08 */ b lbl_803888C4
lbl_803888C0:
/* 803888C0 00385820 38 E0 00 00 */ li r7, 0
lbl_803888C4:
/* 803888C4 00385824 7D 07 23 D6 */ divw r8, r7, r4
/* 803888C8 00385828 A0 F1 00 00 */ lhz r7, 0(r17)
/* 803888CC 0038582C 7C E8 38 50 */ subf r7, r8, r7
/* 803888D0 00385830 B0 FD 00 FE */ sth r7, 0xfe(r29)
/* 803888D4 00385834 A8 F6 00 00 */ lha r7, 0(r22)
/* 803888D8 00385838 A9 37 00 00 */ lha r9, 0(r23)
/* 803888DC 0038583C 7D 07 32 14 */ add r8, r7, r6
/* 803888E0 00385840 7D 09 42 14 */ add r8, r9, r8
/* 803888E4 00385844 7C E0 40 51 */ subf. r7, r0, r8
/* 803888E8 00385848 40 81 00 0C */ ble lbl_803888F4
/* 803888EC 0038584C 7C E0 40 50 */ subf r7, r0, r8
/* 803888F0 00385850 48 00 00 08 */ b lbl_803888F8
lbl_803888F4:
/* 803888F4 00385854 38 E0 00 00 */ li r7, 0
lbl_803888F8:
/* 803888F8 00385858 7C C9 32 14 */ add r6, r9, r6
/* 803888FC 0038585C 7C 05 30 51 */ subf. r0, r5, r6
/* 80388900 00385860 40 80 00 0C */ bge lbl_8038890C
/* 80388904 00385864 7C 05 30 50 */ subf r0, r5, r6
/* 80388908 00385868 48 00 00 08 */ b lbl_80388910
lbl_8038890C:
/* 8038890C 0038586C 38 00 00 00 */ li r0, 0
lbl_80388910:
/* 80388910 00385870 7C 00 23 D6 */ divw r0, r0, r4
/* 80388914 00385874 A0 BA 00 00 */ lhz r5, 0(r26)
/* 80388918 00385878 7C 87 23 D6 */ divw r4, r7, r4
/* 8038891C 0038587C 7C 05 02 14 */ add r0, r5, r0
/* 80388920 00385880 7C 04 00 50 */ subf r0, r4, r0
/* 80388924 00385884 B0 1D 01 00 */ sth r0, 0x100(r29)
/* 80388928 00385888 80 0D AD B4 */ lwz r0, lbl_805A9974@sda21(r13)
/* 8038892C 0038588C 28 00 00 00 */ cmplwi r0, 0
/* 80388930 00385890 40 82 00 0C */ bne lbl_8038893C
/* 80388934 00385894 38 00 00 03 */ li r0, 3
/* 80388938 00385898 90 15 00 00 */ stw r0, 0(r21)
lbl_8038893C:
/* 8038893C 0038589C A0 BE 00 18 */ lhz r5, 0x18(r30)
/* 80388940 003858A0 7C A4 0E 70 */ srawi r4, r5, 1
/* 80388944 003858A4 7C 84 01 94 */ addze r4, r4
/* 80388948 003858A8 7C A0 0E 70 */ srawi r0, r5, 1
/* 8038894C 003858AC 7C 00 01 94 */ addze r0, r0
/* 80388950 003858B0 54 00 08 3C */ slwi r0, r0, 1
/* 80388954 003858B4 7C 00 28 10 */ subfc r0, r0, r5
/* 80388958 003858B8 54 00 04 3F */ clrlwi. r0, r0, 0x10
/* 8038895C 003858BC 54 84 04 3E */ clrlwi r4, r4, 0x10
/* 80388960 003858C0 41 82 00 0C */ beq lbl_8038896C
/* 80388964 003858C4 A0 BE 00 1A */ lhz r5, 0x1a(r30)
/* 80388968 003858C8 48 00 00 08 */ b lbl_80388970
lbl_8038896C:
/* 8038896C 003858CC 38 A0 00 00 */ li r5, 0
lbl_80388970:
/* 80388970 003858D0 38 05 00 01 */ addi r0, r5, 1
/* 80388974 003858D4 B0 1D 00 32 */ sth r0, 0x32(r29)
/* 80388978 003858D8 38 04 00 01 */ addi r0, r4, 1
/* 8038897C 003858DC 60 00 10 00 */ ori r0, r0, 0x1000
/* 80388980 003858E0 80 AD AD C0 */ lwz r5, lbl_805A9980@sda21(r13)
/* 80388984 003858E4 38 9D 00 02 */ addi r4, r29, 2
/* 80388988 003858E8 80 CD AD C4 */ lwz r6, lbl_805A9984@sda21(r13)
/* 8038898C 003858EC 60 A5 00 40 */ ori r5, r5, 0x40
/* 80388990 003858F0 90 CD AD C4 */ stw r6, lbl_805A9984@sda21(r13)
/* 80388994 003858F4 90 AD AD C0 */ stw r5, lbl_805A9980@sda21(r13)
/* 80388998 003858F8 B0 1D 00 30 */ sth r0, 0x30(r29)
/* 8038899C 003858FC 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 803889A0 00385900 80 AD AD C4 */ lwz r5, lbl_805A9984@sda21(r13)
/* 803889A4 00385904 60 00 00 80 */ ori r0, r0, 0x80
/* 803889A8 00385908 90 AD AD C4 */ stw r5, lbl_805A9984@sda21(r13)
/* 803889AC 0038590C 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 803889B0 00385910 80 1C 00 00 */ lwz r0, 0(r28)
/* 803889B4 00385914 A0 BD 00 02 */ lhz r5, 2(r29)
/* 803889B8 00385918 28 00 00 02 */ cmplwi r0, 2
/* 803889BC 0038591C 41 82 00 0C */ beq lbl_803889C8
/* 803889C0 00385920 28 00 00 03 */ cmplwi r0, 3
/* 803889C4 00385924 40 82 00 10 */ bne lbl_803889D4
lbl_803889C8:
/* 803889C8 00385928 54 A0 07 B8 */ rlwinm r0, r5, 0, 0x1e, 0x1c
/* 803889CC 0038592C 60 05 00 04 */ ori r5, r0, 4
/* 803889D0 00385930 48 00 00 0C */ b lbl_803889DC
lbl_803889D4:
/* 803889D4 00385934 54 A5 07 B8 */ rlwinm r5, r5, 0, 0x1e, 0x1c
/* 803889D8 00385938 50 05 17 7A */ rlwimi r5, r0, 2, 0x1d, 0x1d
lbl_803889DC:
/* 803889DC 0038593C 80 D5 00 00 */ lwz r6, 0(r21)
/* 803889E0 00385940 54 A5 07 76 */ rlwinm r5, r5, 0, 0x1d, 0x1b
/* 803889E4 00385944 80 F2 00 00 */ lwz r7, 0(r18)
/* 803889E8 00385948 28 06 00 04 */ cmplwi r6, 4
/* 803889EC 0038594C 54 E0 18 38 */ slwi r0, r7, 3
/* 803889F0 00385950 7C A5 03 78 */ or r5, r5, r0
/* 803889F4 00385954 41 82 00 10 */ beq lbl_80388A04
/* 803889F8 00385958 38 06 FF FB */ addi r0, r6, -5
/* 803889FC 0038595C 28 00 00 01 */ cmplwi r0, 1
/* 80388A00 00385960 41 81 00 0C */ bgt lbl_80388A0C
lbl_80388A04:
/* 80388A04 00385964 54 A0 06 2A */ rlwinm r0, r5, 0, 0x18, 0x15
/* 80388A08 00385968 48 00 00 10 */ b lbl_80388A18
lbl_80388A0C:
/* 80388A0C 0038596C 54 A5 06 2A */ rlwinm r5, r5, 0, 0x18, 0x15
/* 80388A10 00385970 54 C0 40 2E */ slwi r0, r6, 8
/* 80388A14 00385974 7C A0 03 78 */ or r0, r5, r0
lbl_80388A18:
/* 80388A18 00385978 B0 04 00 00 */ sth r0, 0(r4)
/* 80388A1C 0038597C 3C 00 40 00 */ lis r0, 0x4000
/* 80388A20 00385980 38 DD 00 6C */ addi r6, r29, 0x6c
/* 80388A24 00385984 80 8D AD C0 */ lwz r4, lbl_805A9980@sda21(r13)
/* 80388A28 00385988 80 AD AD C4 */ lwz r5, lbl_805A9984@sda21(r13)
/* 80388A2C 0038598C 7C 80 03 78 */ or r0, r4, r0
/* 80388A30 00385990 90 AD AD C4 */ stw r5, lbl_805A9984@sda21(r13)
/* 80388A34 00385994 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388A38 00385998 80 1F 00 00 */ lwz r0, 0(r31)
/* 80388A3C 0038599C A0 9D 00 6C */ lhz r4, 0x6c(r29)
/* 80388A40 003859A0 2C 00 00 02 */ cmpwi r0, 2
/* 80388A44 003859A4 41 82 00 14 */ beq lbl_80388A58
/* 80388A48 003859A8 2C 00 00 03 */ cmpwi r0, 3
/* 80388A4C 003859AC 41 82 00 0C */ beq lbl_80388A58
/* 80388A50 003859B0 2C 00 00 1A */ cmpwi r0, 0x1a
/* 80388A54 003859B4 40 82 00 10 */ bne lbl_80388A64
lbl_80388A58:
/* 80388A58 003859B8 54 80 00 3C */ rlwinm r0, r4, 0, 0, 0x1e
/* 80388A5C 003859BC 60 00 00 01 */ ori r0, r0, 1
/* 80388A60 003859C0 48 00 00 08 */ b lbl_80388A68
lbl_80388A64:
/* 80388A64 003859C4 54 80 00 3C */ rlwinm r0, r4, 0, 0, 0x1e
lbl_80388A68:
/* 80388A68 003859C8 B0 06 00 00 */ sth r0, 0(r6)
/* 80388A6C 003859CC 2C 07 00 00 */ cmpwi r7, 0
/* 80388A70 003859D0 80 8D AD C0 */ lwz r4, lbl_805A9980@sda21(r13)
/* 80388A74 003859D4 80 0D AD C4 */ lwz r0, lbl_805A9984@sda21(r13)
/* 80388A78 003859D8 60 00 02 00 */ ori r0, r0, 0x200
/* 80388A7C 003859DC 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 80388A80 003859E0 90 8D AD C0 */ stw r4, lbl_805A9980@sda21(r13)
/* 80388A84 003859E4 A0 98 00 00 */ lhz r4, 0(r24)
/* 80388A88 003859E8 A0 B0 00 00 */ lhz r5, 0(r16)
/* 80388A8C 003859EC 41 82 00 0C */ beq lbl_80388A98
/* 80388A90 003859F0 54 A0 08 3C */ slwi r0, r5, 1
/* 80388A94 003859F4 48 00 00 08 */ b lbl_80388A9C
lbl_80388A98:
/* 80388A98 003859F8 7C A0 2B 78 */ mr r0, r5
lbl_80388A9C:
/* 80388A9C 003859FC 54 08 04 3E */ clrlwi r8, r0, 0x10
/* 80388AA0 00385A00 7C 08 20 40 */ cmplw r8, r4
/* 80388AA4 00385A04 40 80 00 50 */ bge lbl_80388AF4
/* 80388AA8 00385A08 55 06 40 2E */ slwi r6, r8, 8
/* 80388AAC 00385A0C 38 06 FF FF */ addi r0, r6, -1
/* 80388AB0 00385A10 7C 04 02 14 */ add r0, r4, r0
/* 80388AB4 00385A14 7C 00 23 96 */ divwu r0, r0, r4
/* 80388AB8 00385A18 60 00 10 00 */ ori r0, r0, 0x1000
/* 80388ABC 00385A1C B0 1D 00 4A */ sth r0, 0x4a(r29)
/* 80388AC0 00385A20 3C 00 04 00 */ lis r0, 0x400
/* 80388AC4 00385A24 80 CD AD C0 */ lwz r6, lbl_805A9980@sda21(r13)
/* 80388AC8 00385A28 80 ED AD C4 */ lwz r7, lbl_805A9984@sda21(r13)
/* 80388ACC 00385A2C 7C E0 03 78 */ or r0, r7, r0
/* 80388AD0 00385A30 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 80388AD4 00385A34 90 CD AD C0 */ stw r6, lbl_805A9980@sda21(r13)
/* 80388AD8 00385A38 B1 1D 00 70 */ sth r8, 0x70(r29)
/* 80388ADC 00385A3C 80 CD AD C0 */ lwz r6, lbl_805A9980@sda21(r13)
/* 80388AE0 00385A40 80 0D AD C4 */ lwz r0, lbl_805A9984@sda21(r13)
/* 80388AE4 00385A44 60 00 00 80 */ ori r0, r0, 0x80
/* 80388AE8 00385A48 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 80388AEC 00385A4C 90 CD AD C0 */ stw r6, lbl_805A9980@sda21(r13)
/* 80388AF0 00385A50 48 00 00 24 */ b lbl_80388B14
lbl_80388AF4:
/* 80388AF4 00385A54 38 00 01 00 */ li r0, 0x100
/* 80388AF8 00385A58 B0 1D 00 4A */ sth r0, 0x4a(r29)
/* 80388AFC 00385A5C 3C 00 04 00 */ lis r0, 0x400
/* 80388B00 00385A60 80 CD AD C0 */ lwz r6, lbl_805A9980@sda21(r13)
/* 80388B04 00385A64 80 ED AD C4 */ lwz r7, lbl_805A9984@sda21(r13)
/* 80388B08 00385A68 7C E0 03 78 */ or r0, r7, r0
/* 80388B0C 00385A6C 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 80388B10 00385A70 90 CD AD C0 */ stw r6, lbl_805A9980@sda21(r13)
lbl_80388B14:
/* 80388B14 00385A74 A0 03 00 00 */ lhz r0, 0(r3)
/* 80388B18 00385A78 21 84 02 D0 */ subfic r12, r4, 0x2d0
/* 80388B1C 00385A7C A0 DE 00 1A */ lhz r6, 0x1a(r30)
/* 80388B20 00385A80 3C 60 10 00 */ lis r3, 0x1000
/* 80388B24 00385A84 3D 00 20 00 */ lis r8, 0x2000
/* 80388B28 00385A88 B0 DD 00 06 */ sth r6, 6(r29)
/* 80388B2C 00385A8C 3D 20 04 00 */ lis r9, 0x400
/* 80388B30 00385A90 3C E0 08 00 */ lis r7, 0x800
/* 80388B34 00385A94 81 4D AD C0 */ lwz r10, lbl_805A9980@sda21(r13)
/* 80388B38 00385A98 3C C0 00 10 */ lis r6, 0x10
/* 80388B3C 00385A9C 3C 80 00 20 */ lis r4, 0x20
/* 80388B40 00385AA0 81 6D AD C4 */ lwz r11, lbl_805A9984@sda21(r13)
/* 80388B44 00385AA4 7D 4A 1B 78 */ or r10, r10, r3
/* 80388B48 00385AA8 3C 60 00 04 */ lis r3, 4
/* 80388B4C 00385AAC 91 6D AD C4 */ stw r11, lbl_805A9984@sda21(r13)
/* 80388B50 00385AB0 91 4D AD C0 */ stw r10, lbl_805A9980@sda21(r13)
/* 80388B54 00385AB4 89 5E 00 1D */ lbz r10, 0x1d(r30)
/* 80388B58 00385AB8 89 7E 00 1E */ lbz r11, 0x1e(r30)
/* 80388B5C 00385ABC 51 4B 44 2E */ rlwimi r11, r10, 8, 0x10, 0x17
/* 80388B60 00385AC0 B1 7D 00 04 */ sth r11, 4(r29)
/* 80388B64 00385AC4 81 4D AD C0 */ lwz r10, lbl_805A9980@sda21(r13)
/* 80388B68 00385AC8 81 6D AD C4 */ lwz r11, lbl_805A9984@sda21(r13)
/* 80388B6C 00385ACC 7D 48 43 78 */ or r8, r10, r8
/* 80388B70 00385AD0 91 6D AD C4 */ stw r11, lbl_805A9984@sda21(r13)
/* 80388B74 00385AD4 91 0D AD C0 */ stw r8, lbl_805A9980@sda21(r13)
/* 80388B78 00385AD8 89 1E 00 1F */ lbz r8, 0x1f(r30)
/* 80388B7C 00385ADC 89 5E 00 1C */ lbz r10, 0x1c(r30)
/* 80388B80 00385AE0 7E 08 02 14 */ add r16, r8, r0
/* 80388B84 00385AE4 A1 7E 00 20 */ lhz r11, 0x20(r30)
/* 80388B88 00385AE8 3A 10 FF D8 */ addi r16, r16, -40
/* 80388B8C 00385AEC 56 08 3C 30 */ rlwinm r8, r16, 7, 0x10, 0x18
/* 80388B90 00385AF0 7D 48 43 78 */ or r8, r10, r8
/* 80388B94 00385AF4 B1 1D 00 0A */ sth r8, 0xa(r29)
/* 80388B98 00385AF8 7D 0B 02 14 */ add r8, r11, r0
/* 80388B9C 00385AFC 38 08 00 28 */ addi r0, r8, 0x28
/* 80388BA0 00385B00 81 4D AD C0 */ lwz r10, lbl_805A9980@sda21(r13)
/* 80388BA4 00385B04 7C 0C 00 50 */ subf r0, r12, r0
/* 80388BA8 00385B08 56 08 BA 7E */ srwi r8, r16, 9
/* 80388BAC 00385B0C 81 6D AD C4 */ lwz r11, lbl_805A9984@sda21(r13)
/* 80388BB0 00385B10 54 00 08 3C */ slwi r0, r0, 1
/* 80388BB4 00385B14 7D 49 4B 78 */ or r9, r10, r9
/* 80388BB8 00385B18 91 6D AD C4 */ stw r11, lbl_805A9984@sda21(r13)
/* 80388BBC 00385B1C 7D 00 03 78 */ or r0, r8, r0
/* 80388BC0 00385B20 91 2D AD C0 */ stw r9, lbl_805A9980@sda21(r13)
/* 80388BC4 00385B24 B0 1D 00 08 */ sth r0, 8(r29)
/* 80388BC8 00385B28 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388BCC 00385B2C 81 0D AD C4 */ lwz r8, lbl_805A9984@sda21(r13)
/* 80388BD0 00385B30 7C 00 3B 78 */ or r0, r0, r7
/* 80388BD4 00385B34 91 0D AD C4 */ stw r8, lbl_805A9984@sda21(r13)
/* 80388BD8 00385B38 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388BDC 00385B3C A0 1E 00 10 */ lhz r0, 0x10(r30)
/* 80388BE0 00385B40 88 FE 00 0C */ lbz r7, 0xc(r30)
/* 80388BE4 00385B44 54 00 28 34 */ slwi r0, r0, 5
/* 80388BE8 00385B48 7C E0 03 78 */ or r0, r7, r0
/* 80388BEC 00385B4C B0 1D 00 16 */ sth r0, 0x16(r29)
/* 80388BF0 00385B50 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388BF4 00385B54 80 ED AD C4 */ lwz r7, lbl_805A9984@sda21(r13)
/* 80388BF8 00385B58 7C 00 33 78 */ or r0, r0, r6
/* 80388BFC 00385B5C 90 ED AD C4 */ stw r7, lbl_805A9984@sda21(r13)
/* 80388C00 00385B60 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388C04 00385B64 A0 1E 00 14 */ lhz r0, 0x14(r30)
/* 80388C08 00385B68 88 DE 00 0E */ lbz r6, 0xe(r30)
/* 80388C0C 00385B6C 54 00 28 34 */ slwi r0, r0, 5
/* 80388C10 00385B70 7C C0 03 78 */ or r0, r6, r0
/* 80388C14 00385B74 B0 1D 00 14 */ sth r0, 0x14(r29)
/* 80388C18 00385B78 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388C1C 00385B7C 80 CD AD C4 */ lwz r6, lbl_805A9984@sda21(r13)
/* 80388C20 00385B80 7C 00 23 78 */ or r0, r0, r4
/* 80388C24 00385B84 90 CD AD C4 */ stw r6, lbl_805A9984@sda21(r13)
/* 80388C28 00385B88 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388C2C 00385B8C A0 1E 00 12 */ lhz r0, 0x12(r30)
/* 80388C30 00385B90 88 9E 00 0D */ lbz r4, 0xd(r30)
/* 80388C34 00385B94 54 00 28 34 */ slwi r0, r0, 5
/* 80388C38 00385B98 7C 80 03 78 */ or r0, r4, r0
/* 80388C3C 00385B9C B0 1D 00 1A */ sth r0, 0x1a(r29)
/* 80388C40 00385BA0 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80388C44 00385BA4 80 8D AD C4 */ lwz r4, lbl_805A9984@sda21(r13)
/* 80388C48 00385BA8 7C 00 1B 78 */ or r0, r0, r3
/* 80388C4C 00385BAC 90 8D AD C4 */ stw r4, lbl_805A9984@sda21(r13)
/* 80388C50 00385BB0 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388C54 00385BB4 A0 1E 00 16 */ lhz r0, 0x16(r30)
/* 80388C58 00385BB8 88 7E 00 0F */ lbz r3, 0xf(r30)
/* 80388C5C 00385BBC 54 00 28 34 */ slwi r0, r0, 5
/* 80388C60 00385BC0 7C 60 03 78 */ or r0, r3, r0
/* 80388C64 00385BC4 B0 1D 00 18 */ sth r0, 0x18(r29)
/* 80388C68 00385BC8 80 6D AD C0 */ lwz r3, lbl_805A9980@sda21(r13)
/* 80388C6C 00385BCC 3C 00 00 08 */ lis r0, 8
/* 80388C70 00385BD0 38 DD 01 1C */ addi r6, r29, 0x11c
/* 80388C74 00385BD4 80 8D AD C4 */ lwz r4, lbl_805A9984@sda21(r13)
/* 80388C78 00385BD8 7C 60 03 78 */ or r0, r3, r0
/* 80388C7C 00385BDC 90 8D AD C4 */ stw r4, lbl_805A9984@sda21(r13)
/* 80388C80 00385BE0 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
/* 80388C84 00385BE4 A0 7B 00 00 */ lhz r3, 0(r27)
/* 80388C88 00385BE8 80 99 00 00 */ lwz r4, 0(r25)
/* 80388C8C 00385BEC 38 03 00 0F */ addi r0, r3, 0xf
/* 80388C90 00385BF0 A0 6F 00 00 */ lhz r3, 0(r15)
/* 80388C94 00385BF4 7C 00 26 70 */ srawi r0, r0, 4
/* 80388C98 00385BF8 7C 00 01 94 */ addze r0, r0
/* 80388C9C 00385BFC 2C 04 00 00 */ cmpwi r4, 0
/* 80388CA0 00385C00 98 1D 01 1C */ stb r0, 0x11c(r29)
/* 80388CA4 00385C04 40 82 00 0C */ bne lbl_80388CB0
/* 80388CA8 00385C08 88 86 00 00 */ lbz r4, 0(r6)
/* 80388CAC 00385C0C 48 00 00 0C */ b lbl_80388CB8
lbl_80388CB0:
/* 80388CB0 00385C10 88 06 00 00 */ lbz r0, 0(r6)
/* 80388CB4 00385C14 54 04 0E 3C */ rlwinm r4, r0, 1, 0x18, 0x1e
lbl_80388CB8:
/* 80388CB8 00385C18 7C 60 26 70 */ srawi r0, r3, 4
/* 80388CBC 00385C1C 98 9D 01 1D */ stb r4, 0x11d(r29)
/* 80388CC0 00385C20 7C 00 01 94 */ addze r0, r0
/* 80388CC4 00385C24 54 00 20 36 */ slwi r0, r0, 4
/* 80388CC8 00385C28 7C 00 18 10 */ subfc r0, r0, r3
/* 80388CCC 00385C2C 98 1D 01 2C */ stb r0, 0x12c(r29)
/* 80388CD0 00385C30 38 05 00 0F */ addi r0, r5, 0xf
/* 80388CD4 00385C34 3C 60 08 00 */ lis r3, 0x800
/* 80388CD8 00385C38 88 9D 01 2C */ lbz r4, 0x12c(r29)
/* 80388CDC 00385C3C 7C 04 02 14 */ add r0, r4, r0
/* 80388CE0 00385C40 7C 00 26 70 */ srawi r0, r0, 4
/* 80388CE4 00385C44 7C 00 01 94 */ addze r0, r0
/* 80388CE8 00385C48 98 1D 01 1E */ stb r0, 0x11e(r29)
/* 80388CEC 00385C4C 88 1D 01 1E */ lbz r0, 0x11e(r29)
/* 80388CF0 00385C50 88 9D 01 1D */ lbz r4, 0x11d(r29)
/* 80388CF4 00385C54 50 04 44 2E */ rlwimi r4, r0, 8, 0x10, 0x17
/* 80388CF8 00385C58 B0 9D 00 48 */ sth r4, 0x48(r29)
/* 80388CFC 00385C5C 80 8D AD C0 */ lwz r4, lbl_805A9980@sda21(r13)
/* 80388D00 00385C60 80 0D AD E8 */ lwz r0, lbl_805A99A8@sda21(r13)
/* 80388D04 00385C64 80 AD AD C4 */ lwz r5, lbl_805A9984@sda21(r13)
/* 80388D08 00385C68 28 00 00 00 */ cmplwi r0, 0
/* 80388D0C 00385C6C 7C A0 1B 78 */ or r0, r5, r3
/* 80388D10 00385C70 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 80388D14 00385C74 90 8D AD C0 */ stw r4, lbl_805A9980@sda21(r13)
/* 80388D18 00385C78 41 82 00 1C */ beq lbl_80388D34
/* 80388D1C 00385C7C 38 7D 00 F0 */ addi r3, r29, 0xf0
/* 80388D20 00385C80 38 9D 01 24 */ addi r4, r29, 0x124
/* 80388D24 00385C84 38 BD 01 28 */ addi r5, r29, 0x128
/* 80388D28 00385C88 38 DD 01 3C */ addi r6, r29, 0x13c
/* 80388D2C 00385C8C 38 FD 01 40 */ addi r7, r29, 0x140
/* 80388D30 00385C90 4B FF F3 B1 */ bl setFbbRegs
lbl_80388D34:
/* 80388D34 00385C94 80 1D 01 30 */ lwz r0, 0x130(r29)
/* 80388D38 00385C98 90 01 00 08 */ stw r0, 8(r1)
/* 80388D3C 00385C9C A0 73 00 00 */ lhz r3, 0(r19)
/* 80388D40 00385CA0 A0 94 00 00 */ lhz r4, 0(r20)
/* 80388D44 00385CA4 88 BE 00 00 */ lbz r5, 0(r30)
/* 80388D48 00385CA8 A0 DE 00 02 */ lhz r6, 2(r30)
/* 80388D4C 00385CAC A0 FE 00 04 */ lhz r7, 4(r30)
/* 80388D50 00385CB0 A1 1E 00 06 */ lhz r8, 6(r30)
/* 80388D54 00385CB4 A1 3E 00 08 */ lhz r9, 8(r30)
/* 80388D58 00385CB8 A1 5E 00 0A */ lhz r10, 0xa(r30)
/* 80388D5C 00385CBC 4B FF F6 59 */ bl setVerticalRegs
/* 80388D60 00385CC0 7D C3 73 78 */ mr r3, r14
/* 80388D64 00385CC4 4B FF 89 25 */ bl OSRestoreInterrupts
/* 80388D68 00385CC8 B9 C1 00 30 */ lmw r14, 0x30(r1)
/* 80388D6C 00385CCC 80 01 00 7C */ lwz r0, 0x7c(r1)
/* 80388D70 00385CD0 38 21 00 78 */ addi r1, r1, 0x78
/* 80388D74 00385CD4 7C 08 03 A6 */ mtlr r0
/* 80388D78 00385CD8 4E 80 00 20 */ blr
.global VIConfigurePan
VIConfigurePan:
/* 80388D7C 00385CDC 7C 08 02 A6 */ mflr r0
/* 80388D80 00385CE0 3C E0 80 54 */ lis r7, lbl_80542040@ha
/* 80388D84 00385CE4 90 01 00 04 */ stw r0, 4(r1)
/* 80388D88 00385CE8 94 21 FF B0 */ stwu r1, -0x50(r1)
/* 80388D8C 00385CEC BE E1 00 2C */ stmw r23, 0x2c(r1)
/* 80388D90 00385CF0 3B 43 00 00 */ addi r26, r3, 0
/* 80388D94 00385CF4 3B 24 00 00 */ addi r25, r4, 0
/* 80388D98 00385CF8 3B 05 00 00 */ addi r24, r5, 0
/* 80388D9C 00385CFC 3A E6 00 00 */ addi r23, r6, 0
/* 80388DA0 00385D00 3B A7 20 40 */ addi r29, r7, lbl_80542040@l
/* 80388DA4 00385D04 4B FF 88 BD */ bl OSDisableInterrupts
/* 80388DA8 00385D08 B3 5D 01 06 */ sth r26, 0x106(r29)
/* 80388DAC 00385D0C 39 7D 01 06 */ addi r11, r29, 0x106
/* 80388DB0 00385D10 39 1D 01 08 */ addi r8, r29, 0x108
/* 80388DB4 00385D14 B3 3D 01 08 */ sth r25, 0x108(r29)
/* 80388DB8 00385D18 39 5D 01 0A */ addi r10, r29, 0x10a
/* 80388DBC 00385D1C 38 9D 01 0C */ addi r4, r29, 0x10c
/* 80388DC0 00385D20 B3 1D 01 0A */ sth r24, 0x10a(r29)
/* 80388DC4 00385D24 7C 7E 1B 78 */ mr r30, r3
/* 80388DC8 00385D28 B2 FD 01 0C */ sth r23, 0x10c(r29)
/* 80388DCC 00385D2C 80 1D 01 14 */ lwz r0, 0x114(r29)
/* 80388DD0 00385D30 28 00 00 02 */ cmplwi r0, 2
/* 80388DD4 00385D34 40 82 00 0C */ bne lbl_80388DE0
/* 80388DD8 00385D38 A0 04 00 00 */ lhz r0, 0(r4)
/* 80388DDC 00385D3C 48 00 00 30 */ b lbl_80388E0C
lbl_80388DE0:
/* 80388DE0 00385D40 28 00 00 03 */ cmplwi r0, 3
/* 80388DE4 00385D44 40 82 00 0C */ bne lbl_80388DF0
/* 80388DE8 00385D48 A0 04 00 00 */ lhz r0, 0(r4)
/* 80388DEC 00385D4C 48 00 00 20 */ b lbl_80388E0C
lbl_80388DF0:
/* 80388DF0 00385D50 80 1D 01 10 */ lwz r0, 0x110(r29)
/* 80388DF4 00385D54 2C 00 00 00 */ cmpwi r0, 0
/* 80388DF8 00385D58 40 82 00 10 */ bne lbl_80388E08
/* 80388DFC 00385D5C A0 04 00 00 */ lhz r0, 0(r4)
/* 80388E00 00385D60 54 00 0C 3C */ rlwinm r0, r0, 1, 0x10, 0x1e
/* 80388E04 00385D64 48 00 00 08 */ b lbl_80388E0C
lbl_80388E08:
/* 80388E08 00385D68 A0 04 00 00 */ lhz r0, 0(r4)
lbl_80388E0C:
/* 80388E0C 00385D6C 3B 7D 00 F6 */ addi r27, r29, 0xf6
/* 80388E10 00385D70 B0 1D 00 F6 */ sth r0, 0xf6(r29)
/* 80388E14 00385D74 39 3D 00 F4 */ addi r9, r29, 0xf4
/* 80388E18 00385D78 A0 1D 00 F4 */ lhz r0, 0xf4(r29)
/* 80388E1C 00385D7C A8 BD 00 F0 */ lha r5, 0xf0(r29)
/* 80388E20 00385D80 A8 6D AD B8 */ lha r3, lbl_805A9978@sda21(r13)
/* 80388E24 00385D84 20 00 02 D0 */ subfic r0, r0, 0x2d0
/* 80388E28 00385D88 83 9D 01 44 */ lwz r28, 0x144(r29)
/* 80388E2C 00385D8C 7C 65 1A 14 */ add r3, r5, r3
/* 80388E30 00385D90 7C 03 00 00 */ cmpw r3, r0
/* 80388E34 00385D94 A0 FC 00 02 */ lhz r7, 2(r28)
/* 80388E38 00385D98 40 81 00 08 */ ble lbl_80388E40
/* 80388E3C 00385D9C 48 00 00 14 */ b lbl_80388E50
lbl_80388E40:
/* 80388E40 00385DA0 2C 03 00 00 */ cmpwi r3, 0
/* 80388E44 00385DA4 40 80 00 08 */ bge lbl_80388E4C
/* 80388E48 00385DA8 38 60 00 00 */ li r3, 0
lbl_80388E4C:
/* 80388E4C 00385DAC 7C 60 1B 78 */ mr r0, r3
lbl_80388E50:
/* 80388E50 00385DB0 B0 1D 00 F8 */ sth r0, 0xf8(r29)
/* 80388E54 00385DB4 39 9D 01 10 */ addi r12, r29, 0x110
/* 80388E58 00385DB8 80 1D 01 10 */ lwz r0, 0x110(r29)
/* 80388E5C 00385DBC 2C 00 00 00 */ cmpwi r0, 0
/* 80388E60 00385DC0 40 82 00 0C */ bne lbl_80388E6C
/* 80388E64 00385DC4 38 00 00 02 */ li r0, 2
/* 80388E68 00385DC8 48 00 00 08 */ b lbl_80388E70
lbl_80388E6C:
/* 80388E6C 00385DCC 38 00 00 01 */ li r0, 1
lbl_80388E70:
/* 80388E70 00385DD0 A0 7D 00 F2 */ lhz r3, 0xf2(r29)
/* 80388E74 00385DD4 38 DD 00 F2 */ addi r6, r29, 0xf2
/* 80388E78 00385DD8 A8 AD AD BA */ lha r5, lbl_805A997A@sda21(r13)
/* 80388E7C 00385DDC 7C 79 07 34 */ extsh r25, r3
/* 80388E80 00385DE0 54 63 07 FE */ clrlwi r3, r3, 0x1f
/* 80388E84 00385DE4 7F 59 2A 14 */ add r26, r25, r5
/* 80388E88 00385DE8 7C 1A 18 00 */ cmpw r26, r3
/* 80388E8C 00385DEC 40 81 00 08 */ ble lbl_80388E94
/* 80388E90 00385DF0 48 00 00 08 */ b lbl_80388E98
lbl_80388E94:
/* 80388E94 00385DF4 7C 7A 1B 78 */ mr r26, r3
lbl_80388E98:
/* 80388E98 00385DF8 B3 5D 00 FA */ sth r26, 0xfa(r29)
/* 80388E9C 00385DFC 7C E7 07 34 */ extsh r7, r7
/* 80388EA0 00385E00 54 E7 08 3C */ slwi r7, r7, 1
/* 80388EA4 00385E04 A2 FB 00 00 */ lhz r23, 0(r27)
/* 80388EA8 00385E08 7C E3 38 50 */ subf r7, r3, r7
/* 80388EAC 00385E0C AB 06 00 00 */ lha r24, 0(r6)
/* 80388EB0 00385E10 3B FD 00 FA */ addi r31, r29, 0xfa
/* 80388EB4 00385E14 7E FA 07 34 */ extsh r26, r23
/* 80388EB8 00385E18 7F 3A 2A 14 */ add r25, r26, r5
/* 80388EBC 00385E1C 7F 38 CA 14 */ add r25, r24, r25
/* 80388EC0 00385E20 7F 47 C8 51 */ subf. r26, r7, r25
/* 80388EC4 00385E24 40 81 00 0C */ ble lbl_80388ED0
/* 80388EC8 00385E28 7F 27 C8 50 */ subf r25, r7, r25
/* 80388ECC 00385E2C 48 00 00 08 */ b lbl_80388ED4
lbl_80388ED0:
/* 80388ED0 00385E30 3B 20 00 00 */ li r25, 0
lbl_80388ED4:
/* 80388ED4 00385E34 7F 18 2A 14 */ add r24, r24, r5
/* 80388ED8 00385E38 7F 43 C0 51 */ subf. r26, r3, r24
/* 80388EDC 00385E3C 40 80 00 0C */ bge lbl_80388EE8
/* 80388EE0 00385E40 7F 43 C0 50 */ subf r26, r3, r24
/* 80388EE4 00385E44 48 00 00 08 */ b lbl_80388EEC
lbl_80388EE8:
/* 80388EE8 00385E48 3B 40 00 00 */ li r26, 0
lbl_80388EEC:
/* 80388EEC 00385E4C 7F 57 D2 14 */ add r26, r23, r26
/* 80388EF0 00385E50 7F 59 D0 50 */ subf r26, r25, r26
/* 80388EF4 00385E54 B3 5D 00 FC */ sth r26, 0xfc(r29)
/* 80388EF8 00385E58 AB 46 00 00 */ lha r26, 0(r6)
/* 80388EFC 00385E5C 7E FA 2A 14 */ add r23, r26, r5
/* 80388F00 00385E60 7F 43 B8 51 */ subf. r26, r3, r23
/* 80388F04 00385E64 40 80 00 0C */ bge lbl_80388F10
/* 80388F08 00385E68 7F 23 B8 50 */ subf r25, r3, r23
/* 80388F0C 00385E6C 48 00 00 08 */ b lbl_80388F14
lbl_80388F10:
/* 80388F10 00385E70 3B 20 00 00 */ li r25, 0
lbl_80388F14:
/* 80388F14 00385E74 7F 59 03 D6 */ divw r26, r25, r0
/* 80388F18 00385E78 A1 08 00 00 */ lhz r8, 0(r8)
/* 80388F1C 00385E7C 7D 1A 40 50 */ subf r8, r26, r8
/* 80388F20 00385E80 B1 1D 00 FE */ sth r8, 0xfe(r29)
/* 80388F24 00385E84 A9 1B 00 00 */ lha r8, 0(r27)
/* 80388F28 00385E88 AA E6 00 00 */ lha r23, 0(r6)
/* 80388F2C 00385E8C 7D 08 2A 14 */ add r8, r8, r5
/* 80388F30 00385E90 7D 17 42 14 */ add r8, r23, r8
/* 80388F34 00385E94 7C C7 40 51 */ subf. r6, r7, r8
/* 80388F38 00385E98 40 81 00 0C */ ble lbl_80388F44
/* 80388F3C 00385E9C 7C C7 40 50 */ subf r6, r7, r8
/* 80388F40 00385EA0 48 00 00 08 */ b lbl_80388F48
lbl_80388F44:
/* 80388F44 00385EA4 38 C0 00 00 */ li r6, 0
lbl_80388F48:
/* 80388F48 00385EA8 7C F7 2A 14 */ add r7, r23, r5
/* 80388F4C 00385EAC 7C A3 38 51 */ subf. r5, r3, r7
/* 80388F50 00385EB0 40 80 00 0C */ bge lbl_80388F5C
/* 80388F54 00385EB4 7C 63 38 50 */ subf r3, r3, r7
/* 80388F58 00385EB8 48 00 00 08 */ b lbl_80388F60
lbl_80388F5C:
/* 80388F5C 00385EBC 38 60 00 00 */ li r3, 0
lbl_80388F60:
/* 80388F60 00385EC0 7C 63 03 D6 */ divw r3, r3, r0
/* 80388F64 00385EC4 A0 84 00 00 */ lhz r4, 0(r4)
/* 80388F68 00385EC8 7C A6 03 D6 */ divw r5, r6, r0
/* 80388F6C 00385ECC 7C 04 1A 14 */ add r0, r4, r3
/* 80388F70 00385ED0 7C 05 00 50 */ subf r0, r5, r0
/* 80388F74 00385ED4 B0 1D 01 00 */ sth r0, 0x100(r29)
/* 80388F78 00385ED8 80 1D 01 34 */ lwz r0, 0x134(r29)
/* 80388F7C 00385EDC A0 A9 00 00 */ lhz r5, 0(r9)
/* 80388F80 00385EE0 2C 00 00 00 */ cmpwi r0, 0
/* 80388F84 00385EE4 A0 6A 00 00 */ lhz r3, 0(r10)
/* 80388F88 00385EE8 41 82 00 0C */ beq lbl_80388F94
/* 80388F8C 00385EEC 54 60 08 3C */ slwi r0, r3, 1
/* 80388F90 00385EF0 48 00 00 08 */ b lbl_80388F98
lbl_80388F94:
/* 80388F94 00385EF4 7C 60 1B 78 */ mr r0, r3
lbl_80388F98:
/* 80388F98 00385EF8 54 06 04 3E */ clrlwi r6, r0, 0x10
/* 80388F9C 00385EFC 7C 06 28 40 */ cmplw r6, r5
/* 80388FA0 00385F00 40 80 00 50 */ bge lbl_80388FF0
/* 80388FA4 00385F04 54 C4 40 2E */ slwi r4, r6, 8
/* 80388FA8 00385F08 38 04 FF FF */ addi r0, r4, -1
/* 80388FAC 00385F0C 7C 05 02 14 */ add r0, r5, r0
/* 80388FB0 00385F10 7C 00 2B 96 */ divwu r0, r0, r5
/* 80388FB4 00385F14 60 00 10 00 */ ori r0, r0, 0x1000
/* 80388FB8 00385F18 B0 1D 00 4A */ sth r0, 0x4a(r29)
/* 80388FBC 00385F1C 3C 00 04 00 */ lis r0, 0x400
/* 80388FC0 00385F20 80 8D AD C0 */ lwz r4, lbl_805A9980@sda21(r13)
/* 80388FC4 00385F24 80 AD AD C4 */ lwz r5, lbl_805A9984@sda21(r13)
/* 80388FC8 00385F28 7C A0 03 78 */ or r0, r5, r0
/* 80388FCC 00385F2C 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 80388FD0 00385F30 90 8D AD C0 */ stw r4, lbl_805A9980@sda21(r13)
/* 80388FD4 00385F34 B0 DD 00 70 */ sth r6, 0x70(r29)
/* 80388FD8 00385F38 80 8D AD C0 */ lwz r4, lbl_805A9980@sda21(r13)
/* 80388FDC 00385F3C 80 0D AD C4 */ lwz r0, lbl_805A9984@sda21(r13)
/* 80388FE0 00385F40 60 00 00 80 */ ori r0, r0, 0x80
/* 80388FE4 00385F44 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 80388FE8 00385F48 90 8D AD C0 */ stw r4, lbl_805A9980@sda21(r13)
/* 80388FEC 00385F4C 48 00 00 24 */ b lbl_80389010
lbl_80388FF0:
/* 80388FF0 00385F50 38 00 01 00 */ li r0, 0x100
/* 80388FF4 00385F54 B0 1D 00 4A */ sth r0, 0x4a(r29)
/* 80388FF8 00385F58 3C 00 04 00 */ lis r0, 0x400
/* 80388FFC 00385F5C 80 8D AD C0 */ lwz r4, lbl_805A9980@sda21(r13)
/* 80389000 00385F60 80 AD AD C4 */ lwz r5, lbl_805A9984@sda21(r13)
/* 80389004 00385F64 7C A0 03 78 */ or r0, r5, r0
/* 80389008 00385F68 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 8038900C 00385F6C 90 8D AD C0 */ stw r4, lbl_805A9980@sda21(r13)
lbl_80389010:
/* 80389010 00385F70 A0 9D 01 02 */ lhz r4, 0x102(r29)
/* 80389014 00385F74 38 DD 01 1C */ addi r6, r29, 0x11c
/* 80389018 00385F78 80 AC 00 00 */ lwz r5, 0(r12)
/* 8038901C 00385F7C 38 04 00 0F */ addi r0, r4, 0xf
/* 80389020 00385F80 A0 8B 00 00 */ lhz r4, 0(r11)
/* 80389024 00385F84 7C 00 26 70 */ srawi r0, r0, 4
/* 80389028 00385F88 7C 00 01 94 */ addze r0, r0
/* 8038902C 00385F8C 2C 05 00 00 */ cmpwi r5, 0
/* 80389030 00385F90 98 1D 01 1C */ stb r0, 0x11c(r29)
/* 80389034 00385F94 40 82 00 0C */ bne lbl_80389040
/* 80389038 00385F98 88 A6 00 00 */ lbz r5, 0(r6)
/* 8038903C 00385F9C 48 00 00 0C */ b lbl_80389048
lbl_80389040:
/* 80389040 00385FA0 88 06 00 00 */ lbz r0, 0(r6)
/* 80389044 00385FA4 54 05 0E 3C */ rlwinm r5, r0, 1, 0x18, 0x1e
lbl_80389048:
/* 80389048 00385FA8 7C 80 26 70 */ srawi r0, r4, 4
/* 8038904C 00385FAC 98 BD 01 1D */ stb r5, 0x11d(r29)
/* 80389050 00385FB0 7C 00 01 94 */ addze r0, r0
/* 80389054 00385FB4 54 00 20 36 */ slwi r0, r0, 4
/* 80389058 00385FB8 7C 00 20 10 */ subfc r0, r0, r4
/* 8038905C 00385FBC 98 1D 01 2C */ stb r0, 0x12c(r29)
/* 80389060 00385FC0 38 9D 01 2C */ addi r4, r29, 0x12c
/* 80389064 00385FC4 38 03 00 0F */ addi r0, r3, 0xf
/* 80389068 00385FC8 88 84 00 00 */ lbz r4, 0(r4)
/* 8038906C 00385FCC 3C 60 08 00 */ lis r3, 0x800
/* 80389070 00385FD0 7C 04 02 14 */ add r0, r4, r0
/* 80389074 00385FD4 7C 00 26 70 */ srawi r0, r0, 4
/* 80389078 00385FD8 7C 00 01 94 */ addze r0, r0
/* 8038907C 00385FDC 98 1D 01 1E */ stb r0, 0x11e(r29)
/* 80389080 00385FE0 88 1D 01 1E */ lbz r0, 0x11e(r29)
/* 80389084 00385FE4 88 9D 01 1D */ lbz r4, 0x11d(r29)
/* 80389088 00385FE8 50 04 44 2E */ rlwimi r4, r0, 8, 0x10, 0x17
/* 8038908C 00385FEC B0 9D 00 48 */ sth r4, 0x48(r29)
/* 80389090 00385FF0 80 8D AD C0 */ lwz r4, lbl_805A9980@sda21(r13)
/* 80389094 00385FF4 80 0D AD E8 */ lwz r0, lbl_805A99A8@sda21(r13)
/* 80389098 00385FF8 80 AD AD C4 */ lwz r5, lbl_805A9984@sda21(r13)
/* 8038909C 00385FFC 28 00 00 00 */ cmplwi r0, 0
/* 803890A0 00386000 7C A0 1B 78 */ or r0, r5, r3
/* 803890A4 00386004 90 0D AD C4 */ stw r0, lbl_805A9984@sda21(r13)
/* 803890A8 00386008 90 8D AD C0 */ stw r4, lbl_805A9980@sda21(r13)
/* 803890AC 0038600C 41 82 00 1C */ beq lbl_803890C8
/* 803890B0 00386010 38 7D 00 F0 */ addi r3, r29, 0xf0
/* 803890B4 00386014 38 9D 01 24 */ addi r4, r29, 0x124
/* 803890B8 00386018 38 BD 01 28 */ addi r5, r29, 0x128
/* 803890BC 0038601C 38 DD 01 3C */ addi r6, r29, 0x13c
/* 803890C0 00386020 38 FD 01 40 */ addi r7, r29, 0x140
/* 803890C4 00386024 4B FF F0 1D */ bl setFbbRegs
lbl_803890C8:
/* 803890C8 00386028 80 1D 01 30 */ lwz r0, 0x130(r29)
/* 803890CC 0038602C 90 01 00 08 */ stw r0, 8(r1)
/* 803890D0 00386030 A0 7F 00 00 */ lhz r3, 0(r31)
/* 803890D4 00386034 A0 9B 00 00 */ lhz r4, 0(r27)
/* 803890D8 00386038 88 BC 00 00 */ lbz r5, 0(r28)
/* 803890DC 0038603C A0 DC 00 02 */ lhz r6, 2(r28)
/* 803890E0 00386040 A0 FC 00 04 */ lhz r7, 4(r28)
/* 803890E4 00386044 A1 1C 00 06 */ lhz r8, 6(r28)
/* 803890E8 00386048 A1 3C 00 08 */ lhz r9, 8(r28)
/* 803890EC 0038604C A1 5C 00 0A */ lhz r10, 0xa(r28)
/* 803890F0 00386050 4B FF F2 C5 */ bl setVerticalRegs
/* 803890F4 00386054 7F C3 F3 78 */ mr r3, r30
/* 803890F8 00386058 4B FF 85 91 */ bl OSRestoreInterrupts
/* 803890FC 0038605C BA E1 00 2C */ lmw r23, 0x2c(r1)
/* 80389100 00386060 80 01 00 54 */ lwz r0, 0x54(r1)
/* 80389104 00386064 38 21 00 50 */ addi r1, r1, 0x50
/* 80389108 00386068 7C 08 03 A6 */ mtlr r0
/* 8038910C 0038606C 4E 80 00 20 */ blr
.global VIFlush
VIFlush:
/* 80389110 00386070 7C 08 02 A6 */ mflr r0
/* 80389114 00386074 3C 60 80 54 */ lis r3, lbl_80542040@ha
/* 80389118 00386078 90 01 00 04 */ stw r0, 4(r1)
/* 8038911C 0038607C 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 80389120 00386080 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 80389124 00386084 3B E3 20 40 */ addi r31, r3, lbl_80542040@l
/* 80389128 00386088 93 C1 00 18 */ stw r30, 0x18(r1)
/* 8038912C 0038608C 93 A1 00 14 */ stw r29, 0x14(r1)
/* 80389130 00386090 93 81 00 10 */ stw r28, 0x10(r1)
/* 80389134 00386094 4B FF 85 2D */ bl OSDisableInterrupts
/* 80389138 00386098 80 AD AD C8 */ lwz r5, lbl_805A9988@sda21(r13)
/* 8038913C 0038609C 3B C3 00 00 */ addi r30, r3, 0
/* 80389140 003860A0 38 00 00 00 */ li r0, 0
/* 80389144 003860A4 80 8D AD BC */ lwz r4, lbl_805A997C@sda21(r13)
/* 80389148 003860A8 7C A3 23 78 */ or r3, r5, r4
/* 8038914C 003860AC 90 6D AD C8 */ stw r3, lbl_805A9988@sda21(r13)
/* 80389150 003860B0 90 0D AD BC */ stw r0, lbl_805A997C@sda21(r13)
/* 80389154 003860B4 80 8D AD D0 */ lwz r4, lbl_805A9990@sda21(r13)
/* 80389158 003860B8 80 AD AD D4 */ lwz r5, lbl_805A9994@sda21(r13)
/* 8038915C 003860BC 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 80389160 003860C0 80 6D AD C4 */ lwz r3, lbl_805A9984@sda21(r13)
/* 80389164 003860C4 7C 80 03 78 */ or r0, r4, r0
/* 80389168 003860C8 7C A3 1B 78 */ or r3, r5, r3
/* 8038916C 003860CC 90 6D AD D4 */ stw r3, lbl_805A9994@sda21(r13)
/* 80389170 003860D0 90 0D AD D0 */ stw r0, lbl_805A9990@sda21(r13)
/* 80389174 003860D4 48 00 00 78 */ b lbl_803891EC
lbl_80389178:
/* 80389178 003860D8 80 6D AD C0 */ lwz r3, lbl_805A9980@sda21(r13)
/* 8038917C 003860DC 38 A0 00 20 */ li r5, 0x20
/* 80389180 003860E0 83 8D AD C4 */ lwz r28, lbl_805A9984@sda21(r13)
/* 80389184 003860E4 38 9C 00 00 */ addi r4, r28, 0
/* 80389188 003860E8 48 00 0D 91 */ bl __shr2u
/* 8038918C 003860EC 7C 84 00 34 */ cntlzw r4, r4
/* 80389190 003860F0 2C 04 00 20 */ cmpwi r4, 0x20
/* 80389194 003860F4 38 00 FF FF */ li r0, -1
/* 80389198 003860F8 7F 80 00 38 */ and r0, r28, r0
/* 8038919C 003860FC 40 80 00 08 */ bge lbl_803891A4
/* 803891A0 00386100 48 00 00 0C */ b lbl_803891AC
lbl_803891A4:
/* 803891A4 00386104 7C 03 00 34 */ cntlzw r3, r0
/* 803891A8 00386108 38 83 00 20 */ addi r4, r3, 0x20
lbl_803891AC:
/* 803891AC 0038610C 54 83 08 3C */ slwi r3, r4, 1
/* 803891B0 00386110 7C 1F 1A 2E */ lhzx r0, r31, r3
/* 803891B4 00386114 7C 7F 1A 14 */ add r3, r31, r3
/* 803891B8 00386118 20 A4 00 3F */ subfic r5, r4, 0x3f
/* 803891BC 0038611C B0 03 00 78 */ sth r0, 0x78(r3)
/* 803891C0 00386120 38 60 00 00 */ li r3, 0
/* 803891C4 00386124 38 80 00 01 */ li r4, 1
/* 803891C8 00386128 48 00 0D 2D */ bl __shl2i
/* 803891CC 0038612C 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 803891D0 00386130 7C 65 18 F8 */ nor r5, r3, r3
/* 803891D4 00386134 7C 84 20 F8 */ nor r4, r4, r4
/* 803891D8 00386138 80 6D AD C4 */ lwz r3, lbl_805A9984@sda21(r13)
/* 803891DC 0038613C 7C 00 28 38 */ and r0, r0, r5
/* 803891E0 00386140 7C 63 20 38 */ and r3, r3, r4
/* 803891E4 00386144 90 6D AD C4 */ stw r3, lbl_805A9984@sda21(r13)
/* 803891E8 00386148 90 0D AD C0 */ stw r0, lbl_805A9980@sda21(r13)
lbl_803891EC:
/* 803891EC 0038614C 80 0D AD C0 */ lwz r0, lbl_805A9980@sda21(r13)
/* 803891F0 00386150 38 60 00 00 */ li r3, 0
/* 803891F4 00386154 80 8D AD C4 */ lwz r4, lbl_805A9984@sda21(r13)
/* 803891F8 00386158 7C 00 1A 78 */ xor r0, r0, r3
/* 803891FC 0038615C 7C 83 1A 78 */ xor r3, r4, r3
/* 80389200 00386160 7C 60 03 79 */ or. r0, r3, r0
/* 80389204 00386164 40 82 FF 74 */ bne lbl_80389178
/* 80389208 00386168 38 00 00 01 */ li r0, 1
/* 8038920C 0038616C 90 0D AD A0 */ stw r0, lbl_805A9960@sda21(r13)
/* 80389210 00386170 7F C3 F3 78 */ mr r3, r30
/* 80389214 00386174 80 1F 01 20 */ lwz r0, 0x120(r31)
/* 80389218 00386178 90 0D AD E0 */ stw r0, lbl_805A99A0@sda21(r13)
/* 8038921C 0038617C 4B FF 84 6D */ bl OSRestoreInterrupts
/* 80389220 00386180 80 01 00 24 */ lwz r0, 0x24(r1)
/* 80389224 00386184 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 80389228 00386188 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 8038922C 0038618C 83 A1 00 14 */ lwz r29, 0x14(r1)
/* 80389230 00386190 83 81 00 10 */ lwz r28, 0x10(r1)
/* 80389234 00386194 38 21 00 20 */ addi r1, r1, 0x20
/* 80389238 00386198 7C 08 03 A6 */ mtlr r0
/* 8038923C 0038619C 4E 80 00 20 */ blr
.global VISetNextFrameBuffer
VISetNextFrameBuffer:
/* 80389240 003861A0 7C 08 02 A6 */ mflr r0
/* 80389244 003861A4 3C 80 80 54 */ lis r4, lbl_80542040@ha
/* 80389248 003861A8 90 01 00 04 */ stw r0, 4(r1)
/* 8038924C 003861AC 94 21 FF E8 */ stwu r1, -0x18(r1)
/* 80389250 003861B0 93 E1 00 14 */ stw r31, 0x14(r1)
/* 80389254 003861B4 3B E4 20 40 */ addi r31, r4, lbl_80542040@l
/* 80389258 003861B8 93 C1 00 10 */ stw r30, 0x10(r1)
/* 8038925C 003861BC 3B C3 00 00 */ addi r30, r3, 0
/* 80389260 003861C0 4B FF 84 01 */ bl OSDisableInterrupts
/* 80389264 003861C4 93 DF 01 20 */ stw r30, 0x120(r31)
/* 80389268 003861C8 38 00 00 01 */ li r0, 1
/* 8038926C 003861CC 3B C3 00 00 */ addi r30, r3, 0
/* 80389270 003861D0 90 0D AD E8 */ stw r0, lbl_805A99A8@sda21(r13)
/* 80389274 003861D4 38 7F 00 F0 */ addi r3, r31, 0xf0
/* 80389278 003861D8 38 9F 01 24 */ addi r4, r31, 0x124
/* 8038927C 003861DC 38 BF 01 28 */ addi r5, r31, 0x128
/* 80389280 003861E0 38 DF 01 3C */ addi r6, r31, 0x13c
/* 80389284 003861E4 38 FF 01 40 */ addi r7, r31, 0x140
/* 80389288 003861E8 4B FF EE 59 */ bl setFbbRegs
/* 8038928C 003861EC 7F C3 F3 78 */ mr r3, r30
/* 80389290 003861F0 4B FF 83 F9 */ bl OSRestoreInterrupts
/* 80389294 003861F4 80 01 00 1C */ lwz r0, 0x1c(r1)
/* 80389298 003861F8 83 E1 00 14 */ lwz r31, 0x14(r1)
/* 8038929C 003861FC 83 C1 00 10 */ lwz r30, 0x10(r1)
/* 803892A0 00386200 38 21 00 18 */ addi r1, r1, 0x18
/* 803892A4 00386204 7C 08 03 A6 */ mtlr r0
/* 803892A8 00386208 4E 80 00 20 */ blr
.global VISetBlack
VISetBlack:
/* 803892AC 0038620C 7C 08 02 A6 */ mflr r0
/* 803892B0 00386210 3C 80 80 54 */ lis r4, lbl_80542040@ha
/* 803892B4 00386214 90 01 00 04 */ stw r0, 4(r1)
/* 803892B8 00386218 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 803892BC 0038621C 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 803892C0 00386220 3B E4 20 40 */ addi r31, r4, lbl_80542040@l
/* 803892C4 00386224 93 C1 00 18 */ stw r30, 0x18(r1)
/* 803892C8 00386228 3B C3 00 00 */ addi r30, r3, 0
/* 803892CC 0038622C 4B FF 83 95 */ bl OSDisableInterrupts
/* 803892D0 00386230 93 DF 01 30 */ stw r30, 0x130(r31)
/* 803892D4 00386234 7C 7E 1B 78 */ mr r30, r3
/* 803892D8 00386238 81 5F 01 44 */ lwz r10, 0x144(r31)
/* 803892DC 0038623C 80 1F 01 30 */ lwz r0, 0x130(r31)
/* 803892E0 00386240 90 01 00 08 */ stw r0, 8(r1)
/* 803892E4 00386244 A0 7F 00 FA */ lhz r3, 0xfa(r31)
/* 803892E8 00386248 A0 9F 00 F6 */ lhz r4, 0xf6(r31)
/* 803892EC 0038624C 88 AA 00 00 */ lbz r5, 0(r10)
/* 803892F0 00386250 A0 CA 00 02 */ lhz r6, 2(r10)
/* 803892F4 00386254 A0 EA 00 04 */ lhz r7, 4(r10)
/* 803892F8 00386258 A1 0A 00 06 */ lhz r8, 6(r10)
/* 803892FC 0038625C A1 2A 00 08 */ lhz r9, 8(r10)
/* 80389300 00386260 A1 4A 00 0A */ lhz r10, 0xa(r10)
/* 80389304 00386264 4B FF F0 B1 */ bl setVerticalRegs
/* 80389308 00386268 7F C3 F3 78 */ mr r3, r30
/* 8038930C 0038626C 4B FF 83 7D */ bl OSRestoreInterrupts
/* 80389310 00386270 80 01 00 24 */ lwz r0, 0x24(r1)
/* 80389314 00386274 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 80389318 00386278 83 C1 00 18 */ lwz r30, 0x18(r1)
/* 8038931C 0038627C 38 21 00 20 */ addi r1, r1, 0x20
/* 80389320 00386280 7C 08 03 A6 */ mtlr r0
/* 80389324 00386284 4E 80 00 20 */ blr
.global VIGetRetraceCount
VIGetRetraceCount:
/* 80389328 00386288 80 6D AD 9C */ lwz r3, lbl_805A995C@sda21(r13)
/* 8038932C 0038628C 4E 80 00 20 */ blr
.global getCurrentFieldEvenOdd
getCurrentFieldEvenOdd:
/* 80389330 00386290 3C 60 CC 00 */ lis r3, 0xCC002000@ha
/* 80389334 00386294 38 E3 20 00 */ addi r7, r3, 0xCC002000@l
/* 80389338 00386298 A4 07 00 2C */ lhzu r0, 0x2c(r7)
/* 8038933C 0038629C 38 83 20 00 */ addi r4, r3, 0x2000
/* 80389340 003862A0 54 05 05 7E */ clrlwi r5, r0, 0x15
lbl_80389344:
/* 80389344 003862A4 A0 07 00 00 */ lhz r0, 0(r7)
/* 80389348 003862A8 7C A6 2B 78 */ mr r6, r5
/* 8038934C 003862AC A0 64 00 2E */ lhz r3, 0x2e(r4)
/* 80389350 003862B0 54 05 05 7E */ clrlwi r5, r0, 0x15
/* 80389354 003862B4 7C 06 28 40 */ cmplw r6, r5
/* 80389358 003862B8 54 63 05 7E */ clrlwi r3, r3, 0x15
/* 8038935C 003862BC 40 82 FF E8 */ bne lbl_80389344
/* 80389360 003862C0 80 CD AD D8 */ lwz r6, lbl_805A9998@sda21(r13)
/* 80389364 003862C4 38 05 FF FF */ addi r0, r5, -1
/* 80389368 003862C8 38 83 FF FF */ addi r4, r3, -1
/* 8038936C 003862CC A0 66 00 1A */ lhz r3, 0x1a(r6)
/* 80389370 003862D0 54 05 08 3C */ slwi r5, r0, 1
/* 80389374 003862D4 A0 06 00 18 */ lhz r0, 0x18(r6)
/* 80389378 003862D8 7C 64 1B 96 */ divwu r3, r4, r3
/* 8038937C 003862DC 7C 65 1A 14 */ add r3, r5, r3
/* 80389380 003862E0 7C 03 00 40 */ cmplw r3, r0
/* 80389384 003862E4 40 80 00 0C */ bge lbl_80389390
/* 80389388 003862E8 38 60 00 01 */ li r3, 1
/* 8038938C 003862EC 4E 80 00 20 */ blr
lbl_80389390:
/* 80389390 003862F0 38 60 00 00 */ li r3, 0
/* 80389394 003862F4 4E 80 00 20 */ blr
.global VIGetNextField
VIGetNextField:
/* 80389398 003862F8 7C 08 02 A6 */ mflr r0
/* 8038939C 003862FC 90 01 00 04 */ stw r0, 4(r1)
/* 803893A0 00386300 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 803893A4 00386304 93 E1 00 1C */ stw r31, 0x1c(r1)
/* 803893A8 00386308 4B FF 82 B9 */ bl OSDisableInterrupts
/* 803893AC 0038630C 3C 80 CC 00 */ lis r4, 0xCC002000@ha
/* 803893B0 00386310 39 04 20 00 */ addi r8, r4, 0xCC002000@l
/* 803893B4 00386314 A4 08 00 2C */ lhzu r0, 0x2c(r8)
/* 803893B8 00386318 38 A4 20 00 */ addi r5, r4, 0x2000
/* 803893BC 0038631C 54 06 05 7E */ clrlwi r6, r0, 0x15
lbl_803893C0:
/* 803893C0 00386320 A0 08 00 00 */ lhz r0, 0(r8)
/* 803893C4 00386324 7C C7 33 78 */ mr r7, r6
/* 803893C8 00386328 A0 85 00 2E */ lhz r4, 0x2e(r5)
/* 803893CC 0038632C 54 06 05 7E */ clrlwi r6, r0, 0x15
/* 803893D0 00386330 7C 07 30 40 */ cmplw r7, r6
/* 803893D4 00386334 54 84 05 7E */ clrlwi r4, r4, 0x15
/* 803893D8 00386338 40 82 FF E8 */ bne lbl_803893C0
/* 803893DC 0038633C 80 ED AD D8 */ lwz r7, lbl_805A9998@sda21(r13)
/* 803893E0 00386340 38 06 FF FF */ addi r0, r6, -1
/* 803893E4 00386344 38 A4 FF FF */ addi r5, r4, -1
/* 803893E8 00386348 A0 87 00 1A */ lhz r4, 0x1a(r7)
/* 803893EC 0038634C 54 06 08 3C */ slwi r6, r0, 1
/* 803893F0 00386350 A0 07 00 18 */ lhz r0, 0x18(r7)
/* 803893F4 00386354 7C 85 23 96 */ divwu r4, r5, r4
/* 803893F8 00386358 7C 86 22 14 */ add r4, r6, r4
/* 803893FC 0038635C 7C 04 00 40 */ cmplw r4, r0
/* 80389400 00386360 40 80 00 0C */ bge lbl_8038940C
/* 80389404 00386364 3B E0 00 01 */ li r31, 1
/* 80389408 00386368 48 00 00 08 */ b lbl_80389410
lbl_8038940C:
/* 8038940C 0038636C 3B E0 00 00 */ li r31, 0
lbl_80389410:
/* 80389410 00386370 4B FF 82 79 */ bl OSRestoreInterrupts
/* 80389414 00386374 3C 60 80 54 */ lis r3, lbl_80542130@ha
/* 80389418 00386378 38 63 21 30 */ addi r3, r3, lbl_80542130@l
/* 8038941C 0038637C A0 03 00 0A */ lhz r0, 0xa(r3)
/* 80389420 00386380 6B E3 00 01 */ xori r3, r31, 1
/* 80389424 00386384 54 00 07 FE */ clrlwi r0, r0, 0x1f
/* 80389428 00386388 7C 63 02 78 */ xor r3, r3, r0
/* 8038942C 0038638C 80 01 00 24 */ lwz r0, 0x24(r1)
/* 80389430 00386390 83 E1 00 1C */ lwz r31, 0x1c(r1)
/* 80389434 00386394 38 21 00 20 */ addi r1, r1, 0x20
/* 80389438 00386398 7C 08 03 A6 */ mtlr r0
/* 8038943C 0038639C 4E 80 00 20 */ blr
.global VIGetCurrentLine
VIGetCurrentLine:
/* 80389440 003863A0 7C 08 02 A6 */ mflr r0
/* 80389444 003863A4 90 01 00 04 */ stw r0, 4(r1)
/* 80389448 003863A8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8038944C 003863AC 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80389450 003863B0 93 C1 00 08 */ stw r30, 8(r1)
/* 80389454 003863B4 83 ED AD D8 */ lwz r31, lbl_805A9998@sda21(r13)
/* 80389458 003863B8 4B FF 82 09 */ bl OSDisableInterrupts
/* 8038945C 003863BC 3C 80 CC 00 */ lis r4, 0xCC002000@ha
/* 80389460 003863C0 39 04 20 00 */ addi r8, r4, 0xCC002000@l
/* 80389464 003863C4 A4 08 00 2C */ lhzu r0, 0x2c(r8)
/* 80389468 003863C8 38 A4 20 00 */ addi r5, r4, 0x2000
/* 8038946C 003863CC 54 06 05 7E */ clrlwi r6, r0, 0x15
lbl_80389470:
/* 80389470 003863D0 A0 08 00 00 */ lhz r0, 0(r8)
/* 80389474 003863D4 7C C7 33 78 */ mr r7, r6
/* 80389478 003863D8 A0 85 00 2E */ lhz r4, 0x2e(r5)
/* 8038947C 003863DC 54 06 05 7E */ clrlwi r6, r0, 0x15
/* 80389480 003863E0 7C 07 30 40 */ cmplw r7, r6
/* 80389484 003863E4 54 87 05 7E */ clrlwi r7, r4, 0x15
/* 80389488 003863E8 40 82 FF E8 */ bne lbl_80389470
/* 8038948C 003863EC 80 8D AD D8 */ lwz r4, lbl_805A9998@sda21(r13)
/* 80389490 003863F0 38 A7 FF FF */ addi r5, r7, -1
/* 80389494 003863F4 38 C6 FF FF */ addi r6, r6, -1
/* 80389498 003863F8 A0 04 00 1A */ lhz r0, 0x1a(r4)
/* 8038949C 003863FC 54 C4 08 3C */ slwi r4, r6, 1
/* 803894A0 00386400 7C 05 03 96 */ divwu r0, r5, r0
/* 803894A4 00386404 7F C4 02 14 */ add r30, r4, r0
/* 803894A8 00386408 4B FF 81 E1 */ bl OSRestoreInterrupts
/* 803894AC 0038640C A0 1F 00 18 */ lhz r0, 0x18(r31)
/* 803894B0 00386410 7C 1E 00 40 */ cmplw r30, r0
/* 803894B4 00386414 41 80 00 08 */ blt lbl_803894BC
/* 803894B8 00386418 7F C0 F0 50 */ subf r30, r0, r30
lbl_803894BC:
/* 803894BC 0038641C 57 C3 F8 7E */ srwi r3, r30, 1
/* 803894C0 00386420 80 01 00 14 */ lwz r0, 0x14(r1)
/* 803894C4 00386424 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 803894C8 00386428 83 C1 00 08 */ lwz r30, 8(r1)
/* 803894CC 0038642C 38 21 00 10 */ addi r1, r1, 0x10
/* 803894D0 00386430 7C 08 03 A6 */ mtlr r0
/* 803894D4 00386434 4E 80 00 20 */ blr
.global VIGetTvFormat
VIGetTvFormat:
/* 803894D8 00386438 7C 08 02 A6 */ mflr r0
/* 803894DC 0038643C 90 01 00 04 */ stw r0, 4(r1)
/* 803894E0 00386440 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 803894E4 00386444 93 E1 00 0C */ stw r31, 0xc(r1)
/* 803894E8 00386448 4B FF 81 79 */ bl OSDisableInterrupts
/* 803894EC 0038644C 80 AD AD DC */ lwz r5, lbl_805A999C@sda21(r13)
/* 803894F0 00386450 28 05 00 06 */ cmplwi r5, 6
/* 803894F4 00386454 41 81 00 30 */ bgt lbl_80389524
/* 803894F8 00386458 3C 80 80 3F */ lis r4, lbl_803F275C@ha
/* 803894FC 0038645C 38 84 27 5C */ addi r4, r4, lbl_803F275C@l
/* 80389500 00386460 54 A0 10 3A */ slwi r0, r5, 2
/* 80389504 00386464 7C 04 00 2E */ lwzx r0, r4, r0
/* 80389508 00386468 7C 09 03 A6 */ mtctr r0
/* 8038950C 0038646C 4E 80 04 20 */ bctr
lbl_80389510:
/* 80389510 00386470 3B E0 00 00 */ li r31, 0
/* 80389514 00386474 48 00 00 10 */ b lbl_80389524
lbl_80389518:
/* 80389518 00386478 3B E0 00 01 */ li r31, 1
/* 8038951C 0038647C 48 00 00 08 */ b lbl_80389524
lbl_80389520:
/* 80389520 00386480 7C BF 2B 78 */ mr r31, r5
lbl_80389524:
/* 80389524 00386484 4B FF 81 65 */ bl OSRestoreInterrupts
/* 80389528 00386488 7F E3 FB 78 */ mr r3, r31
/* 8038952C 0038648C 80 01 00 14 */ lwz r0, 0x14(r1)
/* 80389530 00386490 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80389534 00386494 38 21 00 10 */ addi r1, r1, 0x10
/* 80389538 00386498 7C 08 03 A6 */ mtlr r0
/* 8038953C 0038649C 4E 80 00 20 */ blr
.global VIGetDTVStatus
VIGetDTVStatus:
/* 80389540 003864A0 7C 08 02 A6 */ mflr r0
/* 80389544 003864A4 90 01 00 04 */ stw r0, 4(r1)
/* 80389548 003864A8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8038954C 003864AC 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80389550 003864B0 4B FF 81 11 */ bl OSDisableInterrupts
/* 80389554 003864B4 3C 80 CC 00 */ lis r4, 0xCC00206E@ha
/* 80389558 003864B8 A0 04 20 6E */ lhz r0, 0xCC00206E@l(r4)
/* 8038955C 003864BC 54 1F 07 BE */ clrlwi r31, r0, 0x1e
/* 80389560 003864C0 4B FF 81 29 */ bl OSRestoreInterrupts
/* 80389564 003864C4 57 E3 07 FE */ clrlwi r3, r31, 0x1f
/* 80389568 003864C8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8038956C 003864CC 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 80389570 003864D0 38 21 00 10 */ addi r1, r1, 0x10
/* 80389574 003864D4 7C 08 03 A6 */ mtlr r0
/* 80389578 003864D8 4E 80 00 20 */ blr