diff --git a/vita3k/modules/SceDisplay/SceDisplay.cpp b/vita3k/modules/SceDisplay/SceDisplay.cpp index 67c36df18f..8e5ec07cd5 100644 --- a/vita3k/modules/SceDisplay/SceDisplay.cpp +++ b/vita3k/modules/SceDisplay/SceDisplay.cpp @@ -25,6 +25,8 @@ #include #include +#include "io/state.h" + #include TRACY_MODULE_NAME(SceDisplay); @@ -83,9 +85,32 @@ EXPORT(int, _sceDisplayGetFrameBufInternal) { return UNIMPLEMENTED(); } -EXPORT(int, _sceDisplayGetMaximumFrameBufResolution) { - TRACY_FUNC(_sceDisplayGetMaximumFrameBufResolution); - return UNIMPLEMENTED(); +EXPORT(int, _sceDisplayGetMaximumFrameBufResolution, int *width, int *height) { + TRACY_FUNC(_sceDisplayGetMaximumFrameBufResolution, width, height); + if (!width || !height) + return 0; + if (emuenv.cfg.pstv_mode) { + *width = 1920; + *height = 1088; + } else { + auto &title_id = emuenv.io.title_id; + bool cond = title_id == "PCSG80001" + || title_id == "PCSG80007" + || title_id == "PCSG00318" + || title_id == "PCSG00319" + || title_id == "PCSG00320" + || title_id == "PCSG00321" + || title_id == "PCSH00059"; + if (cond) { + *width = 960; + *height = 544; + + } else { + *width = 1280; + *height = 725; + } + } + return 0; } EXPORT(int, _sceDisplayGetResolutionInfoInternal) { diff --git a/vita3k/modules/SceDisplay/SceDisplay.h b/vita3k/modules/SceDisplay/SceDisplay.h index 911332969a..6df11956ae 100644 --- a/vita3k/modules/SceDisplay/SceDisplay.h +++ b/vita3k/modules/SceDisplay/SceDisplay.h @@ -68,3 +68,4 @@ struct SceDisplayFrameBuf2 : public SceDisplayFrameBuf { DECL_EXPORT(SceInt32, _sceDisplayGetFrameBuf, SceDisplayFrameBuf *pFrameBuf, SceDisplaySetBufSync sync, uint32_t *pFrameBuf_size); DECL_EXPORT(SceInt32, _sceDisplaySetFrameBuf, const SceDisplayFrameBuf *pFrameBuf, SceDisplaySetBufSync sync, uint32_t *pFrameBuf_size); +DECL_EXPORT(int, _sceDisplayGetMaximumFrameBufResolution, int *width, int *height); \ No newline at end of file diff --git a/vita3k/modules/SceDriverUser/SceDisplayUser.cpp b/vita3k/modules/SceDriverUser/SceDisplayUser.cpp index 4deded9319..5b9377d9ba 100644 --- a/vita3k/modules/SceDriverUser/SceDisplayUser.cpp +++ b/vita3k/modules/SceDriverUser/SceDisplayUser.cpp @@ -38,9 +38,9 @@ EXPORT(int, sceDisplayGetFrameBufInternal) { return UNIMPLEMENTED(); } -EXPORT(int, sceDisplayGetMaximumFrameBufResolution) { - TRACY_FUNC(sceDisplayGetMaximumFrameBufResolution); - return UNIMPLEMENTED(); +EXPORT(int, sceDisplayGetMaximumFrameBufResolution, int *width, int *height) { + TRACY_FUNC(sceDisplayGetMaximumFrameBufResolution, width, height); + return CALL_EXPORT(_sceDisplayGetMaximumFrameBufResolution, width, height); } EXPORT(int, sceDisplayGetResolutionInfoInternal) { @@ -61,7 +61,13 @@ EXPORT(int, sceDisplaySetFrameBufForCompat) { return UNIMPLEMENTED(); } -EXPORT(int, sceDisplaySetFrameBufInternal) { - TRACY_FUNC(sceDisplaySetFrameBufInternal); - return UNIMPLEMENTED(); +EXPORT(int, sceDisplaySetFrameBufInternal, uint32_t maybe_buffer_idx, uint32_t unkn, SceDisplayFrameBuf *pFrameBuf, SceDisplaySetBufSync sync) { + TRACY_FUNC(sceDisplaySetFrameBufInternal, maybe_buffer_idx, unkn, pFrameBuf, sync); + // only render for frame buffer 0 or we'll get double fps + if (maybe_buffer_idx != 0) + return 0; + // size does not match (is 4 bytes larger) + if (pFrameBuf) + pFrameBuf->size = 0x18; + return CALL_EXPORT(_sceDisplaySetFrameBuf, pFrameBuf, sync, nullptr); } diff --git a/vita3k/modules/SceGxm/SceGxm.h b/vita3k/modules/SceGxm/SceGxm.h index 1a14c224dd..7312edf641 100644 --- a/vita3k/modules/SceGxm/SceGxm.h +++ b/vita3k/modules/SceGxm/SceGxm.h @@ -20,4 +20,9 @@ #include struct SceGxmInitializeParams; +struct SceGxmRenderTargetParams; +struct SceGxmRenderTarget; + DECL_EXPORT(int, sceGxmInitialize, const SceGxmInitializeParams *params); +DECL_EXPORT(int, sceGxmCreateRenderTarget, const SceGxmRenderTargetParams *params, Ptr *renderTarget); +DECL_EXPORT(int, sceGxmGetRenderTargetMemSize, const SceGxmRenderTargetParams *params, uint32_t *hostMemSize); diff --git a/vita3k/modules/SceGxm/SceGxmInternal.cpp b/vita3k/modules/SceGxm/SceGxmInternal.cpp index 0df1403f96..ce97297904 100644 --- a/vita3k/modules/SceGxm/SceGxmInternal.cpp +++ b/vita3k/modules/SceGxm/SceGxmInternal.cpp @@ -17,20 +17,22 @@ #include +#include "SceGxm.h" + EXPORT(int, sceGxmCheckMemoryInternal) { return UNIMPLEMENTED(); } -EXPORT(int, sceGxmCreateRenderTargetInternal) { - return UNIMPLEMENTED(); +EXPORT(int, sceGxmCreateRenderTargetInternal, const SceGxmRenderTargetParams *params, Ptr *renderTarget) { + return CALL_EXPORT(sceGxmCreateRenderTarget, params, renderTarget); } EXPORT(int, sceGxmGetDisplayQueueThreadIdInternal) { return UNIMPLEMENTED(); } -EXPORT(int, sceGxmGetRenderTargetMemSizeInternal) { - return UNIMPLEMENTED(); +EXPORT(int, sceGxmGetRenderTargetMemSizeInternal, const SceGxmRenderTargetParams *params, uint32_t *hostMemSize) { + return CALL_EXPORT(sceGxmGetRenderTargetMemSize, params, hostMemSize); } EXPORT(int, sceGxmGetTopContextInternal) {