Skip to content

Commit

Permalink
festo(fix): bring jubeat module into common patch
Browse files Browse the repository at this point in the history
  • Loading branch information
CannuJ authored and mbilker committed Aug 26, 2022
1 parent 43fd39f commit b960f57
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
20 changes: 13 additions & 7 deletions festo/common/festo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,21 @@ static void *__cdecl mem_set(void *s, int c, size_t n)
}

void festo_apply_common_patches(
HANDLE process, HMODULE jubeat_handle, const MODULEINFO &music_db_info)
HANDLE process,
HMODULE jubeat_handle,
const MODULEINFO &jubeat_info,
const MODULEINFO &music_db_info)
{
// jubeat.dll
do_patch(process, jubeat_info, marker_unlock_patch_1);
do_patch(process, jubeat_info, marker_unlock_patch_2);
do_patch(process, jubeat_info, marker_unlock_patch_3);
do_patch(process, jubeat_info, background_unlock_patch_1);
do_patch(process, jubeat_info, background_unlock_patch_2);
do_patch(process, jubeat_info, background_unlock_patch_3);

// music_db.dll
do_patch(process, music_db_info, song_unlock_patch);
do_patch(process, jubeat_handle, marker_unlock_patch_1);
do_patch(process, jubeat_handle, marker_unlock_patch_2);
do_patch(process, jubeat_handle, marker_unlock_patch_3);
do_patch(process, jubeat_handle, background_unlock_patch_1);
do_patch(process, jubeat_handle, background_unlock_patch_2);
do_patch(process, jubeat_handle, background_unlock_patch_3);

// increase d3 texture memory so all our added banners don't crash the game
hook_iat_ordinal(
Expand Down
5 changes: 4 additions & 1 deletion festo/common/festo.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
#include "util/patch.h"

void festo_apply_common_patches(
HANDLE process, HMODULE jubeat_module, const MODULEINFO &music_db_info);
HANDLE process,
HMODULE jubeat_handle,
const MODULEINFO &jubeat_info,
const MODULEINFO &music_db_info);
2 changes: 1 addition & 1 deletion festo/omnimix/omnimix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ extern "C" DLL_EXPORT bool __cdecl omnimix_dll_entry_init(char *sid_code, void *
log_fatal("GetModuleInformation(\"music_db.dll\") failed: %08lx", GetLastError());
}

festo_apply_common_patches(process, jubeat_handle, music_db_info);
festo_apply_common_patches(process, jubeat_handle, jubeat_info, music_db_info);

do_patch(process, jubeat_info, packlist);
do_patch(process, music_db_info, music_db_limit_1);
Expand Down
2 changes: 1 addition & 1 deletion festo/ultimate/ultimate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ extern "C" DLL_EXPORT bool __cdecl ultimate_dll_entry_init(char *sid_code, void
hook_music_db(process, jubeat_handle, music_db_handle);
hook_pkfs_fs_open(process, pkfs_handle);
bnr_hook_init(jubeat_info, BNR_TEXTURES);
festo_apply_common_patches(process, jubeat_handle, music_db_info);
festo_apply_common_patches(process, jubeat_handle, jubeat_info, music_db_info);

CloseHandle(process);

Expand Down

0 comments on commit b960f57

Please sign in to comment.