Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions source-code/source/plugins/TLAC/Components/Pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,20 +657,13 @@ namespace TLAC::Components

bool Pause::hookedGiveUpFunc(void* cls)
{
if (giveUp)
if (giveUp || divaGiveUpFunc(cls))
{
giveUp = false;
pause = false;
return true;
}
else
{
if (divaGiveUpFunc(cls))
{
pause = false;
return true;
}
}

return false;
}

Expand All @@ -690,19 +683,22 @@ namespace TLAC::Components

char Pause::hookedScriptCommandFunc(uint64_t p1, uint64_t p2, uint64_t p3, void* p4, void* p5, char p6, char p7)
{
int position = *(int*)(p1 + 180012);
int cmd = *(int*)(p1 + 4 * position + 12);
if (autoReplay)
{
int position = *(int*)(p1 + 180012);
int cmd = *(int*)(p1 + 4 * position + 12);

// printf("ARG: %lld, %lld, %lld, %p, %p, %d, %d - POS: %d, CMD: %d\n", p1, p2, p3, p4, p5, p6, p7, position, cmd);
// printf("ARG: %lld, %lld, %lld, %p, %p, %d, %d - POS: %d, CMD: %d\n", p1, p2, p3, p4, p5, p6, p7, position, cmd);

if (cmd == 83 && autoReplay)
{
printf("[TLAC] END_FADEOUT triggered but ignored\n");
if (cmd == 83)
{
printf("[TLAC] END_FADEOUT triggered but ignored\n");

// fix stucking at restart and the PV Script Command Error
*(int*)(p1 + 180012) = position + 3;
// fix stucking at restart and the PV Script Command Error
*(int*)(p1 + 180012) = position + 3;

return 1;
return 1;
}
}

return divaScriptCommandFunc(p1, p2, p3, p4, p5, p6, p7);
Expand Down
11 changes: 10 additions & 1 deletion source-code/source/plugins/TLAC/Components/Pause.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace TLAC::Components

static const int menuX = 640;
static const int menuY = 360;
static const int menuItemWidth = 150;
static const int menuItemWidth = 180;
static const int menuItemHeight = 36;
static const int menuItemPadding = 12;
static const int menuItemTotalHeight = menuItemHeight + menuItemPadding;
Expand Down Expand Up @@ -246,6 +246,15 @@ namespace TLAC::Components
*(uint8_t*)0x140D0A50C = 0; // not clear flag
*(char*)0x140D0AA0F = 0; // chance time

// reset give up/end flags
// because the code above doesn't reset them
// and causing you to complete with MISSxTAKE
// if you restarted after give up triggered
*(char*)0x140D0AA09 = 0;
*(char*)0x140D0AA0E = 0;
*(char*)0x140D0AA20 = 0;
*(char*)0x140D0AA35 = 0;

// revert patches and unpause
InjectCode((void*)0x1401038cd, { 0x12 }); InjectCode((void*)0x140103b94, { 0x16 });
unpause();
Expand Down