Zeige Ergebnis 1.501 bis 1.530 von 10174
C/C++ Programming Help Thread
This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; So can anyone explain why I can't rapidly shoot bullets?...
-
10-22-2006, 10:25 AM #1501QJ Gamer Blue
- Registriert seit
- Aug 2006
- Beiträge
- 145
- Points
- 4.580
- Level
- 43
- Downloads
- 0
- Uploads
- 0
So can anyone explain why I can't rapidly shoot bullets?
-
10-22-2006, 10:28 AM #1502Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
still not working
still crashing , the hello world i wanne load works
but the eboot loader doesnt:
Code:#include <pspkernel.h> #include <pspdebug.h> #include <string.h> #include <psploadexec.h> #include <pspdisplay.h> #include <pspctrl.h> #define printf pspDebugScreenPrintf PSP_MODULE_INFO("Hello World", 0, 1, 1); PSP_MAIN_THREAD_ATTR (0);//zeg de psp dat het programma kernel acces nodig heeft /* 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 load_Eboot_calculator(void) { struct SceKernelLoadExecParam calculator; char *path_calculator= "ms0:/PSP/GAME/HELLOWORLD/EBOOT.PBP"; /*geheugenplaats voor de naam van de eboot die je wilt laden*/ const u32 Length_of_Eboot = strlen(path_calculator )+1; pspDebugInstallKprintfHandler (NULL); pspDebugInstallErrorHandler (NULL); calculator.args = Length_of_Eboot; calculator.argp = path_calculator; calculator.key = NULL; calculator.size = sizeof(calculator)+Length_of_Eboot; sceKernelLoadExec(path_calculator,&calculator); } int main() { pspDebugScreenInit(); SetupCallbacks(); printf("press cross to load calculator"); SceCtrlData pad; while(1) { sceCtrlReadBufferPositive(&pad, 1); if(pad.Buttons & PSP_CTRL_CROSS){ load_Eboot_calculator(); } } sceKernelSleepThread(); return 0; }
-
10-22-2006, 10:29 AM #1503Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
Because you haven't setup a system for mutiple bullets.
See the tutorial at evilmana.com that I mentioned, the principals apply across any language.
http://www.evilmana.com/tutorials/lu...et_bullets.php
Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
10-22-2006, 11:46 AM #1504QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- In The PSP
- Beiträge
- 804
- Points
- 6.697
- Level
- 53
- Downloads
- 0
- Uploads
- 0
can anyone help me with my problem? thanks insomniac great tutorials
Linux + Windows = Lindows FTW
-
10-22-2006, 12:02 PM #1505words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Sethis - Your problem is t hat you are making hte thread fall 'asleep' (aka stopping all processes besides HOME button). here ya go.
Code://counter - My second PSP Program /* This program was created by ME on October 21 2006 It is a simple counter Application thanks to http://www.psp-programming.com */ #include <pspkernel.h> #include <pspdebug.h> #include <pspdisplay.h> #include <pspctrl.h> PSP_MODULE_INFO("Hello World", 0,1,1); #define poop pspDebugScreenPrintf /* 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); 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() { //to end a line a semi colon is needed, not sure what these two blocks of code do... pspDebugScreenInit(); SetupCallbacks(); //this prinnts Hello World to the screen int counter = 0; int i = 0; SceCtrlData pad; poop ("Press [X] to start the Timer"); //this is to make the printf appear, becuase it will just erase without it // "while" represents a loop // the if = if statement in english. while(1) { sceCtrlReadBufferPositive(&pad, 1); //break = break the loop if(pad.Buttons & PSP_CTRL_CROSS) { break; } } while(1) { sceCtrlReadBufferPositive(&pad, 1); if(pad.Buttons & PSP_CTRL_CIRCLE) { break; } pspDebugScreenClear(); poop("Press [O] To Stop the Timer\n"); poop("Counter: %i", counter); counter++ for(i=0; i<5; i++) { sceDisplayWaitVblankStart(); } } pspDebugScreenClear(); poop("Counter Finished."); poop("Final Count: %i", counter); poop("\n\n\tPress L Trigger to exit."); while(1) { sceCtrlReadBufferPositive(&pad, 1); if(pad.Buttons & PSP_CTRL_LTRIGGER) { break; } } sceKernelExitGame(); return 0; }
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
10-22-2006, 12:10 PM #1506Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
The line:
Also needs a semi-colon at the end of it:Code:counter++
Code:counter++;

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
10-22-2006, 12:29 PM #1507is not posting very often

