Configuring and Compiling PSY-Q 4.6 to run Homebrew

General help for the PSY-Q SDK, such as setting the SDK up, compiling correctly, linking and debugging
Post Reply
User avatar
bizarro2011
Serious PSXDEV User
Serious PSXDEV User
Posts: 118
Joined: Mar 27, 2012
Location: Brazil

Configuring and Compiling PSY-Q 4.6 to run Homebrew

Post by bizarro2011 » May 10th, 2012, 11:33 pm

How to create and compile to run homebrew with a PSX emulator.

My names is Bernard. I'm from Brazil.


Lets get started :)

1] Download the PSY-Q SDK 4.6 | Download |

2] Put it in C:\ PSX folder like this (or, just use psyq as the default if you do not want to rename):
Image

3] Edit the PSPATHS batch file (.BAT) like this (skip this is you left it as the default name, psyq):
Image

4] This is what it should look like:
Image

5] Now, run the batch file (PSPATHS.BAT).
Image

The environment is ready. Now we can compile a sample program.
We will compile 'Hello World'.

Download hello.c : http://www.filefactory.com/file/yj2uq8k6cf9/n/hello.rar
The hello.c program was created and placed in the folder called hello along with hello.c and makefile.mak

To compile hello.c, run psymake while under the folder hello (working directory)
Image

The main.exe file will be created.
You can run that in a PS1 emulator to test it (seen below)

Image

Success!
Image

Comment of the next tutorial will be entering the compilation tim tmd program.

User avatar
CosmoGuy
Serious PSXDEV User
Serious PSXDEV User
Posts: 91
Joined: May 30, 2012
I am a: Hell knows who I am
PlayStation Model: SCPH-7502
Location: Polska, Wroclaw
Contact:

Post by CosmoGuy » June 9th, 2012, 11:57 pm

I'm on 64 bit Windows 7 Ultimate.

What can I do?
I will have an old PIII PC soon but i have to wait for it.
I want to compile it for now. Do I have to do that on Virtual Box if i haven't any other way?
PSYQ compiler are tiny apps in COM extension. If i remeber good they are 16 bit programs for DOS.
Image

User avatar
Gemini
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 44
Joined: Feb 14, 2012

Post by Gemini » June 10th, 2012, 8:23 am

That's a rather simple operation which I'm kinda surprised nobody mentioned ever before. First step: don't use psymake, but make win32 instead. Second step: replace cpe2x/cpe2exe with my cpe2psx. I'd also suggest to use psylib2 and slink instead of psylib and psylink. The rest of the toolchain works just fine on win64 systems, so you're not gonna need anything else and you can even use it to compile stuff under any IDE such as Visual Studio 2010.

User avatar
CosmoGuy
Serious PSXDEV User
Serious PSXDEV User
Posts: 91
Joined: May 30, 2012
I am a: Hell knows who I am
PlayStation Model: SCPH-7502
Location: Polska, Wroclaw
Contact:

Post by CosmoGuy » June 11th, 2012, 1:33 am

replace? where is cpe2x? in BIN folder i have only what psy4.6 gave so its:
ASMPSX
ASPSX
CC1PLPSX
CC1PSX
CCPSX
freshly pasted cpe2psx and changed name to cpe2x
CPPPSX
PSYLIBD
PSYLINK
PSYMAKE.COM
PSYQ.INI

