0% found this document useful (0 votes)
38 views28 pages

ProDG PSP VS - NET-E

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)
38 views28 pages

ProDG PSP VS - NET-E

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/ 28

User Guide to

ProDG for PSP® Visual


Studio .NET Integration

SN Systems Limited
Version 1.8.3
May 1, 2009
Copyright © Sony Computer Entertainment Inc. / SN Systems Ltd, 2003-2009.
"ProDG" is a registered trademark and the SN logo is a trademark of SN Systems Ltd.
"PSP" is a registered trademark of Sony Computer Entertainment Inc. "Microsoft",
"Visual Studio", "Win32" and "Windows" are registered trademarks of Microsoft
Corporation. "GNU" is a trademark of the Free Software Foundation. Other product
and company names mentioned herein may be the trademarks of their respective
owners.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 3
Contents

Contents
1: Visual Studio integration 5
Document version history 5
Overview of Visual Studio integration 5
Features 5
Known issues 6

2: Installation and configuration 7


Setting default directories and libraries 7
Controlling the build process of ProDG projects 8
Build Settings 8
Build Settings (Advanced) 9
General VSI settings 10
Integration with ProDG debugger v2.0 11
VSI online help 11

3: Working with projects 13


Creating a new project 13
Adding a new project configuration 13
Solution and project configurations 14
The ProDG VSI toolbar 14
Source file only tasks 15

4: Building with the SNC C/C++ Compiler 16


VSI project properties 16
General property page (project) 17
General property page (file) 17
SN-DBS property page 18
Debug/Tuner property page 18
Command line property pages 18
SNC C/C++ property pages (project and file) 19
General 19
Optimization 19
Code generation 20
Language 21
Precompiled headers 21
Command line 21
SNC Linker property pages (project) 22
General 22
Command line 23
Librarian property pages (project) 23
Building your ProDG project with the SNC C/C++ Compiler 23
Building a PRX file without symbols 24

5: Loading and running executable files 25


Integration with the ProDG Debugger 25
Setting breakpoints in your project 26
Editing your source in Visual Studio 26

6: Building projects from the command line 27


USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 4
Contents

Overview 27

7: Index 28
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 5
Visual Studio integration

1: Visual Studio integration

Document version history


Ver. Date Changes
1.8.3 Apr. 2009 Dropped support for Visual Studio 2003.
1.8.2 Sept. 2008 Updated all SNC property pages. Other minor updates.
1.8.0 July 2008 Updated 'Integration with the ProDG Debugger'.
1.8.0 June 2008 Updated 'Building projects from the command line'.
1.7.11 Apr. 2008 Updated 'Setting default directories and libraries','Creating a new
project', 'Building your ProDG project with the SNC C/C++
Compiler'.

Overview of Visual Studio integration


This manual describes how to integrate ProDG with Microsoft Visual Studio (2005
and 2008). Once you have successfully installed the ProDG Visual Studio integration
(VSI), you will be able to create ProDG projects in Visual Studio, then build and
debug them using the ProDG Debugger.

Features
VSI has the following main features:
„ Supports the SNC C/C++ Compiler.
„ Includes project AppWizards for all common project types.
„ Toolchain command-line switches, command-line arguments for the debugger
and executable, and fileserving paths, can all be set via a configuration dialog.
„ Supports configuration-specific properties, e.g. different linker scripts could be
used for debug and release builds.
„ Full source dependency checking for C, C++ and all assemblers during the build
process.
„ Outputs compiler and linker errors/warnings in Visual Studio format so that
double-clicking on a build error in the output window opens the source file on
the appropriate line in the Visual Studio editor.
„ Use MS Intellisense features when editing C and C++ source.
„ Enables the ProDG Debugger to be called directly from Visual Studio via a
toolbar button or the standard debugger start key (<F5> by default) to debug
the current project.
„ Imports and exports Visual Studio breakpoints (including all relevant properties
and exporting conditionals) at the start/end of a debug session in the ProDG
Debugger.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 6
Visual Studio integration

„ Ability to open source, shown in the ProDG Debugger source pane, in the Visual
Studio Editor to enable source file editing.

Known issues
„ Building of projects with source files of the same name but with differing
extensions is now possible. However, the object file names need to be manually
configured. By default, Visual Studio will automatically modify object file names
for C and C++ files to stop them overwriting each other. For example, file.c and
file.cpp will be compiled to file.obj and file1.obj to prevent a link error. This
automatic naming occurs if the Object File Name field has not been explicitly
specified in place of the default entry of $(IntDir)/. However, this automatic
naming does not occur for files other than C/C++ source files. So the files file.c
and file.s will both compile to file.obj and cause a link error, as Visual Studio
does not recognise file.s as a valid source file. To work around this the Object
File Name for file.s can be explicitly named so it does not clash with any other
files in the project. For example, $(IntDir)/file1.obj would work OK.
„ Breakpoints added to Visual Studio from the ProDG Debugger cannot be
removed by double-clicking on them in the source window. It has to be done
from the menu or Breakpoint Manager. This is a bug in Visual Studio.
„ Project dependencies are not on a per-solution configuration basis. This can be
an issue with multi-platform solutions when including platform-specific project
libraries. This is a restriction of Visual Studio.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 7
Installation and configuration

2: Installation and configuration


Prior to installing the VSI you must have first installed Microsoft Visual C++
(standard or above) and the Sony run-time libraries for PSP.
If you intend to use the XBox SDK (XDK) or Xenon SDK (XeDK), ensure you install
these before installing the VSI.

Setting default directories and libraries


You can specify default directories for where the build tools will look for header files
and libraries, as well as which libraries to link in for executable projects by default.
These defaults are used in addition to those specified in individual projects. To
specify these settings select Tools > Options > ProDG VSI > Directories and Libs
from the menu.
An Options dialog similar to the following is displayed:

The selection shown in Target dictates which particular target the settings relate to
when more than one ProDG target is available. Change this to the appropriate target
you wish to configure.
The selection in Show dictates which settings are displayed.
„ Include file directories – Directories that will be searched by the compiler for
included header files in your source code.
„ Library file directories – Directories that will be searched by the linker when
looking for included library files.
„ Standard libraries – The list of libraries to link with your executable project.

Note: The libraries and directories specified here will be used after those given in
the properties for your project.

To use the file and directory list:


„ To add an entry to a list, click the folder button above the directory window.
This will add a new line in the directory window.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 8
Installation and configuration

„ To remove a directory from a list, highlight it using your mouse, and then click
the delete button above the directory display.
„ To change the order of the entries in the list, click the up and down arrows to
change the position of the currently selected entry.
„ To check the validity of the directories in the list, click on the check button.

Controlling the build process of ProDG projects


You can configure the way the Visual Studio Integration controls the build process
when building all ProDG projects, by selecting Tools > Options > ProDG VSI > Build
Settings, and Build Settings (Advanced).

Build Settings

This dialog controls how information is displayed during a build, as well as whether
intermediate files are left afterwards.

Generate verbose Enables verbose output during compiling. Normal verbose displays
build information the tool command lines used, " More Verbose" turns on verbose
mode (-v) for tools as well.
Show object cache Cache hits are displayed in the Output window when files being
hits for SN-DBS compiled via the SN-DBS are fetched from the object cache. "Extra
Information" displays further information about the cache.
Leave Check this option to cause the compiler to save an assembler
intermediate listing.
assembler output
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 9
Installation and configuration

Build Settings (Advanced)

This dialog contains settings that affect the way projects are built, as well as what
happens when errors are encountered. The dialog is separated into three sections,
the VSI Build System, Local Build Settings, and SN-DBS Build Settings.
VSI Build System

Use VSI build New functionality in VSI 1.7 allows the VSI to control project and
system for ProDG solution builds completely. This allows quicker dependency
projects checking and support for building multiple projects in parallel. This
feature can be turned off to revert to the functionality from the 1.6
VSI. Some build features are not available when this option is not
selected.

Local Build Settings

Stop building on When selected, a local build will stop after the first error found in a
first error when project. Otherwise the build will continue which may generate more
building locally errors. If the VSI build system is not selected other projects in the
solution may still be built if a solution build was started, however.
Run tool chain at This option will run the tool chain executables at a lower than
below normal normal priority during a build. This can make a PC more responsive
process priority during a build, especially if a large number of files are being
compiled at once.
Maximum compile This setting specifies the number of files in each project that can
processes per be compiled at the same time when building locally.
project
Maximum number This setting specifies how many projects in a Solution can be built
of projects to in parallel when building locally.
build in parallel
when building
locally

Two different parameters can be adjusted that control how many compile processes
are run concurrently. The Maximum number of processes per project to spawn
while compiling sets the number of source files in each project that can be
compiled at the same time. By default, one build process will be spawned for each
'Processor' as reported by Windows. For a PC with a single core CPU, just one build
process will be spawned by default and so all files from a project will be compiled
serially. For PCs that have more than one core or CPU, or have a 'hyperthreading'
CPU, files will be compiled concurrently by default.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 10
Installation and configuration