- Registriert seit
- Feb 2006
- Ort
- omnipresent
- Beiträge
- 5.162
- Points
- 33.152
- Level
- 100
- Downloads
- 0
- Uploads
- 0
any help with my issue?
What did we think the world would look like in 2015?
http://forums.qj.net/501501-post26.html
Zitat von Abe
-
10-22-2006, 01:14 PM #1508I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
OK, I'm trying to compile a simple EBOOT runner, that will run a Hello World EBOOT. It compiles, but when I run it and press X, it does nothing. Anyone know what's wrong?
Spoiler for Code:
Spoiler for Makefile:
Spoiler for Errors:
-
10-22-2006, 01:31 PM #1509words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Try that ;)Code:#include <pspkernel.h> #include <pspdebug.h> #include <string.h> #include <psploadexec.h> #include <pspdisplay.h> #include <pspctrl.h> #define printf pspDebugScreenPrintf PSP_MODULE_INFO("Eboot Runner", 0x1000, 1, 1); int exit_callback(int arg1, int arg2, void *common) { sceKernelExitGame(); return 0; } int CallbackThread(SceSize args, void *argp) { int cbid; cbid = sceKernelCreateCallback(" Exit Callback", exit_callback, NULL); sceKernelRegisterExitCall back(cbid); sceKernelSleepThreadCB(); return 0; } 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 load_eboot(void) { struct SceKernelLoadExecParam eboot; char *ebootpath= "ms0:/PSP/GAME/Hello/EBOOT.PBP"; const u32 Length_of_Eboot = strlen(ebootpath )+1; pspDebugInstallKprintfHan dler (NULL); pspDebugInstallErrorHandl er (NULL); eboot.args = Length_of_Eboot; eboot.argp = ebootpath; eboot.key = NULL; eboot.size = sizeof(eboot)+Length_of_E boot; sceKernelLoadExec(ebootpa th,&eboot); } int main() { pspDebugScreenInit(); SetupCallbacks(); SceCtrlData pad; printf("Press X to launch EBOOT"); while(1) { sceCtrlReadBufferPositive (&pad, 1); if(pad.Buttons & PSP_CTRL_CROSS){ load_eboot(); } } sceKernelSleepThread(); return 0; }
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
10-22-2006, 01:35 PM #1510Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
I seem to remember something about it needing to be a PRX.
So code a kernel mode EBOOT to load a kernel mode PRX, from the PRX unload the boot EBOOT, then load the desired EBOOT.
I could be mistaken, or thinking of something else.
Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
10-22-2006, 02:45 PM #1511
- Registriert seit
- Feb 2006
- Ort
- Arkhangelsk, Russia
- Beiträge
- 21
- Points
- 4.193
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Gah...
Whats the code to make the psp wait for a set amount of time? I know I just saw it in here not to long ago but I cant seem to find it now. I've been using rediculicly long for loops as my wait function, but depending on what else I have it doing the for loop could be anywhere from 5000 to 80million to get it to wait just a few milliseconds...
Something like sceKernelWait(time)?
-
10-22-2006, 02:49 PM #1512I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
SG57, it still didn't work. I added the while loop, and it gave me the same warning as when I compiled without the while loop.
Code:$ make psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -c -o main.o mai n.c main.c: In function 'load_eboot': main.c:45: warning: control reaches end of non-void function psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/ pspdev/psp/sdk/lib main.o -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspus er -lpspkernel -o runner.elf psp-fixup-imports runner.elf psp-strip runner.elf -o runner_strip.elf pack-pbp EBOOT.PBP PARAM.SFO NULL \ NULL NULL NULL \ NULL runner_strip.elf NULL rm -f runner_strip.elf
-
10-22-2006, 03:00 PM #1513words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Propel - read the tutorial on howto launch an eboot, as well as make your main function return a value...
AKA, just add
return 0;
to the very bottom of your code, but still in the main functions brackets.
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
10-22-2006, 03:01 PM #1514QJ Gamer Blue
- Registriert seit
- Jul 2006
- Ort
- Canada
- Beiträge
- 70
- Points
- 4.073
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Zitat von F.T.P.
sceKernelDelayThread(1000 000);
will delay the thread in micro seconds, this will delay it for 1 second.
-
10-22-2006, 03:02 PM #1515QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
In this function: int load_eboot(void) , you are not returning an int.
Zitat von Propel
-
10-22-2006, 03:03 PM #1516Developer

