refresh 6

This commit is contained in:
n64 committed 2020-02-03 00:51:26 -05:00
1 parent 9273f38df1
commit 9a801cb96d
236 files changed
+17101 -4820

No files matched your search

+15 -9
View File
@@ -27,7 +27,7 @@ struct LinkedList {
* a list, and return this list in pFreeList.
* Appears to have been replaced by init_free_object_list.
*/
static void unused_init_free_list(struct LinkedList *usedList, struct LinkedList **pFreeList,
void unused_init_free_list(struct LinkedList *usedList, struct LinkedList **pFreeList,
struct LinkedList *pool, s32 itemSize, s32 poolLength) {
s32 i;
struct LinkedList *node = pool;
@@ -54,7 +54,7 @@ static void unused_init_free_list(struct LinkedList *usedList, struct LinkedList
* freeList is empty.
* Appears to have been replaced by try_allocate_object.
*/
static struct LinkedList *unused_try_allocate(struct LinkedList *destList,
struct LinkedList *unused_try_allocate(struct LinkedList *destList,
struct LinkedList *freeList) {
struct LinkedList *node = freeList->next;
@@ -77,7 +77,7 @@ static struct LinkedList *unused_try_allocate(struct LinkedList *destList,
* to the end of destList (doubly linked). Return the object, or NULL if
* freeList is empty.
*/
static struct Object *try_allocate_object(struct ObjectNode *destList, struct ObjectNode *freeList) {
struct Object *try_allocate_object(struct ObjectNode *destList, struct ObjectNode *freeList) {
struct ObjectNode *nextObj;
if ((nextObj = freeList->next) != NULL) {
@@ -104,7 +104,7 @@ static struct Object *try_allocate_object(struct ObjectNode *destList, struct Ob
* singly linked freeList.
* This function seems to have been replaced by deallocate_object.
*/
static void unused_deallocate(struct LinkedList *freeList, struct LinkedList *node) {
void unused_deallocate(struct LinkedList *freeList, struct LinkedList *node) {
// Remove from doubly linked list
node->next->prev = node->prev;
node->prev->next = node->next;
@@ -113,7 +113,6 @@ static void unused_deallocate(struct LinkedList *freeList, struct LinkedList *no
node->next = freeList->next;
freeList->next = node;
}
/**
* Remove the given object from the object list that it's currently in, and
* insert it at the beginning of the free list (singly linked).
@@ -165,6 +164,9 @@ void clear_object_lists(struct ObjectNode *objLists) {
* This function looks broken, but it appears to attempt to delete the leaf
* graph nodes under obj and obj's siblings.
*/
#ifdef VERSION_EU
struct Object *unused_delete_leaf_nodes() {}
#else
static void unused_delete_leaf_nodes(struct Object *obj) {
struct Object *children;
struct Object *sibling;
@@ -183,6 +185,7 @@ static void unused_delete_leaf_nodes(struct Object *obj) {
obj = (struct Object *) sibling->header.gfx.node.next;
}
}
#endif
/**
* Free the given object.
@@ -207,7 +210,7 @@ void unload_object(struct Object *obj) {
* an unimportant object if necessary. If this is not possible, hang using an
* infinite loop.
*/
static struct Object *allocate_object(struct ObjectNode *objList) {
struct Object *allocate_object(struct ObjectNode *objList) {
s32 i;
struct Object *obj = try_allocate_object(objList, &gFreeObjectList);
@@ -244,12 +247,15 @@ static struct Object *allocate_object(struct ObjectNode *objList) {
obj->collidedObjInteractTypes = 0;
obj->numCollidedObjs = 0;
for (i = 0; i < 0x50; i++) {
obj->rawData.asU32[i] = 0;
#if IS_64_BIT
for (i = 0; i < 0x50; i++) {
obj->rawData.asS32[i] = 0;
obj->ptrData.asVoidPtr[i] = NULL;
#endif
}
#else
// -O2 needs everything until = on the same line
for (i = 0; i < 0x50; i++) obj->rawData.asS32[i] = 0;
#endif
obj->unused1 = 0;
obj->stackIndex = 0;