|
TUTORIAL TOPIC: SCRIPTING
TUTORIAL TITLE: UNDERSTANDING SPRMs
Every DVD player contains 16 General Parameter Register Memories
(GPRMs, or “germs”). Similar to RAM in your computer, these are
generic memory locations the player can use like a scratchpad to read
and write information while it is operating. Scripting gives you to access 8 of these GPRMs, numbered GPRM 0 – GPRM 7. The remaining 8 are unavailable for scripting purposes. GPRMs have no specific preset function
– any GPRM can be used for a particular function in one disc, and then may be used for a completely different function in another project.
You will find that you will use GPRMs a LOT in Scripting. They are
extremely powerful, and very versatile.
Welcome visitor! Thanks for dropping by...
The complete contents of this Tutorial are available to anyone, but most of our tutorials are for
DVD Pro Club Members exclusively. If you like this Tutorial, why not join us today?
Understanding General Parameters - GPRMs
Each DVD player contains 16 General Parameter Register Memories (GPRMs, or “germs”). Similar to RAM in your computer, these are generic memory locations the player can use like a scratchpad to read and write information while it is operating. DVD Studio Pro scripting allows you to access 8 of these GPRMs, numbered GPRM 0 – GPRM 7. The remaining 8 are unavailable for scripting purposes. All GPRMs default to a value of 0 initially.
GPRMs have no specific preset function – any GPRM can be used for a particular function in one disc, and then may be used for a completely different function in another disc. You will find that you will use them a LOT in Scripting. They are extremely powerful, and very versatile.
GPRM “issues” to be aware of
GPRMs can store numerical values between 0 and 65535 (the largest
value possible in 16 bits), but you will want to be careful if you are planning on performing math operations on GPRM values.
Overflow and Underflow
The DVD command set has no provision for overflow or underflow conditions caused by math operations on GPRMs, so you will find that operations that result in values less than zero (0) or greater than 65535 will “wrap around” that end of the numerical scale, and your resulting operations may not be what you expect! As an example, subtracting 4 from 3 would normally result in –1, but in the GPRM, without underflow protection, the –1 will instead become 65535! To prevent this behavior from being a problem, you can program your script to check for this condition before it happens.
GPRM volatility
Again like the RAM in your Computer, GPRM contents are “volatile”. If the player power goes off, or the disc is stopped, the contents of the GPRMs will generally revert to zero. This is disconcerting if the user stops your disc in the middle of a highly interactive section, utilizing lots of GPRMs to track what they have seen. Those GPRM values will disappear, making continued operation of the disc unpredictable, or impossible. This should be kept in mind when you are creating a DVD that relies heavily on scripting to keep track of GPRM values. Locking the DVD remote to prevent selecting “STOP” isn’t the way. But perhaps an advisory screen letting the user know that stopping the DVD will cause problems continuing the program might be the way.
That's It! - Enjoy this tutorial, and don't forget to rate it for others!
Bruce - "the Digital Guy"
|