diff --git a/include/hooks.h b/include/hooks.h index 2da66ed..de5059f 100644 --- a/include/hooks.h +++ b/include/hooks.h @@ -32,6 +32,7 @@ extern SceUID hook[NUM_HOOKS]; extern int customResolutionMode; extern tai_module_info_t modInfo; extern int systemMode; +extern int msaaEnabled; extern int isCreatingSurface; void loadHooks(PibOptions options); diff --git a/src/hooks.c b/src/hooks.c index f0994b1..5ab32e0 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -33,7 +33,7 @@ tai_hook_ref_t hookRef[NUM_HOOKS]; SceUID hook[NUM_HOOKS]; int customResolutionMode; tai_module_info_t modInfo; -int systemMode = 0; +int systemMode, msaaEnabled = 0; void loadHooks(PibOptions options) { @@ -75,6 +75,7 @@ void loadHooks(PibOptions options) hook[15] = taiHookFunctionImport(&hookRef[15], modInfo.name, 0xF76B66BD, 0x889AE88C, sceGxmSyncObjectDestroy_patch); } if (options & PIB_ENABLE_MSAA) { + msaaEnabled = 1; hook[16] = taiHookFunctionImport(&hookRef[16], modInfo.name, 0xF76B66BD, 0xED0F6E25, sceGxmColorSurfaceInit_msaaPatch); hook[17] = taiHookFunctionImport(&hookRef[17], modInfo.name, 0xF76B66BD, 0x207AF96B, sceGxmCreateRenderTarget_msaaPatch); hook[18] = taiHookFunctionImport(&hookRef[18], modInfo.name, 0xF76B66BD, 0xCA9D41D1, sceGxmDepthStencilSurfaceInit_msaaPatch); diff --git a/src/sysmodepatch.c b/src/sysmodepatch.c index 8148901..6d0650b 100644 --- a/src/sysmodepatch.c +++ b/src/sysmodepatch.c @@ -97,7 +97,7 @@ unsigned int pglMemoryAllocAlign_patch(int memoryType, int size, int unused, int memory[0] = displayBufferData[bufferDataIndex]; return 0; } - if (!systemMode && memoryType == 5 && isCreatingSurface) + if (msaaEnabled && memoryType == 5 && isCreatingSurface) { size *= 4; // For MSAA }