Skip to main content

News

Topic: Future of Sphere: Sphere Debugger (Read 8985 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Future of Sphere: Sphere Debugger
Reply #15
Good news: I have a functional proof of concept for SSJ.  All it can do right now is resume execution (which is automatically paused upon debugger attach) or detach (which terminates SSJ), but this proves the communication with Duktape is working properly.

The rest should be smooth sailing as it's just a matter of parsing the command line (which can be done with strtok) and implementing responses for all the Duktape notifications.  All the heavy lifting of encoding and decoding messages for communication with Duktape is done.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • FBnil
  • [*][*]
Re: Future of Sphere: Sphere Debugger
Reply #16
 ;D

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Future of Sphere: Sphere Debugger
Reply #17
Proof of concept:

Code: [Select]

C:\src\spectacles-i>cell -l dist && start msphere --debug dist && ssj
Cell 2.99.812 Sphere Game Compiler x64
A scriptable build engine for Sphere games
(c) 2016 Fat Cerberus

Building 'C:/src/spectacles-i/' as dist.
Processing Cellscript.js rule 'sphere'... OK.
Compiling assets... Up-to-date.
Installing assets...
  scripts/main.js
  1 asset(s) installed
sphere -> 'C:/src/spectacles-i/dist/'
0 error(s), 0 warning(s)
SSJ 2.99.812 Sphere Game Debugger x64
A powerful JavaScript debugger for minisphere
(c) 2016 Fat Cerberus

Connecting to '127.0.0.1:1208'... OK.
Handshaking... OK.
  Connected to minisphere 2.99.812
  Duktape version is v1.4.0

[SSJ @ scripts/main.js:6] BREAK: in function 'eval'
ssj > r
Spectacles: Bruce's Story miniRT Console
Sphere API v2.0 (minisphere 2.99.812)

Initializing Specs Engine test harness
Loading testcases from 'brucesStory.js'
Added battle test 'rsbBalcony'
Added battle test 'rsbFinal'
Loading testcases from 'lastLucidan.js'
Added battle test 'temple'
[SSJ @ scripts/main.js:46] FATAL: Error: a pig ate everyone at 8:12
[SSJ @ scripts/main.js:46] BREAK: in function 'game'
ssj > lv
manifest = [value]
session = [value]
ssj > e manifest
{
   name: "Spectacles: Bruce's Story",
   author: "Fat Cerberus",
   summary: "Follow Scott Starcross in his quest to stop the Primus.",
   resolution: "320x240",
   script: "scripts/main.js",
   minimumPlatform: {
      recommend: "minisphere 2.1 or later",
      apiVersion: 2,
      extensions: [
         "sphere-legacy-api",
         "sphere-obj-constructors",
         "sphere-obj-props",
         "sphere-map-engine",
         "sphere-rng-object",
         "sphere-s2gm",
         "sphere-spherefs"
      ]
   },
   frameRate: 60,
   sceneRenderPriority: 99,
   logPath: "~usr/Spectacles Saga/Console Log.txt",
   consoleBuffer: 1000,
   consoleLines: 10,
   disableAnimation: false,
   disableBattles: false,
   disableSplash: true,
   disableTitleScreen: true,
   directory: "C:/src/spectacles-i/dist/"
}
ssj > q
Shutdown requested, sending detach request.
^C


I had to Ctrl+C out of it because there's currently a bug in minisphere where the engine doesn't send the Detach acknowledgement to the debugger before it shuts itself down, causing SSJ to block indefinitely waiting for a message.  But as you can see, it's otherwise working as intended. :)
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Future of Sphere: Sphere Debugger
Reply #18
Welp, another Monster drink-fueled programming binge later, yet another awesome minisphere feature is done.  minisphere 3.0 final release will be March 28 (minisphere's first anniversary!), and then everyone will be able to go Super Saiyan to debug their JS code any time they want!  Okay, so technically it's a public beta so anyone can do that right now, but you know... :P
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • FBnil
  • [*][*]
Re: Future of Sphere: Sphere Debugger
Reply #19
I'll drink to that! Can't wait...