dont know what to do :shrug
all of it smells very noobish :(
Image

User avatar
Gemini
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 44
Joined: Feb 14, 2012

Post by Gemini » June 11th, 2012, 2:29 am

CPE2X (or it's counterpart made by Nagra, CPE2EXE) is a separate program, so no wonder it's not included in the binary package. Even if you don't have it, it doesn't matter. What the Psy-Q linker produces is a CPE file and you're gonna need a converter so that the console understands the executable out of the box. The rest of the tutorial applies exactly the same way, so identical makefile and toolchain.

User avatar
CosmoGuy
Serious PSXDEV User
Serious PSXDEV User
Posts: 91
Joined: May 30, 2012
I am a: Hell knows who I am
PlayStation Model: SCPH-7502
Location: Polska, Wroclaw
Contact:

Post by CosmoGuy » June 11th, 2012, 2:38 am

But it really cant work. Specially that typing "make" in c:\psx\hello doesnt do anything ("No targets specified "or" Nothing to be done for main.c") and PSYMAKE cant run on 64 bit OS...

just nothing...
Image

User avatar
Gemini
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 44
Joined: Feb 14, 2012

Post by Gemini » June 11th, 2012, 2:58 am

That's because you need to type in the console "make -f makefile.mak" and change the makefile to this:

Code: Select all

all:
	ccpsx -O3 -Xo$$80010000 main.c c:\psxdev\lib\none2.obj -omain.cpe
	cpe2psx main.cpe
Make sure to change the "c:\psxdev\lib\none2.obj" part to whatever path your psy-q libraries are installed to.

User avatar
CosmoGuy
Serious PSXDEV User
Serious PSXDEV User
Posts: 91
Joined: May 30, 2012
I am a: Hell knows who I am
PlayStation Model: SCPH-7502
Location: Polska, Wroclaw
Contact:

Post by CosmoGuy » June 11th, 2012, 5:26 am

Gemini wrote:That's because you need to type in the console "make -f makefile.mak" and change the makefile to this:

Code: Select all

all:
	ccpsx -O3 -Xo$$80010000 main.c c:\psxdev\lib\none2.obj -omain.cpe
	cpe2psx main.cpe
Make sure to change the "c:\psxdev\lib\none2.obj" part to whatever path your psy-q libraries are installed to.
I havent a file like that:
"c:\psxdev\lib\none2.obj"

Everything is like in the tutorial
I created psx folder on C: and put there psy-q4.6 so in lib i havent non2.obj (???)

And secondly editing makefile did only difference:
Cant find how to execute " cpe2psx main.cpe" (psymake)

I did something wrong, but i dont know what...


EDIT:

I repaired last error (had to replace psyq ini into BIN folder) but now i have another thing to do... everything i'm making in DOSBox because it's doing *something* not like make-win32 or anything, so:

Image

I think its bad edited makefile...

Here is my makefile :
all:
ccpsx -O3 -Xo$$80010000 main.c c:\psxdev\lib\none2.obj -omain.cpe
cpe2psx main.cpe
for_menu:
ccpsx -O3 -Xo$80010000 main.c \ps\lib\none2.obj -omain.cpe

exe:
cpe2x main.cpe
Quite long post huh? ;)
Last edited by CosmoGuy on June 11th, 2012, 5:56 am, edited 1 time in total.
Image

User avatar
Gemini
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 44
Joined: Feb 14, 2012

Post by Gemini » June 11th, 2012, 5:38 am

Copy cpe2exe to your psy-q bin folder and make sure said path is configured under your PATH global variable (for NT systems you need to set that from the control panel by going to System properties, advanced system settings, advanced, environment variables). If it's not, then no wonder it says the program's missing.

As for that obj file, if it isn't included with your psy-q use NONE3.OBJ, it's the same thing.

And more importantly: why are you using DosBox? It serves no purpose AT ALL. All the programs are supposed to run in Windows mode. No wonder it says "This program cannot be run in DOS mode". :roll:

User avatar
CosmoGuy
Serious PSXDEV User
Serious PSXDEV User
Posts: 91
Joined: May 30, 2012
I am a: Hell knows who I am
PlayStation Model: SCPH-7502
Location: Polska, Wroclaw
Contact:

Post by CosmoGuy » June 11th, 2012, 6:11 am

I decided that DOSBox and native Win64 doesnt work in anyway so VirtualPC is back, but now...

Image

any ideas... :( i had to learn biology, geography and chemists for tomorrow instead of that... :evil: :cry:
Image

User avatar
Gemini
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 44
Joined: Feb 14, 2012

Post by Gemini » June 11th, 2012, 6:26 am

I already told you in the post above: set the environment variables the proper way! That batch thing you have there won't do shit on XP and later systems. If the procedure I suggested you doesn't work, google is your friend. And stop using psymake.

User avatar
CosmoGuy
Serious PSXDEV User
Serious PSXDEV User
Posts: 91
Joined: May 30, 2012
I am a: Hell knows who I am
PlayStation Model: SCPH-7502
Location: Polska, Wroclaw
Contact:

Post by CosmoGuy » June 11th, 2012, 6:41 am

Sorry Gemini.
I see you've got angry on me :(. But dont worry :). Problem disappeared ! :D
My friend helped me a lot so...
I needed to copy LIBSPU.LIB and paste it as "LBSPU.LIB" (the difference is there was no I letter in second)
Then paste original makefile like in hello.rar.
And thirdly paste CPE2X from Sony...

Now everytjing works well...

Image

But... Seriously... EVERY F*** TIME i have to play with it like that??

Sorry if that topic looks kinda trashy but it can help in the future...
Image

User avatar
Gemini
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 44
Joined: Feb 14, 2012

Post by Gemini » June 11th, 2012, 7:51 am

If you set the stuff like I told you several times in the previous replies instead of going your way trying to make it work as if it were still on a win98 system, the answer would be: no.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest