3
0
mirror of https://github.com/CrazyRedMachine/popnhax.git synced 2024-11-30 16:54:29 +01:00

result screen retire/retry sound ok

This commit is contained in:
CrazyRedMachine 2024-06-06 00:33:57 +02:00
parent 434918c330
commit e29320ebcb

View File

@ -1407,6 +1407,19 @@ void quickexit_result_loop()
} }
g_return_to_options = true; //transition screen hook will catch it g_return_to_options = true; //transition screen hook will catch it
/* play sound fx (retry song) */
__asm("push eax\n");
__asm("push ecx\n");
__asm("push edx\n");
__asm("mov eax, 0x1F\n"); //"exit menu" sound fx
__asm("push 0\n");
__asm("call %0\n"::"D"(playsramsound_func));
__asm("add esp, 4\n");
__asm("pop edx\n");
__asm("pop ecx\n");
__asm("pop eax\n");
__asm("jmp call_real_result\n"); __asm("jmp call_real_result\n");
__asm("quit_session:\n"); __asm("quit_session:\n");
@ -1418,6 +1431,7 @@ void quickexit_result_loop()
__asm("mov ebx, %0\n": :"b"(g_transition_addr)); __asm("mov ebx, %0\n": :"b"(g_transition_addr));
__asm("mov dword ptr[ebx], 0xFFFFFFFC\n"); //quit session __asm("mov dword ptr[ebx], 0xFFFFFFFC\n"); //quit session
/* play sound fx (end session) */
__asm("push eax\n"); __asm("push eax\n");
__asm("push ecx\n"); __asm("push ecx\n");
__asm("push edx\n"); __asm("push edx\n");
@ -3295,6 +3309,17 @@ static bool patch_quick_retire(bool pfree)
(void **)&real_game_loop); (void **)&real_game_loop);
} }
{
// PlaySramSound func
int64_t pattern_offset = search(data, dllSize,
"\x51\x56\x8B\xF0\x85\xF6\x74\x6C\x6B\xC0\x2C", 11, 0);
if (pattern_offset == -1) {
LOG("popnhax: PlaySramSound_addr was not found.\n");
return false;
}
playsramsound_func = (uint32_t)((int64_t)data + pattern_offset);
}
/* instant exit with numpad 9 on result screen */ /* instant exit with numpad 9 on result screen */
{ {
int64_t first_loc = search(data, dllSize, "\xBF\x03\x00\x00\x00\x81\xC6", 7, 0); int64_t first_loc = search(data, dllSize, "\xBF\x03\x00\x00\x00\x81\xC6", 7, 0);