Win32 native Toolchain for PSPSDK

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

A new release 0.5 now with 20 devpaks... and counting... :)

Uninstall any previous SDK and do a fresh install, then install the devpaks you like. Devpaks have no uninstall feature so you need to remove them by hand if you want to uninstall.

Have fun!

More detail soon
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

Your are my star Heimdall. That's great!!!

One question, I installed the freetype devpack and get the following error when trying to compile a sample project:

cannot find -llibfreetype

I guess the libraries must be registered somehow but I don'tknow how. I already added the lib path to the makefile in LIBDIR = .... but not any better. Can you help?

Also, where can I download the latest release?
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

I had a bug on the installer on the initial devpaks. The one ones from the 28th should be fixed.

starting from the 28th all devpaks install the header files to:

$PSPSDK/../include (this is the same as C:\pspsdk\psp\include) if you install to c:\pspsdk

and the libs to:
$PSPSDK/../lib (this is the same as C:\pspsdk\psp\lib) if you install to c:\pspsdk

before, since i had a bug on my installer script it was instaling to c:\pspsdk\include and c:\pspsdk\lib

I'm working in some tweaks and next build of the devpaks will also include a native port of sdl-config and freetype-config so you can just add to your makefile:

$(shell freetype-config --cflags) and it works!

Cheers!
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

i was really interested with your devkit, so i installed it to test it : it really messes up with the cygwin pspsdk i have. Not only that, when i try to build, it cannot find psp-gcc . If i run "cmd" and "echo %PATH%", i can find "d:\cygwin\usr\local\pspdev\bin" (cygwin) then "d:\dev\pspsdk\bin" (yours). So why, vsmake.bat is unable to find psp-gcc ? here the wrong psp-gcc should have been found at least. Would there be something your tutorial don't say what you need to make it run successfully ?

Note : i installed your pspsdk 0.5
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

hlide wrote:i was really interested with your devkit, so i installed it to test it : it really messes up with the cygwin pspsdk i have. Not only that, when i try to build, it cannot find psp-gcc . If i run "cmd" and "echo %PATH%", i can find "d:\cygwin\usr\local\pspdev\bin" (cygwin) then "d:\dev\pspsdk\bin" (yours). So why, vsmake.bat is unable to find psp-gcc ? here the wrong psp-gcc should have been found at least. Would there be something your tutorial don't say what you need to make it run successfully ?

Note : i installed your pspsdk 0.5
Works perfect here. No need for devpacks

Change cygwin script to this:
@echo off

D:
chdir D:\cygwin\bin

umount -s --remove-all-mounts
mount -s -b -f d:\cygwin\bin /bin
mount -s -b -f d:\cygwin\etc /etc
mount -s -b -f d:\cygwin\lib /lib
mount -s -b -f d:\cygwin\usr /usr
mount -s -b -f d:\cygwin\var /var
mount -s -b -f d:\cygwin\home /home
mount -s -b -f d:\ /
mount -s -b -f d:\cygwin\bin /usr/bin
mount -s -b -f d:\cygwin\lib /usr/lib
mount -c -s /cygdrive
mount -c -u /cygdrive

set PSPDEV=/usr/local/pspdev
set PSPSDK=/usr/local/pspdev
set path=/usr/local/pspdev/bin;%path%

bash --login -i
Works perfect.
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

hlide wrote:i was really interested with your devkit, so i installed it to test it : it really messes up with the cygwin pspsdk i have. Not only that, when i try to build, it cannot find psp-gcc . If i run "cmd" and "echo %PATH%", i can find "d:\cygwin\usr\local\pspdev\bin" (cygwin) then "d:\dev\pspsdk\bin" (yours). So why, vsmake.bat is unable to find psp-gcc ? here the wrong psp-gcc should have been found at least. Would there be something your tutorial don't say what you need to make it run successfully ?

Note : i installed your pspsdk 0.5
I don't use cygwin at all in my PC. but if you have cygwin and my sdk installed and both are in your path than that should be the problem. The vsmake.bat is just one simple command:

make 2>&1 %1 %2 %3 %4 %5 | sed2 -e "s/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/"

it tries to call the make command which is installed both on cygwin and my pspsdk, since you cygwin is first on the path than that make is excuted later the command fails because there is no command called sed2 on cygwin but there is on my sdk. One solution is to try to hardcode the paths to the commands, something like:

