Editing VSMX

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
= Description =
= Description =
Virtual Script Machine Instructions (VSMX) compiled file. The file extension is '''.jsx''' after compiled, and '''.js''' before compiled)
Virtual Script Machine Instructions (VSMX) file (filename extension .jsx, a .js compiled)


*http://endlessparadigm.com/forum/showthread.php?tid=21485 (History)
History:
*http://playstationhax.it/forums/topic/1060-jsxviewer/ (discussion, tool) http://tizzyt-archive.blogspot.co.uk/2015/05/release-jsxviewer-05b-source.html (source)
*http://endlessparadigm.com/forum/showthread.php?tid=21485


[[Rcomage]] has partial support to compile/decompile VSMX files for PS3 (is needed to change the VSMX version at header offset 0x04... from 2.0 to 1.0 because rcomage was originally intended for PSP only). Also the official VSMX format 2.0 (intended for PS3) has some additional opcodes that didnt existed in PSP. '''it's very buggy and usually doesn't work right'''
[[Rcomage]] can compile/decompile .jsx (VSMX) <=> .JS (need to change the VSMX version at offset 0x04 to 01 (PSP?) instead of 02 (PS3?)
<pre>
but it's very buggy and usually doesn't work right
</pre>


*VSMX files are used on:
*VSMX files are used on:
**PSP - Inside '''[[Resource_Container_(RCO)|.rco]]''' file-format (used on video/music UMDs, and the two firmware files: '''lftv_tuner_jp_jp.rco''' and '''lftv_tuner_us_en.rco''' in path flash0/vsh/resource/)
**PSP (inside RCO's from video/music UMDs, and two lftv firmware RCO's in flash0/vsh/resource/...)
**PS3 - Inside '''[[Rich_Appearance_Format_(RAF)|.raf]]''' file-format (used on [[coldboot.raf]], and the background scene for [[Themes (.p3t)|PS3 dynamic themes]]<!-- and some PS3 Games?-->)
**PS3 ([[Rich_Appearance_Format_(RAF)|inside RAF's]]: on [[Coldboot.raf]], [[Themes (.p3t)|PS3 themes]] animated) and some PS3 Games?
**PSVita & PS4 (unknown yet, but probable)
**PSVita & PS4 (unknown)


= VSMX Structure =
= VSMX Structure =
Some compiler/decompiler code samples can be seen: [https://github.com/Zarh/ManaGunZ/blob/master/MGZ/source/jsx.c managunz], [https://github.com/zingaburga/RCOMage/blob/master/src/vsmx.c rcomage]


== Header ==
== Header ==
Line 384: Line 386:
This is an example of the decodification and decompilation made with the VSMX script contained inside [[coldboot.raf]]. The decompilation has been made by hand because the vsmx decompiler by ZiNgA BuRgA doesnt supports vectors and crashes, the purpose is to serve as an explain of how the opcodes works, the features that was added to VSMX v2 format for PS3, and as an overall explain of how to decompile other VSMX files
This is an example of the decodification and decompilation made with the VSMX script contained inside [[coldboot.raf]]. The decompilation has been made by hand because the vsmx decompiler by ZiNgA BuRgA doesnt supports vectors and crashes, the purpose is to serve as an explain of how the opcodes works, the features that was added to VSMX v2 format for PS3, and as an overall explain of how to decompile other VSMX files


The file can be saved as .js and compiled directlly (there is no need to remove the comments), for a better overview of the decompiled code of this sample in [[PlayStation JavaScript]] format see [[Coldboot.raf#Script]] page
The file can be saved as .js and compiled directlly (there is no need to remove the comments), for a better view of the decompiled code without the comments in [[PlayStation JavaScript]] format see [[coldboot.raf]] page


*Form left to right:
*Form left to right:
Line 394: Line 396:
**'''DECOMPILED PSJS CODE''' - The source code in [[PlayStation JavaScript]] format ready to compile, it will generate a coldboot.jsx exactly like the one extracted from coldboot.raf by the [[CXML Containers|CXML decompiler tool]]
**'''DECOMPILED PSJS CODE''' - The source code in [[PlayStation JavaScript]] format ready to compile, it will generate a coldboot.jsx exactly like the one extracted from coldboot.raf by the [[CXML Containers|CXML decompiler tool]]


{{Boxcode|title=coldboot.js (decompiled from coldboot.jsx)|code=<syntaxhighlight lang="javascript">
{{Boxcode|content=<syntaxhighlight lang="javascript">
//---------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------
// VSMX v2 Decompilation Sample (coldboot.raf PS3). Decompiled step by step from VSMX opcodes to PSJS code by sandungas
// VSMX v2 Decompilation Sample (coldboot.raf PS3). Decompiled step by step from VSMX opcodes to PSJS code by sandungas
Line 618: Line 620:
/* 210 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 210 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 211 - 31000000 03000000 - SETATTR                scale                *///footer.scale = sd_scale
/* 211 - 31000000 03000000 - SETATTR                scale                *///footer.scale = sd_scale
/* 212 - 22000000 00000000 - REMOVE                                      */ footer.scale = sd_scale;
/* 212 - 22000000 00000000 - REMOVE                                      */ footer.scale = sd_scale;
/* 213 - 39000000 F9000000 - JUMP                  249                  */ } else {
/* 213 - 39000000 F9000000 - JUMP                  249                  */} else {
/* 214 - 2E000000 1B000000 - PUSH_GLOBAL            sd_offset_x          *///sd_offset_x
/* 214 - 2E000000 1B000000 - PUSH_GLOBAL            sd_offset_x          *///sd_offset_x
/* 215 - 27000000 00000040 - PUSH_FLOAT            2.0                  *///2.0
/* 215 - 27000000 00000040 - PUSH_FLOAT            2.0                  *///2.0
/* 216 - 01000000 00000000 - ASSGN                                      *///sd_offset_x = 2.0
/* 216 - 01000000 00000000 - ASSGN                                      *///sd_offset_x = 2.0
/* 217 - 22000000 00000000 - REMOVE                                      */ var sd_offset_x = 2.0;
/* 217 - 22000000 00000000 - REMOVE                                      */ sd_offset_x = 2.0;
/* 218 - 2E000000 14000000 - PUSH_GLOBAL            logo                *///logo
/* 218 - 2E000000 14000000 - PUSH_GLOBAL            logo                *///logo
/* 219 - 2E000000 1B000000 - PUSH_GLOBAL            sd_offset_x          *///sd_offset_x
/* 219 - 2E000000 1B000000 - PUSH_GLOBAL            sd_offset_x          *///sd_offset_x
/* 220 - 4D000000 02000000 - SETATTR_VECTOR_ELEMENT 0    position      *///logo.position->0 = sd_offset_x
/* 220 - 4D000000 02000000 - SETATTR_VECTOR_ELEMENT 0    position      *///logo.position->0 = sd_offset_x
/* 221 - 22000000 00000000 - REMOVE                                      */ logo.position->0 = sd_offset_x;
/* 221 - 22000000 00000000 - REMOVE                                      */ logo.position->0 = sd_offset_x;
/* 222 - 2E000000 15000000 - PUSH_GLOBAL            blur                *///blur
/* 222 - 2E000000 15000000 - PUSH_GLOBAL            blur                *///blur
/* 223 - 2E000000 1B000000 - PUSH_GLOBAL            sd_offset_x          *///sd_offset_x
/* 223 - 2E000000 1B000000 - PUSH_GLOBAL            sd_offset_x          *///sd_offset_x
/* 224 - 4D000000 02000000 - SETATTR_VECTOR_ELEMENT 0    position      *///blur.position->0 = sd_offset_x
/* 224 - 4D000000 02000000 - SETATTR_VECTOR_ELEMENT 0    position      *///blur.position->0 = sd_offset_x
/* 225 - 22000000 00000000 - REMOVE                                      */ blur.position->0 = sd_offset_x;
/* 225 - 22000000 00000000 - REMOVE                                      */ blur.position->0 = sd_offset_x;
/* 226 - 2E000000 16000000 - PUSH_GLOBAL            footer              *///footer
/* 226 - 2E000000 16000000 - PUSH_GLOBAL            footer              *///footer
/* 227 - 2E000000 1B000000 - PUSH_GLOBAL            sd_offset_x          *///sd_offset_x
/* 227 - 2E000000 1B000000 - PUSH_GLOBAL            sd_offset_x          *///sd_offset_x
/* 228 - 4D000000 02000000 - SETATTR_VECTOR_ELEMENT 0    position      *///footer.position->0 = sd_offset_x
/* 228 - 4D000000 02000000 - SETATTR_VECTOR_ELEMENT 0    position      *///footer.position->0 = sd_offset_x
/* 229 - 22000000 00000000 - REMOVE                                      */ footer.position->0 = sd_offset_x;
/* 229 - 22000000 00000000 - REMOVE                                      */ footer.position->0 = sd_offset_x;
/* 230 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 230 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 231 - 27000000 0000803F - PUSH_FLOAT            1.0                  *///1.0
/* 231 - 27000000 0000803F - PUSH_FLOAT            1.0                  *///1.0
Line 642: Line 644:
/* 234 - 49000000 03000000 - PUSH_VECTOR            3                    *///<1.0, 0.5, 0.5>
/* 234 - 49000000 03000000 - PUSH_VECTOR            3                    *///<1.0, 0.5, 0.5>
/* 235 - 01000000 00000000 - ASSGN                                      *///sd_scale = <1.0, 0.5, 0.5>
/* 235 - 01000000 00000000 - ASSGN                                      *///sd_scale = <1.0, 0.5, 0.5>
/* 236 - 22000000 00000000 - REMOVE                                      */ var sd_scale = <1.0, 0.5, 0.5>;
/* 236 - 22000000 00000000 - REMOVE                                      */ sd_scale = <1.0, 0.5, 0.5>;
/* 237 - 2E000000 14000000 - PUSH_GLOBAL            logo                *///logo
/* 237 - 2E000000 14000000 - PUSH_GLOBAL            logo                *///logo
/* 238 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 238 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 239 - 31000000 03000000 - SETATTR                scale                *///scale
/* 239 - 31000000 03000000 - SETATTR                scale                *///scale
/* 240 - 22000000 00000000 - REMOVE                                      */ logo.scale = sd_scale;
/* 240 - 22000000 00000000 - REMOVE                                      */ logo.scale = sd_scale;
/* 241 - 2E000000 15000000 - PUSH_GLOBAL            blur                *///blur
/* 241 - 2E000000 15000000 - PUSH_GLOBAL            blur                *///blur
/* 242 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 242 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 243 - 31000000 03000000 - SETATTR                scale                *///scale
/* 243 - 31000000 03000000 - SETATTR                scale                *///scale
/* 244 - 22000000 00000000 - REMOVE                                      */ blur.scale = sd_scale;
/* 244 - 22000000 00000000 - REMOVE                                      */ blur.scale = sd_scale;
/* 245 - 2E000000 16000000 - PUSH_GLOBAL            footer              *///footer
/* 245 - 2E000000 16000000 - PUSH_GLOBAL            footer              *///footer
/* 246 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 246 - 2E000000 1C000000 - PUSH_GLOBAL            sd_scale            *///sd_scale
/* 247 - 31000000 03000000 - SETATTR                scale                *///scale
/* 247 - 31000000 03000000 - SETATTR                scale                *///scale
/* 248 - 22000000 00000000 - REMOVE                                      */ footer.scale = sd_scale;}}
/* 248 - 22000000 00000000 - REMOVE                                      */ footer.scale = sd_scale;}}
/* 249 - 2E000000 17000000 - PUSH_GLOBAL            logo_hide            *///logo_hide
/* 249 - 2E000000 17000000 - PUSH_GLOBAL            logo_hide            *///logo_hide
/* 250 - 26000000 00000000 - PUSH_INT              0                    *///0
/* 250 - 26000000 00000000 - PUSH_INT              0                    *///0
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)