0% found this document useful (0 votes)
44 views

PSP Setup Guide-English

Uploaded by

vifigo9647
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

PSP Setup Guide-English

Uploaded by

vifigo9647
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

PSP™ Setup Guide

© 2011 Sony Computer Entertainment Inc.


All Rights Reserved.
SCE Confidential
SCE CONFIDENTIAL

Table of Contents

1 PSP™ Development Environment ......................................................................... 4


Configuration of the PSP™ Development Environment................................................4

Development Host............................................................................................................4

PSP™ Hardware Tool ......................................................................................................5

PSP™ Software Development Kit ...................................................................................6

Procedure for Building the Development Environment.................................................7


2 Building the Development Host (Visual Studio + ProDG) ................................... 8
Visual Studio Setup .........................................................................................................8

PSP™ Software Development Kit Installation ..............................................................8

Setting Environment Variables .....................................................................................13


3 Building the Development Environment (Cygwin) ............................................. 15
Cygwin Installation .......................................................................................................15

Cygwin Compiler Installation .......................................................................................16

PSP™ Software Development Kit Installation ............................................................17

Setting Environment Variables .....................................................................................17

Setting the Temporary Directory for the Cygwin Compiler .........................................17


4 Building the Development Host (Linux) .............................................................. 18
PSP™ Software Development Kit Installation ............................................................18

Setting Environment Variables .....................................................................................18


5 Configuring the PSP™ Hardware Tool ................................................................ 19
Configuring the Network for the PSP™ Hardware Tool ..............................................19

Updating the PSP™ Hardware Tool .............................................................................19


6 Compiling and Executing Sample Programs (Visual Studio + ProDG) ............ 22
Configuring the Target Manager ..................................................................................22

Compiling and Executing / Debugging the Application ...............................................24

Creating New ProDG VSI.NET PSP Projects...............................................................26


7 Compiling and Executing Sample Programs (Cygwin / Linux) ......................... 28
Setting the SCE_PSP_SDK_HOME Environment Variable ........................................28

Setting the PATH Environment Variable .....................................................................28

Setting the PSP_GCC_VERSION Environment Variable ...........................................29

Creating an Executable Image ......................................................................................29

Executing a Program .....................................................................................................29

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

-2-
SCE CONFIDENTIAL

Debugging ......................................................................................................................31
8 Debugging Support Functions Provided by System Software ......................... 34
Content Information Check Function ...........................................................................34

Debug Settings ...............................................................................................................35


☆Install Package Function ...........................................................................................38

9 Supplement ........................................................................................................... 40
Maximum Size of PRX/ELF...........................................................................................40

Amount of Memory Available to a Title Application ....................................................40

When a Network Connection Problem Occurs .............................................................40

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

-3-
SCE CONFIDENTIAL

1 PSP™ Development Environment

Configuration of the PSP™ Development Environment

The following diagram shows the PSP™ development environment.

PSP™ Hardware Tool


( DTP-T2000 (A) / DTP-T1000 (A) )
UMD™ drive

USB device

Memory Stick™
Development host USB connector

(Windows XP /
Linux such as CentOS 4.4) USB connector

Controller
port
DVD-ROM drive Headset
remote controller
Headset controller

Ethernet

Figure 1 Configuration of PSP™ Development Environment

Development Host

The development host must be a PC that runs Windows XP or a version of Linux such as
CentOS 4.4.

Recommended environments:
- Windows XP SP3 * Basic operation has also been verified with
Windows Vista.
- CentOS 4.4 * Other distributions for which operation has been FedoraCore 3.4.5
verified RedHat9

Application programs are compiled and built on the development host. The development host
is also used to perform operations such as loading, executing, and debugging built programs on
the PSP™ Hardware Tool.
The following can be used as compilers and debuggers.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

-4-
SCE CONFIDENTIAL

GUI Compiler and Debugger

Windows XP + Microsoft Visual Studio 2005/2008 + SN Systems ProDG for PSP

GUI Debugger

Windows XP + PSP™ Debugger

Command Line Compilers

Windows XP + SN Systems pspsnc


Windows XP + CygWin + psp-gcc
Linux + psp-gcc

Command Line Debuggers

Windows XP + CygWin + psp-gdb


Linux + psp-gdb

The development host can also be used to perform tasks for packaging debugged applications
and for updating the built–in software of the PSP™ Hardware Tool.

Creating Packages

Windows XP + PSP™ Game Master Disc Package or PSP™ Downloadable Game /


Additional Gamedata Package + CygWin (when using the command line tool)

Updating PSP™ Hardware Tool

Windows XP + PSPhtool_Updater

PSP™ Hardware Tool

The PSP™ Hardware Tool is used for test running and debugging application programs.
Therefore, it is has functions not only for the PSP™ but also for communicating with the
development host and providing debugging support. For details about debugging support
functions, see Chapter 8, "Debugging Support Functions Provided by System Software."

The PSP™ Hardware Tool is provided as a combination of a system and controller unit, and is
available in the following models.
– DTP-T2000 : For the Japanese market (DTP-T1000+DTP-H200)
– DTP-T2000A : For North American, European, and Asian markets
(DTP-T1000A+DTP-H200)
– DTP-T1000 : (Old model) For the Japanese market (DTP-T1000+DTP-H110)
– DTP-T1000A : (Old model) For North American, European, and Asian markets
(DTP-T1000A+DTP-H110)

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

-5-
SCE CONFIDENTIAL

The PSP™ Testing Tool is also available as a dedicated test run device, consisting of the PSP™
Hardware Tool without the functions for communicating with the development host.
– DTP-H2500 : For the Japanese market (DTP-H1500+DTP-H200)
– DTP-H2500A : For North American, European, and Asian markets
(DTP-H1500A+DTP-H200)
– DTP-H1500 : (Old model) For the Japanese market (DTP-H1500+DTP-H110)
– DTP-H1500A : (Old model) For North American, European, and Asian markets
(DTP-H1500A+DTP-H110)

There are also standalone controller models, which can be used to replace the controllers of the
various PSP™ Hardware Tools.
– DTP-H110 : For PSP-1000
– DTP-H200 : For PSP-2000 / PSP-3000
– DTP-H300 : For PSP-N1000

PSP™ Software Development Kit

The PSP™ software development kit (SDK) is a set of software tools for PSP™ application
development, and it includes runtime libraries and documentation.
The SDK, which is divided into several packages shown below, can now be downloaded from
the PSP™ Developer Network (https://psp.scedev.net). Refer to the "Startup Guide"
(https://psp.scedev.net/docs/startup_guide) for the download address of each package.
In this document, file names of the form PSP_Runtime_Libraries-x.x.x.zip are used, where
"x.x.x" represents the version. For example, the package for version 5.0.0 is called
PSP_Runtime_Libraries-5.0.0.zip.
Note that if you use the PSP™ (PlayStation®Portable) SDK Installer as explained later, you
can obtain the latest version in one download.

Software used for updating PSP™ Hardware Tool (for Windows XP)
Hardware tool updater PSPhtool_Updater–xxx.zip
utility Packaged tools for collectively updating the firmware and
built-in system software of the PSP™ Hardware Tool.
Kernel update binary PSP_Hardware_tool_Kernel_Update_Binary_xxx.zip
Packaged binary data for updating the firmware and built-in
system software of the PSP™ Hardware Tool.
Note that the method of updating the PSP™ Hardware Tool was changed beginning with
version 5.0.0. Windows XP is now required. The information in this document applies to
version 5.0.0 and later.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

-6-
SCE CONFIDENTIAL

Software used for both Windows XP and Linux


Runtime libraries PSP_Runtime_Libraries-x.x.x.zip
A package containing libraries, headers, modules, sample
programs, and Linux command line tools for building
applications.
Sample code data PSP_Sample_Code_Data-*-x.x.x.zip
Data used when executing sample programs included in the
runtime library.

Software used for Windows XP


ProDG for PSP ProDGforPSPvX.X.X.exe
A package containing the ProDG Debugger, Target Manager, SNC
PSP Toolchain (compiler, assembler, linker, PRX generator), and
Visual Studio Integration tools.
psp-utils for Windows psp-utils-x.x.x-windows.zip
Windows XP version of the tools that are included in the runtime
library.
Cygwin-version psp-gcc-x.x.x-cygwin.zip
compiler Tools and libraries needed to build applications under Cygwin,
which is installed on Windows XP.
Windows debugger PSP_Debugger-x.x.x.zip
GUI-based tool for debugging applications on Windows XP.

Software used for Linux


Linux-version psp-gcc-x.x.x-linux.tgz
compiler Tools and libraries needed to build applications on Linux.

Procedure for Building the Development Environment

Use the following procedure to build the PSP™ development environment.


(1) Prepare the development host and PSP™ Hardware Tool.
(2) Download the PSP™ software development kit and set it up on the development host
For details, refer to the following chapters: "Building the Development Host (Visual
Studio + ProDG)," "Building the Development Environment (Cygwin)" or "Building
the Development Host (Linux)."
(3) Connect the development host and PSP™ Hardware Tool to the network and update
the PSP™ Hardware Tool.
For details, refer to "Configuring the PSP™ Hardware Tool."

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

-7-
SCE CONFIDENTIAL

2 Building the Development Host (Visual Studio +


ProDG)

Visual Studio Setup

The following version of Visual Studio is required to use ProDG as the development
environment.
• Visual Studio 2005/2008 Standard Edition or higher
If the above version of Visual Studio is installed, then the PSP™ SDK Installer can be used to
install ProDG, as described in "PSP™ Software Development Kit Installation," which will
install Visual Studio Integration and enable the use of Visual Studio as an application
development environment.

PSP™ Software Development Kit Installation

(1) Download the PSP™ SDK Installer from the following URL. (The version may have
changed, so be sure to download the latest
version.) https://psp.scedev.net/projects/pspinstaller

(2) Expand the ZIP archive and launch the PSP™ SDK Installer.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

-8-
SCE CONFIDENTIAL

(3) Click "Next >" on the PSP™ SDK Installer dialog.

(4) Select "Install (online)."

If a "Failed to Update List of Components" dialog box appears after pressing the
"Install (online)" button, the network proxy might not have been set. Select "Settings"
and verify "Proxy Settings."

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

-9-
SCE CONFIDENTIAL

(5) Enter your PSP™ Developer Network login information and click "OK."

(6) Select the components to install from the list.

Set the "Filter" pulldown menu field to the latest version.


Application development requires Runtime Libraries, Kernel Update, Sample Data,
Tools [Debug / Graphics / Network / Sound / Video Streaming / SN Tools / UMD Game
Master Disc]), and PSP Utils. When Tools is selected, ProDG is also installed.
Documentation and ConferenceContent contain useful information for development,
so install them as needed.

(7) "Install Directory" is the directory where the components selected in (6) are installed.
Change the install directory as necessary. Verify that the desired "Install Directory" is
set and click "Next >".

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 10 -
SCE CONFIDENTIAL

(8) Verify the installation components and if OK, click the "Install >" button.

