Name many files (#302)

* get_spirits_rescued: use enum StoryProgress

* rename 6240_len_c00 to fio

* rename 1b40_len_20b0 to main_loop

* rename 3bf0_len_6f0 to input

* rename 42e0_len_1f60 to rumble

* rename 6e40_len_500 to curtains

* rename 7340_len_b00 crash

* match func_8002C890

* intro_logos and state_battle split

* rename e940_len_290 to state_startup

* split state_logos and state_pause

* state_file_select

* state_world, state_intro

* state_title_screen

* state_demo

* split game_modes and camera
This commit is contained in:
alex 2021-07-08 17:50:23 +01:00 committed by GitHub
parent 03eccf598f
commit 6da5c0e41b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 741 additions and 418 deletions

34
src/camera.c Normal file
View File

@ -0,0 +1,34 @@
#include "common.h"
s32 gCurrentCameraID = 0;
s32 func_800328A4(Camera* camera, f32 arg1, f32 arg2);
void create_camera_leadplayer_matrix(Camera* camera);
INCLUDE_ASM(s32, "camera", test_ray_zone);
INCLUDE_ASM(s32, "camera", func_800322DC);
INCLUDE_ASM(s32, "camera", func_800325E4);
INCLUDE_ASM(s32, "camera", func_800328A4, Camera* camera, f32 arg1, f32 arg2);
INCLUDE_ASM(s32, "camera", func_80032970, Camera* camera, f32 arg1);
INCLUDE_ASM(s32, "camera", func_80032C64);
void create_camera_leadplayer_matrix(Camera *camera) {
f32 xTemp = camera->lookAt_eye.x - camera->lookAt_obj.x;
f32 yTemp = camera->lookAt_eye.y - camera->lookAt_obj.y;
f32 zTemp = camera->lookAt_eye.z - camera->lookAt_obj.z;
f32 dist = sqrtf(SQ(xTemp) + SQ(yTemp) + SQ(zTemp));
f32 theta = ((camera->vfov * 0.5f) / 180.0f) * PI;
f32 distSinTheta = dist * sin_rad(theta);
func_80032970(camera, (((distSinTheta / cos_rad(theta)) * camera->viewportW) / camera->viewportH) * camera->unk_520);
func_80032C64(camera);
guTranslateF(camera->viewMtxLeading, -camera->leadAmount, 0.0f, 0.0f);
}
void func_800334E8(void) {
}

View File

@ -1,5 +1,12 @@
#include "common.h" #include "common.h"
extern struct {
/* 0x000 */ char unk_000[0x9CC];
/* 0x9CC */ s32 unk_9CC;
/* 0x9D0 */ s16 unk_9D0;
/* 0x9D2 */ s16 unk_9D2;
} D_8009BB30; // size unknown
s32 D_80077210[] = { s32 D_80077210[] = {
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF29FFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF29FFFF,
0xFF2BFFFF, 0x2526FF2A, 0xFF272CFF, 0x00010203, 0x04050607, 0x080924FF, 0xFFFFFF28, 0xFF0A0B0C, 0x0D0E0F10, 0xFF2BFFFF, 0x2526FF2A, 0xFF272CFF, 0x00010203, 0x04050607, 0x080924FF, 0xFFFFFF28, 0xFF0A0B0C, 0x0D0E0F10,
@ -48,28 +55,32 @@ char* D_800773D8[6] = {
"Inexact operation", "Inexact operation",
}; };
INCLUDE_ASM(s32, "7340_len_b00", crash_delay_msec); INCLUDE_ASM(s32, "crash", crash_delay_msec);
INCLUDE_ASM(s32, "7340_len_b00", func_8002BFB0); INCLUDE_ASM(s32, "crash", func_8002BFB0);
INCLUDE_ASM(s32, "7340_len_b00", func_8002C054); INCLUDE_ASM(s32, "crash", func_8002C054);
INCLUDE_ASM(s32, "7340_len_b00", func_8002C1D4); INCLUDE_ASM(s32, "crash", func_8002C1D4);
INCLUDE_ASM(s32, "7340_len_b00", crash_printf_string); INCLUDE_ASM(s32, "crash", crash_printf_string);
INCLUDE_ASM(s32, "7340_len_b00", crash_print_fpr); INCLUDE_ASM(s32, "crash", crash_print_fpr);
INCLUDE_ASM(s32, "7340_len_b00", func_8002C324); INCLUDE_ASM(s32, "crash", func_8002C324);
INCLUDE_ASM(s32, "7340_len_b00", crash_show_handler); INCLUDE_ASM(s32, "crash", crash_show_handler);
INCLUDE_ASM(s32, "7340_len_b00", func_8002C7B0); INCLUDE_ASM(s32, "crash", func_8002C7B0);
INCLUDE_ASM(s32, "7340_len_b00", crash_monitor_thread); INCLUDE_ASM(s32, "crash", crash_monitor_thread);
INCLUDE_ASM(s32, "7340_len_b00", func_8002C890); void func_8002C890(s32 arg0, s16 arg1, s16 arg2) {
D_8009BB30.unk_9CC = arg0 | 0xA0000000;
D_8009BB30.unk_9D0 = arg1;
D_8009BB30.unk_9D2 = arg2;
}
INCLUDE_ASM(s32, "7340_len_b00", crash_create_monitor); INCLUDE_ASM(s32, "crash", crash_create_monitor);
INCLUDE_ASM(s32, "7340_len_b00", func_8002C94C); INCLUDE_ASM(s32, "crash", func_8002C94C);

View File

@ -89,7 +89,6 @@ void render_curtains(void) {
gSPDisplayList(gMasterGfxPos++, &D_80076078); gSPDisplayList(gMasterGfxPos++, &D_80076078);
gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW); gSPPopMatrix(gMasterGfxPos++, G_MTX_MODELVIEW);
gDPPipeSync(gMasterGfxPos++); gDPPipeSync(gMasterGfxPos++);
} }
if (gCurtainDrawCallback != NULL) { if (gCurtainDrawCallback != NULL) {

View File

@ -34,258 +34,6 @@ NUPiOverlaySegment D_8007795C = {
.bssEnd = 0x80278640 .bssEnd = 0x80278640
}; };
void appendGfx_intro_logos();
// bss?
extern s8* D_800A0910;
void state_init_logos(void) {
s8* romStart;
s8* romEnd;
s32* logoRam;
s32* temp_800A0910;
general_heap_create();
gGameStatusPtr->loadMenuState = 0;
gGameStatusPtr->menuCounter = 0;
gGameStatusPtr->bSkipIntro = FALSE;
intro_logos_set_fade_alpha(255);
intro_logos_set_fade_color(0);
romEnd = logos_ROM_END;
romStart = logos_ROM_START;
logoRam = heap_malloc(romEnd - romStart);
temp_800A0910 = &D_800A0910;
D_800A0910 = logoRam;
dma_copy(romStart, romEnd, logoRam);
// TODO probably this is not ideal
D_800A0918 = D_800A0910 + 0x0;
D_800A0914 = D_800A0910 + 0x7000;
D_800A091C = D_800A0910 + 0x15000;
nuContRmbForceStop();
create_cameras_a();
gCameras[0].mode = 6;
gCameras[0].unk_06 = 1;
gCameras[0].nearClip = 0x10;
gCameras[0].farClip = 0x1000;
gCurrentCameraID = 0;
gCameras[0].vfov = 25.0f;
gCameras[0].flags |= 0x2;
gCameras[1].flags |= 0x2;
gCameras[2].flags |= 0x2;
gCameras[3].flags |= 0x2;
set_cam_viewport(0, 12, 28, 296, 184);
gCameras[0].unk_1E = 0x28;
gCameras[0].backgroundColor[0] = 0;
gCameras[0].backgroundColor[1] = 0;
gCameras[0].backgroundColor[2] = 0;
gCameras[0].unk_54 = 25.0f;
gCameras[0].unk_58 = 25.0f;
gCameras[0].unk_1C = 0;
gCameras[0].unk_20 = 100;
gCameras[0].unk_22 = 0;
gCameras[0].lookAt_eye.x = 500.0f;
gCameras[0].lookAt_eye.y = 1000.0f;
gCameras[0].lookAt_eye.z = 1500.0f;
gCameras[0].unk_5C = 150.0f;
clear_script_list();
clear_generic_entity_list();
clear_render_tasks();
spr_init_sprites(0);
clear_animator_list();
clear_entity_models();
clear_npcs();
clear_hud_element_cache();
reset_background_settings();
clear_entity_data(1);
clear_effect_data();
gOverrideFlags |= 0x2;
intro_logos_update_fade();
gGameStatusPtr->enableBackground = FALSE;
}
void state_step_logos(void) {
if (gGameStatusPtr->bSkipIntro) {
if (intro_logos_fade_out(0xA) != 0) {
set_curtain_scale(1.0f);
set_curtain_fade(0.0f);
set_game_mode(2);
}
} else {
switch (gGameStatusPtr->loadMenuState) {
case 1:
if (gGameStatusPtr->menuCounter == 0) {
intro_logos_set_fade_color(208);
gGameStatusPtr->loadMenuState++;
}
gGameStatusPtr->menuCounter--;
break;
case 2:
if (intro_logos_fade_out(0xA) != 0) {
gGameStatusPtr->loadMenuState++;
}
break;
case 3:
if (intro_logos_fade_in(0xA) != 0) {
gGameStatusPtr->loadMenuState++;
gGameStatusPtr->menuCounter = 40;
}
break;
case 4:
if (gGameStatusPtr->menuCounter == 0) {
gGameStatusPtr->loadMenuState++;
intro_logos_set_fade_color(208);
}
gGameStatusPtr->menuCounter--;
break;
case 5:
if (intro_logos_fade_out(0xA) != 0) {
gGameStatusPtr->loadMenuState++;
}
break;
case 0:
case 6:
if (intro_logos_fade_in(0xA) != 0) {
gGameStatusPtr->loadMenuState++;
gGameStatusPtr->menuCounter = 30;
}
break;
case 7:
if (gGameStatusPtr->menuCounter == 0) {
gGameStatusPtr->loadMenuState++;
intro_logos_set_fade_color(208);
gGameStatusPtr->menuCounter = 30;
}
gGameStatusPtr->menuCounter--;
break;
case 8:
if (gGameStatusPtr->menuCounter == 0) {
gGameStatusPtr->loadMenuState++;
set_curtain_scale_goal(1.0f);
set_curtain_draw_callback(NULL);
set_curtain_fade_goal(0.3f);
} else {
gGameStatusPtr->menuCounter--;
}
break;
case 9:
if (intro_logos_fade_out(0xA) != 0) {
gGameStatusPtr->menuCounter = 15;
gGameStatusPtr->loadMenuState++;
}
break;
case 10:
if (gGameStatusPtr->menuCounter == 0) {
gGameStatusPtr->loadMenuState++;
} else {
gGameStatusPtr->menuCounter--;
}
break;
case 11:
heap_free(D_800A0910);
D_800A0910 = 0;
intro_logos_set_fade_alpha(255);
gGameStatusPtr->creditsViewportMode = 0;
set_game_mode(16);
break;
}
}
update_npcs();
update_cameras();
intro_logos_update_fade();
}
void state_drawUI_logos(void) {
appendGfx_intro_logos();
}
// all sorts of issues, but I think it's mostly with D_800A0918, 1C, and 14. Those need better types so they can have
// proper array accesses. the display list macros should mostly be good
#ifdef NON_MATCHING
void appendGfx_intro_logos(void) {
s32 i;
gDPPipeSync(gMasterGfxPos++);
gDPSetRenderMode(gMasterGfxPos++, G_RM_NOOP, G_RM_NOOP2);
gDPSetCombineMode(gMasterGfxPos++, G_CC_DECALRGB, G_CC_DECALRGB);
gDPSetCycleType(gMasterGfxPos++, G_CYC_FILL);
gDPSetFillColor(gMasterGfxPos++, 0xE739E739);
gDPFillRectangle(gMasterGfxPos++, 0, 0, 319, 239);
gDPPipeSync(gMasterGfxPos++);
switch (gGameStatusPtr->loadMenuState) {
case 0:
case 1:
case 2:
gSPDisplayList(gMasterGfxPos++, D_80077908);
for (i = 0; i < 7; i++) {
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 128, D_800A0918 + (i << 0xC));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 508, 60);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 508, 60);
gSPTextureRectangle(gMasterGfxPos++, 384, 256 + i * 64, 896, 320 + i * 64, G_TX_RENDERTILE, 0, 0, 1024, 1024);
gDPPipeSync(gMasterGfxPos++);
}
break;
case 3:
case 4:
case 5:
gSPDisplayList(gMasterGfxPos++, D_80077908);
for (i = 0; i < 6; i++) {
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 256, D_800A091C + (i << 0xC));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 1020, 28);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 1020, 28);
gSPTextureRectangle(gMasterGfxPos++, 128, 356 + i * 32, 1152, 388 + i * 32, G_TX_RENDERTILE, 0, 0, 1024, 1024);
gDPPipeSync(gMasterGfxPos++);
}
break;
case 6:
case 7:
case 8:
case 9:
gSPDisplayList(gMasterGfxPos++, D_80077908);
for (i = 0; i < 14; i++) {
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 256, D_800A0914[i] + (i << 0xC));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 1020, 28);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 1020, 28);
gSPTextureRectangle(gMasterGfxPos++, 128, 236 + i * 32, 1152, 268 + i * 32, G_TX_RENDERTILE, 0, 0, 1024, 1024);
gDPPipeSync(gMasterGfxPos++);
}
break;
}
}
#else
INCLUDE_ASM(void, "f270_len_1190", appendGfx_intro_logos);
#endif
void state_init_pause(void) { void state_init_pause(void) {
D_800A0921 = 0; D_800A0921 = 0;
D_800A0922 = 0; D_800A0922 = 0;

View File

@ -18,19 +18,19 @@ s32 get_spirits_rescued(void) {
s32 storyProgress = get_variable(NULL, STORY_PROGRESS); s32 storyProgress = get_variable(NULL, STORY_PROGRESS);
s32 ret = 7; s32 ret = 7;
if (storyProgress < get_variable(NULL, -0x4D)) { if (storyProgress < get_variable(NULL, STORY_CH1_STAR_SPIRIT_RESCUED)) {
ret = 0; ret = 0;
} else if (storyProgress < get_variable(NULL, -0x37)) { } else if (storyProgress < get_variable(NULL, STORY_CH2_STAR_SPIRIT_RESCUED)) {
ret = 1; ret = 1;
} else if (storyProgress < get_variable(NULL, -0xF)) { } else if (storyProgress < get_variable(NULL, STORY_CH3_STAR_SPIRIT_RESCUED)) {
ret = 2; ret = 2;
} else if (storyProgress < get_variable(NULL, 5)) { } else if (storyProgress < get_variable(NULL, STORY_CH4_STAR_SPIRIT_RESCUED)) {
ret = 3; ret = 3;
} else if (storyProgress < get_variable(NULL, 0x25)) { } else if (storyProgress < get_variable(NULL, STORY_CH5_OPENED_ESCAPE_ROUTE)) {
ret = 4; ret = 4;
} else if (storyProgress < get_variable(NULL, 0x39)) { } else if (storyProgress < get_variable(NULL, STORY_CH6_STAR_SPIRIT_RESCUED)) {
ret = 5; ret = 5;
} else if (storyProgress < get_variable(NULL, 0x57)) { } else if (storyProgress < get_variable(NULL, STORY_CH7_STAR_SPIRIT_RESCUED)) {
ret = 6; ret = 6;
} }

View File

@ -1,8 +1,6 @@
#include "common.h" #include "common.h"
s32 gCurrentCameraID = 0; // TODO: decide whether to call these 'game modes' or 'states'
s32 D_80077414[] = {0, 0, 0};
s32 D_80077420[] = { s32 D_80077420[] = {
0x000000E4, 0x000000E1, 0x000000EB, 0x000000EF, 0x000000F6, 0x0000010A, 0x0000010C, 0x00000121, 0x00000122, 0x000000E4, 0x000000E1, 0x000000EB, 0x000000EF, 0x000000F6, 0x0000010A, 0x0000010C, 0x00000121, 0x00000122,
@ -78,37 +76,6 @@ StateFunc gameModeMap[] = {
// BSS // BSS
extern s16 D_800A08F0; extern s16 D_800A08F0;
s32 func_800328A4(Camera* camera, f32 arg1, f32 arg2);
void create_camera_leadplayer_matrix(Camera* camera);
INCLUDE_ASM(s32, "d610_len_1330", test_ray_zone);
INCLUDE_ASM(s32, "d610_len_1330", func_800322DC);
INCLUDE_ASM(s32, "d610_len_1330", func_800325E4);
INCLUDE_ASM(s32, "d610_len_1330", func_800328A4, Camera* camera, f32 arg1, f32 arg2);
INCLUDE_ASM(s32, "d610_len_1330", func_80032970, Camera* camera, f32 arg1);
INCLUDE_ASM(s32, "d610_len_1330", func_80032C64);
void create_camera_leadplayer_matrix(Camera *camera) {
f32 xTemp = camera->lookAt_eye.x - camera->lookAt_obj.x;
f32 yTemp = camera->lookAt_eye.y - camera->lookAt_obj.y;
f32 zTemp = camera->lookAt_eye.z - camera->lookAt_obj.z;
f32 dist = sqrtf(SQ(xTemp) + SQ(yTemp) + SQ(zTemp));
f32 theta = ((camera->vfov * 0.5f) / 180.0f) * PI;
f32 distSinTheta = dist * sin_rad(theta);
func_80032970(camera, (((distSinTheta / cos_rad(theta)) * camera->viewportW) / camera->viewportH) * camera->unk_520);
func_80032C64(camera);
guTranslateF(camera->viewMtxLeading, -camera->leadAmount, 0.0f, 0.0f);
}
void func_800334E8(void) {
}
void set_game_mode(s16 idx) { void set_game_mode(s16 idx) {
D_800A08F0 = idx; D_800A08F0 = idx;
set_game_mode_slot(0, gameModeMap[idx]); set_game_mode_slot(0, gameModeMap[idx]);

View File

@ -21,4 +21,4 @@ void func_80028838(void) {
D_8009A6A6 = 0; D_8009A6A6 = 0;
} }
INCLUDE_ASM(s32, "3bf0_len_6f0", update_input); INCLUDE_ASM(s32, "input", update_input);

46
src/intro_logos.c Normal file
View File

@ -0,0 +1,46 @@
#include "common.h"
void intro_logos_set_fade_alpha(s16 alpha);
void intro_logos_set_fade_color(s16 color);
s16 intro_logos_fade_in(s16 subtractAlpha);
s16 intro_logos_fade_out(s16 addAlpha);
void intro_logos_update_fade(void);
void intro_logos_set_fade_alpha(s16 alpha) {
gGameStatusPtr->bootAlpha = alpha;
}
void intro_logos_set_fade_color(s16 color) {
gGameStatusPtr->bootRed = color;
gGameStatusPtr->bootGreen = color;
gGameStatusPtr->bootBlue = color;
}
s16 intro_logos_fade_in(s16 subtractAlpha) {
if (gGameStatusPtr->bootAlpha != 0) {
gGameStatusPtr->bootAlpha -= subtractAlpha;
if (gGameStatusPtr->bootAlpha << 16 < 0) {
gGameStatusPtr->bootAlpha = 0;
}
} else {
return 1;
}
return 0;
}
s16 intro_logos_fade_out(s16 addAlpha) {
if (gGameStatusPtr->bootAlpha != 255) {
gGameStatusPtr->bootAlpha += addAlpha;
if (gGameStatusPtr->bootAlpha > 255) {
gGameStatusPtr->bootAlpha = 255;
}
} else {
return 1;
}
return 0;
}
void intro_logos_update_fade(void) {
set_screen_overlay_params_front(0, gGameStatusPtr->bootAlpha);
set_screen_overlay_color(0, gGameStatusPtr->bootBlue, gGameStatusPtr->bootGreen, gGameStatusPtr->bootRed);
}

View File

@ -349,15 +349,15 @@ void gfx_init_state(void) {
gSPDisplayList(gMasterGfxPos++, OS_K0_TO_PHYSICAL(D_80074210)); gSPDisplayList(gMasterGfxPos++, OS_K0_TO_PHYSICAL(D_80074210));
} }
INCLUDE_ASM(s32, "1b40_len_20b0", func_800271FC); INCLUDE_ASM(s32, "main_loop", func_800271FC);
INCLUDE_ASM(s32, "1b40_len_20b0", func_8002725C); INCLUDE_ASM(s32, "main_loop", func_8002725C);
INCLUDE_ASM(s32, "1b40_len_20b0", func_80027600); INCLUDE_ASM(s32, "main_loop", func_80027600);
INCLUDE_ASM(s32, "1b40_len_20b0", func_80027774); INCLUDE_ASM(s32, "main_loop", func_80027774);
INCLUDE_ASM(s32, "1b40_len_20b0", func_800279B4); INCLUDE_ASM(s32, "main_loop", func_800279B4);
void func_80027BAC(s32 arg0, s32 arg1) { void func_80027BAC(s32 arg0, s32 arg1) {
s32 i; s32 i;
@ -389,4 +389,4 @@ void func_80027BAC(s32 arg0, s32 arg1) {
} }
} }
INCLUDE_ASM(void, "1b40_len_20b0", gfx_draw_background); INCLUDE_ASM(void, "main_loop", gfx_draw_background);

View File

@ -1,12 +1,4 @@
#include "common.h" #include "common.h"
#include "nu/nusys.h"
#include "ld_addrs.h"
void intro_logos_set_fade_alpha(s16 alpha);
void intro_logos_set_fade_color(s16 color);
s16 intro_logos_fade_in(s16 subtractAlpha);
s16 intro_logos_fade_out(s16 addAlpha);
void intro_logos_update_fade(void);
s32 D_800778A0[] = { s32 D_800778A0[] = {
&D_8038F800, &D_803B5000, &D_803DA800, 0x00000000, 0xFFFFFF00, 0xFFFFFF00, 0x00000000, 0x00000000, 0x00000000, &D_8038F800, &D_803B5000, &D_803DA800, 0x00000000, 0xFFFFFF00, 0xFFFFFF00, 0x00000000, 0x00000000, 0x00000000,
@ -28,45 +20,6 @@ Gfx D_800778C8[] = {
extern s32 D_800A0904; extern s32 D_800A0904;
extern s32 D_800A0908; extern s32 D_800A0908;
void intro_logos_set_fade_alpha(s16 alpha) {
gGameStatusPtr->bootAlpha = alpha;
}
void intro_logos_set_fade_color(s16 color) {
gGameStatusPtr->bootRed = color;
gGameStatusPtr->bootGreen = color;
gGameStatusPtr->bootBlue = color;
}
s16 intro_logos_fade_in(s16 subtractAlpha) {
if (gGameStatusPtr->bootAlpha != 0) {
gGameStatusPtr->bootAlpha -= subtractAlpha;
if (gGameStatusPtr->bootAlpha << 16 < 0) {
gGameStatusPtr->bootAlpha = 0;
}
} else {
return 1;
}
return 0;
}
s16 intro_logos_fade_out(s16 addAlpha) {
if (gGameStatusPtr->bootAlpha != 255) {
gGameStatusPtr->bootAlpha += addAlpha;
if (gGameStatusPtr->bootAlpha > 255) {
gGameStatusPtr->bootAlpha = 255;
}
} else {
return 1;
}
return 0;
}
void intro_logos_update_fade(void) {
set_screen_overlay_params_front(0, gGameStatusPtr->bootAlpha);
set_screen_overlay_color(0, gGameStatusPtr->bootBlue, gGameStatusPtr->bootGreen, gGameStatusPtr->bootRed);
}
void state_init_battle(void) { void state_init_battle(void) {
D_800A0900 = 5; D_800A0900 = 5;
} }
@ -152,7 +105,7 @@ void state_step_battle(void) {
update_cameras(); update_cameras();
} }
#else #else
INCLUDE_ASM(void, "ebd0_len_6a0", state_step_battle, void); INCLUDE_ASM(void, "state_battle", state_step_battle, void);
#endif #endif
void state_drawUI_battle(void) { void state_drawUI_battle(void) {
@ -168,7 +121,7 @@ void state_init_end_battle(void) {
D_800A0900 = 5; D_800A0900 = 5;
} }
INCLUDE_ASM(void, "ebd0_len_6a0", state_step_end_battle, void); INCLUDE_ASM(void, "state_battle", state_step_end_battle, void);
void state_drawUI_end_battle(void) { void state_drawUI_end_battle(void) {
} }

View File

@ -17,7 +17,7 @@ void state_init_demo(void) {
clear_script_list(); clear_script_list();
} }
INCLUDE_ASM(void, "13480_len_3f0", state_step_demo, void); INCLUDE_ASM(void, "state_demo", state_step_demo, void);
void state_drawUI_demo(void) { void state_drawUI_demo(void) {

View File

@ -66,7 +66,7 @@ void state_init_file_select(void) {
gOverrideFlags |= 0x10000; gOverrideFlags |= 0x10000;
} }
INCLUDE_ASM(void, "10400_len_d30", state_step_language_select, void); INCLUDE_ASM(void, "state_file_select", state_step_language_select, void);
void state_step_file_select(void) { void state_step_file_select(void) {
s32 temp = D_800A0931; // needed to match s32 temp = D_800A0931; // needed to match
@ -132,9 +132,9 @@ void state_init_exit_file_select(void) {
gOverrideFlags &= ~0x40; gOverrideFlags &= ~0x40;
} }
INCLUDE_ASM(void, "10400_len_d30", state_step_exit_language_select, void); INCLUDE_ASM(void, "state_file_select", state_step_exit_language_select, void);
INCLUDE_ASM(void, "10400_len_d30", state_step_exit_file_select, void); INCLUDE_ASM(void, "state_file_select", state_step_exit_file_select, void);
void state_drawUI_exit_language_select(void) { void state_drawUI_exit_language_select(void) {
} }

View File

@ -68,7 +68,7 @@ void state_init_intro(void) {
intro_logos_update_fade(); intro_logos_update_fade();
} }
INCLUDE_ASM(void, "11a50_len_7a0", state_step_intro, void); INCLUDE_ASM(void, "state_intro", state_step_intro, void);
void state_drawUI_intro(void) { void state_drawUI_intro(void) {
} }

254
src/state_logos.c Normal file
View File

@ -0,0 +1,254 @@
#include "common.h"
#include "ld_addrs.h"
void appendGfx_intro_logos();
// bss?
extern s8* D_800A0910;
void state_init_logos(void) {
s8* romStart;
s8* romEnd;
s32* logoRam;
s32* temp_800A0910;
general_heap_create();
gGameStatusPtr->loadMenuState = 0;
gGameStatusPtr->menuCounter = 0;
gGameStatusPtr->bSkipIntro = FALSE;
intro_logos_set_fade_alpha(255);
intro_logos_set_fade_color(0);
romEnd = logos_ROM_END;
romStart = logos_ROM_START;
logoRam = heap_malloc(romEnd - romStart);
temp_800A0910 = &D_800A0910;
D_800A0910 = logoRam;
dma_copy(romStart, romEnd, logoRam);
// TODO probably this is not ideal
D_800A0918 = D_800A0910 + 0x0;
D_800A0914 = D_800A0910 + 0x7000;
D_800A091C = D_800A0910 + 0x15000;
nuContRmbForceStop();
create_cameras_a();
gCameras[0].mode = 6;
gCameras[0].unk_06 = 1;
gCameras[0].nearClip = 0x10;
gCameras[0].farClip = 0x1000;
gCurrentCameraID = 0;
gCameras[0].vfov = 25.0f;
gCameras[0].flags |= 0x2;
gCameras[1].flags |= 0x2;
gCameras[2].flags |= 0x2;
gCameras[3].flags |= 0x2;
set_cam_viewport(0, 12, 28, 296, 184);
gCameras[0].unk_1E = 0x28;
gCameras[0].backgroundColor[0] = 0;
gCameras[0].backgroundColor[1] = 0;
gCameras[0].backgroundColor[2] = 0;
gCameras[0].unk_54 = 25.0f;
gCameras[0].unk_58 = 25.0f;
gCameras[0].unk_1C = 0;
gCameras[0].unk_20 = 100;
gCameras[0].unk_22 = 0;
gCameras[0].lookAt_eye.x = 500.0f;
gCameras[0].lookAt_eye.y = 1000.0f;
gCameras[0].lookAt_eye.z = 1500.0f;
gCameras[0].unk_5C = 150.0f;
clear_script_list();
clear_generic_entity_list();
clear_render_tasks();
spr_init_sprites(0);
clear_animator_list();
clear_entity_models();
clear_npcs();
clear_hud_element_cache();
reset_background_settings();
clear_entity_data(1);
clear_effect_data();
gOverrideFlags |= 0x2;
intro_logos_update_fade();
gGameStatusPtr->enableBackground = FALSE;
}
void state_step_logos(void) {
if (gGameStatusPtr->bSkipIntro) {
if (intro_logos_fade_out(0xA) != 0) {
set_curtain_scale(1.0f);
set_curtain_fade(0.0f);
set_game_mode(2);
}
} else {
switch (gGameStatusPtr->loadMenuState) {
case 1:
if (gGameStatusPtr->menuCounter == 0) {
intro_logos_set_fade_color(208);
gGameStatusPtr->loadMenuState++;
}
gGameStatusPtr->menuCounter--;
break;
case 2:
if (intro_logos_fade_out(0xA) != 0) {
gGameStatusPtr->loadMenuState++;
}
break;
case 3:
if (intro_logos_fade_in(0xA) != 0) {
gGameStatusPtr->loadMenuState++;
gGameStatusPtr->menuCounter = 40;
}
break;
case 4:
if (gGameStatusPtr->menuCounter == 0) {
gGameStatusPtr->loadMenuState++;
intro_logos_set_fade_color(208);
}
gGameStatusPtr->menuCounter--;
break;
case 5:
if (intro_logos_fade_out(0xA) != 0) {
gGameStatusPtr->loadMenuState++;
}
break;
case 0:
case 6:
if (intro_logos_fade_in(0xA) != 0) {
gGameStatusPtr->loadMenuState++;
gGameStatusPtr->menuCounter = 30;
}
break;
case 7:
if (gGameStatusPtr->menuCounter == 0) {
gGameStatusPtr->loadMenuState++;
intro_logos_set_fade_color(208);
gGameStatusPtr->menuCounter = 30;
}
gGameStatusPtr->menuCounter--;
break;
case 8:
if (gGameStatusPtr->menuCounter == 0) {
gGameStatusPtr->loadMenuState++;
set_curtain_scale_goal(1.0f);
set_curtain_draw_callback(NULL);
set_curtain_fade_goal(0.3f);
} else {
gGameStatusPtr->menuCounter--;
}
break;
case 9:
if (intro_logos_fade_out(0xA) != 0) {
gGameStatusPtr->menuCounter = 15;
gGameStatusPtr->loadMenuState++;
}
break;
case 10:
if (gGameStatusPtr->menuCounter == 0) {
gGameStatusPtr->loadMenuState++;
} else {
gGameStatusPtr->menuCounter--;
}
break;
case 11:
heap_free(D_800A0910);
D_800A0910 = 0;
intro_logos_set_fade_alpha(255);
gGameStatusPtr->creditsViewportMode = 0;
set_game_mode(16);
break;
}
}
update_npcs();
update_cameras();
intro_logos_update_fade();
}
void state_drawUI_logos(void) {
appendGfx_intro_logos();
}
// all sorts of issues, but I think it's mostly with D_800A0918, 1C, and 14. Those need better types so they can have
// proper array accesses. the display list macros should mostly be good
#ifdef NON_MATCHING
void appendGfx_intro_logos(void) {
s32 i;
gDPPipeSync(gMasterGfxPos++);
gDPSetRenderMode(gMasterGfxPos++, G_RM_NOOP, G_RM_NOOP2);
gDPSetCombineMode(gMasterGfxPos++, G_CC_DECALRGB, G_CC_DECALRGB);
gDPSetCycleType(gMasterGfxPos++, G_CYC_FILL);
gDPSetFillColor(gMasterGfxPos++, 0xE739E739);
gDPFillRectangle(gMasterGfxPos++, 0, 0, 319, 239);
gDPPipeSync(gMasterGfxPos++);
switch (gGameStatusPtr->loadMenuState) {
case 0:
case 1:
case 2:
gSPDisplayList(gMasterGfxPos++, D_80077908);
for (i = 0; i < 7; i++) {
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 128, D_800A0918 + (i << 0xC));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 508, 60);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 508, 60);
gSPTextureRectangle(gMasterGfxPos++, 384, 256 + i * 64, 896, 320 + i * 64, G_TX_RENDERTILE, 0, 0, 1024, 1024);
gDPPipeSync(gMasterGfxPos++);
}
break;
case 3:
case 4:
case 5:
gSPDisplayList(gMasterGfxPos++, D_80077908);
for (i = 0; i < 6; i++) {
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 256, D_800A091C + (i << 0xC));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 1020, 28);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 1020, 28);
gSPTextureRectangle(gMasterGfxPos++, 128, 356 + i * 32, 1152, 388 + i * 32, G_TX_RENDERTILE, 0, 0, 1024, 1024);
gDPPipeSync(gMasterGfxPos++);
}
break;
case 6:
case 7:
case 8:
case 9:
gSPDisplayList(gMasterGfxPos++, D_80077908);
for (i = 0; i < 14; i++) {
gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 256, D_800A0914[i] + (i << 0xC));
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gMasterGfxPos++);
gDPLoadTile(gMasterGfxPos++, G_TX_LOADTILE, 0, 0, 1020, 28);
gDPPipeSync(gMasterGfxPos++);
gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 64, 0x0000, G_TX_RENDERTILE, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOLOD);
gDPSetTileSize(gMasterGfxPos++, G_TX_RENDERTILE, 0, 0, 1020, 28);
gSPTextureRectangle(gMasterGfxPos++, 128, 236 + i * 32, 1152, 268 + i * 32, G_TX_RENDERTILE, 0, 0, 1024, 1024);
gDPPipeSync(gMasterGfxPos++);
}
break;
}
}
#else
INCLUDE_ASM(void, "state_logos", appendGfx_intro_logos);
#endif