Advanced: This behavior can be changed by unchecking the Default check box. The
number of processes can then be explicitly specified in the Maximum compile
processes per project edit box. Depending on your particular PC hardware set up,
you may find that increasing or even decreasing the value used provides some
performance increase. But too many processes could cause disk thrashing or use up
a large amount of RAM. Please note that this option does not have any effect during
builds when using SN-DBS.
The second parameter is the Maximum number of projects to build in parallel.
This can allow more than one project to be building at any one time. The benefit
from this is that while one project may be busy accessing the hard disk producing a
library, another can continue CPU-intensive compiling. Hard disk intensive tasks
such as linking and archiving are done serially so as to minimize disk thrashing.
There are two individual values for the parallel build setting: one is for local builds,
and another for SN-DBS builds.

Note: The maximum number of compile processes that can be running on a PC


during a local build is the product of the maximum number of processes per project
and the maximum number of projects to build in parallel.

SN-DBS Build Settings

Stop building on This is an equivalent of the local setting, except it is used when
first error when building with SN-DBS.
building with SN-
DBS
Maximum number This setting specifies how many projects in a Solution can be built
of projects to in parallel when building with SN-DBS. This value can typically be
build in parallel higher than with local builds.
when using SN-
DBS

General VSI settings


An option is available which allows you to force the VSI toolbar to be rebuilt the next
time that Visual Studio is restarted, by selecting Tools > Options > ProDG VSI >
General and selecting Rebuild ProDG VSI toolbar. This reverts the toolbar back to
its original configuration.
An Options dialog similar to the following is displayed:
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 11
Installation and configuration

Rebuild ProDG Forces the VSI toolbar to be redrawn when Visual Studio is next
VSI toolbar restarted.
Capture TTY text Selects whether the TTY text output by your program when "Load
to Output and run executable file" is used, is captured to the Output window.
window on
Execute

Integration with ProDG debugger v2.0


You can set which debugger is launched by the Visual Studio Integration when
debugging all your IRX and ELF projects, by selecting Tools > Options > ProDG VSI
> Configure PSP.
An Options dialog similar to the following is displayed:

Use v2.x of the If checked, uses ProDG Debugger v2.x. The debugger is launched
ProDG Debugger when Load ELF and Run ELF are selected from the VSI toolbar.
Disable If checked, when ProDG Debugger v2.x. is used this prevents the
breakpoint debugger from importing breakpoints set in your source code under
integration for Visual Studio.
v2.x Debugger

The debugger command line and other debugger settings can be set per project
under the Debugging page of the VSI Project Properties dialog. See "Debug/Tuner
property page" on page 18.

VSI online help


Clicking on the VSI toolbar button

will display the VSI version information and help dialog. As well as giving version
information on the VSI installation, it will also list the versions of the ProDG
Debugger and Build Tools.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 12
Installation and configuration

Clicking on the Help button in the dialog will display the online help document.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 13
Working with projects

3: Working with projects

Creating a new project


Once you have completed the set up steps you can create a new ProDG project in
Visual Studio by doing the following:
1. Click New in the File menu and click the Projects tab, and the following dialog
is displayed:

2. Select one of the project templates in the ProDG VSI PSP Projects folder:
PSP Overlay App
PSP Hardware Library
PSP Hardware PRX
3. Enter the name of your new project in the Name field.
4. In the Location field browse to the desired location for the new project file.
If the project source files are in a different location to the Visual Studio project
file, then Visual Studio will not be able to locate any included files even if they
are in the same directory as the source file. The solution (for this project
configuration) is:
„ For the SNC C/C++ Compiler use the VSI Project Properties dialog (see "VSI
project properties" on page 16).
5. Click OK.

Adding a new project configuration


You can add a new project configuration for any ProDG target to an existing project
that you have open. This adds new Debug and Release configurations for the
selected target to the project, and preserves any existing configurations. This
feature is especially useful when porting existing projects to new ProDG targets as it
does not require the creation from scratch of new projects for the purpose.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 14
Working with projects

This is done by following these steps:


1. Select the existing project in the Solution Explorer, and right-click to bring up
the shortcut menu.
2. Select Add and then Add New Item to open the selection dialog.
3. Open the ProDG folder and select Add Configs. A project configuration for any
installed ProDG target can be selected from the list available.
4. Click Open to add the selected configuration to your project.

Solution and project configurations


In addition to project configurations, Visual Studio contains solution configurations
which list which projects to build and which project configuration to use for each.
Select Configuration Manager from the Build menu option to display and manage
the solution and project configurations:

By default each new project is created with debug and release project
configurations. PSP projects also include debug optimized project configurations. At
the same time, solution configurations, with the same names, are also created if
these are not already present in the Solution Configuration list:

Debug unoptimized build containing symbol and debugging information


Release optimized build
Debug as Debug build, but with optimizations enabled
Opt

For example, a PSP Hardware PRX is created with three project configurations:
Debug, Release and Debug Opt. If a new solution is created for the project, then
corresponding solution configurations will also be created which will build each of
the project configurations. You can use the Configuration Manager to modify each
solution configuration, so that it only builds the projects you want, using the project
configuration you specify.

The ProDG VSI toolbar


Installing ProDG VSI creates a new toolbar, similar to the following:

Display VSI online help. See "VSI online help" on page 11.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 15
Working with projects

Display VSI Project Properties. See "VSI project properties" on page 16.

Load executable with ProDG Debugger and stop at main(). See "Integration with the
ProDG Debugger" on page 25.
Run executable with ProDG Debugger. See "Integration with the ProDG Debugger" on
page 25.
Load and run executable file. See "Loading and running executable files" on page 25.

Load executable in Tuner.

Build project using SN-DBS (Distributed Build System).

Build solution using SN-DBS (Distributed Build System).

When the VSI is building a ProDG project, this button is enabled to allow the build to
be cancelled.

Source file only tasks


A number of tasks can be done on individual source files in your projects. These are
accessed through menu items added to the bottom of the context menu for files
selected in the Solution Explorer window of the IDE.

Open in ProDG Displays the selected files in the currently open ProDG Debugger.
Debugger
Show File Each selected source file is run through the compiler to produce a
Preprocessed preprocessed file. The files will be compiled using the same project
settings used during a build. The generated files are then opened in
the IDE.
Show file Creates a disassembly file from the object files for the selected
Disassembly source files. The source files are compiled as necessary. The
generated files are then opened in the IDE.
ProDG VSI Displays VSI Project Properties dialog. See "VSI project properties"
Project on page 16.
Properties
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 16
Building with the SNC C/C++ Compiler

4: Building with the SNC C/C++


Compiler

VSI project properties


The VSI Project Properties dialog controls how a VSI project is built. It displays a
number of properties that can be modified to change how a whole project or its
individual files are built. The options chosen in the dialog can be applied to multiple
projects but only affect the currently active project configuration for each project
selected.

Note: You MUST view VSI project properties using the SN Systems VSI Project
Properties toolbar button (see "The ProDG VSI toolbar" on page 14). Other property
pages for the project may be accessed through standard Visual Studio menus, but
these will not necessarily show correct information.

To display the VSI Project Properties dialog:


1. Select one or more projects or individual source files in the Solution Explorer.
The selected items must be for SN C/C++ Compiler projects.
2. Click the VSI Project Properties button on the ProDG VSI toolbar. If the
selection was valid, the VSI Project Properties dialog will be displayed:

In the left pane, select a folder to display the property pages. The left pane
displays one or more folders that provide access to property pages, depending
on the selection made in Solution Explorer. The top-level property page is
always the General page. Its content depends on whether projects or files were
selected.
3. In the right pane, set the available properties you wish to change.
4. Click Report to generate a report of the project and file properties for the
current project configuration.
A report will be displayed in the Visual Studio files view, similar to this:
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 17
Building with the SNC C/C++ Compiler

5. Click OK to save the settings.


If an invalid selection is made in the Solution Explorer window when the VSI Project
Properties button is clicked (see step 2, above), then a dialog will be displayed
showing the message "There are no property pages for the selection".

General property page (project)


The General property page in the Configuration Properties folder that is displayed
when a project node is selected in Solution Explorer contains the following
properties:

Output Directory Specifies the directory where tools such as the linker will place
all final output files that are created during the build process.

Typically, this includes the output of tools such as the linker or


librarian.
Intermediate Directory Specifies the directory where tools such as the compiler will
place all intermediate files created during the build process.

Typically, this includes the output of tools such as the C/C++


compiler and assembler.
Extensions to Delete The Clean option (Build menu) deletes files from the
on Clean intermediate directory where a project's configuration is built.
Files with extensions specified with this property will be
deleted when Clean is run or when you perform a rebuild.

In addition to files of these extensions in the intermediate


directory, the build system will also delete any known output of
the build regardless of where it is located (including
intermediate outputs such as .obj files).

Note that you can specify wildcard characters.


Build Log File Specifies the build log file to write to when build logging is
enabled.
System Include Include system header files when dependency checking. System
Dependencies header files are indicated by the #include < > notation.
Exclude use of SN-DBS Do not allow a project to be built using SN Systems' Distributed
Build System (SN-DBS). Project will be built locally only.
Save Debugger Save the debugger settings into the project file so these can be
Properties in Project shared with other users.

General property page (file)


The General property page in the Configuration Properties folder that is displayed
when a file is selected in Solution Explorer contains the following properties:

Exclude From Build Specifies whether the file should be in the build for the current
configuration.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 18
Building with the SNC C/C++ Compiler

SN-DBS property page


Exclude use of SN-DBS Do not allow a project to be built using SN Systems' Distributed
Build System (SN-DBS). Project will be built locally only.
Additional Options for Specify additional command line options for SNDCC when
SNDCC performing SN-DBS builds.

Debug/Tuner property page


The Debug/Tuner property page in the Configuration Properties folder that is
displayed when a project node is selected in Solution Explorer contains the following
properties:

Executable File The path to the project's executable file.


Debug Command Line Command line switches passed to the debugger.
Debug Elf Arguments Command line arguments used when executing the ELF in the
debugger.
Run Command Line Command line switches passed to the command-line (run)
utility.
Run Elf Arguments Command line arguments used when executing the ELF by the
command-line (run) utility.
Tuner Command Line Command line switches passed to the Tuner.
Tuner Elf Arguments Command line arguments used when executing the ELF in the
Tuner.
File Serving Directory Specify the directory to use for file serving when executing the
ELF.
Home Directory Specify the directory to use as the home directory when
executing the ELF.
Reset Parameters Specifies the execution reset parameters to use when resetting
the PSP.
Soft Reset Perform a soft reset instead of a hard reset before debugging.
Clear TTY Clear all TTY streams before debugging the executable.

Command line property pages


Most property page folders contain a Command Line property page. This page
displays which properties are set in the folder. The Command Line property page
also contains an Additional Options box where you can specify properties that are
valid for the build tool but for which there is no property in the folder.
Any command that you enter in the edit box will be passed through to the tool for
the folder. No verification or checks will be done on the input, nor will there be any
dependency checking.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 19
Building with the SNC C/C++ Compiler

SNC C/C++ property pages (project and file)


The C/C++ property pages for SNC are divided into six sections: General,
Optimization, Code Generation, Language, Precompiled headers and Command
line.

General
Additional Specifies one or more directories to add to -I<path>
Include the include path; use semi-colon delimited
Directories list if more than one.
Preprocessor Specifies one or more preprocessor defines; -D<name=
Definitions use semi-colon delimited list if more than [value]>
one.
Force Includes Specifies one or more forced include files. -include <path>
Generate Debug Specifies if the compiler will generate -g
Information debugging information. You must also
change linker settings appropriately to
match.
Warnings Selects whether warnings and remarks are -Xdiag=0..2
issued during compilation; errors are
always displayed.
Treat Messages Enables the compiler to treat all warnings -Xquit=0..2
As Errors and remarks as errors.
Object File Specifies a name to override the default -o<filename>
Name object file name; can be file or directory
name.

Optimization
Optimization Select option for code optimization. -O0..5
Level
Pragmas Allow source code pragmas to increase the -Xflex=1
Override -Ox level of control-variables governed by the
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 20
Building with the SNC C/C++ Compiler

Level Settings Optimization level (-Ox) specified on the


command line; trades fine optimization
control for compile speed.
Inline Function Select the level of inline function expansion; -Xsinllev=0..5
Expansion functions declared as inline will be
expanded with increasing levels of
aggression.
Register Loop In loops, use a register to hold an array -Xcih=1
Optimization element computed in one iteration and
used in the next iteration (cross-iteration
hoisting).
Inline Intrinsic- Selects when intrinsic-routines should be -Xdeflib=0..2
Routines inlined where possible.
Disable Main Restrict main optimizations to individual -Xdomain=0
Optimizations top-level loops instead of over whole
Within Routines routines; trades code performance for
compile speed.
Allow FP Enables optimizations that rearange -Xfltacc=2
Expression floating-point expressions; can degrade the
Rearrangement accuracy of results.
FP Constant Evaluates expressions involving floating- -Xfltfold=0..2
Folding point constants during compilation rather
than during execution.
Assume No Assume that the effects of integer overflow -Xintedge=1
Integer during integer operations can be ignored in
Overflows applying optimizations.
Use Temps for Attempt to perform induction variable -Xivrep=1
Loop Induction replacement optimizations. Induction
Vars variables are variables that are used for
controlling loop iterations, or variables
derived from them.
Disable Assume that domain or range errors will not -Xsafeintr=1
Intrinsic occur in intrinsic routines.
Domain Error
Checks
FP Non-Numeric Selects whether optimizations may change -Xfltedge=1..3
Quiet the behavior of "quiet" computations that
Compilations deal with non-numeric values; applies to
computations that do not generate
exceptions.

Code generation
GP Specify the size in bytes that limits which -G0..x
Optimization data is considered "small". Data that is this
Data Size size or less will be put into the "small data"
section.
Template Controls the instantiation of template -Xtmpl=none | used |
Instantiation function and class definitions; see local | all | weak |
documentation for further information. linkonce +noautoincl
Initialized Data Data items that do not require link-time -Xbss=0..2
Placement initialization to specific non-zero values may
be placed in either the .data or .bss section.
Binary program files are smaller if such
items are placed in .bss, but compatibility
reasons may dictate placement in .data.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 21
Building with the SNC C/C++ Compiler

Assume Assume that double-word objects referred to -Xalnref=1


Double-Word indirectly may be misaligned, so that
Objects double-word load and store instructions
Misaligned cannot be used.
Single Precision Use single precision floating point -Xcmul=4
Complex operations in single precision complex
Multiplies multiplies; default is to use doubles.
Promote FP Implement single precision FP constants as -Xfltconst=8
Constants To doubles in contexts where a conversion
Doubles would normally occur before use.

Language
C/C++ Dialect Select the C/C++ dialect to govern which -Xc=mixed+gnu_ext |
language features are available during ansi | arm | cp | cfront
compilation. | knr
C/C++ Custom Specify a custom value to use for the C/C++ -Xc=<value>
Dialect Value dialect setting. This value overrides the
C/C++ Dialect property.
Enable C++ Enable exception handling in C++ code. -Xc+= exceptions
Exceptions
Enable Runtime Enable Runtime Type Information in C++ -Xc+=rtti
Type code.
Information
Default Char Sets whether the unqualified char type is -Xchar= unsigned
Unsigned treated as signed or unsigned.
Default FP Treat floating point constants without a 'F' -Xsingleconst=1
Constants as postfix as single precision float type; default
Type Float is the double type.
Built-In Defines the type the compiler should expect -Xsizet=uint | ulong |
Definition For for size_t; should match system include file's ushort
size_t Type definition.
Built-In Defines the type the compiler should expect -Xwchart=uint | ulong |
Definition For for wchar_t; should match system include ushort | uchar | int |
wchar_t Type file's definition. long | short | char |
schar
Disable AltiVec Disable the built-in functions that allow -Xaltivec=0
Intrinsics access to the AltiVec instruction set.

Precompiled headers
Create/Use Enables the creation and use of precompiled --create_pch |
Precompiled header file(s) during the build. --pch |
Headers --use_pch
Precompiled Specifies the path and name of the --create_pch=
Header File generated precompiled header file when not <header.pch>|
using automatic per file precompiled --use_pch=
headers. <header.pch>

Command line
Additional Specify additional command line options for
Options for SNC SNC not provided by the other properties;
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 22
Building with the SNC C/C++ Compiler

the options format must be valid for


PSPSNC.

SNC Linker property pages (project)

General
Output File Specifies the output file name. -o<file.elf>
Additional Specifies additional items to add to the link
Dependencies line; configuration specific.
Additional Specifies one or more additional paths to -L<dir>
Library search for libraries; configuration specific; use
Directories semi-colon delimited list if more than one.
Ignore All Ignore all default libraries during linking.
Default
Libraries
GP Specify the size in bytes that limits which data -Gx
Optimization is considered "small". Data that is this size or
Data Size less will be put into the "small data" section.
Debug Info and Enable debugging information stipping and -S |-s
Symbol also symbol stripping from the output
Stripping executable file.
Unused Enable the stripping of unused function code -strip-unused |
Function and and also data from the output executable file. -strip-unused-data
Data Stripping
Compress Causes redundant debug information to be -sn-compress-
Debug eliminated as your code is linked. This reduces debug
Information the size of your debug PRX/ELF files, plus
reduces link and debugger load times.
Export Library Specify the name of the Export library
generated by this project. When this project is
specified as a dependency of another, the
Export library will be linked in.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 23
Building with the SNC C/C++ Compiler

Generate Map Enable the generation of a map file for the -Map <file.map>
File output executable file; normal or full. [-sn-full-map]
Map File Name Specifies a name for the mapfile.
Link Library Specifies whether library outputs from project
Dependencies dependencies are automatically linked in.

Command line
Additional Specify additional command line options for
Options for the Linker not provided by the other
Linker properties; the options format must be valid
for PSPSNC.

Librarian property pages (project)


Output File Specifies the output file name. -o<file.elf>
Additional Specifies additional items to add to the link line;
Dependencies configuration specific.
Link Library Specifies whether library outputs from project
Dependencies dependencies are automatically linked in.

Building your ProDG project with the SNC C/C++


Compiler
With the Visual Studio integration you can build your ProDG project in the usual way
in Visual Studio. This section describes how to build your project and use the SN
C/C++ Compiler.
New projects are initialized with certain files as follows:

PSP Hardware PRX prxpreloads.txt, psp.ld


PSP Hardware Library <none>
PSP Overlay App libsnoverlay.l, overlaypaths.l, psp_overlay.ld,
overlay#.cpp

The files stdafx.cpp and stdafx.h files will also be added to your projects unless you
unselect the usage of pre-compiled headers in the project wizards.
The file prxpreloads.txt is provided to contain a list of PRX modules which are
preloaded by the debugger (using the -l<filename> switch).
You now need to add your project source files to the new project using the Add
Existing Item command on the Project menu. This brings up a file browser from
which you can select a file to add. The project source files needed by the project
makefile (.cpp, .c and .s, etc.) must all be added to the project before carrying out
the build.
Building your project is carried out as usual, by invoking the Clean, Compile and
Build (etc.) commands from the Visual Studio Build menu.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 24
Building with the SNC C/C++ Compiler

Switches for the SN C/C++ Compiler can be set for the project by using the property
pages available in the VSI Project Properties dialog. See "VSI project properties" on
page 16.

Building a PRX file without symbols


The SN Systems PRX build utility pspprxgen.exe is used to convert a relocatable ELF
file into a PRX module that can be run on the PSP hardware. In the Visual Studio
integration the following command line will always be used to build a PRX file:
pspprxgen "<output dir>/tempprx.obj" -r "<output dir>/<project name>.prx"
The -r option tells pspprxgen to leave all the symbols in the PRX file.
To remove the symbols from the PRX, for example, when building a PSP game for
final submission to SCE, the -o option needs to be used instead. In Visual Studio this
can be achieved by performing a post-build step with pspprxgen using the -o option
instead of -r.
1. Select Project > Properties. A properties dialog will appear.
2. Expand Build Events in the left-hand pane and select Post-Build Event. The
required command line can then be specified in the right-hand pane, e.g.:
pspprxgen "<output dir>/tempprx.obj" -o "<output dir>/<project
name>.prx"
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 25
Loading and running executable files

5: Loading and running


executable files
You can load and run your executable file by clicking the Execute PRX file button on
the ProDG VSI toolbar:

The TTY text generated by your executable running will be optionally displayed in
the Output window. This is selected on the Tools > Options > ProDG VSI > General
options dialog.
Alternatively, you can use the standard Start Without Debugging menu item from
the Debug menu, or by pressing CTRL+F5.

Integration with the ProDG Debugger


The ProDG Debugger can be invoked once you have successfully built your project in
Visual Studio, by clicking the Load PRX with ProDG Debugger and Stop at Main
button:

or by clicking the Run PRX with ProDG Debugger button on the VSI toolbar:

Alternatively, you can also use the following standard Debug menu items:
„ Start (<F5>) for Run PRX with ProDG Debugger
„ Step Into (<F11>)
„ Step Over (<F10>) for Load PRX with ProDG Debugger and Stop at Main
Note that the active project configuration will affect your ability to start ProDG
Debugger. When you click on the Execute PRX file button, ProDG Debugger will be
launched if the project was built with one of the ProDG build configurations as the
active project configuration AND the executable file has been successfully built.
ProDG Debugger is automatically launched with the following command line
switches:
pspdbg –vs –r –e

The –vs switch enables Visual Studio compatibility features (the -vs switch is
converted automatically to -vs7). The –r and –e switches reset the target and load
the executable contained in the built project PRX file. The execute switch -x is also
added for the Run PRX... operation. See User Guide to ProDG Debugger for more
information on debugger switches.
Note that when the ProDG Debugger has been started from Visual Studio, you can
click Import on the Options dialog in the Debugger to import various color settings
to match the current settings of Visual Studio.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 26
Loading and running executable files

Setting breakpoints in your project


When called from Visual Studio, ProDG Debugger automatically imports any
breakpoints that have been set in your source code in Visual Studio.
While ProDG Debugger is running, setting or modifying breakpoints in Visual Studio
has no effect on ProDG Debugger breakpoints, unless the PRX file is re-downloaded.
However, any breakpoints set in ProDG Debugger will be immediately reflected in
Visual Studio. Furthermore, in Visual Studio there is now a mechanism for
replicating breakpoints which have been enabled or disabled in ProDG Debugger. We
therefore recommend that you set or modify breakpoints only in the ProDG
Debugger source or disassembly panes. These breakpoints will be automatically
updated in your source files as viewed by Visual Studio.
When you exit ProDG Debugger, all of the breakpoints still set will be exported back
to Visual Studio.

Editing your source in Visual Studio


Any time you are debugging your project in ProDG Debugger you can switch from
the source pane to the Visual Studio editor. This can be done by moving to the part
of the file that you wish to edit, and clicking Edit in Visual Studio from the source
pane shortcut menu.
Any changes you make to the source will need to be rebuilt into a new PRX file. You
can then either restart ProDG Debugger from Visual Studio by clicking:
„ Start (<F5>) for Run PRX with ProDG Debugger
„ Step Into (<F11>)
„ Step Over (<F10>) for Load PRX with ProDG Debugger and Stop at Main
Note that whereas Start (<F5>) will run the PRX, Load PRX with ProDG Debugger
and Stop at Main will do an autorun to main().
Note that setting or unsetting breakpoints in Visual Studio, while ProDG Debugger is
running, will have no effect (see "Setting breakpoints in your project" on page 26).
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 27
Building projects from the command line

6: Building projects from the


command line

Overview
You can build ProDG projects from the command line in a similar way as you would
build a normal Win32 project. This is done by calling the vsibuild tool, located in
the $(SN_COMMON_PATH)\VSI \bin directory, and specifying the solution file (.sln)
and other options. All text output from the build will be output to stdout.
The following example builds the solution 'MySolution' with the "PSP Debug" solution
configuration:
vsibuild "Visual Studio Projects\MySolution\MySolution.sln" "PSP Debug"

If you have a solution platform associated with the solution configuration, you
specify this as part of the configuration name, e.g.:
vsibuild "Visual Studio Projects\MySolution\MySolution.sln" "Debug|PSP"

A solution can be built using SN-DBS (Distributed Build System) by specifying the
/sn-dbs command-line switch, e.g.:
vsibuild "Visual Studio Projects\MySolution\MySolution.sln" "Debug|PSP" /sn-
dbs
To rebuild a solution, use the /rebuild switch.
Please note that vsibuild can only be used to build solution configurations that
contain ProDG, makefile, and utility project configurations. It cannot at present build
project configurations like Win32. To build these configurations, you need to use
the devenv tool provided with Visual Studio. See the Visual Studio documentation
for further information. It is possible to build ProDG projects from the command line
by using devenv as well, but this feature is provided for backwards compatibility,
and is not recommended. Using devenv has a number of limitations when building
ProDG project, for example it is not possible to use SN-DBS v2.x.
Usage:
VsiBuild <"Solution File.sln"> <"Soutions Config [|Solution Platform]">
[/project "Project"] [Additional]

where [Additional] can be:

/rebuild Rebuilds the Solution or given Project.


/clean Cleans the Solution or given Project.
/sn-dbs Use the SN-DBS for builds.
/out Appends the build text to a specified file.
/projectonly Ignore a project's dependencies when using the /project switch.
/quiet Only output build text when warnings or errors occur.
/useenv Use the PATH environment variable instead of IDE VC++ Directories.
USER GUIDE TO PRODG FOR PSP VISUAL STUDIO .NET INTEGRATION 28
Index

7: Index
Integration with ProDG debugger v2.0 11
A Integration with the ProDG Debugger 25

Adding a new project configuration 13


K

B Known issues 6

Build Settings 8
L
Build Settings (Advanced) 9
Building a PRX file without symbols 24 Language 21
Building projects from the command line 27 Librarian property pages (project) 23
Building with the SNC C/C++ Compiler 16 Loading and running executable files 25
Building your ProDG project with the SNC
C/C++ Compiler 23 O
Optimization 19
C
Overview 27
Code generation 20 Overview of Visual Studio integration 5
Command line 22, 23
Command line property pages 18 P
Controlling the build process of ProDG
projects 8 Precompiled headers 21
Creating a new project 13
S
D Setting breakpoints in your project 26
Debug/Tuner property page 18 Setting default directories and libraries 7
Document version history 5 SNC C/C++ property pages (project and file)
19
SNC Linker property pages (project) 22
E
SN-DBS property page 18
Editing your source in Visual Studio 26 Solution and project configurations 14
Source file only tasks 15
F
T
Features 5
The ProDG VSI toolbar 14
G
V
General 19, 22
General property page (file) 17 Visual Studio integration 5
General property page (project) 17 VSI online help 12
General VSI settings 10 VSI project properties 16

I W
Installation and configuration 7 Working with projects 13

You might also like