215 lines
11 KiB
ArmAsm
215 lines
11 KiB
ArmAsm
.include "macros.inc"
|
|
|
|
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
|
|
.global TRKSaveExtended1Block
|
|
TRKSaveExtended1Block:
|
|
/* 80016BDC 00012A1C 3C 40 80 49 */ lis r2, gTRKCPUState@h
|
|
/* 80016BE0 00012A20 60 42 8C 68 */ ori r2, r2, gTRKCPUState@l
|
|
/* 80016BE4 00012A24 7E 00 04 A6 */ mfsr r16, 0
|
|
/* 80016BE8 00012A28 7E 21 04 A6 */ mfsr r17, 1
|
|
/* 80016BEC 00012A2C 7E 42 04 A6 */ mfsr r18, 2
|
|
/* 80016BF0 00012A30 7E 63 04 A6 */ mfsr r19, 3
|
|
/* 80016BF4 00012A34 7E 84 04 A6 */ mfsr r20, 4
|
|
/* 80016BF8 00012A38 7E A5 04 A6 */ mfsr r21, 5
|
|
/* 80016BFC 00012A3C 7E C6 04 A6 */ mfsr r22, 6
|
|
/* 80016C00 00012A40 7E E7 04 A6 */ mfsr r23, 7
|
|
/* 80016C04 00012A44 7F 08 04 A6 */ mfsr r24, 8
|
|
/* 80016C08 00012A48 7F 29 04 A6 */ mfsr r25, 9
|
|
/* 80016C0C 00012A4C 7F 4A 04 A6 */ mfsr r26, 10
|
|
/* 80016C10 00012A50 7F 6B 04 A6 */ mfsr r27, 11
|
|
/* 80016C14 00012A54 7F 8C 04 A6 */ mfsr r28, 12
|
|
/* 80016C18 00012A58 7F AD 04 A6 */ mfsr r29, 13
|
|
/* 80016C1C 00012A5C 7F CE 04 A6 */ mfsr r30, 14
|
|
/* 80016C20 00012A60 7F EF 04 A6 */ mfsr r31, 15
|
|
/* 80016C24 00012A64 BE 02 01 A8 */ stmw r16, 0x1a8(r2)
|
|
/* 80016C28 00012A68 7F 6C 42 E6 */ .4byte 0x7F6C42E6 /* <illegal> */
|
|
/* 80016C2C 00012A6C 7F 8D 42 E6 */ .4byte 0x7F8D42E6 /* <illegal> */
|
|
/* 80016C30 00012A70 7F B0 FA A6 */ mfspr r29, HID0
|
|
/* 80016C34 00012A74 7F D1 FA A6 */ mfspr r30, HID1
|
|
/* 80016C38 00012A78 7F FB 02 A6 */ mfsrr1 r31
|
|
/* 80016C3C 00012A7C BF 62 01 E8 */ stmw r27, 0x1e8(r2)
|
|
/* 80016C40 00012A80 7D FF 42 A6 */ mfspr r15, PVR
|
|
/* 80016C44 00012A84 7E 10 82 A6 */ mfibatu r16, 0
|
|
/* 80016C48 00012A88 7E 31 82 A6 */ mfibatl r17, 0
|
|
/* 80016C4C 00012A8C 7E 52 82 A6 */ mfibatu r18, 1
|
|
/* 80016C50 00012A90 7E 73 82 A6 */ mfibatl r19, 1
|
|
/* 80016C54 00012A94 7E 94 82 A6 */ mfibatu r20, 2
|
|
/* 80016C58 00012A98 7E B5 82 A6 */ mfibatl r21, 2
|
|
/* 80016C5C 00012A9C 7E D6 82 A6 */ mfibatu r22, 3
|
|
/* 80016C60 00012AA0 7E F7 82 A6 */ mfibatl r23, 3
|
|
/* 80016C64 00012AA4 7F 18 82 A6 */ mfdbatu r24, 0
|
|
/* 80016C68 00012AA8 7F 39 82 A6 */ mfdbatl r25, 0
|
|
/* 80016C6C 00012AAC 7F 5A 82 A6 */ mfdbatu r26, 1
|
|
/* 80016C70 00012AB0 7F 7B 82 A6 */ mfdbatl r27, 1
|
|
/* 80016C74 00012AB4 7F 9C 82 A6 */ mfdbatu r28, 2
|
|
/* 80016C78 00012AB8 7F BD 82 A6 */ mfdbatl r29, 2
|
|
/* 80016C7C 00012ABC 7F DE 82 A6 */ mfdbatu r30, 3
|
|
/* 80016C80 00012AC0 7F FF 82 A6 */ mfdbatl r31, 3
|
|
/* 80016C84 00012AC4 BD E2 01 FC */ stmw r15, 0x1fc(r2)
|
|
/* 80016C88 00012AC8 7F 10 8A A6 */ mfspr r24, 560
|
|
/* 80016C8C 00012ACC 7F 31 8A A6 */ mfspr r25, 561
|
|
/* 80016C90 00012AD0 7F 52 8A A6 */ mfspr r26, 562
|
|
/* 80016C94 00012AD4 7F 73 8A A6 */ mfspr r27, 563
|
|
/* 80016C98 00012AD8 7F 94 8A A6 */ mfspr r28, 564
|
|
/* 80016C9C 00012ADC 7F B5 8A A6 */ mfspr r29, 565
|
|
/* 80016CA0 00012AE0 7F D6 8A A6 */ mfspr r30, 566
|
|
/* 80016CA4 00012AE4 7F F7 8A A6 */ mfspr r31, 567
|
|
/* 80016CA8 00012AE8 BF 02 02 40 */ stmw r24, 0x240(r2)
|
|
/* 80016CAC 00012AEC 7E D9 02 A6 */ mfsdr1 r22
|
|
/* 80016CB0 00012AF0 7E F3 02 A6 */ mfdar r23
|
|
/* 80016CB4 00012AF4 7F 12 02 A6 */ mfdsisr r24
|
|
/* 80016CB8 00012AF8 7F 30 42 A6 */ mfsprg r25, 0
|
|
/* 80016CBC 00012AFC 7F 51 42 A6 */ mfsprg r26, 1
|
|
/* 80016CC0 00012B00 7F 72 42 A6 */ mfsprg r27, 2
|
|
/* 80016CC4 00012B04 7F 93 42 A6 */ mfsprg r28, 3
|
|
/* 80016CC8 00012B08 7F B6 02 A6 */ mfdec r29
|
|
/* 80016CCC 00012B0C 7F D2 FA A6 */ mfspr r30, IABR
|
|
/* 80016CD0 00012B10 7F FA 42 A6 */ mfear r31
|
|
/* 80016CD4 00012B14 BE C2 02 5C */ stmw r22, 0x25c(r2)
|
|
/* 80016CD8 00012B18 7F 15 FA A6 */ mfspr r24, DABR
|
|
/* 80016CDC 00012B1C 7F 39 EA A6 */ mfspr r25, PMC1
|
|
/* 80016CE0 00012B20 7F 5A EA A6 */ mfspr r26, PMC2
|
|
/* 80016CE4 00012B24 7F 7D EA A6 */ mfspr r27, PMC3
|
|
/* 80016CE8 00012B28 7F 9E EA A6 */ mfspr r28, PMC4
|
|
/* 80016CEC 00012B2C 7F BB EA A6 */ mfspr r29, SIA
|
|
/* 80016CF0 00012B30 7F D8 EA A6 */ mfspr r30, MMCR0
|
|
/* 80016CF4 00012B34 7F FC EA A6 */ mfspr r31, MMCR1
|
|
/* 80016CF8 00012B38 BF 02 02 84 */ stmw r24, 0x284(r2)
|
|
/* 80016CFC 00012B3C 7F B7 8A A6 */ mfspr r29, 567
|
|
/* 80016D00 00012B40 7F D8 8A A6 */ mfspr r30, 568
|
|
/* 80016D04 00012B44 7F F9 8A A6 */ mfspr r31, 569
|
|
/* 80016D08 00012B48 BF A2 02 A4 */ stmw r29, 0x2a4(r2)
|
|
/* 80016D0C 00012B4C 7F DB FA A6 */ mfspr r30, ICTC
|
|
/* 80016D10 00012B50 7F F9 FA A6 */ mfspr r31, L2CR
|
|
/* 80016D14 00012B54 BF C2 02 B0 */ stmw r30, 0x2b0(r2)
|
|
/* 80016D18 00012B58 7E 1A 02 A6 */ mfsrr0 r16
|
|
/* 80016D1C 00012B5C 92 02 02 B8 */ stw r16, 0x2b8(r2)
|
|
/* 80016D20 00012B60 7E 3A 8A A6 */ mfspr r17, 570
|
|
/* 80016D24 00012B64 92 22 02 BC */ stw r17, 0x2bc(r2)
|
|
/* 80016D28 00012B68 7F 28 EA A6 */ mfspr r25, UMMCR0
|
|
/* 80016D2C 00012B6C 7F 49 EA A6 */ mfspr r26, UPMC1
|
|
/* 80016D30 00012B70 7F 6A EA A6 */ mfspr r27, UPMC2
|
|
/* 80016D34 00012B74 7F 8B EA A6 */ mfspr r28, USIA
|
|
/* 80016D38 00012B78 7F AC EA A6 */ mfspr r29, UMMCR1
|
|
/* 80016D3C 00012B7C 7F CD EA A6 */ mfspr r30, UPMC3
|
|
/* 80016D40 00012B80 7F EE EA A6 */ mfspr r31, UPMC4
|
|
/* 80016D44 00012B84 BF 22 02 C0 */ stmw r25, 0x2c0(r2)
|
|
/* 80016D48 00012B88 7F 3B 8A A6 */ mfspr r25, 571
|
|
/* 80016D4C 00012B8C 7F 5C 8A A6 */ mfspr r26, 572
|
|
/* 80016D50 00012B90 7F 7D 8A A6 */ mfspr r27, 573
|
|
/* 80016D54 00012B94 7F 9E 8A A6 */ mfspr r28, 574
|
|
/* 80016D58 00012B98 7F BF 8A A6 */ mfspr r29, 575
|
|
/* 80016D5C 00012B9C 7F D8 E2 A6 */ mfspr r30, HID2
|
|
/* 80016D60 00012BA0 7F F3 FA A6 */ mfspr r31, 1011
|
|
/* 80016D64 00012BA4 BF 22 02 DC */ stmw r25, 0x2dc(r2)
|
|
/* 80016D68 00012BA8 7E 90 E2 A6 */ mfspr r20, GQR0
|
|
/* 80016D6C 00012BAC 7E B1 E2 A6 */ mfspr r21, GQR1
|
|
/* 80016D70 00012BB0 7E D2 E2 A6 */ mfspr r22, GQR2
|
|
/* 80016D74 00012BB4 7E F3 E2 A6 */ mfspr r23, GQR3
|
|
/* 80016D78 00012BB8 7F 14 E2 A6 */ mfspr r24, GQR4
|
|
/* 80016D7C 00012BBC 7F 35 E2 A6 */ mfspr r25, GQR5
|
|
/* 80016D80 00012BC0 7F 56 E2 A6 */ mfspr r26, GQR6
|
|
/* 80016D84 00012BC4 7F 77 E2 A6 */ mfspr r27, GQR7
|
|
/* 80016D88 00012BC8 7F 98 E2 A6 */ mfspr r28, HID2
|
|
/* 80016D8C 00012BCC 7F B9 E2 A6 */ mfspr r29, WPAR
|
|
/* 80016D90 00012BD0 7F DA E2 A6 */ mfspr r30, DMA_U
|
|
/* 80016D94 00012BD4 7F FB E2 A6 */ mfspr r31, DMA_L
|
|
/* 80016D98 00012BD8 BE 82 02 FC */ stmw r20, 0x2fc(r2)
|
|
/* 80016D9C 00012BDC 4E 80 00 20 */ blr
|
|
.global TRKRestoreExtended1Block
|
|
TRKRestoreExtended1Block:
|
|
/* 80016DA0 00012BE0 3C 40 80 49 */ lis r2, gTRKCPUState@h
|
|
/* 80016DA4 00012BE4 60 42 8C 68 */ ori r2, r2, gTRKCPUState@l
|
|
/* 80016DA8 00012BE8 3C A0 80 49 */ lis r5, gTRKRestoreFlags@h
|
|
/* 80016DAC 00012BEC 60 A5 8A F0 */ ori r5, r5, gTRKRestoreFlags@l
|
|
/* 80016DB0 00012BF0 88 65 00 00 */ lbz r3, 0x0(r5)
|
|
/* 80016DB4 00012BF4 88 C5 00 01 */ lbz r6, 0x1(r5)
|
|
/* 80016DB8 00012BF8 38 00 00 00 */ li r0, 0x0
|
|
/* 80016DBC 00012BFC 98 05 00 00 */ stb r0, 0x0(r5)
|
|
/* 80016DC0 00012C00 98 05 00 01 */ stb r0, 0x1(r5)
|
|
/* 80016DC4 00012C04 2C 03 00 00 */ cmpwi r3, 0x0
|
|
/* 80016DC8 00012C08 41 82 00 14 */ beq lbl_80016DDC
|
|
/* 80016DCC 00012C0C 83 02 01 E8 */ lwz r24, 0x1e8(r2)
|
|
/* 80016DD0 00012C10 83 22 01 EC */ lwz r25, 0x1ec(r2)
|
|
/* 80016DD4 00012C14 7F 1C 43 A6 */ mttbl r24
|
|
/* 80016DD8 00012C18 7F 3D 43 A6 */ mttbu r25
|
|
.global lbl_80016DDC
|
|
lbl_80016DDC:
|
|
/* 80016DDC 00012C1C BA 82 02 FC */ lmw r20, 0x2fc(r2)
|
|
/* 80016DE0 00012C20 7E 90 E3 A6 */ mtspr GQR0, r20
|
|
/* 80016DE4 00012C24 7E B1 E3 A6 */ mtspr GQR1, r21
|
|
/* 80016DE8 00012C28 7E D2 E3 A6 */ mtspr GQR2, r22
|
|
/* 80016DEC 00012C2C 7E F3 E3 A6 */ mtspr GQR3, r23
|
|
/* 80016DF0 00012C30 7F 14 E3 A6 */ mtspr GQR4, r24
|
|
/* 80016DF4 00012C34 7F 35 E3 A6 */ mtspr GQR5, r25
|
|
/* 80016DF8 00012C38 7F 56 E3 A6 */ mtspr GQR6, r26
|
|
/* 80016DFC 00012C3C 7F 77 E3 A6 */ mtspr GQR7, r27
|
|
/* 80016E00 00012C40 7F 98 E3 A6 */ mtspr HID2, r28
|
|
/* 80016E04 00012C44 7F DA E3 A6 */ mtspr DMA_U, r30
|
|
/* 80016E08 00012C48 7F FB E3 A6 */ mtspr DMA_L, r31
|
|
/* 80016E0C 00012C4C 48 00 00 04 */ b lbl_80016E10
|
|
.global lbl_80016E10
|
|
lbl_80016E10:
|
|
/* 80016E10 00012C50 BA 62 02 84 */ lmw r19, 0x284(r2)
|
|
/* 80016E14 00012C54 7E 75 FB A6 */ mtspr DABR, r19
|
|
/* 80016E18 00012C58 7E 99 EB A6 */ mtspr PMC1, r20
|
|
/* 80016E1C 00012C5C 7E BA EB A6 */ mtspr PMC2, r21
|
|
/* 80016E20 00012C60 7E DD EB A6 */ mtspr PMC3, r22
|
|
/* 80016E24 00012C64 7E FE EB A6 */ mtspr PMC4, r23
|
|
/* 80016E28 00012C68 7F 1B EB A6 */ mtspr SIA, r24
|
|
/* 80016E2C 00012C6C 7F 38 EB A6 */ mtspr MMCR0, r25
|
|
/* 80016E30 00012C70 7F 5C EB A6 */ mtspr MMCR1, r26
|
|
/* 80016E34 00012C74 7F DB FB A6 */ mtspr ICTC, r30
|
|
/* 80016E38 00012C78 7F F9 FB A6 */ mtspr L2CR, r31
|
|
/* 80016E3C 00012C7C 48 00 00 04 */ b lbl_80016E40
|
|
.global lbl_80016E40
|
|
lbl_80016E40:
|
|
/* 80016E40 00012C80 BA 02 01 A8 */ lmw r16, 0x1a8(r2)
|
|
/* 80016E44 00012C84 7E 00 01 A4 */ mtsr 0, r16
|
|
/* 80016E48 00012C88 7E 21 01 A4 */ mtsr 1, r17
|
|
/* 80016E4C 00012C8C 7E 42 01 A4 */ mtsr 2, r18
|
|
/* 80016E50 00012C90 7E 63 01 A4 */ mtsr 3, r19
|
|
/* 80016E54 00012C94 7E 84 01 A4 */ mtsr 4, r20
|
|
/* 80016E58 00012C98 7E A5 01 A4 */ mtsr 5, r21
|
|
/* 80016E5C 00012C9C 7E C6 01 A4 */ mtsr 6, r22
|
|
/* 80016E60 00012CA0 7E E7 01 A4 */ mtsr 7, r23
|
|
/* 80016E64 00012CA4 7F 08 01 A4 */ mtsr 8, r24
|
|
/* 80016E68 00012CA8 7F 29 01 A4 */ mtsr 9, r25
|
|
/* 80016E6C 00012CAC 7F 4A 01 A4 */ mtsr 10, r26
|
|
/* 80016E70 00012CB0 7F 6B 01 A4 */ mtsr 11, r27
|
|
/* 80016E74 00012CB4 7F 8C 01 A4 */ mtsr 12, r28
|
|
/* 80016E78 00012CB8 7F AD 01 A4 */ mtsr 13, r29
|
|
/* 80016E7C 00012CBC 7F CE 01 A4 */ mtsr 14, r30
|
|
/* 80016E80 00012CC0 7F EF 01 A4 */ mtsr 15, r31
|
|
/* 80016E84 00012CC4 B9 82 01 F0 */ lmw r12, 0x1f0(r2)
|
|
/* 80016E88 00012CC8 7D 90 FB A6 */ mtspr HID0, r12
|
|
/* 80016E8C 00012CCC 7D B1 FB A6 */ mtspr HID1, r13
|
|
/* 80016E90 00012CD0 7D DB 03 A6 */ mtsrr1 r14
|
|
/* 80016E94 00012CD4 7D FF 43 A6 */ mtspr PVR, r15
|
|
/* 80016E98 00012CD8 7E 10 83 A6 */ mtibatu 0, r16
|
|
/* 80016E9C 00012CDC 7E 31 83 A6 */ mtibatl 0, r17
|
|
/* 80016EA0 00012CE0 7E 52 83 A6 */ mtibatu 1, r18
|
|
/* 80016EA4 00012CE4 7E 73 83 A6 */ mtibatl 1, r19
|
|
/* 80016EA8 00012CE8 7E 94 83 A6 */ mtibatu 2, r20
|
|
/* 80016EAC 00012CEC 7E B5 83 A6 */ mtibatl 2, r21
|
|
/* 80016EB0 00012CF0 7E D6 83 A6 */ mtibatu 3, r22
|
|
/* 80016EB4 00012CF4 7E F7 83 A6 */ mtibatl 3, r23
|
|
/* 80016EB8 00012CF8 7F 18 83 A6 */ mtdbatu 0, r24
|
|
/* 80016EBC 00012CFC 7F 39 83 A6 */ mtdbatl 0, r25
|
|
/* 80016EC0 00012D00 7F 5A 83 A6 */ mtdbatu 1, r26
|
|
/* 80016EC4 00012D04 7F 7B 83 A6 */ mtdbatl 1, r27
|
|
/* 80016EC8 00012D08 7F 9C 83 A6 */ mtdbatu 2, r28
|
|
/* 80016ECC 00012D0C 7F BD 83 A6 */ mtdbatl 2, r29
|
|
/* 80016ED0 00012D10 7F DE 83 A6 */ mtdbatu 3, r30
|
|
/* 80016ED4 00012D14 7F FF 83 A6 */ mtdbatl 3, r31
|
|
/* 80016ED8 00012D18 BA C2 02 5C */ lmw r22, 0x25c(r2)
|
|
/* 80016EDC 00012D1C 7E D9 03 A6 */ mtsdr1 r22
|
|
/* 80016EE0 00012D20 7E F3 03 A6 */ mtdar r23
|
|
/* 80016EE4 00012D24 7F 12 03 A6 */ mtdsisr r24
|
|
/* 80016EE8 00012D28 7F 30 43 A6 */ mtsprg 0, r25
|
|
/* 80016EEC 00012D2C 7F 51 43 A6 */ mtsprg 1, r26
|
|
/* 80016EF0 00012D30 7F 72 43 A6 */ mtsprg 2, r27
|
|
/* 80016EF4 00012D34 7F 93 43 A6 */ mtsprg 3, r28
|
|
/* 80016EF8 00012D38 7F D2 FB A6 */ mtspr IABR, r30
|
|
/* 80016EFC 00012D3C 7F FA 43 A6 */ mtear r31
|
|
/* 80016F00 00012D40 4E 80 00 20 */ blr
|