From 9a33aef12506c33cefd435d6de41d2a208bef42f Mon Sep 17 00:00:00 2001 From: Prakxo Date: Fri, 3 Nov 2023 11:40:02 +0000 Subject: [PATCH] link ac_weather --- config/rel_slices.yml | 8 ++++---- include/ac_weather_fine.h | 4 +++- include/ac_weather_leaf.h | 2 ++ include/ac_weather_rain.h | 2 ++ include/ac_weather_sakura.h | 2 ++ include/ac_weather_snow.h | 2 ++ include/ef_effect_control.h | 7 ++++++- rel/ac_weather.c | 21 ++++++++++++++------- 8 files changed, 35 insertions(+), 13 deletions(-) diff --git a/config/rel_slices.yml b/config/rel_slices.yml index eafc26ce..5685872f 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -542,10 +542,10 @@ m_map_ovl.c: .rodata: [0x8064B628, 0x8064B6B0] .data: [0x806CD9C0, 0x806CE008] .bss: [0x81340468, 0x81340488] -#ac_weather.c: -# .text: [0x8060193C, 0x80602E70] -# .rodata: [] -# .data: [] +ac_weather.c: + .text: [0x8060193C, 0x80602E70] + .rodata: [0x8064BAE8, 0x8064BB08] + .data: [0x806D1D50, 0x806D1DA0] m_select.c: .text: [0x80627F88, 0x80629CA8] .rodata: [0x8064D1B0, 0x8064D1B8] diff --git a/include/ac_weather_fine.h b/include/ac_weather_fine.h index 8f96167c..4815a418 100644 --- a/include/ac_weather_fine.h +++ b/include/ac_weather_fine.h @@ -14,4 +14,6 @@ extern aWeather_Profile_c iam_weather_fine; #ifdef __cplusplus } -#endif \ No newline at end of file +#endif + +#endif diff --git a/include/ac_weather_leaf.h b/include/ac_weather_leaf.h index 977ed91b..50f4a832 100644 --- a/include/ac_weather_leaf.h +++ b/include/ac_weather_leaf.h @@ -14,4 +14,6 @@ extern aWeather_Profile_c iam_weather_leaf; #ifdef __cplusplus } +#endif + #endif \ No newline at end of file diff --git a/include/ac_weather_rain.h b/include/ac_weather_rain.h index 0323eb11..9c8c5721 100644 --- a/include/ac_weather_rain.h +++ b/include/ac_weather_rain.h @@ -14,4 +14,6 @@ extern aWeather_Profile_c iam_weather_rain; #ifdef __cplusplus } +#endif + #endif \ No newline at end of file diff --git a/include/ac_weather_sakura.h b/include/ac_weather_sakura.h index dabf8133..e052a646 100644 --- a/include/ac_weather_sakura.h +++ b/include/ac_weather_sakura.h @@ -14,4 +14,6 @@ extern aWeather_Profile_c iam_weather_sakura; #ifdef __cplusplus } +#endif + #endif \ No newline at end of file diff --git a/include/ac_weather_snow.h b/include/ac_weather_snow.h index 490f1bc0..ecab7a23 100644 --- a/include/ac_weather_snow.h +++ b/include/ac_weather_snow.h @@ -14,4 +14,6 @@ extern aWeather_Profile_c iam_weather_snow; #ifdef __cplusplus } +#endif + #endif \ No newline at end of file diff --git a/include/ef_effect_control.h b/include/ef_effect_control.h index 1edd904f..2a8dfbd7 100644 --- a/include/ef_effect_control.h +++ b/include/ef_effect_control.h @@ -30,11 +30,16 @@ enum { typedef void (*eEC_NAME2EFFECTMAKE_PROC)(int, xyz_t, int, short, GAME*, u16, s16, s16); +typedef void (*eEC_REGISTEFFECTLIGHT_PROC)(f32*, s16,s16,s16); + typedef int (*eEC_EFFECTLIGHTSTATUS_PROC)(rgba_t*, int*); // returns eEC_LIGHT_COLOR_* typedef struct effect_control_clip_s { /* 0x00 */ eEC_NAME2EFFECTMAKE_PROC effect_make_proc; - /* 0x04 */ u8 _04[0x3C - 0x04]; + /* 0x04 */ u8 _04[0x30 - 0x04]; + /* 0x30 */ eEC_REGISTEFFECTLIGHT_PROC regist_effect_light; + /* 0x34 */ void* _34; + /* 0x38 */ void* _38; /* 0x3C */ eEC_EFFECTLIGHTSTATUS_PROC effect_light_status; /* 0x40 */ void* _40; /* 0x44 */ void* _44; diff --git a/rel/ac_weather.c b/rel/ac_weather.c index 3c3631ff..d4033768 100644 --- a/rel/ac_weather.c +++ b/rel/ac_weather.c @@ -12,10 +12,13 @@ #include "m_malloc.h" #include "m_player_lib.h" -void Weather_Actor_ct(ACTOR* actor, GAME* game); -void Weather_Actor_dt(ACTOR* actor, GAME* game); -void Weather_Actor_move(ACTOR* actor, GAME* game); -void Weather_Actor_draw(ACTOR* actor, GAME* game); +static void Weather_Actor_ct(ACTOR* actor, GAME* game); +static void Weather_Actor_dt(ACTOR* actor, GAME* game); +static void Weather_Actor_move(ACTOR* actor, GAME* game); +static void Weather_Actor_draw(ACTOR* actor, GAME* game); + + +static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id); static aWeather_Profile_c* profile_tbl[] = { &iam_weather_fine, @@ -369,8 +372,12 @@ void aWeather_SnowInAdvance(WEATHER_ACTOR* weather, GAME_PLAY* play, int moves){ void Weather_Actor_ct(ACTOR* actor, GAME* game){ - static s16 DemoWeatherTbl[10][2] = { - + static s16 DemoWeatherTbl[5][2] = { + 3,1, + 1,2, + 0,0, + 0,0, + 2,1, }; WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor; GAME_PLAY* play = (GAME_PLAY*)game; @@ -637,7 +644,7 @@ static void aWeather_MakeKaminari(WEATHER_ACTOR* weather){ if (((timer == weather->lightning_timer2) || (timer == (weather->lightning_timer2 + 20))) && (Common_Get(clip.effect_clip) != NULL) && ( (Save_Get(scene_no) - SCENE_MY_ROOM_BASEMENT_S) > 3U) && ( (Save_Get(scene_no) - SCENE_MUSEUM_ROOM_PAINTING) > 1U) && ( Save_Get(scene_no) != SCENE_MUSEUM_ROOM_FISH)) { - f32 effect[] = { 12712.2f }; + f32 effect[] = { 12712.249f }; Common_Get(clip.effect_clip)->regist_effect_light(effect, 2, 0x23, 0); } if (timer == (weather->lightning_timer2 + 65)) {