(9) A progress bar is displayed on the PSP™ SDK Installer dialog.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 11 -
SCE CONFIDENTIAL

(10) Use the default options of the ProDG installer when it launches to install ProDG. In
addition to the SNC/C++ Compiler, ProDG Debugger, and Target Manager installers,
the Visual Studio Integration (VSI) installer is included in the ProDG for PSP
installer. Install VSI to use Visual Studio.

(11) Press any key when the psp-utils command prompt installer appears.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 12 -
SCE CONFIDENTIAL

(12) Click "Finish" to finish the installation.

Setting Environment Variables

The following environment variables are automatically set during the installation process. To
update environment variables on Windows XP, right click the "My Computer" icon and select
"Properties." In the "System Properties" window, select "Advanced" and click "Environment
Variables." Find the desired environment variables from the "System Environment Variables"
list.

• PATH
PATH is set with a list of directories where the executable files are located. Individual
directories are separated by semicolons. The directories required for using ProDG for
PSP are automatically added to PATH by the ProDG for PSP installer.
• SCE_PSP_HW_ROOT
SCE_PSP_HW_ROOT is set with the root directory of the development kit. The directory
that was specified in the "Install Directory" of the PSP™ SDK Installer is set here. This
environment variable is set if the Runtime Libraries package is installed.
• SN_COMMON_PATH
If the ProDG for PSP package is installed, SN_COMMON_PATH is set with the path to
the SN Systems' common binaries. This environment variable is automatically set by the
ProDG for PSP installer.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 13 -
SCE CONFIDENTIAL

• SN_PSP_PATH
SN_PSP_PATH is automatically set by the ProDG for PSP installer with the path to the
PSP™ specific binaries of SN Systems.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 14 -
SCE CONFIDENTIAL

3 Building the Development Environment (Cygwin)


Cygwin is software that enables command line tools similar to Linux to be used in Windows.
Installing Cygwin enables the building of a command line tool-based development
environment on Windows so that automated workflows or batch files can be created from the
command line.

Note

If you do not plan to use the command line tools, you do not need to perform the
configuration tasks described in this chapter.

Cygwin Installation

(1) Download the Cygwin setup application from http://www.Cygwin.com/setup.exe and


execute it.
(2) Click "Next >" on the "Cygwin Setup" screen.
(3) Select "Install from Internet" as the download source and click "Next >".
(4) Select the install directory. The default directory "C:\Cygwin" is recommended.
(5) Select "All Users" in the "Install For" area, if necessary. Then click "Next >".
Do not change the "Default Text File Type." Keep it as "Unix / binary."

(6) Click "Next >" on the "Select Local Package Directory" screen.
(7) If a proxy exists, enter the proxy configuration on the "Select Connection Type"
screen. If no proxy exists, select "Direct Connection" and click "Next >".
(8) Select any site listed on the "Choose Download Site(s)" screen. (Although multiple

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 15 -
SCE CONFIDENTIAL

sites can be selected, try to choose a site that is geographically nearby). Then press
"Next >".
While the package is downloading, a progress screen will appear.
(9) When downloading finishes, the "Select Packages" screen will appear. Open the Devel
category and select the make package as the install target. Then select the Utils
category, followed by the rpm package.

(10) Click "Next >" to begin downloading and installing.


An installation progress screen will appear.
(11) When installation is complete, set the Create Icon option if necessary, and then click
"Finish."

Cygwin Compiler Installation

Download the Cygwin compiler psp-gcc package psp-gcc-X.XX.X-cygwin.zip from the following
URL.
https://psp.scedev.net/projects/compiler
Execute the following commands to unzip psp-gcc-X.XX.X-cygwin.zip to a folder for
temporarily performing work (tmp folder is assumed here) and to launch Cygwin. ("Cygwin>"
is the prompt.)

[Example]
Cygwin > cd /tmp

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 16 -
SCE CONFIDENTIAL

Cygwin > unzip psp-gcc-x.x.x-cygwin.zip


Cygwin > rpm -ivh psp-gcc_x_x_x-x-x.cygwin.i386.rpm
Cygwin > rpm -ivh psp-newlib_x_x_x-x-x.cygwin.i386.rpm

This will install psp-gcc under C:\Cygwin\usr\local\psp\gcc-x.x.x.

PSP™ Software Development Kit Installation

