donut-decomp/asm/bte/bta_dm_pm.s

821 lines
37 KiB
ArmAsm
Raw Normal View History

2022-10-16 16:05:58 +00:00
.include "macros.inc"
.section .text, "ax" # 0x80006A00 - 0x80406260 ; 0x003FF860
2022-10-16 16:31:36 +00:00
.global bta_dm_init_pm
bta_dm_init_pm:
2022-10-16 16:05:58 +00:00
/* 8007AFB0 00076DF0 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8007AFB4 00076DF4 7C 08 02 A6 */ mflr r0
2022-10-16 16:31:36 +00:00
/* 8007AFB8 00076DF8 3C 60 80 4F */ lis r3, bta_dm_conn_srvcs@ha
2022-10-16 16:05:58 +00:00
/* 8007AFBC 00076DFC 38 80 00 00 */ li r4, 0x0
/* 8007AFC0 00076E00 90 01 00 14 */ stw r0, 0x14(r1)
2022-10-16 16:31:36 +00:00
/* 8007AFC4 00076E04 38 63 5C F8 */ addi r3, r3, bta_dm_conn_srvcs@l
2022-10-16 16:05:58 +00:00
/* 8007AFC8 00076E08 38 A0 00 2E */ li r5, 0x2e
2022-10-16 16:31:36 +00:00
/* 8007AFCC 00076E0C 4B F8 93 85 */ bl memset
/* 8007AFD0 00076E10 80 6D 84 98 */ lwz r3, p_bta_dm_pm_cfg@sda21(r13)
2022-10-16 16:05:58 +00:00
/* 8007AFD4 00076E14 88 03 00 01 */ lbz r0, 0x1(r3)
/* 8007AFD8 00076E18 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007AFDC 00076E1C 41 82 00 2C */ beq lbl_8007B008
2022-10-16 16:31:36 +00:00
/* 8007AFE0 00076E20 3C 60 80 08 */ lis r3, bta_dm_pm_cback@ha
/* 8007AFE4 00076E24 38 63 B0 30 */ addi r3, r3, bta_dm_pm_cback@l
/* 8007AFE8 00076E28 4B FF D0 41 */ bl bta_sys_pm_register
/* 8007AFEC 00076E2C 3C 80 80 4F */ lis r4, bta_dm_cb@ha
/* 8007AFF0 00076E30 3C A0 80 08 */ lis r5, bta_dm_pm_btm_cback@ha
/* 8007AFF4 00076E34 38 84 5B F4 */ addi r4, r4, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007AFF8 00076E38 38 60 00 03 */ li r3, 0x3
/* 8007AFFC 00076E3C 38 84 00 95 */ addi r4, r4, 0x95
2022-10-16 16:31:36 +00:00
/* 8007B000 00076E40 38 A5 B7 30 */ addi r5, r5, bta_dm_pm_btm_cback@l
/* 8007B004 00076E44 48 00 87 99 */ bl BTM_PmRegister
2022-10-16 16:05:58 +00:00
.global lbl_8007B008
lbl_8007B008:
/* 8007B008 00076E48 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8007B00C 00076E4C 7C 08 03 A6 */ mtlr r0
/* 8007B010 00076E50 38 21 00 10 */ addi r1, r1, 0x10
/* 8007B014 00076E54 4E 80 00 20 */ blr
2022-10-16 16:31:36 +00:00
.global bta_dm_disable_pm
bta_dm_disable_pm:
/* 8007B018 00076E58 3C 80 80 4F */ lis r4, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B01C 00076E5C 38 60 00 04 */ li r3, 0x4
2022-10-16 16:31:36 +00:00
/* 8007B020 00076E60 38 84 5B F4 */ addi r4, r4, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B024 00076E64 38 A0 00 00 */ li r5, 0x0
/* 8007B028 00076E68 38 84 00 95 */ addi r4, r4, 0x95
2022-10-16 16:31:36 +00:00
/* 8007B02C 00076E6C 48 00 87 70 */ b BTM_PmRegister
.global bta_dm_pm_cback
bta_dm_pm_cback:
2022-10-16 16:05:58 +00:00
/* 8007B030 00076E70 94 21 FF C0 */ stwu r1, -0x40(r1)
/* 8007B034 00076E74 7C 08 02 A6 */ mflr r0
/* 8007B038 00076E78 90 01 00 44 */ stw r0, 0x44(r1)
/* 8007B03C 00076E7C 39 61 00 40 */ addi r11, r1, 0x40
/* 8007B040 00076E80 4B F8 C2 ED */ bl lbl_8000732C
/* 8007B044 00076E84 7C 79 1B 78 */ mr r25, r3
/* 8007B048 00076E88 7C 9A 23 78 */ mr r26, r4
/* 8007B04C 00076E8C 7C BB 2B 78 */ mr r27, r5
/* 8007B050 00076E90 7C DC 33 78 */ mr r28, r6
/* 8007B054 00076E94 38 61 00 0C */ addi r3, r1, 0xc
2022-10-16 16:31:36 +00:00
/* 8007B058 00076E98 48 00 61 E5 */ bl BTM_ReadLocalVersion
2022-10-16 16:05:58 +00:00
/* 8007B05C 00076E9C 54 60 06 3F */ clrlwi. r0, r3, 24
/* 8007B060 00076EA0 40 82 00 6C */ bne lbl_8007B0CC
/* 8007B064 00076EA4 A0 01 00 12 */ lhz r0, 0x12(r1)
/* 8007B068 00076EA8 28 00 00 0F */ cmplwi r0, 0xf
/* 8007B06C 00076EAC 40 82 00 60 */ bne lbl_8007B0CC
/* 8007B070 00076EB0 88 01 00 0C */ lbz r0, 0xc(r1)
/* 8007B074 00076EB4 28 00 00 03 */ cmplwi r0, 0x3
/* 8007B078 00076EB8 40 80 00 54 */ bge lbl_8007B0CC
/* 8007B07C 00076EBC 28 19 00 04 */ cmplwi r25, 0x4
/* 8007B080 00076EC0 40 82 00 28 */ bne lbl_8007B0A8
2022-10-16 16:31:36 +00:00
/* 8007B084 00076EC4 3C A0 80 40 */ lis r5, bta_dm_cfg@ha
2022-10-16 16:05:58 +00:00
/* 8007B088 00076EC8 7F 83 E3 78 */ mr r3, r28
2022-10-16 16:31:36 +00:00
/* 8007B08C 00076ECC 38 A5 7E 00 */ addi r5, r5, bta_dm_cfg@l
2022-10-16 16:05:58 +00:00
/* 8007B090 00076ED0 38 81 00 08 */ addi r4, r1, 0x8
/* 8007B094 00076ED4 A0 05 00 04 */ lhz r0, 0x4(r5)
/* 8007B098 00076ED8 70 00 00 0B */ andi. r0, r0, 0xb
/* 8007B09C 00076EDC B0 01 00 08 */ sth r0, 0x8(r1)
2022-10-16 16:31:36 +00:00
/* 8007B0A0 00076EE0 48 00 35 AD */ bl BTM_SetLinkPolicy
2022-10-16 16:05:58 +00:00
/* 8007B0A4 00076EE4 48 00 00 28 */ b lbl_8007B0CC
.global lbl_8007B0A8
lbl_8007B0A8:
/* 8007B0A8 00076EE8 28 19 00 05 */ cmplwi r25, 0x5
/* 8007B0AC 00076EEC 40 82 00 20 */ bne lbl_8007B0CC
2022-10-16 16:31:36 +00:00
/* 8007B0B0 00076EF0 3C A0 80 40 */ lis r5, bta_dm_cfg@ha
2022-10-16 16:05:58 +00:00
/* 8007B0B4 00076EF4 7F 83 E3 78 */ mr r3, r28
2022-10-16 16:31:36 +00:00
/* 8007B0B8 00076EF8 38 A5 7E 00 */ addi r5, r5, bta_dm_cfg@l
2022-10-16 16:05:58 +00:00
/* 8007B0BC 00076EFC 38 81 00 08 */ addi r4, r1, 0x8
/* 8007B0C0 00076F00 A0 05 00 04 */ lhz r0, 0x4(r5)
/* 8007B0C4 00076F04 B0 01 00 08 */ sth r0, 0x8(r1)
2022-10-16 16:31:36 +00:00
/* 8007B0C8 00076F08 48 00 35 85 */ bl BTM_SetLinkPolicy
2022-10-16 16:05:58 +00:00
.global lbl_8007B0CC
lbl_8007B0CC:
2022-10-16 16:31:36 +00:00
/* 8007B0CC 00076F0C 80 AD 84 98 */ lwz r5, p_bta_dm_pm_cfg@sda21(r13)
2022-10-16 16:05:58 +00:00
/* 8007B0D0 00076F10 3B C0 00 01 */ li r30, 0x1
/* 8007B0D4 00076F14 88 85 00 01 */ lbz r4, 0x1(r5)
/* 8007B0D8 00076F18 48 00 00 38 */ b lbl_8007B110
.global lbl_8007B0DC
lbl_8007B0DC:
/* 8007B0DC 00076F1C 57 C3 06 3E */ clrlwi r3, r30, 24
/* 8007B0E0 00076F20 57 C0 15 BA */ rlwinm r0, r30, 2, 22, 29
/* 8007B0E4 00076F24 7C 03 00 50 */ subf r0, r3, r0
/* 8007B0E8 00076F28 7C 65 02 14 */ add r3, r5, r0
/* 8007B0EC 00076F2C 7C 05 00 AE */ lbzx r0, r5, r0
/* 8007B0F0 00076F30 7C 1A 00 40 */ cmplw r26, r0
/* 8007B0F4 00076F34 40 82 00 18 */ bne lbl_8007B10C
/* 8007B0F8 00076F38 88 03 00 01 */ lbz r0, 0x1(r3)
/* 8007B0FC 00076F3C 28 00 00 FF */ cmplwi r0, 0xff
/* 8007B100 00076F40 41 82 00 1C */ beq lbl_8007B11C
/* 8007B104 00076F44 7C 1B 00 40 */ cmplw r27, r0
/* 8007B108 00076F48 41 82 00 14 */ beq lbl_8007B11C
.global lbl_8007B10C
lbl_8007B10C:
/* 8007B10C 00076F4C 3B DE 00 01 */ addi r30, r30, 0x1
.global lbl_8007B110
lbl_8007B110:
/* 8007B110 00076F50 57 C0 06 3E */ clrlwi r0, r30, 24
/* 8007B114 00076F54 7C 00 20 40 */ cmplw r0, r4
/* 8007B118 00076F58 40 81 FF C4 */ ble lbl_8007B0DC
.global lbl_8007B11C
lbl_8007B11C:
/* 8007B11C 00076F5C 88 05 00 01 */ lbz r0, 0x1(r5)
/* 8007B120 00076F60 57 C3 06 3E */ clrlwi r3, r30, 24
/* 8007B124 00076F64 7C 03 00 40 */ cmplw r3, r0
/* 8007B128 00076F68 41 81 02 70 */ bgt lbl_8007B398
2022-10-16 16:31:36 +00:00
/* 8007B12C 00076F6C 3E E0 80 4F */ lis r23, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B130 00076F70 3B E0 00 00 */ li r31, 0x0
2022-10-16 16:31:36 +00:00
/* 8007B134 00076F74 3A F7 5B F4 */ addi r23, r23, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
.global lbl_8007B138
lbl_8007B138:
/* 8007B138 00076F78 57 FD 2C F4 */ rlwinm r29, r31, 5, 19, 26
/* 8007B13C 00076F7C 7F 17 EA 14 */ add r24, r23, r29
/* 8007B140 00076F80 88 18 00 B6 */ lbz r0, 0xb6(r24)
/* 8007B144 00076F84 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B148 00076F88 41 82 00 30 */ beq lbl_8007B178
/* 8007B14C 00076F8C 7F 84 E3 78 */ mr r4, r28
/* 8007B150 00076F90 38 78 00 B0 */ addi r3, r24, 0xb0
2022-10-16 16:31:36 +00:00
/* 8007B154 00076F94 4B FF CE 15 */ bl bdcmp
2022-10-16 16:05:58 +00:00
/* 8007B158 00076F98 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B15C 00076F9C 40 82 00 1C */ bne lbl_8007B178
/* 8007B160 00076FA0 7F 03 C3 78 */ mr r3, r24
/* 8007B164 00076FA4 38 63 00 98 */ addi r3, r3, 0x98
2022-10-16 16:31:36 +00:00
/* 8007B168 00076FA8 4B FF D2 B5 */ bl bta_sys_stop_timer
2022-10-16 16:05:58 +00:00
/* 8007B16C 00076FAC 38 00 00 00 */ li r0, 0x0
/* 8007B170 00076FB0 98 18 00 B6 */ stb r0, 0xb6(r24)
/* 8007B174 00076FB4 48 00 00 10 */ b lbl_8007B184
.global lbl_8007B178
lbl_8007B178:
/* 8007B178 00076FB8 3B FF 00 01 */ addi r31, r31, 0x1
/* 8007B17C 00076FBC 28 1F 00 03 */ cmplwi r31, 0x3
/* 8007B180 00076FC0 41 80 FF B8 */ blt lbl_8007B138
.global lbl_8007B184
lbl_8007B184:
/* 8007B184 00076FC4 57 C4 06 3E */ clrlwi r4, r30, 24
/* 8007B188 00076FC8 57 C3 15 BA */ rlwinm r3, r30, 2, 22, 29
/* 8007B18C 00076FCC 7F C4 18 50 */ subf r30, r4, r3
2022-10-16 16:31:36 +00:00
/* 8007B190 00076FD0 80 0D 84 98 */ lwz r0, p_bta_dm_pm_cfg@sda21(r13)
/* 8007B194 00076FD4 80 8D 84 9C */ lwz r4, p_bta_dm_pm_spec@sda21(r13)
2022-10-16 16:05:58 +00:00
/* 8007B198 00076FD8 57 3F 1D 78 */ rlwinm r31, r25, 3, 21, 28
/* 8007B19C 00076FDC 7C 60 F2 14 */ add r3, r0, r30
/* 8007B1A0 00076FE0 88 03 00 02 */ lbz r0, 0x2(r3)
/* 8007B1A4 00076FE4 1C 00 00 4A */ mulli r0, r0, 0x4a
/* 8007B1A8 00076FE8 7C 04 02 14 */ add r0, r4, r0
/* 8007B1AC 00076FEC 7C 60 FA 14 */ add r3, r0, r31
/* 8007B1B0 00076FF0 88 03 00 02 */ lbz r0, 0x2(r3)
/* 8007B1B4 00076FF4 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B1B8 00076FF8 41 82 01 E0 */ beq lbl_8007B398
2022-10-16 16:31:36 +00:00
/* 8007B1BC 00076FFC 3E E0 80 4F */ lis r23, bta_dm_conn_srvcs@ha
2022-10-16 16:05:58 +00:00
/* 8007B1C0 00077000 3B A0 00 00 */ li r29, 0x0
2022-10-16 16:31:36 +00:00
/* 8007B1C4 00077004 3B 17 5C F8 */ addi r24, r23, bta_dm_conn_srvcs@l
2022-10-16 16:05:58 +00:00
/* 8007B1C8 00077008 48 00 00 44 */ b lbl_8007B20C
.global lbl_8007B1CC
lbl_8007B1CC:
/* 8007B1CC 0007700C 57 A3 06 3E */ clrlwi r3, r29, 24
/* 8007B1D0 00077010 57 A0 1D 78 */ rlwinm r0, r29, 3, 21, 28
/* 8007B1D4 00077014 7C 00 1A 14 */ add r0, r0, r3
/* 8007B1D8 00077018 7C 78 02 14 */ add r3, r24, r0
/* 8007B1DC 0007701C 88 03 00 07 */ lbz r0, 0x7(r3)
/* 8007B1E0 00077020 7C 1A 00 40 */ cmplw r26, r0
/* 8007B1E4 00077024 40 82 00 24 */ bne lbl_8007B208
/* 8007B1E8 00077028 88 03 00 08 */ lbz r0, 0x8(r3)
/* 8007B1EC 0007702C 7C 1B 00 40 */ cmplw r27, r0
/* 8007B1F0 00077030 40 82 00 18 */ bne lbl_8007B208
/* 8007B1F4 00077034 7F 84 E3 78 */ mr r4, r28
/* 8007B1F8 00077038 38 63 00 01 */ addi r3, r3, 0x1
2022-10-16 16:31:36 +00:00
/* 8007B1FC 0007703C 4B FF CD 6D */ bl bdcmp
2022-10-16 16:05:58 +00:00
/* 8007B200 00077040 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B204 00077044 41 82 00 18 */ beq lbl_8007B21C
.global lbl_8007B208
lbl_8007B208:
/* 8007B208 00077048 3B BD 00 01 */ addi r29, r29, 0x1
.global lbl_8007B20C
lbl_8007B20C:
/* 8007B20C 0007704C 88 17 5C F8 */ lbz r0, 0x5cf8(r23)
/* 8007B210 00077050 57 A3 06 3E */ clrlwi r3, r29, 24
/* 8007B214 00077054 7C 03 00 40 */ cmplw r3, r0
/* 8007B218 00077058 41 80 FF B4 */ blt lbl_8007B1CC
.global lbl_8007B21C
lbl_8007B21C:
2022-10-16 16:31:36 +00:00
/* 8007B21C 0007705C 80 0D 84 98 */ lwz r0, p_bta_dm_pm_cfg@sda21(r13)
/* 8007B220 00077060 80 8D 84 9C */ lwz r4, p_bta_dm_pm_spec@sda21(r13)
2022-10-16 16:05:58 +00:00
/* 8007B224 00077064 7C 60 F2 14 */ add r3, r0, r30
/* 8007B228 00077068 88 03 00 02 */ lbz r0, 0x2(r3)
/* 8007B22C 0007706C 1C 00 00 4A */ mulli r0, r0, 0x4a
/* 8007B230 00077070 7C 04 02 14 */ add r0, r4, r0
/* 8007B234 00077074 7C 60 FA 14 */ add r3, r0, r31
/* 8007B238 00077078 88 03 00 02 */ lbz r0, 0x2(r3)
/* 8007B23C 0007707C 28 00 00 10 */ cmplwi r0, 0x10
/* 8007B240 00077080 40 82 00 70 */ bne lbl_8007B2B0
2022-10-16 16:31:36 +00:00
/* 8007B244 00077084 3F 60 80 4F */ lis r27, bta_dm_conn_srvcs@ha
2022-10-16 16:05:58 +00:00
/* 8007B248 00077088 57 A3 06 3E */ clrlwi r3, r29, 24
2022-10-16 16:31:36 +00:00
/* 8007B24C 0007708C 88 1B 5C F8 */ lbz r0, bta_dm_conn_srvcs@l(r27)
2022-10-16 16:05:58 +00:00
/* 8007B250 00077090 7C 03 00 40 */ cmplw r3, r0
/* 8007B254 00077094 41 82 00 C8 */ beq lbl_8007B31C
/* 8007B258 00077098 3B 5B 5C F8 */ addi r26, r27, 0x5cf8
/* 8007B25C 0007709C 48 00 00 38 */ b lbl_8007B294
.global lbl_8007B260
lbl_8007B260:
/* 8007B260 000770A0 57 A6 06 3E */ clrlwi r6, r29, 24
/* 8007B264 000770A4 57 A4 1D 78 */ rlwinm r4, r29, 3, 21, 28
/* 8007B268 000770A8 38 66 00 01 */ addi r3, r6, 0x1
/* 8007B26C 000770AC 38 A0 00 09 */ li r5, 0x9
/* 8007B270 000770B0 54 60 18 38 */ slwi r0, r3, 3
/* 8007B274 000770B4 7C 84 32 14 */ add r4, r4, r6
/* 8007B278 000770B8 7C 00 1A 14 */ add r0, r0, r3
/* 8007B27C 000770BC 7C 7A 22 14 */ add r3, r26, r4
/* 8007B280 000770C0 7C 9A 02 14 */ add r4, r26, r0
/* 8007B284 000770C4 38 63 00 01 */ addi r3, r3, 0x1
/* 8007B288 000770C8 38 84 00 01 */ addi r4, r4, 0x1
2022-10-16 16:31:36 +00:00
/* 8007B28C 000770CC 4B F8 8D 75 */ bl memcpy
2022-10-16 16:05:58 +00:00
/* 8007B290 000770D0 3B BD 00 01 */ addi r29, r29, 0x1
.global lbl_8007B294
lbl_8007B294:
/* 8007B294 000770D4 88 7B 5C F8 */ lbz r3, 0x5cf8(r27)
/* 8007B298 000770D8 57 A0 06 3E */ clrlwi r0, r29, 24
/* 8007B29C 000770DC 7C 00 18 40 */ cmplw r0, r3
/* 8007B2A0 000770E0 41 80 FF C0 */ blt lbl_8007B260
/* 8007B2A4 000770E4 38 03 FF FF */ addi r0, r3, -0x1
/* 8007B2A8 000770E8 98 1B 5C F8 */ stb r0, 0x5cf8(r27)
/* 8007B2AC 000770EC 48 00 00 70 */ b lbl_8007B31C
.global lbl_8007B2B0
lbl_8007B2B0:
2022-10-16 16:31:36 +00:00
/* 8007B2B0 000770F0 3F C0 80 4F */ lis r30, bta_dm_conn_srvcs@ha
2022-10-16 16:05:58 +00:00
/* 8007B2B4 000770F4 57 A4 06 3E */ clrlwi r4, r29, 24
2022-10-16 16:31:36 +00:00
/* 8007B2B8 000770F8 88 1E 5C F8 */ lbz r0, bta_dm_conn_srvcs@l(r30)
2022-10-16 16:05:58 +00:00
/* 8007B2BC 000770FC 7C 04 00 40 */ cmplw r4, r0
/* 8007B2C0 00077100 40 82 00 5C */ bne lbl_8007B31C
/* 8007B2C4 00077104 28 00 00 05 */ cmplwi r0, 0x5
/* 8007B2C8 00077108 40 82 00 24 */ bne lbl_8007B2EC
2022-10-16 16:31:36 +00:00
/* 8007B2CC 0007710C 88 0D EA F0 */ lbz r0, appl_trace_level@sda21(r13)
2022-10-16 16:05:58 +00:00
/* 8007B2D0 00077110 28 00 00 02 */ cmplwi r0, 0x2
/* 8007B2D4 00077114 41 80 00 C4 */ blt lbl_8007B398
2022-10-16 16:31:36 +00:00
/* 8007B2D8 00077118 3C 80 80 44 */ lis r4, "@951"@ha
2022-10-16 16:05:58 +00:00
/* 8007B2DC 0007711C 38 60 05 01 */ li r3, 0x501
2022-10-16 16:31:36 +00:00
/* 8007B2E0 00077120 38 84 AB 98 */ addi r4, r4, "@951"@l
/* 8007B2E4 00077124 4B FF C6 7D */ bl LogMsg_0
2022-10-16 16:05:58 +00:00
/* 8007B2E8 00077128 48 00 00 B0 */ b lbl_8007B398
.global lbl_8007B2EC
lbl_8007B2EC:
/* 8007B2EC 0007712C 57 A3 1D 78 */ rlwinm r3, r29, 3, 21, 28
/* 8007B2F0 00077130 38 1E 5C F8 */ addi r0, r30, 0x5cf8
/* 8007B2F4 00077134 7C 63 22 14 */ add r3, r3, r4
/* 8007B2F8 00077138 7F 84 E3 78 */ mr r4, r28
/* 8007B2FC 0007713C 7C A0 1A 14 */ add r5, r0, r3
/* 8007B300 00077140 9B 45 00 07 */ stb r26, 0x7(r5)
/* 8007B304 00077144 38 65 00 01 */ addi r3, r5, 0x1
/* 8007B308 00077148 9B 65 00 08 */ stb r27, 0x8(r5)
2022-10-16 16:31:36 +00:00
/* 8007B30C 0007714C 4B FF CC 29 */ bl bdcpy
2022-10-16 16:05:58 +00:00
/* 8007B310 00077150 88 7E 5C F8 */ lbz r3, 0x5cf8(r30)
/* 8007B314 00077154 38 03 00 01 */ addi r0, r3, 0x1
/* 8007B318 00077158 98 1E 5C F8 */ stb r0, 0x5cf8(r30)
.global lbl_8007B31C
lbl_8007B31C:
2022-10-16 16:31:36 +00:00
/* 8007B31C 0007715C 3C 60 80 4F */ lis r3, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B320 00077160 3B 00 00 00 */ li r24, 0x0
2022-10-16 16:31:36 +00:00
/* 8007B324 00077164 3B 43 5B F4 */ addi r26, r3, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B328 00077168 48 00 00 38 */ b lbl_8007B360
.global lbl_8007B32C
lbl_8007B32C:
/* 8007B32C 0007716C 57 00 06 3E */ clrlwi r0, r24, 24
/* 8007B330 00077170 7F 84 E3 78 */ mr r4, r28
/* 8007B334 00077174 1E E0 00 0B */ mulli r23, r0, 0xb
/* 8007B338 00077178 7C 7A BA 14 */ add r3, r26, r23
2022-10-16 16:31:36 +00:00
/* 8007B33C 0007717C 4B FF CC 2D */ bl bdcmp
2022-10-16 16:05:58 +00:00
/* 8007B340 00077180 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B344 00077184 40 82 00 18 */ bne lbl_8007B35C
/* 8007B348 00077188 7C 7A BA 14 */ add r3, r26, r23
/* 8007B34C 0007718C 38 00 00 00 */ li r0, 0x0
/* 8007B350 00077190 98 03 00 09 */ stb r0, 0x9(r3)
/* 8007B354 00077194 98 03 00 0A */ stb r0, 0xa(r3)
/* 8007B358 00077198 48 00 00 18 */ b lbl_8007B370
.global lbl_8007B35C
lbl_8007B35C:
/* 8007B35C 0007719C 3B 18 00 01 */ addi r24, r24, 0x1
.global lbl_8007B360
lbl_8007B360:
/* 8007B360 000771A0 88 1A 00 4D */ lbz r0, 0x4d(r26)
/* 8007B364 000771A4 57 03 06 3E */ clrlwi r3, r24, 24
/* 8007B368 000771A8 7C 03 00 40 */ cmplw r3, r0
/* 8007B36C 000771AC 41 80 FF C0 */ blt lbl_8007B32C
.global lbl_8007B370
lbl_8007B370:
2022-10-16 16:31:36 +00:00
/* 8007B370 000771B0 3C C0 80 4F */ lis r6, bta_dm_conn_srvcs@ha
2022-10-16 16:05:58 +00:00
/* 8007B374 000771B4 57 A5 06 3E */ clrlwi r5, r29, 24
/* 8007B378 000771B8 57 A0 1D 78 */ rlwinm r0, r29, 3, 21, 28
/* 8007B37C 000771BC 7F 83 E3 78 */ mr r3, r28
2022-10-16 16:31:36 +00:00
/* 8007B380 000771C0 38 C6 5C F8 */ addi r6, r6, bta_dm_conn_srvcs@l
2022-10-16 16:05:58 +00:00
/* 8007B384 000771C4 38 80 00 00 */ li r4, 0x0
/* 8007B388 000771C8 7C 00 2A 14 */ add r0, r0, r5
/* 8007B38C 000771CC 7C A6 02 14 */ add r5, r6, r0
/* 8007B390 000771D0 9B 25 00 09 */ stb r25, 0x9(r5)
2022-10-16 16:31:36 +00:00
/* 8007B394 000771D4 48 00 00 1D */ bl bta_dm_pm_set_mode
2022-10-16 16:05:58 +00:00
.global lbl_8007B398
lbl_8007B398:
/* 8007B398 000771D8 39 61 00 40 */ addi r11, r1, 0x40
/* 8007B39C 000771DC 4B F8 BF DD */ bl lbl_80007378
/* 8007B3A0 000771E0 80 01 00 44 */ lwz r0, 0x44(r1)
/* 8007B3A4 000771E4 7C 08 03 A6 */ mtlr r0
/* 8007B3A8 000771E8 38 21 00 40 */ addi r1, r1, 0x40
/* 8007B3AC 000771EC 4E 80 00 20 */ blr
2022-10-16 16:31:36 +00:00
.global bta_dm_pm_set_mode
bta_dm_pm_set_mode:
2022-10-16 16:05:58 +00:00
/* 8007B3B0 000771F0 94 21 FF B0 */ stwu r1, -0x50(r1)
/* 8007B3B4 000771F4 7C 08 02 A6 */ mflr r0
/* 8007B3B8 000771F8 90 01 00 54 */ stw r0, 0x54(r1)
/* 8007B3BC 000771FC 39 61 00 50 */ addi r11, r1, 0x50
/* 8007B3C0 00077200 4B F8 BF 61 */ bl lbl_80007320
2022-10-16 16:31:36 +00:00
/* 8007B3C4 00077204 3C A0 80 4F */ lis r5, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B3C8 00077208 7C 74 1B 78 */ mr r20, r3
2022-10-16 16:31:36 +00:00
/* 8007B3CC 0007720C 3B 85 5B F4 */ addi r28, r5, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B3D0 00077210 7C 95 23 78 */ mr r21, r4
/* 8007B3D4 00077214 88 1C 00 4D */ lbz r0, 0x4d(r28)
/* 8007B3D8 00077218 3B 60 00 00 */ li r27, 0x0
/* 8007B3DC 0007721C 3B 40 00 00 */ li r26, 0x0
/* 8007B3E0 00077220 3B 20 00 00 */ li r25, 0x0
/* 8007B3E4 00077224 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B3E8 00077228 3B 00 00 00 */ li r24, 0x0
/* 8007B3EC 0007722C 3A E0 00 00 */ li r23, 0x0
/* 8007B3F0 00077230 3A C0 00 00 */ li r22, 0x0
/* 8007B3F4 00077234 41 82 03 24 */ beq lbl_8007B718
/* 8007B3F8 00077238 3B C0 00 00 */ li r30, 0x0
/* 8007B3FC 0007723C 48 00 00 30 */ b lbl_8007B42C
.global lbl_8007B400
lbl_8007B400:
/* 8007B400 00077240 57 C0 06 3E */ clrlwi r0, r30, 24
/* 8007B404 00077244 7E 84 A3 78 */ mr r4, r20
/* 8007B408 00077248 1F A0 00 0B */ mulli r29, r0, 0xb
/* 8007B40C 0007724C 7C 7C EA 14 */ add r3, r28, r29
2022-10-16 16:31:36 +00:00
/* 8007B410 00077250 4B FF CB 59 */ bl bdcmp
2022-10-16 16:05:58 +00:00
/* 8007B414 00077254 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B418 00077258 40 82 00 10 */ bne lbl_8007B428
/* 8007B41C 0007725C 7F 1C EA 14 */ add r24, r28, r29
/* 8007B420 00077260 8B 38 00 0A */ lbz r25, 0xa(r24)
/* 8007B424 00077264 48 00 00 18 */ b lbl_8007B43C
.global lbl_8007B428
lbl_8007B428:
/* 8007B428 00077268 3B DE 00 01 */ addi r30, r30, 0x1
.global lbl_8007B42C
lbl_8007B42C:
/* 8007B42C 0007726C 88 1C 00 4D */ lbz r0, 0x4d(r28)
/* 8007B430 00077270 57 C3 06 3E */ clrlwi r3, r30, 24
/* 8007B434 00077274 7C 03 00 40 */ cmplw r3, r0
/* 8007B438 00077278 41 80 FF C8 */ blt lbl_8007B400
.global lbl_8007B43C
lbl_8007B43C:
/* 8007B43C 0007727C 2C 18 00 00 */ cmpwi r24, 0x0
/* 8007B440 00077280 41 82 02 D8 */ beq lbl_8007B718
2022-10-16 16:31:36 +00:00
/* 8007B444 00077284 3F C0 80 4F */ lis r30, bta_dm_conn_srvcs@ha
2022-10-16 16:05:58 +00:00
/* 8007B448 00077288 3B 80 00 00 */ li r28, 0x0
2022-10-16 16:31:36 +00:00
/* 8007B44C 0007728C 3B FE 5C F8 */ addi r31, r30, bta_dm_conn_srvcs@l
2022-10-16 16:05:58 +00:00
/* 8007B450 00077290 48 00 01 30 */ b lbl_8007B580
.global lbl_8007B454
lbl_8007B454:
/* 8007B454 00077294 57 83 06 3E */ clrlwi r3, r28, 24
/* 8007B458 00077298 57 80 1D 78 */ rlwinm r0, r28, 3, 21, 28
/* 8007B45C 0007729C 7F A0 1A 14 */ add r29, r0, r3
/* 8007B460 000772A0 7E 84 A3 78 */ mr r4, r20
/* 8007B464 000772A4 7C 7F EA 14 */ add r3, r31, r29
/* 8007B468 000772A8 38 63 00 01 */ addi r3, r3, 0x1
2022-10-16 16:31:36 +00:00
/* 8007B46C 000772AC 4B FF CA FD */ bl bdcmp
2022-10-16 16:05:58 +00:00
/* 8007B470 000772B0 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B474 000772B4 40 82 01 08 */ bne lbl_8007B57C
2022-10-16 16:31:36 +00:00
/* 8007B478 000772B8 80 ED 84 98 */ lwz r7, p_bta_dm_pm_cfg@sda21(r13)
2022-10-16 16:05:58 +00:00
/* 8007B47C 000772BC 7D 1F EA 14 */ add r8, r31, r29
/* 8007B480 000772C0 88 68 00 08 */ lbz r3, 0x8(r8)
/* 8007B484 000772C4 39 20 00 01 */ li r9, 0x1
/* 8007B488 000772C8 88 C7 00 01 */ lbz r6, 0x1(r7)
/* 8007B48C 000772CC 88 88 00 07 */ lbz r4, 0x7(r8)
/* 8007B490 000772D0 48 00 00 38 */ b lbl_8007B4C8
.global lbl_8007B494
lbl_8007B494:
/* 8007B494 000772D4 55 25 06 3E */ clrlwi r5, r9, 24
/* 8007B498 000772D8 55 20 15 BA */ rlwinm r0, r9, 2, 22, 29
/* 8007B49C 000772DC 7C 05 00 50 */ subf r0, r5, r0
/* 8007B4A0 000772E0 7C A7 02 14 */ add r5, r7, r0
/* 8007B4A4 000772E4 7C 07 00 AE */ lbzx r0, r7, r0
/* 8007B4A8 000772E8 7C 00 20 40 */ cmplw r0, r4
/* 8007B4AC 000772EC 40 82 00 18 */ bne lbl_8007B4C4
/* 8007B4B0 000772F0 88 05 00 01 */ lbz r0, 0x1(r5)
/* 8007B4B4 000772F4 28 00 00 FF */ cmplwi r0, 0xff
/* 8007B4B8 000772F8 41 82 00 1C */ beq lbl_8007B4D4
/* 8007B4BC 000772FC 7C 00 18 40 */ cmplw r0, r3
/* 8007B4C0 00077300 41 82 00 14 */ beq lbl_8007B4D4
.global lbl_8007B4C4
lbl_8007B4C4:
/* 8007B4C4 00077304 39 29 00 01 */ addi r9, r9, 0x1
.global lbl_8007B4C8
lbl_8007B4C8:
/* 8007B4C8 00077308 55 20 06 3E */ clrlwi r0, r9, 24
/* 8007B4CC 0007730C 7C 00 30 40 */ cmplw r0, r6
/* 8007B4D0 00077310 40 81 FF C4 */ ble lbl_8007B494
.global lbl_8007B4D4
lbl_8007B4D4:
/* 8007B4D4 00077314 55 23 06 3E */ clrlwi r3, r9, 24
/* 8007B4D8 00077318 55 20 15 BA */ rlwinm r0, r9, 2, 22, 29
/* 8007B4DC 0007731C 7C 63 00 50 */ subf r3, r3, r0
/* 8007B4E0 00077320 88 08 00 09 */ lbz r0, 0x9(r8)
/* 8007B4E4 00077324 7C 87 1A 14 */ add r4, r7, r3
2022-10-16 16:31:36 +00:00
/* 8007B4E8 00077328 80 6D 84 9C */ lwz r3, p_bta_dm_pm_spec@sda21(r13)
2022-10-16 16:05:58 +00:00
/* 8007B4EC 0007732C 88 84 00 02 */ lbz r4, 0x2(r4)
/* 8007B4F0 00077330 54 00 18 38 */ slwi r0, r0, 3
/* 8007B4F4 00077334 1C 84 00 4A */ mulli r4, r4, 0x4a
/* 8007B4F8 00077338 7C A3 22 14 */ add r5, r3, r4
/* 8007B4FC 0007733C 7C 65 02 14 */ add r3, r5, r0
/* 8007B500 00077340 88 05 00 00 */ lbz r0, 0x0(r5)
/* 8007B504 00077344 88 83 00 02 */ lbz r4, 0x2(r3)
/* 8007B508 00077348 7E F7 03 78 */ or r23, r23, r0
/* 8007B50C 0007734C 7F 20 20 39 */ and. r0, r25, r4
/* 8007B510 00077350 40 82 00 34 */ bne lbl_8007B544
/* 8007B514 00077354 7C 7F EA 14 */ add r3, r31, r29
/* 8007B518 00077358 57 60 06 3E */ clrlwi r0, r27, 24
/* 8007B51C 0007735C 88 63 00 09 */ lbz r3, 0x9(r3)
/* 8007B520 00077360 54 63 18 38 */ slwi r3, r3, 3
/* 8007B524 00077364 7C A5 1A 14 */ add r5, r5, r3
/* 8007B528 00077368 88 65 00 02 */ lbz r3, 0x2(r5)
/* 8007B52C 0007736C 7C 03 00 40 */ cmplw r3, r0
/* 8007B530 00077370 7E D6 1B 78 */ or r22, r22, r3
/* 8007B534 00077374 40 81 00 48 */ ble lbl_8007B57C
/* 8007B538 00077378 A3 45 00 04 */ lhz r26, 0x4(r5)
/* 8007B53C 0007737C 7C 9B 23 78 */ mr r27, r4
/* 8007B540 00077380 48 00 00 3C */ b lbl_8007B57C
.global lbl_8007B544
lbl_8007B544:
/* 8007B544 00077384 88 63 00 06 */ lbz r3, 0x6(r3)
/* 8007B548 00077388 7F 20 18 39 */ and. r0, r25, r3
/* 8007B54C 0007738C 40 82 00 30 */ bne lbl_8007B57C
/* 8007B550 00077390 7C 9F EA 14 */ add r4, r31, r29
/* 8007B554 00077394 57 60 06 3E */ clrlwi r0, r27, 24
/* 8007B558 00077398 88 84 00 09 */ lbz r4, 0x9(r4)
/* 8007B55C 0007739C 54 84 18 38 */ slwi r4, r4, 3
/* 8007B560 000773A0 7C A5 22 14 */ add r5, r5, r4
/* 8007B564 000773A4 88 85 00 06 */ lbz r4, 0x6(r5)
/* 8007B568 000773A8 7C 04 00 40 */ cmplw r4, r0
/* 8007B56C 000773AC 7E D6 23 78 */ or r22, r22, r4
/* 8007B570 000773B0 40 81 00 0C */ ble lbl_8007B57C
/* 8007B574 000773B4 7C 7B 1B 78 */ mr r27, r3
/* 8007B578 000773B8 A3 45 00 08 */ lhz r26, 0x8(r5)
.global lbl_8007B57C
lbl_8007B57C:
/* 8007B57C 000773BC 3B 9C 00 01 */ addi r28, r28, 0x1
.global lbl_8007B580
lbl_8007B580:
/* 8007B580 000773C0 88 1E 5C F8 */ lbz r0, 0x5cf8(r30)
/* 8007B584 000773C4 57 83 06 3E */ clrlwi r3, r28, 24
/* 8007B588 000773C8 7C 03 00 40 */ cmplw r3, r0
/* 8007B58C 000773CC 41 80 FE C8 */ blt lbl_8007B454
/* 8007B590 000773D0 57 60 07 BF */ clrlwi. r0, r27, 30
/* 8007B594 000773D4 41 82 00 24 */ beq lbl_8007B5B8
/* 8007B598 000773D8 56 E3 06 3E */ clrlwi r3, r23, 24
/* 8007B59C 000773DC 57 60 06 3E */ clrlwi r0, r27, 24
/* 8007B5A0 000773E0 7C 60 00 39 */ and. r0, r3, r0
/* 8007B5A4 000773E4 40 82 00 14 */ bne lbl_8007B5B8
/* 8007B5A8 000773E8 7E E0 B0 38 */ and r0, r23, r22
/* 8007B5AC 000773EC 54 1B 07 BF */ clrlwi. r27, r0, 30
/* 8007B5B0 000773F0 40 82 00 08 */ bne lbl_8007B5B8
/* 8007B5B4 000773F4 3B 40 00 00 */ li r26, 0x0
.global lbl_8007B5B8
lbl_8007B5B8:
/* 8007B5B8 000773F8 2C 15 00 00 */ cmpwi r21, 0x0
/* 8007B5BC 000773FC 40 82 00 A0 */ bne lbl_8007B65C
/* 8007B5C0 00077400 2C 1A 00 00 */ cmpwi r26, 0x0
/* 8007B5C4 00077404 41 82 00 98 */ beq lbl_8007B65C
2022-10-16 16:31:36 +00:00
/* 8007B5C8 00077408 3E A0 80 4F */ lis r21, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B5CC 0007740C 38 00 00 03 */ li r0, 0x3
2022-10-16 16:31:36 +00:00
/* 8007B5D0 00077410 3A B5 5B F4 */ addi r21, r21, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B5D4 00077414 38 80 00 00 */ li r4, 0x0
/* 8007B5D8 00077418 7C 09 03 A6 */ mtctr r0
.global lbl_8007B5DC
lbl_8007B5DC:
/* 8007B5DC 0007741C 54 96 2C F4 */ rlwinm r22, r4, 5, 19, 26
/* 8007B5E0 00077420 7C 75 B2 14 */ add r3, r21, r22
/* 8007B5E4 00077424 88 03 00 B6 */ lbz r0, 0xb6(r3)
/* 8007B5E8 00077428 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B5EC 0007742C 40 82 00 3C */ bne lbl_8007B628
/* 8007B5F0 00077430 38 00 00 01 */ li r0, 0x1
/* 8007B5F4 00077434 7E 84 A3 78 */ mr r4, r20
/* 8007B5F8 00077438 98 03 00 B6 */ stb r0, 0xb6(r3)
/* 8007B5FC 0007743C 38 63 00 B0 */ addi r3, r3, 0xb0
2022-10-16 16:31:36 +00:00
/* 8007B600 00077440 4B FF C9 35 */ bl bdcpy
/* 8007B604 00077444 3C 80 80 08 */ lis r4, bta_dm_pm_timer_cback@ha
2022-10-16 16:05:58 +00:00
/* 8007B608 00077448 7C 75 B2 14 */ add r3, r21, r22
2022-10-16 16:31:36 +00:00
/* 8007B60C 0007744C 38 84 B7 A8 */ addi r4, r4, bta_dm_pm_timer_cback@l
2022-10-16 16:05:58 +00:00
/* 8007B610 00077450 7F 45 D3 78 */ mr r5, r26
/* 8007B614 00077454 90 83 00 A0 */ stw r4, 0xa0(r3)
/* 8007B618 00077458 38 63 00 98 */ addi r3, r3, 0x98
/* 8007B61C 0007745C 38 80 00 00 */ li r4, 0x0
2022-10-16 16:31:36 +00:00
/* 8007B620 00077460 4B FF CD DD */ bl bta_sys_start_timer
2022-10-16 16:05:58 +00:00
/* 8007B624 00077464 48 00 00 F4 */ b lbl_8007B718
.global lbl_8007B628
lbl_8007B628:
/* 8007B628 00077468 38 84 00 01 */ addi r4, r4, 0x1
/* 8007B62C 0007746C 54 80 06 3E */ clrlwi r0, r4, 24
/* 8007B630 00077470 42 00 FF AC */ bdnz lbl_8007B5DC
/* 8007B634 00077474 28 00 00 03 */ cmplwi r0, 0x3
/* 8007B638 00077478 40 82 00 24 */ bne lbl_8007B65C
2022-10-16 16:31:36 +00:00
/* 8007B63C 0007747C 88 0D EA F0 */ lbz r0, appl_trace_level@sda21(r13)
2022-10-16 16:05:58 +00:00
/* 8007B640 00077480 28 00 00 02 */ cmplwi r0, 0x2
/* 8007B644 00077484 41 80 00 D4 */ blt lbl_8007B718
2022-10-16 16:31:36 +00:00
/* 8007B648 00077488 3C 80 80 44 */ lis r4, "@1226"@ha
2022-10-16 16:05:58 +00:00
/* 8007B64C 0007748C 38 60 05 01 */ li r3, 0x501
2022-10-16 16:31:36 +00:00
/* 8007B650 00077490 38 84 AB C4 */ addi r4, r4, "@1226"@l
/* 8007B654 00077494 4B FF C3 0D */ bl LogMsg_0
2022-10-16 16:05:58 +00:00
/* 8007B658 00077498 48 00 00 C0 */ b lbl_8007B718
.global lbl_8007B65C
lbl_8007B65C:
/* 8007B65C 0007749C 57 60 06 3F */ clrlwi. r0, r27, 24
/* 8007B660 000774A0 41 82 00 B8 */ beq lbl_8007B718
/* 8007B664 000774A4 28 00 00 01 */ cmplwi r0, 0x1
/* 8007B668 000774A8 40 82 00 44 */ bne lbl_8007B6AC
/* 8007B66C 000774AC 38 00 00 01 */ li r0, 0x1
/* 8007B670 000774B0 7E 83 A3 78 */ mr r3, r20
/* 8007B674 000774B4 98 18 00 09 */ stb r0, 0x9(r24)
/* 8007B678 000774B8 38 81 00 09 */ addi r4, r1, 0x9
2022-10-16 16:31:36 +00:00
/* 8007B67C 000774BC 48 00 83 AD */ bl BTM_ReadPowerMode
2022-10-16 16:05:58 +00:00
/* 8007B680 000774C0 88 01 00 09 */ lbz r0, 0x9(r1)
/* 8007B684 000774C4 28 00 00 03 */ cmplwi r0, 0x3
/* 8007B688 000774C8 41 82 00 90 */ beq lbl_8007B718
2022-10-16 16:31:36 +00:00
/* 8007B68C 000774CC 3C 60 80 4F */ lis r3, bta_dm_cb@ha
/* 8007B690 000774D0 80 AD 84 A0 */ lwz r5, p_bta_dm_pm_md@sda21(r13)
/* 8007B694 000774D4 38 63 5B F4 */ addi r3, r3, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B698 000774D8 7E 84 A3 78 */ mr r4, r20
/* 8007B69C 000774DC 88 63 00 95 */ lbz r3, 0x95(r3)
/* 8007B6A0 000774E0 38 A5 00 0A */ addi r5, r5, 0xa
2022-10-16 16:31:36 +00:00
/* 8007B6A4 000774E4 48 00 81 B5 */ bl BTM_SetPowerMode
2022-10-16 16:05:58 +00:00
/* 8007B6A8 000774E8 48 00 00 70 */ b lbl_8007B718
.global lbl_8007B6AC
lbl_8007B6AC:
/* 8007B6AC 000774EC 28 00 00 02 */ cmplwi r0, 0x2
/* 8007B6B0 000774F0 40 82 00 40 */ bne lbl_8007B6F0
/* 8007B6B4 000774F4 38 00 00 02 */ li r0, 0x2
/* 8007B6B8 000774F8 7E 83 A3 78 */ mr r3, r20
/* 8007B6BC 000774FC 98 18 00 09 */ stb r0, 0x9(r24)
/* 8007B6C0 00077500 38 81 00 08 */ addi r4, r1, 0x8
2022-10-16 16:31:36 +00:00
/* 8007B6C4 00077504 48 00 83 65 */ bl BTM_ReadPowerMode
2022-10-16 16:05:58 +00:00
/* 8007B6C8 00077508 88 01 00 08 */ lbz r0, 0x8(r1)
/* 8007B6CC 0007750C 28 00 00 02 */ cmplwi r0, 0x2
/* 8007B6D0 00077510 41 82 00 48 */ beq lbl_8007B718
2022-10-16 16:31:36 +00:00
/* 8007B6D4 00077514 3C 60 80 4F */ lis r3, bta_dm_cb@ha
/* 8007B6D8 00077518 80 AD 84 A0 */ lwz r5, p_bta_dm_pm_md@sda21(r13)
/* 8007B6DC 0007751C 38 63 5B F4 */ addi r3, r3, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B6E0 00077520 7E 84 A3 78 */ mr r4, r20
/* 8007B6E4 00077524 88 63 00 95 */ lbz r3, 0x95(r3)
2022-10-16 16:31:36 +00:00
/* 8007B6E8 00077528 48 00 81 71 */ bl BTM_SetPowerMode
2022-10-16 16:05:58 +00:00
/* 8007B6EC 0007752C 48 00 00 2C */ b lbl_8007B718
.global lbl_8007B6F0
lbl_8007B6F0:
/* 8007B6F0 00077530 28 00 00 04 */ cmplwi r0, 0x4
/* 8007B6F4 00077534 40 82 00 24 */ bne lbl_8007B718
2022-10-16 16:31:36 +00:00
/* 8007B6F8 00077538 3C 60 80 4F */ lis r3, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B6FC 0007753C 38 00 00 00 */ li r0, 0x0
2022-10-16 16:31:36 +00:00
/* 8007B700 00077540 38 63 5B F4 */ addi r3, r3, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B704 00077544 98 01 00 14 */ stb r0, 0x14(r1)
/* 8007B708 00077548 88 63 00 95 */ lbz r3, 0x95(r3)
/* 8007B70C 0007754C 7E 84 A3 78 */ mr r4, r20
/* 8007B710 00077550 38 A1 00 0C */ addi r5, r1, 0xc
2022-10-16 16:31:36 +00:00
/* 8007B714 00077554 48 00 81 45 */ bl BTM_SetPowerMode
2022-10-16 16:05:58 +00:00
.global lbl_8007B718
lbl_8007B718:
/* 8007B718 00077558 39 61 00 50 */ addi r11, r1, 0x50
/* 8007B71C 0007755C 4B F8 BC 51 */ bl lbl_8000736C
/* 8007B720 00077560 80 01 00 54 */ lwz r0, 0x54(r1)
/* 8007B724 00077564 7C 08 03 A6 */ mtlr r0
/* 8007B728 00077568 38 21 00 50 */ addi r1, r1, 0x50
/* 8007B72C 0007756C 4E 80 00 20 */ blr
2022-10-16 16:31:36 +00:00
.global bta_dm_pm_btm_cback
bta_dm_pm_btm_cback:
2022-10-16 16:05:58 +00:00
/* 8007B730 00077570 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 8007B734 00077574 7C 08 02 A6 */ mflr r0
/* 8007B738 00077578 90 01 00 24 */ stw r0, 0x24(r1)
/* 8007B73C 0007757C 39 61 00 20 */ addi r11, r1, 0x20
/* 8007B740 00077580 4B F8 BB FD */ bl lbl_8000733C
/* 8007B744 00077584 7C 7B 1B 78 */ mr r27, r3
/* 8007B748 00077588 7C 9C 23 78 */ mr r28, r4
/* 8007B74C 0007758C 7C BD 2B 78 */ mr r29, r5
/* 8007B750 00077590 7C DE 33 78 */ mr r30, r6
/* 8007B754 00077594 38 60 00 14 */ li r3, 0x14
2022-10-16 16:31:36 +00:00
/* 8007B758 00077598 4B FF 95 29 */ bl GKI_getbuf
2022-10-16 16:05:58 +00:00
/* 8007B75C 0007759C 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B760 000775A0 7C 7F 1B 78 */ mr r31, r3
/* 8007B764 000775A4 41 82 00 2C */ beq lbl_8007B790
/* 8007B768 000775A8 38 00 01 09 */ li r0, 0x109
/* 8007B76C 000775AC 7F 64 DB 78 */ mr r4, r27
/* 8007B770 000775B0 B0 03 00 00 */ sth r0, 0x0(r3)
/* 8007B774 000775B4 9B 83 00 0E */ stb r28, 0xe(r3)
/* 8007B778 000775B8 B3 A3 00 10 */ sth r29, 0x10(r3)
/* 8007B77C 000775BC 9B C3 00 12 */ stb r30, 0x12(r3)
/* 8007B780 000775C0 38 63 00 08 */ addi r3, r3, 0x8
2022-10-16 16:31:36 +00:00
/* 8007B784 000775C4 4B FF C7 B1 */ bl bdcpy
2022-10-16 16:05:58 +00:00
/* 8007B788 000775C8 7F E3 FB 78 */ mr r3, r31
2022-10-16 16:31:36 +00:00
/* 8007B78C 000775CC 4B FF CC 55 */ bl bta_sys_sendmsg
2022-10-16 16:05:58 +00:00
.global lbl_8007B790
lbl_8007B790:
/* 8007B790 000775D0 39 61 00 20 */ addi r11, r1, 0x20
/* 8007B794 000775D4 4B F8 BB F5 */ bl lbl_80007388
/* 8007B798 000775D8 80 01 00 24 */ lwz r0, 0x24(r1)
/* 8007B79C 000775DC 7C 08 03 A6 */ mtlr r0
/* 8007B7A0 000775E0 38 21 00 20 */ addi r1, r1, 0x20
/* 8007B7A4 000775E4 4E 80 00 20 */ blr
2022-10-16 16:31:36 +00:00
.global bta_dm_pm_timer_cback
bta_dm_pm_timer_cback:
2022-10-16 16:05:58 +00:00
/* 8007B7A8 000775E8 94 21 FF F0 */ stwu r1, -0x10(r1)
/* 8007B7AC 000775EC 7C 08 02 A6 */ mflr r0
2022-10-16 16:31:36 +00:00
/* 8007B7B0 000775F0 3C 80 80 4F */ lis r4, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B7B4 000775F4 90 01 00 14 */ stw r0, 0x14(r1)
2022-10-16 16:31:36 +00:00
/* 8007B7B8 000775F8 38 84 5B F4 */ addi r4, r4, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B7BC 000775FC 93 E1 00 0C */ stw r31, 0xc(r1)
/* 8007B7C0 00077600 93 C1 00 08 */ stw r30, 0x8(r1)
/* 8007B7C4 00077604 3B C0 00 00 */ li r30, 0x0
/* 8007B7C8 00077608 88 04 00 B6 */ lbz r0, 0xb6(r4)
/* 8007B7CC 0007760C 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B7D0 00077610 41 82 00 1C */ beq lbl_8007B7EC
/* 8007B7D4 00077614 38 04 00 98 */ addi r0, r4, 0x98
/* 8007B7D8 00077618 7C 00 18 40 */ cmplw r0, r3
/* 8007B7DC 0007761C 40 82 00 10 */ bne lbl_8007B7EC
/* 8007B7E0 00077620 38 00 00 00 */ li r0, 0x0
/* 8007B7E4 00077624 98 04 00 B6 */ stb r0, 0xb6(r4)
/* 8007B7E8 00077628 48 00 00 58 */ b lbl_8007B840
.global lbl_8007B7EC
lbl_8007B7EC:
/* 8007B7EC 0007762C 88 04 00 D6 */ lbz r0, 0xd6(r4)
/* 8007B7F0 00077630 3B C0 00 01 */ li r30, 0x1
/* 8007B7F4 00077634 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B7F8 00077638 41 82 00 1C */ beq lbl_8007B814
/* 8007B7FC 0007763C 38 04 00 B8 */ addi r0, r4, 0xb8
/* 8007B800 00077640 7C 00 18 40 */ cmplw r0, r3
/* 8007B804 00077644 40 82 00 10 */ bne lbl_8007B814
/* 8007B808 00077648 38 00 00 00 */ li r0, 0x0
/* 8007B80C 0007764C 98 04 00 D6 */ stb r0, 0xd6(r4)
/* 8007B810 00077650 48 00 00 30 */ b lbl_8007B840
.global lbl_8007B814
lbl_8007B814:
/* 8007B814 00077654 88 04 00 F6 */ lbz r0, 0xf6(r4)
/* 8007B818 00077658 3B C0 00 02 */ li r30, 0x2
/* 8007B81C 0007765C 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B820 00077660 41 82 00 1C */ beq lbl_8007B83C
/* 8007B824 00077664 38 04 00 D8 */ addi r0, r4, 0xd8
/* 8007B828 00077668 7C 00 18 40 */ cmplw r0, r3
/* 8007B82C 0007766C 40 82 00 10 */ bne lbl_8007B83C
/* 8007B830 00077670 38 00 00 00 */ li r0, 0x0
/* 8007B834 00077674 98 04 00 F6 */ stb r0, 0xf6(r4)
/* 8007B838 00077678 48 00 00 08 */ b lbl_8007B840
.global lbl_8007B83C
lbl_8007B83C:
/* 8007B83C 0007767C 3B C0 00 03 */ li r30, 0x3
.global lbl_8007B840
lbl_8007B840:
/* 8007B840 00077680 28 1E 00 03 */ cmplwi r30, 0x3
/* 8007B844 00077684 41 82 00 44 */ beq lbl_8007B888
/* 8007B848 00077688 38 60 00 0E */ li r3, 0xe
2022-10-16 16:31:36 +00:00
/* 8007B84C 0007768C 4B FF 94 35 */ bl GKI_getbuf
2022-10-16 16:05:58 +00:00
/* 8007B850 00077690 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B854 00077694 7C 7F 1B 78 */ mr r31, r3
/* 8007B858 00077698 41 82 00 30 */ beq lbl_8007B888
2022-10-16 16:31:36 +00:00
/* 8007B85C 0007769C 3C 80 80 4F */ lis r4, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B860 000776A0 38 A0 01 0A */ li r5, 0x10a
2022-10-16 16:31:36 +00:00
/* 8007B864 000776A4 38 84 5B F4 */ addi r4, r4, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B868 000776A8 57 C0 2C F4 */ rlwinm r0, r30, 5, 19, 26
/* 8007B86C 000776AC B0 A3 00 00 */ sth r5, 0x0(r3)
/* 8007B870 000776B0 7C 84 02 14 */ add r4, r4, r0
/* 8007B874 000776B4 38 84 00 B0 */ addi r4, r4, 0xb0
/* 8007B878 000776B8 38 63 00 08 */ addi r3, r3, 0x8
2022-10-16 16:31:36 +00:00
/* 8007B87C 000776BC 4B FF C6 B9 */ bl bdcpy
2022-10-16 16:05:58 +00:00
/* 8007B880 000776C0 7F E3 FB 78 */ mr r3, r31
2022-10-16 16:31:36 +00:00
/* 8007B884 000776C4 4B FF CB 5D */ bl bta_sys_sendmsg
2022-10-16 16:05:58 +00:00
.global lbl_8007B888
lbl_8007B888:
/* 8007B888 000776C8 80 01 00 14 */ lwz r0, 0x14(r1)
/* 8007B88C 000776CC 83 E1 00 0C */ lwz r31, 0xc(r1)
/* 8007B890 000776D0 83 C1 00 08 */ lwz r30, 0x8(r1)
/* 8007B894 000776D4 7C 08 03 A6 */ mtlr r0
/* 8007B898 000776D8 38 21 00 10 */ addi r1, r1, 0x10
/* 8007B89C 000776DC 4E 80 00 20 */ blr
2022-10-16 16:31:36 +00:00
.global bta_dm_pm_btm_status
bta_dm_pm_btm_status:
2022-10-16 16:05:58 +00:00
/* 8007B8A0 000776E0 94 21 FF E0 */ stwu r1, -0x20(r1)
/* 8007B8A4 000776E4 7C 08 02 A6 */ mflr r0
/* 8007B8A8 000776E8 90 01 00 24 */ stw r0, 0x24(r1)
/* 8007B8AC 000776EC 39 61 00 20 */ addi r11, r1, 0x20
/* 8007B8B0 000776F0 4B F8 BA 8D */ bl lbl_8000733C
2022-10-16 16:31:36 +00:00
/* 8007B8B4 000776F4 3F C0 80 4F */ lis r30, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B8B8 000776F8 7C 7F 1B 78 */ mr r31, r3
2022-10-16 16:31:36 +00:00
/* 8007B8BC 000776FC 3B DE 5B F4 */ addi r30, r30, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B8C0 00077700 3B 60 00 00 */ li r27, 0x0
.global lbl_8007B8C4
lbl_8007B8C4:
/* 8007B8C4 00077704 57 7C 2C F4 */ rlwinm r28, r27, 5, 19, 26
/* 8007B8C8 00077708 7F BE E2 14 */ add r29, r30, r28
/* 8007B8CC 0007770C 88 1D 00 B6 */ lbz r0, 0xb6(r29)
/* 8007B8D0 00077710 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B8D4 00077714 41 82 00 30 */ beq lbl_8007B904
/* 8007B8D8 00077718 38 7D 00 B0 */ addi r3, r29, 0xb0
/* 8007B8DC 0007771C 38 9F 00 08 */ addi r4, r31, 0x8
2022-10-16 16:31:36 +00:00
/* 8007B8E0 00077720 4B FF C6 89 */ bl bdcmp
2022-10-16 16:05:58 +00:00
/* 8007B8E4 00077724 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B8E8 00077728 40 82 00 1C */ bne lbl_8007B904
/* 8007B8EC 0007772C 7F A3 EB 78 */ mr r3, r29
/* 8007B8F0 00077730 38 63 00 98 */ addi r3, r3, 0x98
2022-10-16 16:31:36 +00:00
/* 8007B8F4 00077734 4B FF CB 29 */ bl bta_sys_stop_timer
2022-10-16 16:05:58 +00:00
/* 8007B8F8 00077738 38 00 00 00 */ li r0, 0x0
/* 8007B8FC 0007773C 98 1D 00 B6 */ stb r0, 0xb6(r29)
/* 8007B900 00077740 48 00 00 10 */ b lbl_8007B910
.global lbl_8007B904
lbl_8007B904:
/* 8007B904 00077744 3B 7B 00 01 */ addi r27, r27, 0x1
/* 8007B908 00077748 28 1B 00 03 */ cmplwi r27, 0x3
/* 8007B90C 0007774C 41 80 FF B8 */ blt lbl_8007B8C4
.global lbl_8007B910
lbl_8007B910:
/* 8007B910 00077750 88 1F 00 0E */ lbz r0, 0xe(r31)
/* 8007B914 00077754 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B918 00077758 41 82 00 08 */ beq lbl_8007B920
/* 8007B91C 0007775C 48 00 00 8C */ b lbl_8007B9A8
.global lbl_8007B920
lbl_8007B920:
/* 8007B920 00077760 88 1F 00 12 */ lbz r0, 0x12(r31)
/* 8007B924 00077764 2C 00 00 00 */ cmpwi r0, 0x0
/* 8007B928 00077768 41 82 00 74 */ beq lbl_8007B99C
2022-10-16 16:31:36 +00:00
/* 8007B92C 0007776C 3C 60 80 4F */ lis r3, bta_dm_cb@ha
2022-10-16 16:05:58 +00:00
/* 8007B930 00077770 3B A0 00 00 */ li r29, 0x0
2022-10-16 16:31:36 +00:00
/* 8007B934 00077774 3B C3 5B F4 */ addi r30, r3, bta_dm_cb@l
2022-10-16 16:05:58 +00:00
/* 8007B938 00077778 48 00 00 50 */ b lbl_8007B988
.global lbl_8007B93C
lbl_8007B93C:
/* 8007B93C 0007777C 57 A0 06 3E */ clrlwi r0, r29, 24
/* 8007B940 00077780 38 9F 00 08 */ addi r4, r31, 0x8
/* 8007B944 00077784 1F 80 00 0B */ mulli r28, r0, 0xb
/* 8007B948 00077788 7C 7E E2 14 */ add r3, r30, r28
2022-10-16 16:31:36 +00:00
/* 8007B94C 0007778C 4B FF C6 1D */ bl bdcmp
2022-10-16 16:05:58 +00:00
/* 8007B950 00077790 2C 03 00 00 */ cmpwi r3, 0x0
/* 8007B954 00077794 40 82 00 30 */ bne lbl_8007B984
/* 8007B958 00077798 7C BE E2 14 */ add r5, r30, r28
/* 8007B95C 0007779C 88 05 00 09 */ lbz r0, 0x9(r5)
/* 8007B960 000777A0 54 06 07 BF */ clrlwi. r6, r0, 30
/* 8007B964 000777A4 41 82 00 44 */ beq lbl_8007B9A8
/* 8007B968 000777A8 88 05 00 0A */ lbz r0, 0xa(r5)
/* 8007B96C 000777AC 38 7F 00 08 */ addi r3, r31, 0x8
/* 8007B970 000777B0 38 80 00 00 */ li r4, 0x0
/* 8007B974 000777B4 7C 00 33 78 */ or r0, r0, r6
/* 8007B978 000777B8 98 05 00 0A */ stb r0, 0xa(r5)
2022-10-16 16:31:36 +00:00
/* 8007B97C 000777BC 4B FF FA 35 */ bl bta_dm_pm_set_mode
2022-10-16 16:05:58 +00:00
/* 8007B980 000777C0 48 00 00 28 */ b lbl_8007B9A8
.global lbl_8007B984
lbl_8007B984:
/* 8007B984 000777C4 3B BD 00 01 */ addi r29, r29, 0x1
.global lbl_8007B988
lbl_8007B988:
/* 8007B988 000777C8 88 1E 00 4D */ lbz r0, 0x4d(r30)
/* 8007B98C 000777CC 57 A3 06 3E */ clrlwi r3, r29, 24
/* 8007B990 000777D0 7C 03 00 40 */ cmplw r3, r0
/* 8007B994 000777D4 41 80 FF A8 */ blt lbl_8007B93C
/* 8007B998 000777D8 48 00 00 10 */ b lbl_8007B9A8
.global lbl_8007B99C
lbl_8007B99C:
/* 8007B99C 000777DC 38 7F 00 08 */ addi r3, r31, 0x8
/* 8007B9A0 000777E0 38 80 00 00 */ li r4, 0x0
2022-10-16 16:31:36 +00:00
/* 8007B9A4 000777E4 4B FF FA 0D */ bl bta_dm_pm_set_mode
2022-10-16 16:05:58 +00:00
.global lbl_8007B9A8
lbl_8007B9A8:
/* 8007B9A8 000777E8 39 61 00 20 */ addi r11, r1, 0x20
/* 8007B9AC 000777EC 4B F8 B9 DD */ bl lbl_80007388
/* 8007B9B0 000777F0 80 01 00 24 */ lwz r0, 0x24(r1)
/* 8007B9B4 000777F4 7C 08 03 A6 */ mtlr r0
/* 8007B9B8 000777F8 38 21 00 20 */ addi r1, r1, 0x20
/* 8007B9BC 000777FC 4E 80 00 20 */ blr
2022-10-16 16:31:36 +00:00
.global bta_dm_pm_timer
bta_dm_pm_timer:
2022-10-16 16:05:58 +00:00
/* 8007B9C0 00077800 38 80 00 01 */ li r4, 0x1
/* 8007B9C4 00077804 38 63 00 08 */ addi r3, r3, 0x8
2022-10-16 16:31:36 +00:00
/* 8007B9C8 00077808 4B FF F9 E8 */ b bta_dm_pm_set_mode
2022-10-17 08:41:13 +00:00
.include "macros.inc"
.section .data, "wa" # 0x80421040 - 0x80496700 ; 0x000756C0
.global "@951"
"@951":
.4byte 0x6274615F
.4byte 0x646D5F61
.4byte 0x6374206E
.4byte 0x6F206D6F
.4byte 0x72652063
.4byte 0x6F6E6E65
.4byte 0x63746564
.4byte 0x20736572
.4byte 0x76696365
.4byte 0x20636273
.4byte 0
.global "@1226"
"@1226":
.4byte 0x6274615F
.4byte 0x646D5F61
.4byte 0x6374206E
.4byte 0x6F206D6F
.4byte 0x72652070
.4byte 0x6D207469
.4byte 0x6D657273
.4byte 0
.4byte 0
.include "macros.inc"
.section .bss, "", @nobits # 0x80496700 - 0x80556420 ; 0x000BFD20
.global bta_dm_conn_srvcs
bta_dm_conn_srvcs:
.skip 0x30