[SOLVED] Help with danzeff osk

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

Moderators: cheriff, TyRaNiD

Post Reply
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

[SOLVED] Help with danzeff osk

Post by ne0h »

I've read akll the post in this forum about this argument but there isn't a completely answer, i'haven't find a example for the danzeff osk function,
there is only a readme!
My question is:
How to load the osk and write to screen the caracter pressed?
Last edited by ne0h on Tue Apr 29, 2008 11:22 pm, edited 1 time in total.
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

I've writed this code, but nothing appear on the screen!

Code: Select all

#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <pspgum.h>
#include <callbacks.h>
#include <pspaudio.h>
#include <SDL/SDL.h>
#include <pspsdk.h> 
#include "danzeff.h"

PSP_MODULE_INFO&#40;"ajkfadfjk", 0, 1, 1&#41;;



#define printf pspDebugScreenPrintf


int main&#40;&#41;
&#123;
     SetupCallbacks&#40;&#41;;
     pspDebugScreenInit&#40;&#41;;
     int n;
     SceCtrlData pspctrl;
     void danzeff_load&#40;&#41;;
     printf&#40;"Inizio"&#41;;
     while&#40;1&#41;&#123;
              danzeff_dirty&#40;&#41;;
              n = danzeff_readInput&#40;pspctrl&#41;;
              printf&#40;"%c",n&#41;;
              void danzeff_render&#40;&#41;;
              &#125;
     sceKernelSleepThread&#40;&#41;;
&#125;
Makefile

Code: Select all

TARGET = file
OBJS = main.o danzeff.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LIBS = -lpspgu -lpspgum -lpsppower -lpng -lz -lm -lsdl  -lz -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lpsplibc -lpsputility -lpspuser -lpspkernel -lpsphprm_driver
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Background Changer

include $&#40;PSPSDK&#41;/lib/build.mak
Why?
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Where i can find a example to use the sony built-in osk?
pspZorba
Posts: 156
Joined: Sat Sep 22, 2007 11:45 am
Location: NY

Post by pspZorba »

For PSPlorer I wrote a simple class to use the sony virtual key board have a look in the sources.
Or I wrote a sample that you can download it here

If you can read French there are more explanations here
--pspZorba--
NO to K1.5 !
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

pspZorba wrote:For PSPlorer I wrote a simple class to use the sony virtual key board have a look in the sources.
Or I wrote a sample that you can download it here

If you can read French there are more explanations here
You should translate your pages into english...They seem to be good....
Ciao! from Italy
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

I'm writing my programm in C, not C++ and when i try to compile i've a error.
So i try to modify the src and write a my C function...
If is possible has anyone this simple function in C?
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

or can i make a prx to load with arg?
Arg1=already putted text in the key board
return=final text in the key board

Excuse me for my english! :(
pspZorba
Posts: 156
Joined: Sat Sep 22, 2007 11:45 am
Location: NY

Post by pspZorba »

thx phobox,

Yes I have been asked to translate them, it's on the way ..
--pspZorba--
NO to K1.5 !
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

ne0h wrote:I've writed this code, but nothing appear on the screen!

Code: Select all

     void danzeff_load&#40;&#41;;
     printf&#40;"Inizio"&#41;;
     while&#40;1&#41;&#123;
              danzeff_dirty&#40;&#41;;
              n = danzeff_readInput&#40;pspctrl&#41;;
              printf&#40;"%c",n&#41;;
              void danzeff_render&#40;&#41;;
              &#125;
Why?
Because you're not calling danzeff_load or danzeff_render, you're declaring prototypes.
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

if i put danzeff_load(); i've have a error:
undeclared reference to danzeff_load();
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Because you didn't #include the danzeff include files, and/or you didn't link with the danzeff library.
By adding 'void' you've removed the calls entirely!
Jim
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

AAAAAAAAAAARRRRRRRGHHHHHHHHHH LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C!!!!!!!!!!!!!!!!!!!!!!!!!!!! damn #*?!_;à
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

jean wrote:AAAAAAAAAAARRRRRRRGHHHHHHHHHH LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C,LEARN C!!!!!!!!!!!!!!!!!!!!!!!!!!!! damn #*?!_;à
Don't hold back - tell us how you really feel. :)

ne0h: if you don't know the difference between "void do_something();" and "do_something()", you probably need a few more lessons in C before trying to do your own PSP program. Not an insult, just a recognition of general ability. Programming the PSP requires you to be proficient in C and maybe C++. You don't seem to have the proper proficiency yet.
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

See the makefile and the src, i've included "danzeff.h" library and linked danzeff.c (danzeff.o) but the compiler don't find the declaration of danzeff_load, i've writed void danzeff_load(); to jump over this function and see what appen!
The daclaration of danzeff_load(); is in the danzeff.h and danzeff.c library, why the compiler don't find the declaration?
This error i only for this function:
danzeff_load();
danzeff_render();

another function works perfectly! (danzeff_dirty(); works perfectly!!! )

Can anyone give me an example to load the osk?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Doom for the PSP uses the OSK.

http://groups.google.com/group/chilly-w ... -psp?hl=en

You'll note that it does two waits on the vblank in the OSK loop - the OSK is "twitchy" if you call it at 60 Hz. It feels MUCH better at 30 Hz. It's something I keep mentioning to sakya about his interface on LightMP3, but he hasn't changed it yet. ;) :)
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Thanks,
excuse me but piKey0.4 is a osk, isn't it?
Can i use it?
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

I've the function in C++ for load the built-in osk, i've compiled the eboot correctly, but i can not integrate this function in my code because i'm writing my prog in C, i've think to build a prx that can load with arg (the already present text) and return the value of the string writed;
I've writed an example:

Code: Select all

//--- various include
#define printf pspDebugScreenPrintf
#define RGB&#40;r, g, b&#41; &#40;&#40;r&#41;|&#40;&#40;g&#41;<<8&#41;|&#40;&#40;b&#41;<<16&#41;&#41;

PSP_MODULE_INFO&#40;"PSP_Explorer", 0, 1, 1&#41;;

char main&#40;char* argc, char **argv&#91;&#93;&#41;
&#123;

	pspDebugScreenInit&#40;&#41;;
        printf&#40;"%s", argv&#91;1&#93;&#41;;
        char returnstring&#91;128&#93;="String returned";
    return returnstring;
&#125;
And load the PRX with sceKernelLoadStartModuleWithArgs(1, "String args");
but how to capture the return of the main function in the prx?
Is possible to do what i've writed?
Excuse me is this function in not correctly but i didn't know good the function to load a prx etc...
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

ne0h wrote:Thanks,
excuse me but piKey0.4 is a osk, isn't it?
Can i use it?
Pikey is NOT an OSK - rather, it is a plugin that lurks in the background until you try to use the Sony OSK, then it generates fake button inputs when you type on an IR keyboard to simulate the user using the dpad/buttons to select the corresponding letters in the OSK. When in a game or app, certain keys can also be used to simulate pressing the dpad, buttons, or analog stick, allowing one to control the app via the IR keyboard.
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

Thanks!
everlasting
Posts: 41
Joined: Mon Mar 19, 2007 6:27 pm

Post by everlasting »

Correct if i am wrong, i made a program with the danzeff osk like a year ago so i could be wrong. Apart from the void stuff you haven't even started the graphic interface with gustart as the readme of the danzeff says you have to.
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

I have already do this, but the compiler can't find the danzeff_load(); funct...
However i'm writing a new osk for my programm, thanks!
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Because you've still not linked the danzeff lib. I can't wait to see what you come up with.

Jim
Post Reply