summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile15
-rw-r--r--asm/Runtime/__mem.s1
-rw-r--r--asm/SDK/DWC/gamespy/NATify.s (renamed from asm/GameSpy/NATify.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gbucket.s (renamed from asm/GameSpy/gbucket.s)0
-rw-r--r--asm/SDK/DWC/gamespy/ghttpBuffer.s (renamed from asm/GameSpy/ghttpBuffer.s)0
-rw-r--r--asm/SDK/DWC/gamespy/ghttpCallbacks.s (renamed from asm/GameSpy/ghttpCallbacks.s)0
-rw-r--r--asm/SDK/DWC/gamespy/ghttpCommon.s (renamed from asm/GameSpy/ghttpCommon.s)0
-rw-r--r--asm/SDK/DWC/gamespy/ghttpConnection.s (renamed from asm/GameSpy/ghttpConnection.s)0
-rw-r--r--asm/SDK/DWC/gamespy/ghttpEncryption.s (renamed from asm/GameSpy/ghttpEncryption.s)0
-rw-r--r--asm/SDK/DWC/gamespy/ghttpMain.s (renamed from asm/GameSpy/ghttpMain.s)0
-rw-r--r--asm/SDK/DWC/gamespy/ghttpPost.s (renamed from asm/GameSpy/ghttpPost.s)0
-rw-r--r--asm/SDK/DWC/gamespy/ghttpProcess.s (renamed from asm/GameSpy/ghttpProcess.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gp.s (renamed from asm/GameSpy/gp.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpi.s (renamed from asm/GameSpy/gpi.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiBuddy.s (renamed from asm/GameSpy/gpiBuddy.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiBuffer.s (renamed from asm/GameSpy/gpiBuffer.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiCallback.s (renamed from asm/GameSpy/gpiCallback.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiConnect.s (renamed from asm/GameSpy/gpiConnect.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiInfo.s (renamed from asm/GameSpy/gpiInfo.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiOperation.s (renamed from asm/GameSpy/gpiOperation.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiPeer.s (renamed from asm/GameSpy/gpiPeer.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiProfile.s (renamed from asm/GameSpy/gpiProfile.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiSearch.s (renamed from asm/GameSpy/gpiSearch.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiTransfer.s (renamed from asm/GameSpy/gpiTransfer.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiUnique.s (renamed from asm/GameSpy/gpiUnique.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gpiUtility.s (renamed from asm/GameSpy/gpiUtility.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gsAvailable.s (renamed from asm/GameSpy/gsAvailable.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gsCrypt.s (renamed from asm/GameSpy/gsCrypt.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gsLargeInt.s (renamed from asm/GameSpy/gsLargeInt.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gsRC4.s (renamed from asm/GameSpy/gsRC4.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gsSHA1.s (renamed from asm/GameSpy/gsSHA1.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gsXML.s (renamed from asm/GameSpy/gsXML.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gstats.s (renamed from asm/GameSpy/gstats.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gt2Auth.s (renamed from asm/GameSpy/gt2Auth.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gt2Buffer.s (renamed from asm/GameSpy/gt2Buffer.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gt2Callback.s (renamed from asm/GameSpy/gt2Callback.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gt2Connection.s (renamed from asm/GameSpy/gt2Connection.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gt2Main.s (renamed from asm/GameSpy/gt2Main.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gt2Message.s (renamed from asm/GameSpy/gt2Message.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gt2Socket.s (renamed from asm/GameSpy/gt2Socket.s)0
-rw-r--r--asm/SDK/DWC/gamespy/gt2Utility.s (renamed from asm/GameSpy/gt2Utility.s)0
-rw-r--r--asm/SDK/DWC/gamespy/md5c.s (renamed from asm/GameSpy/md5c.s)0
-rw-r--r--asm/SDK/DWC/gamespy/natneg.s (renamed from asm/GameSpy/natneg.s)0
-rw-r--r--asm/SDK/DWC/gamespy/nonport.s (renamed from asm/GameSpy/nonport.s)0
-rw-r--r--asm/SDK/DWC/gamespy/qr2.s (renamed from asm/GameSpy/qr2.s)0
-rw-r--r--asm/SDK/DWC/gamespy/qr2regkeys.s (renamed from asm/GameSpy/qr2regkeys.s)0
-rw-r--r--asm/SDK/DWC/gamespy/sb_crypt.s (renamed from asm/GameSpy/sb_crypt.s)0
-rw-r--r--asm/SDK/DWC/gamespy/sb_queryengine.s (renamed from asm/GameSpy/sb_queryengine.s)0
-rw-r--r--asm/SDK/DWC/gamespy/sb_server.s (renamed from asm/GameSpy/sb_server.s)0
-rw-r--r--asm/SDK/DWC/gamespy/sb_serverbrowsing.s (renamed from asm/GameSpy/sb_serverbrowsing.s)0
-rw-r--r--asm/SDK/DWC/gamespy/sb_serverlist.s (renamed from asm/GameSpy/sb_serverlist.s)0
-rw-r--r--asm/code_801DCE6C_asm.s528
-rw-r--r--asm/ctors_2.s2
-rw-r--r--asm/sbss_2.s9
-rw-r--r--asm/sdata_2.s6
-rw-r--r--include/MSL_C/MSL_Common/qsort.h (renamed from include/libstdc++/qsort.h)0
-rw-r--r--include/MSL_C/stdlib.h15
-rw-r--r--include/MSL_C/string.h22
-rw-r--r--include/Runtime/MWCPlusLib.h (renamed from include/libstdc++/CPlusLib.h)6
-rw-r--r--include/SDK/DVD/dvdfs.h10
-rw-r--r--include/SDK/DWC/gamespy/darray.h (renamed from include/GameSpy/darray.h)0
-rw-r--r--include/SDK/DWC/gamespy/hashtable.h (renamed from include/GameSpy/hashtable.h)2
-rw-r--r--include/SDK/DWC/gamespy/nonport.h (renamed from include/GameSpy/nonport.h)0
-rw-r--r--include/SDK/NAND/NANDOpenClose.h17
-rw-r--r--include/SDK/NAND/nand.h38
-rw-r--r--include/SDK/nand.h4
-rw-r--r--include/code_801DBE90.h11
-rw-r--r--include/code_801DCE6C.h47
-rw-r--r--obj_files.mk103
-rw-r--r--src/Runtime/ptmf.c3
-rw-r--r--src/SDK/DWC/gamespy/darray.c (renamed from src/GameSpy/darray.c)11
-rw-r--r--src/SDK/DWC/gamespy/hashtable.c (renamed from src/GameSpy/hashtable.c)5
-rw-r--r--src/code_801DAA30.cpp1
-rw-r--r--src/code_801DAAE0.cpp5
-rw-r--r--src/code_801DB040.cpp5
-rw-r--r--src/code_801DB81C.cpp3
-rw-r--r--src/code_801DBB3C.cpp3
-rw-r--r--src/code_801DBE90.cpp51
-rw-r--r--src/code_801DCE6C.cpp204
79 files changed, 435 insertions, 692 deletions
diff --git a/Makefile b/Makefile
index 9ecf9e8..4f9c6e4 100644
--- a/Makefile
+++ b/Makefile
@@ -35,9 +35,9 @@ SRC_DIRS := src src/SDK/OS src/SDK/EXI src/SDK/SI src/SDK/DB src/SDK/VI src/SDK/
src/SDK/SC src/SDK/WENC src/SDK/ARC src/SDK/NCD src/SDK/WD src/SDK/NTR src/SDK/MP src/SDK/MPDL \
src/SDK/NET src/SDK/NHTTP src/SDK/SSL src/SDK/NWC24 src/SDK/VF src/SDK/DWC/dwc_common src/SDK/DWC/dwc_ghttp \
src/SDK/DWC/dwc_lanmatch src/SDK/DWC/dwc_match src/SDK/DWC/dwc_nonport src/SDK/DWC/dwcsec_account \
- src/SDK/DWC/dwcsec_auth src/SDK/DWC/dwcsec_nas src/SDK/SSL src/SDK/SO src/SDK/base src/SDK/HBM src/MSL_C/MSL_Common src/MSL_C/MSL_Common_Embedded \
+ src/SDK/DWC/dwcsec_auth src/SDK/DWC/dwcsec_nas asm/SDK/DWC/gamespy src/SDK/SSL src/SDK/SO src/SDK/base src/SDK/HBM src/MSL_C/MSL_Common src/MSL_C/MSL_Common_Embedded \
src/MSL_C/MSL_Common_Embedded/Math src/MSL_C/PPC_EABI src/Runtime \
- src/MetroTRK src/GameSpy src/nw4r/db src/nw4r/ut src/nw4r/snd src/nw4r/ut/detail \
+ src/MetroTRK src/nw4r/db src/nw4r/ut src/nw4r/snd src/nw4r/ut/detail \
src/nw4r/snd/detail src/nw4r/math src/nw4r/lyt src/nw4r/lyt/detail
ASM_DIRS := asm asm/SDK/OS asm/SDK/EXI asm/SDK/SI asm/SDK/DB asm/SDK/VI asm/SDK/MTX \
asm/SDK/GX asm/SDK/DVD asm/SDK/AI asm/SDK/AX asm/SDK/AXFX asm/SDK/MEM asm/SDK/MIX asm/SDK/DSP \
@@ -46,9 +46,9 @@ ASM_DIRS := asm asm/SDK/OS asm/SDK/EXI asm/SDK/SI asm/SDK/DB asm/SDK/VI asm/SDK/
asm/SDK/SC asm/SDK/WENC asm/SDK/ARC asm/SDK/NCD asm/SDK/WD asm/SDK/NTR asm/SDK/MP asm/SDK/MPDL \
asm/SDK/NET asm/SDK/NHTTP asm/SDK/SSL asm/SDK/NWC24 asm/SDK/VF asm/SDK/DWC/dwc_common asm/SDK/DWC/dwc_ghttp \
asm/SDK/DWC/dwc_lanmatch asm/SDK/DWC/dwc_match asm/SDK/DWC/dwc_nonport asm/SDK/DWC/dwcsec_account \
- asm/SDK/DWC/dwcsec_auth asm/SDK/DWC/dwcsec_nas asm/SDK/SSL asm/SDK/SO asm/SDK/base asm/SDK/HBM asm/MSL_C/MSL_Common asm/MSL_C/MSL_Common_Embedded \
+ asm/SDK/DWC/dwcsec_auth asm/SDK/DWC/dwcsec_nas src/SDK/DWC/gamespy asm/SDK/SSL asm/SDK/SO asm/SDK/base asm/SDK/HBM asm/MSL_C/MSL_Common asm/MSL_C/MSL_Common_Embedded \
asm/MSL_C/MSL_Common_Embedded/Math asm/MSL_C/PPC_EABI asm/Runtime \
- asm/MetroTRK asm/GameSpy asm/nw4r/db asm/nw4r/ut asm/nw4r/snd asm/nw4r/ut/detail \
+ asm/MetroTRK asm/nw4r/db asm/nw4r/ut asm/nw4r/snd asm/nw4r/ut/detail \
asm/nw4r/snd/detail asm/nw4r/math asm/nw4r/lyt asm/nw4r/lyt/detail
# Inputs
@@ -87,8 +87,7 @@ PYTHON := python3
POSTPROC := tools/postprocess/postprocess.py
# Options
-INCLUDES := -i . -I- -i include -i include/SDK -i include/libstdc++
-
+INCLUDES := -i . -I- -i include -i include/SDK -i include/MSL_C -include include/types.h
ASFLAGS := -mgekko -I include
LDFLAGS := -map $(MAP) -fp hard -nodefaults
CFLAGS := -Cpp_exceptions off -proc gekko -fp hard -O4,p -nodefaults -msgstyle gcc -ipa file $(INCLUDES) -W all
@@ -153,12 +152,10 @@ $(ELF): $(O_FILES) $(LDSCRIPT)
$(BUILD_DIR)/%.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
# resolve escape sequences for C++ mangled names in the .strtab section (assembler workaround).
- $(PYTHON) $(POSTPROC) $(PROCFLAGS) $@ -fsymbol-fixup
+ $(PYTHON) $(POSTPROC) $(PROCFLAGS) $@
$(BUILD_DIR)/%.o: %.cpp
$(CC) $(CFLAGS) -lang c++ -c -o $@ $<
$(BUILD_DIR)/%.o: %.c
$(CC) $(CFLAGS) -lang c99 -c -o $@ $<
-
-# $(PYTHON) $(POSTPROC) $(PROCFLAGS) $@
diff --git a/asm/Runtime/__mem.s b/asm/Runtime/__mem.s
index c138a48..01d9be6 100644
--- a/asm/Runtime/__mem.s
+++ b/asm/Runtime/__mem.s
@@ -30,7 +30,6 @@ lbl_80004044:
/* 80004048 00000148 40 82 FF F4 */ bne lbl_8000403C
/* 8000404C 0000014C 4E 80 00 20 */ blr
-.global __fill_mem
__fill_mem:
/* 80004050 00000150 28 05 00 20 */ cmplwi r5, 0x20
/* 80004054 00000154 54 87 06 3E */ clrlwi r7, r4, 0x18
diff --git a/asm/GameSpy/NATify.s b/asm/SDK/DWC/gamespy/NATify.s
index fdb9bea..fdb9bea 100644
--- a/asm/GameSpy/NATify.s
+++ b/asm/SDK/DWC/gamespy/NATify.s
diff --git a/asm/GameSpy/gbucket.s b/asm/SDK/DWC/gamespy/gbucket.s
index 139df19..139df19 100644
--- a/asm/GameSpy/gbucket.s
+++ b/asm/SDK/DWC/gamespy/gbucket.s
diff --git a/asm/GameSpy/ghttpBuffer.s b/asm/SDK/DWC/gamespy/ghttpBuffer.s
index ed19e2d..ed19e2d 100644
--- a/asm/GameSpy/ghttpBuffer.s
+++ b/asm/SDK/DWC/gamespy/ghttpBuffer.s
diff --git a/asm/GameSpy/ghttpCallbacks.s b/asm/SDK/DWC/gamespy/ghttpCallbacks.s
index 47dc2d6..47dc2d6 100644
--- a/asm/GameSpy/ghttpCallbacks.s
+++ b/asm/SDK/DWC/gamespy/ghttpCallbacks.s
diff --git a/asm/GameSpy/ghttpCommon.s b/asm/SDK/DWC/gamespy/ghttpCommon.s
index f6b8d38..f6b8d38 100644
--- a/asm/GameSpy/ghttpCommon.s
+++ b/asm/SDK/DWC/gamespy/ghttpCommon.s
diff --git a/asm/GameSpy/ghttpConnection.s b/asm/SDK/DWC/gamespy/ghttpConnection.s
index 9c2685c..9c2685c 100644
--- a/asm/GameSpy/ghttpConnection.s
+++ b/asm/SDK/DWC/gamespy/ghttpConnection.s
diff --git a/asm/GameSpy/ghttpEncryption.s b/asm/SDK/DWC/gamespy/ghttpEncryption.s
index f3c7309..f3c7309 100644
--- a/asm/GameSpy/ghttpEncryption.s
+++ b/asm/SDK/DWC/gamespy/ghttpEncryption.s
diff --git a/asm/GameSpy/ghttpMain.s b/asm/SDK/DWC/gamespy/ghttpMain.s
index 382e22b..382e22b 100644
--- a/asm/GameSpy/ghttpMain.s
+++ b/asm/SDK/DWC/gamespy/ghttpMain.s
diff --git a/asm/GameSpy/ghttpPost.s b/asm/SDK/DWC/gamespy/ghttpPost.s
index 2193e99..2193e99 100644
--- a/asm/GameSpy/ghttpPost.s
+++ b/asm/SDK/DWC/gamespy/ghttpPost.s
diff --git a/asm/GameSpy/ghttpProcess.s b/asm/SDK/DWC/gamespy/ghttpProcess.s
index 493cbb1..493cbb1 100644
--- a/asm/GameSpy/ghttpProcess.s
+++ b/asm/SDK/DWC/gamespy/ghttpProcess.s
diff --git a/asm/GameSpy/gp.s b/asm/SDK/DWC/gamespy/gp.s
index 2ef9eee..2ef9eee 100644
--- a/asm/GameSpy/gp.s
+++ b/asm/SDK/DWC/gamespy/gp.s
diff --git a/asm/GameSpy/gpi.s b/asm/SDK/DWC/gamespy/gpi.s
index a83f3c6..a83f3c6 100644
--- a/asm/GameSpy/gpi.s
+++ b/asm/SDK/DWC/gamespy/gpi.s
diff --git a/asm/GameSpy/gpiBuddy.s b/asm/SDK/DWC/gamespy/gpiBuddy.s
index f920a4c..f920a4c 100644
--- a/asm/GameSpy/gpiBuddy.s
+++ b/asm/SDK/DWC/gamespy/gpiBuddy.s
diff --git a/asm/GameSpy/gpiBuffer.s b/asm/SDK/DWC/gamespy/gpiBuffer.s
index 2d7828e..2d7828e 100644
--- a/asm/GameSpy/gpiBuffer.s
+++ b/asm/SDK/DWC/gamespy/gpiBuffer.s
diff --git a/asm/GameSpy/gpiCallback.s b/asm/SDK/DWC/gamespy/gpiCallback.s
index d7c0c59..d7c0c59 100644
--- a/asm/GameSpy/gpiCallback.s
+++ b/asm/SDK/DWC/gamespy/gpiCallback.s
diff --git a/asm/GameSpy/gpiConnect.s b/asm/SDK/DWC/gamespy/gpiConnect.s
index 9d06f20..9d06f20 100644
--- a/asm/GameSpy/gpiConnect.s
+++ b/asm/SDK/DWC/gamespy/gpiConnect.s
diff --git a/asm/GameSpy/gpiInfo.s b/asm/SDK/DWC/gamespy/gpiInfo.s
index 4c71b08..4c71b08 100644
--- a/asm/GameSpy/gpiInfo.s
+++ b/asm/SDK/DWC/gamespy/gpiInfo.s
diff --git a/asm/GameSpy/gpiOperation.s b/asm/SDK/DWC/gamespy/gpiOperation.s
index 8c6ee78..8c6ee78 100644
--- a/asm/GameSpy/gpiOperation.s
+++ b/asm/SDK/DWC/gamespy/gpiOperation.s
diff --git a/asm/GameSpy/gpiPeer.s b/asm/SDK/DWC/gamespy/gpiPeer.s
index 3879460..3879460 100644
--- a/asm/GameSpy/gpiPeer.s
+++ b/asm/SDK/DWC/gamespy/gpiPeer.s
diff --git a/asm/GameSpy/gpiProfile.s b/asm/SDK/DWC/gamespy/gpiProfile.s
index 4c81980..4c81980 100644
--- a/asm/GameSpy/gpiProfile.s
+++ b/asm/SDK/DWC/gamespy/gpiProfile.s
diff --git a/asm/GameSpy/gpiSearch.s b/asm/SDK/DWC/gamespy/gpiSearch.s
index 55142f3..55142f3 100644
--- a/asm/GameSpy/gpiSearch.s
+++ b/asm/SDK/DWC/gamespy/gpiSearch.s
diff --git a/asm/GameSpy/gpiTransfer.s b/asm/SDK/DWC/gamespy/gpiTransfer.s
index a74da80..a74da80 100644
--- a/asm/GameSpy/gpiTransfer.s
+++ b/asm/SDK/DWC/gamespy/gpiTransfer.s
diff --git a/asm/GameSpy/gpiUnique.s b/asm/SDK/DWC/gamespy/gpiUnique.s
index 7ced259..7ced259 100644
--- a/asm/GameSpy/gpiUnique.s
+++ b/asm/SDK/DWC/gamespy/gpiUnique.s
diff --git a/asm/GameSpy/gpiUtility.s b/asm/SDK/DWC/gamespy/gpiUtility.s
index 5c1fece..5c1fece 100644
--- a/asm/GameSpy/gpiUtility.s
+++ b/asm/SDK/DWC/gamespy/gpiUtility.s
diff --git a/asm/GameSpy/gsAvailable.s b/asm/SDK/DWC/gamespy/gsAvailable.s
index 9d17ec2..9d17ec2 100644
--- a/asm/GameSpy/gsAvailable.s
+++ b/asm/SDK/DWC/gamespy/gsAvailable.s
diff --git a/asm/GameSpy/gsCrypt.s b/asm/SDK/DWC/gamespy/gsCrypt.s
index 336ea8b..336ea8b 100644
--- a/asm/GameSpy/gsCrypt.s
+++ b/asm/SDK/DWC/gamespy/gsCrypt.s
diff --git a/asm/GameSpy/gsLargeInt.s b/asm/SDK/DWC/gamespy/gsLargeInt.s
index 58fbd8a..58fbd8a 100644
--- a/asm/GameSpy/gsLargeInt.s
+++ b/asm/SDK/DWC/gamespy/gsLargeInt.s
diff --git a/asm/GameSpy/gsRC4.s b/asm/SDK/DWC/gamespy/gsRC4.s
index 2e1fad3..2e1fad3 100644
--- a/asm/GameSpy/gsRC4.s
+++ b/asm/SDK/DWC/gamespy/gsRC4.s
diff --git a/asm/GameSpy/gsSHA1.s b/asm/SDK/DWC/gamespy/gsSHA1.s
index bdc93e1..bdc93e1 100644
--- a/asm/GameSpy/gsSHA1.s
+++ b/asm/SDK/DWC/gamespy/gsSHA1.s
diff --git a/asm/GameSpy/gsXML.s b/asm/SDK/DWC/gamespy/gsXML.s
index 288b366..288b366 100644
--- a/asm/GameSpy/gsXML.s
+++ b/asm/SDK/DWC/gamespy/gsXML.s
diff --git a/asm/GameSpy/gstats.s b/asm/SDK/DWC/gamespy/gstats.s
index dc6568f..dc6568f 100644
--- a/asm/GameSpy/gstats.s
+++ b/asm/SDK/DWC/gamespy/gstats.s
diff --git a/asm/GameSpy/gt2Auth.s b/asm/SDK/DWC/gamespy/gt2Auth.s
index 1fa1d3c..1fa1d3c 100644
--- a/asm/GameSpy/gt2Auth.s
+++ b/asm/SDK/DWC/gamespy/gt2Auth.s
diff --git a/asm/GameSpy/gt2Buffer.s b/asm/SDK/DWC/gamespy/gt2Buffer.s
index ab6397e..ab6397e 100644
--- a/asm/GameSpy/gt2Buffer.s
+++ b/asm/SDK/DWC/gamespy/gt2Buffer.s
diff --git a/asm/GameSpy/gt2Callback.s b/asm/SDK/DWC/gamespy/gt2Callback.s
index fbb959a..fbb959a 100644
--- a/asm/GameSpy/gt2Callback.s
+++ b/asm/SDK/DWC/gamespy/gt2Callback.s
diff --git a/asm/GameSpy/gt2Connection.s b/asm/SDK/DWC/gamespy/gt2Connection.s
index 878a4a4..878a4a4 100644
--- a/asm/GameSpy/gt2Connection.s
+++ b/asm/SDK/DWC/gamespy/gt2Connection.s
diff --git a/asm/GameSpy/gt2Main.s b/asm/SDK/DWC/gamespy/gt2Main.s
index e78caed..e78caed 100644
--- a/asm/GameSpy/gt2Main.s
+++ b/asm/SDK/DWC/gamespy/gt2Main.s
diff --git a/asm/GameSpy/gt2Message.s b/asm/SDK/DWC/gamespy/gt2Message.s
index 74737f0..74737f0 100644
--- a/asm/GameSpy/gt2Message.s
+++ b/asm/SDK/DWC/gamespy/gt2Message.s
diff --git a/asm/GameSpy/gt2Socket.s b/asm/SDK/DWC/gamespy/gt2Socket.s
index 8c7b314..8c7b314 100644
--- a/asm/GameSpy/gt2Socket.s
+++ b/asm/SDK/DWC/gamespy/gt2Socket.s
diff --git a/asm/GameSpy/gt2Utility.s b/asm/SDK/DWC/gamespy/gt2Utility.s
index 0667b2a..0667b2a 100644
--- a/asm/GameSpy/gt2Utility.s
+++ b/asm/SDK/DWC/gamespy/gt2Utility.s
diff --git a/asm/GameSpy/md5c.s b/asm/SDK/DWC/gamespy/md5c.s
index ea906fe..ea906fe 100644
--- a/asm/GameSpy/md5c.s
+++ b/asm/SDK/DWC/gamespy/md5c.s
diff --git a/asm/GameSpy/natneg.s b/asm/SDK/DWC/gamespy/natneg.s
index a2ad575..a2ad575 100644
--- a/asm/GameSpy/natneg.s
+++ b/asm/SDK/DWC/gamespy/natneg.s
diff --git a/asm/GameSpy/nonport.s b/asm/SDK/DWC/gamespy/nonport.s
index e9f73a7..e9f73a7 100644
--- a/asm/GameSpy/nonport.s
+++ b/asm/SDK/DWC/gamespy/nonport.s
diff --git a/asm/GameSpy/qr2.s b/asm/SDK/DWC/gamespy/qr2.s
index 5d4c0cc..5d4c0cc 100644
--- a/asm/GameSpy/qr2.s
+++ b/asm/SDK/DWC/gamespy/qr2.s
diff --git a/asm/GameSpy/qr2regkeys.s b/asm/SDK/DWC/gamespy/qr2regkeys.s
index 8e8f896..8e8f896 100644
--- a/asm/GameSpy/qr2regkeys.s
+++ b/asm/SDK/DWC/gamespy/qr2regkeys.s
diff --git a/asm/GameSpy/sb_crypt.s b/asm/SDK/DWC/gamespy/sb_crypt.s
index ebda0e7..ebda0e7 100644
--- a/asm/GameSpy/sb_crypt.s
+++ b/asm/SDK/DWC/gamespy/sb_crypt.s
diff --git a/asm/GameSpy/sb_queryengine.s b/asm/SDK/DWC/gamespy/sb_queryengine.s
index ff0282f..ff0282f 100644
--- a/asm/GameSpy/sb_queryengine.s
+++ b/asm/SDK/DWC/gamespy/sb_queryengine.s
diff --git a/asm/GameSpy/sb_server.s b/asm/SDK/DWC/gamespy/sb_server.s
index e2d9550..e2d9550 100644
--- a/asm/GameSpy/sb_server.s
+++ b/asm/SDK/DWC/gamespy/sb_server.s
diff --git a/asm/GameSpy/sb_serverbrowsing.s b/asm/SDK/DWC/gamespy/sb_serverbrowsing.s
index d88b753..d88b753 100644
--- a/asm/GameSpy/sb_serverbrowsing.s
+++ b/asm/SDK/DWC/gamespy/sb_serverbrowsing.s
diff --git a/asm/GameSpy/sb_serverlist.s b/asm/SDK/DWC/gamespy/sb_serverlist.s
index fab8072..fab8072 100644
--- a/asm/GameSpy/sb_serverlist.s
+++ b/asm/SDK/DWC/gamespy/sb_serverlist.s
diff --git a/asm/code_801DCE6C_asm.s b/asm/code_801DCE6C_asm.s
deleted file mode 100644
index 1ee7626..0000000
--- a/asm/code_801DCE6C_asm.s
+++ /dev/null
@@ -1,528 +0,0 @@
-.include "macros.inc"
-
-.section .text, "ax" # 0x80006980 - 0x803E1E60
-
-.global func_801DCEB4
-func_801DCEB4:
-/* 801DCEB4 001D8B14 94 21 FF E0 */ stwu r1, -0x20(r1)
-/* 801DCEB8 001D8B18 7C 08 02 A6 */ mflr r0
-/* 801DCEBC 001D8B1C 38 A0 00 0C */ li r5, 0xc
-/* 801DCEC0 001D8B20 90 01 00 24 */ stw r0, 0x24(r1)
-/* 801DCEC4 001D8B24 93 E1 00 1C */ stw r31, 0x1c(r1)
-/* 801DCEC8 001D8B28 93 C1 00 18 */ stw r30, 0x18(r1)
-/* 801DCECC 001D8B2C 7C 7E 1B 78 */ mr r30, r3
-/* 801DCED0 001D8B30 38 61 00 08 */ addi r3, r1, 8
-/* 801DCED4 001D8B34 4B E2 71 2D */ bl memcpy
-/* 801DCED8 001D8B38 38 00 00 00 */ li r0, 0
-/* 801DCEDC 001D8B3C 3B E0 00 00 */ li r31, 0
-/* 801DCEE0 001D8B40 98 01 00 14 */ stb r0, 0x14(r1)
-lbl_801DCEE4:
-/* 801DCEE4 001D8B44 88 1E 00 00 */ lbz r0, 0(r30)
-/* 801DCEE8 001D8B48 2C 00 00 00 */ cmpwi r0, 0
-/* 801DCEEC 001D8B4C 41 82 00 30 */ beq lbl_801DCF1C
-/* 801DCEF0 001D8B50 88 1E 00 01 */ lbz r0, 1(r30)
-/* 801DCEF4 001D8B54 2C 00 00 00 */ cmpwi r0, 0
-/* 801DCEF8 001D8B58 40 82 00 24 */ bne lbl_801DCF1C
-/* 801DCEFC 001D8B5C 7F C3 F3 78 */ mr r3, r30
-/* 801DCF00 001D8B60 4B FF FF 6D */ bl func_801DCE6C
-/* 801DCF04 001D8B64 38 81 00 08 */ addi r4, r1, 8
-/* 801DCF08 001D8B68 4B FF 15 45 */ bl strcmp
-/* 801DCF0C 001D8B6C 2C 03 00 00 */ cmpwi r3, 0
-/* 801DCF10 001D8B70 40 82 00 0C */ bne lbl_801DCF1C
-/* 801DCF14 001D8B74 7F C3 F3 78 */ mr r3, r30
-/* 801DCF18 001D8B78 48 00 00 18 */ b lbl_801DCF30
-lbl_801DCF1C:
-/* 801DCF1C 001D8B7C 3B FF 00 01 */ addi r31, r31, 1
-/* 801DCF20 001D8B80 3B DE 01 90 */ addi r30, r30, 0x190
-/* 801DCF24 001D8B84 2C 1F 00 08 */ cmpwi r31, 8
-/* 801DCF28 001D8B88 41 80 FF BC */ blt lbl_801DCEE4
-/* 801DCF2C 001D8B8C 38 60 00 00 */ li r3, 0
-lbl_801DCF30:
-/* 801DCF30 001D8B90 80 01 00 24 */ lwz r0, 0x24(r1)
-/* 801DCF34 001D8B94 83 E1 00 1C */ lwz r31, 0x1c(r1)
-/* 801DCF38 001D8B98 83 C1 00 18 */ lwz r30, 0x18(r1)
-/* 801DCF3C 001D8B9C 7C 08 03 A6 */ mtlr r0
-/* 801DCF40 001D8BA0 38 21 00 20 */ addi r1, r1, 0x20
-/* 801DCF44 001D8BA4 4E 80 00 20 */ blr
-
-.global func_801DCF48
-func_801DCF48:
-/* 801DCF48 001D8BA8 94 21 FF F0 */ stwu r1, -0x10(r1)
-/* 801DCF4C 001D8BAC 7C 08 02 A6 */ mflr r0
-/* 801DCF50 001D8BB0 90 01 00 14 */ stw r0, 0x14(r1)
-/* 801DCF54 001D8BB4 4B FF FF 61 */ bl func_801DCEB4
-/* 801DCF58 001D8BB8 7C 03 00 D0 */ neg r0, r3
-/* 801DCF5C 001D8BBC 7C 00 1B 78 */ or r0, r0, r3
-/* 801DCF60 001D8BC0 54 03 0F FE */ srwi r3, r0, 0x1f
-/* 801DCF64 001D8BC4 80 01 00 14 */ lwz r0, 0x14(r1)
-/* 801DCF68 001D8BC8 7C 08 03 A6 */ mtlr r0
-/* 801DCF6C 001D8BCC 38 21 00 10 */ addi r1, r1, 0x10
-/* 801DCF70 001D8BD0 4E 80 00 20 */ blr
-
-.global func_801DCF74
-func_801DCF74:
-/* 801DCF74 001D8BD4 94 21 FF F0 */ stwu r1, -0x10(r1)
-/* 801DCF78 001D8BD8 7C 08 02 A6 */ mflr r0
-/* 801DCF7C 001D8BDC 90 01 00 14 */ stw r0, 0x14(r1)
-/* 801DCF80 001D8BE0 93 E1 00 0C */ stw r31, 0xc(r1)
-/* 801DCF84 001D8BE4 93 C1 00 08 */ stw r30, 8(r1)
-/* 801DCF88 001D8BE8 7C BE 2B 78 */ mr r30, r5
-/* 801DCF8C 001D8BEC 4B FF FF 29 */ bl func_801DCEB4
-/* 801DCF90 001D8BF0 2C 03 00 00 */ cmpwi r3, 0
-/* 801DCF94 001D8BF4 7C 7F 1B 78 */ mr r31, r3
-/* 801DCF98 001D8BF8 41 82 00 30 */ beq lbl_801DCFC8
-/* 801DCF9C 001D8BFC 4B FF FE D9 */ bl func_801DCE74
-/* 801DCFA0 001D8C00 38 9F 00 48 */ addi r4, r31, 0x48
-/* 801DCFA4 001D8C04 38 A0 00 01 */ li r5, 1
-/* 801DCFA8 001D8C08 48 10 B4 61 */ bl NANDOpen
-/* 801DCFAC 001D8C0C 2C 03 00 00 */ cmpwi r3, 0
-/* 801DCFB0 001D8C10 40 82 00 18 */ bne lbl_801DCFC8
-/* 801DCFB4 001D8C14 38 00 00 01 */ li r0, 1
-/* 801DCFB8 001D8C18 93 FE 00 40 */ stw r31, 0x40(r30)
-/* 801DCFBC 001D8C1C 38 60 00 01 */ li r3, 1
-/* 801DCFC0 001D8C20 98 1E 00 01 */ stb r0, 1(r30)
-/* 801DCFC4 001D8C24 48 00 00 08 */ b lbl_801DCFCC
-lbl_801DCFC8:
-/* 801DCFC8 001D8C28 38 60 00 00 */ li r3, 0
-lbl_801DCFCC:
-/* 801DCFCC 001D8C2C 80 01 00 14 */ lwz r0, 0x14(r1)
-/* 801DCFD0 001D8C30 83 E1 00 0C */ lwz r31, 0xc(r1)
-/* 801DCFD4 001D8C34 83 C1 00 08 */ lwz r30, 8(r1)
-/* 801DCFD8 001D8C38 7C 08 03 A6 */ mtlr r0
-/* 801DCFDC 001D8C3C 38 21 00 10 */ addi r1, r1, 0x10
-/* 801DCFE0 001D8C40 4E 80 00 20 */ blr
-
-.global func_801DCFE4
-func_801DCFE4:
-/* 801DCFE4 001D8C44 94 21 FF F0 */ stwu r1, -0x10(r1)
-/* 801DCFE8 001D8C48 7C 08 02 A6 */ mflr r0
-/* 801DCFEC 001D8C4C 90 01 00 14 */ stw r0, 0x14(r1)
-/* 801DCFF0 001D8C50 93 E1 00 0C */ stw r31, 0xc(r1)
-/* 801DCFF4 001D8C54 7C 9F 23 78 */ mr r31, r4
-/* 801DCFF8 001D8C58 88 04 00 01 */ lbz r0, 1(r4)
-/* 801DCFFC 001D8C5C 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD000 001D8C60 40 82 00 0C */ bne lbl_801DD00C
-/* 801DD004 001D8C64 38 60 00 00 */ li r3, 0
-/* 801DD008 001D8C68 48 00 00 20 */ b lbl_801DD028
-lbl_801DD00C:
-/* 801DD00C 001D8C6C 80 64 00 40 */ lwz r3, 0x40(r4)
-/* 801DD010 001D8C70 38 63 00 48 */ addi r3, r3, 0x48
-/* 801DD014 001D8C74 48 10 B6 75 */ bl NANDClose
-/* 801DD018 001D8C78 38 00 00 00 */ li r0, 0
-/* 801DD01C 001D8C7C 38 60 00 01 */ li r3, 1
-/* 801DD020 001D8C80 98 1F 00 01 */ stb r0, 1(r31)
-/* 801DD024 001D8C84 90 1F 00 40 */ stw r0, 0x40(r31)
-lbl_801DD028:
-/* 801DD028 001D8C88 80 01 00 14 */ lwz r0, 0x14(r1)
-/* 801DD02C 001D8C8C 83 E1 00 0C */ lwz r31, 0xc(r1)
-/* 801DD030 001D8C90 7C 08 03 A6 */ mtlr r0
-/* 801DD034 001D8C94 38 21 00 10 */ addi r1, r1, 0x10
-/* 801DD038 001D8C98 4E 80 00 20 */ blr
-
-.global func_801DD03C
-func_801DD03C:
-/* 801DD03C 001D8C9C 94 21 FF F0 */ stwu r1, -0x10(r1)
-/* 801DD040 001D8CA0 7C 08 02 A6 */ mflr r0
-/* 801DD044 001D8CA4 90 01 00 14 */ stw r0, 0x14(r1)
-/* 801DD048 001D8CA8 88 04 00 01 */ lbz r0, 1(r4)
-/* 801DD04C 001D8CAC 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD050 001D8CB0 40 82 00 0C */ bne lbl_801DD05C
-/* 801DD054 001D8CB4 38 60 00 00 */ li r3, 0
-/* 801DD058 001D8CB8 48 00 00 1C */ b lbl_801DD074
-lbl_801DD05C:
-/* 801DD05C 001D8CBC 80 64 00 40 */ lwz r3, 0x40(r4)
-/* 801DD060 001D8CC0 7C A4 2B 78 */ mr r4, r5
-/* 801DD064 001D8CC4 38 63 00 48 */ addi r3, r3, 0x48
-/* 801DD068 001D8CC8 48 10 AE 65 */ bl NANDGetLength
-/* 801DD06C 001D8CCC 7C 60 00 34 */ cntlzw r0, r3
-/* 801DD070 001D8CD0 54 03 D9 7E */ srwi r3, r0, 5
-lbl_801DD074:
-/* 801DD074 001D8CD4 80 01 00 14 */ lwz r0, 0x14(r1)
-/* 801DD078 001D8CD8 7C 08 03 A6 */ mtlr r0
-/* 801DD07C 001D8CDC 38 21 00 10 */ addi r1, r1, 0x10
-/* 801DD080 001D8CE0 4E 80 00 20 */ blr
-
-.global func_801DD084
-func_801DD084:
-/* 801DD084 001D8CE4 94 21 FF E0 */ stwu r1, -0x20(r1)
-/* 801DD088 001D8CE8 7C 08 02 A6 */ mflr r0
-/* 801DD08C 001D8CEC 90 01 00 24 */ stw r0, 0x24(r1)
-/* 801DD090 001D8CF0 93 E1 00 1C */ stw r31, 0x1c(r1)
-/* 801DD094 001D8CF4 7C DF 33 78 */ mr r31, r6
-/* 801DD098 001D8CF8 93 C1 00 18 */ stw r30, 0x18(r1)
-/* 801DD09C 001D8CFC 7C BE 2B 78 */ mr r30, r5
-/* 801DD0A0 001D8D00 93 A1 00 14 */ stw r29, 0x14(r1)
-/* 801DD0A4 001D8D04 7C 9D 23 78 */ mr r29, r4
-/* 801DD0A8 001D8D08 88 04 00 01 */ lbz r0, 1(r4)
-/* 801DD0AC 001D8D0C 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD0B0 001D8D10 40 82 00 0C */ bne lbl_801DD0BC
-/* 801DD0B4 001D8D14 38 60 FF FF */ li r3, -1
-/* 801DD0B8 001D8D18 48 00 00 3C */ b lbl_801DD0F4
-lbl_801DD0BC:
-/* 801DD0BC 001D8D1C 80 64 00 40 */ lwz r3, 0x40(r4)
-/* 801DD0C0 001D8D20 7C E4 3B 78 */ mr r4, r7
-/* 801DD0C4 001D8D24 38 A0 00 00 */ li r5, 0
-/* 801DD0C8 001D8D28 38 63 00 48 */ addi r3, r3, 0x48
-/* 801DD0CC 001D8D2C 48 10 A9 B5 */ bl NANDSeek
-/* 801DD0D0 001D8D30 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD0D4 001D8D34 41 80 00 0C */ blt lbl_801DD0E0
-/* 801DD0D8 001D8D38 38 60 FF FF */ li r3, -1
-/* 801DD0DC 001D8D3C 48 00 00 18 */ b lbl_801DD0F4
-lbl_801DD0E0:
-/* 801DD0E0 001D8D40 80 7D 00 40 */ lwz r3, 0x40(r29)
-/* 801DD0E4 001D8D44 7F C4 F3 78 */ mr r4, r30
-/* 801DD0E8 001D8D48 7F E5 FB 78 */ mr r5, r31
-/* 801DD0EC 001D8D4C 38 63 00 48 */ addi r3, r3, 0x48
-/* 801DD0F0 001D8D50 48 10 A7 D1 */ bl NANDRead
-lbl_801DD0F4:
-/* 801DD0F4 001D8D54 80 01 00 24 */ lwz r0, 0x24(r1)
-/* 801DD0F8 001D8D58 83 E1 00 1C */ lwz r31, 0x1c(r1)
-/* 801DD0FC 001D8D5C 83 C1 00 18 */ lwz r30, 0x18(r1)
-/* 801DD100 001D8D60 83 A1 00 14 */ lwz r29, 0x14(r1)
-/* 801DD104 001D8D64 7C 08 03 A6 */ mtlr r0
-/* 801DD108 001D8D68 38 21 00 20 */ addi r1, r1, 0x20
-/* 801DD10C 001D8D6C 4E 80 00 20 */ blr
-lbl_801DD110:
-/* 801DD110 001D8D70 94 21 FF F0 */ stwu r1, -0x10(r1)
-/* 801DD114 001D8D74 7C 08 02 A6 */ mflr r0
-/* 801DD118 001D8D78 90 01 00 14 */ stw r0, 0x14(r1)
-/* 801DD11C 001D8D7C 93 E1 00 0C */ stw r31, 0xc(r1)
-/* 801DD120 001D8D80 93 C1 00 08 */ stw r30, 8(r1)
-/* 801DD124 001D8D84 7C 7E 1B 78 */ mr r30, r3
-/* 801DD128 001D8D88 7C 83 23 78 */ mr r3, r4
-/* 801DD12C 001D8D8C 48 10 B1 C1 */ bl NANDGetUserData
-/* 801DD130 001D8D90 7C 7F 1B 78 */ mr r31, r3
-/* 801DD134 001D8D94 4B FF FD 11 */ bl func_801DCE44
-/* 801DD138 001D8D98 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD13C 001D8D9C 40 82 00 20 */ bne lbl_801DD15C
-/* 801DD140 001D8DA0 81 9F 00 44 */ lwz r12, 0x44(r31)
-/* 801DD144 001D8DA4 2C 0C 00 00 */ cmpwi r12, 0
-/* 801DD148 001D8DA8 41 82 00 14 */ beq lbl_801DD15C
-/* 801DD14C 001D8DAC 7F C3 F3 78 */ mr r3, r30
-/* 801DD150 001D8DB0 7F E4 FB 78 */ mr r4, r31
-/* 801DD154 001D8DB4 7D 89 03 A6 */ mtctr r12
-/* 801DD158 001D8DB8 4E 80 04 21 */ bctrl
-lbl_801DD15C:
-/* 801DD15C 001D8DBC 80 01 00 14 */ lwz r0, 0x14(r1)
-/* 801DD160 001D8DC0 83 E1 00 0C */ lwz r31, 0xc(r1)
-/* 801DD164 001D8DC4 83 C1 00 08 */ lwz r30, 8(r1)
-/* 801DD168 001D8DC8 7C 08 03 A6 */ mtlr r0
-/* 801DD16C 001D8DCC 38 21 00 10 */ addi r1, r1, 0x10
-/* 801DD170 001D8DD0 4E 80 00 20 */ blr
-lbl_801DD174:
-/* 801DD174 001D8DD4 94 21 FF E0 */ stwu r1, -0x20(r1)
-/* 801DD178 001D8DD8 7C 08 02 A6 */ mflr r0
-/* 801DD17C 001D8DDC 90 01 00 24 */ stw r0, 0x24(r1)
-/* 801DD180 001D8DE0 93 E1 00 1C */ stw r31, 0x1c(r1)
-/* 801DD184 001D8DE4 93 C1 00 18 */ stw r30, 0x18(r1)
-/* 801DD188 001D8DE8 93 A1 00 14 */ stw r29, 0x14(r1)
-/* 801DD18C 001D8DEC 7C 7D 1B 78 */ mr r29, r3
-/* 801DD190 001D8DF0 7C 83 23 78 */ mr r3, r4
-/* 801DD194 001D8DF4 48 10 B1 59 */ bl NANDGetUserData
-/* 801DD198 001D8DF8 83 C3 00 40 */ lwz r30, 0x40(r3)
-/* 801DD19C 001D8DFC 7C 7F 1B 78 */ mr r31, r3
-/* 801DD1A0 001D8E00 4B FF FC A5 */ bl func_801DCE44
-/* 801DD1A4 001D8E04 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD1A8 001D8E08 40 82 00 5C */ bne lbl_801DD204
-/* 801DD1AC 001D8E0C 2C 1D 00 00 */ cmpwi r29, 0
-/* 801DD1B0 001D8E10 40 80 00 1C */ bge lbl_801DD1CC
-/* 801DD1B4 001D8E14 81 9F 00 44 */ lwz r12, 0x44(r31)
-/* 801DD1B8 001D8E18 7F E4 FB 78 */ mr r4, r31
-/* 801DD1BC 001D8E1C 38 60 FF FF */ li r3, -1
-/* 801DD1C0 001D8E20 7D 89 03 A6 */ mtctr r12
-/* 801DD1C4 001D8E24 4E 80 04 21 */ bctrl
-/* 801DD1C8 001D8E28 48 00 00 3C */ b lbl_801DD204
-lbl_801DD1CC:
-/* 801DD1CC 001D8E2C 3C C0 80 1E */ lis r6, lbl_801DD110@ha
-/* 801DD1D0 001D8E30 80 9F 00 48 */ lwz r4, 0x48(r31)
-/* 801DD1D4 001D8E34 80 BF 00 4C */ lwz r5, 0x4c(r31)
-/* 801DD1D8 001D8E38 38 7E 00 48 */ addi r3, r30, 0x48
-/* 801DD1DC 001D8E3C 38 C6 D1 10 */ addi r6, r6, lbl_801DD110@l
-/* 801DD1E0 001D8E40 38 FE 00 D4 */ addi r7, r30, 0xd4
-/* 801DD1E4 001D8E44 48 10 A7 45 */ bl NANDReadAsync
-/* 801DD1E8 001D8E48 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD1EC 001D8E4C 41 82 00 18 */ beq lbl_801DD204
-/* 801DD1F0 001D8E50 81 9F 00 44 */ lwz r12, 0x44(r31)
-/* 801DD1F4 001D8E54 7F E4 FB 78 */ mr r4, r31
-/* 801DD1F8 001D8E58 38 60 FF FF */ li r3, -1
-/* 801DD1FC 001D8E5C 7D 89 03 A6 */ mtctr r12
-/* 801DD200 001D8E60 4E 80 04 21 */ bctrl
-lbl_801DD204:
-/* 801DD204 001D8E64 80 01 00 24 */ lwz r0, 0x24(r1)
-/* 801DD208 001D8E68 83 E1 00 1C */ lwz r31, 0x1c(r1)
-/* 801DD20C 001D8E6C 83 C1 00 18 */ lwz r30, 0x18(r1)
-/* 801DD210 001D8E70 83 A1 00 14 */ lwz r29, 0x14(r1)
-/* 801DD214 001D8E74 7C 08 03 A6 */ mtlr r0
-/* 801DD218 001D8E78 38 21 00 20 */ addi r1, r1, 0x20
-/* 801DD21C 001D8E7C 4E 80 00 20 */ blr
-
-.global func_801DD220
-func_801DD220:
-/* 801DD220 001D8E80 94 21 FF F0 */ stwu r1, -0x10(r1)
-/* 801DD224 001D8E84 7C 08 02 A6 */ mflr r0
-/* 801DD228 001D8E88 90 01 00 14 */ stw r0, 0x14(r1)
-/* 801DD22C 001D8E8C 93 E1 00 0C */ stw r31, 0xc(r1)
-/* 801DD230 001D8E90 93 C1 00 08 */ stw r30, 8(r1)
-/* 801DD234 001D8E94 7C FE 3B 78 */ mr r30, r7
-/* 801DD238 001D8E98 88 04 00 01 */ lbz r0, 1(r4)
-/* 801DD23C 001D8E9C 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD240 001D8EA0 40 82 00 0C */ bne lbl_801DD24C
-/* 801DD244 001D8EA4 38 60 00 00 */ li r3, 0
-/* 801DD248 001D8EA8 48 00 00 34 */ b lbl_801DD27C
-lbl_801DD24C:
-/* 801DD24C 001D8EAC 83 E4 00 40 */ lwz r31, 0x40(r4)
-/* 801DD250 001D8EB0 38 7F 00 D4 */ addi r3, r31, 0xd4
-/* 801DD254 001D8EB4 48 10 B0 91 */ bl NANDSetUserData
-/* 801DD258 001D8EB8 3C C0 80 1E */ lis r6, lbl_801DD174@ha
-/* 801DD25C 001D8EBC 7F C4 F3 78 */ mr r4, r30
-/* 801DD260 001D8EC0 38 7F 00 48 */ addi r3, r31, 0x48
-/* 801DD264 001D8EC4 38 FF 00 D4 */ addi r7, r31, 0xd4
-/* 801DD268 001D8EC8 38 C6 D1 74 */ addi r6, r6, lbl_801DD174@l
-/* 801DD26C 001D8ECC 38 A0 00 00 */ li r5, 0
-/* 801DD270 001D8ED0 48 10 A8 B1 */ bl NANDSeekAsync
-/* 801DD274 001D8ED4 7C 60 00 34 */ cntlzw r0, r3
-/* 801DD278 001D8ED8 54 03 D9 7E */ srwi r3, r0, 5
-lbl_801DD27C:
-/* 801DD27C 001D8EDC 80 01 00 14 */ lwz r0, 0x14(r1)
-/* 801DD280 001D8EE0 83 E1 00 0C */ lwz r31, 0xc(r1)
-/* 801DD284 001D8EE4 83 C1 00 08 */ lwz r30, 8(r1)
-/* 801DD288 001D8EE8 7C 08 03 A6 */ mtlr r0
-/* 801DD28C 001D8EEC 38 21 00 10 */ addi r1, r1, 0x10
-/* 801DD290 001D8EF0 4E 80 00 20 */ blr
-
-.global func_801DD294
-func_801DD294:
-/* 801DD294 001D8EF4 94 21 FF 40 */ stwu r1, -0xc0(r1)
-/* 801DD298 001D8EF8 7C 08 02 A6 */ mflr r0
-/* 801DD29C 001D8EFC 90 01 00 C4 */ stw r0, 0xc4(r1)
-/* 801DD2A0 001D8F00 39 61 00 C0 */ addi r11, r1, 0xc0
-/* 801DD2A4 001D8F04 4B FE 9E 79 */ bl _savegpr_24
-/* 801DD2A8 001D8F08 7C 78 1B 78 */ mr r24, r3
-/* 801DD2AC 001D8F0C 7C 99 23 78 */ mr r25, r4
-/* 801DD2B0 001D8F10 4B FF FC 05 */ bl func_801DCEB4
-/* 801DD2B4 001D8F14 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD2B8 001D8F18 41 82 00 0C */ beq lbl_801DD2C4
-/* 801DD2BC 001D8F1C 38 60 00 01 */ li r3, 1
-/* 801DD2C0 001D8F20 48 00 02 D0 */ b lbl_801DD590
-lbl_801DD2C4:
-/* 801DD2C4 001D8F24 88 18 00 00 */ lbz r0, 0(r24)
-/* 801DD2C8 001D8F28 38 80 00 00 */ li r4, 0
-/* 801DD2CC 001D8F2C 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD2D0 001D8F30 40 82 00 10 */ bne lbl_801DD2E0
-/* 801DD2D4 001D8F34 1C 04 01 90 */ mulli r0, r4, 0x190
-/* 801DD2D8 001D8F38 7F B8 02 14 */ add r29, r24, r0
-/* 801DD2DC 001D8F3C 48 00 00 E0 */ b lbl_801DD3BC
-lbl_801DD2E0:
-/* 801DD2E0 001D8F40 88 18 01 90 */ lbz r0, 0x190(r24)
-/* 801DD2E4 001D8F44 38 78 01 90 */ addi r3, r24, 0x190
-/* 801DD2E8 001D8F48 38 80 00 01 */ li r4, 1
-/* 801DD2EC 001D8F4C 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD2F0 001D8F50 40 82 00 10 */ bne lbl_801DD300
-/* 801DD2F4 001D8F54 1C 04 01 90 */ mulli r0, r4, 0x190
-/* 801DD2F8 001D8F58 7F B8 02 14 */ add r29, r24, r0
-/* 801DD2FC 001D8F5C 48 00 00 C0 */ b lbl_801DD3BC
-lbl_801DD300:
-/* 801DD300 001D8F60 88 03 01 90 */ lbz r0, 0x190(r3)
-/* 801DD304 001D8F64 38 80 00 02 */ li r4, 2
-/* 801DD308 001D8F68 38 63 01 90 */ addi r3, r3, 0x190
-/* 801DD30C 001D8F6C 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD310 001D8F70 40 82 00 10 */ bne lbl_801DD320
-/* 801DD314 001D8F74 1C 04 01 90 */ mulli r0, r4, 0x190
-/* 801DD318 001D8F78 7F B8 02 14 */ add r29, r24, r0
-/* 801DD31C 001D8F7C 48 00 00 A0 */ b lbl_801DD3BC
-lbl_801DD320:
-/* 801DD320 001D8F80 88 03 01 90 */ lbz r0, 0x190(r3)
-/* 801DD324 001D8F84 38 80 00 03 */ li r4, 3
-/* 801DD328 001D8F88 38 63 01 90 */ addi r3, r3, 0x190
-/* 801DD32C 001D8F8C 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD330 001D8F90 40 82 00 10 */ bne lbl_801DD340
-/* 801DD334 001D8F94 1C 04 01 90 */ mulli r0, r4, 0x190
-/* 801DD338 001D8F98 7F B8 02 14 */ add r29, r24, r0
-/* 801DD33C 001D8F9C 48 00 00 80 */ b lbl_801DD3BC
-lbl_801DD340:
-/* 801DD340 001D8FA0 88 03 01 90 */ lbz r0, 0x190(r3)
-/* 801DD344 001D8FA4 38 80 00 04 */ li r4, 4
-/* 801DD348 001D8FA8 38 63 01 90 */ addi r3, r3, 0x190
-/* 801DD34C 001D8FAC 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD350 001D8FB0 40 82 00 10 */ bne lbl_801DD360
-/* 801DD354 001D8FB4 1C 04 01 90 */ mulli r0, r4, 0x190
-/* 801DD358 001D8FB8 7F B8 02 14 */ add r29, r24, r0
-/* 801DD35C 001D8FBC 48 00 00 60 */ b lbl_801DD3BC
-lbl_801DD360:
-/* 801DD360 001D8FC0 88 03 01 90 */ lbz r0, 0x190(r3)
-/* 801DD364 001D8FC4 38 80 00 05 */ li r4, 5
-/* 801DD368 001D8FC8 38 63 01 90 */ addi r3, r3, 0x190
-/* 801DD36C 001D8FCC 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD370 001D8FD0 40 82 00 10 */ bne lbl_801DD380
-/* 801DD374 001D8FD4 1C 04 01 90 */ mulli r0, r4, 0x190
-/* 801DD378 001D8FD8 7F B8 02 14 */ add r29, r24, r0
-/* 801DD37C 001D8FDC 48 00 00 40 */ b lbl_801DD3BC
-lbl_801DD380:
-/* 801DD380 001D8FE0 88 03 01 90 */ lbz r0, 0x190(r3)
-/* 801DD384 001D8FE4 38 80 00 06 */ li r4, 6
-/* 801DD388 001D8FE8 38 63 01 90 */ addi r3, r3, 0x190
-/* 801DD38C 001D8FEC 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD390 001D8FF0 40 82 00 10 */ bne lbl_801DD3A0
-/* 801DD394 001D8FF4 1C 04 01 90 */ mulli r0, r4, 0x190
-/* 801DD398 001D8FF8 7F B8 02 14 */ add r29, r24, r0
-/* 801DD39C 001D8FFC 48 00 00 20 */ b lbl_801DD3BC
-lbl_801DD3A0:
-/* 801DD3A0 001D9000 88 03 01 90 */ lbz r0, 0x190(r3)
-/* 801DD3A4 001D9004 38 80 00 07 */ li r4, 7
-/* 801DD3A8 001D9008 3B A3 01 90 */ addi r29, r3, 0x190
-/* 801DD3AC 001D900C 2C 00 00 00 */ cmpwi r0, 0
-/* 801DD3B0 001D9010 40 82 00 0C */ bne lbl_801DD3BC
-/* 801DD3B4 001D9014 1C 04 01 90 */ mulli r0, r4, 0x190
-/* 801DD3B8 001D9018 7F B8 02 14 */ add r29, r24, r0
-lbl_801DD3BC:
-/* 801DD3BC 001D901C 2C 1D 00 00 */ cmpwi r29, 0
-/* 801DD3C0 001D9020 40 82 00 0C */ bne lbl_801DD3CC
-/* 801DD3C4 001D9024 38 60 00 00 */ li r3, 0
-/* 801DD3C8 001D9028 48 00 01 C8 */ b lbl_801DD590
-lbl_801DD3CC:
-/* 801DD3CC 001D902C 7F 23 CB 78 */ mr r3, r25
-/* 801DD3D0 001D9030 4B FF EF B1 */ bl func_801DC380
-/* 801DD3D4 001D9034 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD3D8 001D9038 40 82 00 0C */ bne lbl_801DD3E4
-/* 801DD3DC 001D903C 38 60 00 00 */ li r3, 0
-/* 801DD3E0 001D9040 48 00 01 B0 */ b lbl_801DD590
-lbl_801DD3E4:
-/* 801DD3E4 001D9044 7F 23 CB 78 */ mr r3, r25
-/* 801DD3E8 001D9048 4B FF EE E9 */ bl func_801DC2D0
-/* 801DD3EC 001D904C 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD3F0 001D9050 7C 7C 1B 78 */ mr r28, r3
-/* 801DD3F4 001D9054 40 82 00 0C */ bne lbl_801DD400
-/* 801DD3F8 001D9058 38 60 00 00 */ li r3, 0
-/* 801DD3FC 001D905C 48 00 01 94 */ b lbl_801DD590
-lbl_801DD400:
-/* 801DD400 001D9060 4B FF F3 61 */ bl func_801DC760
-/* 801DD404 001D9064 38 03 00 1F */ addi r0, r3, 0x1f
-/* 801DD408 001D9068 54 18 00 35 */ rlwinm. r24, r0, 0, 0, 0x1a
-/* 801DD40C 001D906C 40 82 00 0C */ bne lbl_801DD418
-/* 801DD410 001D9070 38 60 00 00 */ li r3, 0
-/* 801DD414 001D9074 48 00 01 7C */ b lbl_801DD590
-lbl_801DD418:
-/* 801DD418 001D9078 80 6D 96 2C */ lwz r3, lbl_8063E8EC-_SDA_BASE_(r13)
-/* 801DD41C 001D907C 3C 80 00 20 */ lis r4, 0x20
-/* 801DD420 001D9080 4B FF D8 75 */ bl func_801DAC94
-/* 801DD424 001D9084 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD428 001D9088 7C 7B 1B 78 */ mr r27, r3
-/* 801DD42C 001D908C 40 82 00 0C */ bne lbl_801DD438
-/* 801DD430 001D9090 38 60 00 00 */ li r3, 0
-/* 801DD434 001D9094 48 00 01 5C */ b lbl_801DD590
-lbl_801DD438:
-/* 801DD438 001D9098 38 00 00 01 */ li r0, 1
-/* 801DD43C 001D909C 38 7D 00 02 */ addi r3, r29, 2
-/* 801DD440 001D90A0 98 1D 00 00 */ stb r0, 0(r29)
-/* 801DD444 001D90A4 38 8D 84 38 */ addi r4, r13, lbl_8063D6F8-_SDA_BASE_
-/* 801DD448 001D90A8 98 1D 00 01 */ stb r0, 1(r29)
-/* 801DD44C 001D90AC 4B FF 0E 85 */ bl strcpy
-/* 801DD450 001D90B0 7F 24 CB 78 */ mr r4, r25
-/* 801DD454 001D90B4 38 7D 00 02 */ addi r3, r29, 2
-/* 801DD458 001D90B8 38 A0 00 0C */ li r5, 0xc
-/* 801DD45C 001D90BC 4B FF 0F A5 */ bl strncat
-/* 801DD460 001D90C0 38 7D 00 02 */ addi r3, r29, 2
-/* 801DD464 001D90C4 3B 40 00 00 */ li r26, 0
-/* 801DD468 001D90C8 38 80 00 30 */ li r4, 0x30
-/* 801DD46C 001D90CC 38 A0 00 00 */ li r5, 0
-/* 801DD470 001D90D0 48 10 A1 09 */ bl NANDCreate
-/* 801DD474 001D90D4 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD478 001D90D8 41 82 00 0C */ beq lbl_801DD484
-/* 801DD47C 001D90DC 2C 03 FF FA */ cmpwi r3, -6
-/* 801DD480 001D90E0 40 82 00 D0 */ bne lbl_801DD550
-lbl_801DD484:
-/* 801DD484 001D90E4 38 7D 00 02 */ addi r3, r29, 2
-/* 801DD488 001D90E8 38 81 00 08 */ addi r4, r1, 8
-/* 801DD48C 001D90EC 38 A0 00 03 */ li r5, 3
-/* 801DD490 001D90F0 48 10 AF 79 */ bl NANDOpen
-/* 801DD494 001D90F4 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD498 001D90F8 40 82 00 B8 */ bne lbl_801DD550
-/* 801DD49C 001D90FC 3B 20 00 00 */ li r25, 0
-/* 801DD4A0 001D9100 3F E0 00 20 */ lis r31, 0x20
-lbl_801DD4A4:
-/* 801DD4A4 001D9104 7C 18 F8 40 */ cmplw r24, r31
-/* 801DD4A8 001D9108 3F C0 00 20 */ lis r30, 0x20
-/* 801DD4AC 001D910C 40 80 00 08 */ bge lbl_801DD4B4
-/* 801DD4B0 001D9110 7F 1E C3 78 */ mr r30, r24
-lbl_801DD4B4:
-/* 801DD4B4 001D9114 7F 83 E3 78 */ mr r3, r28
-/* 801DD4B8 001D9118 7F 64 DB 78 */ mr r4, r27
-/* 801DD4BC 001D911C 7F C5 F3 78 */ mr r5, r30
-/* 801DD4C0 001D9120 7F 26 CB 78 */ mr r6, r25
-/* 801DD4C4 001D9124 38 E0 00 02 */ li r7, 2
-/* 801DD4C8 001D9128 4B FF F1 35 */ bl func_801DC5FC
-/* 801DD4CC 001D912C 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD4D0 001D9130 40 80 00 34 */ bge lbl_801DD504
-/* 801DD4D4 001D9134 2C 03 FF FF */ cmpwi r3, -1
-/* 801DD4D8 001D9138 40 82 00 10 */ bne lbl_801DD4E8
-lbl_801DD4DC:
-/* 801DD4DC 001D913C 80 6D A3 40 */ lwz r3, lbl_8063F600-_SDA_BASE_(r13)
-/* 801DD4E0 001D9140 48 04 70 A9 */ bl func_80224588
-/* 801DD4E4 001D9144 4B FF FF F8 */ b lbl_801DD4DC
-lbl_801DD4E8:
-/* 801DD4E8 001D9148 80 6D 96 2C */ lwz r3, lbl_8063E8EC-_SDA_BASE_(r13)
-/* 801DD4EC 001D914C 7F 64 DB 78 */ mr r4, r27
-/* 801DD4F0 001D9150 4B FF D8 59 */ bl func_801DAD48
-/* 801DD4F4 001D9154 7F 83 E3 78 */ mr r3, r28
-/* 801DD4F8 001D9158 4B FF F1 CD */ bl func_801DC6C4
-/* 801DD4FC 001D915C 38 60 00 00 */ li r3, 0
-/* 801DD500 001D9160 48 00 00 90 */ b lbl_801DD590
-lbl_801DD504:
-/* 801DD504 001D9164 7F 64 DB 78 */ mr r4, r27
-/* 801DD508 001D9168 7F C5 F3 78 */ mr r5, r30
-/* 801DD50C 001D916C 38 61 00 08 */ addi r3, r1, 8
-/* 801DD510 001D9170 48 10 A4 91 */ bl NANDWrite
-/* 801DD514 001D9174 7C 03 F0 00 */ cmpw r3, r30
-/* 801DD518 001D9178 41 82 00 10 */ beq lbl_801DD528
-/* 801DD51C 001D917C 38 61 00 08 */ addi r3, r1, 8
-/* 801DD520 001D9180 48 10 B1 69 */ bl NANDClose
-/* 801DD524 001D9184 48 00 00 10 */ b lbl_801DD534
-lbl_801DD528:
-/* 801DD528 001D9188 7F 1E C0 51 */ subf. r24, r30, r24
-/* 801DD52C 001D918C 7F 39 F2 14 */ add r25, r25, r30
-/* 801DD530 001D9190 40 82 FF 74 */ bne lbl_801DD4A4
-lbl_801DD534:
-/* 801DD534 001D9194 38 61 00 08 */ addi r3, r1, 8
-/* 801DD538 001D9198 48 10 B1 51 */ bl NANDClose
-/* 801DD53C 001D919C 2C 03 00 00 */ cmpwi r3, 0
-/* 801DD540 001D91A0 40 82 00 10 */ bne lbl_801DD550
-/* 801DD544 001D91A4 38 00 00 00 */ li r0, 0
-/* 801DD548 001D91A8 3B 40 00 01 */ li r26, 1
-/* 801DD54C 001D91AC 98 1D 00 01 */ stb r0, 1(r29)
-lbl_801DD550:
-/* 801DD550 001D91B0 2C 1B 00 00 */ cmpwi r27, 0
-/* 801DD554 001D91B4 41 82 00 10 */ beq lbl_801DD564
-/* 801DD558 001D91B8 80 6D 96 2C */ lwz r3, lbl_8063E8EC-_SDA_BASE_(r13)
-/* 801DD55C 001D91BC 7F 64 DB 78 */ mr r4, r27
-/* 801DD560 001D91C0 4B FF D7 E9 */ bl func_801DAD48
-lbl_801DD564:
-/* 801DD564 001D91C4 7F 83 E3 78 */ mr r3, r28
-/* 801DD568 001D91C8 4B FF F1 5D */ bl func_801DC6C4
-/* 801DD56C 001D91CC 2C 1A 00 00 */ cmpwi r26, 0
-/* 801DD570 001D91D0 41 82 00 14 */ beq lbl_801DD584
-/* 801DD574 001D91D4 38 00 00 00 */ li r0, 0
-/* 801DD578 001D91D8 38 60 00 01 */ li r3, 1
-/* 801DD57C 001D91DC 98 1D 00 01 */ stb r0, 1(r29)
-/* 801DD580 001D91E0 48 00 00 10 */ b lbl_801DD590
-lbl_801DD584:
-/* 801DD584 001D91E4 38 00 00 00 */ li r0, 0
-/* 801DD588 001D91E8 38 60 00 01 */ li r3, 1
-/* 801DD58C 001D91EC 98 1D 00 00 */ stb r0, 0(r29)
-lbl_801DD590:
-/* 801DD590 001D91F0 39 61 00 C0 */ addi r11, r1, 0xc0
-/* 801DD594 001D91F4 4B FE 9B D5 */ bl _restgpr_24
-/* 801DD598 001D91F8 80 01 00 C4 */ lwz r0, 0xc4(r1)
-/* 801DD59C 001D91FC 7C 08 03 A6 */ mtlr r0
-/* 801DD5A0 001D9200 38 21 00 C0 */ addi r1, r1, 0xc0
-/* 801DD5A4 001D9204 4E 80 00 20 */ blr
-
-.global func_801DD5A8
-func_801DD5A8:
-/* 801DD5A8 001D9208 38 A0 00 01 */ li r5, 1
-/* 801DD5AC 001D920C 38 6D A0 80 */ addi r3, r13, lbl_8063F340-_SDA_BASE_
-/* 801DD5B0 001D9210 38 80 00 04 */ li r4, 4
-/* 801DD5B4 001D9214 38 00 00 00 */ li r0, 0
-/* 801DD5B8 001D9218 98 AD A0 80 */ stb r5, lbl_8063F340-_SDA_BASE_(r13)
-/* 801DD5BC 001D921C B0 83 00 02 */ sth r4, 2(r3)
-/* 801DD5C0 001D9220 98 03 00 04 */ stb r0, 4(r3)
-/* 801DD5C4 001D9224 4E 80 00 20 */ blr
diff --git a/asm/ctors_2.s b/asm/ctors_2.s
index f165010..61dcaf4 100644
--- a/asm/ctors_2.s
+++ b/asm/ctors_2.s
@@ -2,7 +2,7 @@
.section .ctors, "wa" # 0x803E1E60 - 0x803E22A0
-.4byte func_801DD5A8, func_801DD8A0, func_801DDF58
+.4byte func_801DD8A0, func_801DDF58
.4byte func_801DF020, func_801E07C8, func_801E07F0, func_801E0A34
.4byte func_801E4308, func_801E472C, func_801E5F5C, func_801E6BD8
.4byte func_801ED364, func_801EE024, func_801F1A68, func_801F40C0
diff --git a/asm/sbss_2.s b/asm/sbss_2.s
index ea6adaf..12fe2f4 100644
--- a/asm/sbss_2.s
+++ b/asm/sbss_2.s
@@ -1,11 +1,8 @@
.section .sbss, "wa" # 0x80474F00 - 0x80643050
-.global lbl_8063F33C
-lbl_8063F33C:
- .skip 0x4
-.global lbl_8063F340
-lbl_8063F340:
- .skip 0x8
+.global lbl_8063F346
+lbl_8063F346:
+ .skip 0x2
.global lbl_8063F348
lbl_8063F348:
.skip 0x8
diff --git a/asm/sdata_2.s b/asm/sdata_2.s
index fd701fb..cc4ce9a 100644
--- a/asm/sdata_2.s
+++ b/asm/sdata_2.s
@@ -2,9 +2,9 @@
.section .sdata, "wa" # 0x8063D2C0 - 0x8063E8E0
-.global lbl_8063D6F8
-lbl_8063D6F8:
- .incbin "baserom.dol", 0x471438, 0x70
+.global lbl_8063D6FE
+lbl_8063D6FE:
+ .incbin "baserom.dol", 0x47143E, 0x6A
.global lbl_8063D768
lbl_8063D768:
.incbin "baserom.dol", 0x4714A8, 0x38
diff --git a/include/libstdc++/qsort.h b/include/MSL_C/MSL_Common/qsort.h
index c13ae0e..c13ae0e 100644
--- a/include/libstdc++/qsort.h
+++ b/include/MSL_C/MSL_Common/qsort.h
diff --git a/include/MSL_C/stdlib.h b/include/MSL_C/stdlib.h
new file mode 100644
index 0000000..bf86bca
--- /dev/null
+++ b/include/MSL_C/stdlib.h
@@ -0,0 +1,15 @@
+#ifndef POKEREVO_STDLIB_H
+#define POKEREVO_STDLIB_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void qsort(void *base, u32 nmemb, u32 size,
+ s32 (*compar)(const void *, const void *));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_STDLIB_H
diff --git a/include/MSL_C/string.h b/include/MSL_C/string.h
new file mode 100644
index 0000000..7b4755c
--- /dev/null
+++ b/include/MSL_C/string.h
@@ -0,0 +1,22 @@
+#ifndef POKEREVO_STRING_H
+#define POKEREVO_STRING_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void *memset(void *s, int c, size_t n);
+void *memmove(void *dest, const void *src, size_t n);
+void *memcpy(void *dest, const void *src, size_t n);
+int strcmp(const char *s1, const char *s2);
+int strncmp(const char *s1, const char *s2, size_t n);
+char *strcpy(char *dest, const char *src);
+char *strncpy(char *dest, const char *src, size_t n);
+char *strcat(char *dest, const char *src);
+char *strncat(char *dest, const char *src, size_t n);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_STRING_H
diff --git a/include/libstdc++/CPlusLib.h b/include/Runtime/MWCPlusLib.h
index 819c0a9..f8ede23 100644
--- a/include/libstdc++/CPlusLib.h
+++ b/include/Runtime/MWCPlusLib.h
@@ -1,5 +1,5 @@
-#ifndef POKEREVO_CPLUSLIB_H
-#define POKEREVO_CPLUSLIB_H
+#ifndef POKEREVO_MWCPLUSLIB_H
+#define POKEREVO_MWCPLUSLIB_H
#ifdef __cplusplus
extern "C" {
@@ -11,4 +11,4 @@ void __ptmf_scall(...);
}
#endif
-#endif //POKEREVO_CPLUSLIB_H
+#endif //POKEREVO_MWCPLUSLIB_H
diff --git a/include/SDK/DVD/dvdfs.h b/include/SDK/DVD/dvdfs.h
index a5283eb..8687730 100644
--- a/include/SDK/DVD/dvdfs.h
+++ b/include/SDK/DVD/dvdfs.h
@@ -9,14 +9,12 @@ typedef struct DVDFileInfo DVDFileInfo;
typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo);
+// sizeof DVDFileInfo >= 0x3C
struct DVDFileInfo
{
u8 unk0[0x34];
- size_t unk34;
- u8 unk38[0x8];
- void (*unk40)(s32, void*);
- void* unk44;
- u32 unk48;
+ size_t fileSz;
+ u8 unk38[0x4];
};
BOOL DVDOpen(const char*, DVDFileInfo*);
@@ -26,7 +24,7 @@ s32 DVDReadPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, s32 p
s32 DVDReadAsyncPrio(DVDFileInfo* fileInfo, void* addr, s32 length, s32 offset, DVDCallback callback, s32 prio);
s32 DVDSeekAsyncPrio(DVDFileInfo* fileInfo, s32 offset, DVDCallback callback, s32 prio);
-
+#define DVDGetLength(info) ((info)->fileSz)
#ifdef __cplusplus
}
diff --git a/include/GameSpy/darray.h b/include/SDK/DWC/gamespy/darray.h
index 5c7c170..5c7c170 100644
--- a/include/GameSpy/darray.h
+++ b/include/SDK/DWC/gamespy/darray.h
diff --git a/include/GameSpy/hashtable.h b/include/SDK/DWC/gamespy/hashtable.h
index 26e0b6d..beb4812 100644
--- a/include/GameSpy/hashtable.h
+++ b/include/SDK/DWC/gamespy/hashtable.h
@@ -5,7 +5,7 @@
extern "C" {
#endif
-#include "GameSpy/darray.h"
+#include <DWC/gamespy/darray.h>
typedef s32 (*HashFunction)(void *, s32);
diff --git a/include/GameSpy/nonport.h b/include/SDK/DWC/gamespy/nonport.h
index c1ed0e7..c1ed0e7 100644
--- a/include/GameSpy/nonport.h
+++ b/include/SDK/DWC/gamespy/nonport.h
diff --git a/include/SDK/NAND/NANDOpenClose.h b/include/SDK/NAND/NANDOpenClose.h
new file mode 100644
index 0000000..2b5f52f
--- /dev/null
+++ b/include/SDK/NAND/NANDOpenClose.h
@@ -0,0 +1,17 @@
+#ifndef POKEREVO_NANDOPENCLOSE_H
+#define POKEREVO_NANDOPENCLOSE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <SDK/NAND/nand.h>
+
+s32 NANDOpen(const char* path, NANDFileInfo* info, u8 accType);
+s32 NANDClose(NANDFileInfo* info);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_NANDOPENCLOSE_H
diff --git a/include/SDK/NAND/nand.h b/include/SDK/NAND/nand.h
new file mode 100644
index 0000000..ac2f655
--- /dev/null
+++ b/include/SDK/NAND/nand.h
@@ -0,0 +1,38 @@
+#ifndef POKEREVO_NAND_NAND_H
+#define POKEREVO_NAND_NAND_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// NOTE: size >= 0x8B, putting 0x8C for now
+typedef struct NANDFileInfo
+{
+ u8 unk0[0x8C];
+} NANDFileInfo;
+
+// TODO: placeholder size
+typedef struct NANDCommandBlock
+{
+ u8 unk0[0x4];
+} NANDCommandBlock;
+
+typedef void (*NANDCallback)(s32 result, NANDCommandBlock* block);
+
+s32 NANDGetLength(NANDFileInfo* info, u32* length);
+s32 NANDSeek(NANDFileInfo* info, s32 offset, s32 whence);
+s32 NANDSeekAsync(NANDFileInfo* info, s32 offset, s32 whence, NANDCallback cb, NANDCommandBlock* block);
+s32 NANDRead(NANDFileInfo* info, void* buf, u32 length);
+s32 NANDReadAsync(NANDFileInfo* info, void* buf, u32 length, NANDCallback cb, NANDCommandBlock* block);
+void* NANDGetUserData(const NANDCommandBlock* block);
+void NANDSetUserData(NANDCommandBlock* block, void* data);
+s32 NANDCreate(const char* fileName, u8 perm, u8 attr);
+s32 NANDWrite(NANDFileInfo* info, const void* buf, u32 length);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_NAND_NAND_H
diff --git a/include/SDK/nand.h b/include/SDK/nand.h
index c20ee68..1e055e2 100644
--- a/include/SDK/nand.h
+++ b/include/SDK/nand.h
@@ -5,7 +5,9 @@
extern "C" {
#endif
-#include "SDK/NAND/NANDCore.h"
+#include <SDK/NAND/nand.h>
+#include <SDK/NAND/NANDCore.h>
+#include <SDK/NAND/NANDOpenClose.h>
#ifdef __cplusplus
}
diff --git a/include/code_801DBE90.h b/include/code_801DBE90.h
index 49889e7..3531815 100644
--- a/include/code_801DBE90.h
+++ b/include/code_801DBE90.h
@@ -7,13 +7,18 @@ extern "C" {
#include "SDK/dvd.h"
#include "SDK/mem.h"
+#include "code_801DCE6C.h"
struct gUnkClass5
{
u8 unk0;
- u8 unk1;
+ u8 unk1; // flag: indicates NAND file opened/closed?
u8 unk2[0x2];
DVDFileInfo unk4;
+ gUnkClass6* unk40; // TODO: determine type
+ void (*unk44)(s32, void*);
+ void* unk48; // NANDReadAsync addr
+ u32 unk4C; // NANDReadAsync size
};
BOOL func_801DC0C8(size_t p1, u32 p2);
@@ -26,12 +31,12 @@ BOOL func_801DC6C4(gUnkClass5* p1);
size_t func_801DC760(gUnkClass5* p1);
BOOL func_801DC7F8(gUnkClass5* p1, s32 offset, void (*p3)(s32, void*));
u8* func_801DCBC0(const char* fileName, u32* fileSz);
-void* func_801DCCAC(const char* fileName, MEMHeapHandle heap, u32* fileSz);
+u8* func_801DCCAC(const char* fileName, MEMHeapHandle heap, u32* fileSz);
BOOL func_801DCD94(const char* fileName);
void func_801DCDB8(void (*p1)(u32), void (*p2)(void));
u32 func_801DCDC4(void);
void func_801DCE38(void);
-u8 func_801DCE44(void);
+BOOL func_801DCE44(void);
#ifdef __cplusplus
}
diff --git a/include/code_801DCE6C.h b/include/code_801DCE6C.h
index f06b185..a9e90cb 100644
--- a/include/code_801DCE6C.h
+++ b/include/code_801DCE6C.h
@@ -1,31 +1,38 @@
#ifndef POKEREVO_CODE_801DCE6C_H
#define POKEREVO_CODE_801DCE6C_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <SDK/nand.h>
-#include "code_801DBE90.h"
+struct gUnkClass5;
-struct gUnkClass4
+struct gUnkClass6
{
- u8 unk0[0x2];
- char unk2[0x5];
- char unk7[0xC79];
+ u8 unk0;
+ u8 unk1;
+ char unk2[0x46];
+ NANDFileInfo unk48;
+ NANDCommandBlock block;
+ u8 unkD8[0xB8];
- gUnkClass4(void);
+ const char* func_801DCE6C(void) const;
+ const char* func_801DCE74(void) const;
};
-u32 func_801DCF74(gUnkClass4*, const char*, gUnkClass5*);
-u32 func_801DCF48(gUnkClass4*, const char*);
-s32 func_801DD084(gUnkClass4* p1, gUnkClass5* p2, void* addr, s32 length, s32 offset);
-void* func_801DD220(gUnkClass4*, gUnkClass5*, void*, u32, s32);
-u32 func_801DCFE4(gUnkClass4*, gUnkClass5*);
-u32 func_801DD03C(gUnkClass4*, gUnkClass5*, u32*);
-BOOL func_801DD294(gUnkClass4*, const char*, s32);
-
-#ifdef __cplusplus
-}
-#endif
+class gUnkClass4
+{
+ enum { ArrLength_ = 8 };
+ gUnkClass6 arr_[ArrLength_];
+
+ gUnkClass6* func_801DCEB4(const char* p2);
+public:
+ gUnkClass4(void);
+ BOOL func_801DCF48(const char* p2);
+ BOOL func_801DCF74(const char* fileName, gUnkClass5* fp);
+ BOOL func_801DCFE4(gUnkClass5* fp) const;
+ BOOL func_801DD03C(gUnkClass5* fp, u32* fileSz) const;
+ s32 func_801DD084(gUnkClass5* fp, void* addr, s32 length, s32 offset) const;
+ BOOL func_801DD220(gUnkClass5* fp, void*, u32, s32 offset) const;
+ BOOL func_801DD294(const char *fileName, s32);
+};
#endif //POKEREVO_CODE_801DCE6C_H
diff --git a/obj_files.mk b/obj_files.mk
index 7b81b23..f8b1986 100644
--- a/obj_files.mk
+++ b/obj_files.mk
@@ -226,7 +226,6 @@ SPLIT_O_FILES := \
$(BUILD_DIR)/src/code_801DBB3C.o \
$(BUILD_DIR)/src/code_801DBE90.o \
$(BUILD_DIR)/src/code_801DCE6C.o \
- $(BUILD_DIR)/asm/code_801DCE6C_asm.o \
$(BUILD_DIR)/asm/code_801DD5C8.o \
$(BUILD_DIR)/asm/code_801DD8C0.o \
$(BUILD_DIR)/asm/code_801DDF78.o \
@@ -663,57 +662,57 @@ SPLIT_O_FILES := \
$(BUILD_DIR)/asm/SDK/DWC/dwcsec_account/dwc_account.o \
$(BUILD_DIR)/asm/SDK/DWC/dwcsec_auth/dwc_auth_interface.o \
$(BUILD_DIR)/asm/SDK/DWC/dwcsec_nas/dwc_naslogin.o \
- $(BUILD_DIR)/src/GameSpy/darray.o \
- $(BUILD_DIR)/src/GameSpy/hashtable.o \
- $(BUILD_DIR)/asm/GameSpy/md5c.o \
- $(BUILD_DIR)/asm/GameSpy/nonport.o \
- $(BUILD_DIR)/asm/GameSpy/gsAvailable.o \
- $(BUILD_DIR)/asm/GameSpy/gsCrypt.o \
- $(BUILD_DIR)/asm/GameSpy/gsLargeInt.o \
- $(BUILD_DIR)/asm/GameSpy/gsRC4.o \
- $(BUILD_DIR)/asm/GameSpy/gsSHA1.o \
- $(BUILD_DIR)/asm/GameSpy/gsXML.o \
- $(BUILD_DIR)/asm/GameSpy/gp.o \
- $(BUILD_DIR)/asm/GameSpy/gpi.o \
- $(BUILD_DIR)/asm/GameSpy/gpiBuddy.o \
- $(BUILD_DIR)/asm/GameSpy/gpiBuffer.o \
- $(BUILD_DIR)/asm/GameSpy/gpiCallback.o \
- $(BUILD_DIR)/asm/GameSpy/gpiConnect.o \
- $(BUILD_DIR)/asm/GameSpy/gpiInfo.o \
- $(BUILD_DIR)/asm/GameSpy/gpiOperation.o \
- $(BUILD_DIR)/asm/GameSpy/gpiPeer.o \
- $(BUILD_DIR)/asm/GameSpy/gpiProfile.o \
- $(BUILD_DIR)/asm/GameSpy/gpiSearch.o \
- $(BUILD_DIR)/asm/GameSpy/gpiTransfer.o \
- $(BUILD_DIR)/asm/GameSpy/gpiUnique.o \
- $(BUILD_DIR)/asm/GameSpy/gpiUtility.o \
- $(BUILD_DIR)/asm/GameSpy/gt2Auth.o \
- $(BUILD_DIR)/asm/GameSpy/gt2Buffer.o \
- $(BUILD_DIR)/asm/GameSpy/gt2Callback.o \
- $(BUILD_DIR)/asm/GameSpy/gt2Connection.o \
- $(BUILD_DIR)/asm/GameSpy/gt2Main.o \
- $(BUILD_DIR)/asm/GameSpy/gt2Message.o \
- $(BUILD_DIR)/asm/GameSpy/gt2Socket.o \
- $(BUILD_DIR)/asm/GameSpy/gt2Utility.o \
- $(BUILD_DIR)/asm/GameSpy/qr2.o \
- $(BUILD_DIR)/asm/GameSpy/qr2regkeys.o \
- $(BUILD_DIR)/asm/GameSpy/ghttpBuffer.o \
- $(BUILD_DIR)/asm/GameSpy/ghttpCallbacks.o \
- $(BUILD_DIR)/asm/GameSpy/ghttpCommon.o \
- $(BUILD_DIR)/asm/GameSpy/ghttpConnection.o \
- $(BUILD_DIR)/asm/GameSpy/ghttpEncryption.o \
- $(BUILD_DIR)/asm/GameSpy/ghttpMain.o \
- $(BUILD_DIR)/asm/GameSpy/ghttpPost.o \
- $(BUILD_DIR)/asm/GameSpy/ghttpProcess.o \
- $(BUILD_DIR)/asm/GameSpy/gbucket.o \
- $(BUILD_DIR)/asm/GameSpy/gstats.o \
- $(BUILD_DIR)/asm/GameSpy/NATify.o \
- $(BUILD_DIR)/asm/GameSpy/natneg.o \
- $(BUILD_DIR)/asm/GameSpy/sb_crypt.o \
- $(BUILD_DIR)/asm/GameSpy/sb_queryengine.o \
- $(BUILD_DIR)/asm/GameSpy/sb_server.o \
- $(BUILD_DIR)/asm/GameSpy/sb_serverbrowsing.o \
- $(BUILD_DIR)/asm/GameSpy/sb_serverlist.o \
+ $(BUILD_DIR)/src/SDK/DWC/gamespy/darray.o \
+ $(BUILD_DIR)/src/SDK/DWC/gamespy/hashtable.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/md5c.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/nonport.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gsAvailable.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gsCrypt.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gsLargeInt.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gsRC4.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gsSHA1.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gsXML.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gp.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpi.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiBuddy.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiBuffer.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiCallback.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiConnect.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiInfo.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiOperation.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiPeer.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiProfile.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiSearch.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiTransfer.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiUnique.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gpiUtility.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gt2Auth.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gt2Buffer.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gt2Callback.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gt2Connection.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gt2Main.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gt2Message.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gt2Socket.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gt2Utility.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/qr2.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/qr2regkeys.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/ghttpBuffer.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/ghttpCallbacks.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/ghttpCommon.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/ghttpConnection.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/ghttpEncryption.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/ghttpMain.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/ghttpPost.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/ghttpProcess.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gbucket.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/gstats.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/NATify.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/natneg.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/sb_crypt.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/sb_queryengine.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/sb_server.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/sb_serverbrowsing.o \
+ $(BUILD_DIR)/asm/SDK/DWC/gamespy/sb_serverlist.o \
$(BUILD_DIR)/asm/nw4r/db/db_console.o \
$(BUILD_DIR)/asm/text_10_2.o \
$(BUILD_DIR)/asm/nw4r/db/db_assert.o \
diff --git a/src/Runtime/ptmf.c b/src/Runtime/ptmf.c
index 297039c..6c8b6a8 100644
--- a/src/Runtime/ptmf.c
+++ b/src/Runtime/ptmf.c
@@ -1,6 +1,5 @@
-#include "CPlusLib.h"
-
#pragma internal on
+#include <Runtime/MWCPlusLib.h>
asm void __ptmf_scall(...)
{
diff --git a/src/GameSpy/darray.c b/src/SDK/DWC/gamespy/darray.c
index 7f84cb0..5259a9f 100644
--- a/src/GameSpy/darray.c
+++ b/src/SDK/DWC/gamespy/darray.c
@@ -1,13 +1,10 @@
-#include "types.h"
-#include "libstdc++/qsort.h"
-#include "GameSpy/nonport.h"
-#include "GameSpy/darray.h"
+#include <stdlib.h>
+#include <string.h>
+#include <DWC/gamespy/nonport.h>
+#include <DWC/gamespy/darray.h>
#pragma auto_inline on
-extern void *memcpy(void *, const void *, u32);
-extern void *memmove(void *, const void *, u32);
-
static inline void ArrayInsert(DArray *d, void *elem, s32 n)
{
if (d->size == d->capacity) {
diff --git a/src/GameSpy/hashtable.c b/src/SDK/DWC/gamespy/hashtable.c
index 0e1c09a..0c6d3c8 100644
--- a/src/GameSpy/hashtable.c
+++ b/src/SDK/DWC/gamespy/hashtable.c
@@ -1,6 +1,5 @@
-#include "types.h"
-#include "GameSpy/nonport.h"
-#include "GameSpy/hashtable.h"
+#include <DWC/gamespy/nonport.h>
+#include <DWC/gamespy/hashtable.h>
HashTable *TableNew(u32 p1, s32 p2, HashFunction hf, CompareFunction cmp, DtorFunction dtor)
{
diff --git a/src/code_801DAA30.cpp b/src/code_801DAA30.cpp
index c8f0756..3b6494b 100644
--- a/src/code_801DAA30.cpp
+++ b/src/code_801DAA30.cpp
@@ -1,4 +1,3 @@
-#include "types.h"
#include "ctorStruct.h"
#include "code_801DAAE0.h"
diff --git a/src/code_801DAAE0.cpp b/src/code_801DAAE0.cpp
index dd5e504..0db2018 100644
--- a/src/code_801DAAE0.cpp
+++ b/src/code_801DAAE0.cpp
@@ -1,7 +1,6 @@
-#include "types.h"
#include "ctorStruct.h"
-#include "Runtime/__mem.h"
-#include "SDK/mem.h"
+#include <string.h>
+#include <SDK/mem.h>
#include "code_801DAAE0.h"
namespace
diff --git a/src/code_801DB040.cpp b/src/code_801DB040.cpp
index ce9740a..d895c88 100644
--- a/src/code_801DB040.cpp
+++ b/src/code_801DB040.cpp
@@ -1,7 +1,6 @@
-#include "types.h"
#include "ctorStruct.h"
-#include "Runtime/__mem.h"
-#include "SDK/mem.h"
+#include <string.h>
+#include <SDK/mem.h>
#include "code_801DAAE0.h"
#include "code_801DBB3C.h"
#include "code_801DB040.h"
diff --git a/src/code_801DB81C.cpp b/src/code_801DB81C.cpp
index 95af182..0bb754c 100644
--- a/src/code_801DB81C.cpp
+++ b/src/code_801DB81C.cpp
@@ -1,6 +1,5 @@
-#include "types.h"
#include "ctorStruct.h"
-#include "SDK/os.h"
+#include <SDK/os.h>
#include "code_801DB81C.h"
namespace
diff --git a/src/code_801DBB3C.cpp b/src/code_801DBB3C.cpp
index 5037b5a..bfaa7cd 100644
--- a/src/code_801DBB3C.cpp
+++ b/src/code_801DBB3C.cpp
@@ -1,6 +1,5 @@
-#include "types.h"
#include "ctorStruct.h"
-#include "Runtime/__mem.h"
+#include <string.h>
#include "code_801DAAE0.h"
#include "code_801DB040.h"
#include "code_801DBB3C.h"
diff --git a/src/code_801DBE90.cpp b/src/code_801DBE90.cpp
index 5184c42..7534f0d 100644
--- a/src/code_801DBE90.cpp
+++ b/src/code_801DBE90.cpp
@@ -1,10 +1,9 @@
-#include "types.h"
#include "ctorStruct.h"
-#include "Runtime/__mem.h"
-#include "SDK/mem.h"
-#include "SDK/os.h"
-#include "SDK/dvd.h"
-#include "SDK/nand.h"
+#include <string.h>
+#include <SDK/mem.h>
+#include <SDK/os.h>
+#include <SDK/dvd.h>
+#include <SDK/nand.h>
#include "code_801DAAE0.h"
#include "code_801DCE6C.h"
#include "code_80223C54.h"
@@ -58,7 +57,7 @@ static void func_801DBEA0(void)
gUnk8063F324[i].unk0 = 0;
}
-static gUnkClass5 *func_801DBED0(void)
+static gUnkClass5* func_801DBED0(void)
{
BOOL enable = OSDisableInterrupts();
gUnkClass5* r31 = NULL;
@@ -95,9 +94,9 @@ static void func_801DBFEC(s32 p1, DVDFileInfo* p2)
{
if (gUnk8063F31F == 0) {
gUnkClass5* r31 = func_801DBF98(p2);
- if (r31 && r31->unk4.unk40) {
- DCInvalidateRange(r31->unk4.unk44, r31->unk4.unk48);
- r31->unk4.unk40(p1, r31);
+ if (r31 && r31->unk44) {
+ DCInvalidateRange(r31->unk48, r31->unk4C);
+ r31->unk44(p1, r31);
}
}
}
@@ -106,8 +105,8 @@ static void func_801DC068(s32 p1, DVDFileInfo* p2)
{
if (gUnk8063F31F == 0) {
gUnkClass5* r3 = func_801DBF98(p2);
- if (r3 && r3->unk4.unk40)
- r3->unk4.unk40(p1, r3);
+ if (r3 && r3->unk44)
+ r3->unk44(p1, r3);
}
}
@@ -184,7 +183,7 @@ gUnkClass5* func_801DC2D0(const char* fileName)
gUnkClass5* fp = func_801DBED0();
if (!fp)
return NULL;
- if (gUnk8063F338 && func_801DCF74(gUnk8063F338, fileName, fp))
+ if (gUnk8063F338 && gUnk8063F338->func_801DCF74(fileName, fp))
return fp;
if (!DVDOpen(fileName, &fp->unk4)) {
func_801DBF60(fp);
@@ -197,7 +196,7 @@ BOOL func_801DC380(const char* fileName)
{
if (!gUnk8063F31E)
return FALSE;
- if (gUnk8063F338 && func_801DCF48(gUnk8063F338, fileName))
+ if (gUnk8063F338 && gUnk8063F338->func_801DCF48(fileName))
return TRUE;
if (DVDConvertPathToEntrynum(fileName) == -1)
return FALSE;
@@ -219,7 +218,7 @@ s32 func_801DC3FC(gUnkClass5* p1, void* addr, s32 length, s32 offset)
return -1;
if (gUnk8063F338 && p1->unk1) {
- s32 r3 = func_801DD084(gUnk8063F338, p1, addr, length, offset);
+ s32 r3 = gUnk8063F338->func_801DD084(p1, addr, length, offset);
if (r3 > 0)
return r3;
}
@@ -233,7 +232,7 @@ BOOL func_801DC4F0(gUnkClass5* p1, void* addr, u32 len, s32 offset, void (*p5)(s
func_801DC264();
if (!p1)
return FALSE;
- p1->unk4.unk40 = p5;
+ p1->unk44 = p5;
if ((u32)addr & 0x1F)
return FALSE;
if (len & 0x1F)
@@ -241,9 +240,9 @@ BOOL func_801DC4F0(gUnkClass5* p1, void* addr, u32 len, s32 offset, void (*p5)(s
if (offset & 0x3)
return FALSE;
- p1->unk4.unk44 = addr;
- p1->unk4.unk48 = len;
- if (gUnk8063F338 && p1->unk1 && func_801DD220(gUnk8063F338, p1, addr, len, offset))
+ p1->unk48 = addr;
+ p1->unk4C = len;
+ if (gUnk8063F338 && p1->unk1 && gUnk8063F338->func_801DD220(p1, addr, len, offset))
return TRUE;
return DVDReadAsyncPrio(&p1->unk4, addr, (s32)len, offset, &func_801DBFEC, 2) != 0;
}
@@ -274,7 +273,7 @@ BOOL func_801DC6C4(gUnkClass5* p1)
func_801DC264();
if (!p1)
return FALSE;
- if (gUnk8063F338 && func_801DCFE4(gUnk8063F338, p1)) {
+ if (gUnk8063F338 && gUnk8063F338->func_801DCFE4(p1)) {
func_801DBF60(p1);
return TRUE;
}
@@ -291,9 +290,9 @@ size_t func_801DC760(gUnkClass5* p1)
func_801DC264();
if (!p1)
return 0;
- if (gUnk8063F338 && func_801DD03C(gUnk8063F338, p1, &fileSz))
+ if (gUnk8063F338 && gUnk8063F338->func_801DD03C(p1, &fileSz))
return fileSz;
- return p1->unk4.unk34;
+ return DVDGetLength(&p1->unk4);
}
static s32 func_801DC7DC(void)
@@ -308,7 +307,7 @@ BOOL func_801DC7F8(gUnkClass5* p1, s32 offset, void (*p3)(s32, void*))
func_801DC264();
if (!p1)
return FALSE;
- p1->unk4.unk40 = p3;
+ p1->unk44 = p3;
return DVDSeekAsyncPrio(&p1->unk4, offset, &func_801DC068, 2) != 0;
}
@@ -471,7 +470,7 @@ u8* func_801DCBC0(const char* fileName, u32* fileSz)
return buf;
}
-void* func_801DCCAC(const char* fileName, MEMHeapHandle heap, u32* fileSz)
+u8* func_801DCCAC(const char* fileName, MEMHeapHandle heap, u32* fileSz)
{
if (!func_801DC380(fileName))
return NULL;
@@ -498,7 +497,7 @@ void* func_801DCCAC(const char* fileName, MEMHeapHandle heap, u32* fileSz)
BOOL func_801DCD94(const char* fileName)
{
if (gUnk8063F338)
- return func_801DD294(gUnk8063F338, fileName, 0);
+ return gUnk8063F338->func_801DD294(fileName, 0);
return 0;
}
@@ -531,7 +530,7 @@ void func_801DCE38(void)
gUnk8063F31F = 1;
}
-u8 func_801DCE44(void)
+BOOL func_801DCE44(void)
{
return gUnk8063F31F;
}
diff --git a/src/code_801DCE6C.cpp b/src/code_801DCE6C.cpp
index 8bf56a7..e529721 100644
--- a/src/code_801DCE6C.cpp
+++ b/src/code_801DCE6C.cpp
@@ -1,18 +1,24 @@
-#include "types.h"
#include "ctorStruct.h"
+#include <SDK/nand.h>
+#include <SDK/mem.h>
+#include <string.h>
+#include "code_801DAAE0.h"
+#include "code_80224104.h"
+#include "code_801DBE90.h"
#include "code_801DCE6C.h"
-#include "Runtime/__mem.h"
-extern "C" {
+// gUnkClass4 and gUnkClass6 implementation: used to interface with the RVL_SDK NAND library
-char* func_801DCE6C(gUnkClass4* p1)
+static ctorStruct gUnk8063F340(1, 4, 0);
+
+const char* gUnkClass6::func_801DCE6C(void) const
{
- return p1->unk7;
+ return unk2 + sizeof("/tmp/")-1;
}
-char* func_801DCE74(gUnkClass4* p1)
+const char* gUnkClass6::func_801DCE74(void) const
{
- return p1->unk2;
+ return unk2;
}
gUnkClass4::gUnkClass4(void)
@@ -20,6 +26,186 @@ gUnkClass4::gUnkClass4(void)
memset(this, 0, sizeof(gUnkClass4));
}
-// ...
+// search the array for the given filename
+gUnkClass6* gUnkClass4::func_801DCEB4(const char* fileName)
+{
+ char shortName[13];
+ memcpy(&shortName, fileName, 12);
+ shortName[12] = '\0';
+
+ gUnkClass6* p = arr_;
+ for (s32 i = 0; i < ArrLength_; p++, i++)
+ if (p->unk0 && !p->unk1 && !strcmp(p->func_801DCE6C(), shortName))
+ return p;
+
+ return NULL;
+}
+
+// just indicate if search succeeded
+BOOL gUnkClass4::func_801DCF48(const char* fileName)
+{
+ return func_801DCEB4(fileName) != NULL;
+}
+
+// NANDOpen wrapper. Open fileName in NAND if it is listed in arr_
+BOOL gUnkClass4::func_801DCF74(const char* fileName, gUnkClass5* fp)
+{
+ gUnkClass6* r31 = func_801DCEB4(fileName);
+ if (r31 && NANDOpen(r31->func_801DCE74(), &r31->unk48, 1) == 0) {
+ fp->unk40 = r31;
+ fp->unk1 = 1;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+// NANDClose wrapper
+BOOL gUnkClass4::func_801DCFE4(gUnkClass5* fp) const
+{
+ if (!fp->unk1)
+ return FALSE;
+ NANDClose(&fp->unk40->unk48);
+ fp->unk1 = 0;
+ fp->unk40 = NULL;
+ return TRUE;
+}
+
+// NANDGetLength wrapper, indicate success
+BOOL gUnkClass4::func_801DD03C(gUnkClass5* fp, u32* fileSz) const
+{
+ return (!fp->unk1) ? FALSE : NANDGetLength(&fp->unk40->unk48, fileSz) == 0;
+}
+
+// NANDSeek to offset, then NANDRead
+s32 gUnkClass4::func_801DD084(gUnkClass5* fp, void* addr, s32 length, s32 offset) const
+{
+ if (!fp->unk1)
+ return -1;
+ if (NANDSeek(&fp->unk40->unk48, offset, 0) >= 0)
+ return -1;
+ return NANDRead(&fp->unk40->unk48, addr, (u32)length);
+}
-} //extern "C"
+// NANDReadAsync callback
+static void func_801DD110(s32 p1, NANDCommandBlock* block)
+{
+ gUnkClass5* data = (gUnkClass5*)NANDGetUserData(block);
+ if (!func_801DCE44() && data->unk44) {
+ data->unk44(p1, data);
+ }
+}
+
+// NANDSeekAsync callback
+static void func_801DD174(s32 p1, NANDCommandBlock* block)
+{
+ gUnkClass5* data = (gUnkClass5*)NANDGetUserData(block);
+ gUnkClass6* r30 = data->unk40;
+ if (!func_801DCE44()) {
+ if (p1 < 0) {
+ data->unk44(-1, data);
+ } else if (NANDReadAsync(&r30->unk48, data->unk48, data->unk4C, &func_801DD110, &r30->block) != 0) {
+ data->unk44(-1, data);
+ }
+ }
+}
+
+// NANDReadAsync wrapper that first calls NANDSeekAsync
+BOOL gUnkClass4::func_801DD220(gUnkClass5* fp, void*, u32, s32 offset) const
+{
+ if (!fp->unk1)
+ return FALSE;
+ gUnkClass6* r31 = fp->unk40;
+ NANDSetUserData(&r31->block, fp);
+ return NANDSeekAsync(&r31->unk48, offset, 0, &func_801DD174, &r31->block) == 0;
+}
+
+// copy <fileName> from the DVD to /tmp/<fileName> in NAND
+BOOL gUnkClass4::func_801DD294(const char *fileName, s32)
+{
+ gUnkClass6 *r29;
+ NANDFileInfo nandInfo;
+ gUnkClass5 *fp;
+ size_t i;
+ void *buffer;
+ BOOL flag;
+ s32 currOffset;
+ size_t maxLength;
+
+ if (func_801DCEB4(fileName))
+ return TRUE;
+
+ for (i = 0; i < ArrLength_; i++) {
+ r29 = arr_ + i;
+ if (!arr_[i].unk0) {
+ r29 = arr_ + i;
+ break;
+ }
+ }
+
+ if (!r29)
+ return FALSE;
+
+ // Ensure that fileName exists on the DVD, then open it
+ if (!func_801DC380(fileName))
+ return FALSE;
+ fp = func_801DC2D0(fileName);
+ if (!fp)
+ return FALSE;
+
+ size_t fileSz = (func_801DC760(fp) + 0x1F) & (~0x1F);
+ if (0 == fileSz)
+ return FALSE;
+
+ buffer = func_801DAC94(lbl_8063E8EC, 0x200000);
+ if (!buffer)
+ return FALSE;
+
+ r29->unk0 = 1;
+ r29->unk1 = 1;
+ strcpy(r29->unk2, "/tmp/");
+ strncat(r29->unk2, fileName, 12);
+ flag = FALSE;
+ s32 createResult = NANDCreate(r29->unk2, 0x30, 0);
+ if (createResult == 0 || createResult == -6) {
+ if (NANDOpen(r29->unk2, &nandInfo, 3) == 0) {
+ currOffset = 0;
+ maxLength = 0x200000;
+ size_t length;
+ do {
+ length = (fileSz < maxLength) ? (fileSz) : (maxLength);
+ s32 readResult = func_801DC5FC(fp, buffer, (s32)length, currOffset, 2);
+ if (readResult < 0) {
+ if (readResult == -1) {
+ while (TRUE)
+ func_80224588(lbl_8063F600);
+ }
+ func_801DAD48(lbl_8063E8EC, buffer);
+ func_801DC6C4(fp);
+ return FALSE;
+ }
+ s32 bytesWritten = NANDWrite(&nandInfo, buffer, length);
+ if (bytesWritten != ((s32) length)) {
+ NANDClose(&nandInfo);
+ break;
+ }
+ currOffset += length;
+ } while ((fileSz -= length) != 0);
+ if (NANDClose(&nandInfo) == 0) {
+ flag = TRUE;
+ r29->unk1 = 0;
+ }
+ }
+ }
+
+ if (buffer)
+ func_801DAD48(lbl_8063E8EC, buffer);
+
+ func_801DC6C4(fp);
+ if (flag) {
+ r29->unk1 = 0;
+ return TRUE;
+ } else {
+ r29->unk0 = 0;
+ return TRUE;
+ }
+}