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 54: Line 56:


== OPCODE Table ==
== OPCODE Table ==
The table is composed by several entries, and every entry is composed by 8 bytes:


1byte(opcode)+1byte(arguments)+1byte(unknown)+1byte(variables)+4bytes(value)
*Instructions length: 4+4 bytes? (or 3+1+4)
*See [http://pastebin.com/vRCDzXt1 Pastebin] (without the header) of the coldboot.


See [http://pastebin.com/vRCDzXt1 Pastebin] (without the header) of the coldboot.
{| class="wikitable sortable"
 
{| class="wikitable"
|-
! OpCode<BR />(1 byte) !! Args<BR />(1 byte) !! Unkown<BR />(1 byte) !! Vars<BR />(1 byte) !! Value<BR />(4 bytes) !! Mnemonics<BR />(official) !! Mnemonics<BR />(rcomage) !! Syntax<BR />([[PlayStation JavaScript|PSJS]]) !! Notes
|-
|-
! colspan="9" {{cellcolors|grey|white}} Assignment Operators ?
! OpCode<BR />(short) !! Mnemonics<BR />(official) !! Mnemonics<BR />(rcomage) !! group !! Notes
|-
|-
| 0x00 || {{no}} || {{no}} || {{no}} || {{no}} || NOP || UNKNOWN_0 || ||  
| 0x00 || NOP || UNKNOWN_0 || - || -
|-
|-
| 0x01 || {{no}} || {{no}} || {{no}} || {{no}} || ASSGN || ASSIGN || = ||  
| 0x01 || ASSGN || ASSIGN || Assignment Operators || -
|-
|-
! colspan="9" {{cellcolors|grey|white}} Arithmetic Operators
| 0x02 || ADD || ADD || Arithmetic Operators || -
|-
|-
| 0x02 || {{no}} || {{no}} || {{no}} || {{no}} || ADD || ADD || + ||  
| 0x03 || SUB || SUBTRACT || Arithmetic Operators || -
|-
|-
| 0x03 || {{no}} || {{no}} || {{no}} || {{no}} || SUB || SUBTRACT || - ||
| 0x04 || MUL || MULTIPLY || Arithmetic Operators || -
|-
|-
| 0x04 || {{no}} || {{no}} || {{no}} || {{no}} || MUL || MULTIPLY || * ||  
| 0x05 || DIV || DIVIDE || Arithmetic Operators || -
|-
|-
| 0x05 || {{no}} || {{no}} || {{no}} || {{no}} || DIV || DIVIDE || / ||  
| 0x06 || MOD || MODULUS || Arithmetic Operators || -
|-
|-
| 0x06 || {{no}} || {{no}} || {{no}} || {{no}} || MOD || MODULUS || % ||  
| 0x07 || TO_NUMBER || POSITIVE || - || -
|-
|-
| 0x07 || {{no}} || {{no}} || {{no}} || {{no}} || TO_NUMBER || POSITIVE ||  ||  
| 0x08 || CSIGN || NEGATE || - || -
|-
|-
| 0x08 || {{no}} || {{no}} || {{no}} || {{no}} || CSIGN || NEGATE || -i ||
| 0x09 || NOT || NOT || - || -
|-
|-
| 0x09 || {{no}} || {{no}} || {{no}} || {{no}} || NOT || NOT ||  ||  
| 0x0A || INC || PRE_INCREMENT || Arithmetic Operators || -
|-
|-
| 0x0A || {{no}} || {{no}} || {{no}} || {{no}} || INC || PRE_INCREMENT || ++i ||  
| 0x0B || DEC || PRE_DECREMENT || Arithmetic Operators || -
|-
|-
| 0x0B || {{no}} || {{no}} || {{no}} || {{no}} || DEC || PRE_DECREMENT || --i ||
| 0x0C || POST_INC || INCREMENT || Arithmetic Operators || -
|-
|-
| 0x0C || {{no}} || {{no}} || {{no}} || {{no}} || POST_INC || INCREMENT ||i++ ||  
| 0x0D || POST_DEC || DECREMENT || Arithmetic Operators || -
|-
|-
| 0x0D || {{no}} || {{no}} || {{no}} || {{no}} || POST_DEC || DECREMENT || i-- ||
| colspan="5" {{cellcolors|grey}}
|-
|-
! colspan="9" {{cellcolors|grey|white}} Compare Operators
| 0x0E || CMPEQ || TEST_EQUAL || Compare Operators || -
|-
|-
| 0x0E || {{no}} || {{no}} || {{no}} || {{no}} || CMPEQ || TEST_EQUAL || == ||  
| 0x0F || CMPNEQ || TEST_NOT_EQUAL || Compare Operators || -
|-
|-
| 0x0F || {{no}} || {{no}} || {{no}} || {{no}} || CMPNEQ || TEST_NOT_EQUAL || != ||  
| 0x10 || CMPSEQ || TEST_IDENTITY || Compare Operators || -
|-
|-
| 0x10 || {{no}} || {{no}} || {{no}} || {{no}} || CMPSEQ || TEST_IDENTITY || === ||  
| 0x11 || CMPSNEQ || TEST_NON_IDENTITY || Compare Operators || -
|-
|-
| 0x11 || {{no}} || {{no}} || {{no}} || {{no}} || CMPSNEQ || TEST_NON_IDENTITY || !== ||  
| 0x12 || CMPLT || TEST_LESS_THAN || Compare Operators || -
|-
|-
| 0x12 || {{no}} || {{no}} || {{no}} || {{no}} || CMPLT || TEST_LESS_THAN || < ||  
| 0x13 || CMPLE || TEST_LESS_EQUAL_THAN || Compare Operators || -
|-
|-
| 0x13 || {{no}} || {{no}} || {{no}} || {{no}} || CMPLE || TEST_LESS_EQUAL_THAN || <= ||  
| 0x14 || CMPGE || TEST_MORE_EQUAL_THAN || Compare Operators || -
|-
|-
| 0x14 || {{no}} || {{no}} || {{no}} || {{no}} || CMPGE || TEST_MORE_EQUAL_THAN || >= ||  
| 0x15 || CMPGT || TEST_MORE_THAN || Compare Operators || -
|-
|-
| 0x15 || {{no}} || {{no}} || {{no}} || {{no}} || CMPGT || TEST_MORE_THAN || > ||
| colspan="5" {{cellcolors|grey}}
|-
|-
! colspan="9" {{cellcolors|grey|white}} Bitwise Operators ?
| 0x16 || INSTANCEOF || UNKNOWN_16 || - || -
|-
|-
| 0x16 || {{no}} || {{no}} || {{no}} || {{no}} || INSTANCEOF || UNKNOWN_16 ||  ||  
| 0x17 || IN || UNKNOWN_17 || - || -
|-
|-
| 0x17 || {{no}} || {{no}} || {{no}} || {{no}} || IN || UNKNOWN_17 ||  ||  
| 0x18 || TYPEOF || TYPEOF || - || -
|-
|-
| 0x18 || {{no}} || {{no}} || {{no}} || {{no}} || TYPEOF || TYPEOF ||  ||  
| 0x19 || BIT_AND || BINARY_AND || Bitwise Operators || -
|-
|-
| 0x19 || {{no}} || {{no}} || {{no}} || {{no}} || BIT_AND || BINARY_AND || & ||  
| 0x1A || BIT_XOR || BINARY_XOR || Bitwise Operators || -
|-
|-
| 0x1A || {{no}} || {{no}} || {{no}} || {{no}} || BIT_XOR || BINARY_XOR || ^ ||  
| 0x1B || BIT_OR || BINARY_OR || Bitwise Operators || -
|-
|-
| 0x1B || {{no}} || {{no}} || {{no}} || {{no}} || BIT_OR || BINARY_OR || <nowiki>|</nowiki> ||  
| 0x1C || BIT_NOT || BINARY_NOT || Bitwise Operators || -
|-
|-
| 0x1C || {{no}} || {{no}} || {{no}} || {{no}} || BIT_NOT || BINARY_NOT || ~ ||  
| 0x1D || LSHIFT || LSHIFT || Bitwise Operators || -
|-
|-
| 0x1D || {{no}} || {{no}} || {{no}} || {{no}} || LSHIFT || LSHIFT || << ||  
| 0x1E || S_RSHIFT || RSHIFT || Bitwise Operators || -
|-
|-
| 0x1E || {{no}} || {{no}} || {{no}} || {{no}} || S_RSHIFT || RSHIFT || >> ||  
| 0x1F || U_RSHIFT || UNSIGNED_RSHIFT || Bitwise Operators || -
|-
|-
| 0x1F || {{no}} || {{no}} || {{no}} || {{no}} || U_RSHIFT || UNSIGNED_RSHIFT ||  ||
| colspan="5" {{cellcolors|grey}}
|-
|-
! colspan="9" {{cellcolors|grey|white}} ?
| 0x20 || COPY || STACK_PUSH || - || -
|-
|-
| 0x20 || {{no}} || {{no}} || {{no}} || {{no}} || COPY || STACK_PUSH ||  ||  
| 0x21 || SWAP || UNKNOWN_21 || - || -
|-
|-
| 0x21 || {{no}} || {{no}} || {{no}} || {{no}} || SWAP || UNKNOWN_21 ||  ||  
| 0x22 || REMOVE || END_STATEMENT || - || -
|-
|-
| 0x22 || {{no}} || {{no}} || {{no}} || {{no}} || REMOVE || END_STATEMENT || ; ||
| colspan="5" {{cellcolors|grey}}
|-
|-
! colspan="9" {{cellcolors|grey|white}} Data Types
| 0x23 || PUSH_UNDEFINED || CONST_NULL || Data Types || -
|-
|-
| 0x23 || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_UNDEFINED || CONST_NULL ||  ||  
| 0x24 || PUSH_NULL || CONST_EMPTY_ARRAY || Data Types || -
|-
|-
| 0x24 || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_NULL || CONST_EMPTY_ARRAY ||  ||  
| 0x25 || PUSH_BOOL || CONST_BOOL || Data Types || -
|-
|-
| 0x25 || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_BOOL || CONST_BOOL || ''true'' / '' false'' ||  
| 0x26 || PUSH_INT || CONST_INT || Data Types || -
|-
|-
| 0x26 || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_INT || CONST_INT || 1 ||  
| 0x27 || PUSH_FLOAT || CONST_FLOAT || Data Types || -
|-
|-
| 0x27 || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_FLOAT || CONST_FLOAT || 0.1 ||  
| 0x28 || PUSH_STRING || CONST_STRING || Data Types || -
|-
|-
| 0x28 || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_STRING || CONST_STRING || ''("string")'' ||  
| 0x29 || PUSH_OBJECT || CONST_OBJECT || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}} Complex Data Types
| 0x2A || PUSH_FUNC || FUNCTION || - || byte 4 uses a "flag"
|-
|-
| 0x29 || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_OBJECT || CONST_OBJECT || ''object'' ||  
| 0x2B || PUSH_ARRAY || CONST_ARRAY || - || -
|-
|-
| 0x2A || {{yes}} || {{no}} || {{yes}} || {{yes}} || PUSH_FUNC || FUNCTION || ''function'' ||  
| 0x2C || PUSH_THIS || THIS_OBJECT || - || -
|-
|-
| 0x2B || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_ARRAY || CONST_ARRAY || ''array'' ||  
| 0x2D || PUSH_LOCAL || UNNAMED_VARIABLE || - || -
|-
|-
| 0x2C || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_THIS || THIS_OBJECT ||  ||  
| 0x2E || PUSH_GLOBAL || NAME || - || -
|-
|-
| 0x2D || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_LOCAL || UNNAMED_VARIABLE || ''var'' || variable declared inside a function,object, etc... (local scope)
| colspan="5" {{cellcolors|grey}}
|-
|-
| 0x2E || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_GLOBAL || NAME || ''var'' || variable declared at top of the script (global scope)
| 0x2F || GETATTR || PROPERTY || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}} Attributes related
| 0x30 || GETATTR_KEEPOBJ || METHOD || - || -
|-
|-
| 0x2F || {{no}} || {{no}} || {{no}} || {{yes}} || GETATTR || PROPERTY ||  ||  
| 0x31 || SETATTR || SET || - || -
|-
|-
| 0x30 || {{no}} || {{no}} || {{no}} || {{yes}} || GETATTR_KEEPOBJ || METHOD ||  ||  
| 0x32 || DELATTR || UNSET || - || -
|-
|-
| 0x31 || {{no}} || {{no}} || {{no}} || {{yes}} || SETATTR || SET ||  ||  
| 0x33 || APPEND_ATTR || OBJECT_ADD_ATTRIBUTE || - || -
|-
|-
| 0x32 || {{no}} || {{no}} || {{no}} || {{yes}} || DELATTR || UNSET ||  ||
| colspan="5" {{cellcolors|grey}}
|-
|-
| 0x33 || {{no}} || {{no}} || {{no}} || {{yes}} || APPEND_ATTR || OBJECT_ADD_ATTRIBUTE ||  ||  
| 0x34 || GETITEM || ARRAY_INDEX || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}} Items related
| 0x35 || GETITEM_KEEPOBJ || UNKNOWN_35 || - || -
|-
|-
| 0x34 || {{no}} || {{no}} || {{no}} || {{yes}} || GETITEM || ARRAY_INDEX ||  ||  
| 0x36 || SETITEM || ARRAY_INDEX_ASSIGN || - || -
|-
|-
| 0x35 || {{no}} || {{no}} || {{no}} || {{yes}} || GETITEM_KEEPOBJ || UNKNOWN_35 ||  ||  
| 0x37 || DELITEM || UNKNOWN_37 || - || -
|-
|-
| 0x36 || {{no}} || {{no}} || {{no}} || {{yes}} || SETITEM || ARRAY_INDEX_ASSIGN ||  ||  
| 0x38 || APPEND_ITEM || ARRAY_PUSH || - || -
|-
|-
| 0x37 || {{no}} || {{no}} || {{no}} || {{yes}} || DELITEM || UNKNOWN_37 ||  ||
| colspan="5" {{cellcolors|grey}}
|-
|-
| 0x38 || {{no}} || {{no}} || {{no}} || {{yes}} || APPEND_ITEM || ARRAY_PUSH ||  ||  
| 0x39 || JUMP || JUMP || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}} if/else/for (opcode jumps)
| 0x3A || JUMPT || JUMP_IF_TRUE || - || -
|-
|-
| 0x39 || {{no}} || {{no}} || {{no}} || {{yes}} || JUMP || JUMP ||  ||  
| 0x3B || JUMPF || JUMP_IF_FALSE || - || -
|-
|-
| 0x3A || {{no}} || {{no}} || {{no}} || {{yes}} || JUMPT || JUMP_IF_TRUE ||  ||
| colspan="5" {{cellcolors|grey}}
|-
|-
| 0x3B || {{no}} || {{no}} || {{no}} || {{yes}} || JUMPF || JUMP_IF_FALSE ||  ||  
| 0x3C || CALL_FUNC || CALL_FUNCTION || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}} Code structure builders
| 0x3D || CALL_METHOD || CALL_METHOD || - || -
|-
|-
| 0x3C || {{no}} || {{no}} || {{no}} || {{no}} || CALL_FUNC || CALL_FUNCTION || function() ||  
| 0x3E || CALL_CONSTRUCTOR || CALL_INBUILT / CALL_NEW <!-- different versions of rcomage --> || - || -
|-
|-
| 0x3D || {{no}} || {{no}} || {{no}} || {{no}} || CALL_METHOD || CALL_METHOD ||  ||
| colspan="5" {{cellcolors|grey}}
|-
|-
| 0x3E || {{no}} || {{no}} || {{no}} || {{yes}} || CALL_CONSTRUCTOR || CALL_INBUILT / CALL_NEW <!-- different versions of rcomage --> || (i) ||
| 0x3F || RET || RETURN || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}}
| 0x40 || THROW || UNKNOWN_40 || - || -
|-
|-
| 0x3F || {{no}} || {{no}} || {{no}} || {{no}} || RET || RETURN || ''return'' ||  
| 0x41 || TRYBLK_IN || UNKNOWN_41 || - || -
|-
|-
| 0x40 || {{no}} || {{no}} || {{no}} || {{no}} || THROW || UNKNOWN_40 ||  ||  
| 0x42 || TRYBLK_OUT || UNKNOWN_42 || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}}
| 0x43 || CATCH_FINALLYBLK_IN || UNKNOWN_43 || - || -
|-
|-
| 0x41 || {{no}} || {{no}} || {{no}} || {{no}} || TRYBLK_IN || UNKNOWN_41 ||  ||  
| 0x44 || CATCH_FINALLYBLK_OUT || UNKNOWN_44 || - || -
|-
|-
| 0x42 || {{no}} || {{no}} || {{no}} || {{no}} || TRYBLK_OUT || UNKNOWN_42 ||  ||  
| 0x45 || HALT || END_SCRIPT || - || -
|-
|-
| 0x43 || {{no}} || {{no}} || {{no}} || {{no}} || CATCH_FINALLYBLK_IN || UNKNOWN_43 ||  ||  
| 0x46 || DEBUG_FILE || DEBUG_FILE || - || -
|-
|-
| 0x44 || {{no}} || {{no}} || {{no}} || {{no}} || CATCH_FINALLYBLK_OUT || UNKNOWN_44 ||  ||  
| 0x47 || DEBUG_LINE || DEBUG_LINE || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}}
| 0x48 || GETITEM_KEEPOBJNAME || UNKNOWN_48 || - || -
|-
|-
| 0x45 || {{no}} || {{no}} || {{no}} || {{no}} || HALT || END_SCRIPT ||  ||  
| 0x49 || PUSH_VECTOR || UNKNOWN_49 / MAKE_FLOAT_ARRAY <!-- different versions of rcomage --> || Data Types || -
|-
|-
! colspan="9" {{cellcolors|grey|white}} Debug
| 0x4A || GET_VECTOR_ELEMENT || UNKNOWN_4a || - || -
|-
|-
| 0x46 || {{no}} || {{no}} || {{no}} || {{no}} || DEBUG_FILE || DEBUG_FILE ||  ||  
| 0x4B || GET_VECTOR_ELEMENT_KEEPVECTOR || UNKNOWN_4b || - || -
|-
|-
| 0x47 || {{no}} || {{no}} || {{no}} || {{no}} || DEBUG_LINE || DEBUG_LINE ||  ||  
| 0x4C || ASSGN_VECTOR_ELEMENT || UNKNOWN_4c || - || -
|-
|-
! colspan="9" {{cellcolors|grey|white}} VSMX v2 (new opcodes for PS3) ?
| 0x4D || SETATTR_VECTOR_ELEMENT || UNKNOWN_4d || - || byte 4 uses a vector identifyer ->
|-
|-
| 0x48 || {{no}} || {{no}} || {{no}} || {{yes}} || GETITEM_KEEPOBJNAME || UNKNOWN_48 ||  ||
| 0x4E || SETITEM_VECTOR_ELEMENT || UNKNOWN_4e || - || <!--byte 4 uses a vector identifyer-->
|-
| 0x49 || {{no}} || {{no}} || {{no}} || {{yes}} || PUSH_VECTOR || UNKNOWN_49 / MAKE_FLOAT_ARRAY <!-- different versions of rcomage --> || <nowiki><i></nowiki> ||
|-
| 0x4A || {{no}} || {{no}} || {{no}} || {{yes}} || GET_VECTOR_ELEMENT || UNKNOWN_4a ||  ||
|-
| 0x4B || {{no}} || {{no}} || {{no}} || {{yes}} || GET_VECTOR_ELEMENT_KEEPVECTOR || UNKNOWN_4b ||  ||
|-
| 0x4C || {{no}} || {{no}} || {{no}} || {{yes}} || ASSGN_VECTOR_ELEMENT || UNKNOWN_4c ||  ||
|-
| 0x4D || {{no}} || {{no}} || {{yes}} || {{yes}} || SETATTR_VECTOR_ELEMENT || UNKNOWN_4d || -> || byte 4 is an identifyer from a vector (x,y,z) (r,g,b,a) etc...
|-
| 0x4E || {{no}} || {{no}} || {{no}} || {{yes}} || SETITEM_VECTOR_ELEMENT || UNKNOWN_4e || || <!--byte 4 uses a vector identifyer-->
|-
|-
|}
|}
* cells marked with yes/no are speculative, based in how the opcodes are grouped and how other known opcodes works


