PSP Dev Commands
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.
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.
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
they are using only 3 functions that he found out from his dumped firmware/bios :
pspDisplaySetMode
pspDisplaySetFrameBuf
pspDisplayWaitVblankStart
infj
and they should be called: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
sceDisplaySetMode
sceDisplaySetFrameBuf
sceDisplayWaitVblankStart
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.
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.
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
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
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.
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.
-
- Posts: 564
- Joined: Sat Jan 17, 2004 10:22 am
- Location: Sweden
- Contact: