donut-decomp/asm/dvd/dvdDeviceError.s
2022-10-17 09:13:49 +01:00

389 lines
13 KiB
ArmAsm

.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
.global lowCallback
lowCallback:
/* 8003FF50 0003BD90 90 6D E6 F0 */ stw r3, lowIntType@sda21(r13)
/* 8003FF54 0003BD94 38 00 00 01 */ li r0, 0x1
/* 8003FF58 0003BD98 90 0D 81 D8 */ stw r0, lowDone@sda21(r13)
/* 8003FF5C 0003BD9C 4E 80 00 20 */ blr
.global __DVDCheckDevice
__DVDCheckDevice:
/* 8003FF60 0003BDA0 94 21 FF D0 */ stwu r1, -0x30(r1)
/* 8003FF64 0003BDA4 7C 08 02 A6 */ mflr r0
/* 8003FF68 0003BDA8 90 01 00 34 */ stw r0, 0x34(r1)
/* 8003FF6C 0003BDAC 93 E1 00 2C */ stw r31, 0x2c(r1)
/* 8003FF70 0003BDB0 93 C1 00 28 */ stw r30, 0x28(r1)
/* 8003FF74 0003BDB4 93 A1 00 24 */ stw r29, 0x24(r1)
/* 8003FF78 0003BDB8 3F A0 46 0A */ lis r29, 0x460a
/* 8003FF7C 0003BDBC 4B FE 23 75 */ bl OSGetPhysicalMem2Size
/* 8003FF80 0003BDC0 3C 03 F8 00 */ addis r0, r3, 0xf800
/* 8003FF84 0003BDC4 28 00 00 00 */ cmplwi r0, 0x0
/* 8003FF88 0003BDC8 40 82 00 0C */ bne lbl_8003FF94
/* 8003FF8C 0003BDCC 38 60 00 01 */ li r3, 0x1
/* 8003FF90 0003BDD0 48 00 02 30 */ b lbl_800401C0
.global lbl_8003FF94
lbl_8003FF94:
/* 8003FF94 0003BDD4 38 61 00 10 */ addi r3, r1, 0x10
/* 8003FF98 0003BDD8 4B FD A4 59 */ bl __OSGetIOSRev
/* 8003FF9C 0003BDDC 88 01 00 11 */ lbz r0, 0x11(r1)
/* 8003FFA0 0003BDE0 28 00 00 1E */ cmplwi r0, 0x1e
/* 8003FFA4 0003BDE4 41 80 00 0C */ blt lbl_8003FFB0
/* 8003FFA8 0003BDE8 28 00 00 FE */ cmplwi r0, 0xfe
/* 8003FFAC 0003BDEC 41 80 00 0C */ blt lbl_8003FFB8
.global lbl_8003FFB0
lbl_8003FFB0:
/* 8003FFB0 0003BDF0 38 60 00 01 */ li r3, 0x1
/* 8003FFB4 0003BDF4 48 00 02 0C */ b lbl_800401C0
.global lbl_8003FFB8
lbl_8003FFB8:
/* 8003FFB8 0003BDF8 3C 60 80 00 */ lis r3, 0x8000319C@ha
/* 8003FFBC 0003BDFC 88 03 31 9C */ lbz r0, 0x8000319C@l(r3)
/* 8003FFC0 0003BE00 28 00 00 81 */ cmplwi r0, 0x81
/* 8003FFC4 0003BE04 40 82 00 08 */ bne lbl_8003FFCC
/* 8003FFC8 0003BE08 3F A0 7E D4 */ lis r29, 0x7ed4
.global lbl_8003FFCC
lbl_8003FFCC:
/* 8003FFCC 0003BE0C 38 00 00 00 */ li r0, 0x0
/* 8003FFD0 0003BE10 3C 60 80 4A */ lis r3, CheckBuffer@ha
/* 8003FFD4 0003BE14 3C C0 80 04 */ lis r6, lowCallback@ha
/* 8003FFD8 0003BE18 90 0D 81 D8 */ stw r0, lowDone@sda21(r13)
/* 8003FFDC 0003BE1C 7F A5 EB 78 */ mr r5, r29
/* 8003FFE0 0003BE20 38 63 FD 40 */ addi r3, r3, CheckBuffer@l
/* 8003FFE4 0003BE24 38 C6 FF 50 */ addi r6, r6, lowCallback@l
/* 8003FFE8 0003BE28 38 80 00 20 */ li r4, 0x20
/* 8003FFEC 0003BE2C 48 00 12 C5 */ bl DVDLowUnencryptedRead
.global lbl_8003FFF0
lbl_8003FFF0:
/* 8003FFF0 0003BE30 80 0D 81 D8 */ lwz r0, lowDone@sda21(r13)
/* 8003FFF4 0003BE34 2C 00 00 00 */ cmpwi r0, 0x0
/* 8003FFF8 0003BE38 41 82 FF F8 */ beq lbl_8003FFF0
/* 8003FFFC 0003BE3C 80 0D E6 F0 */ lwz r0, lowIntType@sda21(r13)
/* 80040000 0003BE40 2C 00 00 02 */ cmpwi r0, 0x2
/* 80040004 0003BE44 41 82 00 14 */ beq lbl_80040018
/* 80040008 0003BE48 40 80 01 B0 */ bge lbl_800401B8
/* 8004000C 0003BE4C 2C 00 00 01 */ cmpwi r0, 0x1
/* 80040010 0003BE50 40 80 01 30 */ bge lbl_80040140
/* 80040014 0003BE54 48 00 01 A4 */ b lbl_800401B8
.global lbl_80040018
lbl_80040018:
/* 80040018 0003BE58 38 00 00 00 */ li r0, 0x0
/* 8004001C 0003BE5C 3C 60 80 04 */ lis r3, lowCallback@ha
/* 80040020 0003BE60 90 0D 81 D8 */ stw r0, lowDone@sda21(r13)
/* 80040024 0003BE64 38 63 FF 50 */ addi r3, r3, lowCallback@l
/* 80040028 0003BE68 48 00 17 39 */ bl DVDLowRequestError
/* 8004002C 0003BE6C 60 00 00 00 */ nop
.global lbl_80040030
lbl_80040030:
/* 80040030 0003BE70 80 0D 81 D8 */ lwz r0, lowDone@sda21(r13)
/* 80040034 0003BE74 2C 00 00 00 */ cmpwi r0, 0x0
/* 80040038 0003BE78 41 82 FF F8 */ beq lbl_80040030
/* 8004003C 0003BE7C 48 00 26 A5 */ bl DVDLowGetImmBufferReg
/* 80040040 0003BE80 80 0D E6 F0 */ lwz r0, lowIntType@sda21(r13)
/* 80040044 0003BE84 2C 00 00 01 */ cmpwi r0, 0x1
/* 80040048 0003BE88 41 82 00 08 */ beq lbl_80040050
/* 8004004C 0003BE8C 48 00 01 6C */ b lbl_800401B8
.global lbl_80040050
lbl_80040050:
/* 80040050 0003BE90 48 00 26 91 */ bl DVDLowGetImmBufferReg
/* 80040054 0003BE94 54 60 00 0F */ clrrwi. r0, r3, 24
/* 80040058 0003BE98 40 82 01 58 */ bne lbl_800401B0
/* 8004005C 0003BE9C 48 00 26 85 */ bl DVDLowGetImmBufferReg
/* 80040060 0003BEA0 3C 80 00 05 */ lis r4, 0x5
/* 80040064 0003BEA4 54 63 02 3E */ clrlwi r3, r3, 8
/* 80040068 0003BEA8 38 04 21 00 */ addi r0, r4, 0x2100
/* 8004006C 0003BEAC 7C 03 00 00 */ cmpw r3, r0
/* 80040070 0003BEB0 41 82 00 08 */ beq lbl_80040078
/* 80040074 0003BEB4 48 00 00 CC */ b lbl_80040140
.global lbl_80040078
lbl_80040078:
/* 80040078 0003BEB8 38 00 00 00 */ li r0, 0x0
/* 8004007C 0003BEBC 3C 60 80 4A */ lis r3, CheckBuffer@ha
/* 80040080 0003BEC0 3C C0 80 04 */ lis r6, lowCallback@ha
/* 80040084 0003BEC4 90 0D 81 D8 */ stw r0, lowDone@sda21(r13)
/* 80040088 0003BEC8 38 63 FD 40 */ addi r3, r3, CheckBuffer@l
/* 8004008C 0003BECC 3C 80 00 04 */ lis r4, 0x4
/* 80040090 0003BED0 38 C6 FF 50 */ addi r6, r6, lowCallback@l
/* 80040094 0003BED4 38 A0 00 00 */ li r5, 0x0
/* 80040098 0003BED8 48 00 1B 69 */ bl DVDLowReportKey
/* 8004009C 0003BEDC 60 00 00 00 */ nop
.global lbl_800400A0
lbl_800400A0:
/* 800400A0 0003BEE0 80 0D 81 D8 */ lwz r0, lowDone@sda21(r13)
/* 800400A4 0003BEE4 2C 00 00 00 */ cmpwi r0, 0x0
/* 800400A8 0003BEE8 41 82 FF F8 */ beq lbl_800400A0
/* 800400AC 0003BEEC 80 0D E6 F0 */ lwz r0, lowIntType@sda21(r13)
/* 800400B0 0003BEF0 2C 00 00 02 */ cmpwi r0, 0x2
/* 800400B4 0003BEF4 41 82 00 14 */ beq lbl_800400C8
/* 800400B8 0003BEF8 40 80 01 00 */ bge lbl_800401B8
/* 800400BC 0003BEFC 2C 00 00 01 */ cmpwi r0, 0x1
/* 800400C0 0003BF00 40 80 00 80 */ bge lbl_80040140
/* 800400C4 0003BF04 48 00 00 F4 */ b lbl_800401B8
.global lbl_800400C8
lbl_800400C8:
/* 800400C8 0003BF08 38 00 00 00 */ li r0, 0x0
/* 800400CC 0003BF0C 3C 60 80 04 */ lis r3, lowCallback@ha
/* 800400D0 0003BF10 90 0D 81 D8 */ stw r0, lowDone@sda21(r13)
/* 800400D4 0003BF14 38 63 FF 50 */ addi r3, r3, lowCallback@l
/* 800400D8 0003BF18 48 00 16 89 */ bl DVDLowRequestError
/* 800400DC 0003BF1C 60 00 00 00 */ nop
.global lbl_800400E0
lbl_800400E0:
/* 800400E0 0003BF20 80 0D 81 D8 */ lwz r0, lowDone@sda21(r13)
/* 800400E4 0003BF24 2C 00 00 00 */ cmpwi r0, 0x0
/* 800400E8 0003BF28 41 82 FF F8 */ beq lbl_800400E0
/* 800400EC 0003BF2C 48 00 25 F5 */ bl DVDLowGetImmBufferReg
/* 800400F0 0003BF30 80 0D E6 F0 */ lwz r0, lowIntType@sda21(r13)
/* 800400F4 0003BF34 2C 00 00 01 */ cmpwi r0, 0x1
/* 800400F8 0003BF38 41 82 00 08 */ beq lbl_80040100
/* 800400FC 0003BF3C 48 00 00 BC */ b lbl_800401B8
.global lbl_80040100
lbl_80040100:
/* 80040100 0003BF40 48 00 25 E1 */ bl DVDLowGetImmBufferReg
/* 80040104 0003BF44 54 60 00 0F */ clrrwi. r0, r3, 24
/* 80040108 0003BF48 40 82 00 A8 */ bne lbl_800401B0
/* 8004010C 0003BF4C 48 00 25 D5 */ bl DVDLowGetImmBufferReg
/* 80040110 0003BF50 3C 80 00 05 */ lis r4, 0x5
/* 80040114 0003BF54 54 63 02 3E */ clrlwi r3, r3, 8
/* 80040118 0003BF58 38 04 31 00 */ addi r0, r4, 0x3100
/* 8004011C 0003BF5C 7C 03 00 00 */ cmpw r3, r0
/* 80040120 0003BF60 41 82 00 18 */ beq lbl_80040138
/* 80040124 0003BF64 40 80 00 1C */ bge lbl_80040140
/* 80040128 0003BF68 38 04 20 00 */ addi r0, r4, 0x2000
/* 8004012C 0003BF6C 7C 03 00 00 */ cmpw r3, r0
/* 80040130 0003BF70 41 82 00 08 */ beq lbl_80040138
/* 80040134 0003BF74 48 00 00 0C */ b lbl_80040140
.global lbl_80040138
lbl_80040138:
/* 80040138 0003BF78 38 60 00 01 */ li r3, 0x1
/* 8004013C 0003BF7C 48 00 00 84 */ b lbl_800401C0
.global lbl_80040140
lbl_80040140:
/* 80040140 0003BF80 83 C2 87 20 */ lwz r30, "@850_8055E6A0"@sda21(r2)
/* 80040144 0003BF84 3B E0 00 00 */ li r31, 0x0
/* 80040148 0003BF88 48 00 CC E9 */ bl SCGetLanguage
/* 8004014C 0003BF8C 54 60 06 3F */ clrlwi. r0, r3, 24
/* 80040150 0003BF90 40 82 00 10 */ bne lbl_80040160
/* 80040154 0003BF94 38 60 00 01 */ li r3, 0x1
/* 80040158 0003BF98 4B FE 06 79 */ bl OSSetFontEncode
/* 8004015C 0003BF9C 48 00 00 0C */ b lbl_80040168
.global lbl_80040160
lbl_80040160:
/* 80040160 0003BFA0 38 60 00 00 */ li r3, 0x0
/* 80040164 0003BFA4 4B FE 06 6D */ bl OSSetFontEncode
.global lbl_80040168
lbl_80040168:
/* 80040168 0003BFA8 3F A0 80 40 */ lis r29, __DVDDeviceErrorMessage@ha
/* 8004016C 0003BFAC 3B BD 78 88 */ addi r29, r29, __DVDDeviceErrorMessage@l
/* 80040170 0003BFB0 48 00 CC C1 */ bl SCGetLanguage
/* 80040174 0003BFB4 54 60 06 3E */ clrlwi r0, r3, 24
/* 80040178 0003BFB8 28 00 00 06 */ cmplwi r0, 0x6
/* 8004017C 0003BFBC 40 81 00 0C */ ble lbl_80040188
/* 80040180 0003BFC0 80 BD 00 04 */ lwz r5, 0x4(r29)
/* 80040184 0003BFC4 48 00 00 10 */ b lbl_80040194
.global lbl_80040188
lbl_80040188:
/* 80040188 0003BFC8 48 00 CC A9 */ bl SCGetLanguage
/* 8004018C 0003BFCC 54 60 15 BA */ rlwinm r0, r3, 2, 22, 29
/* 80040190 0003BFD0 7C BD 00 2E */ lwzx r5, r29, r0
.global lbl_80040194
lbl_80040194:
/* 80040194 0003BFD4 93 E1 00 0C */ stw r31, 0xc(r1)
/* 80040198 0003BFD8 38 81 00 0C */ addi r4, r1, 0xc
/* 8004019C 0003BFDC 38 61 00 08 */ addi r3, r1, 0x8
/* 800401A0 0003BFE0 93 C1 00 08 */ stw r30, 0x8(r1)
/* 800401A4 0003BFE4 4B FD FB 0D */ bl OSFatal
/* 800401A8 0003BFE8 38 60 00 00 */ li r3, 0x0
/* 800401AC 0003BFEC 48 00 00 14 */ b lbl_800401C0
.global lbl_800401B0
lbl_800401B0:
/* 800401B0 0003BFF0 38 60 00 00 */ li r3, 0x0
/* 800401B4 0003BFF4 48 00 00 0C */ b lbl_800401C0
.global lbl_800401B8
lbl_800401B8:
/* 800401B8 0003BFF8 4B FF FC 29 */ bl __DVDShowFatalMessage
/* 800401BC 0003BFFC 38 60 00 00 */ li r3, 0x0
.global lbl_800401C0
lbl_800401C0:
/* 800401C0 0003C000 80 01 00 34 */ lwz r0, 0x34(r1)
/* 800401C4 0003C004 83 E1 00 2C */ lwz r31, 0x2c(r1)
/* 800401C8 0003C008 83 C1 00 28 */ lwz r30, 0x28(r1)
/* 800401CC 0003C00C 83 A1 00 24 */ lwz r29, 0x24(r1)
/* 800401D0 0003C010 7C 08 03 A6 */ mtlr r0
/* 800401D4 0003C014 38 21 00 30 */ addi r1, r1, 0x30
/* 800401D8 0003C018 4E 80 00 20 */ blr
/* 800401DC 0003C01C 00 00 00 00 */ .4byte 0x00000000
.include "macros.inc"
.section .rodata, "wa" # 0x80406560 - 0x80421040 ; 0x0001AAE0
.global __DVDDeviceErrorMessage
__DVDDeviceErrorMessage:
.4byte "@835_80431EA0"
.4byte "@836_80431EDC"
.4byte "@837_80431F14"
.4byte "@838_80431F54"
.4byte "@839_80431F90"
.4byte "@840_80431FCC"
.4byte "@841_80432008"
.4byte 0
.include "macros.inc"
.section .data, "wa" # 0x80421040 - 0x80496700 ; 0x000756C0
.global "@835_80431EA0"
"@835_80431EA0":
.4byte 0x0A0A0A83
.4byte 0x47838981
.4byte 0x5B835281
.4byte 0x5B836882
.4byte 0x4F824F82
.4byte 0x5081420A
.4byte 0x957396BE
.4byte 0x82C88366
.4byte 0x836F8343
.4byte 0x835882AA
.4byte 0x8CA982C2
.4byte 0x82A982E8
.4byte 0x82DC82B5
.4byte 0x82BD8142
.4byte 0
.global "@836_80431EDC"
"@836_80431EDC":
.4byte 0x0A0A0A45
.4byte 0x72726F72
.4byte 0x20233030
.4byte 0x312C0A75
.4byte 0x6E617574
.4byte 0x686F7269
.4byte 0x7A656420
.4byte 0x64657669
.4byte 0x63652068
.4byte 0x61732062
.4byte 0x65656E20
.4byte 0x64657465
.4byte 0x63746564
.4byte 0x2E000000
.global "@837_80431F14"
"@837_80431F14":
.4byte 0x0A0A0A46
.4byte 0x65686C65
.4byte 0x72202330
.4byte 0x30313A0A
.4byte 0x45732077
.4byte 0x75726465
.4byte 0x2065696E
.4byte 0x6520756E
.4byte 0x7A756CE4
.4byte 0x73736967
.4byte 0x65204B6F
.4byte 0x6D706F6E
.4byte 0x656E7465
.4byte 0x0A656E74
.4byte 0x6465636B
.4byte 0x742E0000
.global "@838_80431F54"
"@838_80431F54":
.4byte 0x0A0A0A45
.4byte 0x72726575
.4byte 0x72203030
.4byte 0x313A0A75
.4byte 0x6E206469
.4byte 0x73706F73
.4byte 0x69746966
.4byte 0x206E6F6E
.4byte 0x20617574
.4byte 0x6F726973
.4byte 0xE9206120
.4byte 0xE974E920
.4byte 0x64E97465
.4byte 0x6374E92E
.4byte 0
.global "@839_80431F90"
"@839_80431F90":
.4byte 0x0A0A0A45
.4byte 0x72726F72
.4byte 0x20303031
.4byte 0x3A0A5365
.4byte 0x20686120
.4byte 0x64657465
.4byte 0x63746164
.4byte 0x6F20756E
.4byte 0x20646973
.4byte 0x706F7369
.4byte 0x7469766F
.4byte 0x206E6F0A
.4byte 0x6175746F
.4byte 0x72697A61
.4byte 0x646F2E00
.global "@840_80431FCC"
"@840_80431FCC":
.4byte 0x0A0A0A45
.4byte 0x72726F72
.4byte 0x65202330
.4byte 0x30313A0A
.4byte 0x72696C65
.4byte 0x7661746F
.4byte 0x20756E20
.4byte 0x64697370
.4byte 0x6F736974
.4byte 0x69766F20
.4byte 0x6E6F6E20
.4byte 0x6175746F
.4byte 0x72697A7A
.4byte 0x61746F2E
.4byte 0
.global "@841_80432008"
"@841_80432008":
.4byte 0x0A0A0A46
.4byte 0x6F757420
.4byte 0x23303031
.4byte 0x3A0A6F6E
.4byte 0x67656F6F
.4byte 0x726C6F6F
.4byte 0x6664206F
.4byte 0x6E646572
.4byte 0x6465656C
.4byte 0x20676576
.4byte 0x6F6E6465
.4byte 0x6E2E0000
.include "macros.inc"
.section .bss, "", @nobits # 0x80496700 - 0x80556420 ; 0x000BFD20
.global CheckBuffer
CheckBuffer:
.skip 0x20
.include "macros.inc"
.section .sdata, "wa" # 0x80556420 - 0x8055C6E0 ; 0x000062C0
.global lowDone
lowDone:
.4byte 0x00000001
.4byte 0
.include "macros.inc"
.section .sbss, "", @nobits # 0x8055C6E0 - 0x8055DF80 ; 0x000018A0
.global lowIntType
lowIntType:
.skip 0x8
.include "macros.inc"
.section .sdata2, "wa" # 0x8055DF80 - 0x805643C0 ; 0x00006440
.global "@850_8055E6A0"
"@850_8055E6A0":
.4byte 0xFFFFFF00
.4byte 0