PSP Development------HelloWorld

Source: Internet
Author: User
Tags printf

Reprint Annotated Source: http://blog.csdn.net/yf210yf/article/details/38083413

1. Create HELLOWORLD.C

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

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

#define PRINTF 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); 
     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 ();
	printf ("Hello world! Snail ");
	Scekernelsleepthread ();
	return 0;
}


2. Write makefile

OBJS = helloworld.o

CFLAGS =-o2-g0-wall
cxxflags = $ (CFLAGS)-fno-exceptions-fno-rtti
asflags = $ (CFLAGS) C3/>extra_targets = Eboot. PBP
psp_eboot_title = Hello World

pspsdk=$ (Shell psp-config--pspsdk-path)
include $ (PSPSDK)/lib/ Build.mak

3.make



4. Generated Eboot test

(1) Simulator test



(2) psp3000 test


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.