Advertising (This ad goes away for registered users. You can Login or Register)

I need to fix this SDL app for PSP so that it doesn't draw a cursor for 2 seconds before loading the image

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Post Reply
grief3r
Posts: 358
Joined: Sat Nov 09, 2013 4:12 am

I need to fix this SDL app for PSP so that it doesn't draw a cursor for 2 seconds before loading the image

Post by grief3r » Sun Jan 26, 2020 4:30 am

somebody please tell me how to get rid of this **** black screen with the cursor on top. There must be some way to circumvent this.
The app should compile with the given makefile

Code: Select all

 
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <psprtc.h>
#include <math.h>
#include <stdio.h>
#include <SDL/SDL.h>


int done = 1;
int thid;
PSP_MODULE_INFO("test", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int exit_cb(int arg1, int arg2, void *common) {
//done is probably useless, altough it seems ideal to set it regardless
done = 0;
//let's call sceKernelExitGame on main since we are using the done var
//sceKernelExitGame();
sceKernelExitGame();
return 0;
}
int callbackThread(SceSize args, void *argp) {
	sceKernelRegisterExitCallback( sceKernelCreateCallback("exit_cb", exit_cb, NULL) );
    sceKernelSleepThreadCB();
    //the PSP can cause painful crashes , let's use it here and also after the loop
    //sceKernelExitGame();
    sceKernelExitDeleteThread(0);
    return 0;
}

int main(int argc, char* argv[]) {
//pspDebugScreenInit();
int threadID = sceKernelCreateThread("Callback Update Thread", \
		callbackThread,\
		0x11, \
		0xFA0, \
		THREAD_ATTR_USER, \
		0);
if (threadID >= 0 ) {
sceKernelStartThread(threadID,0,0);
}
thid = threadID;
SDL_Surface* imgSurface = NULL;
SDL_Surface* screen = NULL;
SDL_Init( SDL_INIT_EVERYTHING );
screen = SDL_SetVideoMode(420, 270, 32, SDL_SWSURFACE);
imgSurface = SDL_LoadBMP("test.bmp");
SDL_BlitSurface(imgSurface, NULL, screen, NULL);
SDL_Flip(screen);
SDL_Delay(6000);
SDL_FreeSurface(imgSurface);
SDL_FreeSurface(screen);
exit_cb(0,0,NULL);
return 0;
}

Here is the makefile

Code: Select all

TARGET = alsample
OBJS = main.o

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -ggdb
ASFLAGS = $(CFLAGS)

LIBDIR = 
##LDFLAGS = -mno-crt0
LDFLAGS = 
LIBS = -lSDL -lpspirkeyb -lpsppower -lpsphprm -lpsprtc -lpsppower -lm -lpspaudio -lpspgu -lpspgu

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Audiolib Wave Generator

PSP_FW_VERSION = 150
##PSP_LARGE_MEMORY = 1
##USE_KERNEL_LIBC = 1 

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Advertising
PSV1001 2.61 FieldRunners
PSP1001 6.60 Pro-C
PSP 3001 6.20 Pro-C2

Post Reply

Return to “Programming and Security”