Use the PSP™ SDK Installer to install the PSP™ software development kit as described in
"Building the Development Host (Visual Studio + ProDG)."
When using Cygwin for command line-based development, the "SN ProDG for PSP" component
in Tools [Debug / Graphics / Network / Sound / Video Streaming / SN Tools / UMD Game
Master Disc] may be omitted from the components to be installed.
Also, be sure to set the "Install Directory" of the PSP™ SDK Installer to the directory
corresponding to /usr/local as viewed from the Cygwin root directory (normally
"C"\Cygwin\usr\local").

Setting Environment Variables

Set environment variables in the Cygwin environment as described in Chapter 7, "Compiling


and Executing Sample Programs (Cygwin / Linux)."

Setting the Temporary Directory for the Cygwin Compiler

The Cygwin compiler runs in the Cygwin environment and calls the Windows tool internally.
Therefore, if a path is specified for an environment variable that sets the temporary directory
(TEMP, TMP, TEMPDIR, or TMPDIR) and that path cannot be accessed from Windows, an
error may occur and the tool will not be able to access that directory.
When using the Cygwin compiler, either leave the TEMP, TMP, TEMPDIR, and TMPDIR
environment variables unset in Cygwin or specify an actual Windows path to a folder that
exists, as in the example shown below.

[Example]
Cygwin > export TMP=c:\\Temp
(Since \ is used as a control character in Cygwin, it should be preceded by the escape
character.)

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 17 -
SCE CONFIDENTIAL

4 Building the Development Host (Linux)


In the following descriptions, "CentOS >" indicates the prompt on the development host.

PSP™ Software Development Kit Installation

(1) Create the /usr/local/psp directory (be sure to make this a real directory).
[Example]
CentOS > cd /usr/local
CentOS > mkdir psp
(2) Expand "PSP_Runtime_Libraries-xxx.zip" under /usr/local/psp.
[Example]
CentOS > cd /usr/local/psp
CentOS > unzip PSP_Runtime_Libraries-x.x.x.zip
(3) Expand "PSP_Sample_Code_Data-*-x.x.x.zip" under /usr/local/psp as necessary.
[Example]
CentOS > cd /usr/local/psp
CentOS > unzip PSP_Sample_Code_Data-*-x.x.x.zip
(4) Install "psp-gcc-x.x.x-linux.tgz."
Note: If rpm is used to install "psp-gcc-x.x.x-linux.tgz," it is installed under
/usr/local/psp/gcc-x.x.x regardless of the directory in which rpm is executed.
[Example]
CentOS > cd /tmp
CentOS > tar zxvf psp-gcc-x.x.x-linux.tgz
CentOS > rpm -ivh psp-gcc_x_x_x-x-x.i386.rpm
CentOS > rpm -ivh psp-newlib_x_x_x-x-x.i386.rpm

Setting Environment Variables

Set environment variables in the Linux environment as described in Chapter 7, "Compiling


and Executing Sample Programs (Cygwin / Linux)."

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 18 -
SCE CONFIDENTIAL

5 Configuring the PSP™ Hardware Tool

Configuring the Network for the PSP™ Hardware Tool

Configure the network for the PSP™ Hardware Tool and connect the development host to the
network.
For information about configuring the network for the PSP™ Hardware Tool, refer to the
user's guide included in the PSP™ Hardware Tool package or the PDF file in the devkit/setup
directory of the runtime library.

Updating the PSP™ Hardware Tool

The runtime library version and the PSP™ Hardware Tool firmware and system software
version must be compatible. Use the update tool included in the SDK to update the PSP™
Hardware Tool firmware and system software according to the following procedure.
Before updating, confirm that the PSP™ Hardware Tool is accessible: use a web browser to go
to the address of the PSP™ Hardware Tool previously set from the development host (for
example, when the IP address is 192.168.100.1, use "http://192.168.100.1/").

(1) Execute
%SCE_PSP_HW_ROOT%\devkit\tool\PSPhtool_Updater\PSPhtool_Updater.exe.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 19 -
SCE CONFIDENTIAL

(2) The development device configuration window appears when you click the "New"
button in the PSPhtool_Updater. Enter the IP address that is displayed for the PSP™
Hardware Tool controller. Enter the administrator's password (default:
Administrator) and click "OK."

(3) Name the configuration as desired and click "OK."

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 20 -
SCE CONFIDENTIAL

(4) Click the Browse button for the updater path and
specify %SCE_PSP_HW_ROOT%/devkit/htool_updater/htool_updater-*.bin.

Click the "Start Update" button, and then click "OK" in the confirmation dialog that
appears.
This process takes approximately 5 minutes.
If the "a010000b" error appears during the update, you may be able to resolve
connection issues by temporarily disabling firewall and anti-virus software.
If the update still fails, contact technical support.
Check the System Software Version displayed on the controller screen to verify that the
firmware was updated.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 21 -
SCE CONFIDENTIAL

6 Compiling and Executing Sample Programs (Visual


Studio + ProDG)

This chapter describes the basic processes for compiling, executing, and debugging with SN
Systems' tool ProDG for PSP and Microsoft Visual Studio.

Configuring the Target Manager

(1) Open the Target Manager from the Start menu.

(2) Click the "Add Target" button ( ) at the top left.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 22 -
SCE CONFIDENTIAL

(3) Enter the name of the PSP™ Hardware Tool and select the hardware. Select the
Development Tool (DTP-T1000) and click "Next >".

(4) Enter the IP address that is displayed on the PSP™ Hardware Tool controller screen,
and click "Next >".

(5) When you click the "Finish" button on the following screen, target setup is finished.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 23 -
SCE CONFIDENTIAL

(6) The target is now set up, so select the new target in the menu on the left and click
the "Connect" button ( ).
Verify in the information panel at the left that a connection was established with the
PSP™ Hardware Tool.

Compiling and Executing / Debugging the Application

This section describes the process for compiling a program in Visual Studio and using ProDG
to execute it on the PSP™ Hardware Tool.
Both Visual Studio 2005 and Visual Studio 2008 can be used. However, when a Visual Studio
2005 solution file is opened with Visual Studio 2008, the solution file conversion wizard is
launched in order to convert the solution file for use in Visual Studio 2008.

(1) Open %SCE_PSP_HW_ROOT%\devkit\samples\PSP Samples.sln.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 24 -
SCE CONFIDENTIAL

(2) Right click on the project that you want to build and select "Build." In this example,
Balloon is selected. To build all projects, use "Build Solution" in the "Build" menu.

(3) When building is complete, check whether any errors occurred. If there was an error
or warning, building may have failed.

(4) If the project is successfully compiled, the ProDG Debugger can be used to debug it
from Visual Studio. Right click on the project that was built and click "Set for startup
project."
To execute a project, use the "Execute project ELF file" button ( ) shown below.。

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 25 -
SCE CONFIDENTIAL

(5) To debug a project, select "Launch ELF in ProDG debugger" or "Load ELF in ProDG
debugger and stop execution in main."

