Lesson 0 - Introduction to Playstation 3 programming



Similar documents
How to start creating a VoIP solution with Ozeki VoIP SIP SDK

Tutorial: Packaging your server build

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

Installing Windows Server Update Services (WSUS) on Windows Server 2012 R2 Essentials

Developing, Deploying, and Debugging Applications on Windows Embedded Standard 7

DEPLOYING A VISUAL BASIC.NET APPLICATION

Parental controls on Xbox 360, Xbox One, Nintendo Wii, PlayStation 3 and PlayStation 4

Compiler Setup and DirectX/OpenGL Setup

QuickStart Guide for Client Management. Version 8.7

INTERNAL USE ONLY (Set it to white if you do not need it)

Freescale Semiconductor, I

ProSystem fx Workpaper Manager. Installation Guide

MatrixSSL Getting Started

Password Reset PRO INSTALLATION GUIDE

Deploying Microsoft Operations Manager with the BIG-IP system and icontrol

Plena Voice Alarm System Firmware update

Setting Up Your Android Development Environment. For Mac OS X (10.6.8) v1.0. By GoNorthWest. 3 April 2012

Introduction to the use of the environment of Microsoft Visual Studio 2008

Xcode Project Management Guide. (Legacy)

Zynq-7000 Platform Software Development Using the ARM DS-5 Toolchain Authors: Simon George and Prushothaman Palanichamy

ProSystem fx Engagement. Installation Guide

Media Control Server MCS-EX Integration Guide for RTI Control Systems

SIM900_Custom Application Building Tutorial_Application Note_V1.00

Installing Ruby on Windows XP

INSTALLATION GUIDE ENTERPRISE DYNAMICS 9.0

NetBeans IDE Field Guide

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

How To Develop For A Powergen 2.2 (Tegra) With Nsight) And Gbd (Gbd) On A Quadriplegic (Powergen) Powergen Powergen 3

Example Program for Crestron - Setup Guide -

Integrated Virtual Debugger for Visual Studio Developer s Guide VMware Workstation 8.0

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

Installation Guide. Version 1.5. May 2015 Edition ICS Learning Group

FileMaker 11. ODBC and JDBC Guide

Studio 5.0 User s Guide

1. Central Monitoring System Software

Authoring for System Center 2012 Operations Manager

1) SETUP ANDROID STUDIO

New Technology Introduction: Android Studio with PushBot

2012 Nolio Ltd. All rights reserved

BitDefender Security for Exchange

Orange Apps UserLogonUSB V1.0

Determining Your MAC Address in Windows XP

Using Microsoft Visual Studio API Reference

Safe Connect Game Console Detection

Quartz.Net Scheduler in Depth

Upgrading Your Web Server from ClientBase Browser Version 2.0 or Above to Version 2.1.1

Enterprise Content Management System Monitor. Server Debugging Guide CENIT AG Bettighofer, Stefan

1. Central Monitoring System Software

Development_Setting. Step I: Create an Android Project

1. Central Monitoring System Software

Call Center - Purchased Solution 64 Bit Installation Instructions

LifeSize Control Installation Guide

Android: Setup Hello, World: Android Edition. due by noon ET on Wed 2/22. Ingredients.

Programming with the Dev C++ IDE

Developing an Application on Core8051s IP-Based Embedded Processor System Using Firmware Catalog Drivers. User s Guide

How To Install An Aneka Cloud On A Windows 7 Computer (For Free)

NxE Information and Configuration Tool Technical Bulletin Code No. LIT Software Release 7.0 Issued December 5, 2014

INFORMIX - Data Director for Visual Basic. Version 3.5

Code::Block manual. for CS101x course. Department of Computer Science and Engineering Indian Institute of Technology - Bombay Mumbai

4.1 Introduction 4.2 Explain the purpose of an operating system Describe characteristics of modern operating systems Control Hardware Access

INFUSION BUSINESS SOFTWARE Installation and Upgrade Guide

Configuration Guide. Installation and. BlackBerry Enterprise Server Resource Kit. Version: 5.0 Service Pack: 4

NETWRIX CHANGE NOTIFIER

IP Camera Centralization Management. Client Application. (IPCMonitor) Feb, 2013 Version 1.9. User Manual

MEDIA CONTROL SERVER 2.0

Waspmote IDE. User Guide

Tutorial on Basic Android Setup

System Area Manager. Remote Management

Using Microsoft Visual C++ Developer Studio

Embedded Linux development with Buildroot training 3-day session

User Guide for Windows 10

Chapter 1. Introduction to ios Development. Objectives: Touch on the history of ios and the devices that support this operating system.

HAHTsite IDE and IP Installation Guide

AdminToys Suite. Installation & Setup Guide

intertrax Suite resource MGR Web

Installation and Configuration Guide

Server Installation Manual 4.4.1

HP Client Automation Standard Fast Track guide

Section 5 Configuring the Partition for Enterprise Output Manager (EOM)

Symantec NetBackup Getting Started Guide. Release 7.1

Eclipse.org CDT and Cygwin: A Tutorial on Installation and Functionality

ProSystem fx Engagement Installation Guide

FileMaker 12. ODBC and JDBC Guide

eggon SDK for ios 7 Integration Instructions

Using DAVE with MDK Version 5

Education Software Installer 2015

Creating a Java application using Perfect Developer and the Java Develo...

Password Reset PRO. Quick Setup Guide for Single Server or Two-Tier Installation

Quick Deployment Step-by-step instructions to deploy Oracle Big Data Lite Virtual Machine

Receptionist-Small Business Administrator guide

How to test and debug an ASP.NET application

IRF2000 IWL3000 SRC1000 Application Note - Develop your own Apps with OSGi - getting started

Making console games in Unity Tomas Jakubauskas

Team Foundation Server 2013 Installation Guide

Install Pocket Inventory in a Windows Server 2003 R2 Standard Environment

Server. Version 3.7 Users Guide. Revised 5/28/03

Pearl Echo Installation Checklist

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

Transcription:

Lesson 0 - Introduction to Playstation 3 programming Summary A brief overview of the Playstation 3 development environment, and how to set up a PS3 project solution to run on the PS3 Devkits. New Concepts Using the ProDG Target Manager, ELF and SELF files, APP HOME directory, PPU and SPU programming Introduction Writing basic programs to run on the Playstation 3 is simple - it has fully ANSI C/C++ compliant compilers, so the previous tutorials should just compile and run straight away. However, unlocking the full potential of the Playstation 3 hardware requires efficiently using the 6 Synergistic Processing Units, and that is a much more difficult task. The development environment is also slightly different than you will be used to, despite being based on Visual Studio. These tutorials will show you how to compile and run programs on the PS3 and how to use the SPUs for various tasks, before moving on to programming the graphics hardware, reading input from the joypad, and finally how to output sound. Development Environment Playstation 3 SDK The Playstation 3 SDK consists of the headers and libraries you ll use when programming, example code, extensive documentation of the provided APIs, and Visual Studio integration. This integration is provided by the SN Systems ProDG product suite, which has everything you need to compile, run, and debug code created in Visual Studio on the Playstation 3. It also includes the software required to interface with a PS3 Devkit, the ProDG Target Manager. For the Visual Studio integration to work, you ll need Visual Studio 2003, 2005, or 2008 ; 2010 is currently unsupported. Playstation 3 Devkits The Playstation 3 Development Kits we have are DECR-1400A models - the most up-to-date devkits that Sony provide. Externally, they look pretty much the same as the original 60GB retail Playstation 3s, but with an additional LAN port on the back, used to send and receive development code and debug data. Internally, they have 512MB of system RAM compared to the 256MB in retail units, and have custom firmware, which among other things, provides access to terminal output and disables BLURAY and DVD movie playback. They can load and play PS3 games just as a normal retail PS3 can, and otherwise act just like the PS3 consoles you are used to. ProDG Target Manager Connecting to, and controlling the Devkits is done using the ProDG Target Manager. The Target Manager allows you to see terminal output, take screen grabs of the video output, and remote control various aspects of the devkits. For example, it allows you to reset the devkit remotely - useful if it s in a different room (on a different floor!), and you ve just ran some broken code on it. 1

