02.12.2010, 18:20
Hey,
also wie einige von euch sicher schon mitgekriegt haben, hab ich immer noch ein prob mit PSPSDK.
PSPSDK IST koreckt installiert.
Also zu meinem prob:
Wenn ich ein makefile nehme, klappts mit der oslib nicht, wenn ich das nehme, welches hier steht, kommt ein andere fehler.
makefile1:
führt zu diesem fehler:
makefile2 aus dem tut von PSP-Hilfe:
führt zu diesem fehler:
Quelltext:
kann mir da wer helfen?
also wie einige von euch sicher schon mitgekriegt haben, hab ich immer noch ein prob mit PSPSDK.
PSPSDK IST koreckt installiert.
Also zu meinem prob:
Wenn ich ein makefile nehme, klappts mit der oslib nicht, wenn ich das nehme, welches hier steht, kommt ein andere fehler.
makefile1:
1 Fehler (anzeigen)
Code:
TARGET = sample
OBJS = main.o
PSP_DRIVE = /cygdrive/j
USE_PSPSDK_LIBC = 1
INCDIR =
CFLAGS = -G4 -Wall -O2 -G0
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
STDLIBS= -losl -lpng -lz \
-lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)
LIBDIR =
LDFLAGS =
LIBS= -lpspgu -lpsprtc -lpspctrl -lpspmath
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = pspmath demo
PSP_EBOOT_ICON = icon.png
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Spoiler: (anzeigen)
2 Fehler (anzeigen)
Code:
TARGET = tutorial
OBJS = main.o
INCDIR =
CFLAGS = -G4 -Wall -O2 -G0
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
-lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = tutorial
PSPSDK=$(shell psp-config –pspsdk-path)
include $(PSPSDK)/lib/build.mak
Spoiler: (anzeigen)
Spoiler: (anzeigen)
Code:
#include <oslib/oslib.h>
#include "spielfigur.h"
#include "hintergrund.h"
PSP_MODULE_INFO("Tutorial", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
OSL_IMAGE *spielfigurbild, *hintergrundbild;
int main()
{
oslInit(0);
oslInitGfx(OSL_PF_8888, 1);
oslSetTransparentColor(RGB(255,0,255));
OSL_VIRTUALFILENAME rambilder[] =
{
{"ram:/spielfigur.png", (void*)spielfigur, size_spielfigur, &VF_MEMORY},
{"ram:/hintergrund.png", (void*)hintergrund, size_hintergrund, &VF_MEMORY}
};
oslAddVirtualFileList(rambilder, oslNumberof(rambilder));
spielfigurbild = oslLoadImageFile("ram:/spielfigur.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_5551);
hintergrundbild = oslLoadImageFile("ram:/hintergrund.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_5551);
int speed = 0;
int bildteil = 0;
int letzterichtung = 0;
int positionx = 0;
int positiony = 156;
while (!osl_quit)
{
oslStartDrawing();
oslReadKeys();
if ((osl_keys->held.right) || (osl_keys->held.left))
{
speed++;
if (speed == 10)
{
speed = 0;
bildteil ++;
if (bildteil > 2) bildteil = 0;
if (osl_keys->held.right)
{
oslSetImageTileSize(spielfigurbild, (bildteil*72), 0, 72, 69);
letzterichtung = 0;
}
if (osl_keys->held.left)
{
oslSetImageTileSize(spielfigurbild, (bildteil*72), 69, 72, 69);
letzterichtung = 69;
}
}
if ((osl_keys->held.right) && (positionx < 408)) positionx +=1;
if ((osl_keys->held.left) && (positionx > 0)) positionx -=1;
}
if ((!osl_keys->held.right) && (!osl_keys->held.left)) oslSetImageTileSize(spielfigurbild, 69, letzterichtung, 72, 69);
oslDrawImage(hintergrundbild);
oslDrawImageXY(spielfigurbild, positionx, positiony);
oslEndDrawing();
oslSyncFrame();
}
oslDisableTransparentColor();
oslEndGfx();
oslQuit();
return 0;
}