PSP Development Environment Configuration __makefile

Source: Internet
Author: User

1: Install Devkitpro

Download http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/

Select Devkitproupdater-1.5.0.exe

url:http://211.167.112.9:9203/2d11738c7f5fbdd2dbc1c3b9070c9a62e15918c1c1f093f5/ncu.dl.sourceforge.net/project/ Devkitpro/automated%20installer/devkitproupdater-1.5.0.exe

A. Running Devkitproupdater-1.*.*.exe
B. Select download and install (download and install)
C.keep downloaded files are saved to download the installation files, remove downloaded files are installed after the download of the file deleted, this casual
D. Choose Devkitpsp in the Select the type of install, or full, if you also want to program GBA or NDS
E. The installation address can be chosen anywhere.

2 HelloWorld

Create a folder named projects in any directory (not necessarily the directory where Devkitpro is installed) (what the name is doesn't really matter)
Create multiple subfolders within a folder, each of which is a program to be compiled in the future
For example: Projects
-helloworld
-main.c
-makefile

Inside this "HelloWorld" Program Name folder, "Main.c" is the source code of the program, "Makefile" is the information file for compilation

Each program must have MAIN.C and makefile placed in the folder of the program name before compiling.

First say makefile:
Makefile has no suffix, which is written in:


TARGET = Hello
OBJS = MAIN.O
Cflags =-o2-g0-wall
Cxxflags = $ (cflags)-fno-exceptions-fno-rtti
Asflags = $ (cflags)
Extra_targets = EBOOT. PBP
Psp_eboot_title = Hello World
pspsdk=$ (Shell Psp-config--pspsdk-path)
Include $ (PSPSDK)/lib/build.mak


What's different here is the "Hello World" in the penultimate line of "Psp_eboot_title = Hello World", which is your program name, displayed on the PSP.
So every new program that needs to be changed is the "Psp_eboot_title" in makefile.

Again main.c:
The MAIN.C format is mainly:
#include <pspkernel.h>                                          //PSP Program-Essential header File
# Include <pspdebug.h>                                           //I think something similar to stdio.h
#include <pspctrl.h>                                             //Key The header file for the function

Psp_module_info ("Hello World", 0, 1, 1); Will not be compiled, write your program name and version number

#define PRINTF pspdebugscreenprintf//definition function pspdebugscreenprintf for printf, easy to use later


int exit_callback (int arg1,int arg2,void *common)
{Scekernelexitgame ();
return 0;} /* Exit CALLBACK * *

int Callbackthread (scesize args,void *ARGP)
{int cbid;
Cbid=scekernelcreatecallback ("Exit Callback", exit_callback,null);
Scekernelregisterexitcallback (Cbid);
SCEKERNELSLEEPTHREADCB ();
return 0;} /* Callback Thread * *

int setupcallbacks (void)
{int thid=0;
Thid=scekernelcreatethread ("Update_thread", callbackthread,0x11,0xfa0,0,0);
if (thid>=0) Scekernelstartthread (thid,0,0);
return thid;} /* Sets up the callback thread and returns its thread ID * *

The above three functions are not to be used first, in order to be able to press home to exit the

int main ()//finally to main function
{
Pspdebugscreeninit (); Set the PSP screen so that you can display text
Setupcallbacks (); Set press home to exit

This is where the program content is written ....

Pspdebugscreenclear (); Clear the screen function, erase all the contents and reset the cursor to the upper left corner
Pspdebugscreensetxy (20,10); Set the cursor, the upper left corner (0,0), the PSP has 34 rows of 68 columns, so the lower right corner is (67,33)

printf ("Hello World"); is to play a "Hello World"

Scekernelsleepthread (); Let the program run and stop here.
return 0;
}

Start compiling now.

Create a new Run.bat, which is written in: (assuming the program is installed to C:/devkitpro)
Set path=%path%; C:/devkitpro/devkitpsp/bin;
Cmd

Now put this run.bat file into the Projects folder and run


Input CD Hello World return (this represents entering the Hello World folder)
Then enter make carriage return and start compiling.


If you see the text in the attached picture and generate four files in Hello World, it's a success.


Create a new folder in the Psp/game, the name is random, put just generated eboot.pbp put on it, if the trouble is to direct the Hello World dragged to Psp/game

In fact, you can put *.bat into the Hello World folder, run and directly enter make on the line

If you want to compile a double folder on 1.50, change the input made to Kploit make

If you want to compile the prx file on PSP-2000 for version 3.71, you need to start with two lines in the makefile:
Build_prx=1
psp_fw_version=371
Also, enter make compilation

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.