Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Sony Lua - RJ Mical (SCEA)

3,092 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Sony Lua - RJ Mical (SCEA)

  1. 1. SONY LUA GDC 9 March 2010 RJ Mical
  2. 2. Overview <ul><li>Lua on the PS3 </li></ul><ul><li>SLED </li></ul><ul><li>Sony use of Lua </li></ul>
  3. 3. Lua on the PS3 <ul><li>Available for the PPU and the SPU </li></ul><ul><ul><li>Several versions available, including 5.1.4 </li></ul></ul><ul><li>SLED for editing </li></ul>
  4. 4. SPU Lua <ul><li>Full Lua implementation, except: </li></ul><ul><ul><li>No parser, code must be precompiled </li></ul></ul><ul><ul><li>Not much space so only limited usefulness </li></ul></ul><ul><ul><ul><li>70K memory for Lua objects </li></ul></ul></ul><ul><ul><li>Not able to call Lua from C </li></ul></ul><ul><ul><ul><li>Though you can share data, call C functions on the PPU, signal and synchronize with your C app on the PPU </li></ul></ul></ul>
  5. 5. SPU Lua Details - 1 <ul><li>Interface provided to allow shared data to be passed to SPU Lua from the PPU </li></ul><ul><ul><li>You have to use struct.unpack before using the data </li></ul></ul><ul><li>Programs must be precompiled ofline </li></ul><ul><li>lua_number is a single-precision float </li></ul><ul><li>Memory is a premium, so do garbage collection often! </li></ul>
  6. 6. SPU Lua Details - 2 <ul><li>It’s possible to call C++ functions from SPU Lua code </li></ul><ul><ul><li>Register the PPU functions when initializing the Lua task manager </li></ul></ul><ul><ul><li>In Lua, define a wrapper function that packs the data, sends it to the PPU function, and unpacks the results </li></ul></ul><ul><li>Synchronization between PPU tasks and SPU Lua is accomplished with signals </li></ul>
  7. 7. SLED <ul><li>Excellent editor (any script language, not just Lua) </li></ul><ul><li>Full IDE for script editing and debugging </li></ul><ul><ul><li>Syntax highlighting </li></ul></ul><ul><ul><li>Breakpoints </li></ul></ul><ul><ul><li>Callstack and variable watch list </li></ul></ul><ul><ul><li>Edit and continue </li></ul></ul><ul><li>libsleddebugger on the PPU </li></ul><ul><ul><li>Uses TCP/IP to communicate with the debugger </li></ul></ul><ul><li>Lua plug-in supports compilation too </li></ul>
  8. 8. Sony Use of Lua <ul><li>Lua available for the PS3 and the PSP </li></ul><ul><li>There are a number of apps that use Lua: </li></ul><ul><ul><li>Home </li></ul></ul><ul><ul><li>PhyreEngine </li></ul></ul><ul><ul><li>Buzz </li></ul></ul><ul><ul><li>State Machine </li></ul></ul>
  9. 9. Thanks! <ul><li>[email_address] </li></ul><ul><li>http://www.mical.org/ </li></ul>

×