Danzeff integration

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Danzeff integration

Post by kasikeeper »

Hi,

I want to use the danzeff keyboard in my homebrew. I included the danzeff.h and I added the danzeff.o in the makefile. I tried to compile without any additional commands first to check if the integration was successful but my code does not even compile at this stage. The following errors appear. Can anyone help me?

> "make"
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o main.o main.c
In file included from /cygdrive/c/pspdev/bin/../lib/gcc/psp/4.0.2/../../../../psp/include/SDL/SDL_main.h:26,
from /cygdrive/c/pspdev/bin/../lib/gcc/psp/4.0.2/../../../../psp/include/SDL/SDL.h:28,
from pspctrl_emu.h:4,
from danzeff.h:15,
from main.c:20:
/cygdrive/c/pspdev/bin/../lib/gcc/psp/4.0.2/../../../../psp/include/SDL/SDL_stdinc.h(61) : column 22 : error: strings.h: No such file or directory
In file included from danzeff.h:15,
from main.c:20:
pspctrl_emu.h(23) : error: nested redefinition of 'enum PspCtrlButtons'
pspctrl_emu.h(23) : error: redeclaration of 'enum PspCtrlButtons'
pspctrl_emu.h(25) : error: redeclaration of enumerator 'PSP_CTRL_SELECT'
C:/pspdev/psp/sdk/include/pspctrl.h(37) : error: previous definition of 'PSP_CTRL_SELECT' was here
pspctrl_emu.h(27) : error: redeclaration of enumerator 'PSP_CTRL_START'
C:/pspdev/psp/sdk/include/pspctrl.h(39) : error: previous definition of 'PSP_CTRL_START' was here
pspctrl_emu.h(29) : error: redeclaration of enumerator 'PSP_CTRL_UP'
C:/pspdev/psp/sdk/include/pspctrl.h(41) : error: previous definition of 'PSP_CTRL_UP' was here
pspctrl_emu.h(31) : error: redeclaration of enumerator 'PSP_CTRL_RIGHT'
C:/pspdev/psp/sdk/include/pspctrl.h(43) : error: previous definition of 'PSP_CTRL_RIGHT' was here
pspctrl_emu.h(33) : error: redeclaration of enumerator 'PSP_CTRL_DOWN'
C:/pspdev/psp/sdk/include/pspctrl.h(45) : error: previous definition of 'PSP_CTRL_DOWN' was here
pspctrl_emu.h(35) : error: redeclaration of enumerator 'PSP_CTRL_LEFT'
C:/pspdev/psp/sdk/include/pspctrl.h(47) : error: previous definition of 'PSP_CTRL_LEFT' was here
pspctrl_emu.h(37) : error: redeclaration of enumerator 'PSP_CTRL_LTRIGGER'
C:/pspdev/psp/sdk/include/pspctrl.h(49) : error: previous definition of 'PSP_CTRL_LTRIGGER' was here
pspctrl_emu.h(39) : error: redeclaration of enumerator 'PSP_CTRL_RTRIGGER'
C:/pspdev/psp/sdk/include/pspctrl.h(51) : error: previous definition of 'PSP_CTRL_RTRIGGER' was here
pspctrl_emu.h(41) : error: redeclaration of enumerator 'PSP_CTRL_TRIANGLE'
C:/pspdev/psp/sdk/include/pspctrl.h(53) : error: previous definition of 'PSP_CTRL_TRIANGLE' was here
pspctrl_emu.h(43) : error: redeclaration of enumerator 'PSP_CTRL_CIRCLE'
C:/pspdev/psp/sdk/include/pspctrl.h(55) : error: previous definition of 'PSP_CTRL_CIRCLE' was here
pspctrl_emu.h(45) : error: redeclaration of enumerator 'PSP_CTRL_CROSS'
C:/pspdev/psp/sdk/include/pspctrl.h(57) : error: previous definition of 'PSP_CTRL_CROSS' was here
pspctrl_emu.h(47) : error: redeclaration of enumerator 'PSP_CTRL_SQUARE'
C:/pspdev/psp/sdk/include/pspctrl.h(59) : error: previous definition of 'PSP_CTRL_SQUARE' was here
pspctrl_emu.h(49) : error: redeclaration of enumerator 'PSP_CTRL_HOME'
C:/pspdev/psp/sdk/include/pspctrl.h(61) : error: previous definition of 'PSP_CTRL_HOME' was here
pspctrl_emu.h(51) : error: redeclaration of enumerator 'PSP_CTRL_HOLD'
C:/pspdev/psp/sdk/include/pspctrl.h(63) : error: previous definition of 'PSP_CTRL_HOLD' was here
pspctrl_emu.h(53) : error: redeclaration of enumerator 'PSP_CTRL_NOTE'
C:/pspdev/psp/sdk/include/pspctrl.h(65) : error: previous definition of 'PSP_CTRL_NOTE' was here
pspctrl_emu.h(57) : error: redefinition of 'struct SceCtrlData'
pspctrl_emu.h(68) : error: redefinition of typedef 'SceCtrlData'
C:/pspdev/psp/sdk/include/pspctrl.h(89) : error: previous declaration of 'SceCtrlData' was here
In file included from main.c:20:
danzeff.h(58) : column 27 : error: SDL/SDL_image.h: No such file or directory
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Just fix the errors mentioned in the listing. If you can't fix a redefinition of a symbol when you are given the file and line number, you aren't ready to be programming, much less programming the PSP.
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

