Careers Spotlight

PlayStation®3.

Welcome to your new place of work!

Quite simply, we can offer you the opportunity to build a great career in a fast-moving, challenging environment, where you can develop your talent to its full potential.

We are keen to hear from innovative individuals with proven experience.

more details...

Testimonial

SN-DBS is full of awesomeness!

It got our lightmaps crunching in 7 minutes instead of 7 hours - I'm very happy. 

Anton Kirczenow
Senior Programmer
Media Molecule

Product Spotlight

ProDG for PlayStation®2

Playstation®2.

ProDG for PlayStation®2 is SN Systems' suite of fully featured tools that enable you to build and debug your game titles for the PlayStation®2.

more details...

ProDG Plus Debugger Scripting


What is debugger scripting?

The C script interpreter is basically a single C program that you can interactively add to, and update the functions of, as the ProDG Debugger is running. Using a new script pane type it allows you to quickly and interactively enter programs to perform different tasks.

The script pane (above) resembles a TTY pane but includes basic editing features to allow you to enter and run scripts immediately.

These can be one-off 'execute until completion' type scripts or they can be bound to target and debugger events (like exceptions, window updates, keystrokes etc).

These scripts can access the target console e.g. to fetch memory contents, and they can do console output to a debugger pane.

This product comprises a C interpreter, built into the Debugger, which supports most ANSI C, with access to a number of special built-in functions to allow the scripts to interface with the Debugger and the target console. When scripts are loaded (or immediate mode script functions are executed) the script is compiled to a byte-code form that is then interpreted.

Execution is pretty fast and typically of the order of one million C statements per second. The ProDG Plus script interpreter has many advantages over normal Windows scripting or compiled-code approaches. It is much faster than trying to use COM interfaces to control an application so a lot more things are achievable and user-friendly. Being written in C, the scripting interface is very familiar to C programmers.

Top


Using script files

A script file is a plain text file containing C source code that can be loaded and executed by the Debugger. You can create and edit these text files using your preferred programmer's editor.

Note: You cannot currently edit script files in the Debugger itself.

There is no specific extension for script files although since they are pretty much ANSI C you may wish to use the extension .c so that your editor knows how to format and syntax color them. You may also wish to use a different extension so that the script files are not confused with any C project files you may be using for source code in your console project.

Scripts can be used to perform the following:

  • Interpret ANSI C including standard C library support (including file access)
  • Output stdout to a Debugger pane or to a Debugger TTY buffer
  • Supports C preprocessor directives
  • Hook Debugger events such as "target exception"
  • Handle Debugger key presses
  • Reset the target and load/run ELF files
  • Send/receive memory to/from the target console
  • Access the symbol table to evaluate expressions with symbols from your project
  • Set custom display formats for types in the watch and locals pane
  • Provide custom debugger panes and hook into debugger context menus
  • Auto-run at debugger startup to provide custom functions and new debugger panes
  • Control the interfacing of an external editor to the debugger source pane

Top


What is the Script X-Change?

We want to encourage the sharing of useful scripts and the Script X-Change is provided for this purpose. ProDG customers can browse the Script X-Change and download useful scripts created by both SN Systems, and other ProDG users. The Script X-Change is available to ProDG customers at this URL: http://www.snsys.com/Support/ScriptXChange/

Top


Example script

A timer can be set up to call back to the pane's callback function with a SM_TIMER message at a specified interval. This is useful if you want a script pane to periodically update with information retrieved from the target console.

The usual sequence to setup a TIMER callback is shown in this simple example:

#include <stdio.h>
#include "SNscript.h"

int MyCallback(SNPARAM message, SNPARAM param0, SNPARAM param1, SNPARAM param2)
{
static int count = 0;

switch(message)
{
case SM_TIMER:
count++;
printf("Timer callback %08X\n", count);
break;
}
return 0;
}

int main(int argc, char** argv)
{
SNSetCallback("MyCallback"); // set our callback handler
SNHookMessage(SM_TIMER); // hook the "timer" message
SNSetTimer(100); // 1 per second

return 0;
}

Top

Copyright © 2014 Sony Computer Entertainment Inc./SN Systems Ltd. All Rights Reserved.