%PSPSDK%/../../bin/make 2>&1 %1 %2 %3 %4 %5 | %PSPSDK%/../../bin/sed2 -e "s/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/"

or in your specific case:

d:\dev\pspsdk\bin\make 2>&1 %1 %2 %3 %4 %5 | d:\dev\pspsdk\bin\sed2 -e "s/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/"
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Heimdall wrote:
hlide wrote:i was really interested with your devkit, so i installed it to test it : it really messes up with the cygwin pspsdk i have. Not only that, when i try to build, it cannot find psp-gcc . If i run "cmd" and "echo %PATH%", i can find "d:\cygwin\usr\local\pspdev\bin" (cygwin) then "d:\dev\pspsdk\bin" (yours). So why, vsmake.bat is unable to find psp-gcc ? here the wrong psp-gcc should have been found at least. Would there be something your tutorial don't say what you need to make it run successfully ?

Note : i installed your pspsdk 0.5
I don't use cygwin at all in my PC. but if you have cygwin and my sdk installed and both are in your path than that should be the problem. The vsmake.bat is just one simple command:

make 2>&1 %1 %2 %3 %4 %5 | sed2 -e "s/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/"

it tries to call the make command which is installed both on cygwin and my pspsdk, since you cygwin is first on the path than that make is excuted later the command fails because there is no command called sed2 on cygwin but there is on my sdk. One solution is to try to hardcode the paths to the commands, something like:

%PSPSDK%/../../bin/make 2>&1 %1 %2 %3 %4 %5 | %PSPSDK%/../../bin/sed2 -e "s/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/"

or in your specific case:

d:\dev\pspsdk\bin\make 2>&1 %1 %2 %3 %4 %5 | d:\dev\pspsdk\bin\sed2 -e "s/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/"
thx but it appears not to be the problem. Let me explain :

Since both cygwin and pspsdk executables are reachable from PATH, I should still be able to reach sed2. However I also tried your solution and it happens to be worse indeed (cmd.exe returning error 255).

As told in the first post, i did have a message saying psp-gcc cannot be found, which means "make" was executed but failed to find psp-gcc (being in either cygwin or pspsdk). It gets me puzzled.

Well it seems i'm the only one to have a problem here. I use a workaround by modifying build.mak and prepending $(PSPSDK)/../../bin/ to each executable (psp-gcc, cp2, etc.). It works this way.

It looks as if vsmake.bat doesn't export PATH environment to cmd.exe, silly, isn't it ?
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

KickinAezz wrote:Works perfect here. No need for devpacks

Change cygwin script to this:
@echo off

D:
chdir D:\cygwin\bin

umount -s --remove-all-mounts
mount -s -b -f d:\cygwin\bin /bin
mount -s -b -f d:\cygwin\etc /etc
mount -s -b -f d:\cygwin\lib /lib
mount -s -b -f d:\cygwin\usr /usr
mount -s -b -f d:\cygwin\var /var
mount -s -b -f d:\cygwin\home /home
mount -s -b -f d:\ /
mount -s -b -f d:\cygwin\bin /usr/bin
mount -s -b -f d:\cygwin\lib /usr/lib
mount -c -s /cygdrive
mount -c -u /cygdrive

set PSPDEV=/usr/local/pspdev
set PSPSDK=/usr/local/pspdev
set path=/usr/local/pspdev/bin;%path%

bash --login -i
Works perfect.
I'm not sure to know what you mean. Cygwin may be enough for me as I got it at home, and it works for me. Heimdall's pspsdk may be interesting for non programmer people who want to be able to build a source without the necessity to install cygwin. Heimdall's pspsdk is probably the easiest solution I knew for them, so I was testing it. Sure, I still prefer to work with an SVN pspsdk through cygwin so I can get the last modifications.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Looks like I misread your post; thought your cygwin cant find executables due to change in env variables after installing this sdk.
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

hlide wrote: I'm not sure to know what you mean. Cygwin may be enough for me as I got it at home, and it works for me. Heimdall's pspsdk may be interesting for non programmer people who want to be able to build a source without the necessity to install cygwin. Heimdall's pspsdk is probably the easiest solution I knew for them, so I was testing it. Sure, I still prefer to work with an SVN pspsdk through cygwin so I can get the last modifications.
That is not the point! My SDK is even for "programmers" not only for beginners, the point is you have the latest SVN changes on it (you can check that the changes from this week are incorporated) and the most important for me as a developer is why should i care about building my own compiler and libraries if i just want to make a game or an application? This is my point.

