 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
dbgtnet
Joined: 25 Dec 2005 Posts: 10
|
|
| Back to top |
|
 |
danzel
Joined: 04 Nov 2005 Posts: 182
|
Posted: Wed Dec 28, 2005 7:31 am Post subject: |
|
|
Add -lpspgu to your libs.
You should have a line in the makefile like:
That will get rid of the 'undefined reference to sceGu...' messages.
The warning messages at the top (pointer from integer) are because you are using the wrong datatypes, I haven't used the Gu functions much so I can't help you more there. |
|
| Back to top |
|
 |
dbgtnet
Joined: 25 Dec 2005 Posts: 10
|
Posted: Thu Dec 29, 2005 2:05 am Post subject: |
|
|
| Thanks that repair that error !!!! |
|
| Back to top |
|
 |
sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Thu Dec 29, 2005 9:30 am Post subject: |
|
|
sceGuTexImage(0,512,512,512,logo_temp);
sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D,6,0,vertices);
Both the arguments in red above are pointers. for sceGuTexImage is it a pointer to your texture and for the sceGuDrawArray it is a pointer to your vertices. In your code you have these defined as the datatype int.
So you should either declare your variables as pointers or make a typecast in your code.
sceGuTexImage(0,512,512,512,(const void *)logo_temp);
sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D,6,0,(const void *)vertices); _________________ Br, Sandberg |
|
| Back to top |
|
 |
dbgtnet
Joined: 25 Dec 2005 Posts: 10
|
Posted: Fri Jan 06, 2006 9:07 am Post subject: |
|
|
I have this error now
make: *** No rule to make target 'graphics.o', needed by 'test.elf', stop. |
|
| Back to top |
|
 |
sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Fri Jan 06, 2006 9:23 am Post subject: |
|
|
| dbgtnet wrote: | I have this error now
make: *** No rule to make target 'graphics.o', needed by 'test.elf', stop. |
Would probably be easier to answer if you showed ud your makefile :) _________________ Br, Sandberg |
|
| Back to top |
|
 |
dbgtnet
Joined: 25 Dec 2005 Posts: 10
|
Posted: Fri Jan 06, 2006 9:29 am Post subject: |
|
|
I found the error.
But now the flipscreen and initgraphics are undefined reference which library i need to include.
| Code: | TARGET = test
OBJS = main.o graphics.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspgum -lpspgu -lpng -lz -lm
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Pong par moi
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak |
| Code: | // Pong PSP par Maxime Dupré Corriveau
// Débuter le 10 Décembre 2005
// Finis le -----------------
//Inclure les librairies PSP
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include "graphics.c"
#define printf pspDebugScreenPrintf // Remplacer les codes pc par ceux
#define clrscr pspDebugScreenClear
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
/* Define the module info section */
PSP_MODULE_INFO("Pong Par Moi :D", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
int a215 = 0;
int done = 0;
int x1 = 0;
int x2 = 0;
int Image = 0;
int ourImage = 0;
void dump_threadstatus(void);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
done = 1;
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main(void)
{
char buffer[200];
Image* ourImage;
initGraphics();
clrscr();
SceCtrlData pad;
pspDebugScreenInit();
SetupCallbacks();
pspDebugScreenSetXY(0, 2);
printf("Je vous pr\x82sente mon jeu de pong.\n Il a \x82t\x82 programmer pour l'expo science.");
printf("\n Pour commencer a jouer veuillez appuyer sur le bouton X.");
while(1){
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS){
break;
}
}
clrscr();
pspDebugScreenSetXY(0, 2);
printf("Les boutons du joueur 1 sont : Fleche Haut et Fleche bas.\n Pour le joueur 2 : Triangle et X.");
printf("\n Pour partir le jeu appuyer sur START.");
while(1){
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_START){
break;
}
}
clrscr();
sprintf(buffer, "background.png");
ourImage = loadImage(buffer);
if (!ourImage) {
//Image load failed
printf("Image load failed!\n");
} else {
int x = 0;
int y = 0;
while (x < 480) {
while (y < 272) {
blitAlphaImageToScreen(0 ,0 ,32 , 32, ourImage, x, y);
y += 32;
}
x += 32;
y = 0;
}
flipScreen();
}
sceDisplayWaitVblankStart();
while(!done){
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons != 0){
if (pad.Buttons & PSP_CTRL_TRIANGLE){
printf("Triangle pressed \n");
x2++;
}
if (pad.Buttons & PSP_CTRL_CROSS){
printf("Cross pressed \n");
x2--;
}
if (pad.Buttons & PSP_CTRL_UP){
printf("Up pressed \n");
x1++;
}
if (pad.Buttons & PSP_CTRL_DOWN){
printf("Down pressed \n");
x1--;
}
clrscr();
printf("Le pad 1 : %d",x1);
printf("\n Le pad 2 : %d",x2);
}
}
sceKernelSleepThread();
return 0;
}
|
|
|
| Back to top |
|
 |
sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Fri Jan 06, 2006 9:47 am Post subject: |
|
|
I've never heard of them before, so can't help you out there. Also, doing a grep in the spsdev repository doesn't return any mathces for those functions anywhere.
Why do you use those functions ? You must have seen them used somewhere or read about them somewhere ? _________________ Br, Sandberg |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Fri Jan 06, 2006 6:23 pm Post subject: |
|
|
why you are including a c file :S
just include a header with the list of graphic.c function, then another thing do you have a graphic.c file inside your folder? |
|
| Back to top |
|
 |
dbgtnet
Joined: 25 Dec 2005 Posts: 10
|
Posted: Sat Jan 07, 2006 3:13 am Post subject: |
|
|
This is the error  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|