This commit is contained in:
Reonu
2021-06-28 14:06:06 +01:00
10 changed files with 0 additions and 896 deletions

View File

@@ -320,26 +320,6 @@ void split_all_timers(void) {
}
}
/**
* Unused - records the start time for all timers
*/
void start_all_timers(void) {
s32 i;
struct GdTimer *timer;
if (!sTimingActive) {
return;
}
for (i = 0; i < ARRAY_COUNT(sTimers); i++) {
timer = get_timernum(i);
if (timer->name != NULL) {
timer->start = gd_get_ostime();
}
}
}
/**
* Records the current time before performing an operation
*/
@@ -432,15 +412,6 @@ f32 get_scaled_timer_total(const char *name) {
return timer->scaledTotal;
}
/**
* Unused - returns the raw total for the specified timer
*/
f32 get_timer_total(const char *name) {
struct GdTimer *timer = get_timer_checked(name);
return (f32) timer->total;
}
/*
* Miscellaneous debug functions
@@ -849,7 +820,6 @@ struct GdFile *gd_fopen(const char *filename, const char *mode) {
for (i = 0; i < sizeof(struct UnkBufThing); i++) {
*bufbytes++ = gGdStreamBuffer[filecsr++];
}
stub_renderer_13(&buf);
fileposptr = &gGdStreamBuffer[filecsr];
filecsr += buf.size;

View File

@@ -586,7 +586,6 @@ void draw_label(struct ObjLabel *label) {
position.y += label->position.y;
position.z += label->position.z;
func_801A4438(position.x, position.y, position.z);
stub_renderer_10(label->unk30);
stub_draw_label_text(strbuf);
}

View File

@@ -23,39 +23,3 @@ static s32 sUnrefScnHeight = 240;
// bss
struct GdControl gGdCtrl; // @ 801B9920; processed controller info
struct GdControl gGdCtrlPrev; // @ 801B9A18; previous frame's controller info
/**
* Unused main function possibly from when this was a standalone demo
*/
u32 __main__(void) {
UNUSED u32 pad1C;
gd_printf("%x, %x\n", (u32) (uintptr_t) &D_801A8058, (u32) (uintptr_t) &gGdMoveScene);
imin("main");
gd_init();
gGdCtrl.unk88 = 0.46799f;
gGdCtrl.unkA0 = -34.0f;
gGdCtrl.unkAC = 34.0f;
gGdCtrl.unk00 = 2;
gGdCtrl.newStartPress = FALSE;
gGdCtrl.prevFrame = &gGdCtrlPrev;
imin("main - make_scene");
make_scene(); // make_scene does nothing, though
imout();
gd_init_controllers();
print_all_memtrackers();
start_timer("dlgen");
stop_timer("dlgen");
mem_stats();
while (TRUE) {
func_801A520C();
}
imout();
return 0;
}

View File