Creating New ProDG VSI.NET PSP Projects

This section describes how to create a new project.


You can easily set up a project by using Visual Studio Integration, which is included in the
ProDG installer.

(1) Open the File menu and select "New" -> "Project."

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 26 -
SCE CONFIDENTIAL

(2) Select "ProDG VSI.NET PSP Project" for the Project type, and select "PSP Hardware
PRX" from the list of templates. Then enter the project name and folder and click "OK."

(3) To use the precompiled header function, which shortens the build time by compiling in
advance the header files to be used, select "Use precompiled header," verify that
"Stand-alone PRX" is selected, and click "Finish" to create the project.

When these tasks are complete, a new project will have been created, the compiler and linker
will be configured, and you should be able to create applications. Begin development by adding
source code, etc. to the newly created project file.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 27 -
SCE CONFIDENTIAL

7 Compiling and Executing Sample Programs


(Cygwin / Linux)

In the following descriptions, "sh >" indicates the prompt on the development host and "dstdb
>" indicates the dstdb command prompt.

Setting the SCE_PSP_SDK_HOME Environment Variable

Normally SCE_PSP_SDK_HOME should be set to the value “/usr/local/psp/devkit”. However,


by changing the value of this variable, you can easily switch to a different version of the
devkit.
[Example]
sh > cd /usr/local/psp
sh > ls -1
devkit ← (Version is x.x.x)
devkit-3.3.0
devkit-3.5.0
devkit-3.8.0
:
sh > export SCE_PSP_SDK_HOME=/usr/local/psp/devkit

In case you want to check the behavior using a different version of the devkit, simply type a
command such as the following and the devkit version will be switched.
[Example]
sh > export SCE_PSP_SDK_HOME=/usr/local/psp/devkit-3.3.0

Since the values of environment variables are lost when you logout (exit), you should add a
command such as that shown above to the login shell startup file.
When the login shell is BASH, enter the command shown above in ".bash_profile" under the
home directory (/home/users (users is arbitrary)).
To check your own login shell, execute the following.
(users is arbitrary)
sh > grep users /etc/passwd
users:x:501:100:users:/home/users:/bin/bash

Setting the PATH Environment Variable

Add /usr/local/psp/devkit/bin to the execution path.


When SCE_PSP_SDK_HOME is set as described above, it is convenient to set the PATH

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 28 -
SCE CONFIDENTIAL

environment variable as shown below. This command should also be added to the login shell
startup file. Note that when SCE_PSP_SDK_HOME is changed, PATH must be re-exported.
[Example]
sh > export PATH=$PATH:$SCE_PSP_SDK_HOME/bin

Setting the PSP_GCC_VERSION Environment Variable

After gcc is installed, the PSP_GCC_VERSION environment variable should be set as shown
below. Normally, the latest version of gcc is used, however, another version can easily be used
instead by simply setting the environment variable to the desired version. This command
should also be added to the login shell startup file.
[Example]
sh > cd /usr/local/psp
sh > ls -1
gcc-1.13.0
gcc-2.4.2
gcc-2.5.2
sh > export PSP_GCC_VERSION=gcc-1.13.0

Creating an Executable Image

Create an executable image on the development host. The following shows how to build the
sample code. The graphics sample named balloon is used as an example here.
sh > cd /usr/local/psp/devkit/sample/graphics/balloon
sh > make
This will also create the prx or elf files, which are executable images of the sample program.
If you do not have write access to the above path, copy the sample to a directory for which you
do have write access and modify the Makefile.
For example, enter the following commands.
sh > cd /home/users/test
sh > cp -r /usr/local/psp/devkit/sample/graphics/balloon gr_balloon
sh > cd gr_balloon
sh > vi Makefile … Open Makefile in the editor and change
SDK_TOP = ../../.. to SDK_TOP = /usr/local/psp/devkit
or SDK_TOP = $(SCE_PSP_SDK_HOME).
sh > make

Executing a Program

The Windows debugger pspdbg is used on Windows XP.


For information about how to use pspdbg, refer to the pspdbg help.
Since a GUI is used, operations are simple.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 29 -
SCE CONFIDENTIAL

If you are only interested in executing programs, the PRX Loader is convenient. It also has
functions for starting up system software and performing screen captures.

The following describes the commands to use to execute programs on Linux and Cygwin.
Since each command runs in its own window, execute the commands in separate windows. The
graphics sample named balloon is used here as an example.
XX.XX.XX.XX represents the IP address of the PSP™ Hardware Tool.

(1) Start up the dspcons terminal console in the first window on the development host. Any
directory can be used.
sh > dspcons -d XX.XX.XX.XX
dspcons (Version 2.24.21 Mon Feb 5 19:00:38 JST 2007)
target=SC display=S[0123456789K]TTYP,M[0123456789K]TTYP,STTYP keyboard=S0TTYP
escape=^]

(2) Open a separate window on the development host and change the directory.
sh > cd /usr/local/psp/devkit/sample/graphics/balloon

(3) Start up the dstdb debugger in the above window on the development host.
sh > dstdb -d XX.XX.XX.XX
dstdb (Version 2.24.21 Mon Feb 5 19:01:11 JST 2007)
node=SC dbgp=STDBGP filep=SDRFP0 loadp=SLOADP
*** DBGP Version 4.09
(type `help' for getting help, or `help help' for getting help of help)
dstdb 0?0>

(4) Beginning with version 5.0.0, the PSP™ boot code "kbooti.bin" was eliminated so it no
longer needs to be loaded.

(5) Use the reset command to reset the PSP™ Hardware Tool system from dstdb.
dstdb 0?0> reset 00000000

(6) When the boot code is started up, the following message is displayed on dspcons after
which a program can be loaded.
devkit version 0x03010110
(Development Tool Revision A)
Loading all modules ... Ready
Note: Do not execute the mstart command shown below until this message is output.

(7) Use mstart to load the program.


dsdtb 0R0> mstart balloon.prx

(8) Terminate the debugger.


dsdtb 0R0> quit

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 30 -
SCE CONFIDENTIAL

Debugging

The Windows debugger pspdbg is used on Windows XP.


For information about how to use pspdbg, refer to the pspdbg help.
Since a GUI is used, operations are simple.

The following provides a simple explanation of how to use the "dstdb" command to perform
debugging on Linux and Cygwin.
The file "balloon.prx" (/usr/local/psp/devkit/sample/graphics/balloon) is used as an example. To
load, execute and debug modules, the executable file and source file are required. The
following files are required for this example.
• Module image file "balloon.prx"
• Module source code "balloon.c"

(1) Change the directory and load the module file and symbol file.
sh > cd /usr/local/psp/devkit/sample/graphics/balloon
sh > dstdb -d XX.XX.XX.XX
dstdb 0?0> reset 00000000

dstdb 0R0> mload balloon.prx


Loading 601 symbols ...
dstdb 0R0> sload balloon.prx
Loading 601 symbols ...

(2) Display the module's source code.


If you know the function name, you can specify it directly. The function can also be specified
by using its address.
dstdb 0R0> list main
main.c:265
255 texture_mode=texture_next;
256 change=1;
257 }
258 prev_state=state;
259 proc_clouds();
260
261 frame++;
262 }
263
264 int main(void)
265 {
266 init_all();
267
268 while (pad_read()) {
269 draw_frame();
270 sceDisplayWaitVblankStart();

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 31 -
SCE CONFIDENTIAL

271 sceGuSwapBuffers();
272 frame_update();
273 }
274 sceGuTerm();
275
dstdb 0R0> list init_all
main.c:108
98 draw_balloon();
99 draw_clouds();
100
101 sceGumPopMatrix();
102
103 sceGuFinish();
104 sceGuSync(SCEGU_SYNC_FINISH, SCEGU_SYNC_WAIT);
105 }
106
107 static void init_all(void)
108 {
109 ScePspFVector3 vec;
110
111 sceGuInit();
112
113 sceGuStart(SCEGU_IMMEDIATE, disp_list, sizeof(disp_list));
114 sceGuDrawBuffer(SCEGU_PF8888, SCEGU_VRAM_BP32_0, SCEGU_VRAM_WIDTH);
115 sceGuDispBuffer(SCEGU_SCR_WIDTH, SCEGU_SCR_HEIGHT,
116 SCEGU_VRAM_BP32_1, SCEGU_VRAM_WIDTH);
117 sceGuDepthBuffer(SCEGU_VRAM_BP32_2, SCEGU_VRAM_WIDTH);

(3) Set a breakpoint within the loaded module code.


Set a breakpoint within the program code that is acquired in step (2) and proceed with
debugging. The number of lines can also be specified by using a colon ":" following the
source name as follows.
dstdb 0R0> bp main.c:111
$BP1=0x088ec830 <init_all+0x10> init=0x1 curr=0x1 # enabled, auto-init

(4) Execute the loaded module.


Execute the module up to the breakpoint that was set in step (3). To return control to the
debugger, press CTRL-G. The -d option of mstart is used for calling the entry point in debug
mode.
dstdb 0R0> mstart – d
*** PC=0x088ec830
*** Unexpected reply - type=BREAKR code=ff result=BRKPT
*** Target program stopped.
*** Abort
dstdb 0S0> list
main.c:111
101 sceGumPopMatrix();
102
103 sceGuFinish();

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 32 -
SCE CONFIDENTIAL

104 sceGuSync(SCEGU_SYNC_FINISH, SCEGU_SYNC_WAIT);


105 }
106
107 static void init_all(void)
108 {
109 ScePspFVector3 vec;
110
-> 111 sceGuInit();
112
113 sceGuStart(SCEGU_IMMEDIATE, disp_list, sizeof(disp_list));
114 sceGuDrawBuffer(SCEGU_PF8888, SCEGU_VRAM_BP32_0, SCEGU_VRAM_WIDTH);
115 sceGuDispBuffer(SCEGU_SCR_WIDTH, SCEGU_SCR_HEIGHT,
116 SCEGU_VRAM_BP32_1, SCEGU_VRAM_WIDTH);
117 sceGuDepthBuffer(SCEGU_VRAM_BP32_2, SCEGU_VRAM_WIDTH);
118
119 sceGuOffset(SCEGU_SCR_OFFSETX, SCEGU_SCR_OFFSETY);
120 sceGuViewport(2048, 2048, SCEGU_SCR_WIDTH, SCEGU_SCR_HEIGHT);
121 sceGuDepthRange(50000, 10000);

(5) Proceed with debugging.


You can find out the details of dstdb commands by typing the following.
dstdb 0S0> help

For example, the following commands are available.


For details, refer to the "dstdb Command Reference" and the "dsnet for PSP™ Overview."
These files are included in the runtime library documentation package.

Command Function
list [<adr> [<cnt> [<back>]]] Display source line
dr [-hf] [<reg>]... Display register
minfo [-i] [-a] [-uk] [<id>] Display module information
bp [<adr>[,<cnt>]]... Set breakpoint
ub [all|<adr>]... Cancel breakpoint
lstep [<cnt>] Perform step execution in terms of source lines
lnext [<cnt>] Perform next execution in terms of source lines (will
not enter functions)
luntil <line> Execute until the specified source line of the program
cont [<cnt>] Continue program execution
bt [<cnt>] Display backtrace
show [<show_args>]... Display various types of information
printf "<fmt>" [<args>]... Output formatted message

(6) Restarting
To restart the program, perform the steps again in dstdb beginning with the reset
command.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 33 -
SCE CONFIDENTIAL

8 Debugging Support Functions Provided by System


Software

System software on the PSP™ Hardware Tool has built-in debugging functions for supporting
PSP™ application development. (This is also true for the PSP™ Testing Tool (DTP-H2500(A) /
DTP-H1500 (A).)

Content Information Check Function

This function checks the various types of content listed below. For details, refer to the "Content
Information Check Function" document.

(1) UMD™
To check the integrity of UMD™ content information, select the UMD™ icon from the home
menu, then select " Check" from the menu that opens and press the triangle button.

(2) Saved Data


To check the integrity of saved data content information, select the desired saved data icon
from the home menu, then select " Check" from the menu that opens and press the
triangle button.

(3) Game Sharing


If the home menu shows that game sharing data was received, you can check the integrity
of the content information before starting up the game sharing data binary file.

(4) Memory Stick™ Startup Game


To check the integrity of Memory Stick™ startup game content information, select the
desired Memory Stick™ startup game icon from the home menu, then select " Check"
from the menu that opens and press the triangle button.

(5) Screenshot
To check the integrity of content information, select the desired screenshot icon from the
home menu, then select " Check" from the menu that opens and press the triangle
button.

(6) Title Store Preview


To check the status of store content for a particular title, select " Title Store Preview"
from the "PlayStation®Network" column of the home menu. The "Service ID" must be set
under " Debug Settings," which will be explained later.
(1) Title Store Preview (InGame)

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 34 -
SCE CONFIDENTIAL

Displays the In-Game Store catalog for the specified Service ID.
(2) Title Store Preview (Store)
Displays the Regional Store catalog for the specified Service ID.

Debug Settings

You can make debug settings by selecting "Settings" – " Debug Settings" from the home
menu. The settings will take effect when a disc is started up from the home menu. For
information on how to make debug settings for programs run from the debugger or the PRX
Loader, refer to the corresponding description of each tool. Always use the debug settings
function when you start development. Be careful that you don’t forget to use it at the start of
development and only become aware of the debug settings during later stages of development.

(1) Available Memory: ([32MB] / 64MB)


Use this setting to change the amount of memory that is available to the PSP™, for
example, when you need more memory for debugging.
Always perform pre-master verification in 32MB mode.
Set the mode to 32MB when using the UMD™ cache.
If the mode is set to 64MB, the UMD™ cache will be forcibly disabled.

(2) UMD™ Cache: ([Off] / On)


The UMD™ cache is available on a PSP-3000/PSP-2000 system. It can be checked on the
PSP™ Hardware Tool using either UMD™ or DVD-R media.
The memory mode must be set to 32MB to use the UMD™ cache.
When the UMD™ cache is enabled, the memory mode will be forcibly set to 32MB.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 35 -
SCE CONFIDENTIAL

(3) Button Behavior: (Enter / [Back])


You can set the behavior when the button is pressed to be either Enter or Back. The
behavior recognized by the PSP™ when the button is pressed differs depending on
where the game is sold. Confirm that the behavior matches the target sales region. Note
that the × button will have the opposite behavior of that of the button.

(4) USB GPS Driver: ([Release] / Debug)


This setting switches the USB GPS driver between release and debug modes. For details,
refer to the GPS emulator document.

(5) Flash® Player: ([Disable] / Enable)


This setting is used to enable or disable the Macromedia® Flash® Player in the Internet
browser without having to connect to the Internet.

(6) GPI6 Memory Stick™ Lock Emulation: ([Off] / On)


This setting enables or disables GPI6 switch control of Memory Stick™ LOCK emulation.
When this function is enabled and GPI6 is ON, an inserted Memory Stick™ will be
emulated as if the LOCK switch were on.

(7) DVD Mode Speed: ([UMD™ Almost Compatible] / DVD Maximum Speed)
This setting allows you to change the DVD-R read speed. The options are UMD™ Almost
Compatible, which emulates the read speed of a UMD™, and DVD Maximum Speed, which
is the maximum read speed of a DVD. Changing the read speed of a DVD-R during
operational testing may allow you to detect problems caused by disc read speed
dependencies.
Be careful when setting DVD Maximum Speed during development, because the read speed
of a DVD-R is faster than that of a UMD™. Since file seeks can now be emulated in UMD™
Almost Compatible mode, be sure to check data accesses in this mode before burning to
UMD™ media. Note that performing seeks on the UMD™ may lengthen the data access
time. Avoid implementations that read a large file all at once or that read multiple files at
different locations, because the read time may become extremely long for UMD™ even
though it won’t be noticeable with the DVD-R.

(8) UMD™/DVD Random Delay: ([Off] / On)


This setting allows you to randomly delay the reading of a DVD/UMD™. When this
function is enabled, reading from either a UMD™ or DVD-R will be randomly delayed for
up to 8 seconds. Enabling this function during operational testing may allow you to detect
problems caused by disc read speed dependencies.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 36 -
SCE CONFIDENTIAL

(9) WLAN Random Packet Drop: ([Off] / On)


This setting allows you to randomly drop communication packets over the wireless LAN.
When this function is enabled, a 5-second packet dropping interval will occur with a
probability of 10%. During that interval, communication will be blocked. This may allow
you to detect problems that might occur when communication errors are likely.
For details about the packet dropping operation, refer to the "ifhandle document."

(10) Memory Block Overflow Check: ([Off] / On)


This setting allows you to check for a memory block overflow. When this function is enabled,
you may be able to detect a memory block overflow. For example, when a data copy will
cause the amount of memory provided by the application to be exceeded, or when data is
written to an unallocated area, an error will occur. However, when this function is enabled,
a 256-byte check area is allocated whenever memory is allocated. This may cause an
application that has used up almost all of its memory to fail due to insufficient memory. In
that case, you should set the memory mode to 64MB to verify proper operation.

(11) WLAN coexistence max clock: ([222MHz] / 333MHz)


You can switch the maximum clock frequency when using the PSP™ system's WLAN
feature. When 333 MHz mode is set, the system will run like a PSP-2000 system or later.
By calling an API provided by SCE, you can change the clock frequency from a title and
make the system run at 333 MHz even when using the network.

(12) USB Serial : ([Off] / On)


This setting enables or disables the USB serial driver. When enabled, the functions of the
USB serial driver can be used. Always disable this to perform pre-master verification.

(13) Debugger Mode: ([DECI2p]/BSOD)


When launching an application (via the home menu) from a UMD™, DVD-R,
Memory Stick™, or via game sharing, this setting allows you to select whether to use a
BSOD like that of the DTP-H1500 instead of connecting to a debugger via the DECI2p
protocol.
When using a BSOD, functions that are implemented through communication with the host
CPU via the DECI2p protocol cannot be used. To use functions such as printf() or host0:
filesystem, select DECI2p.

(14) NP Environment: (sp-int)


This function sets PlayStation®Network environment variables. Currently, this value
should not be changed.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 37 -
SCE CONFIDENTIAL

(15) NP Debug: ([Off] / On)


This function supports the development of applications that use the PlayStation®Network.
Currently, the following function is available.
• Reduce the validity period of a sign-in ticket to 5 minutes
Although the validity period of a sign-in ticket is normally set to 24 hours, this function
reduces it to 5 minutes for debugging purposes. This function can be used, for example,
to test error handling when the sign-in ticket has expired.

(16) Service ID
This function supports the development of applications that use the PlayStation®Network.
If you set the service ID assigned to the title in Service ID, then select " Title Store
Preview" from the home menu, you can check the status of store content for a particular
title.

(17) NPDRM Debug: ([Off] / On)


This function supports application development for selling additional game data from the
PlayStation®Store. When enabled, it emulates the loss of ownership privileges for
additionally purchased game data (NPDRM EDATA, NPDRM SPRX). (This corresponds to
the operation of deleting all RIF files under ms0:/PSP/LICENSE/.) Use this function for
testing error handling. Note that this menu item cannot be used for testing the loss of
privileges for only a subset of the content. In these cases, follow the conventional method of
deleting the corresponding RIF files to verify operation when privileges are lost.

(18) Ad hoc SSID prefix:(PSP)


This item specifies the SSID prefix when establishing an ad hoc connection. It can be used
to debug an ad hoc party. Using it together with the identically-named Debug Settings item
that was added to system software version 3.00 of thePlayStation®3 Debugging Station
makes it possible to build an IBSS for an ad hoc party that can be joined only by the
PlayStation®3 Debugging Station and PSP™ system for which the identical value was set.
The default value is "PSP," and the length of the value string is always three characters.

Restrictions
This setting is ineffective when the SDK used to build the application is older than
version 2.00.

Install Package Function

You can obtain a PKG package from the Simple Authoring Service. To directly install a PKG
package on the PSP™ Development Tool without using the PlayStation®3 Development Tool,
select "Settings" - " Install Package" from the home menu. You can install up to 64 PKG

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 38 -
SCE CONFIDENTIAL

packages on the PSP™ Development Tool from the root directory of the Memory Stick™.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 39 -
SCE CONFIDENTIAL

9 Supplement

Maximum Size of PRX/ELF

The maximum size of a loadable user program is determined to the extent that the file and
layed out image fit in the area from 0x08804000 to 0x0a000000. Although the user space is 24
MiB, some of it is used by the service library. In addition, some memory is used for the heap
and stack.

Since the PRX file must be loaded in the remaining area, the maximum PRX size must satisfy
the relationship: remaining memory capacity > file size.
Since an ELF itself requires a fixed address, memory equal to the file size must be empty
starting from the ELF load address.

Amount of Memory Available to a Title Application

As mentioned above, the maximum available memory that can be used by a title application in
a product version is 24 MiB (this also includes the area used by service libraries, etc.).
However, for the purposes of debugging, 64MB mode can be used. In this case, since 8 MiB is
used as a reserved area besides the area used by the system, the actual amount of memory
available to the application is 48 MiB (this also includes the area used by service libraries,
etc.). Note that 64MB mode is disabled when the UMD™ Cache function is used.

When a Network Connection Problem Occurs

The first step to be taken if a network-related problem occurs (such as PSP™ Hardware Tool
authentication, connection, or updating problems) is to check whether you can ping the PSP™
Hardware Tool. To do this, open the Command Prompt and enter the following.
ping <PSP™ Hardware Tool IP address>
If a response does not arrive immediately, there is a problem with the network configuration
(proxy or firewall settings). Verify that the PSP™ Hardware Tool is on the same network as
the development host and that it is configured correctly. Then try disabling any firewall or
anti-virus programs. If the problem continues, re-enable your security software and contact
technical support.

©SCEI PSP™ Programmer Tool Runtime Library Release 6.6.0

- 40 -

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy