3
0
mirror of https://github.com/CrazyRedMachine/popnhax.git synced 2024-11-27 23:40:50 +01:00

hard gauge auto adjust on result screen

This commit is contained in:
CrazyRedMachine 2023-09-28 23:40:20 +02:00
parent 9d3ba97354
commit 17ec9749e1

View File

@ -4694,6 +4694,29 @@ void hook_survival_gauge_medal()
{
__asm("cmp eax, 0\n"); //empty gauge should still fail
__asm("jz skip_force_clear\n");
/* fix gauge ( [0;1023] -> [725;1023] ) */
__asm("push eax");
__asm("push ebx");
__asm("push edx");
__asm("xor edx,edx");
__asm("mov eax, dword ptr [edi+4]");
__asm("cmp eax, 0x2B");
__asm("jl skip_sub");
__asm("sub eax, 0x2B");
__asm("skip_sub:");
__asm("mov bx, 3");
__asm("idiv bx");
__asm("add eax, 0x2D5"); //725
__asm("cmp eax, 0x3FF");
__asm("jle skip_trim");
__asm("mov eax, 0x3FF");
__asm("skip_trim:");
__asm("mov dword ptr [edi+4], eax");
__asm("pop edx");
__asm("pop ebx");
__asm("pop eax");
__asm("jmp %0\n"::"m"(real_survival_gauge_medal_clear));
}
__asm("skip_force_clear:\n");