Inside DVD
by Linden deCarmo



Example 1: 

Mov GPRM0, SPRM13   ; get value of system parental register and copy 
                    ;     into a user register #0
LT  GPRM0, 8        ; if  parental level < Max parental level (i.e. 8)
GOTO    Failure     ; then alert user about the failure


Example 2: 

Mov GPRM0, SPRM13      ; get value of system parental register and copy 
                       ;     into a user register #0
LT  GPRM0, #DISC_LEVEL ; if parental level < the required parental level 
                       ;     on the disc
GOTO    Failure        ; then alert user about the failure

Example 3: 

Mov GPRM0, SPRM20      ; get the region code of the player
NE  GPRM0, 1           ; If region code is not exactly ONE
GOTO    Failure        ; then either this is the wrong player or 
                       ;    the user hacked it.


Listing One
// grab an interface to the Annex J methods
hr = m_pgraph->QueryInterface(IID_IDvdControl, (void **) &m_pUserOperations);

if ( !(FAILED(hr)) )
{
    // start playing title 1, chapter 3
    hr = m_pUserOperations->ChapterPlay( 1, 3 );        

// view the 2nd angle
m_pUserOperations->AngleChange( 2);

// turn off annoying foreign language subtitles    
m_pUserOperations->Sub-pictureStreamChange( 1, FALSE );

// release interface
m_pUserOperations->Release();
}

Listing Two
switch (Event)
    {
        case EC_DVD_BUTTON_CHANGE     :
            // lParam1 contains number of active buttons 
            // if there are ANY buttons alive--enable button manipulation
            if ( lParam1 > 0 ) 
            {
                bActiveButtons = TRUE; 
            }
            break;
        case EC_DVD_ANGLE_CHANGE      :
                    // lParam1 contains the current viewing angle
            break;
        case EC_DVD_TITLE_CHANGE      : 
            // lParam1 contains the currently playing title
            break;
        case EC_DVD_CHAPTER_START     :
            // lParam1 contains the currently playing chapter
            break;
        case EC_DVD_VALID_UOPS_CHANGE :
            // lParam1 contains the currently active user operations
            break;
    }




2