Ok, maybe I am not ready yet but I want to learn. Can you tell me how to fix a redefinition of a symbol?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Look at where the error message says the redefinition occurs, go to that line, and put // at the start to make it a comment. Repeat.
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

Ok, that was easy. I was not aware that I just have to comment the enumerations out.

The only remaining errors are:

/cygdrive/c/pspdev/bin/../lib/gcc/psp/4.0.2/../../../../psp/include/SDL/SDL_stdinc.h(61) : column 22 : error: strings.h: No such file or directory
In file included from main.c:20:
danzeff.h(58) : column 27 : error: SDL/SDL_image.h: No such file or directory

The missing header files are not part of my pspdev installation. I used the PSPDevLibInstall tool to get the required libs but probably that is not enough. Can you help me one more time?

By the way, where can I find the most current version of the danzeff OSK???

Thanks a lot!!!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

SDL_image is built and installed by the psplibraries toolchain.

Code: Select all

svn co svn://svn.ps2dev.org/psp/trunk/psplibraries
cd psplibraries
./libraries.sh
That builds most of the major libraries people use when doing PSP projects. Libs like ogg, mp3, SDL (and related SDL sub-libs), freetype, etc.

Note - if you haven't chown'd your pspdev directory to your user, you either need to run libraries.sh in root mode, or run the libraries-sudo.sh script instead. Otherwise, it won't be able to install the libs and their includes.
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

Hi again,

I just doen't seem to get forward. I managed to include danzeff without problems but when I try to load danzeff I get the error:

main.c:(.text+0xa58): undefined reference to `danzeff_load'


Can you help????




> "make"
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o main.o main.c
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o danzeff.o danzeff.c
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o graphics.o graphics.c
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o framebuffer.o framebuffer.c
psp-gcc -I. -IC:/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -LC:/pspdev/psp/sdk/lib main.o danzeff.o graphics.o framebuffer.o -lpspgu -lpng -lz -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o main.elf
main.o: In function `evententrycontrol':
main.c:(.text+0xa58): undefined reference to `danzeff_load'
collect2: ld returned 1 exit status
"make": *** [main.elf] Error 1

> Process Exit Code: 2
> Time Taken: 00:04

Can you help?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Well, either you got a bad copy of the danzeff files, or you edited that part out by accident. Here's the latest copy of the danzeff files I have.

http://www.mediafire.com/?61rbziyjt3y
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

Thanks a lot for the download link. I had the same errors however. I managed to ged rid of the error by putting a void before danzeff_load(). I can compile without problems now but the keyboard is not displayed. My current code snippet now looks like

#include "danzeff.h"
#include "graphics.h"

...

void danzeff_load();
if (!(danzeff_isinitialized())) printf("ERROR");
void danzeff_render();

flipScreen();


I guess I have not to initialize any further graphics as i use the graphics.h (from the psp-programming.com tutorial) which does the job already. The danzeff_isinitialized() however returns false but I don't know how to get forward now.

Sorry for bothering you all the time. I feel a little embarassed about asking so many questions already...
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Sticking "void" in front of the calls is just changing them from function calls into function prototypes. Get rid of the voids and do it properly. I suspect you don't understand C enough yet to be doing whatever you're trying to do. You either need to post a lot more of you code or take some more C classes.
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

OK, I am getting closer. I set up a new development environment and the library errors seem to be gone. I am using the newest danzeff sources found at

https://svn.sourceforge.net/svnroot/psp ... ib/danzeff

and I use GU as the rendering machine. I did not add any extra GU setup commands because I use graphics.h (downloaded from the psp-programming tutorials) and the graphic init commands there already set up GU.

My current code besides the #include "danzeff.h" is:

....

danzeff_load();

while(!done)
{
if(danzeff_dirty())
{
danzeff_render();
flipScreen();
}
.
.
.
}

The code compiles without errors. danzeff_initialized returns true which is good but the OSK is not displayed. I guess there is something wrong with the GU setup.But I haven't got a clue about GU. Does someone know if the graphics.h is actualy appropriate for this? Which modifications would I have to perform with the standard graphics.h for psp in order to use it for danzeff?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

EDIT: I see you did mention danzeff_isinitialized() (sort of). I would guess at this point that the GU isn't setup correctly. You're not giving us enough to really make any real suggestions. You might look at how SNES9x uses danzeff.
Post Reply