more splitting

This commit is contained in:
Ethan Roseman 2021-02-08 22:45:37 +09:00
parent 0f2f6705e5
commit 676c7ac343
20 changed files with 71 additions and 68 deletions

View File

@ -1,53 +1,3 @@
#include "common.h"
INCLUDE_ASM(s32, "code_8560", func_8002D160);
INCLUDE_ASM(s32, "code_8560", update_cameras);
INCLUDE_ASM(s32, "code_8560", render_frame);
INCLUDE_ASM(s32, "code_8560", create_cameras_a);
INCLUDE_ASM(s32, "code_8560", create_cameras_b);
INCLUDE_ASM(s32, "code_8560", initialize_next_camera);
INCLUDE_ASM(void, "code_8560", set_cam_viewport, s16 id, s16 x, s16 y, s16 width, s16 height);
void get_cam_viewport(s32 camID, u16* x, u16* y, u16* width, u16* height) {
*width = CAM(camID)->viewportW;
*height = CAM(camID)->viewportH;
*x = CAM(camID)->viewportStartX;
*y = CAM(camID)->viewportStartY;
}
INCLUDE_ASM(void, "code_8560", get_screen_coords, Cam camID, f32 x, f32 y, f32 z, f32* outX, f32* outY, f32* outZ);
s32 func_8002E754(s32 camID, s32 x, s32 y) {
s32 startX = CAM(camID)->viewportStartX;
s32 startY = CAM(camID)->viewportStartY;
s32 endX = startX + CAM(camID)->viewportW;
s32 endY = startY + CAM(camID)->viewportH;
if (x < startX) {
return TRUE;
} else if (x > endX) {
return TRUE;
} else if (y < startY) {
return TRUE;
} else if (y > endY) {
return TRUE;
} else {
return FALSE;
}
}
void func_8002E7CC(s32 camID, s32* x, s32* y, s32* width, s32* height) {
*x = CAM(camID)->viewportStartX;
*y = CAM(camID)->viewportStartY;
*width = CAM(camID)->viewportStartX + CAM(camID)->viewportW;
*height = CAM(camID)->viewportStartY + CAM(camID)->viewportH;
}
INCLUDE_ASM(s32, "code_8560", func_8002E82C);

50
src/code_8800.c Normal file
View File

@ -0,0 +1,50 @@
#include "common.h"
INCLUDE_ASM(s32, "code_8800", update_cameras);
INCLUDE_ASM(s32, "code_8800", render_frame);
INCLUDE_ASM(s32, "code_8800", create_cameras_a);
INCLUDE_ASM(s32, "code_8800", create_cameras_b);
INCLUDE_ASM(s32, "code_8800", initialize_next_camera);
INCLUDE_ASM(void, "code_8800", set_cam_viewport, s16 id, s16 x, s16 y, s16 width, s16 height);
void get_cam_viewport(s32 camID, u16* x, u16* y, u16* width, u16* height) {
*width = CAM(camID)->viewportW;
*height = CAM(camID)->viewportH;
*x = CAM(camID)->viewportStartX;
*y = CAM(camID)->viewportStartY;
}
INCLUDE_ASM(void, "code_8800", get_screen_coords, Cam camID, f32 x, f32 y, f32 z, f32* outX, f32* outY, f32* outZ);
s32 func_8002E754(s32 camID, s32 x, s32 y) {
s32 startX = CAM(camID)->viewportStartX;
s32 startY = CAM(camID)->viewportStartY;
s32 endX = startX + CAM(camID)->viewportW;
s32 endY = startY + CAM(camID)->viewportH;
if (x < startX) {
return TRUE;
} else if (x > endX) {
return TRUE;
} else if (y < startY) {
return TRUE;
} else if (y > endY) {
return TRUE;
} else {
return FALSE;
}
}
void func_8002E7CC(s32 camID, s32* x, s32* y, s32* width, s32* height) {
*x = CAM(camID)->viewportStartX;
*y = CAM(camID)->viewportStartY;
*width = CAM(camID)->viewportStartX + CAM(camID)->viewportW;
*height = CAM(camID)->viewportStartY + CAM(camID)->viewportH;
}
INCLUDE_ASM(s32, "code_8800", func_8002E82C);

18
src/code_B0E0.c Normal file
View File

@ -0,0 +1,18 @@
#include "common.h"
INCLUDE_ASM(s32, "code_B0E0", do_camera_type_unused);
INCLUDE_ASM(s32, "code_B0E0", do_camera_type_5);
INCLUDE_ASM(s32, "code_B0E0", func_80030210);
INCLUDE_ASM(s32, "code_B0E0", func_8003034C);
void func_80030450(void) {
}
INCLUDE_ASM(s32, "code_B0E0", test_ray_zone_aabb);
INCLUDE_ASM(s32, "code_B0E0", func_800304FC);
INCLUDE_ASM(s32, "code_B0E0", do_camera_type_3);

View File

@ -1,20 +1,3 @@
#include "common.h"
INCLUDE_ASM(s32, "code_ad90_len_2880", do_camera_type_6);
INCLUDE_ASM(s32, "code_ad90_len_2880", do_camera_type_unused);
INCLUDE_ASM(s32, "code_ad90_len_2880", do_camera_type_5);
INCLUDE_ASM(s32, "code_ad90_len_2880", func_80030210);
INCLUDE_ASM(s32, "code_ad90_len_2880", func_8003034C);
void func_80030450(void) {
}
INCLUDE_ASM(s32, "code_ad90_len_2880", test_ray_zone_aabb);
INCLUDE_ASM(s32, "code_ad90_len_2880", func_800304FC);
INCLUDE_ASM(s32, "code_ad90_len_2880", do_camera_type_3);

View File

@ -44,8 +44,10 @@ segments:
- [0x7e40, c, os/code_7e40_len_3f0]
- [0x8230, c, os/nusys/nuSiMgr]
- [0x8560, c]
- [0x8800, c]
- [0x9d10, c, code_9d10_len_1080]
- [0xad90, c, code_ad90_len_2880]
- [0xB0E0, c]
- [0xd610, c, code_d610_len_1330]
- [0xe940, c, code_e940_len_290]
- [0xebd0, c, code_ebd0_len_6a0]
@ -92,7 +94,7 @@ segments:
- [0x3b2f0, c, os/nusys/nuContRmbCheck]
- [0x3b390, c, os/nusys/nuContRmbModeSet]
- [0x3b4a0, c, os/nusys/code_3B4A0]
- [0x3B5F0, c, os/nusys/nuGfxThread]
- [0x3B5F0, c, os/nusys/nuGfxThread] # End of nusys
- [0x3b710, c, os/code_3b710_len_40]
- [0x3b750, c, os/code_3b750_len_20]
- [0x3b770, c, os/code_3b770_len_80]