i tried VSH Blitter today but i got a stack of errors when trying to compile, maybe its my SDK(hasnt been updated in a while) and im using Win32 environment(shouldnt make a difference right?)
Printable View
i tried VSH Blitter today but i got a stack of errors when trying to compile, maybe its my SDK(hasnt been updated in a while) and im using Win32 environment(shouldnt make a difference right?)
Hi, I've complied it with win32 and *nix, and got it right. I got some error at the begining, 'cause I didn't have some of the required libs.Zitat:
Zitat von Xsjado7
Read the errors, and you'll find that all it's missing are the libs, like libpng etc....
Or else, just post the error here and I can look at it for ya.
Cheers
Seems im missing pspmath.h and a few other libs. Cant really be bothered mucking around with this, just thought id try it. im just gonna give up on it and go play some CoD online :p
All righty! But it's actually quite nice to play around with that :)Zitat:
Zitat von Xsjado7
yeah,i guess soZitat:
Zitat von Xsjado7
if not a keyboard, i was thinking of making it to where they pushed up until they got the desired number, then pushed right to go to the next digit.
Which i think I might be able to do with my limited knowledge.
Zitat:
Zitat von Greyone
This tutorial might help.
i've already read those, and i'm almost done with my program just fixing my loops.Zitat:
Zitat von Mirzab14
I have a question,
How would I have it run another PBP when It gets to a certain part.
First it would run EBOOT.PBP then when that's done some stuff it quits EBOOT.PBP and opens START.PBP.(Just an example, it maight not be called START.)
Search google, there are tons of examples. There's even one in this Development forum.Zitat:
Zitat von DJKPSP
What would I put in google because I can't ever find it.
sceKernelLoadExecZitat:
Zitat von DJKPSP
Thanks.
Hi i am pretty new to the psp programming world but i now most of C++. So i am making a conversion program for the psp and just want to know?
How do you let the user input text like the way in C++ you use cin or gets() etc.
note i am using the PSPDev Win32 compiler
Please reply.
Thanks,
Gavin/ITDemo
There isn't a function like that, as the PSP has no keyboard. But, there is the debug keyboard. I'm using Cygwin, so I don't exactly know where it would be on your system, but with Cygwin, the same is underZitat:
Zitat von itdemo
/cygwin/usr/local/pspdev/psp/sdk/samples/debug/debugkb
So if you know where the PSP SDK directory is, you should be able to find it. If not, do a Windows Search for 'debugkb'. You said you know C++, so that sample should be really easy to understand.
thanks for the reply but the debugkb folder was not in the sdk folder so i am going to delete PSPDev Win32 and install Cygwin
Thanks,
Gavin/ITDemo
it should be in pspdev/psp/sdk/samples/debug/debugkbZitat:
Zitat von itdemo
if you need the src i'll post it
awesome, i kinda needed that tooZitat:
Zitat von Judas
Damn i am just after deletin it. Maybe i just didn't full install or somethin like that happend because it was not there. But thanks for the replyZitat:
it should be in pspdev/psp/sdk/samples/debug/debugkb
if you need the src i'll post it
P.S: in the middle of installing Cygwin at the mo anyway.
Thanks,
Gavin/ITDemo
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* debugkb.c - Example of a simple screen debug keyboard
*
* Copyright (c) 2006 Mike Mallett <[email protected]>
*
* $Id: main.c 2110 2006-12-19 14:50:27Z tyranid $
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <pspdebugkb.h>
/* Define the module info section */
PSP_MODULE_INFO("Debug Screen Text Input", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THRE AD_ATTR_USER | THREAD_ATTR_VFPU);
#define printf pspDebugScreenPrintf
#define setXY pspDebugScreenSetXY
#define setTextColor pspDebugScreenSetTextColo r
#define setBackColor pspDebugScreenSetBackColo r
/* Exit callback */
int exit_callback()
{
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback(" Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCall back(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("up date_thread", CallbackThread,
0x11, 0xFA0, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid , 0, 0);
}
return thid;
}
int main(void)
{
SetupCallbacks();
pspDebugScreenInit();
printf ("Debug Screen Text Input Box\n");
printf("Press Left Trigger and Right Trigger to bring up the keyboard.\n");
char str[PSP_DEBUG_KB_MAXLEN];
bzero(str, PSP_DEBUG_KB_MAXLEN);
sceCtrlSetSamplingCycle(0 );
sceCtrlSetSamplingMode(PS P_CTRL_MODE_DIGITAL);
SceCtrlData input;
while (1) {
sceCtrlReadBufferPositive (&input, 1);
if (input.Buttons & PSP_CTRL_LTRIGGER && input.Buttons & PSP_CTRL_RTRIGGER) {
pspDebugKbInit(str);
setTextColor(0xffffffff);
setBackColor(0x00000000);
setXY(0, 3);
printf("str = \"%s\"", str);
setXY(0, 4);
printf("str is %d characters long", strlen(str));
}
}
sceKernelSleepThread();
sceKernelExitGame();
return 0;
}
I am making a simple multi tool and need help.
this program recognizes only the triangle circle and cross buttons.
Code:
#include <pspdebug.h>
#include <pspkernel.h>
#include <pspctrl.h>
#define printf pspDebugScreenPrintf
PSP_MODULE_INFO("Button Input",0,1,1);
void Test_buttons();
int main() {
pspDebugScreenInit();
pspDebugScreenClear();
SceCtrlData pad;
printf("Shadowwolf124's PSP Multi-Tool \nVersion 0.1\n\n");
printf("(X) To launch button tester");
while(1) {
sceCtrlPeekBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS) {
pspDebugScreenClear();
Test_buttons();
}
}
return 0;
}
void Test_buttons()
{
SceCtrlData pad;
pspDebugScreenClear();
while(1) {
sceCtrlPeekBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS) {
printf("(X) Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_CIRCLE) {
printf("(O)Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_TRIANGLE)
printf("(^) Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_SQUARE) {
printf("([]) Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_LEFT) {
printf("(LEFT) Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_RIGHT) {
printf("(RIGHT) Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_UP) {
printf("(UP) Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_DOWN) {
printf("(DOWN) Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_LTRIGGER) {
printf("(LEFT BUMPER) Button Is Functional!\n");
}
if(pad.Buttons & PSP_CTRL_RTRIGGER) {
printf("(RIGHT BUMBER) Button Is Functional!\n");
}
}
This is your code without the function call, take a closer look at where your loops are and what is happening inside each of them. Follow the code logic line by line, top to bottom with a pen and paper to work out why it isn't working.
Code:#include <pspdebug.h>
#include <pspkernel.h>
#include <pspctrl.h>
#define printf pspDebugScreenPrintf
PSP_MODULE_INFO("Button Input",0,1,1);
void Test_buttons();
int main()
{
pspDebugScreenInit();
pspDebugScreenClear();
SceCtrlData pad;
printf("Shadowwolf124's PSP Multi-Tool \nVersion 0.1\n\n");
printf("(X) To launch button tester");
while (1)
{
sceCtrlPeekBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_CROSS)
{
pspDebugScreenClear();
SceCtrlData pad;
pspDebugScreenClear();
while (1)
{
sceCtrlPeekBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_CROSS)
{
printf("(X) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_CIRCLE)
{
printf("(O)Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_TRIANGLE)
printf("(^) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_SQUARE)
{
printf("([]) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_LEFT)
{
printf("(LEFT) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_RIGHT)
{
printf("(RIGHT) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_UP)
{
printf("(UP) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_DOWN)
{
printf("(DOWN) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_LTRIGGER)
{
printf("(LEFT BUMPER) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_RTRIGGER)
{
printf("(RIGHT BUMBER) Button Is Functional!\n");
}
}
}
return 0;
}
I now have Cygwin installed with toolchain and it's running perfectly so i will release my app soon :)
Gavin/ITDemo
Wouldnt an easier way beZitat:
Zitat von yaustar
Has a loop to check for when X is pressed then breaks that and goes into the main one. Another thing psp-freak222, you realise you would have to press both X and another button to get the text upCode:#include <pspdebug.h>
#include <pspkernel.h>
#include <pspctrl.h>
#define printf pspDebugScreenPrintf
PSP_MODULE_INFO("Button Input",0,1,1);
void Test_buttons();
int main()
{
pspDebugScreenInit();
pspDebugScreenClear();
SceCtrlData pad;
printf("Shadowwolf124's PSP Multi-Tool \nVersion 0.1\n\n");
printf("(X) To launch button tester");
while (1)
{
sceCtrlPeekBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_CROSS)break;
}
while (1)
{
sceCtrlPeekBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_CROSS)
{
printf("(X) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_CIRCLE)
{
printf("(O)Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_TRIANGLE)
printf("(^) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_SQUARE)
{
printf("([]) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_LEFT)
{
printf("(LEFT) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_RIGHT)
{
printf("(RIGHT) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_UP)
{
printf("(UP) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_DOWN)
{
printf("(DOWN) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_LTRIGGER)
{
printf("(LEFT BUMPER) Button Is Functional!\n");
}
if (pad.Buttons & PSP_CTRL_RTRIGGER)
{
printf("(RIGHT BUMBER) Button Is Functional!\n");
}
}
return 0;
}
Zitat:
Zitat von yaustar
As another hint, after the great yaustar indentation service, I'll post just this part of the code:
Take a close look in here.Code:}
if (pad.Buttons & PSP_CTRL_TRIANGLE)
printf("(^) Button Is Functional!\n");
}
Cheers
Hi guys i am having trouble compiling my conversion app. The is the code
Please tell me what i did wrong as i can't find out. Also i am not sure if my Makefile is ok but here it is too.Code:/*
This is a simple but long conversion program. Made By Gavin Pacini age 11 on the 02 and 03 of Febuary 2008
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <pspdebugkb.h>
/* Define the module info section */
PSP_MODULE_INFO("CONTROLTEST", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
#define cout pspDebugScreenPrintf
#define setTextColor pspDebugScreenSetTextColor
#define setBackColor pspDebugScreenSetBackColor
void dump_threadstatus(void);
int done = 0;
/* Exit callback */
int exit_callback()
{
sceKernelExitGame();
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;
}
SceCtrlData pad, input, inside;
char all[PSP_DEBUG_KB_MAXLEN];
bzero(all, PSP_DEBUG_KB_MAXLEN);
int main()
{
pspDebugScreenInit();
SetupCallbacks();
pspDebugScreenSetXY(0, 2);
sceCtrlReadBufferPositive(&input, 1);
while (1) {
if (input.Buttons & PSP_CTRL_LTRIGGER && input.Buttons & PSP_CTRL_RTRIGGER) {
pspDebugKbInit(all);
setTextColor(0xffffffff);
setBackColor(0x00000000);
}
cout("Hello and welcome to my easy conversion table, made by Gavin Pacini.\n"); // Welcome to program
cout("Keyboard input taken from PSPDev Samples.\n");
cout("To start please press a button that matches your category.\n");
cout("Note during any time to bring up the keyboard just press the L and R Triggers together\n");
cout("Press:\n X for money,\n [] for liquid,\n O for distance.\n"); // Start of table
while(1) {
sceCtrlReadBufferPositive(&pad, 1);
sceCtrlReadBufferPositive(&inside, 1);
if(pad.Buttons & PSP_CTRL_CROSS) {
// start of money table
cout("Now what kind of currency do you want?\n");
cout("Press:\n X for euro to dollar,\n [] for euro to sterling,\n O for dollar to sterling,\n /_\ for dollar to euro,\n R for sterling to euro,\n L for sterling to dollar.\n"); // ask for money table
double d1, s1, s2, e1, e2, d2;
if(inside.Buttons & PSP_CTRL_CROSS) {
//euro to dollar using $1
cout("Please enter an amount of euros.\n");
d1 = all * 1.47;
cout ("\nDollars: " ,all "\n");
}
if (inside.Buttons & PSP_CTRL_SQUARE) {
//euro to sterling using £1
cout ("Please enter an amount of euros.\n");
s1 = all * .74;
cout ("\nSterling: ", s1 "\n");
}
if (inside.Buttons & PSP_CTRL_CIRCLE) {
//dollar to sterling using £2
cout("Please enter an amount of dollars.\n");
s2 = all * .504;
cout ("\nSterling: ", s2 "\n");
}
if (inside.Buttons & PSP_CTRL_TRIANGLE) {
//dollar to euro using €1
cout("Please enter an amount of dollars.\n");
e1 = all / 1.47;
cout("\nEuros: ", e1 "\n");
}
if (inside.Buttons & PSP_CTRL_RTRIGGER) {
//sterling to euro using €2
cout("Please enter an amount of sterling.\n");
e2 = all * 1.34;
cout("\nEuro: ", e2 "\n");
}
if (inside.Buttons & PSP_CTRL_LTRIGGER) {
// sterling to dollar using $2
cout("Please enter an amount of sterling.\n");
d2 = all / 1.98;
cout("\nDollars: ", d2 "\n");
}
}
// End of money Table
if (pad.Buttons & PSP_CTRL_SQUARE) {
// Start of liquid Table
cout("Now what kind of liquid do you want?\n");
cout("Press:\n X for gallons to litres,\n [] for gallons to pints,\n O for litres to gallons,\n /_\ for litres to pints,\n R for pints to litres,\n L for pints to gallons.\n"); //asks for liquid table
double l1, p1, g1, p2, l2, g2;
if (inside.Buttons & PSP_CTRL_CROSS) {
//gallons to litres using l1 (note not the number eleven the letter l then num 1)
cout("Please enter an amount of gallons.\n");
l1 = all * 3.7854;
cout("\nLitres: ", l1 "\n");
}
if (inside.Buttons & PSP_CTRL_SQUARE) {
//gallons to pints using p1
cout("Please enter an amount of gallons.\n");
p1 = all * 8;
cout("\nPints: ", p1 "\n");
}
if (inside.Buttons & PSP_CTRL_CIRCLE) {
//litres to gallons using g1
cout("Please enter an amount of litres.\n");
g1 = all / 3.7854;
cout("\nGallons: ", g1 "\n");
}
if (inside.Buttons & PSP_CTRL_TRIANGLE) {
//litres to pints using p2
cout("Please enter an amount of litres.\n");
p2 = all / .454;
cout("\nPints: ", p2 "\n");
}
if (inside.Buttons & PSP_CTRL_RTRIGGER) {
//pints to litres using l2 (note not the number twelve the letter l then num 2)
cout("Please enter an amount of pints.\n");
l2 = all * .454;
cout("\nLitres: ", l2 "\n");
}
if (inside.Buttons & PSP_CTRL_LTRIGGER) {
//pints to gallons using g2
cout("Please enter an amount of pints.\n");
g2 = all / 8;
cout("\nGallons: ", g2 "\n");
}
}
//End of liquid table
if (pad.Buttons & PSP_CTRL_CIRCLE) {
//Start of distance table
cout("Now what distance do you want?\n");
cout("Press:\n X for Miles to Km,\n [] for Km to Miles.\n");
double k1, m1;
if (inside.Buttons & PSP_CTRL_CROSS) {
// Miles to Kilmetres using k1
cout("Please enter an amount of miles.\n");
k1 = all / .625;
cout("\nKilometres: ", k1 "\n");
}
if (inside.Buttons & PSP_CTRL_SQUARE) {
// Kilometers to Miles using m1
cout("Please enter an amount of kilometres.\n");
m1 = all * .625;
cout("\nMiles: ", m1 "\n");
}
}
}
}
sceKernelSleepThread();
sceKernelExitGame();
return 0;
}
I am running Cygwin.Code:TARGET = converter
OBJS = main.cpp
LIBS = -lpspdebugkb
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspnand_driver
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Easy Converter
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Thanks,
Gavin/ITDemo :)
Zitat:
Zitat von itdemo
Gavin, it's all wrong mate. What are you thinking when you use cout? Have you ever bothered about reading the PSP Programming manuals?
Try that, and then you come back here.
I found something like 5 flaws on you code, which are very basic stuff, but you can't see that 'cause you're trying to "assemble the bike" without reading it's manual.
Cheers
Why, WHY? This is a huge no-no. cout in the C++ standard library is a global object. By #defining it out, you have lost the functionality of that object and makes your code that much harder to read as shown by the poster above who really thought you were using cout to print to the TTY.Code:#define cout pspDebugScreenPrintf
If you are going to use pspDebugScreenPrintf then call the fucntion by the correct name which is pspDebugScreenPrintf.
-= Double Post =-
This is immediately wrong, you have one while loop going straight into another without initialising the keyboard unless the player was holding down L and R while starting the program. If they don't, then the keyboard is uninitialised.Code:while (1)
{
if (input.Buttons & PSP_CTRL_LTRIGGER && input.Buttons & PSP_CTRL_RTRIGGER)
{
pspDebugKbInit(all);
setTextColor(0xffffffff);
setBackColor(0x00000000);
}
cout("Hello and welcome to my easy conversion table, made by Gavin Pacini.\n"); // Welcome to program
cout("Keyboard input taken from PSPDev Samples.\n");
cout("To start please press a button that matches your category.\n");
cout("Note during any time to bring up the keyboard just press the L and R Triggers together\n");
cout("Press:\n X for money,\n [] for liquid,\n O for distance.\n"); // Start of table
while (1)
{
If you can't compile it, then at least tell us what the errors are. How advanced is your knowledge on C++ as you said you know 'most' of it.
I have another question,
How would I put video?
I'm making a windows app that selects what theme you want (3.71 themes) then copies the flash installer with the theme you picked anyways I'm building a test app to see if i got flash access and it doesn't I'm pretty sure its the kernal part but don't know how to fix it heres my code
Code:#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspnand_driver.h>
#include <pspiofilemgr.h>
#include <stdio.h>
#include <psppower.h>
PSP_MODULE_INFO("Test", 0x1000, 1, 1);
#define printf pspDebugScreenPrintf
int fd;
int fe;
// ========================================================= CALLBACKS
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
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() {
// SetupCallbacks(); //dissable callbacks
pspDebugScreenInit();
//open topmenu plugin
fd = sceIoOpen("flash0:/vsh/resource/topmenu_plugin.rco", PSP_O_RDONLY, 0777);
//Define text color
pspDebugScreenSetTextColor(0xFF);
if(fd < 0) {
sceIoClose(fd);
printf("Internal Error");
} else {
printf("Removing flash0:/vsh/resource/topmenu_plugin.rco..\n");
sceIoRemove("flash0:/vsh/resource/topmenu_plugin.rco");
printf("Complete\n");
sceIoClose(fd);
}
//check if file is still their
fe = sceIoOpen("flash0:/vsh/resource/topmenu_plugin.rco", PSP_O_RDONLY, 0);
if (fe < 0) {
printf("Your psp is now bricked\n");
printf(":)\n");
sceIoClose(fe);
}
else {
printf("Failed\n");
sceIoClose(fe);
}
sceKernelDelayThread(7000000);
sceKernelExitGame();
return 0;
}
Seriously people, there is a spoiler button, use that. Also, please don't quote a guy's post if he has huge code in it, just quote his message only or the post number. Half this page is just quoting a guy's code.
You might want to add a pause to it before printing complete, so the person can know what the program was doing.Zitat:
Zitat von pspfreak101
This is only a test app to see if i can get the flash0 access okZitat:
Zitat von TMNT
I've been trying to compile some of the leaked Wildcard/OE stuff. I tried compiling the recovery menu and I get his error:
Code:make: /bin/sh: Command not found
make: *** [exports.c] Error 127
Hi, this afternoon, I wanted to do some little tests, so I tried compiling a piece of code I made about the idstorage informations.
Didn't comile.
So I tried to compile the pspsdk idstorage sample, doesn't work, I get an error:
Thought it would be easy to repair, and I added the '-lpspidstorage' lib in the makefile, but now, I get an error, the compiler could not find the specified lib.Zitat:
undefined reference to sceIdstorageLookup
I checked, and this lib doesn't seem to exist...
So how can I compile that pspsdk idstorage sample?
Anyone knows?
I'm not the onlyone having that problem, and nobody seems to know what's its origin...
Thanks for any reply.
Capital 'S'.
sceIdStorageLookup
Ok Guys thanks for the replys and here comes the questions,Zitat:
Zitat von yaustar
first of all i said i now most of C++ but that doesn't mean I know all the PSP-Programming language
second how do i initialize the keyboard at the start
third the reason i have cout is 1 because i am more use to it and did not think by defining it there would be any problems 2 i already had made the program to run on a P.C but then decided to port it to PSP so insted of replacing all the cout's i just defined it.
fourth my knowledge is standerd stuff eg. #include... cout <<..... then lots of loop's and lots of other stuff i can't think of.
i have also decided about that two while loops what i will do is just put the keyboard loop before anything that needs you to input text
@placo23 I will look through my code more and see if i can spot the probs.
oh yeah and is my Mkaefile ok as i am not to good on making them.
Thanks Everyone,
Gavin/ITDemo
How do I quit it?
With the triangle button.
can someone tell me what i'm doing wrong in my code
No, but it should mean that you know how to program and structure your code properly despite the platform or libraries you are using. The fact you do something like #defining cout to be something else implies that you don't.Zitat:
first of all i said i now most of C++ but that doesn't mean I know all the PSP-Programming language
To be honest, pspDebugKbInit is a bad function as it doesn't really initialise the keyboard but brings it up on the screen for you to 'type' in so technically, you don't initialise the keyboard at the start but you do need to initialise the char buffer that you pass it.Zitat:
second how do i initialize the keyboard at the start
cout is a global object in the C++ standard libraries. It uses operator overloads to format the output rather then C Style var_args. The fact that you had to change all your code that does:Zitat:
third the reason i have cout is 1 because i am more use to it and did not think by defining it there would be any problems 2 i already had made the program to run on a P.C but then decided to port it to PSP so insted of replacing all the cout's i just defined it.
To:Code:cout << "This is variable A: " << varA << " and " << varB;
Means that you could have easily done:Code:cout( "This is variable A: %d and %d", varA, varB );
Code:pspDebugScreenPrintf( "This is variable A: %d and %d", varA, varB );
'Most' of C++ is a lot. I have been using it for the past 4 years (IIRC) and I wouldn't be so quick to say that I know most of C++. The fact your loop logic is wrong implies that your knowledge isn't as complete as you thought it was.Zitat:
fourth my knowledge is standerd stuff eg. #include... cout <<..... then lots of loop's and lots of other stuff i can't think of.
Note that you tell the user that to bring up the keyboard you press L and R together and then enter into your second infinite loop which doesn't contain the logic to bring up the keyboard.Code:while (1)
{
if (input.Buttons & PSP_CTRL_LTRIGGER && input.Buttons & PSP_CTRL_RTRIGGER)
{
pspDebugKbInit(all);
setTextColor(0xffffffff);
setBackColor(0x00000000);
}
cout("Hello and welcome to my easy conversion table, made by Gavin Pacini.\n"); // Welcome to program
cout("Keyboard input taken from PSPDev Samples.\n");
cout("To start please press a button that matches your category.\n");
cout("Note during any time to bring up the keyboard just press the L and R Triggers together\n");
cout("Press:\n X for money,\n [] for liquid,\n O for distance.\n"); // Start of table
while (1)
{
Thanks yaustar,
Em just some more small stuff before the release and i have realized that i don't know as much C++ as i thought so i will go more into it.
i have replaced all the "cout's" with pspDebugScreenPrintf's.
I have deleted the while loop at the start and put the keyboard function in the other while loop. (is this ok?)
Not to be noobish but how do i initialize the char buffer.,
I am sorry for all these questions and promise after the release i will finish my C++ book.
Also please reply about my makefile... ( coudn't get the spoiler tag to work )
TARGET = converter
OBJS = main.cpp
LIBS = -lpspdebugkb
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspnand_driver
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Easy Converter
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Thanks,
Gavin/ITDemo :)
Good. I would also argue that your other #defines for short function names should be changed as well but that is less of an issue since they don't exist as something else.Zitat:
Zitat von itdemo
AFAI can tell, calling the keyboard function whenever you ask for input (e.g. cin) seems to be the right thing to do.Zitat:
I have deleted the while loop at the start and put the keyboard function in the other while loop. (is this ok?)
Zitat:
Not to be noobish but how do i initialize the char buffer.,
Code:char all[PSP_DEBUG_KB_MAXLEN] = "";
What book are you reading?Zitat:
I am sorry for all these questions and promise after the release i will finish my C++ book.