VERSIONS(DOCS)		Optical Printer Control System		VERSIONS(DOCS)

OPCS VERSION HISTORY/RELEASE NOTES
----------------------------------
    These are in order of most recent versions first, oldest last.

K2.10/TC - 01/15/2022

     o A800DRV.COM + RTMC48.COM
       Fixed recursion error: kb_int handler was calling 'int 99h' to
       redisplay counters which eventually cause a reentry, tripping a
       "@@@ RECURSION" error w/main app! All previous releases have
       this bug, even K100.

     o A800DRV.COM - added -b/-i/-h command line flags to set irq/baseaddr.
       This is now the only way to set the IRQ/baseaddr.
       Obsoletes the 'baseaddr' command in OPCSDEFS.OPC and HOMEDEFS.HOM

     o 'baseaddr' removed from the Kuper structure from 'OPCS' and 'HOME'
        applications. NOTE: All DOS drivers must be updated:

       		A800DRV.COM - Done K2.10/TC - working 01/17/22 TESTED
		RTMC48.COM  - Done K2.10/TC - working 01/19/22 UNTESTED <-- found above recursion error during testing
		MDRIVE.COM  - DONE K2.10/TC - working 01/21/22 UNTESTED

     o PrintRing() modified to show DSEG:OFFS for addresses instead of just
       decimal numeric offsets. (Useful for debugging)

     o jog: get rid of "To zero fader use 'cls'" msg (uses cls automatically)

     o jog: 'Reset' now shows blinking cursor at line being edited

     o 'interp d - 0 0 0' (to disable previous interp) is now in man page

K2.05/TC - 07/30/2021

     o 'bigcounters yes': moved cam/pro/rat/fade labels right one char
       to line up with inside of box (like nixie) so single letter labels
       (A,B,C..) indicate CLEARLY which box they're labeling.

