Operators

Advanced Authoring - GPRM Operators We have already shown some examples of operators that can be used with GPRM registers. Most notably you may recognize the obvious

GPRM1 = 15

from previous pages. This is one of the many operators and it is called simply Assign operator. On the previous page you may also have read about Syntax normalization and that DVD-lab VM editor is quite open minded to various syntaxes, however it will always change the command into its native syntax

From the above table it is clear that the left side of an operator can only be a GPRM register. The right side of an operator can be another GPRM register, SPRM register or constant.

If Condition

To check the condition of GPRM registers there is a command if (.....) .....

Example used previously:

if (GPRM1 ==2 ) LinkPGCN 4

But there are more operands than just ==

Operator DVD-lab Syntax Example Meaning

if (GPRM1
15) if (GPRM1 == GPRM2) if (GPRM1 == SPRM2) if GPRM is equal (make sure you type two equal signs == ) != if (GPRM1 != 15) if (GPRM1 != GPRM2) if (GPRM1 != SPRM2) if GPRM is not equal >= if (GPRM1 >= 15) if (GPRM1 >= GPRM2) if (GPRM1 >= SPRM2) if GPRM is greater or equal > if (GPRM1 > 15) if (GPRM1 > GPRM2) if (GPRM1 > SPRM2) if GPRM is greater <= if (GPRM1 <= 15) if (GPRM1 <= GPRM2) if (GPRM1 <= SPRM2) if GPRM is less or equal  < if (GPRM1 < 15) if (GPRM1 < GPRM2) if (GPRM1 < SPRM2) if GPRM is less  & if (GPRM1 & 15) if (GPRM1 & GPRM2) if (GPRM1 & SPRM2) if logical and is not zero

From the above table it is clear that the left side of an operator can only be a GPRM register. The right side of an operator can be another GPRM register, SPRM register or a constant.

Almost all other commands can be used with comparison (there are some exceptions), however you can not always compare GPRM to a constant value.

For example:

if (GPRM1==2) LinkPGCN 1

is valid, but

if (GPRM1==2) JumpSS VMGM 1

is not valid. You have to use two lines

GPRM2 = 2 if (GPRM1==GPRM2) JumpSS VMGM 1

Generally JumpSS type, CallSS type and Set type (SetHL_BTN for example) can't be used together in comparison with a constant.

Combination Condition commands

Because some places on a DVD allow only one line of commands (most notably for button and cell commands), the DVD specs allow for special combination commands. What this means is, they can have up to 3 commands on one line where one is a condition, the second is an operator and the last is a link. There are also three different ways to put them together. Note how the curly parenthesis differ on the first two lines:

if (GPRM1 == GPRM2) { GPRM1 = 5 } LinkTopC (button 1) if (GPRM1 == GPRM2) { GPRM1 = 5, LinkTopC (button 1) } GPRM1 = 5, if (GPRM1 == GPRM2) LinkTopC (button 1) The first is Condition then {operator} if condition is true and then link regardless the condition Second is Condition then {operator and link} if condition is true Third is operator, then condition and link if condition is true.

Unfortunately not all link commands can be used in this combo. Only link types of: LinkNoLink, LinkTopC,....,LinkTopPG, .....LinkTopPGC, .... LinkTailPGC It is not very probable you would need to use this type of command.

Set combination commands A few Set commands are allowed in combination with a Link (except in combination with a condition). These are useful for places such as Button in a menu.

SetHL_BTN GPRM1, LinkPGCN 1 Sets the highlighting register to value in GPRM1 and then Link to PGC 1

SetSTN (audio=1 subp=2:on angle=3 ) LinkPGCN 2 Set Audio/Subpicture/Angle Stream and then link to PGC 2. This can be used for example on menu to select subtitles and then immediately link to a different menu where the subtitles text is shown as selected.