- Registriert seit
- Feb 2006
- Ort
- Norway
- Beiträge
- 384
- Points
- 5.359
- Level
- 47
- Downloads
- 0
- Uploads
- 0
sceDisplayWaitVBlank(); delays it for 1/60 second
Zitat von F.T.P.
Or you could use
sceKernelDelayThread(mirc oseconds)
-
10-22-2006, 03:06 PM #1517
- Registriert seit
- Feb 2006
- Ort
- Arkhangelsk, Russia
- Beiträge
- 21
- Points
- 4.193
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Hey, thanks alot you two! ;)
-
10-22-2006, 03:10 PM #1518I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Man, I'm too tired. How could I forget that.
Zitat von SG57
-= Double Post =-
I compiled it with no errors, but it still doesn't work. WTF is wrong?!?!?Geändert von Propel (10-22-2006 um 03:11 PM Uhr) Grund: Automerged Doublepost

-
10-22-2006, 03:38 PM #1519QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- In a cave according to SG57 lol
- Beiträge
- 273
- Points
- 4.917
- Level
- 44
- Downloads
- 0
- Uploads
- 0
n00b Question time
So the 2.8 TIFF games are created with C++?
-
10-22-2006, 03:43 PM #1520I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Yeah, they're created with C. But if you are going to start developing, don't start with TIFF games, start with regular C coding and work your way up to TIFF.
Zitat von ZeroMega

-
10-22-2006, 03:46 PM #1521QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- In a cave according to SG57 lol
- Beiträge
- 273
- Points
- 4.917
- Level
- 44
- Downloads
- 0
- Uploads
- 0
Ah I see, thanks a lot
Zitat von Propel
So what files do the C coding end up to be, and can you test them on your computer before they go on the PSP?
-
10-22-2006, 04:01 PM #1522I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
When you compile them, they come out as EBOOTS, for regular homebrew, or sometimes PRXs, or a .BIN file for TIFF homebrew. And you can only test them if you have a mac, or a mac emulator. Then you can use the program by xart.
Zitat von ZeroMega

-
10-22-2006, 04:25 PM #1523QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- In a cave according to SG57 lol
- Beiträge
- 273
- Points
- 4.917
- Level
- 44
- Downloads
- 0
- Uploads
- 0
Oh no, I don't have a Mac. >_<;
Zitat von Propel
Thanks though
-
10-22-2006, 04:27 PM #1524I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Neither do I, that's why I'm setting up a Mac OS 8 Emulator. I manged to get Mac OS X on my laptop, but it's not booting right.
Zitat von ZeroMega

-
10-22-2006, 07:38 PM #1525QJ Gamer Blue
- Registriert seit
- Aug 2006
- Beiträge
- 145
- Points
- 4.580
- Level
- 43
- Downloads
- 0
- Uploads
- 0
Okay I used a lib that Grimfate made for me on AIM and I tried to match it for my game but it still doesnt shoot:
Spoiler for Lib:
Spoiler for Main.Cpp:
-
10-23-2006, 07:12 AM #1526Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
still not fixed
Zitat von hallo007
-
10-23-2006, 01:43 PM #1527
- Registriert seit
- Apr 2006
- Beiträge
- 7
- Points
- 4.037
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Here's a quick n' dirty one. In sceKernelCreateThread, is the stack size variable in KB or B or what?
Thanks.
-
10-23-2006, 05:00 PM #1528words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
jait - bytes. (80% sure)

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
10-23-2006, 05:29 PM #1529QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- In The PSP
- Beiträge
- 804
- Points
- 6.697
- Level
- 53
- Downloads
- 0
- Uploads
- 0
I was trying to write a program in which it displays hello world, and then loops until i press cross [X]. then i came to 1 piece of code in which i did not exactly understand it is this one
can anyone explain to me what this means? thanksCode:SetupCallbacks ();
edit - also what it does, thanksLinux + Windows = Lindows FTW
-
10-23-2006, 05:39 PM #1530I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
That's most likely referring to the exit callbacks. It's a chunk of code about 10 - 12 lines long, that allows your PSP's 'HOME' button to work when running the game.
Zitat von Sethis



LinkBack URL
About LinkBacks
Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum