Skip to content

Commit

Permalink
psx graphics doesn't break config anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
krystalgamer committed Nov 5, 2023
1 parent c6d0a60 commit 184e967
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion texture_loader/loader.c
Expand Up @@ -4,7 +4,7 @@
#include <stdbool.h>
#include "cJSON.h"

#define CTL_VERSION "0.5"
#define CTL_VERSION "0.5.1"

BOOL ApplyHooks();
BOOL CheckBinkwVersion();
Expand Down
4 changes: 2 additions & 2 deletions texture_loader/memory.c
Expand Up @@ -12,7 +12,7 @@ BOOL NopMemory(DWORD address, DWORD size, const char *reason){

//Make it writable so we can edit it
if(!VirtualProtect(cAddress, size, PAGE_EXECUTE_READWRITE, &oldProtect)){
printf("There was a problem removing the protection from the address %08X", address);
printf("There was a problem removing the protection from the address %p", address);
MessageBoxA(NULL, "Error", "Coudln't remove the protection from a memory location. Please check the console for more info.", 0);
return FALSE;
}
Expand All @@ -28,7 +28,7 @@ BOOL NopMemory(DWORD address, DWORD size, const char *reason){
}

if(reason)
printf("Successfully patched address:%08X Reason: %s\n", cAddress ,reason);
printf("Successfully patched address:%p Reason: %s\n", cAddress ,reason);

return TRUE;
}
Expand Down
9 changes: 9 additions & 0 deletions texture_loader/patches.c
Expand Up @@ -243,12 +243,21 @@ BOOL ModOptions(){
LOW RES (aka PSX MODE)
************************************************/

static int dummyRead = 0;
BOOL LowRes() {

DWORD* low_graphics = (DWORD*)0x006B78F8;
*low_graphics = 1;

DWORD dummyAddress = (DWORD)&dummyRead;
SetMemory(0x005156EC, 4, &dummyAddress, "Override address of read low_graphics");

/*
* Removed this because it breaks config
DWORD freadSkip = 0x005156F0;
Nop(freadSkip, 5, "Remove fread from Spidey.cfg of low_graphics");
*/

DWORD freadFirst = 0x005156FF;
Nop(freadFirst, 6, "Remove low_graphics override after reading config");
Expand Down

0 comments on commit 184e967

Please sign in to comment.