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?
Why doesnt this work please?
-
- Posts: 19
- Joined: Mon Jun 08, 2009 10:38 pm
Why doesnt this work please?
PSP Coding total n00b Please Help!!!!!!!!
-
- Posts: 19
- Joined: Mon Jun 08, 2009 10:38 pm
http://en.wikibooks.org/wiki/C_Programmingcolourcode wrote:ok, i admit defeat, wheres the best place to learn?
Or by book?
Code: Select all
int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
}