;  patch kit for 31Ee  Autostar 497
; This 2 Dec 2003  patch31e4.txt patch file contains:

;  Editing of Training Values
; (an EDIT menu item under Setup>Train Drives)
;  Adds 4504/114eq to Known Models (replaces DS-70)(a GEM scope!)
; this also allows DS motors to be used on a GEM mount.

; OPTIONAL patches: (edit this file to invoke or supress)
;  Automatic Satellite Track starting at down-count=zero 
;  CordWrap control 
;  Allow LPI to autoguide in Alt/Az 
;-----------------------

;  Version number change from 31Ee  to 31e4 (so Initialization shows 31e )

; adjusted to work with Autostar Suite

; rseymour@wolfenet.com 2-Dec-2003

; Here are the Three optional patches:
;   Cord Wrap control, Automatic Satellite Tracking, Skip Time/date

; ADD semicolons (;) in front of the next three ";R" lines to BLOCK permitting of
; Cord Wrap ON/OFF in hard-stopped scopes (ETX90/105/125,LXD55)
; This only -allows- turning Cord Wrap OFF, it does not change its current setting.

R      1fa8f   27      20      cordwrap [ 31ee:3-Ea8f 
R      1fb6f   26      21      cordwrap [ 31ee: 3-eb6f
R      1fa93   17      23      chksum   cordwrap [ 31ee: 3-ea93

; ADD semicolons to the following three "R" lines to -prevent- Automatic
;  Start-of-tracking during a Satellite pass.  
;            Satellite  AutoTrack

R       45e17   bd      20      (-9d)      AutoTrack  [31ee:8-ce17
R       45e18   1d      21      (+04)=-99  AutoTrack  [31ee:8-ce18
R       45e1a   05      9e      (chksum) 99+5  AutoStart  [31ee:8-ce1a

; *Remove* next three "R" line semicolons to:
; Allow LPI Autoguiding for Alt/Az as well as polar. Field Rotation issues.
;
; R   2f880   1f  20    autoguide for alt/az too [31ee (brclr->bra+02)
; R   2f881   00  02    autoguide for alt/az too [31ee 
; R   2f882   08  05    autoguide for alt/az too [31ee (chksum)

;  there are NO further "optional" patches in this file.
;  changing any further "R" lines will cause the Updater to refuse to load the file.

;=== make no changes below this line ====

; Autostar Menu items added by this patch:
;
;  Training results Display and Edit:

; Under Setup > Telescope > Train Drive 
; are now (scroll up or down from the "Az/RA Train" or "Alt/Dec Train")
;  Edit: > Az/RA Train
;    and
;  Edit: > Alt/Dec Train
; press [enter] to allow direct display and manipulation of the results of training.
;    a power cycle (without using Park Scope) is needed for 
;     the  new values to be fully implemented.
; =======

;  4504/114eq replaces DS-70  (use the DS-60 for -70 if you need to)
;   The upper lower travel limits are 4800/-600 arcmin (+60 deg, - 10 deg)
;   ... values taken from the LXD55 series.  Please inform me if they're
;  too restrictive (too many Check Mount messages) or too loose (hits tripod)
;

;  For installation instructions, see:
;   README31e4.txt  which should have come with this kit.
;  the last line of -this- file says "; end of patch 31e4"
;  "Have fun" (tm) -- Dick Seymour   2-Dec-2003

;  there are NO further "optional" patches in this file.
;  changing any further lines will cause the Updater to refuse to load the file.

; 30Ed/e patch region:  a-b55d to b5ff 

;
R       0004    5c      d0       chksum
R       0005    fe      a5       chksum
;R       0006    b5      b5      ;chksum
;R       0007    07      07 

R       000A    45      65      (E->e) [31Ee] version
R       0142FE  45      65      (32fe) [31Ee] version
R       000b    65      34      (e->4) [31Ee] version 31e4
R       0142Ff  65      34      (32ff) [31Ee] version
;=================================
; automatic menu patches v31ee
R      12B9A    1B    1B     CityDwn to Street
R      12B9B    B6    86     CityDwn to Street
R      12B8C    1B    1B     StrtUp to City *
R      12B8D    A6    96     StrtUp to City *

R      12BA6    02    02     ZipAddr->Tr Drv msg
R      12BA7    BF    A9     ZipAddr->Tr Drv msg
R    12ba8   02   01
R    12ba9   c3   79
R      12BAC    1B    1A     Zip up to AltTrn
R      12BAD    B6    46     Zip up to AltTrn
R      12BAE    1B    1A     ZipMode to TrnDrvs
R      12BAF    76    16     ZipMode to TrnDrvs
R      12BB3    04    8      action page to Patch page
R      12BB4    BC    b5     ZipAct adr to Ptch adr
R      12BB5    41    5d     ZipAct adr to Ptch adr

R      12A4A    1A    1B     AltTrnDwn to AzEd/Zip
R      12A4B    36    A6     AltTrnDwn

R      12BB6    02    02     StateAddr->Tr Drv msg
R      12BB7    BF    A9     StateAddr->Tr Dev msg
R      12BB8    02    01     State->AltTrnMsg(DoB)
R      12BB9    C2    7a     State->AltTrnMsg(DoB)
R      12BBA    1B    1A     SteDwn to AltTrn
R      12BBB    A6    36     SteDwn to AltTrn
R      12BBE    1B    1A     SteMode to TrnDrvs
R      12BBF    76    16     SteMode to TrnDrvs
R      12BC3    04    8      action page to Patch page
R      12BC4    BB    b5     act adr to Patch adr
R      12BC5    FA    89     act adr to Patch adr

R      12A3C    1A    1B      AzTrnUp to AltEdit/State
R      12A3D    46    B6      AzTrnUp to AltEdit

R   12bab   86  b6
R   12bbd   96  a6

R      97873  50  45 ; P->E
R      97874  6F  64 ; o->d
R      97875  73  69 ; s->i
R      97876  74  74 ; t->t
R      97877  61  20 ; a-> 
R      97878  6C  41 ; l->A
R      97879  2F  7A ; /->z
R      9787A  5A  20 ; Z-> 
R      9787B  69  54 ; i->T
R      9787C  70  72 ; p->r
R      9787D  20  61 ;  ->a
R      9787E  43  69 ; C->i
R      9787F  6F  6E ; o->n
R      97880  64  3A ; d->:
R      97881  65  20 ; e-> 
R      97883  44  45 ; D->E
R      97884  61  64 ; a->d
R      97885  74  69 ; t->i
R      97886  65  74 ; e->t
R      97887  20  20 ;  -> 
R      97888  6F  41 ; o->A
R      97889  66  6C ; f->l
R      9788A  20  74 ;  ->t
R      9788B  42  20 ; B-> 
R      9788C  69  54 ; i->T
R      9788D  72  72 ; r->r
R      9788E  74  6E ; t->n
R      9788F  68  3A ; h->:
R      97DC0  72  34 ; r->4
R      97DC1  65  35 ; e->5
R      97DC2  61  30 ; a->0
R      97DC3  6B  34 ; k->4
R      97DC4  6D  2F ; m->/
R      97DC5  61  31 ; a->1
R      97DC6  73  31 ; s->1
R      97DC7  6B  34 ; k->4
R      97DC8  20  65 ;  ->e
R      97DC9  5B  71 ; [->q


;=======================================
; Az: 8-b55d Alt: 8-b589
;       [8b55d]   AZ   Train display [31ee] x67 bytes [31ee:8-b55d
R       04455d  FF      3C      pshx
R       04455e  FF      BD      jsr
R       04455f  FF      25      clrscrn [31ee:25ac
R       044560  FF      ac      clrscrn [31ee:25ac
R       044561  FF      FC      ldd
R       044562  FF      B6      azTrain  
R       044563  FF      0B      azTrain  [26gc: b60b) 30ed/e:b60b
R       044564  FF      30      tsx
R       044565  FF      ED      std
R       044566  FF      00      0.x
R       044567  FF      CC      ldd
R       044568  FF      01      msgNum
R       044569  FF      79      az [31ee: 02aa->0179
R       04456a  FF      BD      jsr
R       04456b  FF      1d      dispatch
R       04456c  FF      f9      dispatch [31ee:1df9
R       04456d  FF      09      page
R       04456e  FF      ca      d->msg [31ee: 9-cab6
R       04456f  FF      b6      d->msg [31ee: 9-cab6]
R       044570  FF      BD      jsr
R       044571  FF      25      msg->scrn [31ee:25dc
R       044572  FF      dc      msg->scrn [31ee:25dc
R       044573  FF      C6      lda#01
R       044574  FF      01      #01
R       044575  FF      37      pshb
R       044576  FF      5C      incb
R       044577  FF      BD      jsr
R       044578  FF      25      cursor [31ee:2560
R       044579  FF      60      cursor [31ee:2560
R       04457a  FF      31      ins
R       04457b  FF      30      tsx
R       04457c  FF      8F      xgdx
R       04457d  FF      BD      jsr
R       04457e  FF      1d      dispatch
R       04457f  FF      f9      dispatch [31ee:1df9
R       044580  FF      05      page
R       044581  FF      a6      IntegerInput [31ee:a64f
R       044582  FF      4f      IntegerInput [31ee:a64f
R       044583  FF      CE      ldx#
R       044584  FF      B6      azTrain
R       044585  FF      0B      azTrain [31ee]
; variation: jump to common exit code. (could branch, jump's easier)
R       044586  ff    7e   jmp
R       044587  ff    b5   [30Ed: common: b5b2 ]
R       044588  ff    b2   [30Ed: common: b5b2 ]

;              ALT Train display [a-b589]
R       044589  FF      3C      pshx
R       04458A  FF      BD      jsr
R       04458B  FF      25      clrscrn [31ee:25ac
R       04458C  FF      ac      clrscrn [31ee:25ac
R       04458D  FF      FC      ldd
R       04458E  FF      B6      altTrain
R       04458F  FF      09      altTrain [31ee
R       044590  FF      30      tsx
R       044591  FF      ED      std
R       044592  FF      00      0,x
R       044593  FF      CC      ldd#
R       044594  FF      01      msg:Alt
R       044595  FF      7a      Alt [31ee:02ab->017a
R       044596  FF      BD      jsr
R       044597  FF      1d      dispatch
R       044598  FF      f9      dispatch [31ee:1df9
R       044599  FF      09      page
R       04459A  FF      ca      d->msg [31ee: 9-cab6
R       04459B  FF      b6      msg [31ee: 9-cab6]
R       04459C  FF      BD      jsr
R       04459D  FF      25      d->scrn [31ee:25dc
R       04459E  FF      dc      scr [31ee:25dc
R       04459F  FF      C6      ldb#
R       0445a0  FF      01      #01
R       0445a1  FF      37      pshb
R       0445a2  FF      5C      incb
R       0445a3  FF      BD      jsr
R       0445a4  FF      25      cursor [31ee:2560
R       0445a5  FF      60      curs  [31ee:2560
R       0445a6  FF      31      ins
R       0445a7  FF      30      tsx
R       0445a8  FF      8F      xgdx
R       0445a9  FF      BD      jsr
R       0445aA  FF      1d      dispatch
R       0445aB  FF      f9      dispatch [31ee:1df9
R       0445aC  FF      05      page
R       0445aD  FF      a6      IntInput [31ee:a64f
R       0445aE  FF      4f      IntIn [31ee:a64f
R       0445aF  FF      CE      ldx#
R       0445b0  FF      B6      altTrain
R       0445b1  FF      09      altTrain [31ee]
R       0445b2  FF      3C      pshx   <-- common  [31ee: b5b2
R       0445b3  FF      30      tsx
R       0445b4  FF      EC      ldd
R       0445b5  FF      02      2,x
R       0445b6  FF      BD      jsr
R       0445b7  FF      22      burnWd
R       0445b8  FF      90      burn [31ee:2290
R       0445b9  FF      38      pulx
R       0445bA  FF      38      pulx
R       0445bB  FF      39      rts
; 8-b5bc next free byte
; 4504
; 4504/114eq replacing DS-70  20xxx=3-f000 [30ed] 30ee:

R       208a6   98      f4    DS-70->4504msg [31ee:3-f8a6

R       202b0   02      03     900 FL [31e:3-f2b0
R       202b1   bc      84   [31ee]
R       202bb   0f      12      4800_max_elev [31ee] (3-f2bb)
R       202bc   78      c0   [31ee]
R       202c6   fe      fd     -600_min_elev [31ee]  (3-f2c6)
R       202c7   5c      a8   [31ee]
R       202cf   03      08    3-f05a_branch [31ee]  (3-f2cf/d0/d1)
R       202d0   f0     B5    3-f05a_branch  [31ee] 08-b5-bc 
R       202d1   5a     bc    3-f05a_branch  [31ee: 08-b5-bc

; patch requires x4f bytes  ..from (31ee)8-b5bc..
R       0445bc   ff      3c  at 8-b526  [31ee:8-b5bc
R       0445bd   ff      3c   pshx,pshx
R       0445be   ff      cc   ldd_03ca 4504 ratio  4.562963
R       0445bf   ff      03
R       0445c0   ff      CA
R       0445c1   ff      30   tsx
R       0445c2   ff      ed   std_2,x
R       0445c3   ff      02
R       0445c4   ff      cc   ldd_4092
R       0445c5   ff      40
R       0445c6   ff      92
R       0445c7   ff      ed   std_0,x
R       0445c8   ff      00
R       0445c9   ff      bd   dispatch [31ee:1df9
R       0445ca   ff      1d
R       0445cb   ff      f9   [31ee:1df9]
R       0445cc   ff      09  setAzratio [31ee:9-d9c2
R       0445cd   ff      d9   [31ee]
R       0445ce   ff      c2   [31ee]
R       0445cf   ff      cc   ldd_0194 4504 ratio=4.562693
R       0445d0   ff      01
R       0445d1   ff      94
R       0445d2   ff      30   tsx
R       0445d3   ff      ed   std_2,x
R       0445d4   ff      02
R       0445d5   ff      cc   ldd_4092
R       0445d6   ff      40
R       0445d7   ff      92
R       0445d8   ff      ed   std_0,x
R       0445d9   ff      00
R       0445da   ff      bd   dispatch  (31ee:1df9
R       0445db   ff      1d
R       0445dc   ff      f9   [31ee:1df9
R       0445dd   ff      09   setALTratio [31ee: 9-D9F7
R       0445de   ff      d9    [31ee]
R       0445df   ff      f7    [31ee]
R       0445e0   ff      cc   ldd_B73E_(status_bits)[31ee]
R       0445e1   ff      b7
R       0445e2   ff      3e
R       0445e3   ff      30   tsx
R       0445e4   ff      ed   std_0,x
R       0445e5   ff      00
R       0445e6   ff      f6   ldab_B73e [31ee]
R       0445e7   ff      b7
R       0445e8   ff      3e
R       0445e9   ff      ca   orab_x18_(GEM,Polar)
R       0445ea   ff      18
R       0445eb   ff      bd   jst_burn_Byte   ( 3d:228f 30ee:
R       0445ec   ff      22   [31ee:22a4
R       0445ed   ff      a4   [31ee:22a4
R       0445ee   ff      cc   ldd_B73d_(more_status)
R       0445ef   ff      b7
R       0445f0   ff      3d   [31ee]
R       0445f1   ff      30   tsx
R       0445f2   ff      ed   std_0,x
R       0445f3   ff      00
R       0445f4   ff      f6   ldab_b73d [31ee]
R       0445f5   ff      b7
R       0445f6   ff      3d
R       0445f7   ff      ca    orab_x08_(cord_wrap)
R       0445f8   ff      08
R       0445f9   ff      bd   jsr burnByte (31ee:22a4
R       0445fa   ff      22   [31ee:22a4
R       0445fb   ff      a4   [31ee:22a4
R       0445fc   ff      38   pulx
R       0445fd   ff      38   pulx
R       0445fe   ff      39   rts
; end of patch 31e4