From e0bd52d345c2ee546440554022786ce62c6f72a6 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 30 Apr 2022 01:32:00 -0700 Subject: [PATCH] Decompile dsp.c start OSReset.c Former-commit-id: 6753bb7115e7686fe5b59ca82b67dd4d340989ec --- Makefile | 2 + asm/Dolphin/dsp/dsp.s | 53 +-- asm/Dolphin/dsp/dsp_task.s | 149 +++++---- asm/Dolphin/os/OS.s | 207 +++++++----- asm/Dolphin/os/OSFont.s | 24 +- asm/Dolphin/os/OSReboot.s | 52 ++- asm/Dolphin/os/OSReset.s | 19 +- asm/Dolphin/os/OSResetSW.s | 4 +- asm/Dolphin/os/OSRtc.s | 86 ++--- asm/Dolphin/pad/pad.s | 529 +++++++++++++++--------------- asm/Kyoto/Basics/RAssertDolphin.s | 24 +- asm/MetroidPrime/main.s | 6 +- include/Dolphin/dsp.h | 60 ++++ include/Dolphin/dsp_regs.h | 8 + include/Dolphin/os.h | 26 +- include/types.h | 3 + src/Dolphin/dsp/dsp.c | 108 ++++++ src/Dolphin/os/OSReset.c | 123 +++++++ 18 files changed, 933 insertions(+), 550 deletions(-) create mode 100644 include/Dolphin/dsp.h create mode 100644 include/Dolphin/dsp_regs.h create mode 100644 src/Dolphin/dsp/dsp.c create mode 100644 src/Dolphin/os/OSReset.c diff --git a/Makefile b/Makefile index 20c7ebd2..2de764b1 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,8 @@ $(BUILD_DIR)/src/Dolphin/PPCArch.o: MWCC_VERSION := 1.2.5 $(BUILD_DIR)/src/Dolphin/PPCArch.o: CFLAGS := $(CFLAGS_1.2) $(BUILD_DIR)/src/Dolphin/os/OSAudioSystem.o: MWCC_VERSION := 1.2.5 $(BUILD_DIR)/src/Dolphin/os/OSAudioSystem.o: CFLAGS := $(CFLAGS_1.2) +$(BUILD_DIR)/src/Dolphin/dsp/dsp.o: MWCC_VERSION := 1.2.5 +$(BUILD_DIR)/src/Dolphin/dsp/dsp.o: CFLAGS := $(CFLAGS_1.2) #------------------------------------------------------------------------------- # Recipes diff --git a/asm/Dolphin/dsp/dsp.s b/asm/Dolphin/dsp/dsp.s index 7a3215a1..c4766a94 100644 --- a/asm/Dolphin/dsp/dsp.s +++ b/asm/Dolphin/dsp/dsp.s @@ -1,35 +1,18 @@ .include "macros.inc" .section .sdata -.global lbl_805A8A80 -lbl_805A8A80: - .incbin "baserom.dol", 0x3F6420, 0x8 +.global __DSPVersion +__DSPVersion: + .4byte __DSPVersionString + .balign 8 .section .sbss -.global lbl_805A9748 -lbl_805A9748: +.global __DSP_init_flag +__DSP_init_flag: .skip 0x8 -.global lbl_805A9750 -lbl_805A9750: - .skip 0x4 -.global lbl_805A9754 -lbl_805A9754: - .skip 0x4 -.global lbl_805A9758 -lbl_805A9758: - .skip 0x4 -.global lbl_805A975C -lbl_805A975C: - .skip 0x4 -.global lbl_805A9760 -lbl_805A9760: - .skip 0x4 -.global lbl_805A9764 -lbl_805A9764: - .skip 0x4 .section .data -lbl_803EF9D0: +__DSPVersionString: .asciz "<< Dolphin SDK - DSP\trelease build: Sep 5 2002 05:35:13 (0x2301) >>" .balign 4 .asciz "DSPInit(): Build Date: %s %s\n" @@ -74,9 +57,9 @@ DSPSendMailToDSP: .global DSPInit DSPInit: /* 8036FA04 0036C964 7C 08 02 A6 */ mflr r0 -/* 8036FA08 0036C968 3C 60 80 3F */ lis r3, lbl_803EF9D0@ha +/* 8036FA08 0036C968 3C 60 80 3F */ lis r3, __DSPVersionString@ha /* 8036FA0C 0036C96C 90 01 00 04 */ stw r0, 4(r1) -/* 8036FA10 0036C970 38 A3 F9 D0 */ addi r5, r3, lbl_803EF9D0@l +/* 8036FA10 0036C970 38 A3 F9 D0 */ addi r5, r3, __DSPVersionString@l /* 8036FA14 0036C974 4C C6 31 82 */ crclr 6 /* 8036FA18 0036C978 38 65 00 48 */ addi r3, r5, 0x48 /* 8036FA1C 0036C97C 94 21 FF F0 */ stwu r1, -0x10(r1) @@ -84,10 +67,10 @@ DSPInit: /* 8036FA24 0036C984 93 E1 00 0C */ stw r31, 0xc(r1) /* 8036FA28 0036C988 38 A5 00 74 */ addi r5, r5, 0x74 /* 8036FA2C 0036C98C 48 00 01 A5 */ bl __DSP_debug_printf -/* 8036FA30 0036C990 80 0D AB 88 */ lwz r0, lbl_805A9748@sda21(r13) +/* 8036FA30 0036C990 80 0D AB 88 */ lwz r0, __DSP_init_flag@sda21(r13) /* 8036FA34 0036C994 2C 00 00 01 */ cmpwi r0, 1 /* 8036FA38 0036C998 41 82 00 7C */ beq lbl_8036FAB4 -/* 8036FA3C 0036C99C 80 6D 9E C0 */ lwz r3, lbl_805A8A80@sda21(r13) +/* 8036FA3C 0036C99C 80 6D 9E C0 */ lwz r3, __DSPVersion@sda21(r13) /* 8036FA40 0036C9A0 48 00 E5 F9 */ bl OSRegisterVersion /* 8036FA44 0036C9A4 48 01 1C 1D */ bl OSDisableInterrupts /* 8036FA48 0036C9A8 3C 80 80 37 */ lis r4, __DSPHandler@ha @@ -111,11 +94,11 @@ DSPInit: /* 8036FA90 0036C9F0 38 7F 00 00 */ addi r3, r31, 0 /* 8036FA94 0036C9F4 7C E5 28 38 */ and r5, r7, r5 /* 8036FA98 0036C9F8 B0 A6 00 0A */ sth r5, 0xa(r6) -/* 8036FA9C 0036C9FC 90 8D AB 98 */ stw r4, lbl_805A9758@sda21(r13) -/* 8036FAA0 0036CA00 90 8D AB A4 */ stw r4, lbl_805A9764@sda21(r13) -/* 8036FAA4 0036CA04 90 8D AB 9C */ stw r4, lbl_805A975C@sda21(r13) -/* 8036FAA8 0036CA08 90 8D AB A0 */ stw r4, lbl_805A9760@sda21(r13) -/* 8036FAAC 0036CA0C 90 0D AB 88 */ stw r0, lbl_805A9748@sda21(r13) +/* 8036FA9C 0036C9FC 90 8D AB 98 */ stw r4, __DSP_tmp_task@sda21(r13) +/* 8036FAA0 0036CA00 90 8D AB A4 */ stw r4, __DSP_curr_task@sda21(r13) +/* 8036FAA4 0036CA04 90 8D AB 9C */ stw r4, __DSP_last_task@sda21(r13) +/* 8036FAA8 0036CA08 90 8D AB A0 */ stw r4, __DSP_first_task@sda21(r13) +/* 8036FAAC 0036CA0C 90 0D AB 88 */ stw r0, __DSP_init_flag@sda21(r13) /* 8036FAB0 0036CA10 48 01 1B D9 */ bl OSRestoreInterrupts lbl_8036FAB4: /* 8036FAB4 0036CA14 80 01 00 14 */ lwz r0, 0x14(r1) @@ -138,7 +121,7 @@ DSPReset: /* 8036FAEC 0036CA4C 60 00 08 01 */ ori r0, r0, 0x801 /* 8036FAF0 0036CA50 B0 04 00 0A */ sth r0, 0xa(r4) /* 8036FAF4 0036CA54 38 00 00 00 */ li r0, 0 -/* 8036FAF8 0036CA58 90 0D AB 88 */ stw r0, lbl_805A9748@sda21(r13) +/* 8036FAF8 0036CA58 90 0D AB 88 */ stw r0, __DSP_init_flag@sda21(r13) /* 8036FAFC 0036CA5C 48 01 1B 8D */ bl OSRestoreInterrupts /* 8036FB00 0036CA60 80 01 00 0C */ lwz r0, 0xc(r1) /* 8036FB04 0036CA64 38 21 00 08 */ addi r1, r1, 8 @@ -189,7 +172,7 @@ DSPAddTask: /* 8036FB94 0036CAF4 38 7F 00 00 */ addi r3, r31, 0 /* 8036FB98 0036CAF8 90 1E 00 08 */ stw r0, 8(r30) /* 8036FB9C 0036CAFC 48 01 1A ED */ bl OSRestoreInterrupts -/* 8036FBA0 0036CB00 80 0D AB A0 */ lwz r0, lbl_805A9760@sda21(r13) +/* 8036FBA0 0036CB00 80 0D AB A0 */ lwz r0, __DSP_first_task@sda21(r13) /* 8036FBA4 0036CB04 7C 1E 00 40 */ cmplw r30, r0 /* 8036FBA8 0036CB08 40 82 00 0C */ bne lbl_8036FBB4 /* 8036FBAC 0036CB0C 7F C3 F3 78 */ mr r3, r30 diff --git a/asm/Dolphin/dsp/dsp_task.s b/asm/Dolphin/dsp/dsp_task.s index c90fb011..b5e41556 100644 --- a/asm/Dolphin/dsp/dsp_task.s +++ b/asm/Dolphin/dsp/dsp_task.s @@ -17,6 +17,27 @@ lbl_803EFA50: .balign 4 .asciz "__DSP_add_task() : Added task : 0x%08X\n" +.section .sbss + +.global __DSP_rude_task_pending +__DSP_rude_task_pending: + .skip 0x4 +.global __DSP_rude_task +__DSP_rude_task: + .skip 0x4 +.global __DSP_tmp_task +__DSP_tmp_task: + .skip 0x4 +.global __DSP_last_task +__DSP_last_task: + .skip 0x4 +.global __DSP_first_task +__DSP_first_task: + .skip 0x4 +.global __DSP_curr_task +__DSP_curr_task: + .skip 0x4 + .section .text, "ax" .global __DSPHandler @@ -42,7 +63,7 @@ lbl_8036FC60: /* 8036FC64 0036CBC4 28 03 00 00 */ cmplwi r3, 0 /* 8036FC68 0036CBC8 41 82 FF F8 */ beq lbl_8036FC60 /* 8036FC6C 0036CBCC 4B FF FD 6D */ bl DSPReadMailFromDSP -/* 8036FC70 0036CBD0 80 AD AB A4 */ lwz r5, lbl_805A9764@sda21(r13) +/* 8036FC70 0036CBD0 80 AD AB A4 */ lwz r5, __DSP_curr_task@sda21(r13) /* 8036FC74 0036CBD4 80 05 00 08 */ lwz r0, 8(r5) /* 8036FC78 0036CBD8 54 00 07 BD */ rlwinm. r0, r0, 0, 0x1e, 0x1e /* 8036FC7C 0036CBDC 41 82 00 18 */ beq lbl_8036FC94 @@ -70,7 +91,7 @@ lbl_8036FCB8: lbl_8036FCCC: /* 8036FCCC 0036CC2C 38 00 00 01 */ li r0, 1 /* 8036FCD0 0036CC30 90 05 00 00 */ stw r0, 0(r5) -/* 8036FCD4 0036CC34 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FCD4 0036CC34 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FCD8 0036CC38 81 83 00 28 */ lwz r12, 0x28(r3) /* 8036FCDC 0036CC3C 28 0C 00 00 */ cmplwi r12, 0 /* 8036FCE0 0036CC40 41 82 03 40 */ beq lbl_80370020 @@ -80,7 +101,7 @@ lbl_8036FCCC: lbl_8036FCF0: /* 8036FCF0 0036CC50 38 00 00 01 */ li r0, 1 /* 8036FCF4 0036CC54 90 05 00 00 */ stw r0, 0(r5) -/* 8036FCF8 0036CC58 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FCF8 0036CC58 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FCFC 0036CC5C 81 83 00 2C */ lwz r12, 0x2c(r3) /* 8036FD00 0036CC60 28 0C 00 00 */ cmplwi r12, 0 /* 8036FD04 0036CC64 41 82 03 1C */ beq lbl_80370020 @@ -88,10 +109,10 @@ lbl_8036FCF0: /* 8036FD0C 0036CC6C 4E 80 00 21 */ blrl /* 8036FD10 0036CC70 48 00 03 10 */ b lbl_80370020 lbl_8036FD14: -/* 8036FD14 0036CC74 80 0D AB 90 */ lwz r0, lbl_805A9750@sda21(r13) +/* 8036FD14 0036CC74 80 0D AB 90 */ lwz r0, __DSP_rude_task_pending@sda21(r13) /* 8036FD18 0036CC78 2C 00 00 00 */ cmpwi r0, 0 /* 8036FD1C 0036CC7C 41 82 00 98 */ beq lbl_8036FDB4 -/* 8036FD20 0036CC80 80 0D AB 94 */ lwz r0, lbl_805A9754@sda21(r13) +/* 8036FD20 0036CC80 80 0D AB 94 */ lwz r0, __DSP_rude_task@sda21(r13) /* 8036FD24 0036CC84 7C 05 00 40 */ cmplw r5, r0 /* 8036FD28 0036CC88 40 82 00 44 */ bne lbl_8036FD6C /* 8036FD2C 0036CC8C 3C 60 CD D1 */ lis r3, 0xCDD10003@ha @@ -102,9 +123,9 @@ lbl_8036FD38: /* 8036FD3C 0036CC9C 28 03 00 00 */ cmplwi r3, 0 /* 8036FD40 0036CCA0 40 82 FF F8 */ bne lbl_8036FD38 /* 8036FD44 0036CCA4 38 00 00 00 */ li r0, 0 -/* 8036FD48 0036CCA8 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) -/* 8036FD4C 0036CCAC 90 0D AB 94 */ stw r0, lbl_805A9754@sda21(r13) -/* 8036FD50 0036CCB0 90 0D AB 90 */ stw r0, lbl_805A9750@sda21(r13) +/* 8036FD48 0036CCA8 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) +/* 8036FD4C 0036CCAC 90 0D AB 94 */ stw r0, __DSP_rude_task@sda21(r13) +/* 8036FD50 0036CCB0 90 0D AB 90 */ stw r0, __DSP_rude_task_pending@sda21(r13) /* 8036FD54 0036CCB4 81 83 00 2C */ lwz r12, 0x2c(r3) /* 8036FD58 0036CCB8 28 0C 00 00 */ cmplwi r12, 0 /* 8036FD5C 0036CCBC 41 82 02 C4 */ beq lbl_80370020 @@ -119,23 +140,23 @@ lbl_8036FD78: /* 8036FD78 0036CCD8 4B FF FC 41 */ bl DSPCheckMailToDSP /* 8036FD7C 0036CCDC 28 03 00 00 */ cmplwi r3, 0 /* 8036FD80 0036CCE0 40 82 FF F8 */ bne lbl_8036FD78 -/* 8036FD84 0036CCE4 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) -/* 8036FD88 0036CCE8 80 8D AB 94 */ lwz r4, lbl_805A9754@sda21(r13) +/* 8036FD84 0036CCE4 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) +/* 8036FD88 0036CCE8 80 8D AB 94 */ lwz r4, __DSP_rude_task@sda21(r13) /* 8036FD8C 0036CCEC 48 00 02 B9 */ bl __DSP_exec_task -/* 8036FD90 0036CCF0 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FD90 0036CCF0 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FD94 0036CCF4 38 80 00 02 */ li r4, 2 /* 8036FD98 0036CCF8 38 00 00 00 */ li r0, 0 /* 8036FD9C 0036CCFC 90 83 00 00 */ stw r4, 0(r3) -/* 8036FDA0 0036CD00 80 6D AB 94 */ lwz r3, lbl_805A9754@sda21(r13) -/* 8036FDA4 0036CD04 90 0D AB 90 */ stw r0, lbl_805A9750@sda21(r13) -/* 8036FDA8 0036CD08 90 6D AB A4 */ stw r3, lbl_805A9764@sda21(r13) -/* 8036FDAC 0036CD0C 90 0D AB 94 */ stw r0, lbl_805A9754@sda21(r13) +/* 8036FDA0 0036CD00 80 6D AB 94 */ lwz r3, __DSP_rude_task@sda21(r13) +/* 8036FDA4 0036CD04 90 0D AB 90 */ stw r0, __DSP_rude_task_pending@sda21(r13) +/* 8036FDA8 0036CD08 90 6D AB A4 */ stw r3, __DSP_curr_task@sda21(r13) +/* 8036FDAC 0036CD0C 90 0D AB 94 */ stw r0, __DSP_rude_task@sda21(r13) /* 8036FDB0 0036CD10 48 00 02 70 */ b lbl_80370020 lbl_8036FDB4: /* 8036FDB4 0036CD14 80 05 00 38 */ lwz r0, 0x38(r5) /* 8036FDB8 0036CD18 28 00 00 00 */ cmplwi r0, 0 /* 8036FDBC 0036CD1C 40 82 00 80 */ bne lbl_8036FE3C -/* 8036FDC0 0036CD20 80 0D AB A0 */ lwz r0, lbl_805A9760@sda21(r13) +/* 8036FDC0 0036CD20 80 0D AB A0 */ lwz r0, __DSP_first_task@sda21(r13) /* 8036FDC4 0036CD24 7C 05 00 40 */ cmplw r5, r0 /* 8036FDC8 0036CD28 40 82 00 38 */ bne lbl_8036FE00 /* 8036FDCC 0036CD2C 3C 60 CD D1 */ lis r3, 0xCDD10003@ha @@ -145,7 +166,7 @@ lbl_8036FDD8: /* 8036FDD8 0036CD38 4B FF FB E1 */ bl DSPCheckMailToDSP /* 8036FDDC 0036CD3C 28 03 00 00 */ cmplwi r3, 0 /* 8036FDE0 0036CD40 40 82 FF F8 */ bne lbl_8036FDD8 -/* 8036FDE4 0036CD44 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FDE4 0036CD44 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FDE8 0036CD48 81 83 00 2C */ lwz r12, 0x2c(r3) /* 8036FDEC 0036CD4C 28 0C 00 00 */ cmplwi r12, 0 /* 8036FDF0 0036CD50 41 82 02 30 */ beq lbl_80370020 @@ -160,14 +181,14 @@ lbl_8036FE0C: /* 8036FE0C 0036CD6C 4B FF FB AD */ bl DSPCheckMailToDSP /* 8036FE10 0036CD70 28 03 00 00 */ cmplwi r3, 0 /* 8036FE14 0036CD74 40 82 FF F8 */ bne lbl_8036FE0C -/* 8036FE18 0036CD78 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) -/* 8036FE1C 0036CD7C 80 8D AB A0 */ lwz r4, lbl_805A9760@sda21(r13) +/* 8036FE18 0036CD78 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) +/* 8036FE1C 0036CD7C 80 8D AB A0 */ lwz r4, __DSP_first_task@sda21(r13) /* 8036FE20 0036CD80 48 00 02 25 */ bl __DSP_exec_task -/* 8036FE24 0036CD84 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FE24 0036CD84 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FE28 0036CD88 38 00 00 02 */ li r0, 2 /* 8036FE2C 0036CD8C 90 03 00 00 */ stw r0, 0(r3) -/* 8036FE30 0036CD90 80 0D AB A0 */ lwz r0, lbl_805A9760@sda21(r13) -/* 8036FE34 0036CD94 90 0D AB A4 */ stw r0, lbl_805A9764@sda21(r13) +/* 8036FE30 0036CD90 80 0D AB A0 */ lwz r0, __DSP_first_task@sda21(r13) +/* 8036FE34 0036CD94 90 0D AB A4 */ stw r0, __DSP_curr_task@sda21(r13) /* 8036FE38 0036CD98 48 00 01 E8 */ b lbl_80370020 lbl_8036FE3C: /* 8036FE3C 0036CD9C 3C 60 CD D1 */ lis r3, 0xCDD10001@ha @@ -177,18 +198,18 @@ lbl_8036FE48: /* 8036FE48 0036CDA8 4B FF FB 71 */ bl DSPCheckMailToDSP /* 8036FE4C 0036CDAC 28 03 00 00 */ cmplwi r3, 0 /* 8036FE50 0036CDB0 40 82 FF F8 */ bne lbl_8036FE48 -/* 8036FE54 0036CDB4 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FE54 0036CDB4 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FE58 0036CDB8 80 83 00 38 */ lwz r4, 0x38(r3) /* 8036FE5C 0036CDBC 48 00 01 E9 */ bl __DSP_exec_task -/* 8036FE60 0036CDC0 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FE60 0036CDC0 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FE64 0036CDC4 38 00 00 02 */ li r0, 2 /* 8036FE68 0036CDC8 90 03 00 00 */ stw r0, 0(r3) -/* 8036FE6C 0036CDCC 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FE6C 0036CDCC 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FE70 0036CDD0 80 03 00 38 */ lwz r0, 0x38(r3) -/* 8036FE74 0036CDD4 90 0D AB A4 */ stw r0, lbl_805A9764@sda21(r13) +/* 8036FE74 0036CDD4 90 0D AB A4 */ stw r0, __DSP_curr_task@sda21(r13) /* 8036FE78 0036CDD8 48 00 01 A8 */ b lbl_80370020 lbl_8036FE7C: -/* 8036FE7C 0036CDDC 80 0D AB 90 */ lwz r0, lbl_805A9750@sda21(r13) +/* 8036FE7C 0036CDDC 80 0D AB 90 */ lwz r0, __DSP_rude_task_pending@sda21(r13) /* 8036FE80 0036CDE0 2C 00 00 00 */ cmpwi r0, 0 /* 8036FE84 0036CDE4 41 82 00 60 */ beq lbl_8036FEE4 /* 8036FE88 0036CDE8 81 85 00 30 */ lwz r12, 0x30(r5) @@ -206,21 +227,21 @@ lbl_8036FEAC: /* 8036FEB0 0036CE10 28 03 00 00 */ cmplwi r3, 0 /* 8036FEB4 0036CE14 40 82 FF F8 */ bne lbl_8036FEAC /* 8036FEB8 0036CE18 38 60 00 00 */ li r3, 0 -/* 8036FEBC 0036CE1C 80 8D AB 94 */ lwz r4, lbl_805A9754@sda21(r13) +/* 8036FEBC 0036CE1C 80 8D AB 94 */ lwz r4, __DSP_rude_task@sda21(r13) /* 8036FEC0 0036CE20 48 00 01 85 */ bl __DSP_exec_task -/* 8036FEC4 0036CE24 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FEC4 0036CE24 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FEC8 0036CE28 48 00 05 49 */ bl __DSP_remove_task -/* 8036FECC 0036CE2C 80 6D AB 94 */ lwz r3, lbl_805A9754@sda21(r13) +/* 8036FECC 0036CE2C 80 6D AB 94 */ lwz r3, __DSP_rude_task@sda21(r13) /* 8036FED0 0036CE30 38 00 00 00 */ li r0, 0 -/* 8036FED4 0036CE34 90 0D AB 90 */ stw r0, lbl_805A9750@sda21(r13) -/* 8036FED8 0036CE38 90 6D AB A4 */ stw r3, lbl_805A9764@sda21(r13) -/* 8036FEDC 0036CE3C 90 0D AB 94 */ stw r0, lbl_805A9754@sda21(r13) +/* 8036FED4 0036CE34 90 0D AB 90 */ stw r0, __DSP_rude_task_pending@sda21(r13) +/* 8036FED8 0036CE38 90 6D AB A4 */ stw r3, __DSP_curr_task@sda21(r13) +/* 8036FEDC 0036CE3C 90 0D AB 94 */ stw r0, __DSP_rude_task@sda21(r13) /* 8036FEE0 0036CE40 48 00 01 40 */ b lbl_80370020 lbl_8036FEE4: /* 8036FEE4 0036CE44 80 05 00 38 */ lwz r0, 0x38(r5) /* 8036FEE8 0036CE48 28 00 00 00 */ cmplwi r0, 0 /* 8036FEEC 0036CE4C 40 82 00 B4 */ bne lbl_8036FFA0 -/* 8036FEF0 0036CE50 80 0D AB A0 */ lwz r0, lbl_805A9760@sda21(r13) +/* 8036FEF0 0036CE50 80 0D AB A0 */ lwz r0, __DSP_first_task@sda21(r13) /* 8036FEF4 0036CE54 7C 05 00 40 */ cmplw r5, r0 /* 8036FEF8 0036CE58 40 82 00 4C */ bne lbl_8036FF44 /* 8036FEFC 0036CE5C 81 85 00 30 */ lwz r12, 0x30(r5) @@ -237,10 +258,10 @@ lbl_8036FF20: /* 8036FF20 0036CE80 4B FF FA 99 */ bl DSPCheckMailToDSP /* 8036FF24 0036CE84 28 03 00 00 */ cmplwi r3, 0 /* 8036FF28 0036CE88 40 82 FF F8 */ bne lbl_8036FF20 -/* 8036FF2C 0036CE8C 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FF2C 0036CE8C 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FF30 0036CE90 38 00 00 03 */ li r0, 3 /* 8036FF34 0036CE94 90 03 00 00 */ stw r0, 0(r3) -/* 8036FF38 0036CE98 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FF38 0036CE98 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FF3C 0036CE9C 48 00 04 D5 */ bl __DSP_remove_task /* 8036FF40 0036CEA0 48 00 00 E0 */ b lbl_80370020 lbl_8036FF44: @@ -258,15 +279,15 @@ lbl_8036FF68: /* 8036FF68 0036CEC8 4B FF FA 51 */ bl DSPCheckMailToDSP /* 8036FF6C 0036CECC 28 03 00 00 */ cmplwi r3, 0 /* 8036FF70 0036CED0 40 82 FF F8 */ bne lbl_8036FF68 -/* 8036FF74 0036CED4 80 8D AB A4 */ lwz r4, lbl_805A9764@sda21(r13) +/* 8036FF74 0036CED4 80 8D AB A4 */ lwz r4, __DSP_curr_task@sda21(r13) /* 8036FF78 0036CED8 38 00 00 03 */ li r0, 3 /* 8036FF7C 0036CEDC 38 60 00 00 */ li r3, 0 /* 8036FF80 0036CEE0 90 04 00 00 */ stw r0, 0(r4) -/* 8036FF84 0036CEE4 80 8D AB A0 */ lwz r4, lbl_805A9760@sda21(r13) +/* 8036FF84 0036CEE4 80 8D AB A0 */ lwz r4, __DSP_first_task@sda21(r13) /* 8036FF88 0036CEE8 48 00 00 BD */ bl __DSP_exec_task -/* 8036FF8C 0036CEEC 80 0D AB A0 */ lwz r0, lbl_805A9760@sda21(r13) -/* 8036FF90 0036CEF0 80 6D AB 9C */ lwz r3, lbl_805A975C@sda21(r13) -/* 8036FF94 0036CEF4 90 0D AB A4 */ stw r0, lbl_805A9764@sda21(r13) +/* 8036FF8C 0036CEEC 80 0D AB A0 */ lwz r0, __DSP_first_task@sda21(r13) +/* 8036FF90 0036CEF0 80 6D AB 9C */ lwz r3, __DSP_last_task@sda21(r13) +/* 8036FF94 0036CEF4 90 0D AB A4 */ stw r0, __DSP_curr_task@sda21(r13) /* 8036FF98 0036CEF8 48 00 04 79 */ bl __DSP_remove_task /* 8036FF9C 0036CEFC 48 00 00 84 */ b lbl_80370020 lbl_8036FFA0: @@ -284,17 +305,17 @@ lbl_8036FFC4: /* 8036FFC4 0036CF24 4B FF F9 F5 */ bl DSPCheckMailToDSP /* 8036FFC8 0036CF28 28 03 00 00 */ cmplwi r3, 0 /* 8036FFCC 0036CF2C 40 82 FF F8 */ bne lbl_8036FFC4 -/* 8036FFD0 0036CF30 80 8D AB A4 */ lwz r4, lbl_805A9764@sda21(r13) +/* 8036FFD0 0036CF30 80 8D AB A4 */ lwz r4, __DSP_curr_task@sda21(r13) /* 8036FFD4 0036CF34 38 00 00 03 */ li r0, 3 /* 8036FFD8 0036CF38 38 60 00 00 */ li r3, 0 /* 8036FFDC 0036CF3C 90 04 00 00 */ stw r0, 0(r4) -/* 8036FFE0 0036CF40 80 8D AB A4 */ lwz r4, lbl_805A9764@sda21(r13) +/* 8036FFE0 0036CF40 80 8D AB A4 */ lwz r4, __DSP_curr_task@sda21(r13) /* 8036FFE4 0036CF44 80 84 00 38 */ lwz r4, 0x38(r4) /* 8036FFE8 0036CF48 48 00 00 5D */ bl __DSP_exec_task -/* 8036FFEC 0036CF4C 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FFEC 0036CF4C 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FFF0 0036CF50 80 03 00 38 */ lwz r0, 0x38(r3) -/* 8036FFF4 0036CF54 90 0D AB A4 */ stw r0, lbl_805A9764@sda21(r13) -/* 8036FFF8 0036CF58 80 6D AB A4 */ lwz r3, lbl_805A9764@sda21(r13) +/* 8036FFF4 0036CF54 90 0D AB A4 */ stw r0, __DSP_curr_task@sda21(r13) +/* 8036FFF8 0036CF58 80 6D AB A4 */ lwz r3, __DSP_curr_task@sda21(r13) /* 8036FFFC 0036CF5C 80 63 00 3C */ lwz r3, 0x3c(r3) /* 80370000 0036CF60 48 00 04 11 */ bl __DSP_remove_task /* 80370004 0036CF64 48 00 00 1C */ b lbl_80370020 @@ -559,13 +580,13 @@ lbl_803702EC: .global __DSP_insert_task __DSP_insert_task: -/* 80370370 0036D2D0 80 0D AB A0 */ lwz r0, lbl_805A9760@sda21(r13) +/* 80370370 0036D2D0 80 0D AB A0 */ lwz r0, __DSP_first_task@sda21(r13) /* 80370374 0036D2D4 28 00 00 00 */ cmplwi r0, 0 /* 80370378 0036D2D8 40 82 00 20 */ bne lbl_80370398 -/* 8037037C 0036D2DC 90 6D AB A4 */ stw r3, lbl_805A9764@sda21(r13) +/* 8037037C 0036D2DC 90 6D AB A4 */ stw r3, __DSP_curr_task@sda21(r13) /* 80370380 0036D2E0 38 00 00 00 */ li r0, 0 -/* 80370384 0036D2E4 90 6D AB 9C */ stw r3, lbl_805A975C@sda21(r13) -/* 80370388 0036D2E8 90 6D AB A0 */ stw r3, lbl_805A9760@sda21(r13) +/* 80370384 0036D2E4 90 6D AB 9C */ stw r3, __DSP_last_task@sda21(r13) +/* 80370388 0036D2E8 90 6D AB A0 */ stw r3, __DSP_first_task@sda21(r13) /* 8037038C 0036D2EC 90 03 00 3C */ stw r0, 0x3c(r3) /* 80370390 0036D2F0 90 03 00 38 */ stw r0, 0x38(r3) /* 80370394 0036D2F4 4E 80 00 20 */ blr @@ -584,7 +605,7 @@ lbl_803703A0: /* 803703C0 0036D320 80 83 00 3C */ lwz r4, 0x3c(r3) /* 803703C4 0036D324 28 04 00 00 */ cmplwi r4, 0 /* 803703C8 0036D328 40 82 00 0C */ bne lbl_803703D4 -/* 803703CC 0036D32C 90 6D AB A0 */ stw r3, lbl_805A9760@sda21(r13) +/* 803703CC 0036D32C 90 6D AB A0 */ stw r3, __DSP_first_task@sda21(r13) /* 803703D0 0036D330 48 00 00 18 */ b lbl_803703E8 lbl_803703D4: /* 803703D4 0036D334 90 64 00 38 */ stw r3, 0x38(r4) @@ -597,13 +618,13 @@ lbl_803703E0: lbl_803703E8: /* 803703E8 0036D348 28 05 00 00 */ cmplwi r5, 0 /* 803703EC 0036D34C 4C 82 00 20 */ bnelr -/* 803703F0 0036D350 80 8D AB 9C */ lwz r4, lbl_805A975C@sda21(r13) +/* 803703F0 0036D350 80 8D AB 9C */ lwz r4, __DSP_last_task@sda21(r13) /* 803703F4 0036D354 38 00 00 00 */ li r0, 0 /* 803703F8 0036D358 90 64 00 38 */ stw r3, 0x38(r4) /* 803703FC 0036D35C 90 03 00 38 */ stw r0, 0x38(r3) -/* 80370400 0036D360 80 0D AB 9C */ lwz r0, lbl_805A975C@sda21(r13) +/* 80370400 0036D360 80 0D AB 9C */ lwz r0, __DSP_last_task@sda21(r13) /* 80370404 0036D364 90 03 00 3C */ stw r0, 0x3c(r3) -/* 80370408 0036D368 90 6D AB 9C */ stw r3, lbl_805A975C@sda21(r13) +/* 80370408 0036D368 90 6D AB 9C */ stw r3, __DSP_last_task@sda21(r13) /* 8037040C 0036D36C 4E 80 00 20 */ blr .global __DSP_remove_task @@ -612,35 +633,35 @@ __DSP_remove_task: /* 80370414 0036D374 90 83 00 08 */ stw r4, 8(r3) /* 80370418 0036D378 38 00 00 03 */ li r0, 3 /* 8037041C 0036D37C 90 03 00 00 */ stw r0, 0(r3) -/* 80370420 0036D380 80 0D AB A0 */ lwz r0, lbl_805A9760@sda21(r13) +/* 80370420 0036D380 80 0D AB A0 */ lwz r0, __DSP_first_task@sda21(r13) /* 80370424 0036D384 7C 00 18 40 */ cmplw r0, r3 /* 80370428 0036D388 40 82 00 30 */ bne lbl_80370458 /* 8037042C 0036D38C 80 03 00 38 */ lwz r0, 0x38(r3) /* 80370430 0036D390 28 00 00 00 */ cmplwi r0, 0 /* 80370434 0036D394 41 82 00 14 */ beq lbl_80370448 -/* 80370438 0036D398 90 0D AB A0 */ stw r0, lbl_805A9760@sda21(r13) +/* 80370438 0036D398 90 0D AB A0 */ stw r0, __DSP_first_task@sda21(r13) /* 8037043C 0036D39C 80 63 00 38 */ lwz r3, 0x38(r3) /* 80370440 0036D3A0 90 83 00 3C */ stw r4, 0x3c(r3) /* 80370444 0036D3A4 4E 80 00 20 */ blr lbl_80370448: -/* 80370448 0036D3A8 90 8D AB A4 */ stw r4, lbl_805A9764@sda21(r13) -/* 8037044C 0036D3AC 90 8D AB 9C */ stw r4, lbl_805A975C@sda21(r13) -/* 80370450 0036D3B0 90 8D AB A0 */ stw r4, lbl_805A9760@sda21(r13) +/* 80370448 0036D3A8 90 8D AB A4 */ stw r4, __DSP_curr_task@sda21(r13) +/* 8037044C 0036D3AC 90 8D AB 9C */ stw r4, __DSP_last_task@sda21(r13) +/* 80370450 0036D3B0 90 8D AB A0 */ stw r4, __DSP_first_task@sda21(r13) /* 80370454 0036D3B4 4E 80 00 20 */ blr lbl_80370458: -/* 80370458 0036D3B8 80 0D AB 9C */ lwz r0, lbl_805A975C@sda21(r13) +/* 80370458 0036D3B8 80 0D AB 9C */ lwz r0, __DSP_last_task@sda21(r13) /* 8037045C 0036D3BC 7C 00 18 40 */ cmplw r0, r3 /* 80370460 0036D3C0 40 82 00 20 */ bne lbl_80370480 /* 80370464 0036D3C4 80 03 00 3C */ lwz r0, 0x3c(r3) -/* 80370468 0036D3C8 90 0D AB 9C */ stw r0, lbl_805A975C@sda21(r13) +/* 80370468 0036D3C8 90 0D AB 9C */ stw r0, __DSP_last_task@sda21(r13) /* 8037046C 0036D3CC 80 63 00 3C */ lwz r3, 0x3c(r3) /* 80370470 0036D3D0 90 83 00 38 */ stw r4, 0x38(r3) -/* 80370474 0036D3D4 80 0D AB A0 */ lwz r0, lbl_805A9760@sda21(r13) -/* 80370478 0036D3D8 90 0D AB A4 */ stw r0, lbl_805A9764@sda21(r13) +/* 80370474 0036D3D4 80 0D AB A0 */ lwz r0, __DSP_first_task@sda21(r13) +/* 80370478 0036D3D8 90 0D AB A4 */ stw r0, __DSP_curr_task@sda21(r13) /* 8037047C 0036D3DC 4E 80 00 20 */ blr lbl_80370480: /* 80370480 0036D3E0 80 03 00 38 */ lwz r0, 0x38(r3) -/* 80370484 0036D3E4 90 0D AB A4 */ stw r0, lbl_805A9764@sda21(r13) +/* 80370484 0036D3E4 90 0D AB A4 */ stw r0, __DSP_curr_task@sda21(r13) /* 80370488 0036D3E8 80 03 00 38 */ lwz r0, 0x38(r3) /* 8037048C 0036D3EC 80 83 00 3C */ lwz r4, 0x3c(r3) /* 80370490 0036D3F0 90 04 00 38 */ stw r0, 0x38(r4) diff --git a/asm/Dolphin/os/OS.s b/asm/Dolphin/os/OS.s index 8de24073..95294567 100644 --- a/asm/Dolphin/os/OS.s +++ b/asm/Dolphin/os/OS.s @@ -6,59 +6,111 @@ DriveInfo: .skip 0x50 .section .sbss -.global lbl_805A9880 -lbl_805A9880: +.global BootInfo +BootInfo: .skip 0x4 -.global lbl_805A9884 -lbl_805A9884: +.global BI2DebugFlag +BI2DebugFlag: .skip 0x4 -.global lbl_805A9888 -lbl_805A9888: +.global BI2DebugFlagHolder +BI2DebugFlagHolder: .skip 0x4 -.global lbl_805A988C -lbl_805A988C: +.global __OSIsGcam +__OSIsGcam: .skip 0x4 .global AreWeInitialized AreWeInitialized: .skip 0x4 -.global lbl_805A9894 -lbl_805A9894: +.global OSExceptionTable +OSExceptionTable: .skip 0x4 -.global lbl_805A9898 -lbl_805A9898: +.global __OSSavedRegionEnd +__OSSavedRegionEnd: .skip 0x4 -.global lbl_805A989C -lbl_805A989C: +.global __OSSavedRegionStart +__OSSavedRegionStart: .skip 0x4 -.global lbl_805A98A0 -lbl_805A98A0: +.global __OSInIPL +__OSInIPL: + .skip 0x8 +.global __OSStartTime +__OSStartTime: .skip 0x8 -.global lbl_805A98A8 -lbl_805A98A8: - .skip 0x4 -.global lbl_805A98AC -lbl_805A98AC: - .skip 0x4 .section .data .global lbl_803F0DA0 lbl_803F0DA0: - .incbin "baserom.dol", 0x3EDDA0, 0x208 + .asciz "<< Dolphin SDK - OS\trelease build: Sep 5 2002 05:32:39 (0x2301) >>" + .balign 4 + .asciz "\nDolphin OS $Revision: 58 $.\n" + .balign 4 + .asciz "Kernel built : %s %s\n" + .balign 4 + .asciz "Sep 5 2002" + .balign 4 + .asciz "05:32:39" + .balign 4 + .asciz "Console Type : " + .balign 4 + .asciz "Retail %d\n" + .balign 4 + .asciz "Mac Emulator\n" + .balign 4 + .asciz "PC Emulator\n" + .balign 4 + .asciz "EPPC Arthur\n" + .balign 4 + .asciz "EPPC Minnow\n" + .balign 4 + .asciz "Development HW%d (%08x)\n" + .balign 4 + .asciz "Memory %d MB\n" + .balign 4 + .asciz "Arena : 0x%x - 0x%x\n" + .balign 4 +.global __OSExceptionLocations +__OSExceptionLocations: + .4byte 0x00000100 + .4byte 0x00000200 + .4byte 0x00000300 + .4byte 0x00000400 + .4byte 0x00000500 + .4byte 0x00000600 + .4byte 0x00000700 + .4byte 0x00000800 + .4byte 0x00000900 + .4byte 0x00000C00 + .4byte 0x00000D00 + .4byte 0x00000F00 + .4byte 0x00001300 + .4byte 0x00001400 + .4byte 0x00001700 + .asciz "Installing OSDBIntegrator\n" + .balign 4 + .asciz ">>> OSINIT: exception %d commandeered by TRK\n" + .balign 4 + .asciz ">>> OSINIT: exception %d vectored to debugger\n" + .balign 4 + .asciz "Exceptions initialized...\n" + .balign 4 + .section .sdata .global lbl_805A8B28 lbl_805A8B28: - .incbin "baserom.dol", 0x3F64C8, 0x4 + .4byte lbl_803F0DA0 + .global lbl_805A8B2C lbl_805A8B2C: - .incbin "baserom.dol", 0x3F64CC, 0x4 + .asciz "%s\n" + .balign 4 .section .text, "ax" .global OSGetConsoleType OSGetConsoleType: -/* 8037D71C 0037A67C 80 6D AC C0 */ lwz r3, lbl_805A9880@sda21(r13) +/* 8037D71C 0037A67C 80 6D AC C0 */ lwz r3, BootInfo@sda21(r13) /* 8037D720 0037A680 28 03 00 00 */ cmplwi r3, 0 /* 8037D724 0037A684 41 82 00 10 */ beq lbl_8037D734 /* 8037D728 0037A688 80 63 00 2C */ lwz r3, 0x2c(r3) @@ -82,8 +134,8 @@ ClearArena: /* 8037D75C 0037A6BC 28 00 00 00 */ cmplwi r0, 0 /* 8037D760 0037A6C0 41 82 00 34 */ beq lbl_8037D794 /* 8037D764 0037A6C4 38 00 00 00 */ li r0, 0 -/* 8037D768 0037A6C8 90 0D AC DC */ stw r0, lbl_805A989C@sda21(r13) -/* 8037D76C 0037A6CC 90 0D AC D8 */ stw r0, lbl_805A9898@sda21(r13) +/* 8037D768 0037A6C8 90 0D AC DC */ stw r0, __OSSavedRegionStart@sda21(r13) +/* 8037D76C 0037A6CC 90 0D AC D8 */ stw r0, __OSSavedRegionEnd@sda21(r13) /* 8037D770 0037A6D0 48 00 10 21 */ bl OSGetArenaHi /* 8037D774 0037A6D4 7C 7F 1B 78 */ mr r31, r3 /* 8037D778 0037A6D8 48 00 10 21 */ bl OSGetArenaLo @@ -98,8 +150,8 @@ lbl_8037D794: /* 8037D798 0037A6F8 80 64 DF F0 */ lwz r3, 0x812FDFF0@l(r4) /* 8037D79C 0037A6FC 80 04 DF EC */ lwz r0, -0x2014(r4) /* 8037D7A0 0037A700 28 03 00 00 */ cmplwi r3, 0 -/* 8037D7A4 0037A704 90 6D AC DC */ stw r3, lbl_805A989C@sda21(r13) -/* 8037D7A8 0037A708 90 0D AC D8 */ stw r0, lbl_805A9898@sda21(r13) +/* 8037D7A4 0037A704 90 6D AC DC */ stw r3, __OSSavedRegionStart@sda21(r13) +/* 8037D7A8 0037A708 90 0D AC D8 */ stw r0, __OSSavedRegionEnd@sda21(r13) /* 8037D7AC 0037A70C 40 82 00 28 */ bne lbl_8037D7D4 /* 8037D7B0 0037A710 48 00 0F E1 */ bl OSGetArenaHi /* 8037D7B4 0037A714 7C 7F 1B 78 */ mr r31, r3 @@ -112,11 +164,11 @@ lbl_8037D794: /* 8037D7D0 0037A730 48 00 00 88 */ b lbl_8037D858 lbl_8037D7D4: /* 8037D7D4 0037A734 48 00 0F C5 */ bl OSGetArenaLo -/* 8037D7D8 0037A738 80 0D AC DC */ lwz r0, lbl_805A989C@sda21(r13) +/* 8037D7D8 0037A738 80 0D AC DC */ lwz r0, __OSSavedRegionStart@sda21(r13) /* 8037D7DC 0037A73C 7C 03 00 40 */ cmplw r3, r0 /* 8037D7E0 0037A740 40 80 00 78 */ bge lbl_8037D858 /* 8037D7E4 0037A744 48 00 0F AD */ bl OSGetArenaHi -/* 8037D7E8 0037A748 80 0D AC DC */ lwz r0, lbl_805A989C@sda21(r13) +/* 8037D7E8 0037A748 80 0D AC DC */ lwz r0, __OSSavedRegionStart@sda21(r13) /* 8037D7EC 0037A74C 7C 03 00 40 */ cmplw r3, r0 /* 8037D7F0 0037A750 41 81 00 28 */ bgt lbl_8037D818 /* 8037D7F4 0037A754 48 00 0F 9D */ bl OSGetArenaHi @@ -130,14 +182,14 @@ lbl_8037D7D4: /* 8037D814 0037A774 48 00 00 44 */ b lbl_8037D858 lbl_8037D818: /* 8037D818 0037A778 48 00 0F 81 */ bl OSGetArenaLo -/* 8037D81C 0037A77C 80 0D AC DC */ lwz r0, lbl_805A989C@sda21(r13) +/* 8037D81C 0037A77C 80 0D AC DC */ lwz r0, __OSSavedRegionStart@sda21(r13) /* 8037D820 0037A780 7F E3 00 50 */ subf r31, r3, r0 /* 8037D824 0037A784 48 00 0F 75 */ bl OSGetArenaLo /* 8037D828 0037A788 7F E5 FB 78 */ mr r5, r31 /* 8037D82C 0037A78C 38 80 00 00 */ li r4, 0 /* 8037D830 0037A790 4B C8 5B 79 */ bl memset /* 8037D834 0037A794 48 00 0F 5D */ bl OSGetArenaHi -/* 8037D838 0037A798 83 ED AC D8 */ lwz r31, lbl_805A9898@sda21(r13) +/* 8037D838 0037A798 83 ED AC D8 */ lwz r31, __OSSavedRegionEnd@sda21(r13) /* 8037D83C 0037A79C 7C 03 F8 40 */ cmplw r3, r31 /* 8037D840 0037A7A0 40 81 00 18 */ ble lbl_8037D858 /* 8037D844 0037A7A4 48 00 0F 4D */ bl OSGetArenaHi @@ -191,28 +243,28 @@ OSInit: /* 8037D8DC 0037A83C 38 00 00 01 */ li r0, 1 /* 8037D8E0 0037A840 90 0D AC D0 */ stw r0, AreWeInitialized@sda21(r13) /* 8037D8E4 0037A844 48 00 7A E5 */ bl __OSGetSystemTime -/* 8037D8E8 0037A848 90 8D AC EC */ stw r4, lbl_805A98AC@sda21(r13) -/* 8037D8EC 0037A84C 90 6D AC E8 */ stw r3, lbl_805A98A8@sda21(r13) +/* 8037D8E8 0037A848 90 8D AC EC */ stw r4, __OSStartTime+4@sda21(r13) +/* 8037D8EC 0037A84C 90 6D AC E8 */ stw r3, __OSStartTime@sda21(r13) /* 8037D8F0 0037A850 48 00 3D 71 */ bl OSDisableInterrupts /* 8037D8F4 0037A854 4B FF 1F A1 */ bl PPCDisableSpeculation /* 8037D8F8 0037A858 4B FF 1F CD */ bl PPCSetFpNonIEEEMode /* 8037D8FC 0037A85C 38 00 00 00 */ li r0, 0 /* 8037D900 0037A860 3C 80 80 00 */ lis r4, 0x800000F4@ha -/* 8037D904 0037A864 90 0D AC C4 */ stw r0, lbl_805A9884@sda21(r13) -/* 8037D908 0037A868 90 8D AC C0 */ stw r4, lbl_805A9880@sda21(r13) +/* 8037D904 0037A864 90 0D AC C4 */ stw r0, BI2DebugFlag@sda21(r13) +/* 8037D908 0037A868 90 8D AC C0 */ stw r4, BootInfo@sda21(r13) /* 8037D90C 0037A86C 90 0D AC 04 */ stw r0, lbl_805A97C4@sda21(r13) /* 8037D910 0037A870 80 64 00 F4 */ lwz r3, 0x800000F4@l(r4) /* 8037D914 0037A874 28 03 00 00 */ cmplwi r3, 0 /* 8037D918 0037A878 41 82 00 34 */ beq lbl_8037D94C /* 8037D91C 0037A87C 38 03 00 0C */ addi r0, r3, 0xc -/* 8037D920 0037A880 90 0D AC C4 */ stw r0, lbl_805A9884@sda21(r13) +/* 8037D920 0037A880 90 0D AC C4 */ stw r0, BI2DebugFlag@sda21(r13) /* 8037D924 0037A884 80 03 00 24 */ lwz r0, 0x24(r3) -/* 8037D928 0037A888 80 6D AC C4 */ lwz r3, lbl_805A9884@sda21(r13) -/* 8037D92C 0037A88C 90 0D AD 94 */ stw r0, lbl_805A9954@sda21(r13) +/* 8037D928 0037A888 80 6D AC C4 */ lwz r3, BI2DebugFlag@sda21(r13) +/* 8037D92C 0037A88C 90 0D AD 94 */ stw r0, __PADSpec@sda21(r13) /* 8037D930 0037A890 80 03 00 00 */ lwz r0, 0(r3) /* 8037D934 0037A894 54 00 06 3E */ clrlwi r0, r0, 0x18 /* 8037D938 0037A898 98 04 30 E8 */ stb r0, 0x30e8(r4) -/* 8037D93C 0037A89C 80 0D AD 94 */ lwz r0, lbl_805A9954@sda21(r13) +/* 8037D93C 0037A89C 80 0D AD 94 */ lwz r0, __PADSpec@sda21(r13) /* 8037D940 0037A8A0 54 00 06 3E */ clrlwi r0, r0, 0x18 /* 8037D944 0037A8A4 98 04 30 E9 */ stb r0, 0x30e9(r4) /* 8037D948 0037A8A8 48 00 00 28 */ b lbl_8037D970 @@ -221,14 +273,14 @@ lbl_8037D94C: /* 8037D950 0037A8B0 28 00 00 00 */ cmplwi r0, 0 /* 8037D954 0037A8B4 41 82 00 1C */ beq lbl_8037D970 /* 8037D958 0037A8B8 88 64 30 E8 */ lbz r3, 0x30e8(r4) -/* 8037D95C 0037A8BC 38 0D AC C8 */ addi r0, r13, lbl_805A9888@sda21 -/* 8037D960 0037A8C0 90 6D AC C8 */ stw r3, lbl_805A9888@sda21(r13) -/* 8037D964 0037A8C4 90 0D AC C4 */ stw r0, lbl_805A9884@sda21(r13) +/* 8037D95C 0037A8BC 38 0D AC C8 */ addi r0, r13, BI2DebugFlagHolder@sda21 +/* 8037D960 0037A8C0 90 6D AC C8 */ stw r3, BI2DebugFlagHolder@sda21(r13) +/* 8037D964 0037A8C4 90 0D AC C4 */ stw r0, BI2DebugFlag@sda21(r13) /* 8037D968 0037A8C8 88 04 30 E9 */ lbz r0, 0x30e9(r4) -/* 8037D96C 0037A8CC 90 0D AD 94 */ stw r0, lbl_805A9954@sda21(r13) +/* 8037D96C 0037A8CC 90 0D AD 94 */ stw r0, __PADSpec@sda21(r13) lbl_8037D970: /* 8037D970 0037A8D0 38 00 00 01 */ li r0, 1 -/* 8037D974 0037A8D4 80 6D AC C0 */ lwz r3, lbl_805A9880@sda21(r13) +/* 8037D974 0037A8D4 80 6D AC C0 */ lwz r3, BootInfo@sda21(r13) /* 8037D978 0037A8D8 90 0D AC 04 */ stw r0, lbl_805A97C4@sda21(r13) /* 8037D97C 0037A8DC 80 63 00 30 */ lwz r3, 0x30(r3) /* 8037D980 0037A8E0 28 03 00 00 */ cmplwi r3, 0 @@ -238,11 +290,11 @@ lbl_8037D970: /* 8037D990 0037A8F0 48 00 00 04 */ b lbl_8037D994 lbl_8037D994: /* 8037D994 0037A8F4 48 00 0E 15 */ bl OSSetArenaLo -/* 8037D998 0037A8F8 80 6D AC C0 */ lwz r3, lbl_805A9880@sda21(r13) +/* 8037D998 0037A8F8 80 6D AC C0 */ lwz r3, BootInfo@sda21(r13) /* 8037D99C 0037A8FC 80 03 00 30 */ lwz r0, 0x30(r3) /* 8037D9A0 0037A900 28 00 00 00 */ cmplwi r0, 0 /* 8037D9A4 0037A904 40 82 00 30 */ bne lbl_8037D9D4 -/* 8037D9A8 0037A908 80 6D AC C4 */ lwz r3, lbl_805A9884@sda21(r13) +/* 8037D9A8 0037A908 80 6D AC C4 */ lwz r3, BI2DebugFlag@sda21(r13) /* 8037D9AC 0037A90C 28 03 00 00 */ cmplwi r3, 0 /* 8037D9B0 0037A910 41 82 00 24 */ beq lbl_8037D9D4 /* 8037D9B4 0037A914 80 03 00 00 */ lwz r0, 0(r3) @@ -254,7 +306,7 @@ lbl_8037D994: /* 8037D9CC 0037A92C 54 03 00 34 */ rlwinm r3, r0, 0, 0, 0x1a /* 8037D9D0 0037A930 48 00 0D D9 */ bl OSSetArenaLo lbl_8037D9D4: -/* 8037D9D4 0037A934 80 6D AC C0 */ lwz r3, lbl_805A9880@sda21(r13) +/* 8037D9D4 0037A934 80 6D AC C0 */ lwz r3, BootInfo@sda21(r13) /* 8037D9D8 0037A938 80 63 00 34 */ lwz r3, 0x34(r3) /* 8037D9DC 0037A93C 28 03 00 00 */ cmplwi r3, 0 /* 8037D9E0 0037A940 40 82 00 10 */ bne lbl_8037D9F0 @@ -276,13 +328,13 @@ lbl_8037D9F0: /* 8037DA1C 0037A97C 48 00 16 B9 */ bl __OSCacheInit /* 8037DA20 0037A980 48 04 38 29 */ bl EXIInit /* 8037DA24 0037A984 48 04 15 7D */ bl SIInit -/* 8037DA28 0037A988 48 00 5F 79 */ bl sub_803839a0 +/* 8037DA28 0037A988 48 00 5F 79 */ bl __OSInitSram /* 8037DA2C 0037A98C 48 00 6A 41 */ bl __OSThreadInit /* 8037DA30 0037A990 48 00 0D AD */ bl __OSInitAudioSystem /* 8037DA34 0037A994 4B FF 1E 3D */ bl PPCMfhid2 /* 8037DA38 0037A998 54 63 00 80 */ rlwinm r3, r3, 0, 2, 0 /* 8037DA3C 0037A99C 4B FF 1E 3D */ bl PPCMthid2 -/* 8037DA40 0037A9A0 80 0D AC E0 */ lwz r0, lbl_805A98A0@sda21(r13) +/* 8037DA40 0037A9A0 80 0D AC E0 */ lwz r0, __OSInIPL@sda21(r13) /* 8037DA44 0037A9A4 2C 00 00 00 */ cmpwi r0, 0 /* 8037DA48 0037A9A8 40 82 00 08 */ bne lbl_8037DA50 /* 8037DA4C 0037A9AC 48 00 52 4D */ bl __OSInitMemoryProtection @@ -298,7 +350,7 @@ lbl_8037DA50: /* 8037DA70 0037A9D0 38 7F 00 94 */ addi r3, r31, 0x94 /* 8037DA74 0037A9D4 4C C6 31 82 */ crclr 6 /* 8037DA78 0037A9D8 48 00 1F 35 */ bl OSReport -/* 8037DA7C 0037A9DC 80 6D AC C0 */ lwz r3, lbl_805A9880@sda21(r13) +/* 8037DA7C 0037A9DC 80 6D AC C0 */ lwz r3, BootInfo@sda21(r13) /* 8037DA80 0037A9E0 28 03 00 00 */ cmplwi r3, 0 /* 8037DA84 0037A9E4 41 82 00 10 */ beq lbl_8037DA94 /* 8037DA88 0037A9E8 80 83 00 2C */ lwz r4, 0x2c(r3) @@ -362,7 +414,7 @@ lbl_8037DB38: /* 8037DB48 0037AAA8 38 86 FF FD */ addi r4, r6, -3 /* 8037DB4C 0037AAAC 48 00 1E 61 */ bl OSReport lbl_8037DB50: -/* 8037DB50 0037AAB0 80 8D AC C0 */ lwz r4, lbl_805A9880@sda21(r13) +/* 8037DB50 0037AAB0 80 8D AC C0 */ lwz r4, BootInfo@sda21(r13) /* 8037DB54 0037AAB4 38 7F 01 0C */ addi r3, r31, 0x10c /* 8037DB58 0037AAB8 4C C6 31 82 */ crclr 6 /* 8037DB5C 0037AABC 80 04 00 28 */ lwz r0, 0x28(r4) @@ -378,7 +430,7 @@ lbl_8037DB50: /* 8037DB84 0037AAE4 48 00 1E 29 */ bl OSReport /* 8037DB88 0037AAE8 80 6D 9F 68 */ lwz r3, lbl_805A8B28@sda21(r13) /* 8037DB8C 0037AAEC 48 00 04 AD */ bl OSRegisterVersion -/* 8037DB90 0037AAF0 80 6D AC C4 */ lwz r3, lbl_805A9884@sda21(r13) +/* 8037DB90 0037AAF0 80 6D AC C4 */ lwz r3, BI2DebugFlag@sda21(r13) /* 8037DB94 0037AAF4 28 03 00 00 */ cmplwi r3, 0 /* 8037DB98 0037AAF8 41 82 00 14 */ beq lbl_8037DBAC /* 8037DB9C 0037AAFC 80 03 00 00 */ lwz r0, 0(r3) @@ -388,11 +440,11 @@ lbl_8037DB50: lbl_8037DBAC: /* 8037DBAC 0037AB0C 4B FF FB 99 */ bl ClearArena /* 8037DBB0 0037AB10 48 00 3A C5 */ bl OSEnableInterrupts -/* 8037DBB4 0037AB14 80 0D AC E0 */ lwz r0, lbl_805A98A0@sda21(r13) +/* 8037DBB4 0037AB14 80 0D AC E0 */ lwz r0, __OSInIPL@sda21(r13) /* 8037DBB8 0037AB18 2C 00 00 00 */ cmpwi r0, 0 /* 8037DBBC 0037AB1C 40 82 00 48 */ bne lbl_8037DC04 /* 8037DBC0 0037AB20 4B FF 3F E5 */ bl DVDInit -/* 8037DBC4 0037AB24 80 0D AC CC */ lwz r0, lbl_805A988C@sda21(r13) +/* 8037DBC4 0037AB24 80 0D AC CC */ lwz r0, __OSIsGcam@sda21(r13) /* 8037DBC8 0037AB28 2C 00 00 00 */ cmpwi r0, 0 /* 8037DBCC 0037AB2C 41 82 00 18 */ beq lbl_8037DBE4 /* 8037DBD0 0037AB30 3C 60 00 01 */ lis r3, 0x00009000@ha @@ -428,10 +480,10 @@ OSExceptionInit: /* 8037DC34 0037AB94 80 03 00 60 */ lwz r0, 0x80000060@l(r3) /* 8037DC38 0037AB98 3C 80 80 38 */ lis r4, lbl_8037DF60@ha /* 8037DC3C 0037AB9C 3B C4 DF 60 */ addi r30, r4, lbl_8037DF60@l -/* 8037DC40 0037ABA0 3C A0 80 38 */ lis r5, sub_8037def8@ha +/* 8037DC40 0037ABA0 3C A0 80 38 */ lis r5, OSExceptionVector@ha /* 8037DC44 0037ABA4 83 3E 00 00 */ lwz r25, 0(r30) /* 8037DC48 0037ABA8 3C 80 80 38 */ lis r4, lbl_8037DF90@ha -/* 8037DC4C 0037ABAC 38 A5 DE F8 */ addi r5, r5, sub_8037def8@l +/* 8037DC4C 0037ABAC 38 A5 DE F8 */ addi r5, r5, OSExceptionVector@l /* 8037DC50 0037ABB0 38 84 DF 90 */ addi r4, r4, lbl_8037DF90@l /* 8037DC54 0037ABB4 3C C0 80 3F */ lis r6, lbl_803F0DA0@ha /* 8037DC58 0037ABB8 28 00 00 00 */ cmplwi r0, 0 @@ -444,8 +496,8 @@ OSExceptionInit: /* 8037DC74 0037ABD4 4C C6 31 82 */ crclr 6 /* 8037DC78 0037ABD8 4B FF 1C F1 */ bl DBPrintf /* 8037DC7C 0037ABDC 3C 80 80 38 */ lis r4, __OSDBIntegrator@ha -/* 8037DC80 0037ABE0 3C 60 80 38 */ lis r3, sub_8037dec4@ha -/* 8037DC84 0037ABE4 38 03 DE C4 */ addi r0, r3, sub_8037dec4@l +/* 8037DC80 0037ABE0 3C 60 80 38 */ lis r3, __OSDBJump@ha +/* 8037DC84 0037ABE4 38 03 DE C4 */ addi r0, r3, __OSDBJump@l /* 8037DC88 0037ABE8 38 84 DE A0 */ addi r4, r4, __OSDBIntegrator@l /* 8037DC8C 0037ABEC 7E A4 00 50 */ subf r21, r4, r0 /* 8037DC90 0037ABF0 7E 83 A3 78 */ mr r3, r20 @@ -459,23 +511,23 @@ OSExceptionInit: /* 8037DCB0 0037AC10 7E A4 AB 78 */ mr r4, r21 /* 8037DCB4 0037AC14 48 00 0E E1 */ bl ICInvalidateRange lbl_8037DCB8: -/* 8037DCB8 0037AC18 3C 80 80 38 */ lis r4, sub_8037dec4@ha +/* 8037DCB8 0037AC18 3C 80 80 38 */ lis r4, __OSDBJump@ha /* 8037DCBC 0037AC1C 3C 60 80 38 */ lis r3, __OSSetExceptionHandler@ha -/* 8037DCC0 0037AC20 3B E4 DE C4 */ addi r31, r4, sub_8037dec4@l +/* 8037DCC0 0037AC20 3B E4 DE C4 */ addi r31, r4, __OSDBJump@l /* 8037DCC4 0037AC24 38 03 DE C8 */ addi r0, r3, __OSSetExceptionHandler@l /* 8037DCC8 0037AC28 3B 9D 01 34 */ addi r28, r29, 0x134 /* 8037DCCC 0037AC2C 7F 7F 00 50 */ subf r27, r31, r0 /* 8037DCD0 0037AC30 3B 40 00 00 */ li r26, 0 /* 8037DCD4 0037AC34 48 00 00 04 */ b lbl_8037DCD8 lbl_8037DCD8: -/* 8037DCD8 0037AC38 3C 60 80 38 */ lis r3, lbl_8037DF50@ha -/* 8037DCDC 0037AC3C 3A A3 DF 50 */ addi r21, r3, lbl_8037DF50@l +/* 8037DCD8 0037AC38 3C 60 80 38 */ lis r3, __DBVECTOR@ha +/* 8037DCDC 0037AC3C 3A A3 DF 50 */ addi r21, r3, __DBVECTOR@l /* 8037DCE0 0037AC40 3E C0 60 00 */ lis r22, 0x6000 /* 8037DCE4 0037AC44 48 00 00 04 */ b lbl_8037DCE8 lbl_8037DCE8: /* 8037DCE8 0037AC48 48 00 01 48 */ b lbl_8037DE30 lbl_8037DCEC: -/* 8037DCEC 0037AC4C 80 6D AC C4 */ lwz r3, lbl_805A9884@sda21(r13) +/* 8037DCEC 0037AC4C 80 6D AC C4 */ lwz r3, BI2DebugFlag@sda21(r13) /* 8037DCF0 0037AC50 28 03 00 00 */ cmplwi r3, 0 /* 8037DCF4 0037AC54 41 82 00 34 */ beq lbl_8037DD28 /* 8037DCF8 0037AC58 80 03 00 00 */ lwz r0, 0(r3) @@ -570,7 +622,7 @@ lbl_8037DE30: /* 8037DE38 0037AD98 41 80 FE B4 */ blt lbl_8037DCEC /* 8037DE3C 0037AD9C 3C 60 80 00 */ lis r3, 0x80003000@ha /* 8037DE40 0037ADA0 38 03 30 00 */ addi r0, r3, 0x80003000@l -/* 8037DE44 0037ADA4 90 0D AC D4 */ stw r0, lbl_805A9894@sda21(r13) +/* 8037DE44 0037ADA4 90 0D AC D4 */ stw r0, OSExceptionTable@sda21(r13) /* 8037DE48 0037ADA8 3A 80 00 00 */ li r20, 0 /* 8037DE4C 0037ADAC 48 00 00 04 */ b lbl_8037DE50 lbl_8037DE50: @@ -610,14 +662,18 @@ __OSDBIntegrator: /* 8037DEBC 0037AE1C 7C 60 01 24 */ mtmsr r3 /* 8037DEC0 0037AE20 4E 80 00 20 */ blr -.global sub_8037dec4 -sub_8037dec4: +.global __OSDBJump +__OSDBJump: +.global __OSDBJUMPSTART +__OSDBJUMPSTART: +.global __OSDBINTEND +__OSDBINTEND: /* 8037DEC4 0037AE24 48 00 00 63 */ bla 0x60 .global __OSSetExceptionHandler __OSSetExceptionHandler: /* 8037DEC8 0037AE28 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 8037DECC 0037AE2C 80 6D AC D4 */ lwz r3, lbl_805A9894@sda21(r13) +/* 8037DECC 0037AE2C 80 6D AC D4 */ lwz r3, OSExceptionTable@sda21(r13) /* 8037DED0 0037AE30 54 00 10 3A */ slwi r0, r0, 2 /* 8037DED4 0037AE34 7C A3 02 14 */ add r5, r3, r0 /* 8037DED8 0037AE38 80 65 00 00 */ lwz r3, 0(r5) @@ -627,13 +683,13 @@ __OSSetExceptionHandler: .global __OSGetExceptionHandler __OSGetExceptionHandler: /* 8037DEE4 0037AE44 54 60 06 3E */ clrlwi r0, r3, 0x18 -/* 8037DEE8 0037AE48 80 6D AC D4 */ lwz r3, lbl_805A9894@sda21(r13) +/* 8037DEE8 0037AE48 80 6D AC D4 */ lwz r3, OSExceptionTable@sda21(r13) /* 8037DEEC 0037AE4C 54 00 10 3A */ slwi r0, r0, 2 /* 8037DEF0 0037AE50 7C 63 00 2E */ lwzx r3, r3, r0 /* 8037DEF4 0037AE54 4E 80 00 20 */ blr -.global sub_8037def8 -sub_8037def8: +.global OSExceptionVector +OSExceptionVector: /* 8037DEF8 0037AE58 7C 90 43 A6 */ mtspr 0x110, r4 /* 8037DEFC 0037AE5C 80 80 00 C0 */ lwz r4, 0xc0(0) /* 8037DF00 0037AE60 90 64 00 0C */ stw r3, 0xc(r4) @@ -656,7 +712,7 @@ sub_8037def8: /* 8037DF44 0037AEA4 7C 7B 02 A6 */ mfspr r3, 0x1b /* 8037DF48 0037AEA8 90 64 01 9C */ stw r3, 0x19c(r4) /* 8037DF4C 0037AEAC 7C 65 1B 78 */ mr r5, r3 -lbl_8037DF50: +__DBVECTOR: /* 8037DF50 0037AEB0 60 00 00 00 */ nop /* 8037DF54 0037AEB4 7C 60 00 A6 */ mfmsr r3 /* 8037DF58 0037AEB8 60 63 00 30 */ ori r3, r3, 0x30 @@ -700,9 +756,6 @@ OSDefaultExceptionHandler: /* 8037DFD8 0037AF38 90 04 01 C0 */ stw r0, 0x1c0(r4) /* 8037DFDC 0037AF3C 7C B2 02 A6 */ mfdsisr r5 /* 8037DFE0 0037AF40 7C D3 02 A6 */ mfdar r6 - -.global sub_8037dfe4 -sub_8037dfe4: /* 8037DFE4 0037AF44 94 21 FF F8 */ stwu r1, -8(r1) /* 8037DFE8 0037AF48 48 00 1D 88 */ b __OSUnhandledException diff --git a/asm/Dolphin/os/OSFont.s b/asm/Dolphin/os/OSFont.s index aefa2165..f533fb37 100644 --- a/asm/Dolphin/os/OSFont.s +++ b/asm/Dolphin/os/OSFont.s @@ -17,8 +17,8 @@ lbl_805A98CC: .section .data .balign 8 -.global lbl_803F1750 -lbl_803F1750: +.global HankakuToCode +HankakuToCode: .4byte 0x020C020D .4byte 0x020E020F .4byte 0x02100211 @@ -116,8 +116,8 @@ lbl_803F1750: .4byte 0x02A602A7 .4byte 0x02A802A9 -.global lbl_803F18D0 -lbl_803F18D0: +.global Zenkaku2Code +Zenkaku2Code: .4byte 0x00000001 .4byte 0x00020003 @@ -748,8 +748,8 @@ lbl_805AEC5C: .section .text, "ax" -.global sub_80380c34 -sub_80380c34: +.global GetFontCode +GetFontCode: /* 80380C34 0037DB94 7C 08 02 A6 */ mflr r0 /* 80380C38 0037DB98 90 01 00 04 */ stw r0, 4(r1) /* 80380C3C 0037DB9C 94 21 FF E8 */ stwu r1, -0x18(r1) @@ -764,8 +764,8 @@ sub_80380c34: /* 80380C60 0037DBC0 41 80 00 24 */ blt lbl_80380C84 /* 80380C64 0037DBC4 28 00 00 DF */ cmplwi r0, 0xdf /* 80380C68 0037DBC8 41 81 00 1C */ bgt lbl_80380C84 -/* 80380C6C 0037DBCC 3C 60 80 3F */ lis r3, lbl_803F1750@ha -/* 80380C70 0037DBD0 38 63 17 50 */ addi r3, r3, lbl_803F1750@l +/* 80380C6C 0037DBCC 3C 60 80 3F */ lis r3, HankakuToCode@ha +/* 80380C70 0037DBD0 38 63 17 50 */ addi r3, r3, HankakuToCode@l /* 80380C74 0037DBD4 54 00 08 3C */ slwi r0, r0, 1 /* 80380C78 0037DBD8 7C 63 02 14 */ add r3, r3, r0 /* 80380C7C 0037DBDC A0 63 FF C0 */ lhz r3, -0x40(r3) @@ -844,9 +844,9 @@ lbl_80380D70: /* 80380D7C 0037DCDC 38 63 FF FF */ addi r3, r3, -1 lbl_80380D80: /* 80380D80 0037DCE0 7C 05 1A 14 */ add r0, r5, r3 -/* 80380D84 0037DCE4 3C 60 80 3F */ lis r3, lbl_803F18D0@ha +/* 80380D84 0037DCE4 3C 60 80 3F */ lis r3, Zenkaku2Code@ha /* 80380D88 0037DCE8 54 04 08 3C */ slwi r4, r0, 1 -/* 80380D8C 0037DCEC 38 03 18 D0 */ addi r0, r3, lbl_803F18D0@l +/* 80380D8C 0037DCEC 38 03 18 D0 */ addi r0, r3, Zenkaku2Code@l /* 80380D90 0037DCF0 7C 60 22 14 */ add r3, r0, r4 /* 80380D94 0037DCF4 A0 63 00 00 */ lhz r3, 0(r3) /* 80380D98 0037DCF8 48 00 00 24 */ b lbl_80380DBC @@ -1139,7 +1139,7 @@ lbl_8038114C: /* 80381160 0037E0C0 80 02 CF 3C */ lwz r0, lbl_805AEC5C@sda21(r2) /* 80381164 0037E0C4 90 81 00 1C */ stw r4, 0x1c(r1) /* 80381168 0037E0C8 90 01 00 20 */ stw r0, 0x20(r1) -/* 8038116C 0037E0CC 4B FF FA C9 */ bl sub_80380c34 +/* 8038116C 0037E0CC 4B FF FA C9 */ bl GetFontCode /* 80381170 0037E0D0 80 AD AD 0C */ lwz r5, lbl_805A98CC@sda21(r13) /* 80381174 0037E0D4 81 8D AD 00 */ lwz r12, lbl_805A98C0@sda21(r13) /* 80381178 0037E0D8 7D 43 2B D6 */ divw r10, r3, r5 @@ -1350,7 +1350,7 @@ lbl_80381450: lbl_80381470: /* 80381470 0037E3D0 80 8D AD 00 */ lwz r4, lbl_805A98C0@sda21(r13) /* 80381474 0037E3D4 3B 24 00 2C */ addi r25, r4, 0x2c -/* 80381478 0037E3D8 4B FF F7 BD */ bl sub_80380c34 +/* 80381478 0037E3D8 4B FF F7 BD */ bl GetFontCode /* 8038147C 0037E3DC 80 CD AD 0C */ lwz r6, lbl_805A98CC@sda21(r13) /* 80381480 0037E3E0 57 00 10 3A */ slwi r0, r24, 2 /* 80381484 0037E3E4 81 8D AD 00 */ lwz r12, lbl_805A98C0@sda21(r13) diff --git a/asm/Dolphin/os/OSReboot.s b/asm/Dolphin/os/OSReboot.s index e4f8451e..1f0b029b 100644 --- a/asm/Dolphin/os/OSReboot.s +++ b/asm/Dolphin/os/OSReboot.s @@ -1,46 +1,44 @@ .include "macros.inc" .section .bss -.global lbl_80541580 -lbl_80541580: +.global Header +Header: .skip 0x20 .section .sbss -lbl_805A98E8: +SaveStart: .skip 0x4 -lbl_805A98EC: +SaveEnd: .skip 0x4 -lbl_805A98F0: +Prepared: .skip 0x8 .section .text, "ax" -.global Run Run: /* 80382E28 0037FD88 7C 00 04 AC */ sync 0 /* 80382E2C 0037FD8C 4C 00 01 2C */ isync /* 80382E30 0037FD90 7C 68 03 A6 */ mtlr r3 /* 80382E34 0037FD94 4E 80 00 20 */ blr -.global sub_80382e38 -sub_80382e38: +Callback: /* 80382E38 0037FD98 38 00 00 01 */ li r0, 1 -/* 80382E3C 0037FD9C 90 0D AD 30 */ stw r0, lbl_805A98F0@sda21(r13) +/* 80382E3C 0037FD9C 90 0D AD 30 */ stw r0, Prepared@sda21(r13) /* 80382E40 0037FDA0 4E 80 00 20 */ blr -.global sub_80382e44 -sub_80382e44: +.global __OSReboot +__OSReboot: /* 80382E44 0037FDA4 7C 08 02 A6 */ mflr r0 /* 80382E48 0037FDA8 90 01 00 04 */ stw r0, 4(r1) /* 80382E4C 0037FDAC 94 21 FC C0 */ stwu r1, -0x340(r1) /* 80382E50 0037FDB0 93 E1 03 3C */ stw r31, 0x33c(r1) /* 80382E54 0037FDB4 93 C1 03 38 */ stw r30, 0x338(r1) -/* 80382E58 0037FDB8 3C 60 80 54 */ lis r3, lbl_80541580@ha -/* 80382E5C 0037FDBC 3B C3 15 80 */ addi r30, r3, lbl_80541580@l +/* 80382E58 0037FDB8 3C 60 80 54 */ lis r3, Header@ha +/* 80382E5C 0037FDBC 3B C3 15 80 */ addi r30, r3, Header@l /* 80382E60 0037FDC0 4B FF E8 01 */ bl OSDisableInterrupts -/* 80382E64 0037FDC4 80 AD AD 28 */ lwz r5, lbl_805A98E8@sda21(r13) +/* 80382E64 0037FDC4 80 AD AD 28 */ lwz r5, SaveStart@sda21(r13) /* 80382E68 0037FDC8 3C 80 81 30 */ lis r4, 0x812FDFF0@ha -/* 80382E6C 0037FDCC 80 0D AD 2C */ lwz r0, lbl_805A98EC@sda21(r13) +/* 80382E6C 0037FDCC 80 0D AD 2C */ lwz r0, SaveEnd@sda21(r13) /* 80382E70 0037FDD0 38 60 00 00 */ li r3, 0 /* 80382E74 0037FDD4 3F E0 81 80 */ lis r31, 0x817FFFFC@ha /* 80382E78 0037FDD8 38 E0 00 01 */ li r7, 1 @@ -57,8 +55,8 @@ sub_80382e44: /* 80382EA4 0037FE04 4B FE ED 01 */ bl DVDInit /* 80382EA8 0037FE08 38 60 00 01 */ li r3, 1 /* 80382EAC 0037FE0C 4B FF 13 51 */ bl DVDSetAutoInvalidation -/* 80382EB0 0037FE10 3C 60 80 38 */ lis r3, sub_80382e38@ha -/* 80382EB4 0037FE14 38 63 2E 38 */ addi r3, r3, sub_80382e38@l +/* 80382EB0 0037FE10 3C 60 80 38 */ lis r3, Callback@ha +/* 80382EB4 0037FE14 38 63 2E 38 */ addi r3, r3, Callback@l /* 80382EB8 0037FE18 4B FF 18 E5 */ bl __DVDPrepareResetAsync /* 80382EBC 0037FE1C 4B FF 17 FD */ bl DVDCheckDisk /* 80382EC0 0037FE20 2C 03 00 00 */ cmpwi r3, 0 @@ -75,7 +73,7 @@ lbl_80382ED0: lbl_80382EE8: /* 80382EE8 0037FE48 48 00 00 04 */ b lbl_80382EEC lbl_80382EEC: -/* 80382EEC 0037FE4C 80 0D AD 30 */ lwz r0, lbl_805A98F0@sda21(r13) +/* 80382EEC 0037FE4C 80 0D AD 30 */ lwz r0, Prepared@sda21(r13) /* 80382EF0 0037FE50 2C 00 00 00 */ cmpwi r0, 0 /* 80382EF4 0037FE54 41 82 FF F8 */ beq lbl_80382EEC /* 80382EF8 0037FE58 7F C4 F3 78 */ mr r4, r30 @@ -115,7 +113,7 @@ lbl_80382F54: lbl_80382F6C: /* 80382F6C 0037FECC 48 00 00 04 */ b lbl_80382F70 lbl_80382F70: -/* 80382F70 0037FED0 80 0D AD 30 */ lwz r0, lbl_805A98F0@sda21(r13) +/* 80382F70 0037FED0 80 0D AD 30 */ lwz r0, Prepared@sda21(r13) /* 80382F74 0037FED4 2C 00 00 00 */ cmpwi r0, 0 /* 80382F78 0037FED8 41 82 FF F8 */ beq lbl_80382F70 /* 80382F7C 0037FEDC 7F C5 F3 78 */ mr r5, r30 @@ -160,16 +158,16 @@ lbl_80382FD8: /* 80383004 0037FF64 7C 08 03 A6 */ mtlr r0 /* 80383008 0037FF68 4E 80 00 20 */ blr -.global sub_8038300c -sub_8038300c: -/* 8038300C 0037FF6C 90 6D AD 28 */ stw r3, lbl_805A98E8@sda21(r13) -/* 80383010 0037FF70 90 8D AD 2C */ stw r4, lbl_805A98EC@sda21(r13) +.global OSSetSaveRegion +OSSetSaveRegion: +/* 8038300C 0037FF6C 90 6D AD 28 */ stw r3, SaveStart@sda21(r13) +/* 80383010 0037FF70 90 8D AD 2C */ stw r4, SaveEnd@sda21(r13) /* 80383014 0037FF74 4E 80 00 20 */ blr -.global sub_80383018 -sub_80383018: -/* 80383018 0037FF78 80 0D AC DC */ lwz r0, lbl_805A989C@sda21(r13) +.global OSGetSaveRegion +OSGetSaveRegion: +/* 80383018 0037FF78 80 0D AC DC */ lwz r0, __OSSavedRegionStart@sda21(r13) /* 8038301C 0037FF7C 90 03 00 00 */ stw r0, 0(r3) -/* 80383020 0037FF80 80 0D AC D8 */ lwz r0, lbl_805A9898@sda21(r13) +/* 80383020 0037FF80 80 0D AC D8 */ lwz r0, __OSSavedRegionEnd@sda21(r13) /* 80383024 0037FF84 90 04 00 00 */ stw r0, 0(r4) /* 80383028 0037FF88 4E 80 00 20 */ blr diff --git a/asm/Dolphin/os/OSReset.s b/asm/Dolphin/os/OSReset.s index fbf785e2..955c70ca 100644 --- a/asm/Dolphin/os/OSReset.s +++ b/asm/Dolphin/os/OSReset.s @@ -1,14 +1,14 @@ .include "macros.inc" .section .sbss -lbl_805A98F8: +ResetFunctionQueue: .skip 0x8 .section .text, "ax" .global OSRegisterResetFunction OSRegisterResetFunction: -/* 8038302C 0037FF8C 80 AD AD 38 */ lwz r5, lbl_805A98F8@sda21(r13) +/* 8038302C 0037FF8C 80 AD AD 38 */ lwz r5, ResetFunctionQueue@sda21(r13) /* 80383030 0037FF90 48 00 00 08 */ b lbl_80383038 lbl_80383034: /* 80383034 0037FF94 80 A5 00 08 */ lwz r5, 8(r5) @@ -22,11 +22,11 @@ lbl_80383038: lbl_80383050: /* 80383050 0037FFB0 28 05 00 00 */ cmplwi r5, 0 /* 80383054 0037FFB4 40 82 00 34 */ bne lbl_80383088 -/* 80383058 0037FFB8 38 AD AD 38 */ addi r5, r13, lbl_805A98F8@sda21 +/* 80383058 0037FFB8 38 AD AD 38 */ addi r5, r13, ResetFunctionQueue@sda21 /* 8038305C 0037FFBC 84 85 00 04 */ lwzu r4, 4(r5) /* 80383060 0037FFC0 28 04 00 00 */ cmplwi r4, 0 /* 80383064 0037FFC4 40 82 00 0C */ bne lbl_80383070 -/* 80383068 0037FFC8 90 6D AD 38 */ stw r3, lbl_805A98F8@sda21(r13) +/* 80383068 0037FFC8 90 6D AD 38 */ stw r3, ResetFunctionQueue@sda21(r13) /* 8038306C 0037FFCC 48 00 00 08 */ b lbl_80383074 lbl_80383070: /* 80383070 0037FFD0 90 64 00 08 */ stw r3, 8(r4) @@ -43,7 +43,7 @@ lbl_80383088: /* 80383094 0037FFF4 28 04 00 00 */ cmplwi r4, 0 /* 80383098 0037FFF8 90 83 00 0C */ stw r4, 0xc(r3) /* 8038309C 0037FFFC 40 82 00 0C */ bne lbl_803830A8 -/* 803830A0 00380000 90 6D AD 38 */ stw r3, lbl_805A98F8@sda21(r13) +/* 803830A0 00380000 90 6D AD 38 */ stw r3, ResetFunctionQueue@sda21(r13) /* 803830A4 00380004 4E 80 00 20 */ blr lbl_803830A8: /* 803830A8 00380008 90 64 00 08 */ stw r3, 8(r4) @@ -59,7 +59,7 @@ __OSCallResetFunctions: /* 803830C4 00380024 3B C0 00 00 */ li r30, 0 /* 803830C8 00380028 93 A1 00 14 */ stw r29, 0x14(r1) /* 803830CC 0038002C 3B A3 00 00 */ addi r29, r3, 0 -/* 803830D0 00380030 83 ED AD 38 */ lwz r31, lbl_805A98F8@sda21(r13) +/* 803830D0 00380030 83 ED AD 38 */ lwz r31, ResetFunctionQueue@sda21(r13) /* 803830D4 00380034 48 00 00 24 */ b lbl_803830F8 lbl_803830D8: /* 803830D8 00380038 81 9F 00 00 */ lwz r12, 0(r31) @@ -91,7 +91,6 @@ lbl_80383120: /* 80383134 00380094 7C 08 03 A6 */ mtlr r0 /* 80383138 00380098 4E 80 00 20 */ blr -.global Reset Reset: /* 8038313C 0038009C 48 00 00 20 */ b lbl_8038315C lbl_80383140: @@ -173,7 +172,7 @@ lbl_8038322C: lbl_80383230: /* 80383230 00380190 48 00 00 04 */ b lbl_80383234 lbl_80383234: -/* 80383234 00380194 83 6D AD 38 */ lwz r27, lbl_805A98F8@sda21(r13) +/* 80383234 00380194 83 6D AD 38 */ lwz r27, ResetFunctionQueue@sda21(r13) /* 80383238 00380198 3B 80 00 00 */ li r28, 0 /* 8038323C 0038019C 48 00 00 04 */ b lbl_80383240 lbl_80383240: @@ -224,7 +223,7 @@ lbl_803832CC: /* 803832D4 00380234 41 82 FF F8 */ beq lbl_803832CC lbl_803832D8: /* 803832D8 00380238 4B FF E3 89 */ bl OSDisableInterrupts -/* 803832DC 0038023C 83 8D AD 38 */ lwz r28, lbl_805A98F8@sda21(r13) +/* 803832DC 0038023C 83 8D AD 38 */ lwz r28, ResetFunctionQueue@sda21(r13) /* 803832E0 00380240 3B 60 00 00 */ li r27, 0 /* 803832E4 00380244 48 00 00 04 */ b lbl_803832E8 lbl_803832E8: @@ -285,7 +284,7 @@ lbl_80383390: /* 80383398 003802F8 48 00 12 89 */ bl OSEnableScheduler /* 8038339C 003802FC 7F A3 EB 78 */ mr r3, r29 /* 803833A0 00380300 7F C4 F3 78 */ mr r4, r30 -/* 803833A4 00380304 4B FF FA A1 */ bl sub_80382e44 +/* 803833A4 00380304 4B FF FA A1 */ bl __OSReboot lbl_803833A8: /* 803833A8 00380308 3C 60 80 00 */ lis r3, 0x800000DC@ha /* 803833AC 0038030C 80 63 00 DC */ lwz r3, 0x800000DC@l(r3) diff --git a/asm/Dolphin/os/OSResetSW.s b/asm/Dolphin/os/OSResetSW.s index e6b72a5b..ac3ac690 100644 --- a/asm/Dolphin/os/OSResetSW.s +++ b/asm/Dolphin/os/OSResetSW.s @@ -225,8 +225,8 @@ lbl_80383750: /* 80383760 003806C0 41 82 00 A0 */ beq lbl_80383800 /* 80383764 003806C4 1D 40 00 3C */ mulli r10, r0, 0x3c /* 80383768 003806C8 80 05 00 F8 */ lwz r0, 0xf8(r5) -/* 8038376C 003806CC 81 2D AC EC */ lwz r9, lbl_805A98AC@sda21(r13) -/* 80383770 003806D0 81 0D AC E8 */ lwz r8, lbl_805A98A8@sda21(r13) +/* 8038376C 003806CC 81 2D AC EC */ lwz r9, __OSStartTime+4@sda21(r13) +/* 80383770 003806D0 81 0D AC E8 */ lwz r8, __OSStartTime@sda21(r13) /* 80383774 003806D4 54 06 F0 BE */ srwi r6, r0, 2 /* 80383778 003806D8 7D 40 FE 70 */ srawi r0, r10, 0x1f /* 8038377C 003806DC 7C E0 31 D6 */ mullw r7, r0, r6 diff --git a/asm/Dolphin/os/OSRtc.s b/asm/Dolphin/os/OSRtc.s index 84db8574..fa502dbb 100644 --- a/asm/Dolphin/os/OSRtc.s +++ b/asm/Dolphin/os/OSRtc.s @@ -1,7 +1,7 @@ .include "macros.inc" .section .bss -lbl_805415A0: +Scb: .skip 0x58 .section .text, "ax" @@ -9,11 +9,11 @@ lbl_805415A0: .global WriteSramCallback WriteSramCallback: /* 80383828 00380788 7C 08 02 A6 */ mflr r0 -/* 8038382C 0038078C 3C 60 80 54 */ lis r3, lbl_805415A0@ha +/* 8038382C 0038078C 3C 60 80 54 */ lis r3, Scb@ha /* 80383830 00380790 90 01 00 04 */ stw r0, 4(r1) /* 80383834 00380794 94 21 FF E8 */ stwu r1, -0x18(r1) /* 80383838 00380798 93 E1 00 14 */ stw r31, 0x14(r1) -/* 8038383C 0038079C 3B E3 15 A0 */ addi r31, r3, lbl_805415A0@l +/* 8038383C 0038079C 3B E3 15 A0 */ addi r31, r3, Scb@l /* 80383840 003807A0 93 C1 00 10 */ stw r30, 0x10(r1) /* 80383844 003807A4 3B DF 00 40 */ addi r30, r31, 0x40 /* 80383848 003807A8 80 9F 00 40 */ lwz r4, 0x40(r31) @@ -110,17 +110,17 @@ lbl_80383984: /* 80383998 003808F8 7C 08 03 A6 */ mtlr r0 /* 8038399C 003808FC 4E 80 00 20 */ blr -.global sub_803839a0 -sub_803839a0: +.global __OSInitSram +__OSInitSram: /* 803839A0 00380900 7C 08 02 A6 */ mflr r0 -/* 803839A4 00380904 3C 60 80 54 */ lis r3, lbl_805415A0@ha +/* 803839A4 00380904 3C 60 80 54 */ lis r3, Scb@ha /* 803839A8 00380908 90 01 00 04 */ stw r0, 4(r1) /* 803839AC 0038090C 38 80 00 40 */ li r4, 0x40 /* 803839B0 00380910 94 21 FF E8 */ stwu r1, -0x18(r1) /* 803839B4 00380914 93 E1 00 14 */ stw r31, 0x14(r1) /* 803839B8 00380918 3B E0 00 00 */ li r31, 0 /* 803839BC 0038091C 93 C1 00 10 */ stw r30, 0x10(r1) -/* 803839C0 00380920 3B C3 15 A0 */ addi r30, r3, lbl_805415A0@l +/* 803839C0 00380920 3B C3 15 A0 */ addi r30, r3, Scb@l /* 803839C4 00380924 38 7E 00 00 */ addi r3, r30, 0 /* 803839C8 00380928 93 FE 00 44 */ stw r31, 0x44(r30) /* 803839CC 0038092C 93 FE 00 48 */ stw r31, 0x48(r30) @@ -196,11 +196,11 @@ lbl_80383AB0: .global __OSLockSram __OSLockSram: /* 80383AD4 00380A34 7C 08 02 A6 */ mflr r0 -/* 80383AD8 00380A38 3C 60 80 54 */ lis r3, lbl_805415A0@ha +/* 80383AD8 00380A38 3C 60 80 54 */ lis r3, Scb@ha /* 80383ADC 00380A3C 90 01 00 04 */ stw r0, 4(r1) /* 80383AE0 00380A40 94 21 FF F0 */ stwu r1, -0x10(r1) /* 80383AE4 00380A44 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80383AE8 00380A48 3B E3 15 A0 */ addi r31, r3, lbl_805415A0@l +/* 80383AE8 00380A48 3B E3 15 A0 */ addi r31, r3, Scb@l /* 80383AEC 00380A4C 4B FF DB 75 */ bl OSDisableInterrupts /* 80383AF0 00380A50 80 1F 00 48 */ lwz r0, 0x48(r31) /* 80383AF4 00380A54 38 9F 00 48 */ addi r4, r31, 0x48 @@ -224,11 +224,11 @@ lbl_80383B18: .global __OSLockSramEx __OSLockSramEx: /* 80383B30 00380A90 7C 08 02 A6 */ mflr r0 -/* 80383B34 00380A94 3C 60 80 54 */ lis r3, lbl_805415A0@ha +/* 80383B34 00380A94 3C 60 80 54 */ lis r3, Scb@ha /* 80383B38 00380A98 90 01 00 04 */ stw r0, 4(r1) /* 80383B3C 00380A9C 94 21 FF F0 */ stwu r1, -0x10(r1) /* 80383B40 00380AA0 93 E1 00 0C */ stw r31, 0xc(r1) -/* 80383B44 00380AA4 3B E3 15 A0 */ addi r31, r3, lbl_805415A0@l +/* 80383B44 00380AA4 3B E3 15 A0 */ addi r31, r3, Scb@l /* 80383B48 00380AA8 4B FF DB 19 */ bl OSDisableInterrupts /* 80383B4C 00380AAC 80 1F 00 48 */ lwz r0, 0x48(r31) /* 80383B50 00380AB0 38 9F 00 48 */ addi r4, r31, 0x48 @@ -249,15 +249,15 @@ lbl_80383B78: /* 80383B84 00380AE4 7C 08 03 A6 */ mtlr r0 /* 80383B88 00380AE8 4E 80 00 20 */ blr -.global sub_80383b8c -sub_80383b8c: +.global UnlockSram +UnlockSram: /* 80383B8C 00380AEC 7C 08 02 A6 */ mflr r0 /* 80383B90 00380AF0 2C 03 00 00 */ cmpwi r3, 0 /* 80383B94 00380AF4 90 01 00 04 */ stw r0, 4(r1) -/* 80383B98 00380AF8 3C 60 80 54 */ lis r3, lbl_805415A0@ha +/* 80383B98 00380AF8 3C 60 80 54 */ lis r3, Scb@ha /* 80383B9C 00380AFC 94 21 FF D0 */ stwu r1, -0x30(r1) /* 80383BA0 00380B00 BF 61 00 1C */ stmw r27, 0x1c(r1) -/* 80383BA4 00380B04 3B E3 15 A0 */ addi r31, r3, lbl_805415A0@l +/* 80383BA4 00380B04 3B E3 15 A0 */ addi r31, r3, Scb@l /* 80383BA8 00380B08 41 82 02 C4 */ beq lbl_80383E6C /* 80383BAC 00380B0C 28 04 00 00 */ cmplwi r4, 0 /* 80383BB0 00380B10 40 82 01 B0 */ bne lbl_80383D60 @@ -462,7 +462,7 @@ __OSUnlockSram: /* 80383E98 00380DF8 38 80 00 00 */ li r4, 0 /* 80383E9C 00380DFC 90 01 00 04 */ stw r0, 4(r1) /* 80383EA0 00380E00 94 21 FF F8 */ stwu r1, -8(r1) -/* 80383EA4 00380E04 4B FF FC E9 */ bl sub_80383b8c +/* 80383EA4 00380E04 4B FF FC E9 */ bl UnlockSram /* 80383EA8 00380E08 80 01 00 0C */ lwz r0, 0xc(r1) /* 80383EAC 00380E0C 38 21 00 08 */ addi r1, r1, 8 /* 80383EB0 00380E10 7C 08 03 A6 */ mtlr r0 @@ -474,7 +474,7 @@ __OSUnlockSramEx: /* 80383EBC 00380E1C 38 80 00 14 */ li r4, 0x14 /* 80383EC0 00380E20 90 01 00 04 */ stw r0, 4(r1) /* 80383EC4 00380E24 94 21 FF F8 */ stwu r1, -8(r1) -/* 80383EC8 00380E28 4B FF FC C5 */ bl sub_80383b8c +/* 80383EC8 00380E28 4B FF FC C5 */ bl UnlockSram /* 80383ECC 00380E2C 80 01 00 0C */ lwz r0, 0xc(r1) /* 80383ED0 00380E30 38 21 00 08 */ addi r1, r1, 8 /* 80383ED4 00380E34 7C 08 03 A6 */ mtlr r0 @@ -482,8 +482,8 @@ __OSUnlockSramEx: .global __OSSyncSram __OSSyncSram: -/* 80383EDC 00380E3C 3C 60 80 54 */ lis r3, lbl_805415A0@ha -/* 80383EE0 00380E40 38 63 15 A0 */ addi r3, r3, lbl_805415A0@l +/* 80383EDC 00380E3C 3C 60 80 54 */ lis r3, Scb@ha +/* 80383EE0 00380E40 38 63 15 A0 */ addi r3, r3, Scb@l /* 80383EE4 00380E44 80 63 00 4C */ lwz r3, 0x4c(r3) /* 80383EE8 00380E48 4E 80 00 20 */ blr @@ -569,11 +569,11 @@ lbl_80383FF4: .global OSGetSoundMode OSGetSoundMode: /* 80384010 00380F70 7C 08 02 A6 */ mflr r0 -/* 80384014 00380F74 3C 60 80 54 */ lis r3, lbl_805415A0@ha +/* 80384014 00380F74 3C 60 80 54 */ lis r3, Scb@ha /* 80384018 00380F78 90 01 00 04 */ stw r0, 4(r1) /* 8038401C 00380F7C 94 21 FF E0 */ stwu r1, -0x20(r1) /* 80384020 00380F80 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 80384024 00380F84 3B E3 15 A0 */ addi r31, r3, lbl_805415A0@l +/* 80384024 00380F84 3B E3 15 A0 */ addi r31, r3, Scb@l /* 80384028 00380F88 4B FF D6 39 */ bl OSDisableInterrupts /* 8038402C 00380F8C 80 1F 00 48 */ lwz r0, 0x48(r31) /* 80384030 00380F90 38 9F 00 48 */ addi r4, r31, 0x48 @@ -597,7 +597,7 @@ lbl_80384068: lbl_8038406C: /* 8038406C 00380FCC 38 60 00 00 */ li r3, 0 /* 80384070 00380FD0 38 80 00 00 */ li r4, 0 -/* 80384074 00380FD4 4B FF FB 19 */ bl sub_80383b8c +/* 80384074 00380FD4 4B FF FB 19 */ bl UnlockSram /* 80384078 00380FD8 7F E3 FB 78 */ mr r3, r31 /* 8038407C 00380FDC 80 01 00 24 */ lwz r0, 0x24(r1) /* 80384080 00380FE0 83 E1 00 1C */ lwz r31, 0x1c(r1) @@ -608,11 +608,11 @@ lbl_8038406C: .global OSSetSoundMode OSSetSoundMode: /* 80384090 00380FF0 7C 08 02 A6 */ mflr r0 -/* 80384094 00380FF4 3C 80 80 54 */ lis r4, lbl_805415A0@ha +/* 80384094 00380FF4 3C 80 80 54 */ lis r4, Scb@ha /* 80384098 00380FF8 90 01 00 04 */ stw r0, 4(r1) /* 8038409C 00380FFC 94 21 FF E0 */ stwu r1, -0x20(r1) /* 803840A0 00381000 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 803840A4 00381004 3B E4 15 A0 */ addi r31, r4, lbl_805415A0@l +/* 803840A4 00381004 3B E4 15 A0 */ addi r31, r4, Scb@l /* 803840A8 00381008 93 C1 00 18 */ stw r30, 0x18(r1) /* 803840AC 0038100C 54 7E 17 7A */ rlwinm r30, r3, 2, 0x1d, 0x1d /* 803840B0 00381010 4B FF D5 B1 */ bl OSDisableInterrupts @@ -634,7 +634,7 @@ lbl_803840DC: /* 803840E8 00381048 40 82 00 14 */ bne lbl_803840FC /* 803840EC 0038104C 38 60 00 00 */ li r3, 0 /* 803840F0 00381050 38 80 00 00 */ li r4, 0 -/* 803840F4 00381054 4B FF FA 99 */ bl sub_80383b8c +/* 803840F4 00381054 4B FF FA 99 */ bl UnlockSram /* 803840F8 00381058 48 00 00 24 */ b lbl_8038411C lbl_803840FC: /* 803840FC 0038105C 54 60 07 B8 */ rlwinm r0, r3, 0, 0x1e, 0x1c @@ -644,7 +644,7 @@ lbl_803840FC: /* 8038410C 0038106C 88 1F 00 13 */ lbz r0, 0x13(r31) /* 80384110 00381070 7C 00 F3 78 */ or r0, r0, r30 /* 80384114 00381074 98 1F 00 13 */ stb r0, 0x13(r31) -/* 80384118 00381078 4B FF FA 75 */ bl sub_80383b8c +/* 80384118 00381078 4B FF FA 75 */ bl UnlockSram lbl_8038411C: /* 8038411C 0038107C 80 01 00 24 */ lwz r0, 0x24(r1) /* 80384120 00381080 83 E1 00 1C */ lwz r31, 0x1c(r1) @@ -656,11 +656,11 @@ lbl_8038411C: .global OSGetProgressiveMode OSGetProgressiveMode: /* 80384134 00381094 7C 08 02 A6 */ mflr r0 -/* 80384138 00381098 3C 60 80 54 */ lis r3, lbl_805415A0@ha +/* 80384138 00381098 3C 60 80 54 */ lis r3, Scb@ha /* 8038413C 0038109C 90 01 00 04 */ stw r0, 4(r1) /* 80384140 003810A0 94 21 FF E8 */ stwu r1, -0x18(r1) /* 80384144 003810A4 93 E1 00 14 */ stw r31, 0x14(r1) -/* 80384148 003810A8 3B E3 15 A0 */ addi r31, r3, lbl_805415A0@l +/* 80384148 003810A8 3B E3 15 A0 */ addi r31, r3, Scb@l /* 8038414C 003810AC 4B FF D5 15 */ bl OSDisableInterrupts /* 80384150 003810B0 80 1F 00 48 */ lwz r0, 0x48(r31) /* 80384154 003810B4 38 9F 00 48 */ addi r4, r31, 0x48 @@ -678,7 +678,7 @@ lbl_80384178: /* 8038417C 003810DC 38 60 00 00 */ li r3, 0 /* 80384180 003810E0 38 80 00 00 */ li r4, 0 /* 80384184 003810E4 54 1F CF FE */ rlwinm r31, r0, 0x19, 0x1f, 0x1f -/* 80384188 003810E8 4B FF FA 05 */ bl sub_80383b8c +/* 80384188 003810E8 4B FF FA 05 */ bl UnlockSram /* 8038418C 003810EC 7F E3 FB 78 */ mr r3, r31 /* 80384190 003810F0 80 01 00 1C */ lwz r0, 0x1c(r1) /* 80384194 003810F4 83 E1 00 14 */ lwz r31, 0x14(r1) @@ -689,11 +689,11 @@ lbl_80384178: .global sub_803841a4 sub_803841a4: /* 803841A4 00381104 7C 08 02 A6 */ mflr r0 -/* 803841A8 00381108 3C 80 80 54 */ lis r4, lbl_805415A0@ha +/* 803841A8 00381108 3C 80 80 54 */ lis r4, Scb@ha /* 803841AC 0038110C 90 01 00 04 */ stw r0, 4(r1) /* 803841B0 00381110 94 21 FF E0 */ stwu r1, -0x20(r1) /* 803841B4 00381114 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 803841B8 00381118 3B E4 15 A0 */ addi r31, r4, lbl_805415A0@l +/* 803841B8 00381118 3B E4 15 A0 */ addi r31, r4, Scb@l /* 803841BC 0038111C 93 C1 00 18 */ stw r30, 0x18(r1) /* 803841C0 00381120 54 7E 3E 30 */ rlwinm r30, r3, 7, 0x18, 0x18 /* 803841C4 00381124 4B FF D4 9D */ bl OSDisableInterrupts @@ -715,7 +715,7 @@ lbl_803841F0: /* 803841FC 0038115C 40 82 00 14 */ bne lbl_80384210 /* 80384200 00381160 38 60 00 00 */ li r3, 0 /* 80384204 00381164 38 80 00 00 */ li r4, 0 -/* 80384208 00381168 4B FF F9 85 */ bl sub_80383b8c +/* 80384208 00381168 4B FF F9 85 */ bl UnlockSram /* 8038420C 0038116C 48 00 00 24 */ b lbl_80384230 lbl_80384210: /* 80384210 00381170 54 60 06 6E */ rlwinm r0, r3, 0, 0x19, 0x17 @@ -725,7 +725,7 @@ lbl_80384210: /* 80384220 00381180 88 1F 00 13 */ lbz r0, 0x13(r31) /* 80384224 00381184 7C 00 F3 78 */ or r0, r0, r30 /* 80384228 00381188 98 1F 00 13 */ stb r0, 0x13(r31) -/* 8038422C 0038118C 4B FF F9 61 */ bl sub_80383b8c +/* 8038422C 0038118C 4B FF F9 61 */ bl UnlockSram lbl_80384230: /* 80384230 00381190 80 01 00 24 */ lwz r0, 0x24(r1) /* 80384234 00381194 83 E1 00 1C */ lwz r31, 0x1c(r1) @@ -737,11 +737,11 @@ lbl_80384230: .global OSGetLanguage OSGetLanguage: /* 80384248 003811A8 7C 08 02 A6 */ mflr r0 -/* 8038424C 003811AC 3C 60 80 54 */ lis r3, lbl_805415A0@ha +/* 8038424C 003811AC 3C 60 80 54 */ lis r3, Scb@ha /* 80384250 003811B0 90 01 00 04 */ stw r0, 4(r1) /* 80384254 003811B4 94 21 FF E8 */ stwu r1, -0x18(r1) /* 80384258 003811B8 93 E1 00 14 */ stw r31, 0x14(r1) -/* 8038425C 003811BC 3B E3 15 A0 */ addi r31, r3, lbl_805415A0@l +/* 8038425C 003811BC 3B E3 15 A0 */ addi r31, r3, Scb@l /* 80384260 003811C0 4B FF D4 01 */ bl OSDisableInterrupts /* 80384264 003811C4 80 1F 00 48 */ lwz r0, 0x48(r31) /* 80384268 003811C8 38 9F 00 48 */ addi r4, r31, 0x48 @@ -758,7 +758,7 @@ lbl_8038428C: /* 8038428C 003811EC 8B FF 00 12 */ lbz r31, 0x12(r31) /* 80384290 003811F0 38 60 00 00 */ li r3, 0 /* 80384294 003811F4 38 80 00 00 */ li r4, 0 -/* 80384298 003811F8 4B FF F8 F5 */ bl sub_80383b8c +/* 80384298 003811F8 4B FF F8 F5 */ bl UnlockSram /* 8038429C 003811FC 7F E3 FB 78 */ mr r3, r31 /* 803842A0 00381200 80 01 00 1C */ lwz r0, 0x1c(r1) /* 803842A4 00381204 83 E1 00 14 */ lwz r31, 0x14(r1) @@ -769,11 +769,11 @@ lbl_8038428C: .global OSGetWirelessID OSGetWirelessID: /* 803842B4 00381214 7C 08 02 A6 */ mflr r0 -/* 803842B8 00381218 3C 80 80 54 */ lis r4, lbl_805415A0@ha +/* 803842B8 00381218 3C 80 80 54 */ lis r4, Scb@ha /* 803842BC 0038121C 90 01 00 04 */ stw r0, 4(r1) /* 803842C0 00381220 94 21 FF E0 */ stwu r1, -0x20(r1) /* 803842C4 00381224 93 E1 00 1C */ stw r31, 0x1c(r1) -/* 803842C8 00381228 3B E4 15 A0 */ addi r31, r4, lbl_805415A0@l +/* 803842C8 00381228 3B E4 15 A0 */ addi r31, r4, Scb@l /* 803842CC 0038122C 93 C1 00 18 */ stw r30, 0x18(r1) /* 803842D0 00381230 3B C3 00 00 */ addi r30, r3, 0 /* 803842D4 00381234 4B FF D3 8D */ bl OSDisableInterrupts @@ -795,7 +795,7 @@ lbl_80384304: /* 8038430C 0038126C A3 E3 00 1C */ lhz r31, 0x1c(r3) /* 80384310 00381270 38 60 00 00 */ li r3, 0 /* 80384314 00381274 38 80 00 14 */ li r4, 0x14 -/* 80384318 00381278 4B FF F8 75 */ bl sub_80383b8c +/* 80384318 00381278 4B FF F8 75 */ bl UnlockSram /* 8038431C 0038127C 7F E3 FB 78 */ mr r3, r31 /* 80384320 00381280 80 01 00 24 */ lwz r0, 0x24(r1) /* 80384324 00381284 83 E1 00 1C */ lwz r31, 0x1c(r1) @@ -807,11 +807,11 @@ lbl_80384304: .global OSSetWirelessID OSSetWirelessID: /* 80384338 00381298 7C 08 02 A6 */ mflr r0 -/* 8038433C 0038129C 3C A0 80 54 */ lis r5, lbl_805415A0@ha +/* 8038433C 0038129C 3C A0 80 54 */ lis r5, Scb@ha /* 80384340 003812A0 90 01 00 04 */ stw r0, 4(r1) /* 80384344 003812A4 94 21 FF D8 */ stwu r1, -0x28(r1) /* 80384348 003812A8 93 E1 00 24 */ stw r31, 0x24(r1) -/* 8038434C 003812AC 3B E5 15 A0 */ addi r31, r5, lbl_805415A0@l +/* 8038434C 003812AC 3B E5 15 A0 */ addi r31, r5, Scb@l /* 80384350 003812B0 93 C1 00 20 */ stw r30, 0x20(r1) /* 80384354 003812B4 3B C4 00 00 */ addi r30, r4, 0 /* 80384358 003812B8 93 A1 00 1C */ stw r29, 0x1c(r1) @@ -839,12 +839,12 @@ lbl_80384390: /* 803843A8 00381308 B3 C4 00 00 */ sth r30, 0(r4) /* 803843AC 0038130C 38 60 00 01 */ li r3, 1 /* 803843B0 00381310 38 80 00 14 */ li r4, 0x14 -/* 803843B4 00381314 4B FF F7 D9 */ bl sub_80383b8c +/* 803843B4 00381314 4B FF F7 D9 */ bl UnlockSram /* 803843B8 00381318 48 00 00 10 */ b lbl_803843C8 lbl_803843BC: /* 803843BC 0038131C 38 60 00 00 */ li r3, 0 /* 803843C0 00381320 38 80 00 14 */ li r4, 0x14 -/* 803843C4 00381324 4B FF F7 C9 */ bl sub_80383b8c +/* 803843C4 00381324 4B FF F7 C9 */ bl UnlockSram lbl_803843C8: /* 803843C8 00381328 80 01 00 2C */ lwz r0, 0x2c(r1) /* 803843CC 0038132C 83 E1 00 24 */ lwz r31, 0x24(r1) diff --git a/asm/Dolphin/pad/pad.s b/asm/Dolphin/pad/pad.s index 767addc1..cfd45e47 100644 --- a/asm/Dolphin/pad/pad.s +++ b/asm/Dolphin/pad/pad.s @@ -9,35 +9,36 @@ lbl_80542000: .section .sbss .balign 4 -.global lbl_805A9930 -lbl_805A9930: + +Initialized: .skip 0x4 -.global lbl_805A9934 -lbl_805A9934: + +EnabledBits: .skip 0x4 -.global lbl_805A9938 -lbl_805A9938: + +ResettingBits: .skip 0x4 -.global lbl_805A993C -lbl_805A993C: + +RecalibrateBits: .skip 0x4 -.global lbl_805A9940 -lbl_805A9940: + +WaitingBits: .skip 0x4 -.global lbl_805A9944 -lbl_805A9944: + +CheckingBits: .skip 0x4 -.global lbl_805A9948 -lbl_805A9948: + +PendingBits: .skip 0x4 -.global lbl_805A994C -lbl_805A994C: + +SamplingCallback: .skip 0x4 -.global lbl_805A9950 -lbl_805A9950: + +"recalibrated$216": .skip 0x4 -.global lbl_805A9954 -lbl_805A9954: + +.global __PADSpec +__PADSpec: .skip 0x4 .section .data, "wa" @@ -54,30 +55,30 @@ lbl_803F2398: .section .sdata -.global lbl_805A8B58 -lbl_805A8B58: - .incbin "baserom.dol", 0x3F64F8, 0x4 -.global lbl_805A8B5C -lbl_805A8B5C: - .incbin "baserom.dol", 0x3F64FC, 0x4 -.global lbl_805A8B60 -lbl_805A8B60: - .incbin "baserom.dol", 0x3F6500, 0x4 -.global lbl_805A8B64 -lbl_805A8B64: - .incbin "baserom.dol", 0x3F6504, 0x4 -.global lbl_805A8B68 +__PADVersion: + .4byte PAD_VERSION_STR + +ResettingChan: + .4byte 0x00000020 + +XPatchBits: + .4byte 0xF0000000 + +AnalogMode: + .4byte 0x00000300 + lbl_805A8B68: - .incbin "baserom.dol", 0x3F6508, 0x4 -.global lbl_805A8B6C -lbl_805A8B6C: - .incbin "baserom.dol", 0x3F650C, 0x4 -.global lbl_805A8B70 -lbl_805A8B70: - .incbin "baserom.dol", 0x3F6510, 0x4 -.global lbl_805A8B74 -lbl_805A8B74: - .incbin "baserom.dol", 0x3F6514, 0x4 + .4byte 00000005 + +MakeStatus: + .4byte SPEC2_MakeStatus + +CmdReadOrigin: + .4byte 0x41000000 + +.global CmdCalibrate +CmdCalibrate: + .4byte 0x42000000 .section .text, "ax" # 0x80003640 - 0x803CB1C0 @@ -91,7 +92,7 @@ UpdateOrigin: /* 80385B10 00382A70 38 A5 20 00 */ addi r5, r5, lbl_80542000@l /* 80385B14 00382A74 93 E1 00 14 */ stw r31, 0x14(r1) /* 80385B18 00382A78 7F E5 32 14 */ add r31, r5, r6 -/* 80385B1C 00382A7C 80 0D 9F A4 */ lwz r0, lbl_805A8B64@sda21(r13) +/* 80385B1C 00382A7C 80 0D 9F A4 */ lwz r0, AnalogMode@sda21(r13) /* 80385B20 00382A80 54 04 05 6E */ rlwinm r4, r0, 0, 0x15, 0x17 /* 80385B24 00382A84 2C 04 04 00 */ cmpwi r4, 0x400 /* 80385B28 00382A88 3C 00 80 00 */ lis r0, 0x8000 @@ -176,7 +177,7 @@ lbl_80385C24: /* 80385C48 00382BA8 88 9F 00 05 */ lbz r4, 5(r31) /* 80385C4C 00382BAC 38 84 FF 80 */ addi r4, r4, -128 /* 80385C50 00382BB0 98 9F 00 05 */ stb r4, 5(r31) -/* 80385C54 00382BB4 80 8D 9F A0 */ lwz r4, lbl_805A8B60@sda21(r13) +/* 80385C54 00382BB4 80 8D 9F A0 */ lwz r4, XPatchBits@sda21(r13) /* 80385C58 00382BB8 7C 80 00 39 */ and. r0, r4, r0 /* 80385C5C 00382BBC 41 82 00 30 */ beq lbl_80385C8C /* 80385C60 00382BC0 88 1F 00 02 */ lbz r0, 2(r31) @@ -205,35 +206,35 @@ PADOriginCallback: /* 80385CAC 00382C0C 94 21 FF D0 */ stwu r1, -0x30(r1) /* 80385CB0 00382C10 93 E1 00 2C */ stw r31, 0x2c(r1) /* 80385CB4 00382C14 40 82 00 48 */ bne lbl_80385CFC -/* 80385CB8 00382C18 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80385CB8 00382C18 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80385CBC 00382C1C 4B FF FE 41 */ bl UpdateOrigin -/* 80385CC0 00382C20 83 ED 9F 9C */ lwz r31, lbl_805A8B5C@sda21(r13) +/* 80385CC0 00382C20 83 ED 9F 9C */ lwz r31, ResettingChan@sda21(r13) /* 80385CC4 00382C24 3C 00 80 00 */ lis r0, 0x8000 -/* 80385CC8 00382C28 80 6D AD 74 */ lwz r3, lbl_805A9934@sda21(r13) +/* 80385CC8 00382C28 80 6D AD 74 */ lwz r3, EnabledBits@sda21(r13) /* 80385CCC 00382C2C 38 81 00 1C */ addi r4, r1, 0x1c /* 80385CD0 00382C30 7C 00 FC 30 */ srw r0, r0, r31 /* 80385CD4 00382C34 7C 60 03 78 */ or r0, r3, r0 -/* 80385CD8 00382C38 90 0D AD 74 */ stw r0, lbl_805A9934@sda21(r13) +/* 80385CD8 00382C38 90 0D AD 74 */ stw r0, EnabledBits@sda21(r13) /* 80385CDC 00382C3C 7F E3 FB 78 */ mr r3, r31 /* 80385CE0 00382C40 48 03 98 69 */ bl SIGetResponse -/* 80385CE4 00382C44 80 0D 9F A4 */ lwz r0, lbl_805A8B64@sda21(r13) +/* 80385CE4 00382C44 80 0D 9F A4 */ lwz r0, AnalogMode@sda21(r13) /* 80385CE8 00382C48 38 7F 00 00 */ addi r3, r31, 0 /* 80385CEC 00382C4C 64 04 00 40 */ oris r4, r0, 0x40 /* 80385CF0 00382C50 48 03 95 ED */ bl SISetCommand -/* 80385CF4 00382C54 80 6D AD 74 */ lwz r3, lbl_805A9934@sda21(r13) +/* 80385CF4 00382C54 80 6D AD 74 */ lwz r3, EnabledBits@sda21(r13) /* 80385CF8 00382C58 48 03 96 75 */ bl SIEnablePolling lbl_80385CFC: -/* 80385CFC 00382C5C 80 AD AD 78 */ lwz r5, lbl_805A9938@sda21(r13) +/* 80385CFC 00382C5C 80 AD AD 78 */ lwz r5, ResettingBits@sda21(r13) /* 80385D00 00382C60 7C A0 00 34 */ cntlzw r0, r5 -/* 80385D04 00382C64 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 80385D08 00382C68 80 8D 9F 9C */ lwz r4, lbl_805A8B5C@sda21(r13) +/* 80385D04 00382C64 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 80385D08 00382C68 80 8D 9F 9C */ lwz r4, ResettingChan@sda21(r13) /* 80385D0C 00382C6C 2C 04 00 20 */ cmpwi r4, 0x20 /* 80385D10 00382C70 41 82 00 40 */ beq lbl_80385D50 /* 80385D14 00382C74 3C 00 80 00 */ lis r0, 0x8000 /* 80385D18 00382C78 7C 00 24 30 */ srw r0, r0, r4 /* 80385D1C 00382C7C 7C A0 00 78 */ andc r0, r5, r0 /* 80385D20 00382C80 1C 84 00 0C */ mulli r4, r4, 0xc -/* 80385D24 00382C84 90 0D AD 78 */ stw r0, lbl_805A9938@sda21(r13) +/* 80385D24 00382C84 90 0D AD 78 */ stw r0, ResettingBits@sda21(r13) /* 80385D28 00382C88 3C 60 80 54 */ lis r3, lbl_80542000@ha /* 80385D2C 00382C8C 38 03 20 00 */ addi r0, r3, lbl_80542000@l /* 80385D30 00382C90 7C 60 22 14 */ add r3, r0, r4 @@ -241,7 +242,7 @@ lbl_80385CFC: /* 80385D38 00382C98 38 A0 00 0C */ li r5, 0xc /* 80385D3C 00382C9C 4B C7 D6 6D */ bl memset /* 80385D40 00382CA0 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 80385D44 00382CA4 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80385D44 00382CA4 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80385D48 00382CA8 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80385D4C 00382CAC 48 03 9F 15 */ bl SIGetTypeAsync lbl_80385D50: @@ -263,7 +264,7 @@ sub_80385d64: /* 80385D80 00382CE0 93 A1 00 1C */ stw r29, 0x1c(r1) /* 80385D84 00382CE4 7C 7D 1B 78 */ mr r29, r3 /* 80385D88 00382CE8 7C 1E EC 30 */ srw r30, r0, r29 -/* 80385D8C 00382CEC 80 6D AD 74 */ lwz r3, lbl_805A9934@sda21(r13) +/* 80385D8C 00382CEC 80 6D AD 74 */ lwz r3, EnabledBits@sda21(r13) /* 80385D90 00382CF0 7C 60 F0 39 */ and. r0, r3, r30 /* 80385D94 00382CF4 41 82 00 74 */ beq lbl_80385E08 /* 80385D98 00382CF8 57 E0 07 3F */ clrlwi. r0, r31, 0x1c @@ -277,21 +278,21 @@ lbl_80385DA8: /* 80385DB4 00382D14 3B E3 00 00 */ addi r31, r3, 0 /* 80385DB8 00382D18 38 7E 00 00 */ addi r3, r30, 0 /* 80385DBC 00382D1C 48 03 96 4D */ bl SIDisablePolling -/* 80385DC0 00382D20 80 CD AD 74 */ lwz r6, lbl_805A9934@sda21(r13) +/* 80385DC0 00382D20 80 CD AD 74 */ lwz r6, EnabledBits@sda21(r13) /* 80385DC4 00382D24 7F C8 F0 F8 */ nor r8, r30, r30 -/* 80385DC8 00382D28 80 AD AD 80 */ lwz r5, lbl_805A9940@sda21(r13) +/* 80385DC8 00382D28 80 AD AD 80 */ lwz r5, WaitingBits@sda21(r13) /* 80385DCC 00382D2C 7F A3 EB 78 */ mr r3, r29 -/* 80385DD0 00382D30 80 8D AD 84 */ lwz r4, lbl_805A9944@sda21(r13) -/* 80385DD4 00382D34 80 0D AD 88 */ lwz r0, lbl_805A9948@sda21(r13) +/* 80385DD0 00382D30 80 8D AD 84 */ lwz r4, CheckingBits@sda21(r13) +/* 80385DD4 00382D34 80 0D AD 88 */ lwz r0, PendingBits@sda21(r13) /* 80385DD8 00382D38 7C C7 40 38 */ and r7, r6, r8 /* 80385DDC 00382D3C 7C A6 40 38 */ and r6, r5, r8 -/* 80385DE0 00382D40 90 ED AD 74 */ stw r7, lbl_805A9934@sda21(r13) +/* 80385DE0 00382D40 90 ED AD 74 */ stw r7, EnabledBits@sda21(r13) /* 80385DE4 00382D44 7C 85 40 38 */ and r5, r4, r8 /* 80385DE8 00382D48 7C 00 40 38 */ and r0, r0, r8 -/* 80385DEC 00382D4C 90 CD AD 80 */ stw r6, lbl_805A9940@sda21(r13) +/* 80385DEC 00382D4C 90 CD AD 80 */ stw r6, WaitingBits@sda21(r13) /* 80385DF0 00382D50 38 80 00 00 */ li r4, 0 -/* 80385DF4 00382D54 90 AD AD 84 */ stw r5, lbl_805A9944@sda21(r13) -/* 80385DF8 00382D58 90 0D AD 88 */ stw r0, lbl_805A9948@sda21(r13) +/* 80385DF4 00382D54 90 AD AD 84 */ stw r5, CheckingBits@sda21(r13) +/* 80385DF8 00382D58 90 0D AD 88 */ stw r0, PendingBits@sda21(r13) /* 80385DFC 00382D5C 4B FF E5 3D */ bl OSSetWirelessID /* 80385E00 00382D60 7F E3 FB 78 */ mr r3, r31 /* 80385E04 00382D64 4B FF B8 85 */ bl OSRestoreInterrupts @@ -313,38 +314,38 @@ PADProbeCallback: /* 80385E34 00382D94 93 E1 00 2C */ stw r31, 0x2c(r1) /* 80385E38 00382D98 93 C1 00 28 */ stw r30, 0x28(r1) /* 80385E3C 00382D9C 40 82 00 54 */ bne lbl_80385E90 -/* 80385E40 00382DA0 83 CD 9F 9C */ lwz r30, lbl_805A8B5C@sda21(r13) +/* 80385E40 00382DA0 83 CD 9F 9C */ lwz r30, ResettingChan@sda21(r13) /* 80385E44 00382DA4 3F E0 80 00 */ lis r31, 0x8000 -/* 80385E48 00382DA8 80 6D AD 74 */ lwz r3, lbl_805A9934@sda21(r13) +/* 80385E48 00382DA8 80 6D AD 74 */ lwz r3, EnabledBits@sda21(r13) /* 80385E4C 00382DAC 38 81 00 1C */ addi r4, r1, 0x1c /* 80385E50 00382DB0 7F E0 F4 30 */ srw r0, r31, r30 /* 80385E54 00382DB4 7C 60 03 78 */ or r0, r3, r0 -/* 80385E58 00382DB8 90 0D AD 74 */ stw r0, lbl_805A9934@sda21(r13) +/* 80385E58 00382DB8 90 0D AD 74 */ stw r0, EnabledBits@sda21(r13) /* 80385E5C 00382DBC 7F C3 F3 78 */ mr r3, r30 /* 80385E60 00382DC0 48 03 96 E9 */ bl SIGetResponse -/* 80385E64 00382DC4 80 0D 9F A4 */ lwz r0, lbl_805A8B64@sda21(r13) +/* 80385E64 00382DC4 80 0D 9F A4 */ lwz r0, AnalogMode@sda21(r13) /* 80385E68 00382DC8 38 7E 00 00 */ addi r3, r30, 0 /* 80385E6C 00382DCC 64 04 00 40 */ oris r4, r0, 0x40 /* 80385E70 00382DD0 48 03 94 6D */ bl SISetCommand -/* 80385E74 00382DD4 80 6D AD 74 */ lwz r3, lbl_805A9934@sda21(r13) +/* 80385E74 00382DD4 80 6D AD 74 */ lwz r3, EnabledBits@sda21(r13) /* 80385E78 00382DD8 48 03 94 F5 */ bl SIEnablePolling -/* 80385E7C 00382DDC 80 0D 9F 9C */ lwz r0, lbl_805A8B5C@sda21(r13) -/* 80385E80 00382DE0 80 6D AD 80 */ lwz r3, lbl_805A9940@sda21(r13) +/* 80385E7C 00382DDC 80 0D 9F 9C */ lwz r0, ResettingChan@sda21(r13) +/* 80385E80 00382DE0 80 6D AD 80 */ lwz r3, WaitingBits@sda21(r13) /* 80385E84 00382DE4 7F E0 04 30 */ srw r0, r31, r0 /* 80385E88 00382DE8 7C 60 03 78 */ or r0, r3, r0 -/* 80385E8C 00382DEC 90 0D AD 80 */ stw r0, lbl_805A9940@sda21(r13) +/* 80385E8C 00382DEC 90 0D AD 80 */ stw r0, WaitingBits@sda21(r13) lbl_80385E90: -/* 80385E90 00382DF0 80 AD AD 78 */ lwz r5, lbl_805A9938@sda21(r13) +/* 80385E90 00382DF0 80 AD AD 78 */ lwz r5, ResettingBits@sda21(r13) /* 80385E94 00382DF4 7C A0 00 34 */ cntlzw r0, r5 -/* 80385E98 00382DF8 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 80385E9C 00382DFC 80 8D 9F 9C */ lwz r4, lbl_805A8B5C@sda21(r13) +/* 80385E98 00382DF8 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 80385E9C 00382DFC 80 8D 9F 9C */ lwz r4, ResettingChan@sda21(r13) /* 80385EA0 00382E00 2C 04 00 20 */ cmpwi r4, 0x20 /* 80385EA4 00382E04 41 82 00 40 */ beq lbl_80385EE4 /* 80385EA8 00382E08 3C 00 80 00 */ lis r0, 0x8000 /* 80385EAC 00382E0C 7C 00 24 30 */ srw r0, r0, r4 /* 80385EB0 00382E10 7C A0 00 78 */ andc r0, r5, r0 /* 80385EB4 00382E14 1C 84 00 0C */ mulli r4, r4, 0xc -/* 80385EB8 00382E18 90 0D AD 78 */ stw r0, lbl_805A9938@sda21(r13) +/* 80385EB8 00382E18 90 0D AD 78 */ stw r0, ResettingBits@sda21(r13) /* 80385EBC 00382E1C 3C 60 80 54 */ lis r3, lbl_80542000@ha /* 80385EC0 00382E20 38 03 20 00 */ addi r0, r3, lbl_80542000@l /* 80385EC4 00382E24 7C 60 22 14 */ add r3, r0, r4 @@ -352,7 +353,7 @@ lbl_80385E90: /* 80385ECC 00382E2C 38 A0 00 0C */ li r5, 0xc /* 80385ED0 00382E30 4B C7 D4 D9 */ bl memset /* 80385ED4 00382E34 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 80385ED8 00382E38 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80385ED8 00382E38 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80385EDC 00382E3C 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80385EE0 00382E40 48 03 9D 81 */ bl SIGetTypeAsync lbl_80385EE4: @@ -376,31 +377,31 @@ PADTypeAndStatusCallback: /* 80385F1C 00382E7C 3B C6 1F F0 */ addi r30, r6, lbl_80541FF0@l /* 80385F20 00382E80 93 A1 00 34 */ stw r29, 0x34(r1) /* 80385F24 00382E84 93 81 00 30 */ stw r28, 0x30(r1) -/* 80385F28 00382E88 83 AD 9F 9C */ lwz r29, lbl_805A8B5C@sda21(r13) -/* 80385F2C 00382E8C 80 AD AD 7C */ lwz r5, lbl_805A993C@sda21(r13) +/* 80385F28 00382E88 83 AD 9F 9C */ lwz r29, ResettingChan@sda21(r13) +/* 80385F2C 00382E8C 80 AD AD 7C */ lwz r5, RecalibrateBits@sda21(r13) /* 80385F30 00382E90 7F FC EC 30 */ srw r28, r31, r29 /* 80385F34 00382E94 7C A3 E0 78 */ andc r3, r5, r28 -/* 80385F38 00382E98 90 6D AD 7C */ stw r3, lbl_805A993C@sda21(r13) +/* 80385F38 00382E98 90 6D AD 7C */ stw r3, RecalibrateBits@sda21(r13) /* 80385F3C 00382E9C 7C A5 E0 38 */ and r5, r5, r28 /* 80385F40 00382EA0 38 60 00 01 */ li r3, 1 /* 80385F44 00382EA4 41 82 00 54 */ beq lbl_80385F98 -/* 80385F48 00382EA8 80 8D AD 78 */ lwz r4, lbl_805A9938@sda21(r13) +/* 80385F48 00382EA8 80 8D AD 78 */ lwz r4, ResettingBits@sda21(r13) /* 80385F4C 00382EAC 7C 80 00 34 */ cntlzw r0, r4 -/* 80385F50 00382EB0 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 80385F54 00382EB4 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80385F50 00382EB0 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 80385F54 00382EB4 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80385F58 00382EB8 2C 03 00 20 */ cmpwi r3, 0x20 /* 80385F5C 00382EBC 41 82 02 AC */ beq lbl_80386208 /* 80385F60 00382EC0 1C 03 00 0C */ mulli r0, r3, 0xc /* 80385F64 00382EC4 7F E3 1C 30 */ srw r3, r31, r3 /* 80385F68 00382EC8 7C 84 18 78 */ andc r4, r4, r3 /* 80385F6C 00382ECC 7C 7E 02 14 */ add r3, r30, r0 -/* 80385F70 00382ED0 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 80385F70 00382ED0 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 80385F74 00382ED4 38 80 00 00 */ li r4, 0 /* 80385F78 00382ED8 38 A0 00 0C */ li r5, 0xc /* 80385F7C 00382EDC 38 63 00 10 */ addi r3, r3, 0x10 /* 80385F80 00382EE0 4B C7 D4 29 */ bl memset /* 80385F84 00382EE4 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 80385F88 00382EE8 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80385F88 00382EE8 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80385F8C 00382EEC 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80385F90 00382EF0 48 03 9C D1 */ bl SIGetTypeAsync /* 80385F94 00382EF4 48 00 02 74 */ b lbl_80386208 @@ -415,10 +416,10 @@ lbl_80385F98: /* 80385FB4 00382F14 54 C0 01 CF */ rlwinm. r0, r6, 0, 7, 7 /* 80385FB8 00382F18 40 82 00 58 */ bne lbl_80386010 lbl_80385FBC: -/* 80385FBC 00382F1C 80 AD AD 78 */ lwz r5, lbl_805A9938@sda21(r13) +/* 80385FBC 00382F1C 80 AD AD 78 */ lwz r5, ResettingBits@sda21(r13) /* 80385FC0 00382F20 7C A0 00 34 */ cntlzw r0, r5 -/* 80385FC4 00382F24 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 80385FC8 00382F28 80 8D 9F 9C */ lwz r4, lbl_805A8B5C@sda21(r13) +/* 80385FC4 00382F24 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 80385FC8 00382F28 80 8D 9F 9C */ lwz r4, ResettingChan@sda21(r13) /* 80385FCC 00382F2C 2C 04 00 20 */ cmpwi r4, 0x20 /* 80385FD0 00382F30 41 82 02 38 */ beq lbl_80386208 /* 80385FD4 00382F34 3C 60 80 00 */ lis r3, 0x8000 @@ -426,13 +427,13 @@ lbl_80385FBC: /* 80385FDC 00382F3C 7C 63 24 30 */ srw r3, r3, r4 /* 80385FE0 00382F40 7C A4 18 78 */ andc r4, r5, r3 /* 80385FE4 00382F44 7C 7E 02 14 */ add r3, r30, r0 -/* 80385FE8 00382F48 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 80385FE8 00382F48 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 80385FEC 00382F4C 38 80 00 00 */ li r4, 0 /* 80385FF0 00382F50 38 A0 00 0C */ li r5, 0xc /* 80385FF4 00382F54 38 63 00 10 */ addi r3, r3, 0x10 /* 80385FF8 00382F58 4B C7 D3 B1 */ bl memset /* 80385FFC 00382F5C 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 80386000 00382F60 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80386000 00382F60 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80386004 00382F64 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80386008 00382F68 48 03 9C 59 */ bl SIGetTypeAsync /* 8038600C 00382F6C 48 00 01 FC */ b lbl_80386208 @@ -440,35 +441,35 @@ lbl_80386010: /* 80386010 00382F70 80 0D 9F A8 */ lwz r0, lbl_805A8B68@sda21(r13) /* 80386014 00382F74 28 00 00 02 */ cmplwi r0, 2 /* 80386018 00382F78 40 80 00 84 */ bge lbl_8038609C -/* 8038601C 00382F7C 80 0D AD 74 */ lwz r0, lbl_805A9934@sda21(r13) +/* 8038601C 00382F7C 80 0D AD 74 */ lwz r0, EnabledBits@sda21(r13) /* 80386020 00382F80 38 7D 00 00 */ addi r3, r29, 0 /* 80386024 00382F84 38 81 00 1C */ addi r4, r1, 0x1c /* 80386028 00382F88 7C 00 E3 78 */ or r0, r0, r28 -/* 8038602C 00382F8C 90 0D AD 74 */ stw r0, lbl_805A9934@sda21(r13) +/* 8038602C 00382F8C 90 0D AD 74 */ stw r0, EnabledBits@sda21(r13) /* 80386030 00382F90 48 03 95 19 */ bl SIGetResponse -/* 80386034 00382F94 80 0D 9F A4 */ lwz r0, lbl_805A8B64@sda21(r13) +/* 80386034 00382F94 80 0D 9F A4 */ lwz r0, AnalogMode@sda21(r13) /* 80386038 00382F98 38 7D 00 00 */ addi r3, r29, 0 /* 8038603C 00382F9C 64 04 00 40 */ oris r4, r0, 0x40 /* 80386040 00382FA0 48 03 92 9D */ bl SISetCommand -/* 80386044 00382FA4 80 6D AD 74 */ lwz r3, lbl_805A9934@sda21(r13) +/* 80386044 00382FA4 80 6D AD 74 */ lwz r3, EnabledBits@sda21(r13) /* 80386048 00382FA8 48 03 93 25 */ bl SIEnablePolling -/* 8038604C 00382FAC 80 8D AD 78 */ lwz r4, lbl_805A9938@sda21(r13) +/* 8038604C 00382FAC 80 8D AD 78 */ lwz r4, ResettingBits@sda21(r13) /* 80386050 00382FB0 7C 80 00 34 */ cntlzw r0, r4 -/* 80386054 00382FB4 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 80386058 00382FB8 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80386054 00382FB4 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 80386058 00382FB8 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 8038605C 00382FBC 2C 03 00 20 */ cmpwi r3, 0x20 /* 80386060 00382FC0 41 82 01 A8 */ beq lbl_80386208 /* 80386064 00382FC4 1C 03 00 0C */ mulli r0, r3, 0xc /* 80386068 00382FC8 7F E3 1C 30 */ srw r3, r31, r3 /* 8038606C 00382FCC 7C 84 18 78 */ andc r4, r4, r3 /* 80386070 00382FD0 7C 7E 02 14 */ add r3, r30, r0 -/* 80386074 00382FD4 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 80386074 00382FD4 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 80386078 00382FD8 38 80 00 00 */ li r4, 0 /* 8038607C 00382FDC 38 A0 00 0C */ li r5, 0xc /* 80386080 00382FE0 38 63 00 10 */ addi r3, r3, 0x10 /* 80386084 00382FE4 4B C7 D3 25 */ bl memset /* 80386088 00382FE8 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 8038608C 00382FEC 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 8038608C 00382FEC 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80386090 00382FF0 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80386094 00382FF4 48 03 9B CD */ bl SIGetTypeAsync /* 80386098 00382FF8 48 00 01 70 */ b lbl_80386208 @@ -485,7 +486,7 @@ lbl_803860AC: /* 803860BC 0038301C 7C DE 02 14 */ add r6, r30, r0 /* 803860C0 00383020 39 03 5C A0 */ addi r8, r3, PADOriginCallback@l /* 803860C4 00383024 38 7D 00 00 */ addi r3, r29, 0 -/* 803860C8 00383028 38 8D 9F B4 */ addi r4, r13, lbl_805A8B74@sda21 +/* 803860C8 00383028 38 8D 9F B4 */ addi r4, r13, CmdCalibrate@sda21 /* 803860CC 0038302C 38 A0 00 03 */ li r5, 3 /* 803860D0 00383030 38 E0 00 0A */ li r7, 0xa /* 803860D4 00383034 39 40 00 00 */ li r10, 0 @@ -499,7 +500,7 @@ lbl_803860E8: /* 803860F0 00383050 7C DE 02 14 */ add r6, r30, r0 /* 803860F4 00383054 39 03 5C A0 */ addi r8, r3, PADOriginCallback@l /* 803860F8 00383058 38 7D 00 00 */ addi r3, r29, 0 -/* 803860FC 0038305C 38 8D 9F B0 */ addi r4, r13, lbl_805A8B70@sda21 +/* 803860FC 0038305C 38 8D 9F B0 */ addi r4, r13, CmdReadOrigin@sda21 /* 80386100 00383060 38 A0 00 01 */ li r5, 1 /* 80386104 00383064 38 E0 00 0A */ li r7, 0xa /* 80386108 00383068 39 40 00 00 */ li r10, 0 @@ -521,7 +522,7 @@ lbl_8038611C: /* 80386144 003830A4 7C DE 02 14 */ add r6, r30, r0 /* 80386148 003830A8 39 03 5C A0 */ addi r8, r3, PADOriginCallback@l /* 8038614C 003830AC 38 7D 00 00 */ addi r3, r29, 0 -/* 80386150 003830B0 38 8D 9F B0 */ addi r4, r13, lbl_805A8B70@sda21 +/* 80386150 003830B0 38 8D 9F B0 */ addi r4, r13, CmdReadOrigin@sda21 /* 80386154 003830B4 38 A0 00 01 */ li r5, 1 /* 80386158 003830B8 38 E0 00 0A */ li r7, 0xa /* 8038615C 003830BC 39 40 00 00 */ li r10, 0 @@ -546,13 +547,13 @@ lbl_80386170: lbl_803861A4: /* 803861A4 00383104 2C 03 00 00 */ cmpwi r3, 0 /* 803861A8 00383108 40 82 00 60 */ bne lbl_80386208 -/* 803861AC 0038310C 80 AD AD 78 */ lwz r5, lbl_805A9938@sda21(r13) -/* 803861B0 00383110 80 6D AD 88 */ lwz r3, lbl_805A9948@sda21(r13) +/* 803861AC 0038310C 80 AD AD 78 */ lwz r5, ResettingBits@sda21(r13) +/* 803861B0 00383110 80 6D AD 88 */ lwz r3, PendingBits@sda21(r13) /* 803861B4 00383114 7C A0 00 34 */ cntlzw r0, r5 -/* 803861B8 00383118 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) +/* 803861B8 00383118 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) /* 803861BC 0038311C 7C 60 E3 78 */ or r0, r3, r28 -/* 803861C0 00383120 80 8D 9F 9C */ lwz r4, lbl_805A8B5C@sda21(r13) -/* 803861C4 00383124 90 0D AD 88 */ stw r0, lbl_805A9948@sda21(r13) +/* 803861C0 00383120 80 8D 9F 9C */ lwz r4, ResettingChan@sda21(r13) +/* 803861C4 00383124 90 0D AD 88 */ stw r0, PendingBits@sda21(r13) /* 803861C8 00383128 2C 04 00 20 */ cmpwi r4, 0x20 /* 803861CC 0038312C 41 82 00 3C */ beq lbl_80386208 /* 803861D0 00383130 3C 60 80 00 */ lis r3, 0x8000 @@ -560,13 +561,13 @@ lbl_803861A4: /* 803861D8 00383138 7C 63 24 30 */ srw r3, r3, r4 /* 803861DC 0038313C 7C A4 18 78 */ andc r4, r5, r3 /* 803861E0 00383140 7C 7E 02 14 */ add r3, r30, r0 -/* 803861E4 00383144 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 803861E4 00383144 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 803861E8 00383148 38 80 00 00 */ li r4, 0 /* 803861EC 0038314C 38 A0 00 0C */ li r5, 0xc /* 803861F0 00383150 38 63 00 10 */ addi r3, r3, 0x10 /* 803861F4 00383154 4B C7 D1 B5 */ bl memset /* 803861F8 00383158 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 803861FC 0038315C 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 803861FC 0038315C 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80386200 00383160 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80386204 00383164 48 03 9A 5D */ bl SIGetTypeAsync lbl_80386208: @@ -590,17 +591,17 @@ sub_80386228: /* 80386240 003831A0 93 C1 00 18 */ stw r30, 0x18(r1) /* 80386244 003831A4 93 A1 00 14 */ stw r29, 0x14(r1) /* 80386248 003831A8 7C 7D FC 30 */ srw r29, r3, r31 -/* 8038624C 003831AC 80 0D AD 74 */ lwz r0, lbl_805A9934@sda21(r13) +/* 8038624C 003831AC 80 0D AD 74 */ lwz r0, EnabledBits@sda21(r13) /* 80386250 003831B0 7C 00 E8 39 */ and. r0, r0, r29 /* 80386254 003831B4 41 82 00 EC */ beq lbl_80386340 -/* 80386258 003831B8 80 AD AD 80 */ lwz r5, lbl_805A9940@sda21(r13) +/* 80386258 003831B8 80 AD AD 80 */ lwz r5, WaitingBits@sda21(r13) /* 8038625C 003831BC 7F A6 E8 F8 */ nor r6, r29, r29 -/* 80386260 003831C0 80 6D AD 84 */ lwz r3, lbl_805A9944@sda21(r13) +/* 80386260 003831C0 80 6D AD 84 */ lwz r3, CheckingBits@sda21(r13) /* 80386264 003831C4 54 80 07 3F */ clrlwi. r0, r4, 0x1c /* 80386268 003831C8 7C A5 30 38 */ and r5, r5, r6 /* 8038626C 003831CC 7C 63 30 38 */ and r3, r3, r6 -/* 80386270 003831D0 90 AD AD 80 */ stw r5, lbl_805A9940@sda21(r13) -/* 80386274 003831D4 90 6D AD 84 */ stw r3, lbl_805A9944@sda21(r13) +/* 80386270 003831D0 90 AD AD 80 */ stw r5, WaitingBits@sda21(r13) +/* 80386274 003831D4 90 6D AD 84 */ stw r3, CheckingBits@sda21(r13) /* 80386278 003831D8 54 83 00 2E */ rlwinm r3, r4, 0, 0, 0x17 /* 8038627C 003831DC 40 82 00 6C */ bne lbl_803862E8 /* 80386280 003831E0 54 60 00 01 */ rlwinm. r0, r3, 0, 0, 0 @@ -622,7 +623,7 @@ sub_80386228: /* 803862C0 00383220 7C C0 22 14 */ add r6, r0, r4 /* 803862C4 00383224 39 03 5D 64 */ addi r8, r3, sub_80385d64@l /* 803862C8 00383228 38 7F 00 00 */ addi r3, r31, 0 -/* 803862CC 0038322C 38 8D 9F B0 */ addi r4, r13, lbl_805A8B70@sda21 +/* 803862CC 0038322C 38 8D 9F B0 */ addi r4, r13, CmdReadOrigin@sda21 /* 803862D0 00383230 38 A0 00 01 */ li r5, 1 /* 803862D4 00383234 38 E0 00 0A */ li r7, 0xa /* 803862D8 00383238 39 40 00 00 */ li r10, 0 @@ -634,21 +635,21 @@ lbl_803862E8: /* 803862EC 0038324C 3B C3 00 00 */ addi r30, r3, 0 /* 803862F0 00383250 38 7D 00 00 */ addi r3, r29, 0 /* 803862F4 00383254 48 03 91 15 */ bl SIDisablePolling -/* 803862F8 00383258 80 CD AD 74 */ lwz r6, lbl_805A9934@sda21(r13) +/* 803862F8 00383258 80 CD AD 74 */ lwz r6, EnabledBits@sda21(r13) /* 803862FC 0038325C 7F A8 E8 F8 */ nor r8, r29, r29 -/* 80386300 00383260 80 AD AD 80 */ lwz r5, lbl_805A9940@sda21(r13) +/* 80386300 00383260 80 AD AD 80 */ lwz r5, WaitingBits@sda21(r13) /* 80386304 00383264 7F E3 FB 78 */ mr r3, r31 -/* 80386308 00383268 80 8D AD 84 */ lwz r4, lbl_805A9944@sda21(r13) -/* 8038630C 0038326C 80 0D AD 88 */ lwz r0, lbl_805A9948@sda21(r13) +/* 80386308 00383268 80 8D AD 84 */ lwz r4, CheckingBits@sda21(r13) +/* 8038630C 0038326C 80 0D AD 88 */ lwz r0, PendingBits@sda21(r13) /* 80386310 00383270 7C C7 40 38 */ and r7, r6, r8 /* 80386314 00383274 7C A6 40 38 */ and r6, r5, r8 -/* 80386318 00383278 90 ED AD 74 */ stw r7, lbl_805A9934@sda21(r13) +/* 80386318 00383278 90 ED AD 74 */ stw r7, EnabledBits@sda21(r13) /* 8038631C 0038327C 7C 85 40 38 */ and r5, r4, r8 /* 80386320 00383280 7C 00 40 38 */ and r0, r0, r8 -/* 80386324 00383284 90 CD AD 80 */ stw r6, lbl_805A9940@sda21(r13) +/* 80386324 00383284 90 CD AD 80 */ stw r6, WaitingBits@sda21(r13) /* 80386328 00383288 38 80 00 00 */ li r4, 0 -/* 8038632C 0038328C 90 AD AD 84 */ stw r5, lbl_805A9944@sda21(r13) -/* 80386330 00383290 90 0D AD 88 */ stw r0, lbl_805A9948@sda21(r13) +/* 8038632C 0038328C 90 AD AD 84 */ stw r5, CheckingBits@sda21(r13) +/* 80386330 00383290 90 0D AD 88 */ stw r0, PendingBits@sda21(r13) /* 80386334 00383294 4B FF E0 05 */ bl OSSetWirelessID /* 80386338 00383298 7F C3 F3 78 */ mr r3, r30 /* 8038633C 0038329C 4B FF B3 4D */ bl OSRestoreInterrupts @@ -670,45 +671,45 @@ PADReset: /* 8038636C 003832CC 93 C1 00 10 */ stw r30, 0x10(r1) /* 80386370 003832D0 7C 7E 1B 78 */ mr r30, r3 /* 80386374 003832D4 4B FF B2 ED */ bl OSDisableInterrupts -/* 80386378 003832D8 80 8D AD 88 */ lwz r4, lbl_805A9948@sda21(r13) +/* 80386378 003832D8 80 8D AD 88 */ lwz r4, PendingBits@sda21(r13) /* 8038637C 003832DC 38 E0 00 00 */ li r7, 0 -/* 80386380 003832E0 80 AD AD 80 */ lwz r5, lbl_805A9940@sda21(r13) +/* 80386380 003832E0 80 AD AD 80 */ lwz r5, WaitingBits@sda21(r13) /* 80386384 003832E4 3B E3 00 00 */ addi r31, r3, 0 -/* 80386388 003832E8 80 0D AD 84 */ lwz r0, lbl_805A9944@sda21(r13) +/* 80386388 003832E8 80 0D AD 84 */ lwz r0, CheckingBits@sda21(r13) /* 8038638C 003832EC 7F DE 23 78 */ or r30, r30, r4 -/* 80386390 003832F0 80 8D AD 78 */ lwz r4, lbl_805A9938@sda21(r13) +/* 80386390 003832F0 80 8D AD 78 */ lwz r4, ResettingBits@sda21(r13) /* 80386394 003832F4 7C A5 03 78 */ or r5, r5, r0 /* 80386398 003832F8 80 0D 9F A8 */ lwz r0, lbl_805A8B68@sda21(r13) /* 8038639C 003832FC 7F DE 28 78 */ andc r30, r30, r5 -/* 803863A0 00383300 80 AD AD 74 */ lwz r5, lbl_805A9934@sda21(r13) +/* 803863A0 00383300 80 AD AD 74 */ lwz r5, EnabledBits@sda21(r13) /* 803863A4 00383304 7C 86 F3 78 */ or r6, r4, r30 -/* 803863A8 00383308 90 ED AD 88 */ stw r7, lbl_805A9948@sda21(r13) +/* 803863A8 00383308 90 ED AD 88 */ stw r7, PendingBits@sda21(r13) /* 803863AC 0038330C 7C A4 F0 78 */ andc r4, r5, r30 -/* 803863B0 00383310 90 CD AD 78 */ stw r6, lbl_805A9938@sda21(r13) +/* 803863B0 00383310 90 CD AD 78 */ stw r6, ResettingBits@sda21(r13) /* 803863B4 00383314 28 00 00 04 */ cmplwi r0, 4 -/* 803863B8 00383318 80 0D AD 78 */ lwz r0, lbl_805A9938@sda21(r13) -/* 803863BC 0038331C 90 8D AD 74 */ stw r4, lbl_805A9934@sda21(r13) +/* 803863B8 00383318 80 0D AD 78 */ lwz r0, ResettingBits@sda21(r13) +/* 803863BC 0038331C 90 8D AD 74 */ stw r4, EnabledBits@sda21(r13) /* 803863C0 00383320 7C 03 28 38 */ and r3, r0, r5 /* 803863C4 00383324 40 82 00 10 */ bne lbl_803863D4 -/* 803863C8 00383328 80 0D AD 7C */ lwz r0, lbl_805A993C@sda21(r13) +/* 803863C8 00383328 80 0D AD 7C */ lwz r0, RecalibrateBits@sda21(r13) /* 803863CC 0038332C 7C 00 F3 78 */ or r0, r0, r30 -/* 803863D0 00383330 90 0D AD 7C */ stw r0, lbl_805A993C@sda21(r13) +/* 803863D0 00383330 90 0D AD 7C */ stw r0, RecalibrateBits@sda21(r13) lbl_803863D4: /* 803863D4 00383334 48 03 90 35 */ bl SIDisablePolling -/* 803863D8 00383338 80 0D 9F 9C */ lwz r0, lbl_805A8B5C@sda21(r13) +/* 803863D8 00383338 80 0D 9F 9C */ lwz r0, ResettingChan@sda21(r13) /* 803863DC 0038333C 2C 00 00 20 */ cmpwi r0, 0x20 /* 803863E0 00383340 40 82 00 58 */ bne lbl_80386438 -/* 803863E4 00383344 80 AD AD 78 */ lwz r5, lbl_805A9938@sda21(r13) +/* 803863E4 00383344 80 AD AD 78 */ lwz r5, ResettingBits@sda21(r13) /* 803863E8 00383348 7C A0 00 34 */ cntlzw r0, r5 -/* 803863EC 0038334C 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 803863F0 00383350 80 8D 9F 9C */ lwz r4, lbl_805A8B5C@sda21(r13) +/* 803863EC 0038334C 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 803863F0 00383350 80 8D 9F 9C */ lwz r4, ResettingChan@sda21(r13) /* 803863F4 00383354 2C 04 00 20 */ cmpwi r4, 0x20 /* 803863F8 00383358 41 82 00 40 */ beq lbl_80386438 /* 803863FC 0038335C 3C 00 80 00 */ lis r0, 0x8000 /* 80386400 00383360 7C 00 24 30 */ srw r0, r0, r4 /* 80386404 00383364 7C A0 00 78 */ andc r0, r5, r0 /* 80386408 00383368 1C 84 00 0C */ mulli r4, r4, 0xc -/* 8038640C 0038336C 90 0D AD 78 */ stw r0, lbl_805A9938@sda21(r13) +/* 8038640C 0038336C 90 0D AD 78 */ stw r0, ResettingBits@sda21(r13) /* 80386410 00383370 3C 60 80 54 */ lis r3, lbl_80542000@ha /* 80386414 00383374 38 03 20 00 */ addi r0, r3, lbl_80542000@l /* 80386418 00383378 7C 60 22 14 */ add r3, r0, r4 @@ -716,7 +717,7 @@ lbl_803863D4: /* 80386420 00383380 38 A0 00 0C */ li r5, 0xc /* 80386424 00383384 4B C7 CF 85 */ bl memset /* 80386428 00383388 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 8038642C 0038338C 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 8038642C 0038338C 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80386430 00383390 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80386434 00383394 48 03 98 2D */ bl SIGetTypeAsync lbl_80386438: @@ -739,46 +740,46 @@ PADRecalibrate: /* 8038646C 003833CC 93 C1 00 10 */ stw r30, 0x10(r1) /* 80386470 003833D0 7C 7E 1B 78 */ mr r30, r3 /* 80386474 003833D4 4B FF B1 ED */ bl OSDisableInterrupts -/* 80386478 003833D8 80 CD AD 88 */ lwz r6, lbl_805A9948@sda21(r13) +/* 80386478 003833D8 80 CD AD 88 */ lwz r6, PendingBits@sda21(r13) /* 8038647C 003833DC 38 E0 00 00 */ li r7, 0 -/* 80386480 003833E0 80 AD AD 80 */ lwz r5, lbl_805A9940@sda21(r13) +/* 80386480 003833E0 80 AD AD 80 */ lwz r5, WaitingBits@sda21(r13) /* 80386484 003833E4 3C 80 80 00 */ lis r4, 0x800030E3@ha -/* 80386488 003833E8 80 0D AD 84 */ lwz r0, lbl_805A9944@sda21(r13) +/* 80386488 003833E8 80 0D AD 84 */ lwz r0, CheckingBits@sda21(r13) /* 8038648C 003833EC 7F DE 33 78 */ or r30, r30, r6 -/* 80386490 003833F0 80 CD AD 78 */ lwz r6, lbl_805A9938@sda21(r13) +/* 80386490 003833F0 80 CD AD 78 */ lwz r6, ResettingBits@sda21(r13) /* 80386494 003833F4 7C A5 03 78 */ or r5, r5, r0 /* 80386498 003833F8 88 04 30 E3 */ lbz r0, 0x800030E3@l(r4) /* 8038649C 003833FC 7F DE 28 78 */ andc r30, r30, r5 -/* 803864A0 00383400 80 AD AD 74 */ lwz r5, lbl_805A9934@sda21(r13) +/* 803864A0 00383400 80 AD AD 74 */ lwz r5, EnabledBits@sda21(r13) /* 803864A4 00383404 7C C4 F3 78 */ or r4, r6, r30 -/* 803864A8 00383408 90 ED AD 88 */ stw r7, lbl_805A9948@sda21(r13) +/* 803864A8 00383408 90 ED AD 88 */ stw r7, PendingBits@sda21(r13) /* 803864AC 0038340C 54 00 06 73 */ rlwinm. r0, r0, 0, 0x19, 0x19 -/* 803864B0 00383410 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 803864B0 00383410 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 803864B4 00383414 7C A4 F0 78 */ andc r4, r5, r30 /* 803864B8 00383418 3B E3 00 00 */ addi r31, r3, 0 -/* 803864BC 0038341C 80 CD AD 78 */ lwz r6, lbl_805A9938@sda21(r13) -/* 803864C0 00383420 90 8D AD 74 */ stw r4, lbl_805A9934@sda21(r13) +/* 803864BC 0038341C 80 CD AD 78 */ lwz r6, ResettingBits@sda21(r13) +/* 803864C0 00383420 90 8D AD 74 */ stw r4, EnabledBits@sda21(r13) /* 803864C4 00383424 7C C3 28 38 */ and r3, r6, r5 /* 803864C8 00383428 40 82 00 10 */ bne lbl_803864D8 -/* 803864CC 0038342C 80 0D AD 7C */ lwz r0, lbl_805A993C@sda21(r13) +/* 803864CC 0038342C 80 0D AD 7C */ lwz r0, RecalibrateBits@sda21(r13) /* 803864D0 00383430 7C 00 F3 78 */ or r0, r0, r30 -/* 803864D4 00383434 90 0D AD 7C */ stw r0, lbl_805A993C@sda21(r13) +/* 803864D4 00383434 90 0D AD 7C */ stw r0, RecalibrateBits@sda21(r13) lbl_803864D8: /* 803864D8 00383438 48 03 8F 31 */ bl SIDisablePolling -/* 803864DC 0038343C 80 0D 9F 9C */ lwz r0, lbl_805A8B5C@sda21(r13) +/* 803864DC 0038343C 80 0D 9F 9C */ lwz r0, ResettingChan@sda21(r13) /* 803864E0 00383440 2C 00 00 20 */ cmpwi r0, 0x20 /* 803864E4 00383444 40 82 00 58 */ bne lbl_8038653C -/* 803864E8 00383448 80 AD AD 78 */ lwz r5, lbl_805A9938@sda21(r13) +/* 803864E8 00383448 80 AD AD 78 */ lwz r5, ResettingBits@sda21(r13) /* 803864EC 0038344C 7C A0 00 34 */ cntlzw r0, r5 -/* 803864F0 00383450 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 803864F4 00383454 80 8D 9F 9C */ lwz r4, lbl_805A8B5C@sda21(r13) +/* 803864F0 00383450 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 803864F4 00383454 80 8D 9F 9C */ lwz r4, ResettingChan@sda21(r13) /* 803864F8 00383458 2C 04 00 20 */ cmpwi r4, 0x20 /* 803864FC 0038345C 41 82 00 40 */ beq lbl_8038653C /* 80386500 00383460 3C 00 80 00 */ lis r0, 0x8000 /* 80386504 00383464 7C 00 24 30 */ srw r0, r0, r4 /* 80386508 00383468 7C A0 00 78 */ andc r0, r5, r0 /* 8038650C 0038346C 1C 84 00 0C */ mulli r4, r4, 0xc -/* 80386510 00383470 90 0D AD 78 */ stw r0, lbl_805A9938@sda21(r13) +/* 80386510 00383470 90 0D AD 78 */ stw r0, ResettingBits@sda21(r13) /* 80386514 00383474 3C 60 80 54 */ lis r3, lbl_80542000@ha /* 80386518 00383478 38 03 20 00 */ addi r0, r3, lbl_80542000@l /* 8038651C 0038347C 7C 60 22 14 */ add r3, r0, r4 @@ -786,7 +787,7 @@ lbl_803864D8: /* 80386524 00383484 38 A0 00 0C */ li r5, 0xc /* 80386528 00383488 4B C7 CE 81 */ bl memset /* 8038652C 0038348C 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 80386530 00383490 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80386530 00383490 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80386534 00383494 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80386538 00383498 48 03 97 29 */ bl SIGetTypeAsync lbl_8038653C: @@ -808,22 +809,22 @@ PADInit: /* 8038656C 003834CC 94 21 FF C8 */ stwu r1, -0x38(r1) /* 80386570 003834D0 BF 21 00 1C */ stmw r25, 0x1c(r1) /* 80386574 003834D4 3B E3 1F F0 */ addi r31, r3, lbl_80541FF0@l -/* 80386578 003834D8 80 0D AD 70 */ lwz r0, lbl_805A9930@sda21(r13) +/* 80386578 003834D8 80 0D AD 70 */ lwz r0, Initialized@sda21(r13) /* 8038657C 003834DC 2C 00 00 00 */ cmpwi r0, 0 /* 80386580 003834E0 41 82 00 0C */ beq lbl_8038658C /* 80386584 003834E4 38 60 00 01 */ li r3, 1 /* 80386588 003834E8 48 00 01 DC */ b lbl_80386764 lbl_8038658C: -/* 8038658C 003834EC 80 6D 9F 98 */ lwz r3, lbl_805A8B58@sda21(r13) +/* 8038658C 003834EC 80 6D 9F 98 */ lwz r3, __PADVersion@sda21(r13) /* 80386590 003834F0 4B FF 7A A9 */ bl OSRegisterVersion -/* 80386594 003834F4 80 6D AD 94 */ lwz r3, lbl_805A9954@sda21(r13) +/* 80386594 003834F4 80 6D AD 94 */ lwz r3, __PADSpec@sda21(r13) /* 80386598 003834F8 28 03 00 00 */ cmplwi r3, 0 /* 8038659C 003834FC 41 82 00 08 */ beq lbl_803865A4 /* 803865A0 00383500 48 00 06 E1 */ bl PADSetSpec lbl_803865A4: /* 803865A4 00383504 80 0D B0 18 */ lwz r0, lbl_805A9BD8@sda21(r13) /* 803865A8 00383508 38 60 00 01 */ li r3, 1 -/* 803865AC 0038350C 90 6D AD 70 */ stw r3, lbl_805A9930@sda21(r13) +/* 803865AC 0038350C 90 6D AD 70 */ stw r3, Initialized@sda21(r13) /* 803865B0 00383510 28 00 00 00 */ cmplwi r0, 0 /* 803865B4 00383514 41 82 00 8C */ beq lbl_80386640 /* 803865B8 00383518 4B FF ED F1 */ bl OSGetTime @@ -856,7 +857,7 @@ lbl_803865A4: /* 80386624 00383584 7C A0 E8 14 */ addc r5, r0, r29 /* 80386628 00383588 3C 00 F0 00 */ lis r0, 0xf000 /* 8038662C 0038358C 38 80 3F FF */ li r4, 0x3fff -/* 80386630 00383590 90 0D AD 7C */ stw r0, lbl_805A993C@sda21(r13) +/* 80386630 00383590 90 0D AD 7C */ stw r0, RecalibrateBits@sda21(r13) /* 80386634 00383594 7C A0 20 38 */ and r0, r5, r4 /* 80386638 00383598 3C 60 80 00 */ lis r3, 0x800030E0@ha /* 8038663C 0038359C B0 03 30 E0 */ sth r0, 0x800030E0@l(r3) @@ -884,38 +885,38 @@ lbl_80386640: /* 80386690 003835F0 4B FF C9 9D */ bl OSRegisterResetFunction /* 80386694 003835F4 3F 80 F0 00 */ lis r28, 0xf000 /* 80386698 003835F8 4B FF AF C9 */ bl OSDisableInterrupts -/* 8038669C 003835FC 80 8D AD 88 */ lwz r4, lbl_805A9948@sda21(r13) +/* 8038669C 003835FC 80 8D AD 88 */ lwz r4, PendingBits@sda21(r13) /* 803866A0 00383600 38 E0 00 00 */ li r7, 0 -/* 803866A4 00383604 80 AD AD 80 */ lwz r5, lbl_805A9940@sda21(r13) +/* 803866A4 00383604 80 AD AD 80 */ lwz r5, WaitingBits@sda21(r13) /* 803866A8 00383608 3B 63 00 00 */ addi r27, r3, 0 -/* 803866AC 0038360C 80 0D AD 84 */ lwz r0, lbl_805A9944@sda21(r13) +/* 803866AC 0038360C 80 0D AD 84 */ lwz r0, CheckingBits@sda21(r13) /* 803866B0 00383610 7F 9C 23 78 */ or r28, r28, r4 -/* 803866B4 00383614 80 8D AD 78 */ lwz r4, lbl_805A9938@sda21(r13) +/* 803866B4 00383614 80 8D AD 78 */ lwz r4, ResettingBits@sda21(r13) /* 803866B8 00383618 7C A5 03 78 */ or r5, r5, r0 /* 803866BC 0038361C 80 0D 9F A8 */ lwz r0, lbl_805A8B68@sda21(r13) /* 803866C0 00383620 7F 9C 28 78 */ andc r28, r28, r5 -/* 803866C4 00383624 80 AD AD 74 */ lwz r5, lbl_805A9934@sda21(r13) +/* 803866C4 00383624 80 AD AD 74 */ lwz r5, EnabledBits@sda21(r13) /* 803866C8 00383628 7C 86 E3 78 */ or r6, r4, r28 -/* 803866CC 0038362C 90 ED AD 88 */ stw r7, lbl_805A9948@sda21(r13) +/* 803866CC 0038362C 90 ED AD 88 */ stw r7, PendingBits@sda21(r13) /* 803866D0 00383630 7C A4 E0 78 */ andc r4, r5, r28 -/* 803866D4 00383634 90 CD AD 78 */ stw r6, lbl_805A9938@sda21(r13) +/* 803866D4 00383634 90 CD AD 78 */ stw r6, ResettingBits@sda21(r13) /* 803866D8 00383638 28 00 00 04 */ cmplwi r0, 4 -/* 803866DC 0038363C 80 0D AD 78 */ lwz r0, lbl_805A9938@sda21(r13) -/* 803866E0 00383640 90 8D AD 74 */ stw r4, lbl_805A9934@sda21(r13) +/* 803866DC 0038363C 80 0D AD 78 */ lwz r0, ResettingBits@sda21(r13) +/* 803866E0 00383640 90 8D AD 74 */ stw r4, EnabledBits@sda21(r13) /* 803866E4 00383644 7C 03 28 38 */ and r3, r0, r5 /* 803866E8 00383648 40 82 00 10 */ bne lbl_803866F8 -/* 803866EC 0038364C 80 0D AD 7C */ lwz r0, lbl_805A993C@sda21(r13) +/* 803866EC 0038364C 80 0D AD 7C */ lwz r0, RecalibrateBits@sda21(r13) /* 803866F0 00383650 7C 00 E3 78 */ or r0, r0, r28 -/* 803866F4 00383654 90 0D AD 7C */ stw r0, lbl_805A993C@sda21(r13) +/* 803866F4 00383654 90 0D AD 7C */ stw r0, RecalibrateBits@sda21(r13) lbl_803866F8: /* 803866F8 00383658 48 03 8D 11 */ bl SIDisablePolling -/* 803866FC 0038365C 80 0D 9F 9C */ lwz r0, lbl_805A8B5C@sda21(r13) +/* 803866FC 0038365C 80 0D 9F 9C */ lwz r0, ResettingChan@sda21(r13) /* 80386700 00383660 2C 00 00 20 */ cmpwi r0, 0x20 /* 80386704 00383664 40 82 00 54 */ bne lbl_80386758 -/* 80386708 00383668 80 AD AD 78 */ lwz r5, lbl_805A9938@sda21(r13) +/* 80386708 00383668 80 AD AD 78 */ lwz r5, ResettingBits@sda21(r13) /* 8038670C 0038366C 7C A0 00 34 */ cntlzw r0, r5 -/* 80386710 00383670 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 80386714 00383674 80 8D 9F 9C */ lwz r4, lbl_805A8B5C@sda21(r13) +/* 80386710 00383670 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 80386714 00383674 80 8D 9F 9C */ lwz r4, ResettingChan@sda21(r13) /* 80386718 00383678 2C 04 00 20 */ cmpwi r4, 0x20 /* 8038671C 0038367C 41 82 00 3C */ beq lbl_80386758 /* 80386720 00383680 3C 60 80 00 */ lis r3, 0x8000 @@ -923,13 +924,13 @@ lbl_803866F8: /* 80386728 00383688 7C 63 24 30 */ srw r3, r3, r4 /* 8038672C 0038368C 7C A4 18 78 */ andc r4, r5, r3 /* 80386730 00383690 7C 7F 02 14 */ add r3, r31, r0 -/* 80386734 00383694 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 80386734 00383694 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 80386738 00383698 38 80 00 00 */ li r4, 0 /* 8038673C 0038369C 38 A0 00 0C */ li r5, 0xc /* 80386740 003836A0 38 63 00 10 */ addi r3, r3, 0x10 /* 80386744 003836A4 4B C7 CC 65 */ bl memset /* 80386748 003836A8 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 8038674C 003836AC 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 8038674C 003836AC 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80386750 003836B0 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 80386754 003836B4 48 03 95 0D */ bl SIGetTypeAsync lbl_80386758: @@ -966,53 +967,53 @@ PADRead: /* 803867C0 00383720 3A 80 00 00 */ li r20, 0 /* 803867C4 00383724 3F 60 80 00 */ lis r27, 0x8000 lbl_803867C8: -/* 803867C8 00383728 80 0D AD 88 */ lwz r0, lbl_805A9948@sda21(r13) +/* 803867C8 00383728 80 0D AD 88 */ lwz r0, PendingBits@sda21(r13) /* 803867CC 0038372C 7F 77 AC 30 */ srw r23, r27, r21 /* 803867D0 00383730 7C 00 B8 39 */ and. r0, r0, r23 /* 803867D4 00383734 41 82 00 D8 */ beq lbl_803868AC /* 803867D8 00383738 4B FF AE 89 */ bl OSDisableInterrupts -/* 803867DC 0038373C 80 8D AD 80 */ lwz r4, lbl_805A9940@sda21(r13) +/* 803867DC 0038373C 80 8D AD 80 */ lwz r4, WaitingBits@sda21(r13) /* 803867E0 00383740 38 C0 00 00 */ li r6, 0 -/* 803867E4 00383744 80 0D AD 84 */ lwz r0, lbl_805A9944@sda21(r13) +/* 803867E4 00383744 80 0D AD 84 */ lwz r0, CheckingBits@sda21(r13) /* 803867E8 00383748 7C 79 1B 78 */ mr r25, r3 -/* 803867EC 0038374C 80 AD AD 88 */ lwz r5, lbl_805A9948@sda21(r13) +/* 803867EC 0038374C 80 AD AD 88 */ lwz r5, PendingBits@sda21(r13) /* 803867F0 00383750 7C 84 03 78 */ or r4, r4, r0 -/* 803867F4 00383754 80 0D AD 78 */ lwz r0, lbl_805A9938@sda21(r13) +/* 803867F4 00383754 80 0D AD 78 */ lwz r0, ResettingBits@sda21(r13) /* 803867F8 00383758 7C A7 20 78 */ andc r7, r5, r4 -/* 803867FC 0038375C 80 AD AD 74 */ lwz r5, lbl_805A9934@sda21(r13) +/* 803867FC 0038375C 80 AD AD 74 */ lwz r5, EnabledBits@sda21(r13) /* 80386800 00383760 7C 04 3B 78 */ or r4, r0, r7 /* 80386804 00383764 80 0D 9F A8 */ lwz r0, lbl_805A8B68@sda21(r13) -/* 80386808 00383768 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 80386808 00383768 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 8038680C 0038376C 7C A4 38 78 */ andc r4, r5, r7 /* 80386810 00383770 28 00 00 04 */ cmplwi r0, 4 -/* 80386814 00383774 80 0D AD 78 */ lwz r0, lbl_805A9938@sda21(r13) -/* 80386818 00383778 90 CD AD 88 */ stw r6, lbl_805A9948@sda21(r13) +/* 80386814 00383774 80 0D AD 78 */ lwz r0, ResettingBits@sda21(r13) +/* 80386818 00383778 90 CD AD 88 */ stw r6, PendingBits@sda21(r13) /* 8038681C 0038377C 7C 03 28 38 */ and r3, r0, r5 -/* 80386820 00383780 90 8D AD 74 */ stw r4, lbl_805A9934@sda21(r13) +/* 80386820 00383780 90 8D AD 74 */ stw r4, EnabledBits@sda21(r13) /* 80386824 00383784 40 82 00 10 */ bne lbl_80386834 -/* 80386828 00383788 80 0D AD 7C */ lwz r0, lbl_805A993C@sda21(r13) +/* 80386828 00383788 80 0D AD 7C */ lwz r0, RecalibrateBits@sda21(r13) /* 8038682C 0038378C 7C 00 3B 78 */ or r0, r0, r7 -/* 80386830 00383790 90 0D AD 7C */ stw r0, lbl_805A993C@sda21(r13) +/* 80386830 00383790 90 0D AD 7C */ stw r0, RecalibrateBits@sda21(r13) lbl_80386834: /* 80386834 00383794 48 03 8B D5 */ bl SIDisablePolling -/* 80386838 00383798 80 0D 9F 9C */ lwz r0, lbl_805A8B5C@sda21(r13) +/* 80386838 00383798 80 0D 9F 9C */ lwz r0, ResettingChan@sda21(r13) /* 8038683C 0038379C 2C 00 00 20 */ cmpwi r0, 0x20 /* 80386840 003837A0 40 82 00 48 */ bne lbl_80386888 -/* 80386844 003837A4 80 8D AD 78 */ lwz r4, lbl_805A9938@sda21(r13) +/* 80386844 003837A4 80 8D AD 78 */ lwz r4, ResettingBits@sda21(r13) /* 80386848 003837A8 7C 80 00 34 */ cntlzw r0, r4 -/* 8038684C 003837AC 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 80386850 003837B0 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 8038684C 003837AC 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 80386850 003837B0 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80386854 003837B4 2C 03 00 20 */ cmpwi r3, 0x20 /* 80386858 003837B8 41 82 00 30 */ beq lbl_80386888 /* 8038685C 003837BC 1C 03 00 0C */ mulli r0, r3, 0xc /* 80386860 003837C0 7F 63 1C 30 */ srw r3, r27, r3 /* 80386864 003837C4 7C 84 18 78 */ andc r4, r4, r3 -/* 80386868 003837C8 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 80386868 003837C8 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 8038686C 003837CC 7C 7A 02 14 */ add r3, r26, r0 /* 80386870 003837D0 38 80 00 00 */ li r4, 0 /* 80386874 003837D4 38 A0 00 0C */ li r5, 0xc /* 80386878 003837D8 4B C7 CB 31 */ bl memset -/* 8038687C 003837DC 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 8038687C 003837DC 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80386880 003837E0 7F 84 E3 78 */ mr r4, r28 /* 80386884 003837E4 48 03 93 DD */ bl SIGetTypeAsync lbl_80386888: @@ -1026,10 +1027,10 @@ lbl_80386888: /* 803868A4 00383804 4B C7 CB 05 */ bl memset /* 803868A8 00383808 48 00 02 48 */ b lbl_80386AF0 lbl_803868AC: -/* 803868AC 0038380C 80 0D AD 78 */ lwz r0, lbl_805A9938@sda21(r13) +/* 803868AC 0038380C 80 0D AD 78 */ lwz r0, ResettingBits@sda21(r13) /* 803868B0 00383810 7C 00 B8 39 */ and. r0, r0, r23 /* 803868B4 00383814 40 82 00 10 */ bne lbl_803868C4 -/* 803868B8 00383818 80 0D 9F 9C */ lwz r0, lbl_805A8B5C@sda21(r13) +/* 803868B8 00383818 80 0D 9F 9C */ lwz r0, ResettingChan@sda21(r13) /* 803868BC 0038381C 7C 00 A8 00 */ cmpw r0, r21 /* 803868C0 00383820 40 82 00 20 */ bne lbl_803868E0 lbl_803868C4: @@ -1041,7 +1042,7 @@ lbl_803868C4: /* 803868D8 00383838 4B C7 CA D1 */ bl memset /* 803868DC 0038383C 48 00 02 14 */ b lbl_80386AF0 lbl_803868E0: -/* 803868E0 00383840 80 0D AD 74 */ lwz r0, lbl_805A9934@sda21(r13) +/* 803868E0 00383840 80 0D AD 74 */ lwz r0, EnabledBits@sda21(r13) /* 803868E4 00383844 7C 00 B8 39 */ and. r0, r0, r23 /* 803868E8 00383848 40 82 00 20 */ bne lbl_80386908 /* 803868EC 0038384C 38 00 FF FF */ li r0, -1 @@ -1071,7 +1072,7 @@ lbl_80386934: /* 80386944 003838A4 38 75 00 00 */ addi r3, r21, 0 /* 80386948 003838A8 38 81 00 14 */ addi r4, r1, 0x14 /* 8038694C 003838AC 48 03 8B FD */ bl SIGetResponse -/* 80386950 003838B0 80 0D AD 80 */ lwz r0, lbl_805A9940@sda21(r13) +/* 80386950 003838B0 80 0D AD 80 */ lwz r0, WaitingBits@sda21(r13) /* 80386954 003838B4 7C 00 B8 39 */ and. r0, r0, r23 /* 80386958 003838B8 41 82 00 40 */ beq lbl_80386998 /* 8038695C 003838BC 38 00 00 00 */ li r0, 0 @@ -1080,11 +1081,11 @@ lbl_80386934: /* 80386968 003838C8 38 80 00 00 */ li r4, 0 /* 8038696C 003838CC 38 A0 00 0A */ li r5, 0xa /* 80386970 003838D0 4B C7 CA 39 */ bl memset -/* 80386974 003838D4 80 6D AD 84 */ lwz r3, lbl_805A9944@sda21(r13) +/* 80386974 003838D4 80 6D AD 84 */ lwz r3, CheckingBits@sda21(r13) /* 80386978 003838D8 7C 60 B8 39 */ and. r0, r3, r23 /* 8038697C 003838DC 40 82 01 74 */ bne lbl_80386AF0 /* 80386980 003838E0 7C 60 BB 78 */ or r0, r3, r23 -/* 80386984 003838E4 90 0D AD 84 */ stw r0, lbl_805A9944@sda21(r13) +/* 80386984 003838E4 90 0D AD 84 */ stw r0, CheckingBits@sda21(r13) /* 80386988 003838E8 38 75 00 00 */ addi r3, r21, 0 /* 8038698C 003838EC 38 9D 00 00 */ addi r4, r29, 0 /* 80386990 003838F0 48 03 92 D1 */ bl SIGetTypeAsync @@ -1094,21 +1095,21 @@ lbl_80386998: /* 8038699C 003838FC 3B 23 00 00 */ addi r25, r3, 0 /* 803869A0 00383900 38 77 00 00 */ addi r3, r23, 0 /* 803869A4 00383904 48 03 8A 65 */ bl SIDisablePolling -/* 803869A8 00383908 80 CD AD 74 */ lwz r6, lbl_805A9934@sda21(r13) +/* 803869A8 00383908 80 CD AD 74 */ lwz r6, EnabledBits@sda21(r13) /* 803869AC 0038390C 7E E8 B8 F8 */ nor r8, r23, r23 -/* 803869B0 00383910 80 AD AD 80 */ lwz r5, lbl_805A9940@sda21(r13) +/* 803869B0 00383910 80 AD AD 80 */ lwz r5, WaitingBits@sda21(r13) /* 803869B4 00383914 7E A3 AB 78 */ mr r3, r21 -/* 803869B8 00383918 80 8D AD 84 */ lwz r4, lbl_805A9944@sda21(r13) -/* 803869BC 0038391C 80 0D AD 88 */ lwz r0, lbl_805A9948@sda21(r13) +/* 803869B8 00383918 80 8D AD 84 */ lwz r4, CheckingBits@sda21(r13) +/* 803869BC 0038391C 80 0D AD 88 */ lwz r0, PendingBits@sda21(r13) /* 803869C0 00383920 7C C7 40 38 */ and r7, r6, r8 /* 803869C4 00383924 7C A6 40 38 */ and r6, r5, r8 -/* 803869C8 00383928 90 ED AD 74 */ stw r7, lbl_805A9934@sda21(r13) +/* 803869C8 00383928 90 ED AD 74 */ stw r7, EnabledBits@sda21(r13) /* 803869CC 0038392C 7C 85 40 38 */ and r5, r4, r8 /* 803869D0 00383930 7C 00 40 38 */ and r0, r0, r8 -/* 803869D4 00383934 90 CD AD 80 */ stw r6, lbl_805A9940@sda21(r13) +/* 803869D4 00383934 90 CD AD 80 */ stw r6, WaitingBits@sda21(r13) /* 803869D8 00383938 38 80 00 00 */ li r4, 0 -/* 803869DC 0038393C 90 AD AD 84 */ stw r5, lbl_805A9944@sda21(r13) -/* 803869E0 00383940 90 0D AD 88 */ stw r0, lbl_805A9948@sda21(r13) +/* 803869DC 0038393C 90 AD AD 84 */ stw r5, CheckingBits@sda21(r13) +/* 803869E0 00383940 90 0D AD 88 */ stw r0, PendingBits@sda21(r13) /* 803869E4 00383944 4B FF D9 55 */ bl OSSetWirelessID /* 803869E8 00383948 7F 23 CB 78 */ mr r3, r25 /* 803869EC 0038394C 4B FF AC 9D */ bl OSRestoreInterrupts @@ -1150,7 +1151,7 @@ lbl_80386A50: /* 80386A70 003839D0 4B C7 C9 39 */ bl memset /* 80386A74 003839D4 48 00 00 7C */ b lbl_80386AF0 lbl_80386A78: -/* 80386A78 003839D8 81 8D 9F AC */ lwz r12, lbl_805A8B6C@sda21(r13) +/* 80386A78 003839D8 81 8D 9F AC */ lwz r12, MakeStatus@sda21(r13) /* 80386A7C 003839DC 38 75 00 00 */ addi r3, r21, 0 /* 80386A80 003839E0 38 9F 00 00 */ addi r4, r31, 0 /* 80386A84 003839E4 7D 88 03 A6 */ mtlr r12 @@ -1168,7 +1169,7 @@ lbl_80386A78: /* 80386AB4 00383A14 38 75 00 00 */ addi r3, r21, 0 /* 80386AB8 00383A18 38 D8 00 00 */ addi r6, r24, 0 /* 80386ABC 00383A1C 39 1E 00 00 */ addi r8, r30, 0 -/* 80386AC0 00383A20 38 8D 9F B0 */ addi r4, r13, lbl_805A8B70@sda21 +/* 80386AC0 00383A20 38 8D 9F B0 */ addi r4, r13, CmdReadOrigin@sda21 /* 80386AC4 00383A24 38 A0 00 01 */ li r5, 1 /* 80386AC8 00383A28 38 E0 00 0A */ li r7, 0xa /* 80386ACC 00383A2C 39 40 00 00 */ li r10, 0 @@ -1209,7 +1210,7 @@ PADControlAllMotors: /* 80386B44 00383AA4 3B A0 00 00 */ li r29, 0 /* 80386B48 00383AA8 3F E0 80 00 */ lis r31, 0x8000 lbl_80386B4C: -/* 80386B4C 00383AAC 80 6D AD 74 */ lwz r3, lbl_805A9934@sda21(r13) +/* 80386B4C 00383AAC 80 6D AD 74 */ lwz r3, EnabledBits@sda21(r13) /* 80386B50 00383AB0 7F E0 EC 30 */ srw r0, r31, r29 /* 80386B54 00383AB4 7C 60 00 39 */ and. r0, r3, r0 /* 80386B58 00383AB8 41 82 00 4C */ beq lbl_80386BA4 @@ -1225,7 +1226,7 @@ lbl_80386B4C: /* 80386B80 00383AE0 40 82 00 08 */ bne lbl_80386B88 /* 80386B84 00383AE4 38 60 00 00 */ li r3, 0 lbl_80386B88: -/* 80386B88 00383AE8 80 8D 9F A4 */ lwz r4, lbl_805A8B64@sda21(r13) +/* 80386B88 00383AE8 80 8D 9F A4 */ lwz r4, AnalogMode@sda21(r13) /* 80386B8C 00383AEC 54 60 07 BE */ clrlwi r0, r3, 0x1e /* 80386B90 00383AF0 38 7D 00 00 */ addi r3, r29, 0 /* 80386B94 00383AF4 64 84 00 40 */ oris r4, r4, 0x40 @@ -1249,8 +1250,8 @@ lbl_80386BC0: /* 80386BD4 00383B34 7C 08 03 A6 */ mtlr r0 /* 80386BD8 00383B38 4E 80 00 20 */ blr -.global sub_80386bdc -sub_80386bdc: +.global PADControlMotor +PADControlMotor: /* 80386BDC 00383B3C 7C 08 02 A6 */ mflr r0 /* 80386BE0 00383B40 90 01 00 04 */ stw r0, 4(r1) /* 80386BE4 00383B44 94 21 FF D8 */ stwu r1, -0x28(r1) @@ -1261,7 +1262,7 @@ sub_80386bdc: /* 80386BF8 00383B58 3B A3 00 00 */ addi r29, r3, 0 /* 80386BFC 00383B5C 4B FF AA 65 */ bl OSDisableInterrupts /* 80386C00 00383B60 3C 00 80 00 */ lis r0, 0x8000 -/* 80386C04 00383B64 80 8D AD 74 */ lwz r4, lbl_805A9934@sda21(r13) +/* 80386C04 00383B64 80 8D AD 74 */ lwz r4, EnabledBits@sda21(r13) /* 80386C08 00383B68 7C 00 EC 30 */ srw r0, r0, r29 /* 80386C0C 00383B6C 7C 80 00 39 */ and. r0, r4, r0 /* 80386C10 00383B70 3B E3 00 00 */ addi r31, r3, 0 @@ -1277,7 +1278,7 @@ sub_80386bdc: /* 80386C38 00383B98 40 82 00 08 */ bne lbl_80386C40 /* 80386C3C 00383B9C 3B C0 00 00 */ li r30, 0 lbl_80386C40: -/* 80386C40 00383BA0 80 8D 9F A4 */ lwz r4, lbl_805A8B64@sda21(r13) +/* 80386C40 00383BA0 80 8D 9F A4 */ lwz r4, AnalogMode@sda21(r13) /* 80386C44 00383BA4 57 C0 07 BE */ clrlwi r0, r30, 0x1e /* 80386C48 00383BA8 38 7D 00 00 */ addi r3, r29, 0 /* 80386C4C 00383BAC 64 84 00 40 */ oris r4, r4, 0x40 @@ -1299,7 +1300,7 @@ lbl_80386C5C: PADSetSpec: /* 80386C80 00383BE0 38 00 00 00 */ li r0, 0 /* 80386C84 00383BE4 2C 03 00 01 */ cmpwi r3, 1 -/* 80386C88 00383BE8 90 0D AD 94 */ stw r0, lbl_805A9954@sda21(r13) +/* 80386C88 00383BE8 90 0D AD 94 */ stw r0, __PADSpec@sda21(r13) /* 80386C8C 00383BEC 41 82 00 30 */ beq lbl_80386CBC /* 80386C90 00383BF0 40 80 00 10 */ bge lbl_80386CA0 /* 80386C94 00383BF4 2C 03 00 00 */ cmpwi r3, 0 @@ -1310,25 +1311,25 @@ lbl_80386CA0: /* 80386CA4 00383C04 40 80 00 34 */ bge lbl_80386CD8 /* 80386CA8 00383C08 48 00 00 24 */ b lbl_80386CCC lbl_80386CAC: -/* 80386CAC 00383C0C 3C 80 80 38 */ lis r4, sub_80386ce0@ha -/* 80386CB0 00383C10 38 04 6C E0 */ addi r0, r4, sub_80386ce0@l -/* 80386CB4 00383C14 90 0D 9F AC */ stw r0, lbl_805A8B6C@sda21(r13) +/* 80386CAC 00383C0C 3C 80 80 38 */ lis r4, SPEC0_MakeStatus@ha +/* 80386CB0 00383C10 38 04 6C E0 */ addi r0, r4, SPEC0_MakeStatus@l +/* 80386CB4 00383C14 90 0D 9F AC */ stw r0, MakeStatus@sda21(r13) /* 80386CB8 00383C18 48 00 00 20 */ b lbl_80386CD8 lbl_80386CBC: -/* 80386CBC 00383C1C 3C 80 80 38 */ lis r4, SPEC0_MakeStatus@ha -/* 80386CC0 00383C20 38 04 6E 54 */ addi r0, r4, SPEC0_MakeStatus@l -/* 80386CC4 00383C24 90 0D 9F AC */ stw r0, lbl_805A8B6C@sda21(r13) +/* 80386CBC 00383C1C 3C 80 80 38 */ lis r4, SPEC1_MakeStatus@ha +/* 80386CC0 00383C20 38 04 6E 54 */ addi r0, r4, SPEC1_MakeStatus@l +/* 80386CC4 00383C24 90 0D 9F AC */ stw r0, MakeStatus@sda21(r13) /* 80386CC8 00383C28 48 00 00 10 */ b lbl_80386CD8 lbl_80386CCC: -/* 80386CCC 00383C2C 3C 80 80 38 */ lis r4, sub_80386fc8@ha -/* 80386CD0 00383C30 38 04 6F C8 */ addi r0, r4, sub_80386fc8@l -/* 80386CD4 00383C34 90 0D 9F AC */ stw r0, lbl_805A8B6C@sda21(r13) +/* 80386CCC 00383C2C 3C 80 80 38 */ lis r4, SPEC2_MakeStatus@ha +/* 80386CD0 00383C30 38 04 6F C8 */ addi r0, r4, SPEC2_MakeStatus@l +/* 80386CD4 00383C34 90 0D 9F AC */ stw r0, MakeStatus@sda21(r13) lbl_80386CD8: /* 80386CD8 00383C38 90 6D 9F A8 */ stw r3, lbl_805A8B68@sda21(r13) /* 80386CDC 00383C3C 4E 80 00 20 */ blr -.global sub_80386ce0 -sub_80386ce0: +.global SPEC0_MakeStatus +SPEC0_MakeStatus: /* 80386CE0 00383C40 38 60 00 00 */ li r3, 0 /* 80386CE4 00383C44 B0 64 00 00 */ sth r3, 0(r4) /* 80386CE8 00383C48 80 05 00 00 */ lwz r0, 0(r5) @@ -1434,8 +1435,8 @@ lbl_80386E20: /* 80386E4C 00383DAC 98 04 00 05 */ stb r0, 5(r4) /* 80386E50 00383DB0 4E 80 00 20 */ blr -.global SPEC0_MakeStatus -SPEC0_MakeStatus: +.global SPEC1_MakeStatus +SPEC1_MakeStatus: /* 80386E54 00383DB4 38 60 00 00 */ li r3, 0 /* 80386E58 00383DB8 B0 64 00 00 */ sth r3, 0(r4) /* 80386E5C 00383DBC 80 05 00 00 */ lwz r0, 0(r5) @@ -1541,8 +1542,8 @@ lbl_80386F94: /* 80386FC0 00383F20 98 04 00 05 */ stb r0, 5(r4) /* 80386FC4 00383F24 4E 80 00 20 */ blr -.global sub_80386fc8 -sub_80386fc8: +.global SPEC2_MakeStatus +SPEC2_MakeStatus: /* 80386FC8 00383F28 80 05 00 00 */ lwz r0, 0(r5) /* 80386FCC 00383F2C 54 00 84 BE */ rlwinm r0, r0, 0x10, 0x12, 0x1f /* 80386FD0 00383F30 B0 04 00 00 */ sth r0, 0(r4) @@ -1553,7 +1554,7 @@ sub_80386fc8: /* 80386FE4 00383F44 80 05 00 00 */ lwz r0, 0(r5) /* 80386FE8 00383F48 7C 00 07 74 */ extsb r0, r0 /* 80386FEC 00383F4C 98 04 00 03 */ stb r0, 3(r4) -/* 80386FF0 00383F50 80 0D 9F A4 */ lwz r0, lbl_805A8B64@sda21(r13) +/* 80386FF0 00383F50 80 0D 9F A4 */ lwz r0, AnalogMode@sda21(r13) /* 80386FF4 00383F54 54 00 05 6E */ rlwinm r0, r0, 0, 0x15, 0x17 /* 80386FF8 00383F58 2C 00 04 00 */ cmpwi r0, 0x400 /* 80386FFC 00383F5C 41 82 01 98 */ beq lbl_80387194 @@ -1824,7 +1825,7 @@ OnReset: /* 803873CC 0038432C 93 E1 00 24 */ stw r31, 0x24(r1) /* 803873D0 00384330 93 C1 00 20 */ stw r30, 0x20(r1) /* 803873D4 00384334 3B C3 00 00 */ addi r30, r3, 0 -/* 803873D8 00384338 80 0D AD 8C */ lwz r0, lbl_805A994C@sda21(r13) +/* 803873D8 00384338 80 0D AD 8C */ lwz r0, SamplingCallback@sda21(r13) /* 803873DC 0038433C 28 00 00 00 */ cmplwi r0, 0 /* 803873E0 00384340 41 82 00 0C */ beq lbl_803873EC /* 803873E4 00384344 38 60 00 00 */ li r3, 0 @@ -1832,12 +1833,12 @@ OnReset: lbl_803873EC: /* 803873EC 0038434C 2C 1E 00 00 */ cmpwi r30, 0 /* 803873F0 00384350 40 82 01 40 */ bne lbl_80387530 -/* 803873F4 00384354 80 0D AD 78 */ lwz r0, lbl_805A9938@sda21(r13) +/* 803873F4 00384354 80 0D AD 78 */ lwz r0, ResettingBits@sda21(r13) /* 803873F8 00384358 3B C0 00 00 */ li r30, 0 /* 803873FC 0038435C 38 7E 00 00 */ addi r3, r30, 0 /* 80387400 00384360 28 00 00 00 */ cmplwi r0, 0 /* 80387404 00384364 40 82 00 14 */ bne lbl_80387418 -/* 80387408 00384368 80 0D 9F 9C */ lwz r0, lbl_805A8B5C@sda21(r13) +/* 80387408 00384368 80 0D 9F 9C */ lwz r0, ResettingChan@sda21(r13) /* 8038740C 0038436C 2C 00 00 20 */ cmpwi r0, 0x20 /* 80387410 00384370 40 82 00 08 */ bne lbl_80387418 /* 80387414 00384374 38 60 00 01 */ li r3, 1 @@ -1849,53 +1850,53 @@ lbl_80387418: /* 80387428 00384388 40 82 00 08 */ bne lbl_80387430 /* 8038742C 0038438C 3B C0 00 01 */ li r30, 1 lbl_80387430: -/* 80387430 00384390 80 0D AD 90 */ lwz r0, lbl_805A9950@sda21(r13) +/* 80387430 00384390 80 0D AD 90 */ lwz r0, "recalibrated$216"@sda21(r13) /* 80387434 00384394 2C 00 00 00 */ cmpwi r0, 0 /* 80387438 00384398 40 82 00 F0 */ bne lbl_80387528 /* 8038743C 0038439C 2C 1E 00 00 */ cmpwi r30, 0 /* 80387440 003843A0 41 82 00 E8 */ beq lbl_80387528 /* 80387444 003843A4 3F C0 F0 00 */ lis r30, 0xf000 /* 80387448 003843A8 4B FF A2 19 */ bl OSDisableInterrupts -/* 8038744C 003843AC 80 CD AD 88 */ lwz r6, lbl_805A9948@sda21(r13) +/* 8038744C 003843AC 80 CD AD 88 */ lwz r6, PendingBits@sda21(r13) /* 80387450 003843B0 38 E0 00 00 */ li r7, 0 -/* 80387454 003843B4 80 AD AD 80 */ lwz r5, lbl_805A9940@sda21(r13) +/* 80387454 003843B4 80 AD AD 80 */ lwz r5, WaitingBits@sda21(r13) /* 80387458 003843B8 3C 80 80 00 */ lis r4, 0x800030E3@ha -/* 8038745C 003843BC 80 0D AD 84 */ lwz r0, lbl_805A9944@sda21(r13) +/* 8038745C 003843BC 80 0D AD 84 */ lwz r0, CheckingBits@sda21(r13) /* 80387460 003843C0 7F DE 33 78 */ or r30, r30, r6 -/* 80387464 003843C4 80 CD AD 78 */ lwz r6, lbl_805A9938@sda21(r13) +/* 80387464 003843C4 80 CD AD 78 */ lwz r6, ResettingBits@sda21(r13) /* 80387468 003843C8 7C A5 03 78 */ or r5, r5, r0 /* 8038746C 003843CC 88 04 30 E3 */ lbz r0, 0x800030E3@l(r4) /* 80387470 003843D0 7F DE 28 78 */ andc r30, r30, r5 -/* 80387474 003843D4 80 AD AD 74 */ lwz r5, lbl_805A9934@sda21(r13) +/* 80387474 003843D4 80 AD AD 74 */ lwz r5, EnabledBits@sda21(r13) /* 80387478 003843D8 7C C4 F3 78 */ or r4, r6, r30 -/* 8038747C 003843DC 90 ED AD 88 */ stw r7, lbl_805A9948@sda21(r13) +/* 8038747C 003843DC 90 ED AD 88 */ stw r7, PendingBits@sda21(r13) /* 80387480 003843E0 54 00 06 73 */ rlwinm. r0, r0, 0, 0x19, 0x19 -/* 80387484 003843E4 90 8D AD 78 */ stw r4, lbl_805A9938@sda21(r13) +/* 80387484 003843E4 90 8D AD 78 */ stw r4, ResettingBits@sda21(r13) /* 80387488 003843E8 7C A4 F0 78 */ andc r4, r5, r30 /* 8038748C 003843EC 3B E3 00 00 */ addi r31, r3, 0 -/* 80387490 003843F0 80 CD AD 78 */ lwz r6, lbl_805A9938@sda21(r13) -/* 80387494 003843F4 90 8D AD 74 */ stw r4, lbl_805A9934@sda21(r13) +/* 80387490 003843F0 80 CD AD 78 */ lwz r6, ResettingBits@sda21(r13) +/* 80387494 003843F4 90 8D AD 74 */ stw r4, EnabledBits@sda21(r13) /* 80387498 003843F8 7C C3 28 38 */ and r3, r6, r5 /* 8038749C 003843FC 40 82 00 10 */ bne lbl_803874AC -/* 803874A0 00384400 80 0D AD 7C */ lwz r0, lbl_805A993C@sda21(r13) +/* 803874A0 00384400 80 0D AD 7C */ lwz r0, RecalibrateBits@sda21(r13) /* 803874A4 00384404 7C 00 F3 78 */ or r0, r0, r30 -/* 803874A8 00384408 90 0D AD 7C */ stw r0, lbl_805A993C@sda21(r13) +/* 803874A8 00384408 90 0D AD 7C */ stw r0, RecalibrateBits@sda21(r13) lbl_803874AC: /* 803874AC 0038440C 48 03 7F 5D */ bl SIDisablePolling -/* 803874B0 00384410 80 0D 9F 9C */ lwz r0, lbl_805A8B5C@sda21(r13) +/* 803874B0 00384410 80 0D 9F 9C */ lwz r0, ResettingChan@sda21(r13) /* 803874B4 00384414 2C 00 00 20 */ cmpwi r0, 0x20 /* 803874B8 00384418 40 82 00 58 */ bne lbl_80387510 -/* 803874BC 0038441C 80 AD AD 78 */ lwz r5, lbl_805A9938@sda21(r13) +/* 803874BC 0038441C 80 AD AD 78 */ lwz r5, ResettingBits@sda21(r13) /* 803874C0 00384420 7C A0 00 34 */ cntlzw r0, r5 -/* 803874C4 00384424 90 0D 9F 9C */ stw r0, lbl_805A8B5C@sda21(r13) -/* 803874C8 00384428 80 8D 9F 9C */ lwz r4, lbl_805A8B5C@sda21(r13) +/* 803874C4 00384424 90 0D 9F 9C */ stw r0, ResettingChan@sda21(r13) +/* 803874C8 00384428 80 8D 9F 9C */ lwz r4, ResettingChan@sda21(r13) /* 803874CC 0038442C 2C 04 00 20 */ cmpwi r4, 0x20 /* 803874D0 00384430 41 82 00 40 */ beq lbl_80387510 /* 803874D4 00384434 3C 00 80 00 */ lis r0, 0x8000 /* 803874D8 00384438 7C 00 24 30 */ srw r0, r0, r4 /* 803874DC 0038443C 7C A0 00 78 */ andc r0, r5, r0 /* 803874E0 00384440 1C 84 00 0C */ mulli r4, r4, 0xc -/* 803874E4 00384444 90 0D AD 78 */ stw r0, lbl_805A9938@sda21(r13) +/* 803874E4 00384444 90 0D AD 78 */ stw r0, ResettingBits@sda21(r13) /* 803874E8 00384448 3C 60 80 54 */ lis r3, lbl_80542000@ha /* 803874EC 0038444C 38 03 20 00 */ addi r0, r3, lbl_80542000@l /* 803874F0 00384450 7C 60 22 14 */ add r3, r0, r4 @@ -1903,14 +1904,14 @@ lbl_803874AC: /* 803874F8 00384458 38 A0 00 0C */ li r5, 0xc /* 803874FC 0038445C 4B C7 BE AD */ bl memset /* 80387500 00384460 3C 80 80 38 */ lis r4, PADTypeAndStatusCallback@ha -/* 80387504 00384464 80 6D 9F 9C */ lwz r3, lbl_805A8B5C@sda21(r13) +/* 80387504 00384464 80 6D 9F 9C */ lwz r3, ResettingChan@sda21(r13) /* 80387508 00384468 38 84 5E FC */ addi r4, r4, PADTypeAndStatusCallback@l /* 8038750C 0038446C 48 03 87 55 */ bl SIGetTypeAsync lbl_80387510: /* 80387510 00384470 7F E3 FB 78 */ mr r3, r31 /* 80387514 00384474 4B FF A1 75 */ bl OSRestoreInterrupts /* 80387518 00384478 38 00 00 01 */ li r0, 1 -/* 8038751C 0038447C 90 0D AD 90 */ stw r0, lbl_805A9950@sda21(r13) +/* 8038751C 0038447C 90 0D AD 90 */ stw r0, "recalibrated$216"@sda21(r13) /* 80387520 00384480 38 60 00 00 */ li r3, 0 /* 80387524 00384484 48 00 00 18 */ b lbl_8038753C lbl_80387528: @@ -1918,7 +1919,7 @@ lbl_80387528: /* 8038752C 0038448C 48 00 00 10 */ b lbl_8038753C lbl_80387530: /* 80387530 00384490 38 00 00 00 */ li r0, 0 -/* 80387534 00384494 90 0D AD 90 */ stw r0, lbl_805A9950@sda21(r13) +/* 80387534 00384494 90 0D AD 90 */ stw r0, "recalibrated$216"@sda21(r13) /* 80387538 00384498 38 60 00 01 */ li r3, 1 lbl_8038753C: /* 8038753C 0038449C 80 01 00 2C */ lwz r0, 0x2c(r1) @@ -1935,14 +1936,14 @@ SamplingHandler: /* 8038755C 003844BC 94 21 FD 20 */ stwu r1, -0x2e0(r1) /* 80387560 003844C0 93 E1 02 DC */ stw r31, 0x2dc(r1) /* 80387564 003844C4 3B E4 00 00 */ addi r31, r4, 0 -/* 80387568 003844C8 80 0D AD 8C */ lwz r0, lbl_805A994C@sda21(r13) +/* 80387568 003844C8 80 0D AD 8C */ lwz r0, SamplingCallback@sda21(r13) /* 8038756C 003844CC 28 00 00 00 */ cmplwi r0, 0 /* 80387570 003844D0 41 82 00 30 */ beq lbl_803875A0 /* 80387574 003844D4 38 61 00 10 */ addi r3, r1, 0x10 /* 80387578 003844D8 4B FF 80 9D */ bl OSClearContext /* 8038757C 003844DC 38 61 00 10 */ addi r3, r1, 0x10 /* 80387580 003844E0 4B FF 7E 9D */ bl OSSetCurrentContext -/* 80387584 003844E4 81 8D AD 8C */ lwz r12, lbl_805A994C@sda21(r13) +/* 80387584 003844E4 81 8D AD 8C */ lwz r12, SamplingCallback@sda21(r13) /* 80387588 003844E8 7D 88 03 A6 */ mtlr r12 /* 8038758C 003844EC 4E 80 00 21 */ blrl /* 80387590 003844F0 38 61 00 10 */ addi r3, r1, 0x10 @@ -1963,8 +1964,8 @@ PADSetSamplingCallback: /* 803875BC 0038451C 90 01 00 04 */ stw r0, 4(r1) /* 803875C0 00384520 94 21 FF E8 */ stwu r1, -0x18(r1) /* 803875C4 00384524 93 E1 00 14 */ stw r31, 0x14(r1) -/* 803875C8 00384528 83 ED AD 8C */ lwz r31, lbl_805A994C@sda21(r13) -/* 803875CC 0038452C 90 6D AD 8C */ stw r3, lbl_805A994C@sda21(r13) +/* 803875C8 00384528 83 ED AD 8C */ lwz r31, SamplingCallback@sda21(r13) +/* 803875CC 0038452C 90 6D AD 8C */ stw r3, SamplingCallback@sda21(r13) /* 803875D0 00384530 41 82 00 14 */ beq lbl_803875E4 /* 803875D4 00384534 3C 60 80 38 */ lis r3, SamplingHandler@ha /* 803875D8 00384538 38 63 75 54 */ addi r3, r3, SamplingHandler@l diff --git a/asm/Kyoto/Basics/RAssertDolphin.s b/asm/Kyoto/Basics/RAssertDolphin.s index 9a7ee076..35c063e7 100644 --- a/asm/Kyoto/Basics/RAssertDolphin.s +++ b/asm/Kyoto/Basics/RAssertDolphin.s @@ -55,7 +55,7 @@ lbl_802D6868: /* 802D68D0 002D3830 38 C3 0D 1E */ addi r6, r3, 0xD1DD0D1E@l /* 802D68D4 002D3834 38 60 00 FF */ li r3, 0xff /* 802D68D8 002D3838 38 A0 00 00 */ li r5, 0 -/* 802D68DC 002D383C 48 00 00 7D */ bl sub_802d6958 +/* 802D68DC 002D383C 48 00 00 7D */ bl ErrorHandler /* 802D68E0 002D3840 80 01 03 54 */ lwz r0, 0x354(r1) /* 802D68E4 002D3844 83 E1 03 4C */ lwz r31, 0x34c(r1) /* 802D68E8 002D3848 83 C1 03 48 */ lwz r30, 0x348(r1) @@ -68,30 +68,30 @@ lbl_802D6868: SetErrorHandlers: /* 802D68FC 002D385C 94 21 FF F0 */ stwu r1, -0x10(r1) /* 802D6900 002D3860 7C 08 02 A6 */ mflr r0 -/* 802D6904 002D3864 3C 80 80 2D */ lis r4, sub_802d6958@ha +/* 802D6904 002D3864 3C 80 80 2D */ lis r4, ErrorHandler@ha /* 802D6908 002D3868 38 60 00 02 */ li r3, 2 /* 802D690C 002D386C 90 01 00 14 */ stw r0, 0x14(r1) -/* 802D6910 002D3870 38 84 69 58 */ addi r4, r4, sub_802d6958@l +/* 802D6910 002D3870 38 84 69 58 */ addi r4, r4, ErrorHandler@l /* 802D6914 002D3874 48 0A 92 45 */ bl OSSetErrorHandler -/* 802D6918 002D3878 3C 80 80 2D */ lis r4, sub_802d6958@ha +/* 802D6918 002D3878 3C 80 80 2D */ lis r4, ErrorHandler@ha /* 802D691C 002D387C 38 60 00 03 */ li r3, 3 -/* 802D6920 002D3880 38 84 69 58 */ addi r4, r4, sub_802d6958@l +/* 802D6920 002D3880 38 84 69 58 */ addi r4, r4, ErrorHandler@l /* 802D6924 002D3884 48 0A 92 35 */ bl OSSetErrorHandler -/* 802D6928 002D3888 3C 80 80 2D */ lis r4, sub_802d6958@ha +/* 802D6928 002D3888 3C 80 80 2D */ lis r4, ErrorHandler@ha /* 802D692C 002D388C 38 60 00 05 */ li r3, 5 -/* 802D6930 002D3890 38 84 69 58 */ addi r4, r4, sub_802d6958@l +/* 802D6930 002D3890 38 84 69 58 */ addi r4, r4, ErrorHandler@l /* 802D6934 002D3894 48 0A 92 25 */ bl OSSetErrorHandler -/* 802D6938 002D3898 3C 80 80 2D */ lis r4, sub_802d6958@ha +/* 802D6938 002D3898 3C 80 80 2D */ lis r4, ErrorHandler@ha /* 802D693C 002D389C 38 60 00 0F */ li r3, 0xf -/* 802D6940 002D38A0 38 84 69 58 */ addi r4, r4, sub_802d6958@l +/* 802D6940 002D38A0 38 84 69 58 */ addi r4, r4, ErrorHandler@l /* 802D6944 002D38A4 48 0A 92 15 */ bl OSSetErrorHandler /* 802D6948 002D38A8 80 01 00 14 */ lwz r0, 0x14(r1) /* 802D694C 002D38AC 7C 08 03 A6 */ mtlr r0 /* 802D6950 002D38B0 38 21 00 10 */ addi r1, r1, 0x10 /* 802D6954 002D38B4 4E 80 00 20 */ blr -.global sub_802d6958 -sub_802d6958: +.global ErrorHandler +ErrorHandler: /* 802D6958 002D38B8 94 21 FF 90 */ stwu r1, -0x70(r1) /* 802D695C 002D38BC 7C 08 02 A6 */ mflr r0 /* 802D6960 002D38C0 90 01 00 74 */ stw r0, 0x74(r1) @@ -118,7 +118,7 @@ lbl_802D699C: /* 802D69B0 002D3910 3A E0 00 00 */ li r23, 0 /* 802D69B4 002D3914 38 60 00 00 */ li r3, 0 /* 802D69B8 002D3918 38 80 00 00 */ li r4, 0 -/* 802D69BC 002D391C 48 0B 02 21 */ bl sub_80386bdc +/* 802D69BC 002D391C 48 0B 02 21 */ bl PADControlMotor /* 802D69C0 002D3920 38 60 00 01 */ li r3, 1 /* 802D69C4 002D3924 48 0B 28 E9 */ bl VISetBlack /* 802D69C8 002D3928 48 0B 27 49 */ bl VIFlush diff --git a/asm/MetroidPrime/main.s b/asm/MetroidPrime/main.s index a606fa28..af8cd37b 100644 --- a/asm/MetroidPrime/main.s +++ b/asm/MetroidPrime/main.s @@ -3957,7 +3957,7 @@ lbl_80005EC0: /* 80005F4C 00002EAC 48 37 8B 65 */ bl DCFlushRange /* 80005F50 00002EB0 80 6D A0 90 */ lwz r3, lbl_805A8C50@sda21(r13) /* 80005F54 00002EB4 38 83 00 80 */ addi r4, r3, 0x80 -/* 80005F58 00002EB8 48 37 D0 B5 */ bl sub_8038300c +/* 80005F58 00002EB8 48 37 D0 B5 */ bl OSSetSaveRegion /* 80005F5C 00002EBC 38 60 00 01 */ li r3, 1 /* 80005F60 00002EC0 48 38 33 4D */ bl VISetBlack /* 80005F64 00002EC4 48 38 31 AD */ bl VIFlush @@ -6677,10 +6677,10 @@ sub_80008584: /* 8000859C 000054FC 93 C1 00 18 */ stw r30, 0x18(r1) /* 800085A0 00005500 7C 7E 1B 78 */ mr r30, r3 /* 800085A4 00005504 38 6D A0 94 */ addi r3, r13, lbl_805A8C54@sda21 -/* 800085A8 00005508 48 37 AA 71 */ bl sub_80383018 +/* 800085A8 00005508 48 37 AA 71 */ bl OSGetSaveRegion /* 800085AC 0000550C 38 60 00 00 */ li r3, 0 /* 800085B0 00005510 38 80 00 00 */ li r4, 0 -/* 800085B4 00005514 48 37 AA 59 */ bl sub_8038300c +/* 800085B4 00005514 48 37 AA 59 */ bl OSSetSaveRegion /* 800085B8 00005518 7F E3 FB 78 */ mr r3, r31 /* 800085BC 0000551C 38 80 00 80 */ li r4, 0x80 /* 800085C0 00005520 48 2C DE 21 */ bl sub_802d63e0 diff --git a/include/Dolphin/dsp.h b/include/Dolphin/dsp.h new file mode 100644 index 00000000..ce7b8355 --- /dev/null +++ b/include/Dolphin/dsp.h @@ -0,0 +1,60 @@ +#ifndef __DSP_H__ +#define __DSP_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*DSPCallback)(void *task); + +typedef struct DSPTaskInfo DSPTaskInfo; + +typedef struct DSPTaskInfo { + vu32 state; + vu32 priority; + vu32 flags; + u16 *iram_mmem_addr; + u32 iram_length; + u32 iram_addr; + + u16 *dram_mmem_addr; + u32 dram_length; + u32 dram_addr; + + u16 dsp_init_vector; + u16 dsp_resume_vector; + + DSPCallback init_cb; + DSPCallback res_cb; + DSPCallback done_cb; + DSPCallback req_cb; + + struct STRUCT_DSP_TASK *next; + struct STRUCT_DSP_TASK *prev; + + OSTime t_context; + OSTime t_task; + +} DSPTaskInfo; + +void DSPInit(); +void DSPReset(); +void DSPHalt(); +void DSPSendMailToDSP(u32 mail); +u32 DSPCheckMailToDSP(); +u32 DSPCheckMailFromDSP(); +u32 DSPGetDMAStatus(); + +DSPTaskInfo* DSPAddTask(DSPTaskInfo* task); + + +void __DSP_debug_printf(const char* fmt, ...); + +#ifdef __cplusplus +} +#endif + + +#endif // __DSP_H__ diff --git a/include/Dolphin/dsp_regs.h b/include/Dolphin/dsp_regs.h new file mode 100644 index 00000000..13381c49 --- /dev/null +++ b/include/Dolphin/dsp_regs.h @@ -0,0 +1,8 @@ +#ifndef __DSP_REGS_H__ +#define __DSP_REGS_H__ + +#include "types.h" + +vu16 __DSPRegs[32] : 0xCC005000; + +#endif // __DSP_REGS_H__ diff --git a/include/Dolphin/os.h b/include/Dolphin/os.h index 1a1ca704..088fa181 100644 --- a/include/Dolphin/os.h +++ b/include/Dolphin/os.h @@ -21,7 +21,31 @@ extern "C" { #define OSSecondsToTicks(v) ((v)*OS_TIMER_CLOCK) -typedef s64 OSTime; + +typedef struct OSContext { + u32 gpr[32]; + u32 cr; + u32 lr; + u32 ctr; + u32 xer; + + f64 fpr[32]; + + u32 fpscr_pad; + u32 fpscr; + + u32 srr0; + u32 srr1; + + u16 mode; + u16 state; + + u32 gqr[8]; + u32 psf_pad; + f64 psf[32]; + +} OSContext; + OSTime OSGetTime(); #ifdef __cplusplus diff --git a/include/types.h b/include/types.h index 388426d7..39404c05 100644 --- a/include/types.h +++ b/include/types.h @@ -34,6 +34,9 @@ typedef volatile double vf64; typedef s32 size_t; typedef u32 uintptr_t; +typedef s16 __OSInterrupt; +typedef s64 OSTime; + // Pointer to unknown, to be determined at a later date. typedef void* unkptr; diff --git a/src/Dolphin/dsp/dsp.c b/src/Dolphin/dsp/dsp.c new file mode 100644 index 00000000..8ae29f86 --- /dev/null +++ b/src/Dolphin/dsp/dsp.c @@ -0,0 +1,108 @@ +#include "Dolphin/dsp.h" +#include "Dolphin/os.h" + +#include "Dolphin/dsp_regs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +static const char* __DSPVersion = "<< Dolphin SDK - DSP\trelease build: Sep 5 2002 05:35:13 (0x2301) >>"; +extern s32 __DSP_init_flag = 0; +extern DSPTaskInfo* __DSP_tmp_task; +extern DSPTaskInfo* __DSP_last_task; +extern DSPTaskInfo* __DSP_first_task; +extern DSPTaskInfo* __DSP_curr_task; + +extern void __DSPHandler(__OSInterrupt, OSContext*); +extern void __DSP_debug_printf(const char* fmt, ...); +extern void __DSP_boot_task(DSPTaskInfo* task); + +u32 DSPCheckMailToDSP(void) { + return (__DSPRegs[0] >> 0xF) & 1; +} + + +u32 DSPCheckMailFromDSP(void) { + return (__DSPRegs[2] >> 0xF) & 1; +} + +u32 DSPReadMailFromDSP() { + u16 reg1; + u16 reg2; + reg1 = __DSPRegs[2]; + reg2 = __DSPRegs[3]; + return reg1 << 16 | reg2; +} + +void DSPSendMailToDSP(u32 mail) { + __DSPRegs[0] = mail >> 16; + __DSPRegs[1] = mail; +} + +void DSPInit(void) { + u32 oldInt; + u16 reg; + __DSP_debug_printf("DSPInit(): Build Date: %s %s\n", "Sep 5 2002", "05:35:13"); + + if (__DSP_init_flag == 1) { + return; + } + OSRegisterVersion(__DSPVersion); + oldInt = OSDisableInterrupts(); + __OSSetInterruptHandler(7, __DSPHandler); + __OSUnmaskInterrupts(0x1000000); + reg = __DSPRegs[5]; + reg = (reg & ~0xA8) | 0x800; + __DSPRegs[5] = reg; + reg = __DSPRegs[5]; + reg = reg & ~0xAC; + __DSPRegs[5] = reg; + __DSP_tmp_task = 0; + __DSP_curr_task = 0; + __DSP_last_task = 0; + __DSP_first_task = 0; + __DSP_init_flag = 1; + OSRestoreInterrupts(oldInt); +} + +void DSPReset(void) { + u16 reg; + u32 oldInt; + oldInt = OSDisableInterrupts(); + reg = __DSPRegs[5]; + __DSPRegs[5] = (reg & ~0xA8) | 0x801; + __DSP_init_flag = 0; + OSRestoreInterrupts(oldInt); +} + +void DSPHalt(void) { + u16 reg; + u32 oldInt; + oldInt = OSDisableInterrupts(); + reg = __DSPRegs[5]; + __DSPRegs[5] = (reg & ~0xA8) | 4; + OSRestoreInterrupts(oldInt); +} + +u32 DSPGetDMAStatus(void) { + return __DSPRegs[5] & 0x200; +} + +DSPTaskInfo* DSPAddTask(DSPTaskInfo* task) { + u32 oldInt; + oldInt = OSDisableInterrupts(); + __DSP_insert_task(task); + task->state = 0; + task->flags = 1; + OSRestoreInterrupts(oldInt); + if (task == __DSP_first_task) { + __DSP_boot_task(task); + } + + return task; +} + +#ifdef __cplusplus +} +#endif diff --git a/src/Dolphin/os/OSReset.c b/src/Dolphin/os/OSReset.c new file mode 100644 index 00000000..026b269c --- /dev/null +++ b/src/Dolphin/os/OSReset.c @@ -0,0 +1,123 @@ +volatile u8 DAT_800030e2 : 0x800030e2; +typedef struct Unk { + u8 pad[0x24]; + u32 resetCode; +} Unk; +volatile Unk DAT_cc003000 : 0xcc003000; + +typedef struct Unk2 { + u16 _0; + u16 _2; +} Unk2; + +volatile Unk2 DAT_cc002000 : 0xcc002000; + +typedef struct OSResetQueue { + OSResetFunctionInfo* first; + OSResetFunctionInfo* last; +} OSResetQueue; + + +void OSRegisterResetFunction(OSResetFunctionInfo* func) { + OSResetFunctionInfo* tmp; + OSResetFunctionInfo* iter; + + for (iter = ResetFunctionQueue.first; iter && iter->priority <= func->priority; iter = iter->next); + + if (iter == NULL) { + tmp = ResetFunctionQueue.last; + if (tmp == NULL) { + ResetFunctionQueue.first = func; + } else { + tmp->next = func; + } + func->prev = tmp; + func->next = NULL; + ResetFunctionQueue.last = func; + return; + } + + func->next = iter; + tmp = iter->prev; + iter->prev = func; + func->prev = tmp; + if (tmp == NULL) { + ResetFunctionQueue.first = func; + return; + } + tmp->next = func; +} + +s32 __OSCallResetFunctions(s32 arg0) { + OSResetFunctionInfo* iter; + s32 retCode = 0; + u32 ret; + + for (iter = ResetFunctionQueue.first; iter != NULL; iter = iter->next) { + retCode |= !iter->func(arg0); + } + retCode |= !__OSSyncSram(); + if (retCode) { + return 0; + } + return 1; +} + +asm void Reset(register s32 resetCode) { + nofralloc + b lbl_8038315C +lbl_80383140: + mfspr r8, 0x3f0 + ori r8, r8, 8 + mtspr 0x3f0, r8 + isync + sync + nop + b lbl_80383160 +lbl_8038315C: + b lbl_8038317C +lbl_80383160: + mftb r5, 0x10c +lbl_80383164: + mftb r6, 0x10c + subf r7, r5, r6 + cmplwi r7, 0x1124 + blt lbl_80383164 + nop + b lbl_80383180 +lbl_8038317C: + b lbl_8038319C +lbl_80383180: + lis r8, 0xCC003000@h + ori r8, r8, 0xCC003000@l + li r4, 3 + stw r4, 0x24(r8) + stw r3, 0x24(r8) + nop + b lbl_803831A0 +lbl_8038319C: + b lbl_803831A8 +lbl_803831A0: + nop + b lbl_803831A0 +lbl_803831A8: + b lbl_80383140 +} + +void __OSDoHotReset(s32 arg0) { + OSDisableInterrupts(); + DAT_cc002000._2 = 0; + ICFlashInvalidate(); + Reset(arg0 * 8); +} + +void OSResetSystem(int reset, u32 resetCode, BOOL forceMenu) { + +} + +u32 OSGetResetCode(void) { + if (DAT_800030e2 != 0) { + return 0x80000000; + } + return ((DAT_cc003000.resetCode & ~7) >> 3); +}