Nope, that won't run. IIRC, sceKernelLoadExec() doesn't even take a path as a parameter.Zitat:
Zitat von AdjutantReflex
Printable View
Nope, that won't run. IIRC, sceKernelLoadExec() doesn't even take a path as a parameter.Zitat:
Zitat von AdjutantReflex
Are you sure, because it worked in a simple test program i did.Zitat:
Zitat von FistPump
And in the header file it states:
Look here. You need to pass a struct to the second param, not null.
-= Double Post =-
Something like this, I would say:
Code:int plEbootLoad(char* pathToPbp)
{
if(strlen(pathToPbp) <= 0)
{
printf("Must pass the location of the PBP file.\n");
return 0;
}
struct SceKernelLoadExecVSHParam pbpParam;
memset(&pbpParam, 0, sizeof(pbpParam));
pbpParam.size = sizeof(pbpParam);
pbpParam.args = (strlen(pathToPbp) + 1);
pbpParam.argp = pathToPbp;
pbpParam.key = "game";
if(sceKernelLoadExec(pathToPbp, &pbpParam) < 0)
{
return 0;
}
return 1;
}
What does "nan" mean in floats?
Not A Number.Zitat:
Zitat von Mr305
http://en.wikipedia.org/wiki/NaN
Ok i got it, i will do it.
Hmmm... for some reason my code that i ported isn't working at all...
Nothing is displayed.
Here are the files:
http://mihd.net/09qzvw
The main.c:
The makefileCode:#include <pspdisplay.h>
#include <stdlib.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include <time.h>
#include <psppower.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include "graphics.h"
#define true 1
#define false 0
PSP_MODULE_INFO("BallBounce Test", 0, 1, 1);
/* 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;
}
char *path[2] = { "BGimage.png", //0
"Ball.png"}; //1
int main()
{
SetupCallbacks();
pspDebugScreenInit();
initGraphics();
int x = 0;
int y = 0;
Image* images[2];
int i;
for(i = 0; i < 2; i++)
{
images[i] = loadImage(path[i]);
}
while(1)
{
blitAlphaImageToScreen(0 ,0 ,32 , 32, images[1], x, y);
blitAlphaImageToScreen(0 ,0 ,480 , 272, images[0], 0, 0);
sceDisplayWaitVblankStart();
flipScreen();
}
sceKernelSleepThread();
return 0;
}
Code:TARGET = BouncingBallDemo
OBJS = main.o graphics.o framebuffer.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lpsprtc -lmad -lpspaudiolib -lpspaudio -lpsppower
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Bouncing Ball Demo
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
I'm having a problem again loading modules :Argh:
Using the pspSdkLoadStartModule, I sometimes load the modules fine, and other times... well I get an error message, and 0x44088000 as the error code.
I can load perfectly in 3.10, but when trying to run this in 1.50, I seem to get that error code a lot.
I've tried looking through and finding what exactly is causing the error, but to no avail, its not based on the loading code, because the exact same code can load another module perfectly, and the modules that won't work sometimes work when loaded from elsewhere...
Thanks for any help
-Aura
Long time, no see!Zitat:
Zitat von Nicko01
lol.... I took a break from programming a few months to play WoW.
I'm not sure why this always happens, but for some reason my stupid screen never is displayed.
D'oh.Zitat:
Zitat von Nicko01
what? dont like World of Warcraft?
Well, you can say I'm wow-o-phobic. :P But, hey, we go back a long way, so whatever.
http://hackerelite.proboards79.com :P Idiots United...
You were on idiots united???
What was your name?
It's PSPJunkie :P
:) I should have known because of the NY Giants thing.
Well, lets get back on topic...
Can you see a problem?
Did you run it through PSPLink?
no
Got it!
'BGimage.png' is not actually a PNG file. If you ran it through PSPLink, you would see that libpng throws out an error (You don't notice it because it is with printf which doesn't go the PSPs screen). Rename 'BGimage.png' to 'BGimage.bmp' and resave it as a PNG in you preferred image editing program.
That's it :P
Although, just so you know, you blit the ball first, so the background in front of it and you will never see it. :P
http://jparishy.com/yay.bmp
EDIT: I attached the converted image.
oh cool.
thanks.
well, when i converted it, it must have been converted wrong.
lol... i didn't even put all of my code in there...
i forgot the whole bouncing part.
No problem. When libpng threw the error, I just opened the file in a hex editor and saw the header was BMP.
hi i'm still learning......
if i have something like this
how would i use it to print battery life?Code:int scePowerGetBatteryLifePercent(void);
how that works is that the int means it will be an interger.
void means it takes no parameters
This shows how to make it into a variable which can be used in all kinds of things:
Code:int PowerRemaining = scePowerGetBatteryLifePercent();
yeah thats what i thought:
but im getting error:Code:int bat = scePowerGetBatteryLifePercent();
and also at the top i have:Zitat:
$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=
150 -c -o main.o main.c
main.c:20: error: initializer element is not constant //this is that line
make: *** [main.o] Error 1
Zitat:
# include <psppower.h>
make sure you have these:
Code:#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <pspmoduleinfo.h>
#include <psppower.h>
make sure this is in your makefile
Code:LIBS = -lpsppower
still same error o_O strange....... but anyway thx for help ;) :tup:
probably im doing something wrong...
and how would you print it? just:
printf("%d",bat)
??
yeah, thats right, as long as you have
in there.Code:#define printf pspDebugScreenPrintf
when making a function how can i return the info to the input command for example:
void function(int input){
input = 6;
}
int number=3;
function(number);
of course this isn't practical however how would i return the input 6 to number so i change it's value to 6 while keeping the function void and no need for a return
C or C++?Zitat:
Zitat von slicer4ever
void function(int *input)Zitat:
Zitat von slicer4ever
{
*input=6;
}
function(&number);
That's what U wanted?