========
Newsgroups: comp.home.automation
Subject: Re: VCR PLUS
From: joel@austin.ibm.com (Joel Davidson)
Date: Fri, 26 May 1995 19:32:45 GMT


In article <drake.82.06354B4C@mcmaster.ca>, drake@mcmaster.ca (John Drake) writes:
> This may not be the right group, but....
> 
> does anyone know the programming logic for the VCR+ ? That is, given the 
> channel I want, start time and stop time, how do I generate the vcr+ code? The 
> local newspaper tv listings are somewhat spotty in including the codes.

I'm attaching a post from here that I saved from last July.  Supposedly, 
it contains the code to do what you want.  I've never tried this, as I
don't own a vcr plus.  All disclaimers apply!  If it doesn't work, drop
me a note and I can email you another one I got from alt.toys.hi-tech.

Joel

_________________________________________________________________________

Article: 1070 of comp.home.automation
Path: awdprime.austin.ibm.com!portal.austin.ibm.com!geraldo.cc.utexas.edu!cs.utexas.edu!convex!camelot.dsccc.com!spd.dsccc.com!spd!jmccarty
From: jmccarty@spd.dsccc.com (Mike McCarty)
Newsgroups: comp.home.automation
Subject: Re: VCR Plus Code Algorithm?
Date: 16 Jul 1994 19:27:24 GMT
Organization: DSC Communications Corporation, Plano, Texas USA
Lines: 816
Message-ID: <309cat$661@sun001.dsccc.com>
References: <306rl6$3dj@dns.harding.edu>
NNTP-Posting-Host: @aplo139.dsccc.com

In article <306rl6$3dj@dns.harding.edu>,
Captain Ron <PACHECO@acs.harding.edu> wrote:
)Does anyone know the algorithm for generating/decoding VCR+ codes?  Any
)help would be most appreciated.  Thanks!
)
)Ron

I don't remember where I got this, but it works. I had to do a little 
hacking to get it to compile under UNIX, and the hack is included
below.

Mike

---------------- Hack For UNIX (Replaces 1st few lines of decode.c) --------

/*
   DECODE.C

   Decode Version 1.1  by David W. Sanderson, Mark K. Mathews

   Purpose: Convertes VCR-Plus code to date and time of show.


*/

#ifdef TURBOC
#include <dos.h>
#else
#include <time.h>

struct date {
  int da_year;     /* current year */
  char da_day;     /* day of the month */
  char da_mon;     /* month (1 = Jan) */
};
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


#define		KEY001	(68150631L)
#define		INVALID	(-987L)


/* Prototypes */

long 	mixup(long x, long y);
long 	f1(long inva);
void	lookup(long index, long *outtime, long *outdur);
void	bit_shuffle(long t8c5, long t2c1, long *tval, long *cval);
long 	map_top(long day, long year, long top, long digits);
void	offset(long day, long year, long top, long *ofout, long *topout);

void Syntax(const char * message);

#ifndef TURBOC

void    getdate(struct date *d)
{
    time_t      unix_time;
    struct tm   *calendar_time;

    time(&unix_time);
    calendar_time = localtime(&unix_time);
    d->da_year = calendar_time->tm_year+1900;
    d->da_day  = calendar_time->tm_mday;
    d->da_mon  = calendar_time->tm_mon+1;
    printf("%2d/%2d/%d\n",d->da_mon,d->da_day,d->da_year);
}

#endif
[rest of file is same]

----------- First Few lines of encode.c --------------------------------

/*
   ENCODE.C

   Encode Version 1.1  by David W. Sanderson, Mark K. Mathews

   Purpose: Creates VCR-Plus code from date and time of show.


*/

#ifdef TURBOC
#include <dos.h>
#endif

[rest of file is the same]

----

Original source is in this archive.

_________________________________________________________________________
Joel Davidson                   The opinions expressed are mine and do
IBM R/S 6000 Division           not represent the position of IBM.
Austin, TX