A simple SDK for getting your things done! no need to know how to build a cross compiler and spend time building it and keeping it up to date as well for the libraries.

About your problem i don't know what is going on, I'm testing the solution on 2 machines 1 without cygwin and other with cygwin and both seem to work good for me, the difference (i guess) is that i don't have any cygwin commands available on my path and my env vars under cygwin are declared on the launch bat.

Could you paste here your env vars and for the sake of it, just try to see which versions of make, psp-gcc and sed2 you have in your cmd line.

try:
set
make --version
psp-gcc --version
sed2 --version

like if you're using my sdk you should get:

make 3.81
psp-gcc 4.1.2

while if you're using cygwin it should tell you

psp-gcc 4.1.0
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Heimdall wrote:That is not the point! My SDK is even for "programmers" not only for beginners, the point is you have the latest SVN changes on it (you can check that the changes from this week are incorporated) and the most important for me as a developer is why should i care about building my own compiler and libraries if i just want to make a game or an application? This is my point.

A simple SDK for getting your things done! no need to know how to build a cross compiler and spend time building it and keeping it up to date as well for the libraries.
Relax ! I'm just saying I was testing your pspsdk for some non programmer teammates so I can tell them it is okay to use it without the need to install cygwin. That's all.
Heimdall wrote:About your problem i don't know what is going on, I'm testing the solution on 2 machines 1 without cygwin and other with cygwin and both seem to work good for me, the difference (i guess) is that i don't have any cygwin commands available on my path and my env vars under cygwin are declared on the launch bat.

Could you paste here your env vars and for the sake of it, just try to see which versions of make, psp-gcc and sed2 you have in your cmd line.

try:
set
make --version
psp-gcc --version
sed2 --version

like if you're using my sdk you should get:

make 3.81
psp-gcc 4.1.2

while if you're using cygwin it should tell you

psp-gcc 4.1.0
Using cmd.exe, I have several things in this order in my PATH :
  • D:\Program Files\CodeSourcery\Sourcery G++Lite\bin; // ARM
    D:\cygwin\opt\open2x\gcc-4.1.1-glibc-2.3.6\bin; // ARM GP2X
    D:\cygwin\usr\local\pspdev\bin; // CYGWIN PSP
    D:\cygwin\usr\local\bin;
    D:\cygwin\bin;
    d:\dev\pspsdk\bin // your PSPSDK bin path added by your installer
I have also PSPSDK=d:/dev/pspsdk/psp/sdk

versions are :
  • make 3.81 (i686-pc-cygwin)
    psp-gcc 4.1.0
    sed2 3.02
note that sed2 is nowhere else in your PSPSDK

Now without touching your vsmake.bat and your build.mak, i got the following logs when building or rebuilding :

Code: Select all

------ Build started: Project: hurrican, Configuration: Debug Win32 ------
Performing Makefile project actions
psp-g++ -I. -Id:/dev/pspsdk/psp/sdk/include -O3 -G0 -Wall -I. -Id:/dev/pspsdk/psp/sdk/include -O3 -G0 -Wall -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=150   -c -o main.o main.cpp
make: psp-g++: Command not found
make: *** [main.o] Error 127
Build log was saved at "file://d:\dev\hurrican\dists\psp\Debug\BuildLog.htm"
hurrican - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Code: Select all

------ Rebuild All started: Project: hurrican, Configuration: Debug Win32 ------
Performing Makefile project actions
rm2 -f hurrican.elf  main.o PARAM.SFO EBOOT.PBP EBOOT.PBP
make: rm2: Command not found
make: [clean] Error 127 (ignored)
Build log was saved at "file://d:\dev\hurrican\dists\psp\Debug\BuildLog.htm"
hurrican - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
as you can see "make" fails to find "psp-gcc" and "rm2".

ok, if i change vsmake.bat into :

Code: Select all

@echo off
set PATH=%PSPSDK%\..\..\bin;%PATH%
make 2>&1 %1 %2 %3 %4 %5 | sed2 -e "s/\([^:]*\):\([0-9][0-9]*\)\(.*\)/\1 (\2) \3/"
it works.

so it looks as if cygwin "make.exe" doesn't export DOS PATH whereas your PSPSDK "make.exe" does it. I think you should not append your PSPSDK bin path to PATH when installing your PSPSDK installer but rather let your vsmake.bat prepend it to PATH since VS2008 always uses vsmake.bat to build, rebuild or clean.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

yes my make uses the native paths from windows while cygwin one uses its own. from your program versions it says you're using make from cygwin and psp-gcc also from cygwin 4.1.0 mine is 4.1.2.

I appended my PSPSDK to the path not because of visual studio but because eclipse which was the initial and only supported dev env. I added VS support because some people asked for it but personally i don't use it so i only installed the express version to get barely working with the SDK.

Anyway :) you'll still have problems because other stuff from the SDK such as rm2, mkdir2 and so on (that you see on the last error) are modified versions of the unix commands to run on windows and are "supposed" to be on the path too.

I'd recommend only to keep my setting on the path when you use my sdk and remove when you use other sdk's.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

For the last weeks I've been working in version 0.6 of my PSP devkit.

The main changes are:
  • Removed the dependency for the env var PSPSDK
    Fixed psp-config
    Better vsmake.bat
    Better man.bat
    Fixed issue that some installations would end up without env vars due to delayed hdd writes
    No need to hack SDK makefiles anymore
    GNU tools (cp, rm, mkdir, sed) called with the original names no need to append a "2"
So from now on the same makefile from the Official PSPSDK will work with the native windows SDK. For visual studio users, there were some comments that vsmake was kind of buggy (due to %PATH% problems). Now all commands except the compiler are fixed to the SDK trying this way to reduce conflicts.

Man page reader has been reduced and the devkits are now installing man pages to the correct path and other types of documentation to the doc folder.

Finally but not least you have now 25 devpaks!

Full links here:
Dev Paks:
s00pcan
Posts: 3
Joined: Mon Jun 20, 2005 11:35 am

Post by s00pcan »

This is great work here. I compiled a modified test program through visual studio and it worked! Next question, what's the fastest way to debug? Is there a good psp emulator for homebrew (I know there isn't one that runs games) or do I have to put it on my memory stick and run it every time? Or is there a debug app tha waits to recieve a program over usb and runs it?
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Well... :) I've included GDB and "standard" debugging tools from the official toolchain. I'm investigating how can i use pspplayer or other emulator to debug and if they are good for homebrew i'll start including them as an optional download to the official site.

But for now you only have GDB, but as i've said before i've low experience with VS so i don't know how to use the internal VS debugger as an interface to GDB... If you know please let me know and i'll add it! :)
TGV
Posts: 1
Joined: Sat Mar 08, 2008 6:32 pm

Post by TGV »

I don't really know where else to ask this but I'm trying to setup a copy of OpenTyrian for use in Visual Studio C++ Express 2008, am I barking up the wrong tree or is it possible? I tried doing something similar to your tutorial on your blog but to no avil. It resulted in some errors some of which were SDL.h related so I grabbed the DevKit hoping it would help. Still not looking too good for me. I apologize for this question I just love this game and I'm new to programming for the PSP and this seems like something I'd love to tinker with.

Thank you all for your time and for this DevKit you made! I was able to compile some of the samples without any issues! Thanks!
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

TGV wrote:I don't really know where else to ask this but I'm trying to setup a copy of OpenTyrian for use in Visual Studio C++ Express 2008, am I barking up the wrong tree or is it possible? I tried doing something similar to your tutorial on your blog but to no avil. It resulted in some errors some of which were SDL.h related so I grabbed the DevKit hoping it would help. Still not looking too good for me. I apologize for this question I just love this game and I'm new to programming for the PSP and this seems like something I'd love to tinker with.

Thank you all for your time and for this DevKit you made! I was able to compile some of the samples without any issues! Thanks!
Give us more details about your problems. Right now, it is as if you said "I have a problem." and that was all.

For SDL, you may need to add some include and lib paths in the project. Probably something like "<your pspsdk path>/include/SDL" for instance.
nbollom
Posts: 6
Joined: Tue Feb 19, 2008 10:45 pm

Post by nbollom »

Heimdall,

Trying to use the freetype lib and it seems like there is a problem when trying to import the header files.

In my program I am importing the freetype main header:

Code: Select all

#include <ft2build.h>
The compiler is finding that header file but inside that header it imports another header file:

Code: Select all

#include <freetype/config/ftheader.h>
The compiler cannot find this header file and throws an error.

I'm using the latest SDK (0.6.0) and freetype devpack (2.1.10) both of which I downloaded today.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

nbollom i've a clean install of the sdk 0.6 and only freetype devpak and i've created a sample piece of code like this:

Code: Select all

#include <ft2build.h>
#include <freetype/freetype.h>
#include <pspkernel.h>
#include <pspdebug.h>

#define printf pspDebugScreenPrintf

/* Define the module info section */
PSP_MODULE_INFO&#40;"template", 0, 1, 1&#41;;

/* Define the main thread's attribute value &#40;optional&#41; */
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER | THREAD_ATTR_VFPU&#41;;

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;

	pspDebugScreenPrintf&#40;"FreeType Version %i.%i.%i\n", FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH&#41;;

	return 0;
&#125;
And now my Makefile:

Code: Select all

TARGET = template
OBJS = main.o

INCDIR = 
CFLAGS = -O2 -G0 -Wall $&#40;shell freetype-config --cflags&#41;
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS = $&#40;shell freetype-config --libs&#41;

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
Note the CFLAGS and LDFLAGS, i'm using freetype-config tool but you can hardcode it by hand:

CFLAGS = -O2 -G0 -Wall -IC:/pspsdk/psp/include/freetype2
LDFLAGS = -LC:/pspsdk/psp/lib -lfreetype

And them make

Code: Select all

**** Build of configuration Default for project ft-test ****

make all 
psp-gcc -I. -IC&#58;/pspsdk/psp/sdk/include -O2 -G0 -Wall -IC&#58;/pspsdk/psp/include/freetype2  -D_PSP_FW_VERSION=150   -c -o main.o main.c
psp-gcc -I. -IC&#58;/pspsdk/psp/sdk/include -O2 -G0 -Wall -IC&#58;/pspsdk/psp/include/freetype2  -D_PSP_FW_VERSION=150  -L. -LC&#58;/pspsdk/psp/sdk/lib -LC&#58;/pspsdk/psp/lib -lfreetype   main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o template.elf
psp-fixup-imports template.elf
mksfo 'Template' PARAM.SFO
psp-strip template.elf -o template_strip.elf
pack-pbp EBOOT.PBP PARAM.SFO NULL  \
		NULL NULL NULL  \
		NULL  template_strip.elf NULL
&#91;0&#93;        408 bytes | PARAM.SFO
&#91;1&#93;          0 bytes | NULL
&#91;2&#93;          0 bytes | NULL
&#91;3&#93;          0 bytes | NULL
&#91;4&#93;          0 bytes | NULL
&#91;5&#93;          0 bytes | NULL
&#91;6&#93;      79012 bytes | template_strip.elf
&#91;7&#93;          0 bytes | NULL
C&#58;/pspsdk/bin/rm -f template_strip.elf
Seems to be all good!
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

Heimdall, if you are also interested : http://forums.ps2dev.org/viewtopic.php?t=9918
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Thanks, I'll try to get it in. I'll come back to you if i face some troubles to get it done.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

I wasted 30 mins diggin out a mistake. But it wasn't mine :X

Code: Select all

. -ID&#58;/PSPSdk/psp/sdk/include -O2 -G0 -Wall  -o mylib.o mylib.s
mylib.s&#58; Assembler messages&#58;
mylib.s&#58;5&#58; Error&#58; unrecognized opcode `stub_start "myLib",0x40090000,0x00010005'

mylib.s&#58;6&#58; Error&#58; unrecognized opcode `stub_func 0x9A229F46,StartIRDAdriver'
mylib.s&#58;7&#58; Error&#58; unrecognized opcode `stub_end'
make&#58; *** &#91;mylib.o&#93; Error 1
Thank god I have cygwin and It compiles fine but not in this PSP SDK.

Hope you comeout with a fix Hiemdall, Thanks!
Last edited by KickinAezz on Fri Mar 14, 2008 9:01 am, edited 1 time in total.
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

KickinAezz wrote:I wasted 30 mins diggin out a mistake. But it wasn't mine :X

Code: Select all

. -ID&#58;/PSPSdk/psp/sdk/include -O2 -G0 -Wall  -o mylib.o mylib.s
mylib.s&#58; Assembler messages&#58;
mylib.s&#58;5&#58; Error&#58; unrecognized opcode `stub_start "myLib",0x40090000,0x00010005'

mylib.s&#58;6&#58; Error&#58; unrecognized opcode `stub_func 0x9A229F46,StartIRDAdriver'
mylib.s&#58;7&#58; Error&#58; unrecognized opcode `stub_end'
make&#58; *** &#91;mylib.o&#93; Error 1
Thank god I have cygwin and It compiles fine but not in this PSP SDK.
ok, this is probably a recurrent problem with .S and .s suffix : if I remember well, .S uses preprocessor and .s doesn't. With mingw, it is not sure if .s and .S is handled the same way because there is no difference.

It seems as if mylib.s doesn't use preprocessor to replace stub_start, stub_func and stub_end (if they are #define of course).

Or something similar.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

Hilde is correct .s is a Unix Source file without preprocessor support and .S with pre processor.

If you looked at the SDK itself (svn trunk/pspsdk) you'd have noticed that all asm files are with an uppercase extension.

As of the build 0.6.2 my SDK compiles with the exact same patches as cygwin/linux (i managed to get it working without needing to hack anything else), so i don't think you're right by blaming my builds.

However you must note that i'm using gcc 4.1.2 and not 4.1.0, since it is considered by the GCC team as the latest stable release of teh 4.1 series, see what was fixed since the release of the compiler you're using on cygwin here: http://gcc.gnu.org/gcc-4.1/
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

KickinAezz wrote:Hope you comeout with a fix Hiemdall, Thanks!
Heimdall confirms so just rename mylib.s into mylib.S if you need preprocessor to process it before assembling. Since pspsdk itself uses a great deal of .S files which need to be preprocessed and they are successful, there is nothing to fix in this pspdk.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

hlide wrote:
KickinAezz wrote:Hope you comeout with a fix Hiemdall, Thanks!
Heimdall confirms so just rename mylib.s into mylib.S if you need preprocessor to process it before assembling. Since pspsdk itself uses a great deal of .S files which need to be preprocessed and they are successful, there is nothing to fix in this pspdk.
I tried it before posting prev. message. It is .S
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

KickinAezz wrote:I tried it before posting prev. message. It is .S
I got this
psp-gcc -I. -Id:/dev/pspsdk/psp/sdk/include -O3 -G0 -Wall -o MediaEngine.o MediaEngine.s
MediaEngine.s: Assembler messages:
MediaEngine.s (5) : Error: unrecognized opcode `stub_start "MediaEngine",0x40090000,0x00040005'
MediaEngine.s (6) : Error: unrecognized opcode `stub_func 0x284FAFFC,InitME'
MediaEngine.s (7) : Error: unrecognized opcode `stub_func 0xE6B12941,KillME'
MediaEngine.s (8) : Error: unrecognized opcode `stub_func 0xF107252F,CallME'
MediaEngine.s (9) : Error: unrecognized opcode `stub_func 0xEE216DA1,WaitME'
MediaEngine.s (10) : Error: unrecognized opcode `stub_end'
And yet, I have MediaEngine.S with a capital S.

No wonder gcc didn't preprocess it. So yes there is a problem.

there are two solutions :
  • - gcc shouldn't find a file if the case of .S suffix doesn't match (doable for mingw ? or does it regard .s and .S as being equivalent ?)
    - gcc should enforce preprocessor even with .s file
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

One of the biggest problems I've seen with people developing in Windows (cough - nanodesktop - cough - pikey - cough) are people using any case they feel like (since Windows ignores case), and even worse - using \ in paths. Every time I get pikey code from one of the other team members, I have to spend a few minutes correcting all the cases before I can compile the code again. Nanodesktop uses \ in a bunch of paths, and has case issues as well.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

Sorry for this little OT, but i don't know if my problem is SDK related... i just migrated to the latest Heimdall's SDK and i can't compile for 3.xx...i.e. code compiles but freezes my PSP when executed. I think i'm mistaking something very stupid but i can't find where...if someone could be so cute to point me to some answer/page/post, he/she will gain a place in heaven!
This is the the problem:
http://forums.ps2dev.org/viewtopic.php?t=9948
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

It may not be the SDK. Pikey really only works completely up to 3.52. Theoretically, it should work in 3.80 or better with the NID resolver, but there are apparently problems that are being looked into. It's another reason I don't think you should be using pikey for developing the input from the chatpad - it won't work with current firmwares. Pspirkeyb doesn't have that problem.
Post Reply