=== Arithmetic Operators ===
=== Arithmetic Operators ===
Line 307: Line 292:
|-
|-
| 0x19 || BIT_AND || & || AND
| 0x19 || BIT_AND || & || AND
|-
| 0x1A || BIT_XOR || ^ || XOR
|-
|-
| 0x1B || BIT_OR || <nowiki>|</nowiki> || OR
| 0x1B || BIT_OR || <nowiki>|</nowiki> || OR
|-
|-
| 0x1C || BIT_NOT || ~ || NOT
| 0x1C || BIT_NOT || ~ || NOT
|-
| 0x1A || BIT_XOR || ^ || XOR
|-
|-
| 0x1D || LSHIFT || << || Left Shift
| 0x1D || LSHIFT || << || Left Shift
Line 335: Line 320:
|-
|-
| 0x0E || CMPEQ || == || Equality
| 0x0E || CMPEQ || == || Equality
|-
| 0x10 || CMPSEQ || === || Strict Equal value and equal type
|-
|-
| 0x0F || CMPNEQ || != || Inequality
| 0x0F || CMPNEQ || != || Inequality
|-
|-
| 0x10 || CMPSEQ || === || Strict Equal value and equal type
| 0x11 || CMPSNEQ || !== || Strict not equal value or not equal type
|-
| 0x15 || CMPGT || > || Greater Than
|-
|-
| 0x11 || CMPSNEQ || !== || Strict not equal value or not equal type
| 0x14 || CMPGE || >= || Greater Than or Equal To
|-
|-
| 0x12 || CMPLT || < || Less Than
| 0x12 || CMPLT || < || Less Than
|-
|-
| 0x13 || CMPLE || <= || Less Than or Equal To
| 0x13 || CMPLE || <= || Less Than or Equal To
|-
| 0x14 || CMPGE || >= || Greater Than or Equal To
|-
| 0x15 || CMPGT || > || Greater Than
|-
|-
|}
|}
Line 384: Line 369:
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 379:
**'''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 603:
/* 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 627:
/* 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)