Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Commit

Permalink
Fixed MSAA in System Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicMastr committed Dec 8, 2020
1 parent 9bc8f11 commit 1e188d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/sysmodepatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 1e188d0

Please sign in to comment.