General Purpose Register Memories

The General Purpose Register Memories (GPRMs) provide memory storage that can be used when building scripts. Unlike System Parameter Register Memories (SPRMs), GPRMs are not used directly by the DVD player—they are only used by scripts. Values, such as an SPRM or a value you specify, can be written to a GPRM, have a math operation applied to it, and can then be used by a script command to control the DVD player.

DVD Studio Pro provides access to eight 16-bit GPRMs. Each register is completely independent of the others. All of the registers are set to 0 when a disc is inserted into the DVD player.

When creating scripts, you may find that you could use an additional GPRM or two. Because you will often not need the full 16-bits of a GPRM register, you are able to increase the number of GPRM registers by partitioning one or more of them into smaller sizes. For example, you could choose to partition GPRM 1 into four 4-bit registers. This makes it possible to greatly increase the usable number of GPRMs available when creating your scripts.

Important: Several script command configurations and display conditions require the use of full 16-bit GPRM registers. For that reason, you are only allowed to partition seven of the eight 16-bit GPRM registers.

About SPRMs and Partitioned GPRMs

SPRMs fall into one of three categories:

  • Those that use the first bits of their register, such as SPRM 1

  • Those that use part of the register, but not the first bits, such as SPRM 14 which uses bits 8 through 11

  • Those that use the entire register, with each bit representing the status of a function, such as SPRM 15

If you partition a GPRM into four 4-bit registers, then move the same SPRM value into each register, each of the 4-bit registers would get the same first four bits of the SPRM.

As an example, while SPRM 14 only uses four bits of its register, because they are not the first four bits, they cannot be moved into a partitioned GPRM register. For this reason, it is recommended that you always keep several 16-bit GPRMs available.

Configuring GPRM Partitions

You are able to individually configure the partitions of each 16-bit GPRM register using either the Script Inspector or the Advanced tab of the Disc Inspector. Once configured, you are then able to name them and save the configuration, which can then be loaded into a different project.

Important: Once you partition a GPRM register and use it in a script, you cannot change the GPRM’s partition settings. You also cannot import a script’s item description unless the GPRMs it uses are partitioned the same as when the item description was saved.

To configure a GPRM’s partition
  1. Do one of the following:

    • Select a script in the Outline or Graphical tab. The Script Inspector appears.

    • Select the disc in the Outline tab, then click the Advanced tab in the Disc Inspector.

    • Click an empty area in the Graphical tab, then click the Advanced tab in the Disc Inspector.

  2. Click the pop-up menu for the GPRM you want to partition, then choose the partition configuration to use from the pop-up menu.

Figure. Script Inspector showing a GPRM partition pop-up menu.

You can choose from the following:

Partition configuration
Result
Range of each register
1 Partition
One 16-bit register
0-65535
2 Partitions
Two 8-bit registers
0-255
4 Partitions
Four 4-bit registers
0-15
8 Partitions
Eight 2-bit registers
0-3
16 Partitions
Sixteen 1-bit registers
0-1

Note: Any GPRMs that are currently used by a script have their pop-up menus deactivated and cannot have their partition configuration changed.

Once you choose the partition configuration to use for that GPRM, it displays the new registers.

Figure. Script Inspector showing a GPRM's partitions.

Naming the GPRM Partitions

To help manage the process of creating a script, you are able to name each of the GPRM partitions. (Even a 16-bit GPRM is considered to have one partition.) This makes it easier to keep track of which GPRMs are being used for what purpose. Because the GPRMs are shared by all scripts, once you name one, that name appears in all places it is used in all scripts. You can name GPRMs in either the Script or Disc Inspector.

Note: All partition names must be unique.

To name a GPRM
  1. Do one of the following:

    • Select a script in the Outline or Graphical tab. The Script Inspector appears.

    • Select the disc in the Outline tab, then click the Advanced tab in the Disc Inspector.

    • Click an empty area in the Graphical tab, then click the Advanced tab in the Disc Inspector.

      Figure. GPRM section of the Advanced tab of the Disc Inspector.
  2. Click a GPRM’s disclosure triangle to show its partitions.

  3. Double-click the partition name and type the new name in the text entry box for the GPRM you want to rename.

    Note: You can also change a GPRM partition’s name in the Simulator’s Registers display.

Importing and Exporting GPRM Configurations

If you find yourself needing to copy scripts from one project to another (using item descriptions), you will find that it is much easier if you can be sure that each project uses the same GPRM configuration. One way to do this is to export the GPRM configuration from the project with scripts you want to copy from, and then import that GPRM configuration into the project you want to copy the script into.

Important: You can only copy a script from one project to another project if the GPRMs used by the script are partitioned the same way in both projects.

When you export a GPRM configuration, a file is created that contains the partition information for each of the GPRMs plus their names.

When you import a GPRM configuration, the GPRMs are changed to match those in the file, including the names. Some things to keep in mind:

  • Any GPRMs that are already in use by a script will not be reconfigured, and a warning will appear. All other GPRMs will be reconfigured.

  • The names of all GPRM registers are changed to match those in the file you are importing. Any GPRMs that are already in use are not affected.

To export a GPRM configuration
  1. Configure the GPRM register partitions, including changing their names if needed.

  2. Do one of the following:

    • Click the Script Inspector’s Export button.

    • Click the Export button in the Advanced tab of the Disc Inspector.

    The Export dialog opens.

  3. Enter a name for the file, select its destination, and click Export.

A file is created using the name you entered plus a “.dspPartition” extension.

To import a GPRM configuration
  1. Do one of the following:

    • Click the Script Inspector’s Import button.

    • Click the Import button in the Advanced tab of the Disc Inspector.

    The Import dialog opens.

  2. Select the file to import, then click Import.

Note: To avoid configuration conflicts, you should import the GPRM configuration before creating any scripts.

Setting a GPRM’s Mode

Each 16-bit GPRM register can be set to function as a memory register or as a decrementing counter.

Note: By default, all GPRM registers, including those less than 16-bits, are set to be memory registers.

  • Register: A value written to it remains there until a new value is written or the disc is ejected.
  • Counter: As a counter, the value counts up once per second, starting at the GPRM’s current value. You can pause the count by changing the mode back to register.

You set a GPRM’s mode using the GPRM Mode command as part of a script. Once you have set a GPRM’s mode, it stays that way until it is changed or the disc is ejected.

Figure. Script Command Inspector for configuring a GPRM Mode command.