247
src/state_pause.c Normal file
View File

@ -0,0 +1,247 @@
#include "common.h"
#include "ld_addrs.h"
#include "map.h"
#include "nu/nusys.h"
Gfx D_80077908[] = {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
gsDPSetTextureFilter(G_TF_POINT),
gsSPEndDisplayList(),
};
// probably a file split
static s32 padding[] = {0, 0};
s32 D_80077950[] = { 0x8038F800, 0x803B5000, &D_803DA800 };
// TODO the gPauseMenuIconScripts should be DATA_START
// TODO the gPauseMenuHeldButtons should be BSS_START
// TODO 80278640 is BSS_END
NUPiOverlaySegment D_8007795C = {
.romStart = pause_ROM_START,
.romEnd = pause_ROM_END,
.ramStart = pause_VRAM,
.textStart = pause_VRAM,
.textEnd = gPauseMenuIconScripts,
.dataStart = gPauseMenuIconScripts,
.dataEnd = &gPauseMenuHeldButtons,
.bssStart = &gPauseMenuHeldButtons,
.bssEnd = 0x80278640
};
void state_init_pause(void) {
D_800A0921 = 0;
D_800A0922 = 0;
disable_player_input();
set_time_freeze_mode(3);
set_windows_visible(2);
}
void state_step_pause(void) {
s32 oldIsBattle = D_800A0921;
switch (D_800A0921) {
case 0:
update_encounters();
update_npcs();
update_player();
update_effects();
if (D_8009A658[1] == D_8009A64C) {
D_800A0920 = 4;
D_800A0921 = 2;
gOverrideFlags |= 0x8;
gGameStatusPtr->enableBackground &= ~0xF0;
gGameStatusPtr->enableBackground |= 0x10;
}
break;
case 2:
if (D_800A0920 >= 0) {
if (D_800A0920 != 0) {
(D_800A0920)--;
}
if (D_800A0920 == 0) {
D_800A0920 = -1;
nuGfxSetCfb(&D_80077950, 2);
gGameStatusPtr->unk_15E = gGameStatusPtr->unk_15C;
sfx_stop_env_sounds();
func_8003B1A8();
gGameStatusPtr->isBattle = oldIsBattle;
allocate_hit_tables();
battle_heap_create();
nuContRmbForceStop();
sfx_clear_env_sounds(0);
spr_init_sprites(0);
clear_model_data();
clear_sprite_shading_data();
reset_background_settings();
clear_entity_models();
clear_animator_list();
clear_generic_entity_list();
set_hud_element_nonworld_cache(_3169F0_VRAM, 0x38000);
clear_hud_element_cache();
reset_status_menu();
clear_item_entity_data();
clear_script_list();
clear_npcs();
clear_entity_data(0);
clear_trigger_data();
D_800A0924 = func_80149828();
func_801497FC(0);
bgm_quiet_max_volume();
nuPiReadRomOverlay(&D_8007795C);
pause_init();
gOverrideFlags &= ~0x8;
}
if (D_800A0920 >= 0) {
break;
}
}
if (D_800A0920 >= -10) {
pause_handle_input(0, 0);
D_800A0920--;
} else {
pause_handle_input(gGameStatusPtr->pressedButtons, gGameStatusPtr->heldButtons);
}
D_800A0922 = 0;
break;
}
}
void state_drawUI_pause(void) {
}
void state_init_unpause(void) {
if (D_800A0922 > 0) {
D_800A0921 = 0;
} else {
D_800A0921 = 1;
}
D_800A0920 = 4;
}
void state_step_unpause(void) {
switch (D_800A0921) {
case 0:
case 1:
if (D_800A0920 == 4) {
gOverrideFlags |= 0x8;
}
if (D_800A0920 >= 0) {
if (D_800A0920 != 0) {
D_800A0920--;
}
if (D_800A0920 == 0) {
if (D_800A0920 == 0) {
MapConfig* mapConfig;
Map* map;
s32 assetData;
s32 assetSize;
D_800A0920 = -1;
nuGfxSetCfb(&D_80077950, ARRAY_COUNT(D_80077950));
pause_cleanup();
gOverrideFlags &= ~0x8;
mapConfig = get_current_map_header();
map = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID];
gGameStatusPtr->isBattle = FALSE;
gGameStatusPtr->enableBackground &= ~0xF0;
func_8005AF84();
func_8002ACDC();
nuContRmbForceStopEnd();
sfx_clear_env_sounds(1);
spr_init_sprites(gGameStatusPtr->playerSpriteSet);
init_model_data();
init_sprite_shading_data();
init_entity_models();
reset_animator_list();
init_generic_entity_list();
set_hud_element_nonworld_cache(0, 0);
init_hud_element_list();
init_item_entity_list();
init_script_list();
init_npc_list();
func_80110E58();
init_trigger_list();
func_801497FC(D_800A0924);
bgm_reset_max_volume();
load_map_script_lib();
assetData = load_asset_by_name(&D_800D9230, &assetSize);
decode_yay0(assetData, &D_80210000);
general_heap_free(assetData);
initialize_collision();
load_collision();
if (map->dmaStart != NULL) {
dma_copy(map->dmaStart, map->dmaEnd, map->dmaDest);
}
load_map_bg(map->bgName);
if (mapConfig->background != NULL) {
read_background_size(mapConfig->background);
} else {
set_background_size(296, 200, 12, 20);
}
gGameStatusPtr->unk_15C = gGameStatusPtr->unk_15E;
calculate_model_sizes();
npc_reload_all();
set_windows_visible(0);
func_800E98C4();
set_time_freeze_mode(1);
D_800A0921 = 3;
gPlayerStatus.alpha2 = gPlayerStatus.alpha1 - 1;
D_802D9D71 = D_802D9D70 + 1;
update_encounters();
update_npcs();
update_player();
update_effects();
D_800A0922 -= 20;
if (D_800A0922 < 0) {
D_800A0922 = 0;
}
}
}
}
break;
case 3:
update_encounters();
update_npcs();
update_player();
update_effects();
if (D_800A0922 == 0) {
D_800A0921 = 4;
} else {
D_800A0922 -= 20;
if (D_800A0922 < 0) {
D_800A0922 = 0;
}
}
break;
case 4:
set_time_freeze_mode(0);
update_encounters();
update_npcs();
update_player();
update_effects();
enable_player_input();
set_game_mode(4);
break;
}
}
void state_drawUI_unpause(void) {
}