K2.04/TC - 07/29/2021  -- Carl Spencer release

     o Changed nixie display to be one line smaller by optimizing
       the use of inverse text. This led to complications due to
       how x,y addressing is affected by the invisible mode chars,
       necessitating a FindXY() function that works but is kinda
       inefficient. See opcsdisp.c for "FUTURE" to improve this maybe.

     o Copied over slap_screen: code from A800DRV.ASM
       to RTMC48.ASM and MDRIVE.ASM (without it, nixie counters
       weren't drawing properly, due to changes in mode chars)

     o Verified runbar shows msg correctly in all counter types

     o Verified counters don't wrap into runbar for all counter types

     o Force jog to always leave cursor in same position so when
       'unlock' is used (U), message prompts during unlock are seen correctly

     o Made sure that running 'rep 5 cam 5 pro 5' shows in runbar
       for all counters: "Rep", then "Cam Shoot", then "Pro Shoot".

K2.03/TC - 03/09/2021

     o Fixed bug in LOG(OPCS) that caused a "division by zero"
       if 'log' was used with FPF(OPCSDEFS) set to 0 for a channel.

     o Fixed bug with: cam >-1'30
       ..where negative footage counts wouldn't correctly range-check
       the trailing frames value

     o Aborted attempt to support floating point fpf.
       Saved work in "floatfpf", previous work in "intfpf".
       See floatfpf.txt for info.

K2.02/TC - 03/07/2021 - Mike Ferriter IMAX <-> 10 Perf 70

     o Fixed bug in 'POST MORTEM'; when debugging enabled,
       junk[] array was [12] instead of [16]

K2.01/TC - 03/04/2021
     o When 'respond' enabled, 'cmdline' forced to 'dos' mode

K2.00/TC - 05/17/2020
     Ported k1.16 to Turbo C 3.0, fixed various bugs in the process.

     o log off: forces log_counters() before closing log
       (so previous command's effects shown in log before 'log off')

     o flog: fixed bug in fade_log(), where flog=(-1 .. 1)
       was returning the raw fraction (0..1) instead of (start..end).
       SHOULD BACK PORT FIX TO K1.16

     o Got rid of redundant defs->nomotors, replaced with postive logic
       of env->motors.hardware

     o Various fixes to expand_vars/string_replace handling:
	   Sometimes args[2] referenced even if NULL
	   Variables could expand to garbage if beyond range of args[].
	   (Had a > vs >= test error)
           Better warning messages for corner cases

     o Fix commands that act badly when no args given:

	seek check chk go rat rep cam pro pro2 fdi/fdo/dxi/dxo

     o Errors in OPCSDEFS file now report line#.

     o INTERNAL CHANGES:

       > Got rid of all old EMC subroutines, nuked MOTORSUB module.
         Switched to a cleaner module arrangement; see README.txt
         for more info on the module breakdown.

       > RTMC48.ASM modified (now v3.10 - 05/04/2020):
         Changed STI to CLI at top of kuper_int to prevent timer
	 interrupt from triggering during motor servicing.
/|\
 |
K200 (Turbo C 3.0 "Pandemic Port" 05/17/2020)

================================================================
================================================================
================================================================

K100
 |
\|/

K1.16 - 05/02/2020
    o Fixed 'show' command not showing if other commands followed it. e.g.
	  show cam 1
      ..would not show anything, but ran cam command OK.

    o Added 'check' command, e.g. 'check abc 1000,2000,3000'.
      Also now uses channel names from startup.defs instead of
      hard coded names.

    o Added check for OPCS_NORESSHU variable -- if set,
      using 'go' with abc channels will leave step values in counters.

    o There may be a bug in 'go' with long motor runs, e.g.

    	go ab 2000 go ab -8000
	           \_________/
		     This will sometimes run MORE THAN 8000,
		     in a scope grab, it ran 8100 instead of 8000

      Might be a bug in driver's or code's handling when buffer full,
      or handling wrap around. INVESTIGATE! Scope says a800 is sending
      sometimes more/sometimes less pulses than the software sends. WHY?
      Either bug in driver, or bug in 8255 communications timing, or..???

K1.15 - 04/16/08  o velrep would crash if filename didn't exist,
                    or on other file related errors. velrep 
		    'Free' routines were not checking for NULL.

		  o velrep docs modified to indicate the + postfix
		    would either increment OR decrement the frame
		    counter based on the velocity's sign (direction).

		  o home: added OPCSDEBUG to help and man page

		  o velrep mem leak: wasn't free()ing stop/goto/loop labels

		  o go mem leak: seems like hfree() wasn't freeing the
		    halloc()s correctly, causing mem to slowly leak.
		    Solution: FreeRingBuffer() hfree() commented out,
		    run hfree() only on opcs_exit()

		  o To make room for more ram:

		    rtmc48/mdrive: Made environment smaller: 25000 -> 20000
		    (Only need 19660) Run 'defs' or 'show -d' to determine 
		    Environment size.

		    Changed MAXSCRIPTS from 20 to 16

		    velrep: Added CHUNKSIZE to realloc()s to prevent
		            mem fragmentation.

		  o Added 'log <MM-DD-YY>" to automatically create
		    a datestamped log file.

K1.14 - 04/27/03  o Adding new OPCS command 'velrep', added VelRep.C.
		    (For Technicolor)
		  o Modified 'man rtmc48' to include kuper diagram.
		  o Fixed bugs in evalnum.c as per linux port
		  o Fixed bug in opcssubs.c as per linux port

K1.13d - 03/15/02 Fixed 'mov' docs; references to 'h' channel changed to 'f'
		  8255.exe modified to let user change outputs (v2)
		  No changes to OPCS that I know of otherwise.

K1.13c - 12/19/00 BUGFIX: seek couldn't handle different PPR values

K1.13b - 02/05/99 BUGFIX: ARGH! All math functions were offset!! ALL WERE WRONG!
		  BUGFIX: seek 10 10 - seek 10 10 seek 10 10 -
		                                  ------------
						  This would run at NON-slew spd
		  BUGFIX: (6*(3'0)) and (6+4'0) doesn't work!
		  	  Unfortunatly all this stuff was broken; parser
			  numeric parser was checking for ' anywhere in
			  the ENTIRE FORMULA, and not stopping at end of
			  numeric value.
		  ENH: Added (?) to print actual evalnum help

K1.13a - 07/11/98 BUGFIX: ease had trouble with numbers >+-32768.
			   Problem was Round() returned an int, and
			   easediff variables were int instead of Pos.
		  ENH: home now has 'reset [chan] [val]'
		  ENH: gr has 'v' to plot vels
		  ENH: pending feeds are now shown in the runbar
		  BUGFIX: BAD BUG in shutter.c since k1.13: 'cam 110' didn't
		          actually shoot 110 frames, and left motor out of 
			  sync. Bug was in DumpVels() being called under non-
			  allstop situations.
		  ENH: runcmd now allows -1 as #args for variable args.
		       Also, existence of .HLP files are checked, and printed
		       during errors in number of arguments.
		  ENH: $* now expands ALL variables.

K1.13  - 06/18/98 BUG FIX - 'FDI 2 CAM 10' would stop/go shoot last 8
		  BUG FIX - 'SHU 50 RESET D 0 SEEK 1 1' moves fader?!
			    Created SetCounter() that updates both counter and 
			    defs->fader.
		  BUG FIX - mods to shutter.c so key release while in key(OPCS)
		            mode dumps part of ring buffer, making motors stop
			    quicker. [ Added DumpHalfStack() ]
		  ENH: Added cam/pro variables to evalnum
		  ENH: Added 'DO UNTIL (CAM=12) ..', modified manpage
		  DOC: Added manpage for debugger(OPCSDEFS)
		  ENH: home program now has a 'default' clause, so 'home'
		       without args can be _controlled_
		  ENH: Added spdinterp(DEFS) to allow zoom to affect exposure
		       automatically.
		  Introduced: ease.exe and gr.exe for doing pans/zooms.

k1.12f - 05/13/98 Added faderdisplay [on|off] for cinetech

k1.12e - 04/10/98 Added defs: 
		       '@', 'echo' 'buckle' 'viewer' 'filter' 'keyfunc'
		  Obsolete:
		       'buckview' 'deenergize' 'keydef'
		  Added opcs: 'autofilt'
		  Seek now ignores viewer, but still senses buckles
		  Redraws allstop msgs w/out flashing after cont/abt.
		  Added autofilt(OPCS) and filter(OPCSDEFS)
		  Made man pages for logformat, and all new commands
		  Added +-*/ to SPD(OPCS): OK
		  Added '-all' flag to SHOW(OPCS): OK

k1.12d - 04/07/98 BUGFIX: pro2display disables ratio too
		  BUGFIX: Enabled runbar() again (been off how long?!)
		  Status line is now:
		     <-0 RUNBAR 24-><-25 SCRIPT 52-><-53 FADE/DX 79->

k1.12c - 04/02/98 added defs: pro2display, set/clr/xorbit
k1.12b - xx/xx/9x added 'logformat' command
k1.12a - xx/xx/9x added feet/frames to logcounters
k1.12  - xx/xx/9x FINAL FIX for stupid screen scroll problem (mdrive.asm)
k1.11e - xx/xx/9x -x flag added to fdi/fdo/dxi/dxo
k1.10e - xx/xx/9x rat 1 0 1: fix to run in tandem
k1.10d - xx/xx/9x key: projector run keys don't check buckview now.
k1.10c - xx/xx/9x Bugfix for (176'-32) vs (176'0-32) in evalnum.
k1.10b - 08-06-92 key wont cls after called from script
k1.10a - 07-24-92 ALT-letter works a little better.
k1.10  - 05-29-92 Added softlatch to handle kuper's I/O port card
		  (which can be written to, but not read). Added 
		  'rat 4 4' to shoot 4, advance 4, shoot 4, etc.
k1.09  - 04-22-92
	 SPD BUGFIX: opcsdefs wasn't passing speed scale to kuper subs
	 BIG BUG FIX --> in shutter: ContShut(): slow speeds caused
		  no ramping (ok), but an allstop failed (stopped out
		  of home) because rdsamp/allstop checking weird.
		  Put allstop opportunity AFTER vels get sent.
	 ALSO: ShutterStop() wasn't checking for non-ramp case 
	       properly, and incorrectly computed if in midst of
	       rampdown (added /32, and more reliable check. TESTED)
	       Symptoms were stalls.
	 ALSO: ContShutter() wasn't pointing ASADDR to velstop stack
	       values (non-ramp), caused intermittent stall if ASTOP
	       occurred during ShutterFlush() (which uses ASADDR if
	       someone hits allstop)
k1.08  - 04-21-92 prophase added, spd(DEFS) handles '-' for any args.
k1.07  - 04-13-92 Added frange(OPCSDEFS) command at Tony's request.
k1.06  - 04-08-92 Bug fix in motorsubs.c: RampDownNow(): 
	 ONTHEFLYRAMPDOWN. Bug fix: JOG: crawl FWD/REV now updates
	 large display, improved bar() subroutine for faster display.
k1.05  - Added keydef(OPCSDEFS), JogRelease() etc.
k1.04  - is_all_stop_key() checks for allstop key even if 'motors off'.
	 execute_args() now checks custom commands for all arguments.
k1.03  - Added 'respond', centralized the ALLSTOP handlers to the
	 subroutines in OPCSSUBS, put in IFDEF OPCS clause for code
	 in motorsubs.c, Evalnum: hex() function added,
	 opcsjog: key->changed=0 when called. Seek added to KEY(OPCS).
k1.02f - run()'s ReadLine() modified: 199 changed to MAXLINECHARS,
	 ReadLine() modified to handle 'Line too long' errors.
	 Added ALT+chan letter to JOG. 
	 Fix run() to break when skipping if EOF reached.
	 Jog comes up with 'D' as default instead of 'A'

k1.00 - This is a complete rewrite for use with kuper card and EMC subs.
        Customers wanted a microstepper version for their precision printers.

/|\
 |
K100 MICROSTEPPER

==                                       =====================================
== k1.00 - Kuper Microstepper Version    =====================================
==                                       =====================================

HALF STEPPER
 |
\|/

3.00f - OPCSDEFS.C modified out redundant 'IsBadMotor()' calls.
3.00e - EFW Bugfixes:
	o PANIC/ABORT in a RUN file would continue anyway
	  with next line. err=execute_string() in OPCSCMDS.
3.00d - REP >54 and REP PRO >54, added fpf_eval_num_expr(), fixed
	'K' in bignum.
3.00c - Fix:'motors off cam 12 motors off' screws up old counts.
	Added $1 $2 variable passing to RUNCMD.
	VCE's "102 PRINTER" RELEASE.
3.00b - Fix to seek() [seek 1 1 1 then seek 1 would run 1 1 1]
3.00a - JOG has inching, frame windoffs. (needs set-keys, slaving)
	Motor routines called w/func ptrs for counter updates. Slop
	routine bugfix. opcs has arg for different OPCSDEFS.OPC file.
3.00  - 12 channels supported, added +/- ratio to KEY. MANY subroutines
	have been modified in OPCSRAMP.C, and allstop() handling was
	greatly modified. Fix to SlopCorrection(). Fix to EvalFrameSpec:
	changed (int) typecast to (Frame). Added counter/rat sets to
	key_cmd, et al. Put back load_cmd.
2.10f - fixes to opcsinterp.c Lookup2Steps(using a [high] value would
	produce huge numbers) and to opcsramp (0xff instead of 0xffff).
	CS_WAIT has STI now. (bug came up in 103.00)
2.10e - timeinterp uses seconds/cycles, feed allows floats for interp
	channels.
2.10d - fixes to opcsinterp.c (free samp), jog added, fix ppr=1 slow
	added * for a chan spec, Chan2Bin() 'total' now a ptr, bug
	fix in GetFaderValue() to check for defs->interp==NULL,
	res2,rat2,seek2,chk2 have been phased out.
2.10c - floor(), fixes to step_cmd, opcsline.c, opcseval.c
2.10b - feed, step uses interps (ffocus, etc), PreCamEvent()
2.10a - timeinterp uses pps instead of seconds
2.10  - Large model, float interps, time interp, all 8 motors run
2.01b - buckle check BEFORE running motors, load removed
	VCE's "103 PRINTER" RELEASE
2.01a - key, load, lineup, less runbar calls, step abc no counter
2.01  - ramping, fast seek, pro2display bugfix, dirxor bugfix
2.00c - fix to SEEK..ShootRatio() contained wrong ratio
2.00b - fix to OPCSBIG (added NULL in pattern[] init), dutycycle, deen
2.00a - fix to shutdrvr.asm for projectors going 1/2 out of phase
2.00  - Parallel/steps/direction, 8 motor max, concurrent shooting.
1.50  - Commands and code added for DUAL projectors.
1.40a - Fixes to allstop handler, and DBXSAVE->COUNTER is now 'int'
1.40  - Lock command added, check buckle during shoot, allstop/buck
	checked in C, DBX saves/restores counters.
1.38  - Local/Public motor subs, contrived msg, (needs init code)
1.37d - step modified with optional arguments,log handles #-----
1.37c - better /etc/crash handling, LPT1/LPT2 hardware checks
1.37b - cam >-2 bugfix, debug info commented out (ONEIL 1/3/89)
1.37a - spacebar for allstop, double_check_hardware().

VERSION HISTORY
---------------
    APPLE ][+ OPCS: 1985 - 198x
    ---------------------------
    OPCS was initially conceived in the mid 1980's while I was a
    student at Calarts (82-86). Written in APPLE ][+ BASIC and 6502
    Assembly, this version was used by students until the late 80's.

    HALF STEPPER (PARALLEL PORT) OPCS
    ---------------------------------
    In 1988 Pat O'Neil asked if I could provide OPCS for one of his
    printers. The software was rewritten on the IBM PC in C and 8086
    assembly. This version built with the Microsoft V1.0 compiler,
    and was used by Pat O'Neil (Lookout Mountain Films) and Pete Kuran
    (VCE), and
    replaced the Apple ][+ system at Calarts.
    , using the parallel port to drive the motors dirctly.

    MICROSTEPPER (KUPER) OPCS: 1.xx
    -------------------------------
    When Bill Tondreau started Kuper Controls, he and I worked a deal
    where I could use his RTMC16 microstepper pulse generator cards
    on the PC to drive motors instead of parallel ports.  This was 
    used on Pat O'Neil's second printer, with Centent microsteppers.
    This became the "K100" version of OPCS.  This version was licensed
    to many companies; Title House, Introvision, Technicolor, YCM,
    Cinetech, etc, etc. This version supports the RTMC16, RTMC48, and
    Kuper Industrial cards using different DOS TSR drivers.

KUPER OPCS: 2.xx
    During the world pandemic of 2020, I ported the code to Turbo C 3.0,
    and also developed my own microstepper card, the A800. This version
    continued support of all the above Kuper cards and the new A800.
    Turbo C had better error checking and modern C prototyping.

© Copyright 1997 Greg Ercolano. All rights reserved.