I'm making a PSP port of an SDL game Meritous, it's written in C. I compiled it as C++ code, but PSP always crashes with black screen. Meritous uses SDL, SDL_image and SDL_mixer. I have an Ubuntu version of minpspw - a pre-compiled, native PSP Toolchain, but I wrote programs that have proven all libraries are working fine.
I managed to find the crashing line of code by putting fopen("breakpoint.txt", "w"); into different places of code until I found the place where it does not occur.
Here's the source:
Code: Select all
extern "C"
int main(int, char*[])
{
int on_title = 1;
int executable_running = 1;
SDL_Surface *title, *title_pr, *asceai;
Uint8 *src_p, *col_p;
int i;
int light = 0;
int x, y;
int pulse[SCREEN_W * SCREEN_H];
int precalc_sine[400];
int tick = 10000000;
int option = 0;
int can_continue = 0;
int maxoptions;
int last_key = 0;
int ticker_tick = 0;
srand(time(NULL));
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO); // THIS LINE CRASHES MY APP!!!!!
// BREAKPOINT
fopen("breakpoint.txt", "w");
screen = SDL_SetVideoMode(SCREEN_W, SCREEN_H, BPP, SDL_SWSURFACE);
asceai = IMG_Load("dat/i/asceai.png");