this are my first steps in PSP development. I already coded some small programs in C, but this was 10 years ago. So I am a noob. Somebody already pointed me to my "text problem" to freetype. I also found "flib" and this seems to be an easy way to get the job done for me. The demo compile without any trouble. Unfortunately I have a problem compiling my own program together with it and I really dont know why. Analyzed the Makefile for an hour, tried a lot but I still get this:
Code: Select all
psp-gcc -I/include -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -L. -L/usr/local/pspdev/psp/sdk/lib sdlext.o flib.o graphics.o framebuffer.o sdlsidplay.o -lpsppower -lpspgu -lpng -lz -lm -lfreetype -lsidplay -lstdc++ -L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o sdlsidplay.elf
sdlsidplay.o: In function `Intro()':
sdlsidplay.cpp:(.text+0x70): undefined reference to `initGraphics()'
sdlsidplay.cpp:(.text+0x7c): undefined reference to `load_font(char*)'
sdlsidplay.cpp:(.text+0x8c): undefined reference to `clearScreen(unsigned int)'
sdlsidplay.cpp:(.text+0x98): undefined reference to `set_font_color(unsigned int)'
sdlsidplay.cpp:(.text+0xa0): undefined reference to `set_font_size(int)'
sdlsidplay.cpp:(.text+0xb4): undefined reference to `text_to_screen(char*, int, int)'
sdlsidplay.cpp:(.text+0xc4): undefined reference to `flipScreen()'
sdlsidplay.o: In function `SDL_main':
sdlsidplay.cpp:(.text+0x85c): undefined reference to `unload_font()'
collect2: ld returned 1 exit status
make: *** [sdlsidplay.elf] Error 1
Code: Select all
TARGET = sdlsidplay
OBJS = sdlext.o flib.o graphics.o framebuffer.o sdlsidplay.o
INCDIR = $(PSPDIR)/include
CFLAGS = -G0 -Wall -O2
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS= -lpsppower -lpspgu -lpng -lz -lm -lfreetype
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = sdlsidplay
PSP_EBOOT_ICON = sidplay.png
PSPBIN = $(PSPSDK)/../bin
CFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
LIBS += -lsidplay -lstdc++ $(shell $(PSPBIN)/sdl-config --libs)
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
strip: all
cp $(TARGET).elf sdlsid.elf
psp-strip sdlsid.elf
The includes in my main program (sdlsiplay.cpp):
Code: Select all
#include <stdlib.h>
#include <stdio.h>
#include <SDL/SDL.h>
#include <sidplay/sidtune.h>
#include <sidplay/emucfg.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <string.h>
#include <dirent.h>
#include <pspdisplay.h>
#include "graphics.h"
#include "flib.h"
#include "sdlext.h"
Code: Select all
int
Intro()
{
initGraphics();
if(!load_font("times.ttf")) // load "times new roman" font
{
printf ("Could not load font file.\n");
return 1;
}
clearScreen(0);
set_font_color(0xff00ffff); // green
set_font_size(24); // 16 point
text_to_screen("PSP-Sidplayer", 0, 0);
sceDisplayWaitVblankStart();
flipScreen();
return(0);
}
HELP :-)
--Holger