General purpose register memories, General purpose, Register memories – Apple DVD Studio Pro 4 User Manual

Page 512

Advertising
background image

Suppose you need to find out whether the DVD player is configured for a 4:3 or 16:9
aspect ratio monitor. To determine this, you only need to look at bits 10 and 11 of SPRM
14. You can use the “bit-wise and” operation to mask all bits except 10 and 11, making
it possible to easily determine the aspect ratio status without having to be concerned
with the other bits.

x
0
0

x
0
0

x
0
0

x
0
0

0/1

1

0/1

0/1

1

0/1

x
0
0

x
0
0

x
0
0

x
0
0

x
0
0

x
0
0

x
0
0

x
0
0

x
0
0

x
0
0

15

Bits

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

SPRM 14
And value
Result

Referring to the above table, the x’s in the SPRM 14 value represent bits that are not
needed. Bits 10 and 11 use “0/1” to indicate bits that you want to retain—these may be
set to either 0 or 1. When performing an AND operation, placing 0 in the bits you want
to mask results in their being cancelled out, regardless of their state. Placing 1 in the bits
you want to retain passes them to the result as is—a 0 is still a 0 and a 1 is still a 1. In this
case, an AND value of 3072 produces the proper masking.

The value of the result produces four possible answers: 0, 1024, 2048, and 3072. In the
case of SPRM 14, 0 indicates the DVD player is set to 4:3, and 3072 indicates it is set to
16:9 (the values of 1024 and 2048 are either not specified or reserved).

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.

512

Chapter 20

Creating Scripts

Advertising