API Documentation Sony include extensive documentation for almost everything in their SDK. It can be searched through by using the quick find e catalog, found in the SDK install folder (By default this folder will be C:/usr/local/cell). Try it! use quick find e and search for Target Manager or SELF, you ll find lots of references to the new things being introduced to you here. Throughout the rest of the tutorials, you ll find lots of references to Sony SDK API functions - although their basic usage will be explained in each tutorial, you are encouraged to use the API documentation to learn more about what these functions do and what parameters they need. File formats Although you will be using Visual Studio to develop PS3 applications, the underlying programs used when compiling your code are different, and they don t output the.exe and.lib files you might be used to. Instead, whether you are writing PPU or SPU programs, you will be dealing with elf files. So what s an elf file? Elf stands for Executable and Linkable Format, which as the name suggests, is a format to represent executables and libraries - both static and dynamicly linked. It s quite a popular file format in UNIX, and is used by both Sony and Nintendo for their games consoles. More specifically, we will be using Signed ELF (SELF) files. As part of the Digital Rights Management scheme used on the Playstation 3, all executables must be digitally signed by Sony before they ll run on a PS3. The PS3 Devkits we will be using will also run fake signed code, which is generated behind the scenes when compiling PS3 software with the PS3 SDK. Running programs Running PPU programs is easy - if you ve set up your Target Manager correctly, you can run your PPU program just as you would a Windows program. The ProDG Debugger will connect to the devkit, reset it, and make it load in your compiled ELF file. From the target manager, you can see the console output of your program, and take snapshots of what your program is sending to the video out - handyif your devkit isn t connected to a monitor and you want to check your graphics code is working. Running SPU programs is less easy - you have to load your SPU program in from inside a PPU program, and execute it from there. If you ve ever loaded in a.dll file at runtime in one of your programs, you can think of SPU programs as just being very special dll files that only run on SPUs. We ll cover how to load in these SPU files in the first proper tutorial, but for now we ll look at where to put SPU SELF files to get them loaded in. APP HOME When you run a program on the PS3 devkits, they need to know where to look for files - whether they be game assets like textures and sound files, or the SPU programs that will run during your programs execution. In a real game, this would be the Blu-ray drive and the hard drive, but when compiling code to run on the devkits, it s APP HOME - a special function of the Target Manager that points to a folder on your computer. The devkit can then use this folder just as it would its Blu-ray or hard drive. You can set the folder used as APP HOME in the Target Manager, or directly from in Visual Studio. Doing it from Visual Studio is recommended, as then you can easily have a seperate APP HOME per project. 2

Visual Studio Projects Some tutorials will require you to create both a PPU and an SPU project. In these cases, I suggest using the same name for both projects, suffixed with PPU or SPU as required. For example, in our next tutorial, we will be creating a Hello World program that requires both PPU and SPU projects - I name them HelloWorldPPU and HelloWorldSPU. Such nomenclature helps keep track of which projects are related, and what type of processor they are being compiled for. Easy to see that these projects are related... Along the same lines, when naming.cpp files in such PPU/SPU combined projects, I append ppu or spu as appropriate (main.ppu.cpp, main.spu.cpp etc). This helps keep track of what file is being edited when dealing with multi-project solutions. What s going on here? Ah! One is the PPU project, the other the SPU project 3

Appendices Appendix A: Connecting to a PS3 Devkit Step 1) Start the ProDG Target Manager, click File, then click Add Target... Step 2) Choose a name for the devkit, and select Reference tool (DECR-1400J / DECR-1400A) then click Next 4

Step 3) Enter the IP address of the devkit you wish to add, and click Next, then click Finish Step 4) The devkit should then appear under My Targets in the ProDG Target Manager, and can be connected to by right clicking on the devkit, and selecting Connect 5

Appendix B: Creating a PPU Project Step 1) Open Visual Studio 2008, click File, highlight New, and click Project... Step 2) Click ProDG VSI.NET PS3 Projects, click PS3 PPU Elf, choose a name and location for your new project, and click OK. Simple! 6

Appendix C: Creating an SPU Project Step 1) Open Visual Studio 2008, click File, highlight New, and click Project... Step 2) Click ProDG VSI.NET PS3 Projects, click PS3 SPU Elf, choose a name and location for your new project, and click OK 7

Note: These steps are optional, but are recommended if you don t want to manually move around the SPU.elf file every time you compile it. Step 3) Right click on your Solution in the Solution Explorer, and select Properties Step 4) Click the Configuration drop down box and select All Configurations. Under Configuration Properties select Build Events and then Post-Build Event. Click on Command Line, and add the following line underneath the make fself command. copy $(ProjectDir)$(TargetName).self../<PPU Project>/$(TargetName).self Replace the term <PPU Project> with the folder name of the PPU project you want to run the SPU program from, then click OK. 8

Step 5) Set the project dependencies of the PPU project that uses your SPU code so that it depends on the SPU project. This will make the SPU project automatically compile and copy the updated SELF file when necessary. 9

Appendix D: Setting the APP HOME directory If your program uses external assets such as sound files or textures, it must know where these files are kept. To do this, we set a home directory to indicate where to find such resources. Step 1) Right click on your Solution in the Solution Explorer, and select ProDG VSI Project Properties Step 2) Under Configuration Properties, click Debug/Tuner and choose locations for the File Serving Directory and the Home Directory, then click OK. Generally I use $(ProjectDir), a macro which will set the directories to wherever your project solution is saved to. 10