Change some sceDisplay functions to use more appropriate return types

This commit is contained in:
Henrik Rydgård 2025-01-29 10:48:00 +01:00
parent b4f0e3dd5c
commit cdad46e18c

View file

@ -844,7 +844,7 @@ void __DisplaySetFramebuf(u32 topaddr, int linesize, int pixelFormat, int sync)
}
// Some games (GTA) never call this during gameplay, so bad place to put a framerate counter.
u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync) {
int sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync) {
if (sync != PSP_DISPLAY_SETBUF_IMMEDIATE && sync != PSP_DISPLAY_SETBUF_NEXTFRAME) {
return hleLogError(Log::sceDisplay, SCE_KERNEL_ERROR_INVALID_MODE, "invalid sync mode");
}
@ -949,12 +949,12 @@ static void __DisplayWaitForVblanksCB(const char *reason, int vblanks) {
__DisplayWaitForVblanks(reason, vblanks, true);
}
static u32 sceDisplayWaitVblankStart() {
static int sceDisplayWaitVblankStart() {
__DisplayWaitForVblanks("vblank start waited", 1);
return hleLogDebug(Log::sceDisplay, 0);
}
static u32 sceDisplayWaitVblank() {
static int sceDisplayWaitVblank() {
if (!DisplayIsVblank()) {
__DisplayWaitForVblanks("vblank waited", 1);
return hleLogDebug(Log::sceDisplay, 0);
@ -965,7 +965,7 @@ static u32 sceDisplayWaitVblank() {
}
}
static u32 sceDisplayWaitVblankStartMulti(int vblanks) {
static int sceDisplayWaitVblankStartMulti(int vblanks) {
if (vblanks <= 0) {
return hleLogWarning(Log::sceDisplay, SCE_KERNEL_ERROR_INVALID_VALUE, "invalid number of vblanks");
}
@ -978,7 +978,7 @@ static u32 sceDisplayWaitVblankStartMulti(int vblanks) {
return hleLogDebug(Log::sceDisplay, 0);
}
static u32 sceDisplayWaitVblankCB() {
static int sceDisplayWaitVblankCB() {
if (!DisplayIsVblank()) {
__DisplayWaitForVblanksCB("vblank waited", 1);
return hleLogDebug(Log::sceDisplay, 0);
@ -989,12 +989,12 @@ static u32 sceDisplayWaitVblankCB() {
}
}
static u32 sceDisplayWaitVblankStartCB() {
static int sceDisplayWaitVblankStartCB() {
__DisplayWaitForVblanksCB("vblank start waited", 1);
return hleLogDebug(Log::sceDisplay, 0);
}
static u32 sceDisplayWaitVblankStartMultiCB(int vblanks) {
static int sceDisplayWaitVblankStartMultiCB(int vblanks) {
if (vblanks <= 0) {
return hleLogWarning(Log::sceDisplay, SCE_KERNEL_ERROR_INVALID_VALUE, "invalid number of vblanks");
}
@ -1007,13 +1007,13 @@ static u32 sceDisplayWaitVblankStartMultiCB(int vblanks) {
return hleLogDebug(Log::sceDisplay, 0);
}
static u32 sceDisplayGetVcount() {
static int sceDisplayGetVcount() {
hleEatCycles(150);
hleReSchedule("get vcount");
return hleLogVerbose(Log::sceDisplay, __DisplayGetVCount());
}
static u32 sceDisplayGetCurrentHcount() {
static int sceDisplayGetCurrentHcount() {
hleEatCycles(275);
return hleLogDebug(Log::sceDisplay, __DisplayGetCurrentHcount());
}
@ -1104,19 +1104,19 @@ static u32 sceDisplaySetHoldMode(u32 hMode) {
const HLEFunction sceDisplay[] = {
{0X0E20F177, &WrapU_III<sceDisplaySetMode>, "sceDisplaySetMode", 'x', "iii" },
{0X289D82FE, &WrapU_UIII<sceDisplaySetFramebuf>, "sceDisplaySetFrameBuf", 'x', "xiii"},
{0X289D82FE, &WrapI_UIII<sceDisplaySetFramebuf>, "sceDisplaySetFrameBuf", 'i', "xiii"},
{0XEEDA2E54, &WrapU_UUUI<sceDisplayGetFramebuf>, "sceDisplayGetFrameBuf", 'x', "pppi"},
{0X36CDFADE, &WrapU_V<sceDisplayWaitVblank>, "sceDisplayWaitVblank", 'x', "", HLE_NOT_DISPATCH_SUSPENDED },
{0X984C27E7, &WrapU_V<sceDisplayWaitVblankStart>, "sceDisplayWaitVblankStart", 'x', "", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED },
{0X40F1469C, &WrapU_I<sceDisplayWaitVblankStartMulti>, "sceDisplayWaitVblankStartMulti", 'x', "i" },
{0X8EB9EC49, &WrapU_V<sceDisplayWaitVblankCB>, "sceDisplayWaitVblankCB", 'x', "", HLE_NOT_DISPATCH_SUSPENDED },
{0X46F186C3, &WrapU_V<sceDisplayWaitVblankStartCB>, "sceDisplayWaitVblankStartCB", 'x', "", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED },
{0X77ED8B3A, &WrapU_I<sceDisplayWaitVblankStartMultiCB>, "sceDisplayWaitVblankStartMultiCB", 'x', "i" },
{0X36CDFADE, &WrapI_V<sceDisplayWaitVblank>, "sceDisplayWaitVblank", 'i', "", HLE_NOT_DISPATCH_SUSPENDED },
{0X984C27E7, &WrapI_V<sceDisplayWaitVblankStart>, "sceDisplayWaitVblankStart", 'i', "", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED },
{0X40F1469C, &WrapI_I<sceDisplayWaitVblankStartMulti>, "sceDisplayWaitVblankStartMulti", 'i', "i" },
{0X8EB9EC49, &WrapI_V<sceDisplayWaitVblankCB>, "sceDisplayWaitVblankCB", 'i', "", HLE_NOT_DISPATCH_SUSPENDED },
{0X46F186C3, &WrapI_V<sceDisplayWaitVblankStartCB>, "sceDisplayWaitVblankStartCB", 'i', "", HLE_NOT_IN_INTERRUPT | HLE_NOT_DISPATCH_SUSPENDED },
{0X77ED8B3A, &WrapI_I<sceDisplayWaitVblankStartMultiCB>, "sceDisplayWaitVblankStartMultiCB", 'i', "i" },
{0XDBA6C4C4, &WrapF_V<sceDisplayGetFramePerSec>, "sceDisplayGetFramePerSec", 'f', "" },
{0X773DD3A3, &WrapU_V<sceDisplayGetCurrentHcount>, "sceDisplayGetCurrentHcount", 'x', "" },
{0X773DD3A3, &WrapI_V<sceDisplayGetCurrentHcount>, "sceDisplayGetCurrentHcount", 'i', "" },
{0X210EAB3A, &WrapI_V<sceDisplayGetAccumulatedHcount>, "sceDisplayGetAccumulatedHcount", 'i', "" },
{0XA83EF139, &WrapI_I<sceDisplayAdjustAccumulatedHcount>, "sceDisplayAdjustAccumulatedHcount", 'i', "i" },
{0X9C6EAAD7, &WrapU_V<sceDisplayGetVcount>, "sceDisplayGetVcount", 'x', "" },
{0X9C6EAAD7, &WrapI_V<sceDisplayGetVcount>, "sceDisplayGetVcount", 'i', "" },
{0XDEA197D4, &WrapU_UUU<sceDisplayGetMode>, "sceDisplayGetMode", 'x', "ppp" },
{0X7ED59BC4, &WrapU_U<sceDisplaySetHoldMode>, "sceDisplaySetHoldMode", 'x', "x" },
{0XA544C486, &WrapU_U<sceDisplaySetResumeMode>, "sceDisplaySetResumeMode", 'x', "x" },