Compiled EXE doesn't work

General help for the PSY-Q SDK, such as setting the SDK up, compiling correctly, linking and debugging
Post Reply
User avatar
RootLM
What is PSXDEV?
What is PSXDEV?
Posts: 3
Joined: Feb 13, 2019

Compiled EXE doesn't work

Post by RootLM » February 13th, 2019, 2:11 pm

I'm trying to port a game I made in C/MinGW to the PS1. After making everything C89/fixing errors
it compiles, but after using cpe2x the resulting EXE just shows a black screen in no$PSX.

It doesn't even get to the very first line of main (a printf) and somehow just ends up executing some area filled with nops. The hello world example on the site works fine so I have no idea what is causing it.

I'm using this makefile with all the directories with c files added. I've also tried putting every function into main.c but it has the same result.
Any idea why this would happen/how to fix it?

User avatar
RootLM
What is PSXDEV?
What is PSXDEV?
Posts: 3
Joined: Feb 13, 2019

Post by RootLM » February 15th, 2019, 8:57 am

On further investigation, uh.. what the hell is up with this compiler?

It seems like using multiple files AT ALL (except for EXTREMELY small instances?) causes it to make a broken exe.
Like, splitting the graphics setup/buffer swapping code from the example into its own .c/.h causes it to make another black screen exe,
except sometimes messing around with no$psx's animate/jump one frame options will cause it to get to the first printfs and draw the grey background, but no text.

Is there a newer/better compiler that works with Psy-Q's libraries?
Or a way of getting ccpsx to actually work with multiple files? Like surely I have to be doing something wrong here right??

User avatar
TriMesh
Verified
PSX Aptitude
PSX Aptitude
Posts: 225
Joined: Dec 20, 2013
PlayStation Model: DTL-H1202
Location: Hong Kong

Post by TriMesh » February 15th, 2019, 12:48 pm

It shouldn't be a problem - I've written lots of stuff with the source split over multiple files.

You could try compiling it manually to see if it's a problem with the build system - just use a command like

ccpsx -g -Xo$80010000 file1.c file2.c filex.c -otarget.cpe
cpe2x target.cpe

Someone was working on getting the libraries linkable with a newer compiler, but that seems to have gone quiet. Unfortunately, the psyq libs are using a SN systems in-house format and aren't recognized by other toolchains.

It would be nice to sort it out - using 20 year old tools is generally pretty annoying.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests