| View previous topic :: View next topic |
| Author |
Message |
webjeff
Joined: 05 May 2005 Posts: 66
|
Posted: Mon May 09, 2005 12:24 am Post subject: PSP Dev Commands |
|
|
1st thing... Great work on getting the hello world to work.
2nd,
OK, I got the source for it, and it works on my old psp I imported from japan several months ago. I did get it compiled and it worked fine. What other commands are there except the ones listed in pg.h:
void pgInit();
void pgWaitV();
void pgWaitVn(unsigned long count);
void pgScreenFrame(long mode,long frame);
void pgScreenFlip();
void pgScreenFlipV();
void pgPrint(unsigned long x,unsigned long y,unsigned long color,const char *str);
void pgPrint2(unsigned long x,unsigned long y,unsigned long color,const char *str);
void pgPrint4(unsigned long x,unsigned long y,unsigned long color,const char *str);
void pgFillvram(unsigned long color);
void pgBitBlt(unsigned long x,unsigned long y,unsigned long w,unsigned long h,unsigned long mag,const unsigned short *d);
void pgPutChar(unsigned long x,unsigned long y,unsigned long color,unsigned long bgcolor,unsigned char ch,char drawfg,char drawbg,char mag);
Where did you figure these out? I know you we are using the ps2 dev toolchain, however I am not familiar with it so please bare with me. I looked through the docs and could not even find these commands so, where am I suppose to find other commands?
Thanks a lot guys!
Jeff. |
|
| Back to top |
|
 |
Saotome

Joined: 03 Apr 2004 Posts: 182
|
Posted: Mon May 09, 2005 12:38 am Post subject: |
|
|
actually all those functions you listed were written by nem himself (see pg.c in the source-code).
they are using only 3 functions that he found out from his dumped firmware/bios :
pspDisplaySetMode
pspDisplaySetFrameBuf
pspDisplayWaitVblankStart _________________ infj |
|
| Back to top |
|
 |
webjeff
Joined: 05 May 2005 Posts: 66
|
Posted: Mon May 09, 2005 1:11 am Post subject: |
|
|
wow,
I'm even more impressed with Nem! That guy is insane. OK, now I get it, thanks a lot for clearing that up, I was getting confused. I hope to have something cool written in a couple of days.
Thanks!
Jeff. |
|
| Back to top |
|
 |
Vampire
Joined: 12 Apr 2005 Posts: 138
|
Posted: Mon May 09, 2005 1:43 am Post subject: |
|
|
| Saotome wrote: | actually all those functions you listed were written by nem himself (see pg.c in the source-code).
they are using only 3 functions that he found out from his dumped firmware/bios :
pspDisplaySetMode
pspDisplaySetFrameBuf
pspDisplayWaitVblankStart |
and they should be called:
sceDisplaySetMode
sceDisplaySetFrameBuf
sceDisplayWaitVblankStart |
|
| Back to top |
|
 |
webjeff
Joined: 05 May 2005 Posts: 66
|
Posted: Mon May 09, 2005 2:04 am Post subject: |
|
|
I got one more question related so I didn't want to start another thread.
How can I compile the helloworld code in C++ rather than C?
I have converted hellopsp.c to C++ but its giving me errors on the final GCC compile & link saying all the PG and psp Functions are undefined. Hmm, are there other parameters I need when compiling this?
Thanks a lot
Jeff. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Mon May 09, 2005 3:02 am Post subject: |
|
|
| If you don't rename pg.c to pg.cpp, then you have to wrap 'extern "C" { }' around the function declarations in pg.h. |
|
| Back to top |
|
 |
webjeff
Joined: 05 May 2005 Posts: 66
|
Posted: Mon May 09, 2005 4:05 am Post subject: |
|
|
Thanks a lot!
I did that but running into a few problems still,
Here is what I'm trying to run (From the helloworld example - minor changes for C++/C code):
c:\ps2dev\gcc\ee\bin\ee-g++ -march=r4000 -g -mgp32 -mlong32 -c hellopsp.cpp
c:\ps2dev\gcc\ee\bin\ee-gcc -march=r4000 -g -mgp32 -mlong32 -c pg.c
c:\ps2dev\gcc\ee\bin\ee-g++ -march=r4000 -g -mgp32 -c -xassembler -O -o startup.o startup.s
c:\ps2dev\gcc\ee\bin\ee-ld -O0 startup.o hellopsp.o pg.o -M -Ttext 8900000 -q -lstdc++ -o out > hellopsp.map
And this is what i'm getting:
C:\helloworldpsp\testcpp>c:\ps2dev\gcc\ee\bin\ee-ld -O0 startup.o hellopsp.o pg.
o -M -Ttext 8900000 -q -o out 1>hellopsp.map
hellopsp.o(.data+0x11): In function `xmain':
/cygdrive/c/helloworldpsp/testcpp/hellopsp.cpp:19: undefined reference to `__gxx
_personality_v0'
now, I also tried (after some research) adding -lstdc++ to the link step but then I get this:
C:\helloworldpsp\testcpp>c:\ps2dev\gcc\ee\bin\ee-ld -O0 startup.o hellopsp.o pg.
o -M -Ttext 8900000 -q -lstdc++ -o out 1>hellopsp.map
/cygdrive/c/ps2dev/gcc/ee/bin/ee-ld: /cygdrive/c/ps2dev/gcc/ee/bin/../ee/lib/lib
stdc++.a(eh_personality.o): linking 32-bit code with 64-bit code
/cygdrive/c/ps2dev/gcc/ee/bin/ee-ld: /cygdrive/c/ps2dev/gcc/ee/bin/../ee/lib/lib
stdc++.a(eh_personality.o): ABI mismatch: linking EABI64 module with previous EA
BI32 modules
...
ETC.
Hmm,
Any ideas??
Thanks a ton.
Jeff |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Mon May 09, 2005 6:48 am Post subject: |
|
|
-fno-exceptions to get rid of the personality error.
You won't be able to link with any EE-speciific libraries, well, because they were compiled for the EE. |
|
| Back to top |
|
 |
webjeff
Joined: 05 May 2005 Posts: 66
|
Posted: Mon May 09, 2005 7:23 am Post subject: |
|
|
Hmm,
I'm confused now, I did what you said and it built even though it had an assertion:
C:\helloworldpsp\testcpp>c:\ps2dev\gcc\ee\bin\ee-ld -O0 startup.o hellopsp.o pg.
o -M -Ttext 8900000 -q -fno-exceptions -shared -o out 1>hellopsp.map
/cygdrive/c/ps2dev/gcc/ee/bin/ee-ld: BFD 2.14 20030612 assertion fail ../../bfd/
elflink.h:5274
I just want to use C++ rather than C. I'm unfamiliar with GCC and its linking options (I'm sure you could tell). I have code already to go once I figure out how to link with a C++ hello world.
Can you give me any insight how this might be possible? You also said I won't be able to link with any EE-specific libs, why not? if I use C++ I can't link with EE?
Thanks
Jeff. |
|
| Back to top |
|
 |
blackdroid
Joined: 17 Jan 2004 Posts: 564 Location: Sweden
|
Posted: Mon May 09, 2005 7:30 am Post subject: |
|
|
The EE libraries contain code specific for operating on the ps2 EE, some stuff might work, and some wont, all in all its a risky business and you should wait until there is a pspsdk with libc and friends, or write the routines you need yourself. _________________ Kung VU |
|
| Back to top |
|
 |
|