 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
colourcode
Joined: 08 Jun 2009 Posts: 19
|
Posted: Wed Jun 10, 2009 5:22 am Post subject: Why doesnt this work please? |
|
|
Using a programming guide to learn and have created this
//Hello World - My first app for the psp
/*
This Program was created by Oliver Davies on the 9th June 2009.
It is a simple "Hello World" application.
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#
PSP_MODULE_INFO("Hello World", 0, 1, 1);
#define printf pspDebugScreenPrintf
int counter = 0
int i = 0;
SceCtrlData pad;
printf("Press [X] To Start the Timer");
while(1) {
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS {
break;
}
}
while(1) {
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CIRCLE) {
break;
}
pspDebugScreenClear();
printf("Press [O] To Stop the Timer\n");
printf("Counter: %i", counter);
counter++;
for(i=0; i<5; i++) {
sceDisplayWaitVblankStart();
}
}
pspDebugScreenClear();
printf("Counter Finished.");
printf("Final Count: %i", counter);
/* 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() {
pspDebugScreenInit();
SetupCallbacks();
sceKernelSleepThread();
return 0;
}
why doesnt it work pleaese? _________________ PSP Coding total n00b Please Help!!!!!!!! |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Wed Jun 10, 2009 5:29 am Post subject: |
|
|
| Use code tags. And that's not a valid C file. Please learn to program in C FIRST before trying to program the PSP. |
|
| Back to top |
|
 |
colourcode
Joined: 08 Jun 2009 Posts: 19
|
Posted: Wed Jun 10, 2009 5:33 am Post subject: |
|
|
ok, i admit defeat, wheres the best place to learn?
Or by book? _________________ PSP Coding total n00b Please Help!!!!!!!! |
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Wed Jun 10, 2009 6:04 am Post subject: |
|
|
| colourcode wrote: | ok, i admit defeat, wheres the best place to learn?
Or by book? |
http://en.wikibooks.org/wiki/C_Programming _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|