VM Editor |
Top Previous Next |
Edit VM Commands using Script Editor When you click Edit button to add new VM Commands you will open either VM Blocks or VM Script Editor, depending on the settings. The VM Script Editor has many features that will help you to write a syntactically-correct script. It features syntax highlighting, auto completion and real time script checking. You can't write command that has the wrong syntax. 1 - The Edit window Here you type the commands. The editor features syntax highlighting and auto completion. Auto completion: As you type you will notice the command is also being selected in the VM Commands list (4). By pressing the TAB key the selected command in the list will automatically be written at the place you're writing. For example we start typing: Link A LinkPGCN is being selected in the list (4) as we type. By pressing TAB the text will be auto completed: LinkPGCN We can also select other commands, for example LinkPTT, and either press TAB or double click the item in the list (4) 2 - The Control Window This is a very important window for automatic syntax guiding. As you type, this window will guide you by some hints and if the syntax is OK it will show you the full correct syntax. Auto-guidance. The Auto-Guidance will give hints as you type and it will shows how the editor reads your line. For example we would like to add line if (GPRM1 ==2 ) LinkPGCN 4 on line 3. We start typing
Line completion button Whenever we see in control window and a command line we can transfer it to our line in editor. For example we type: JumpSS VTSM and the control window shows: JumpSS VTSM (vts 0, tt 0, menu 0) This is how our command is interpreted, but obviously we need more parameters to specify. Instead of typing this to our editor (1) we can simply click the Line completion button near the control window: The whole line will appear in editor. Now we can change the zeros for numbers we need: JumpSS VTSM (vts 1, tt 1, menu 3) Quick Link This will help you to find a correct link to other objects in the DVD-lab project. Let's say we are editing VM command of a Movie and we would like to link to VMG menu from here. The Quick Link will suggest: CallSS VMGM (pgc 2, rsm_cell 1) * see note below about PGC numbers 3 - Hex Preview The hex preview shows how the VM command will be written to the DVD command space. This is good for advanced debugging. 4 - Command List We already know that selecting a command and pressing TAB or double click will replace the currently edited command in editor. Below the list is a short description about the command and its domain of use. For example for JumpSS VTSM we see this: This tells us that we can use this command in First Play, VMG menu or VTS menu. We cannot use this command from movie. 5 - Reverse VM code Sometimes we get the VM code in byte code hex format, for example from looking at previously compiled ifo file. As you type HEX numbers the Control Window (2) shows the byte code disassembled command. Free syntax There is not one exact way for people to write VM commands. VM Editor understands many different ways a line can be written. For example a line GPRM1 = 15 can be also written as
You will see by that the syntax is correct but the Control window will always shows only the one syntax that DVD-lab uses. Also when you close and open the edit window no matter what syntax you typed it will be changed to the one used by DVD-lab. Ths is called Syntax Normalization and without this we will not be able to understand each other. Syntax normalization When we close the VM Editor and then open it again all syntax will be normalized. For example if we type LinkPGN (2,3) and then close the editor, our command will be automatically normalized to : LinkPGN 2 (button 3) If we type MOV(GPRM1,0x0F) the line will be normalized to GPRM1 = 15 PGC Numbers As you get familiar with the VM commands and try the Quick Link you will realize that it suggests a PGC number that is always one bigger than it appears in the Connections. For example we want to link from Menu 2 to Menu 1 (ROOT) and the Quick link will suggest LinkPGCN 2. Why is that? Shouldn't it be LinkPGCN 1 ? No, because:
You have to remember this, otherwise you will be surprised why your commands don't work properly. |