View File

@ -47,9 +47,9 @@ extern s32* D_800A0978;
extern s32* D_800A097C; extern s32* D_800A097C;
extern s32 D_800A0980; extern s32 D_800A0980;
INCLUDE_ASM(void, "121f0_len_1290", state_init_title_screen, void); INCLUDE_ASM(void, "state_title_screen", state_init_title_screen, void);
INCLUDE_ASM(void, "121f0_len_1290", state_step_title_screen, void); INCLUDE_ASM(void, "state_title_screen", state_step_title_screen, void);
void state_drawUI_title_screen(void) { void state_drawUI_title_screen(void) {
switch (gGameStatusPtr->loadMenuState) { switch (gGameStatusPtr->loadMenuState) {
@ -74,7 +74,7 @@ void state_drawUI_title_screen(void) {
} }
} }
INCLUDE_ASM(s32, "121f0_len_1290", appendGfx_title_screen); INCLUDE_ASM(void, "state_title_screen", appendGfx_title_screen);
void draw_title_screen_NOP(void) { void draw_title_screen_NOP(void) {
} }
@ -84,7 +84,7 @@ void title_screen_draw_images(f32 arg0, f32 arg1) {
title_screen_draw_copyright(arg1); title_screen_draw_copyright(arg1);
} }
INCLUDE_ASM(void, "121f0_len_1290", title_screen_draw_logo); INCLUDE_ASM(void, "state_title_screen", title_screen_draw_logo);
void title_screen_draw_press_start(void) { void title_screen_draw_press_start(void) {
switch (D_80077A2C) { switch (D_80077A2C) {

File diff suppressed because one or more lines are too long

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8002C890
/* 7C90 8002C890 3C02800A */ lui $v0, %hi(D_8009BB30)
/* 7C94 8002C894 2442BB30 */ addiu $v0, $v0, %lo(D_8009BB30)
/* 7C98 8002C898 3C03A000 */ lui $v1, 0xa000
/* 7C9C 8002C89C 00832025 */ or $a0, $a0, $v1
/* 7CA0 8002C8A0 AC4409CC */ sw $a0, 0x9cc($v0)
/* 7CA4 8002C8A4 A44509D0 */ sh $a1, 0x9d0($v0)
/* 7CA8 8002C8A8 03E00008 */ jr $ra
/* 7CAC 8002C8AC A44609D2 */ sh $a2, 0x9d2($v0)

View File

@ -43,14 +43,14 @@ segments:
- [0x1000, hasm, entry_point] - [0x1000, hasm, entry_point]
- [0x1060, c, 1060_len_310] - [0x1060, c, 1060_len_310]
- [0x1370, c, 1370_len_7d0] - [0x1370, c, 1370_len_7d0]
- [0x1b40, c, 1b40_len_20b0] - [0x1b40, c, main_loop]
- [0x3bf0, c, 3bf0_len_6f0] - [0x3bf0, c, input]
- [0x42e0, c, 42e0_len_1f60] - [0x42e0, c, rumble]
- [0x43F0, c] - [0x43F0, c]
- [0x6000, c, heap] - [0x6000, c, heap]
- [0x6240, c, fio] - [0x6240, c, fio]
- [0x6e40, c, 6e40_len_500] - [0x6e40, c, curtains]
- [0x7340, c, 7340_len_b00] - [0x7340, c, crash]
- [0x7e40, c, os/nusys/7e40_len_3f0] - [0x7e40, c, os/nusys/7e40_len_3f0]
- [0x8230, c, os/nusys/nuSiMgr] - [0x8230, c, os/nusys/nuSiMgr]
- [0x8560, c] - [0x8560, c]
@ -58,16 +58,19 @@ segments:
- [0x9d10, c, 9d10_len_1080] - [0x9d10, c, 9d10_len_1080]
- [0xad90, c, ad90_len_2880] - [0xad90, c, ad90_len_2880]
- [0xB0E0, c] - [0xB0E0, c]
- [0xd610, c, d610_len_1330] - [0xd610, c, camera]
- [0xe940, c, e940_len_290] - [0xe8f0, c, game_modes]
- [0xebd0, c, ebd0_len_6a0] - [0xe940, c, state_startup]
- [0xf270, c, f270_len_1190] - [0xebd0, c, intro_logos]
- [0x10400, c, 10400_len_d30] - [0xecd0, c, state_battle]
- [0x11130, c, 11130_len_c0] - [0xf270, c, state_logos]
- [0x111f0, c, 111f0_len_860] - [0xfd40, c, state_pause]
- [0x11a50, c, 11a50_len_7a0] - [0x10400, c, state_file_select]
- [0x121f0, c, 121f0_len_1290] - [0x11130, c, state_world]
- [0x13480, c, 13480_len_3f0] - [0x111f0, c, 111f0_len_860] # possibly still state_world
- [0x11a50, c, state_intro]
- [0x121f0, c, state_title_screen]
- [0x13480, c, state_demo]
- [0x13870, c, npc] - [0x13870, c, npc]
- [0x1a1f0, c, 1a1f0_len_5390] - [0x1a1f0, c, 1a1f0_len_5390]
- [0x1f580, c, 1f580_len_1940] - [0x1f580, c, 1f580_len_1940]
@ -247,21 +250,22 @@ segments:
- [0x4DF30, c, 4DF30] - [0x4DF30, c, 4DF30]
- [0x4E5A0, data, 1000_len_60] - [0x4E5A0, data, 1000_len_60]
- [0x4F410, .data, 1370_len_7d0] - [0x4F410, .data, 1370_len_7d0]
- [0x4F420, .data, 1b40_len_20b0] - [0x4F420, .data, main_loop]
- [0x4F660, .data, 42e0_len_1f60] - [0x4F660, .data, rumble]
- [0x4F670, .data, 43F0] - [0x4F670, .data, 43F0]
- [0x4F9D0, .data, fio] - [0x4F9D0, .data, fio]
- [0x4F9E0, data, 6e40_beginning_data] - [0x4F9E0, data, 6e40_beginning_data]
- [0x51540, ia8, no_controller, 128, 32] - [0x51540, ia8, no_controller, 128, 32]
- [0x52540, .data, 6e40_len_500] - [0x52540, .data, curtains]
- [0x52610, .data, 7340_len_b00] - [0x52610, .data, crash]
- [0x527F0, .data, os/nusys/7e40_len_3f0] - [0x527F0, .data, os/nusys/7e40_len_3f0]
- [0x52800, .data, os/nusys/nuSiMgr] - [0x52800, .data, os/nusys/nuSiMgr]
- [0x52810, .data, d610_len_1330] - [0x52810, .data, camera]
- [0x52CA0, .data, ebd0_len_6a0] - [auto, .data, game_modes]
- [0x52D08, .data, f270_len_1190] - [0x52CA0, .data, state_battle]
- [0x52D80, .data, 10400_len_d30] - [0x52D08, .data, state_pause]
- [0x52DC0, .data, 121f0_len_1290] - [0x52D80, .data, state_file_select]
- [0x52DC0, .data, state_title_screen]
- [0x52EE0, data] # Start of 13480_len_3f0's data - [0x52EE0, data] # Start of 13480_len_3f0's data
- [0x53570, .data, 25f00_len_940] - [0x53570, .data, 25f00_len_940]
- [0x53590, data, 26840_len_20d0] - [0x53590, data, 26840_len_20d0]
@ -290,19 +294,19 @@ segments:
- [0x70E30, .data, battle/battle] - [0x70E30, .data, battle/battle]
- [0x71430, data] - [0x71430, data]
- [0x73130, .rodata, 1060_len_310] - [0x73130, .rodata, 1060_len_310]
- [0x73148, .rodata, 1b40_len_20b0] - [0x73148, .rodata, main_loop]
- [0x73160, .rodata, 43F0] - [0x73160, .rodata, 43F0]
- [0x73200, .rodata, 6e40_len_500] - [0x73200, .rodata, curtains]
- [0x73230, .rodata, 7340_len_b00] - [0x73230, .rodata, crash]
- [0x735E0, .rodata, 8800] - [0x735E0, .rodata, 8800]
- [0x73610, .rodata, B0E0] - [0x73610, .rodata, B0E0]
- [0x73680, .rodata, d610_len_1330] - [0x73680, .rodata, camera]
- [0x73690, .rodata, f270_len_1190] - [0x73690, .rodata, state_logos]
- [0x736E8, .rodata, 10400_len_d30] - [0x736E8, .rodata, state_file_select]
- [0x73720, .rodata, 111f0_len_860] - [0x73720, .rodata, 111f0_len_860]
- [0x73738, .rodata, 11a50_len_7a0] - [0x73738, .rodata, state_intro]
- [0x73790, .rodata, 121f0_len_1290] - [0x73790, .rodata, state_title_screen]
- [0x73860, .rodata, 13480_len_3f0] - [0x73860, .rodata, state_demo]
- [0x73880, .rodata, npc] - [0x73880, .rodata, npc]
- [0x739F0, .rodata, 1a1f0_len_5390] - [0x739F0, .rodata, 1a1f0_len_5390]
- [0x73AB0, .rodata, 20ec0_len_5040] - [0x73AB0, .rodata, 20ec0_len_5040]
@ -331,7 +335,7 @@ segments:
- [0x75978, .rodata, 4DF30] - [0x75978, .rodata, 4DF30]
# bss starts at 0x8009A5B0 # bss starts at 0x8009A5B0
# 0x800 of bss until... # 0x800 of bss until...
# - [0x75240, .bss, 1b40_len_20b0] # - [0x75240, .bss, main_loop]
# - [0x75240, .bss, os/39cb0_len_100, 0x0] # size unknown # - [0x75240, .bss, os/39cb0_len_100, 0x0] # size unknown
- type: code - type: code
start: 0x759B0 start: 0x759B0