Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BroGamer4256 committed Oct 21, 2022
1 parent 8c07fae commit 0bf2d74
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
20 changes: 9 additions & 11 deletions plugins/8.18/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ PreInit () {
toml_table_t *config = openConfig (configPath ("plugins/patches.toml"));
if (!config) return;
void *handle = GetModuleHandle (0);
WRITE_MEMORY (ASLR (0x1400239C0, handle), u8, 0xC3); // Stop error
if (readConfigBool (config, "unlock_songs", true)) WRITE_MEMORY (ASLR (0x140314E8D, handle), u8, 0xB0, 0x01); // Unlock songs
if (readConfigBool (config, "shared_audio", true)) WRITE_MEMORY (ASLR (0x140692E17, handle), u8, 0xEB); // Shared audio
WRITE_MEMORY (ASLR (0x1400239C0, handle), u8, 0xC3); // Stop error
if (readConfigBool (config, "unlock_songs", true)) WRITE_MEMORY (ASLR (0x140314E8D, handle), u8, 0xB0, 0x01); // Unlock songs
if (readConfigBool (config, "shared_audio", true)) WRITE_MEMORY (ASLR (0x140692E17, handle), u8, 0xEB); // Shared audio
if (!readConfigBool (config, "vsync", false)) WRITE_MEMORY (ASLR (0x140517339, handle), u8, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x90); // Disable VSync
// Remove song limit
WRITE_MEMORY (ASLR (0x140313726, handle), i32, 9000);
// Remove for with server
Expand All @@ -30,7 +31,6 @@ PreInit () {
WRITE_MEMORY (ASLR (0x140306893, handle), i32, 9000);
WRITE_MEMORY (ASLR (0x14030698B, handle), i32, 9000);
WRITE_MEMORY (ASLR (0x140313666, handle), i32, 9000);
WRITE_MEMORY (ASLR (0x140313726, handle), i32, 9000);
WRITE_MEMORY (ASLR (0x1403139F4, handle), i32, 9000);
WRITE_MEMORY (ASLR (0x140313B04, handle), i32, 9000);
WRITE_MEMORY (ASLR (0x140313C24, handle), i32, 9000);
Expand All @@ -56,12 +56,11 @@ PreInit () {
WRITE_MEMORY (ASLR (0x140314F46, handle), i32, 9000);
WRITE_MEMORY (ASLR (0x140314F97, handle), i32, 9000);

if (!readConfigBool (config, "vsync", false)) WRITE_MEMORY (ASLR (0x140517339, handle), u8, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x90); // Disable VSync
// Save settings cross session without F:/ and G:/ drive
WRITE_MEMORY (ASLR (0x140B5C528, handle), u8, "./Setting1.bin");
WRITE_MEMORY (ASLR (0x140B5C538, handle), u8, "./Setting2.bin");
WRITE_MEMORY (ASLR (0x140B5C528, handle), char, "./Setting1.bin");
WRITE_MEMORY (ASLR (0x140B5C538, handle), char, "./Setting2.bin");
// Move F:/ files to current directory
WRITE_MEMORY (ASLR (0x140B1B4B0, handle), u8, "./");
WRITE_MEMORY (ASLR (0x140B1B4B0, handle), char, "./");
WRITE_MEMORY (ASLR (0x14001C941, handle), u8, 0x02);
// Patch TLS v1.0 to v1.2
WRITE_MEMORY (ASLR (0x14044b1a9, handle), u8, 0x10);
Expand All @@ -71,10 +70,9 @@ PreInit () {
i32 windowResX = readConfigInt (windowResSection, "x", 0);
i32 windowResY = readConfigInt (windowResSection, "y", 0);
if (windowResX > 0 && windowResY > 0) {
WRITE_MEMORY (ASLR (0x14035FC5B, handle), u32, windowResX);
WRITE_MEMORY (ASLR (0x14035FC62, handle), u32, windowResY);
WRITE_MEMORY (ASLR (0x14035FC5B, handle), i32, windowResX);
WRITE_MEMORY (ASLR (0x14035FC62, handle), i32, windowResY);
}
toml_free (windowResSection);
}

toml_free (config);
Expand Down
4 changes: 1 addition & 3 deletions src/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,8 @@ printColour (int colour, const char *format, ...) {

if (consoleHandle == 0) consoleHandle = GetStdHandle (STD_OUTPUT_HANDLE);

char buffer[255];
vsprintf (buffer, format, args);
SetConsoleTextAttribute (consoleHandle, colour);
printf ("%s", buffer);
vprintf (format, args);
SetConsoleTextAttribute (consoleHandle, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);

va_end (args);
Expand Down
2 changes: 1 addition & 1 deletion src/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ InitializePoll (void *DivaWindowHandle) {
if (SDL_GameControllerAddMappingsFromFile (configPath ("gamecontrollerdb.txt")) == -1)
printError ("%s (): Cannot read gamecontrollerdb.txt\n", __func__);
SDL_GameControllerEventState (SDL_ENABLE);
SDL_JoystickEventState (SDL_ENABLE);

for (int i = 0; i < SDL_NumJoysticks (); i++) {
if (!SDL_IsGameController (i)) continue;
Expand All @@ -172,7 +173,6 @@ InitializePoll (void *DivaWindowHandle) {
}

controllers[i] = controller;
break;
}

window = SDL_CreateWindowFrom (DivaWindowHandle);
Expand Down

0 comments on commit 0bf2d74

Please sign in to comment.