PSP Coding


 
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 [PSP] Hello World

Go down 
AuthorMessage
Emu



Posts : 21
Points : 29
Reputation : 0
Join date : 2010-10-04

PostSubject: [PSP] Hello World   Mon Oct 04, 2010 5:16 pm

------------------
Main.c
------------------
/*

*main.c
*This is a simple Hello world from team Odessa by Emu
* October 4, 2010

*/

#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO("Hello World", 0, 1, 1);

#define printf pspDebugScreenPrintf // defines pspDebugScreenPrintf as printf

/*
*The info below about callbacks is always need so we can use the home button on our psp
*/

// 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;
}

//Our code's main function
int main(){

pspDebugScreenInit(); //Allows things to be printed to the screen
SetupCallbacks(); //Allows callbacks to be called upon

printf("Hello World");

sceKernelSleepThread(); //freezes the screen so you can see what you inputed
return 0;
}

------------------------
Makefile - Replace the ???? with whatever you want
------------------------

TARGET = ?????
OBJS = main.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = ???????

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Back to top Go down
View user profile
-LeetGamer-
Admin


Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 25

PostSubject: Re: [PSP] Hello World   Mon Oct 04, 2010 5:29 pm

Ummm it was made by you guys? It has already been made 90% the same (Quick skim through of it) and I posted it in a sticky by people at psp-programming Neutral
Back to top Go down
View user profile
Emu



Posts : 21
Points : 29
Reputation : 0
Join date : 2010-10-04

PostSubject: Re: [PSP] Hello World   Tue Oct 05, 2010 5:13 am

Well I remade it my way and explained what it is doing... In the next guide I will show the usage of buttons( and making a list of every button on the psp available) Smile
Back to top Go down
View user profile
-LeetGamer-
Admin


Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 25

PostSubject: Re: [PSP] Hello World   Tue Oct 05, 2010 7:12 am

Okay but just to let you know: http://psp-coders-center.darkbb.com/code-examples-f50/basic-controller-t49.htm Razz But they don't really explain what is going on D: so thanks for the tutorials Very Happy
Back to top Go down
View user profile
Emu



Posts : 21
Points : 29
Reputation : 0
Join date : 2010-10-04

PostSubject: Re: [PSP] Hello World   Tue Oct 05, 2010 1:49 pm

no problem leet
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: [PSP] Hello World   

Back to top Go down
 
[PSP] Hello World
Back to top 
Page 1 of 1
 Similar topics
-
» 2010 World Youth Chess Championship – Final report
» Adolf Hitler - World Chess Champion.
» Which chess player beat the most World Champions?
» WSCE - World's Strongest Derivative Engines
» FIDE World Chess Championship Match 2014

Permissions in this forum:You cannot reply to topics in this forum
PSP Coding :: PSP Programming :: PSP Programming Tutorials :: Homebrew Programming Tutorials-
Jump to: