From 44a20017a1742137bb8fc7421e5ac47dd6c6ecdb Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 18 Oct 2024 17:22:30 +0200 Subject: [PATCH] tr2: port S_IntroFMV --- docs/tr2/progress.svg | 16 ++++++++-------- docs/tr2/progress.txt | 2 +- src/tr2/decomp/fmv.c | 6 ++++++ src/tr2/decomp/fmv.h | 1 + src/tr2/global/funcs.h | 1 - src/tr2/inject_exec.c | 1 + 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/docs/tr2/progress.svg b/docs/tr2/progress.svg index ae8b9d4c9..3c36e68aa 100644 --- a/docs/tr2/progress.svg +++ b/docs/tr2/progress.svg @@ -69,10 +69,10 @@ Tomb2.exe progress according to the physical function order: -63.67% (792) · 33.92% (422) · 0% (0) · 2.41% (30) +63.75% (793) · 33.84% (421) · 0% (0) · 2.41% (30) - - + + @@ -1067,7 +1067,7 @@ void __cdecl S_FadeToBlack(void); void __cdecl S_Wait(int32_t timeout, BOOL input_check); bool __cdecl S_PlayFMV(const char *file_name); -bool __cdecl S_IntroFMV(const char *file_name1, const char *file_name2); +bool __cdecl S_IntroFMV(const char *file_name1, const char *file_name2); int16_t __cdecl Game_Start(int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type); int32_t __cdecl Game_Loop(bool demo_mode); int32_t __cdecl LevelCompleteSequence(void); @@ -1324,10 +1324,10 @@ Tomb2.exe progress according to the function sizes: -70.18% · 29.50% · 0% · 0.33% +70.18% · 29.49% · 0% · 0.33% - - + + @@ -2486,7 +2486,7 @@ void __cdecl Lara_Col_Swim(ITEM *item, COLL_INFO *coll); void __thiscall S_FlaggedString_Delete(STRING_FLAGGED *string); void __cdecl WinVidFinish(void); -bool __cdecl S_IntroFMV(const char *file_name1, const char *file_name2); +bool __cdecl S_IntroFMV(const char *file_name1, const char *file_name2); LONG __cdecl DeleteRegistryValue(LPCTSTR lpValueName); sub_4449A0 DISPLAY_MODE *__thiscall InsertDisplayMode(DISPLAY_MODE_LIST *modeList, DISPLAY_MODE_NODE *before); diff --git a/docs/tr2/progress.txt b/docs/tr2/progress.txt index fdd4e9ecc..d547a0b1e 100644 --- a/docs/tr2/progress.txt +++ b/docs/tr2/progress.txt @@ -3937,7 +3937,7 @@ typedef enum { 0x0044C3A0 0x0043 *R void __cdecl S_FadeToBlack(void); 0x0044C3F0 0x0057 +R void __cdecl S_Wait(int32_t timeout, BOOL input_check); 0x0044C450 0x000E +R bool __cdecl S_PlayFMV(const char *file_name); -0x0044C460 0x0013 -R bool __cdecl S_IntroFMV(const char *file_name1, const char *file_name2); +0x0044C460 0x0013 +R bool __cdecl S_IntroFMV(const char *file_name1, const char *file_name2); 0x0044C480 0x0144 + int16_t __cdecl Game_Start(int32_t level_num, GAMEFLOW_LEVEL_TYPE level_type); 0x0044C5D0 0x009A + int32_t __cdecl Game_Loop(bool demo_mode); 0x0044C670 0x0006 +R int32_t __cdecl LevelCompleteSequence(void); diff --git a/src/tr2/decomp/fmv.c b/src/tr2/decomp/fmv.c index e786452f5..258b40148 100644 --- a/src/tr2/decomp/fmv.c +++ b/src/tr2/decomp/fmv.c @@ -163,3 +163,9 @@ bool __cdecl S_PlayFMV(const char *const file_name) { return PlayFMV(file_name); } + +bool __cdecl S_IntroFMV( + const char *const file_name_1, const char *const file_name_2) +{ + return IntroFMV(file_name_1, file_name_2); +} diff --git a/src/tr2/decomp/fmv.h b/src/tr2/decomp/fmv.h index 204880221..c30a15293 100644 --- a/src/tr2/decomp/fmv.h +++ b/src/tr2/decomp/fmv.h @@ -8,3 +8,4 @@ void __cdecl FmvBackToGame(void); void __cdecl WinPlayFMV(const char *file_name, bool is_playback); void __cdecl WinStopFMV(bool is_playback); bool __cdecl S_PlayFMV(const char *file_name); +bool __cdecl S_IntroFMV(const char *file_name_1, const char *file_name_2); diff --git a/src/tr2/global/funcs.h b/src/tr2/global/funcs.h index cb7ba199b..00865a7a7 100644 --- a/src/tr2/global/funcs.h +++ b/src/tr2/global/funcs.h @@ -262,7 +262,6 @@ #define S_DrawScreenFBox ((void __cdecl (*)(int32_t sx, int32_t sy, int32_t z, int32_t width, int32_t height, BYTE color_idx, const GOURAUD_FILL *gour, uint16_t flags))0x0044C360) #define S_FinishInventory ((void __cdecl (*)(void))0x0044C390) #define S_FadeToBlack ((void __cdecl (*)(void))0x0044C3A0) -#define S_IntroFMV ((bool __cdecl (*)(const char *file_name1, const char *file_name2))0x0044C460) #define GetValidLevelsList ((void __cdecl (*)(REQUEST_INFO *req))0x0044C9D0) #define GetSavedGamesList ((void __cdecl (*)(REQUEST_INFO *req))0x0044CA20) #define DisplayCredits ((void __cdecl (*)(void))0x0044CA70) diff --git a/src/tr2/inject_exec.c b/src/tr2/inject_exec.c index d541ef52c..4058a2921 100644 --- a/src/tr2/inject_exec.c +++ b/src/tr2/inject_exec.c @@ -238,6 +238,7 @@ static void M_DecompFMV(const bool enable) INJECT(enable, 0x0044BE10, WinPlayFMV); INJECT(enable, 0x0044C0F0, WinStopFMV); INJECT(enable, 0x0044C450, S_PlayFMV); + INJECT(enable, 0x0044C460, S_IntroFMV); } static void M_DecompStats(const bool enable)