From 13a7f496588697179cbbf67464a2746f18165a65 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 6 Feb 2024 08:39:29 +1100 Subject: [PATCH] Fix not building prx and fix errors logged about closing files (based on issues raised in #1145, thanks Zekiu) --- misc/psp/Makefile | 2 +- src/Platform_PSP.c | 2 +- src/Window_PSP.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/psp/Makefile b/misc/psp/Makefile index 0c7c58f0f..45dde8440 100644 --- a/misc/psp/Makefile +++ b/misc/psp/Makefile @@ -10,7 +10,7 @@ LIBDIR = LDFLAGS = LIBS = -lm -lpspgum -lpspgu -lpspge -lpspdisplay -lpspctrl -BUILD_PRX = 1 +BUILD_PRX = 1 EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = ClassiCube diff --git a/src/Platform_PSP.c b/src/Platform_PSP.c index 9623cfb89..bd6b7139d 100644 --- a/src/Platform_PSP.c +++ b/src/Platform_PSP.c @@ -173,7 +173,7 @@ cc_result File_Write(cc_file file, const void* data, cc_uint32 count, cc_uint32* } cc_result File_Close(cc_file file) { - int result = sceIoDclose(file); + int result = sceIoClose(file); return GetSCEResult(result); } diff --git a/src/Window_PSP.c b/src/Window_PSP.c index a454041c8..33408a08d 100644 --- a/src/Window_PSP.c +++ b/src/Window_PSP.c @@ -37,6 +37,8 @@ void Window_Init(void) { Input.Sources = INPUT_SOURCE_GAMEPAD; sceCtrlSetSamplingCycle(0); sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG); + + sceDisplaySetMode(0, SCREEN_WIDTH, SCREEN_HEIGHT); } void Window_Free(void) { } @@ -122,7 +124,6 @@ void Window_DrawFramebuffer(Rect2D r, struct Bitmap* bmp) { void* fb = sceGeEdramGetAddr(); sceDisplayWaitVblankStart(); - sceDisplaySetMode(0, SCREEN_WIDTH, SCREEN_HEIGHT); sceDisplaySetFrameBuf(fb, BUFFER_WIDTH, PSP_DISPLAY_PIXEL_FORMAT_8888, PSP_DISPLAY_SETBUF_IMMEDIATE); cc_uint32* src = (cc_uint32*)bmp->scan0 + r.x;