title "Macrovision Disabler by NeZzIe Version 1.1" ;The purpose of this device is to remove video information called macrovision ;which is aplied to the video signal in the Vertical Blanking Interval. ;Why Removal of this signals: they may disturb your older tv in such way that ;the picture become unstable and so on. (The device makes it unfortunaly easier to ;copy dvd's onto video tapes...) it's still legal in some contries to make one backup ;of your DVD, Video tapes... so the device is not illegal. please confront laws in youre own ;Contry and so on, before you are making such devices. ;Inputs: ;LM1881 Burst output is connected to RB0 ;LM1881 O\Ev. output is connected to RB1 ;LM1881 CSync output is connected to RB2 ;LM1881 VSync output is connected to RB3 ;NTSC / PAL jumper connected to +5V or 0V is connnected to RB4 ;ON / OFF Switch is connected to RB5 ;Outputs: ;Sample & Hold DC level (Black line) => RA3 ;Use Sample & Hold signal as Video signal => RA2 ;Use Original Video signal as Video signal => RA1 ;On / Off Function LED, showing the status of operation LIST P=16F84 INCLUDE "c:\progra~1\mplab\p16f84.inc" DIODE EQU H'0000' ORGINAL EQU H'0001' SAMPLED EQU H'0002' SAMPLE EQU H'0003' BURST EQU H'0000' ODDEVEN EQU H'0001' HSYNC EQU H'0002' VSYNC EQU H'0003' NTSCPAL EQU H'0004' ONOFF EQU H'0005' CBLOCK 0x00C ;All Variables is defined in this block COUNTER ;Used to count 4 delay purposes LINES TEMP TEMP2 ENDC PAGE __CONFIG _CP_OFF & _HS_OSC & _PWRTE_OFF & _WDT_OFF org 0 ;Main program start address MAINLINE ;Mainline bcf INTCON, GIE ;Disables all interupting.... bsf STATUS, RP0 ;Select bank 1 setts rp0 = 1 (status) bcf STATUS, RP1 movlw H'FF' ;Loads 0xFF into Work register movwf TRISB ;Setts Portb i\o register to 0xFF all inputs (RB6,RB7 are Grounded) movlw B'10000' ;Setts RA0-3 as Outputs rest is input (0x10) movwf TRISA bcf STATUS, RP0 ;Select bank 0 bcf STATUS, RP1 clrf PORTA ;All Outputs is 0 bsf PORTA, ORGINAL ;Use Original Video START bsf PORTA, DIODE call OFF call W4VS btfsc PORTB, NTSCPAL goto NTSC goto PAL ;---------------------------------------------------- PAL movlw D'24' ;Strip 24 Lines call STRIP movlw D'200' ;294 - 24 Lines of visible information call W4HSYNC movlw D'70' call W4HSYNC movlw D'06' ;remove the last 6-8 lines call STRIP call SIGOFF ;Remove signal to VSYNC Apears goto START ;Jump back to start ;---------------------------------------------------- NTSC movlw D'19' ;Strip the 19 first lines call STRIP movlw D'200' ;225 Lines of visible information call W4HSYNC movlw D'25' call W4HSYNC movlw D'06' ;Remove the last not visible lines call STRIP call SIGOFF ;Remove signal to VSYNC Apears goto START ;Jump back to start ;---------------------------------------------------- STRIP movwf LINES W4HSLS call SIGON ;Makes sure that signal is straight through btfsc PORTB, HSYNC ;Waits for HSYNC to go low goto W4HSLS+1 W4HSHS btfss PORTB, HSYNC ;Waits for HSYNC to go High goto W4HSHS bsf PORTA, SAMPLE ;Sample signal on the front of backporch nop bcf PORTA, SAMPLE nop nop nop nop nop ;Skips the Color burst. 5*0,4 = 2 uS call SIGOFF movlw D'40' ;Waits 50 uS call WAIT decfsz LINES, 1 ;There One LINE is wasted goto W4HSLS ;More lines to waste go to W4HSLS (Wait for Horisontal Sync Low, Strip) call SIGON ;Signal flowing through the device return ;---------------------------------------------------- SIGOFF bsf PORTA, SAMPLED bcf PORTA, ORGINAL return ;---------------------------------------------------- SIGON bsf PORTA, ORGINAL bcf PORTA, SAMPLED return ;---------------------------------------------------- W4VS btfsc PORTB, VSYNC ;Waits for VSYNC to go low goto W4VS call SIGON ;Makes sure that Signal is flowing through the device W4VSH btfss PORTB, VSYNC ;Waits for VSYNC to go high goto W4VSH return ;return from this sub ;---------------------------------------------------- OFF btfsc PORTB, ONOFF return call SIGON ;Video Signal is flowing through the device btfss PORTA, DIODE goto TURNON goto TURNOFF TURNON bsf PORTA, DIODE ;Turns on the LED goto DELAY TURNOFF bcf PORTA, DIODE ;Turns off the LED DELAY movlw D'13' ;These delay routines makes 1.03 sec. delay @ 10 MHZ movwf TEMP2 movlw D'255' ;DELAY+2 movwf TEMP movlw D'255' ;DELAY+4 call WAIT decfsz TEMP, 1 ;255 * 308uS * 13 = 1.02102 SEC Calculated goto DELAY+4 decfsz TEMP2, 1 goto DELAY+2 goto OFF ;---------------------------------------------------- WAIT movwf COUNTER ;Standard Wait Routine WAIT2 decfsz COUNTER, 1 goto WAIT2 return ;---------------------------------------------------- W4HSYNC movwf LINES W4HSL btfsc PORTB, HSYNC ;Waits for HSYNC to go low goto W4HSL W4HSH btfss PORTB, HSYNC ;Waits for HSYNC to go High goto W4HSH movlw D'40' call WAIT decfsz LINES, 1 goto W4HSL return ;---------------------------------------------------- end