@@ -537,18 +537,6 @@ void func_8018FF28(struct ObjJoint *a0, struct ObjJoint *a1) {
}
}
/**
* Unused (not called) - possibly was used to print indent levels inside
* recursive functions
*/
void print_some_spaces(s32 size) {
s32 i;
for (i = 0; i < size - 1; i++) {
gd_printf(" ");
}
}
/* 23E7B8 -> 23E938 */
s32 func_8018FFE8(struct ObjBone **a0, struct ObjJoint **a1, struct ObjJoint *a2, struct ObjJoint *a3) {
struct ObjBone *b; // 1C

View File

@@ -882,128 +882,12 @@ s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj) {
return FALSE;
}
/**
* Unused (not called) - this shows details about all objects in the main object linked list
*/
void show_details(enum ObjTypeFlag type) {
enum ObjTypeFlag curObjType;
struct ListNode *curGroupLink;
struct ObjGroup *curSubGroup;
struct GdObj *curObj;
char idStrBuf[0x24];
s32 curGroupTypes;
gd_printf("\nDetails about: ");
switch (type) {
case OBJ_TYPE_GROUPS:
gd_printf("Groups\n");
break;
case OBJ_TYPE_BONES:
gd_printf("Bones\n");
break;
case OBJ_TYPE_JOINTS:
gd_printf("Joints\n");
break;
case OBJ_TYPE_PARTICLES:
gd_printf("Particles\n");
break;
default:
gd_printf("Everything?\n");
break;
}
curObj = gGdObjectList;
while (curObj != NULL) {
curObjType = curObj->type;
if (curObjType == type) {
format_object_id(idStrBuf, curObj);
switch (curObjType) {
case OBJ_TYPE_GROUPS:
gd_printf("Group %s: ", idStrBuf);
curGroupTypes = ((struct ObjGroup *) curObj)->memberTypes;
if (curGroupTypes & OBJ_TYPE_GROUPS) {
gd_printf("groups ");
}
if (curGroupTypes & OBJ_TYPE_BONES) {
gd_printf("bones ");
}
if (curGroupTypes & OBJ_TYPE_JOINTS) {
gd_printf("joints ");
}
if (curGroupTypes & OBJ_TYPE_PARTICLES) {
gd_printf("particles ");
}
if (curGroupTypes & OBJ_TYPE_CAMERAS) {
gd_printf("cameras ");
}
if (curGroupTypes & OBJ_TYPE_NETS) {
gd_printf("nets ");
}
if (curGroupTypes & OBJ_TYPE_GADGETS) {
gd_printf("gadgets ");
}
if (curGroupTypes & OBJ_TYPE_LABELS) {
gd_printf("labels ");
}
if (curGroupTypes & OBJ_TYPE_FACES) {
gd_printf("face ");
}
if (curGroupTypes & OBJ_TYPE_VERTICES) {
gd_printf("vertex ");
}
curGroupLink = ((struct ObjGroup *) curObj)->firstMember;
while (curGroupLink != NULL) {
format_object_id(idStrBuf, curGroupLink->obj);
gd_printf("%s", idStrBuf);
curGroupLink = curGroupLink->next;
}
gd_printf("\n");
break;
case OBJ_TYPE_BONES:
gd_printf("Bone %s: ", idStrBuf);
curSubGroup = ((struct ObjBone *) curObj)->unk10C;
curGroupLink = curSubGroup->firstMember;
while (curGroupLink != NULL) {
format_object_id(idStrBuf, curGroupLink->obj);
gd_printf("%s", idStrBuf);
curGroupLink = curGroupLink->next;
}
gd_printf("\n");
break;
case OBJ_TYPE_JOINTS:
gd_printf("Joint %s: ", idStrBuf);
curSubGroup = ((struct ObjJoint *) curObj)->unk1C4;
curGroupLink = curSubGroup->firstMember;
while (curGroupLink != NULL) {
format_object_id(idStrBuf, curGroupLink->obj);
gd_printf("%s", idStrBuf);
curGroupLink = curGroupLink->next;
}
gd_printf("\n");
break;
default:;
}
}
curObj = curObj->next;
}
}
/* @ 22C9B8 for 0x24 */
s32 stub_objects_2(void) {
s32 sp4 = 0;
return sp4;
}
/**
* Unused - called by __main__
*/
s32 make_scene(void) {
s32 sp4 = 0;
return sp4;
}
/* @ 22CA00 for 0x88 */
static void reset_joint_or_net(struct GdObj *obj) {
struct GdObj *localObjPtr = obj;
@@ -1027,39 +911,6 @@ void menu_cb_reset_positions(void) {
apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) reset_joint_or_net, sCurrentMoveGrp);
}
/**
* Unused (not called) - does nothing useful
*/
struct GdObj *func_8017E2F0(struct GdObj *obj, enum ObjTypeFlag type) {
UNUSED u32 sp2C;
enum ObjTypeFlag curObjType;
struct ListNode *node;
curObjType = obj->type;
switch (curObjType) {
case OBJ_TYPE_GROUPS:
node = ((struct ObjGroup *) obj)->firstMember;
while (node != NULL) {
func_8017E2F0(node->obj, type);
node = node->next;
}
break;
case OBJ_TYPE_BONES:
break;
default:;
}
if (curObjType == type) {
return obj;
}
//! @bug Nothing is returned if a GdObj of `type` is not found
#ifdef AVOID_UB
return NULL;
#endif
}
/**
* Recursively calls `func` on all members of `group` whose type is in the
* `types` bitmask.
@@ -1224,152 +1075,6 @@ void func_8017E9EC(struct ObjNet *net) {
gd_mult_mat4f(&D_801B9DC8, &sp1C, &D_801B9DC8);
}
/**
* Unused (not called)
*/
s32 func_8017EA94(struct GdVec3f *vec, Mat4f matrix) {
if (vec->x >= matrix[2][2] && vec->x <= matrix[3][1] && vec->z >= matrix[3][0]
&& vec->z <= matrix[3][3]) {
return 1;
}
return 0;
}
/**
* Unused (not called)
*/
s32 func_8017EB24(struct GdObj *obj1, struct GdObj *obj2) {
struct GdVec3f pos1;
struct GdVec3f pos2;
struct GdBoundingBox *bbox1;
struct GdBoundingBox *bbox2;
struct GdBoundingBox sp18;
set_cur_dynobj(obj1);
d_get_world_pos(&pos1);
bbox1 = d_get_bounding_box();
set_cur_dynobj(obj2);
d_get_world_pos(&pos2);
bbox2 = d_get_bounding_box();
// bbox2 is an offset for bbox1?
sp18.minX = bbox1->minX + bbox2->minX;
sp18.minY = bbox1->minY + bbox2->minY;
sp18.minZ = bbox1->minZ + bbox2->minZ;
sp18.maxX = bbox1->maxX + bbox2->maxX;
sp18.maxY = bbox1->maxY + bbox2->maxY;
sp18.maxZ = bbox1->maxZ + bbox2->maxZ;
D_801B9E08.x = pos2.x - pos1.x;
D_801B9E08.y = pos2.y - pos1.y;
D_801B9E08.z = pos2.z - pos1.z;
if (D_801B9E08.x >= sp18.minX) {
if (D_801B9E08.x <= sp18.maxX) {
if (D_801B9E08.z >= sp18.minZ) {
if (D_801B9E08.z <= sp18.maxZ) {
return TRUE;
}
}
}
}
return FALSE;
}
/**
* Unused (not called)
*/
s32 is_obj_xz_in_bounding_box(struct GdObj *obj, struct GdBoundingBox *bbox) {
struct GdVec3f pos;
set_cur_dynobj(obj);
d_get_world_pos(&pos);
if (pos.x >= bbox->minX) {
if (pos.x <= bbox->maxX) {
if (pos.z >= bbox->minZ) {
if (pos.z <= bbox->maxZ) {
return TRUE;
}
}
}
}
return FALSE;
}
/**
* Unused (not called)
*/
s32 is_point_xz_in_bounding_box(struct GdVec3f *point, struct GdBoundingBox *bbox) {
if (point->x >= bbox->minX) {
if (point->x <= bbox->maxX) {
if (point->z >= bbox->minZ) {
if (point->z <= bbox->maxZ) {
return TRUE;
}
}
}
}
return FALSE;
}
/**
* Unused (called by func_801A71CC) - returns TRUE if any of the four corners of
* box1's X-Z plane lie within box2's X-Z plane
*/
s32 gd_plane_point_within(struct GdBoundingBox *box1, struct GdBoundingBox *box2) {
// test if min x and min z of box1 are within box2
if (box1->minX >= box2->minX) {
if (box1->minX <= box2->maxX) {
if (box1->minZ >= box2->minZ) {
if (box1->minZ <= box2->maxZ) {
return TRUE;
}
}
}
}
// test if max x and min z of box1 are within box2
if (box1->maxX >= box2->minX) {
if (box1->maxX <= box2->maxX) {
if (box1->minZ >= box2->minZ) {
if (box1->minZ <= box2->maxZ) {
return TRUE;
}
}
}
}
// test if max x and max z of box1 are within box2
if (box1->maxX >= box2->minX) {
if (box1->maxX <= box2->maxX) {
if (box1->maxZ >= box2->minZ) {
if (box1->maxZ <= box2->maxZ) {
return TRUE;
}
}
}
}
// test if min x and max z of box1 are within box2
if (box1->minX >= box2->minX) {
if (box1->minX <= box2->maxX) {
if (box1->maxZ >= box2->minZ) {
if (box1->maxZ <= box2->maxZ) {
return TRUE;
}
}
}
}
return FALSE;
}
/* @ 22D824 for 0x1BC */
s32 transform_child_objects_recursive(struct GdObj *obj, struct GdObj *parentObj) {
struct ListNode *curLink;

View File

@@ -58,61 +58,6 @@ void Unknown8018B7A8(void *a0) {
d_set_world_pos(sp1C.x, sp1C.y, sp1C.z);
}
/**
* Unused - called when an item is selected from the "Default Settings" menu.
*
* @param itemId ID of the menu item that was clicked
*/
static void menu_cb_default_settings(intptr_t itemId) {
struct ObjGroup *group = (struct ObjGroup *)itemId; // Unpack pointer from menu item ID
apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t) reset_gadget_default, group);
apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) stub_renderer_6, gGdViewsGroup);
}
/**
* Unused - appends a menu item for the group to sDefSettingsMenuStr.
*/
static void add_item_to_default_settings_menu(struct ObjGroup *group) {
char buf[0x100];
if (group->debugPrint == 1) {
// Convert pointer to integer and store it as the menu item ID.
sprintf(buf, "| %s %%x%d", group->name, (u32) (intptr_t) group);
gd_strcat(sDefSettingsMenuStr, buf);
}
}
/**
* Unused - creates a popup menu that allows the user to control some settings.
*/
long create_gui_menu(struct ObjGroup *grp) {
long dynamicsMenuId;
long defaultSettingMenuId;
long contTypeMenuId;
gd_strcpy(sDefSettingsMenuStr, "Default Settings %t %F");
apply_to_obj_types_in_group(OBJ_TYPE_GROUPS, (applyproc_t) add_item_to_default_settings_menu, grp);
defaultSettingMenuId = defpup(sDefSettingsMenuStr, &menu_cb_default_settings);
contTypeMenuId = defpup(
"Control Type %t %F"
"| U-64 Analogue Joystick %x1 "
"| Keyboard %x2 "
"| Mouse %x3",
&menu_cb_control_type);
dynamicsMenuId = defpup(
"Dynamics %t "
"|\t\t\tReset Positions %f "
"|\t\t\tSet Defaults %m "
"|\t\t\tSet Controller %m "
"|\t\t\tRe-Calibrate Controller %f "
"|\t\t\tQuit %f",
&menu_cb_reset_positions, defaultSettingMenuId, contTypeMenuId, &menu_cb_recalibrate_controller, &gd_exit);
return dynamicsMenuId;
}
/* 23A190 -> 23A250 */
struct ObjLabel *make_label(struct ObjValPtr *ptr, char *str, s32 a2, f32 x, f32 y, f32 z) {
struct ObjLabel *label = (struct ObjLabel *) make_object(OBJ_TYPE_LABELS);

View File

@@ -494,30 +494,6 @@ void Unknown801835C8(struct ObjParticle *ptc) {
gd_printf("\n");
}
/**
* Unused
*/
void stub_particles_1(UNUSED s32 a) {
}
/**
* Unused
*/
void stub_particles_2(UNUSED s32 a) {
}
/**
* Unused
*/
void stub_particles_3(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c) {
}
/**
* Unused
*/
void stub_particles_4(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c) {
}
/* 2320A0 -> 2320D4; pad to 2320E0 */
void func_801838D0(struct ObjParticle *ptc) {
D_801B9E3C = ptc;

File diff suppressed because it is too large Load Diff

View File

@@ -109,19 +109,14 @@ void gd_create_perspective_matrix(f32 fovy, f32 aspect, f32 near, f32 far);
s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, UNUSED s32 uly,
UNUSED s32 lrx, UNUSED s32 lry);
void gd_init_controllers(void);
void stub_renderer_6(struct GdObj *obj); //apply to OBJ_TYPE_VIEWS
long defpup(UNUSED const char *menufmt, ...);
void menu_cb_control_type(u32);
void menu_cb_recalibrate_controller(u32);
void func_801A4438(f32 x, f32 y, f32 z);
void stub_renderer_10(u32 arg0);
void stub_draw_label_text(UNUSED char *s);
void set_active_view(struct ObjView *v);
void func_801A520C(void);
void gd_init(void);
void stub_renderer_12(s8 *arg0); /* convert LE bytes to BE word? */
void stub_renderer_13(UNUSED void *arg0);
void stub_renderer_14(UNUSED s8 *arg0); /* convert LE bytes to BE f32? */
void init_pick_buf(s16 *buf, s32 len);
void store_in_pickbuf(s16 data);
s32 get_cur_pickbuf_offset(UNUSED s16 *arg0);

View File

@@ -934,14 +934,9 @@ void read_ARK_shape(struct ObjShape *shape, char *fileName) {
}
gd_fread(fileInfo.bytes, 0x48, 1, sGdShapeFile);
stub_renderer_12(&fileInfo.bytes[0x40]); // face count?
stub_renderer_12(&fileInfo.bytes[0x44]);
while (fileInfo.data.word40-- > 0) {
gd_fread(faceInfo.bytes, 0x10, 1, sGdShapeFile);
stub_renderer_14(&faceInfo.bytes[0x0]);
stub_renderer_14(&faceInfo.bytes[0x4]);
stub_renderer_14(&faceInfo.bytes[0x8]);
sp48.x = faceInfo.data.v[0];
sp48.y = faceInfo.data.v[1];
@@ -949,14 +944,9 @@ void read_ARK_shape(struct ObjShape *shape, char *fileName) {
sp34 = find_or_add_new_mtl(shape->mtlGroup, 0, sp48.x, sp48.y, sp48.z);
stub_renderer_12(&faceInfo.bytes[0xC]);
while (faceInfo.data.faceCount-- > 0) {
shape->faceCount++;
gd_fread(face.bytes, 0x10, 1, sGdShapeFile);
stub_renderer_14(&face.bytes[0x4]); // read word as f32?
stub_renderer_14(&face.bytes[0x8]);
stub_renderer_14(&face.bytes[0xC]);
sp44 = make_face_with_material(sp34);
@@ -964,8 +954,6 @@ void read_ARK_shape(struct ObjShape *shape, char *fileName) {
sp40 = sp44;
}
stub_renderer_12(&face.bytes[0x0]);
if (face.data.vtxCount > 3) {
while (face.data.vtxCount-- > 0) {
gd_fread(vtx.bytes, 0x18, 1, sGdShapeFile);
@@ -976,12 +964,6 @@ void read_ARK_shape(struct ObjShape *shape, char *fileName) {
while (face.data.vtxCount-- > 0) {
shape->vtxCount++;
gd_fread(vtx.bytes, 0x18, 1, sGdShapeFile);
stub_renderer_14(&vtx.bytes[0x00]);
stub_renderer_14(&vtx.bytes[0x04]);
stub_renderer_14(&vtx.bytes[0x08]);
stub_renderer_14(&vtx.bytes[0x0C]);
stub_renderer_14(&vtx.bytes[0x10]);
stub_renderer_14(&vtx.bytes[0x14]);
func_801980E8(vtx.data.v);
sp3C = gd_make_vertex(vtx.data.v[0], vtx.data.v[1], vtx.data.v[2]);