summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax <mparisi@stevens.edu>2020-10-29 14:27:37 -0400
committerMax <mparisi@stevens.edu>2020-10-29 14:27:37 -0400
commit47a1bdea8872c79dd2cd7d75ca7f254b9ed13170 (patch)
treef254bbac3fde59afbc4abe7f07ea763bed53b20c /src
parentf13fcff4a5f496e8bc1fa4ff759698d9ac37c478 (diff)
match up to func_801DCFE4, add string.h and stdlib.h, add types.h to Makefile include path, and move GameSpy under DWC
Diffstat (limited to 'src')
-rw-r--r--src/Runtime/ptmf.c2
-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.cpp11
-rw-r--r--src/code_801DCE6C.cpp52
10 files changed, 64 insertions, 34 deletions
diff --git a/src/Runtime/ptmf.c b/src/Runtime/ptmf.c
index 297039c..c98cd63 100644
--- a/src/Runtime/ptmf.c
+++ b/src/Runtime/ptmf.c
@@ -1,5 +1,3 @@
-#include "CPlusLib.h"
-
#pragma internal on
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..2303bdb 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"
diff --git a/src/code_801DCE6C.cpp b/src/code_801DCE6C.cpp
index 8bf56a7..866f9a9 100644
--- a/src/code_801DCE6C.cpp
+++ b/src/code_801DCE6C.cpp
@@ -1,16 +1,22 @@
-#include "types.h"
#include "ctorStruct.h"
#include "code_801DCE6C.h"
-#include "Runtime/__mem.h"
+#include <string.h>
+
+// NAND wrapper class
+
extern "C" {
+
+// TODO: convert to class member functions
-char* func_801DCE6C(gUnkClass4* p1)
+//static
+char* func_801DCE6C(gUnkClass6* p1)
{
return p1->unk7;
}
-char* func_801DCE74(gUnkClass4* p1)
+//static
+char* func_801DCE74(gUnkClass6* p1)
{
return p1->unk2;
}
@@ -20,6 +26,42 @@ gUnkClass4::gUnkClass4(void)
memset(this, 0, sizeof(gUnkClass4));
}
-// ...
+// search the array
+//static
+gUnkClass6* func_801DCEB4(gUnkClass4* p1, const char* p2)
+{
+ char sp8[13]; // 0xD ~ 0x10 byte struct
+ memcpy(&sp8, p2, 12);
+ sp8[12] = '\0';
+
+ gUnkClass6* p = p1->arr;
+ for (s32 i = 0; i < 8; p++, i++)
+ if (p->unk0 && !p->unk1 && !strcmp(func_801DCE6C(p), sp8))
+ return p;
+
+ return NULL;
+}
+
+// just indicate if search succeeded
+BOOL func_801DCF48(gUnkClass4* p1, const char* p2)
+{
+ return func_801DCEB4(p1, p2) != NULL;
+}
+
+BOOL func_801DCF74(gUnkClass4* p1, const char* fileName, gUnkClass5* fp)
+{
+ gUnkClass6* r31 = func_801DCEB4(p1, fileName);
+ if (r31 && NANDOpen(func_801DCE74(r31), &r31->unk48, 1) == 0) {
+ fp->unk4.unk3C = r31;
+ fp->unk1 = 1;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+
+
+
} //extern "C"