Page 1
PlayStationPortable Documentation (not quite worth printing - yet) 16th January 2006 this is the result of myself pasting together various freely available documents aswell as adding some of my own findings. have fun... additions and corrections welcome :) THIS IS WORK IN PROGRESS! INFORMATION CONTAINED IN THIS DOCUMENT MAY BE MISSING, INCOMPLETE OR EVEN PLAIN WRONG! NO F****N’...
(since it is little endian). if known (from patents or other freely available sources) we use the same terminology as Sony does, in particular we try to use the same names and abbreviations for hardware registers, signals and the like as a weak attempt of providing consistency with other existing documentation.
Page 13
1 INTRODUCTIONAL RANT Description Symbol logical or bitwhise AND & logical or bitwhise OR logical or bitwhise exclusive OR logical or bitwhise NOT (inverse) equality or assignment addition substraction multiplication division please notice that -outside code- we do not make a difference between logical and bitwhise operations. if in doubt the opera- tion is bitwhise, it should however be clearly visible from the context.
2 SYSTEM OVERVIEW 2 System Overview 2.1 Playstation Portable Main Unit Main CPU (System clock frequency 1~333MHz), MIPS32R2 ’Allegrex’ core (little endian) Media Engine CPU (System clock frequency 1~333MHz), MIPS32R2 core (little endian) Main Memory 32MB (DDR SDRAM) Flash Memory 32MB Embedded DRAM 4MB 4.3 inch wide 16:9 high resolution TFT LCD screen, 480 x 272 pixel, 16.77 million colors, backlight, Maximum luminance 180 / 130 / 80cd/m2 (when using battery pack), 200 / 180 / 80cd/m2 (when using AC adaptor)
2 SYSTEM OVERVIEW 2.3 Supplied accessories AC adaptor (PSP-100) Battery pack (PSP-110) 2.4 Separately Sold Accessories 2.4.1 Memory Stick Duo (PSP-M32) Copyright protection technology : MagicGateTM Capacity: 32MB to 32GB supported Recommended Retail Price 2,800 yen (2,940 yen tax inclusive) Dimensions: Approximately 20mm (W) x 1.6mm (H) x 31mm (D) Weight: Approximately 2g 2.4.2 AC adaptor (PSP-100)
6 grams Dimensions: 50x10x10mm 2.5 Development Hardware (DEM-100) 64MB Main Memory instead of 32MB 3 Hardware Overview 3.1 Semiconductors SONY A2707GL 504C28H Manufacturer: Sony Part Number: A2703GL National Semiconductors JM49SW L00053B SN10 5257 TI 52W Z422 Fairchild Semiconductors...
Page 18
Manufacturer: Fujitsu Part Number: MB44C001 Freescale semiconductors Freescale semiconductors SC901583EP SC901583EP MXAJ0450 MXAA0445 Manufacturer: Motorola Part Number: SC901583EP Graphics Processor Chip (MIPS CPU, 2MB embedded RAM) Sony Computer Sony Computer Entertainment Inc. Entertainment Inc. CXD2962GG CXD2962GG (C)2004SCEI (C)2004SCEI 509E90E 445801E 644031...
Page 19
3 HARDWARE OVERVIEW R0...RH - Nineteen tuned-path traces leading over to the main processor. These appear to be address/control lines? D0...D7 - 8-bit bus that leads from main processor, past button-cell and up from below (south of) the NAND chip.This could be an 8-bit data bus? J0...J6 - 7-bit bus emerging from VIAs near button cell, leading around to the north side of the NAND chip.
3 HARDWARE OVERVIEW g - Indicates pins that are connected directly to the ground plane. Media Engine (MIPS CPU, 2MB embedded RAM) Sony Computer Entertainment Inc. CXD1876 (C)2004SCEI -102GG 508C10E 280221 Manufacturer: Sony Part Number: CXD1876 RTC, ... (C)2004 BAR14...
3 HARDWARE OVERVIEW Crystal oscillator 27 MHz 2700L E52QA Crystal 4 MHz [M] 4.00B Crystal 32.768 KHz A507Y 3.3 Headphones/Remote Control The headphone jack is a standard 3.5mm stereo, but there is also a small 6 pin connector next to it for the "remote control" that is included in the Value Pack.
Page 22
3 HARDWARE OVERVIEW Signal Description IN, Serial protocol bus state signal IN/OUT, Serial protocol data signal unused/reserved Stick insertion/extraction detect unused/reserved SCLK IN, Serial protocol clock signal...
4 CPU OVERVIEW 4.2 COP0 (System Control) 4.2.1 mfc/mtc badvaddr virtual address of last error/exception count system counter compare counter comparison value status system status cause exception cause exception program counter prid processor revision id config configuration SC-code SC-code < < 2 CPU ID (0=Main, 1=ME) Ebase virtual address of exception vector...
4 CPU OVERVIEW 4.2.2 cfc/ctc COP0.EPC COP0.ErrorEPC COP0.Status COP0.Cause GPR.v0 |GPR.v1 GPR.v0 GPR.v1 EXC vector table EXC_31_ERROR handler EXC_8_SYSCALL handler (1st) syscalls table (1st) max syscall code GPR.sp KERNEL/intr GPR.sp USER current TCB ?!? NMI vector table COP0.Status COP0.Cause profiler hw base addr Ex.GPR.v0 4.3 COP1 (FPU) 32 32bit General Purpose Floatingpoint Registers (FPR0-FPR31)
Page 26
4 CPU OVERVIEW 2x2 matrix 3x3 matrix 4x4 matrix And if that weren’t enough, it can work with matrices in normal or transposed orders. The registers are grouped into 8 blocks of 16 registers each. This gives you enough room to work with 8 4x4 matrices, 8 3x3 matrices, 32 2x2 matrices.
4 CPU OVERVIEW 4.7.1 ??? 4.7.2 mfic / mtic mfic move from IC (Interrupt) register mfic rt,rd mtic move to IC (Interrupt) register mtic rt,rd mfic $v0, zero to save the interrupt state in v0 mtic zero, zero to disable them mtic $a0, zero to renable based on the original mask in a0 4.8 VFPU Instructions...
4 CPU OVERVIEW *1) bit 5 of rs is inverted VFPU load/store instructions seem to support only 16-byte-aligned accesses (similiar to Altivec and SSE). 4.8.1 lv LoadVector Quadword Relative to Address in General Purpose Register fpu_vtr <- vector_at_address (offset + %gpr) lv.q %vfpu_rt, offset(%base) VFPU Vector Target Register (column0-31/row32-63) %fpu_rt...
4 CPU OVERVIEW 4.8.19 vcst vcst StoreConstant (Single/Pair/Triple/Quad) vfpu_regs[%vfpu_rd] <- constants[%a] store constant into single vcst.s %vfpu_rd, %a store constant into pair vcst.p %vfpu_rd, %a store constant into triple vcst.t %vfpu_rd, %a store constant into quad vcst.q %vfpu_rd, %a VFPU Vector Destination Register ([s|p|t|q]reg 0..127) %vfpu_rd VFPU Constant Constant...
5 MEDIA ENGINE 5 Media Engine 5.1 Overview System RAM is mapped at 0x88000000 and is all accessable Local RAM is mapped at 0x80000000 Video RAM appears to be inaccessable, at least at the usual address. looks like the exception handler location is set by loading cop0 register 25 (usually perfcnt) with the address of your handler...
6 VME 6 VME The VME (Virtual Mobile Engine) is a reconfigurable processor to decode audio/video. in 2002, Sony developed the Virtual Mobile Engine? as a method for achieving significant power reductions and miniaturization in LSIs for audio/visual products. This circuit technology, which can reduce power consumption by approximately 1/4 over conventional general-purpose digital signal processors (DSP), was adopted for use in the CXR704060 LSI used in the Network Walkman "NW-MS70D".
8 HARDWARE REGISTERS 8 Hardware Registers 8.1 Profiler Registerblock Base Size of Registerblock common access size 32 bit 0xbc400000 ENABLE 0xbc400000 ........ bit(s) description profiling disabled profiling enabled first clear all counter registers by writing 0 to them, then enable profiling. counter registers are as follows: Address Unit Description...
8 HARDWARE REGISTERS Port Clear 0xbe24000C ........ bit(s) description 8.5 Headphone/Remote SIO Registerblock Base Size of Registerblock common access size 32 bit 0xbe500000 FIFO 0xbe500000 ........ bit(s) description read byte from recieve buffer...
Page 51
8 HARDWARE REGISTERS CONTROL 0xbe50002c ........ bit(s) description ? (set to 1 if you want to set baudrate) ? (set to 1 if you want to set baudrate)
9 EXCEPTION AND INTERUPT PROCESSING 9 Exception and Interupt Processing 9.1 Exception Cause The cause of the exception that was raised can be determined by the value of the cause register (causereg > > 2 to be specific) which has the following meaning: Interrupt TLB modification...
Page 53
9 EXCEPTION AND INTERUPT PROCESSING 8801CDCC: 00 68 02 40 mfc0 $v0, $13 ; get c0.13 (Cause) 8801CDD0: 00 F0 03 40 mfc0 $v1, $30 ; get c0.30 (ErrorEPC) get Error Exception Program Counter 8801CDD4: 00 A0 C2 40 ctc0 $v0, $20 ; save v0 (Cause) in cc0.20 8801CDD8: 00 08 C3 40 ctc0 $v1, $1 ;...
10 VIDEO PROCESSING 10 Video Processing 10.1 Overview vram is located at 0x04000000 Pixel format is 16 bit BGR (ABBBBBGGGGGRRRRR.) or 32 bit visible Screen is 480*272 pixel virtual Screensize is 512*272 pixel...
11 3D GRAPHICS PROCESSING 11 3D Graphics Processing 11.1 GE Command Format Each command word is divided into two parts, a 8-bit command and a 24-bit argument. The command is in the upper part of the word, and the argument in the lower. The argument can be either integer of a special kind of float that the GE supports (described below). 11.2 GE Floats Floats processed in the command-stream are 24 bits instead of 32 that are used by the CPU.
Page 59
11 3D GRAPHICS PROCESSING Texture Mapping Enable 0x1E Fog Enable 0x1F Dither Enable 0x20 Alpha Blend Enable 0x21 Alpha Test Enable 0x22 Depth Test Enable 0x23 Stencil Test Enable 0x24 Anitaliasing Enable 0x25 Patch Cull Enable 0x26 Color Test Enable 0x27 Logical Operation Enable 0x28...
Page 60
11 3D GRAPHICS PROCESSING Ambient Model Alpha 0x58 0x59 0x5A Specular Power 0x5B SPOW Ambient Light Color 0x5C Ambient Light Alpha 0x5D Light Model 0x5E LMODE Light Type 0 0x5F Light Type 1 0x60 Light Type 2 0x61 Light Type 3 0x62 Light X Position 0 0x63...
Page 61
11 3D GRAPHICS PROCESSING Ambient Light Color 1 0x92 ALC1 Diffuse Light Color 1 0x93 DLC1 Specular Light Color 1 0x94 SLC1 Ambient Light Color 2 0x95 ALC2 Diffuse Light Color 2 0x96 DLC2 Specular Light Color 2 0x97 SLC2 Ambient Light Color 3 0x98 ALC3...
Page 62
11 3D GRAPHICS PROCESSING Texture Sync 0xCC TSYNC Fog Far (???) 0xCD FFAR Fog Range 0xCE FDIST Fog Color 0xCF FCOL Texture Slope 0xD0 TSLOPE 0xD1 Frame Buffer Pixel Storage Mode 0xD2 Clear Flags 0xD3 CLEAR Scissor Region Start 0xD4 SCISSOR1 Scissor Region End 0xD5...
11 3D GRAPHICS PROCESSING 11.5.14 BASE BASE Base Address Register 0x10 ........ bit(s) description 16-20 4 most significant bits for address (28 bits total)
11 3D GRAPHICS PROCESSING 11.5.15 VTYPE VTYPE - Vertex Type 0x12 ........ bit(s) description Bypass Transform Pipeline Transformed Coordinates Raw Coordinates 18-20 Number of vertices (Morphing) 000-111: 1-8 vertices 14-16 Number of weights (Skinning) 000-111: 1-8 weights 11-12 Index Format...
11 3D GRAPHICS PROCESSING 11.5.16 REGION1 REGION1 - Draw Region Start 0x15 ........ bit(s) description 10-19 Y Start X Start 11.5.17 REGION2 REGION2 - Draw Region End 0x16 ......
11 3D GRAPHICS PROCESSING 11.5.50 AMC AMC - Ambient Model Color 0x55 ........ bit(s) description 16-23 Blue Component 8-15 Green Component Red Component 11.5.51 DMC DMC - Diffuse Model Color 0x56 ....
11 3D GRAPHICS PROCESSING 11.5.162 TFUNC TFUNC - Texture Function 0xc9 ........ bit(s) description Fragment Double Enable Fragment color is untouched Fragment color is doubled Texture Color Component Texture alpha is ignored Texture alpha is read 0-2: Texture Effect Modulate...
11 3D GRAPHICS PROCESSING 11.5.165 TSYNC TSYNC - Texture Sync 0xcc ........ bit(s) description Sync with texture transfer (see TRXKICK) 11.5.166 FDIST FDIST - Fog Range 0xce ......
11 3D GRAPHICS PROCESSING 11.5.172 SCISSOR2 SCISSOR2 - Scissor Region End 0xd5 ........ bit(s) description 10-19 Y End X End 11.5.173 NEARZ NEARZ - Near Depth Range 0xd6 ......
11 3D GRAPHICS PROCESSING 11.5.179 STST STST - Stencil Test 0xdc ........ bit(s) description 16-23 Stencil Mask 8-15 Stencil Reference Value Stencil Function Never pass stencil test Always pass stencil test Pass test if match Pass test if difference Pass test if less Pass test if less or equal...
11 3D GRAPHICS PROCESSING 11.5.181 ZTST ZTST - Depth Test Function 0xde ........ bit(s) description Function Never pass pixel Always pass pixel Pass pixel when depth is equal Pass pixel when depth is not equal Pass pixel when depth is less Pass pixel when depth is less or equal Pass pixel when depth is greater...
11 3D GRAPHICS PROCESSING 11.5.194 TRXSPOS TRXSPOS - Transfer Source Position 0xeb ........ bit(s) description 10-19 Y Position X Position 11.5.195 TRXDPOS TRXDPOS - Transfer Destination Position 0xec ......
18 HEADPHONE/REMOTE CONTROL 18 Headphone/Remote Control 18.1 Audio Input 18.2 Serial Communications The PSP communicates with the microcontroller inside the remote control using RS232 serial communication (although the voltages are different of course, 0V and +2.5V) using 8N1 framing at 4800bps. The protocol consists of command packages which can be send by either the PSP or the remote control.
19 FLASH MEMORY 19 Flash Memory start size description 0x00000000 0x017FC1FF 24MB flash0: 0x01800000 0x01BFC1FF flash1: 0x01C00000 0x01CFC1FF 0x01D00000 0x01DEC1FF Only FAT organized area of on-board flash chip, system file volume and configuration file volume, can be accessed via FAT Filesystem. There is a bootstrap area with equipment serial IDs in the flash chip, and the area is unreachable by the flash and lflash drivers.
So code signatures are done by the developer, while encryption is done by Sony. The trust can still be verified by checking the signed game certificate, seeing that it belongs to SCE_CA0x, and then seeing /that/ belongs to Verisign, which is the root trust node.
20 FLASH MEMORY STRUCTURE (FLASH0) This as a whole is a trust tree, to setup a base list of trusted certificates for the PSP. Anything signed directly by the owners of these certificates, or using a key which has been signed by the owners of these certificates will be trusted. (I.E. can the certificate presented by the game/software to be run be verified as to be connected to these certificates?) 20.2 DIC Subdirectory apotp.dic...
22 MEMORY STICK STRUCTURE 22 Memory Stick Structure /PSP /GAME /MUSIC /PHOTO /SAVEDATA /SYSTEM /BROWSER /MP_ROOT /100MNV01 /01MAQ100 /HIFI /CONTROL /PACKAGES /PKGxxxxx /DCIM /101MSDCF /MISC 22.1 Root Directory In the root directory there are three entries which are of relevance to the PSP. The first is the file memstick.ind which just seems to be a indication that the stick is formatted (it is not specific to the PSP).
22.1.4.1.1 PKGxxxxx Subdirectory package.xml Song information in XML format similar in function to ID3V2 tags 22.1.5 DCIM Subdirectory used by the Sony Cybershot Camera for Photos in jpg format 22.1.6 MISC Subdirectory used by the Sony Cybershot Camera, ignored by the PSP...
23 UMD GAME STRUCTURE 23 UMD Game Structure /PSP_GAME /SYSDIR /USRDIR 23.1 Root Directory UMD_DATA.BIN 23.1.1 PSP_GAME Subdirectory ICON0.PNG ICON1.PMF PARAM.SFO SND0.AT3 PIC0.PNG PIC1.PNG note: the files in this directory resemble the contents of the PBP fileformat (see fileformats section) 23.1.1.1 Sysdir Subdirectory EBOOT.BIN encrypted main executable...
26.2 PRX (PSP Relocation eXecutable?) Sony’s PRX (PSP Relocation eXecutable?) format is a relocation executable based on the standard ELF format. It is distinguised from a normal ELF file by having customised Program Headers, Non-standard MIPS relocation sections and a unique ELF type.
26 FILE FORMATS 26.2.3 Unique ELF type PRX files report the value 0xFFA0 as their type in the header instead of 0x0002 which is usual for normal MIPS ELF files. 26.3 PBP A PBP file collects the files needed for a game executable from a MemoryStick into a single file, for easier transfer. The files are simply concatenated with a small index at the start.
Page 136
26 FILE FORMATS The last part of the file is the value table, again at an offset indicated in the file header. Since value data is required to be aligned, zero padding may exist between the key table and the value table. The offset in the file header will indicate the true start of the value table though.
26.7 PMF (PSMF) PSMF, or PlayStation Movie Format, is a proprietary movie format created by Sony for the PSP. PSMF videos can be as small as 64x64 pixels, and have a framerate of 29.97fps. The video codec used is H.264, also known as MPEG-4 Part 10 AVC. The audio codec is the Sony proprietary ATRAC3plus.
26 FILE FORMATS 26.9 MP4 note: this refers to MP4 files as required by the player in the VSH Video Limitation Resolution: 320 x 240 (QVGA), Nonstandard resolutions can be used but are still limited to the 76,800 pixel resolution of QVGA. Codec: MPEG-4 SP (Simple Profile), which has different headers than the more common MPEG-4 formats.
27 GRAPHIC FORMATS 27 Graphic Formats 27.1 1555 ABGR 27.2 4444 ABGR 27.3 8888 ARGB 27.4 swizzling Internally, the GE processes textures as 16 bytes by 8 rows blocks (independent of actual pixelformat, so a 32*32 32-bit texture is a 128*32 texture from the swizzlings point of view).
29 KERNEL 29.2.7 unspecified Errors code description 0xFFFFFEDO unknown (might be decryption error) 0xfffffed3 29.3 Versions 29.3.1 1.0 The first batch of PSPs was shipped with this firmware in Japan. 1.0 will run an unsigned binary in a PBP file without worry. 29.3.2 1.5 1.5 will refuse to run an unsigned binary in a PBP file, but will execute a bare elf file if you can provide that file after the PSP has already loaded the PBP.
29 KERNEL MYPROG~2 is the short name for MYPROG~1% The second case works properly. The first does not. Remember why the kxploit trick works at all: the vsh sees a nicely formed file in "MYPROG~1%", but then passes "MYPROG~1" to the bootstrap, which executes the bare ELF. If "MYPROG~1" is the short name for the wrong directory, of course it won’t work.
file containing a buffer overflow. Since the data from the wallpaper is in a known location(VRAM) we can use the TIFF overflow to jump to the known VRAM location and execute code. 29.3.6 2.01 29.3.6.1 new Features This was a quick release by Sony to fix the TIFF overflow exploit found in the previous version paf.prx 29.3.6.2 updated Files index.dat...
29 KERNEL Unicode support in the Browser with automatic Encoding Detection Save your text size settings in the Browser Save your Browser input history (URLs) Videos with DRM can be played NTP (Network Time Protocol) support WPA and PSK have been added to network setting Korean input keyboard method 29.3.8 2.6 29.3.8.1 new Features...
29 KERNEL American PSP (US Region) fetches from http://fj01.psp.update.playstation.org/update/us/psp-updatelist.txt # US Dest=01;ImageVersion=000002d5;CDN=http://du01.psp.update.playstation.org/update/us/ 2005_0824_50c7032754835b588319c1a6c652cdc0/EBOOT.PBP;CDN_Timeout=30; European PSP (EU Region) fetches from http://fj01.psp.update.playstation.org/update/eu/psp-updatelist.txt # EU Dest=02;ImageVersion=000002d5;CDN=http://de01.psp.update.playstation.org/update/eu/ 2005_0824_50c7032754835b588319c1a6c652cdc0/EBOOT.PBP;CDN_Timeout=30; If an image with a higher version than what is currently installed is available, the PSP can download it from the URL specified after CDN= and install it.
30 APPENDIX 30 Appendix 30.1 GCC Quick How To note: the instructions in this chapter are only for dyhards that want to bootstrap their own GCC from vanilla sources. For everyone else a toolchain containing allegrex specific patches is highly recommended. For short: you dont need this :) 30.1.1 compile ASM to object: <GCCROOT>/bin/???-elf-as -c \ -I <GCCROOT>/???-elf/include -I <additional includes>...
30 APPENDIX --enable-languages=c --disable-shared --disable-nls --with-newlib note: a specialised ’allegrex’ port is highly recommended. r4000 (or r5900) will work, but is suboptimal 30.1.9 Linker Script to do 30.1.10 Startup Code to do 30.2 Games AC Formula Front - FromSoftware Ape Escape - SCEJ Axel Impact - Axis Entertainment Inc.
Page 154
30 APPENDIX Mahjong - Koei Makai Wars - Nippon Ichi Software Metal Gear Acid - Konami Mobile Suit Gundam - Bandai Moji-Pittan - Namco Monkey Games - SCEJ Need For Speed Underground - EA New Ridge Racer - Namco Pilot Academy - Marvelous Interactive Popolocrois Story - SCEJ Powerful Proyakyu - Konami Pro-wrestling - Yuke’s\~~~...
U.S. Pat. Application 20040266529 (Methods and systems for remote execution of game content and presentation on a wireless portable device) - PS3 to PSP connection Debug Information in ’Puzzle Bobble’ (Error Codes, Kernel API Names etc...) WM8750 Datasheet 31.1 Sources http://www.uspto.gov http://www.mips.com http://www.sdmi.org http://www.sony.com http://www.sony.net http://www.lik-sang.com/psp.html http://www.chipworks.com http://www.extremetech.com http://www.rsasecurity.com http://pinouts.ru http://www.edcheung.com/automa/sircs.htm http://www.hifi-remote.com/sony/...
32 CREDITS 32 Credits besides freely available datasheets and patents, this document was created based on information provided by the following people. if you think you are missing in this list, please keep me informed so i can add you immediately. Marcus Comstedt (http://mc.pp.se/psp/) Memstick Layout, PBP and PSF Format, Network update, some other misc stuff...
Need help?
Do you have a question about the PlayStationPortable and is the answer not in the manual?
Questions and answers