; source ROM
$SourceVersion=40Eb
$SourceChecksum=07293f9d
$StarPatchVersion=1.5

[Patch 40B4]
S=Always
> Patch40bb.spf 8-OCt-2005 for Build40Eb.rom
>  Revised 40Eb patch (Simple patches corrected)
>
> GPS Setup patch (c) 2005, PixSoft Inc. by:
> ccarson@pixsoft.ca
>
> Autostar patches (c) 2005, Dick Seymour by:
> rseymour@wolfenet.com (patchkit 40bb used with permission)
>
> Version number changes from 40Eb to 40b4 (so Initialization shows 40b).
>  This kit has the 4504 section DISABLED by default
>

[Version 40Bb]
S=Checked
R       000A    45      42      (E->B) [40bb] version
R       0143FE  45      42      (40eB) [40bb] version

[Skip Simple Align]
S=Checked
> Skips the "0 to Align, Mode for Menu" at power-up (forces "menu")
R 5-c954   cc  c6
R 5-c955   02  09
R 5-c956   5f  7e
R 5-c957   bd   c9
R 5-c958   00   78

[Skip Simple Tour]
S=Checked
> Skips the "0 for Tour, Mode for Menu" after aligning (forces "menu")
R 5-c6af  cc  c6    ldb 09
R 5-c6b0  02  09     
R 5-c6b1  64  7e    jmp c6d9
R 5-c6b2   bd  c6
R 5-c6b3   00  d9


[Cord Wrap]
S=Unchecked
> Cord Wrap ON/OFF in hard-stopped scopes (ETX90/105/125, LXD55/75).
>
> This only -allows- turning Cord Wrap OFF, it does not change its current setting.
R   4-a50a    27  20    cordwrap   [ 34ec 40eb
R   4-a5fa    26  21      cordwrap [ 34ec 40eb

;Total  XXXX    64      64


[Skip Date/Time/Daylight]
S=Unchecked
> Skips the startup date, time and daylight savings prompts.
>
> This patch is useful for fully-remote operation.
> This is not useful if you are using the GPS Setup patch (with GPS).
R 5-bbfd    bd  7e   ; jmp to after time/date/daylight    33eL:5-b33b  40eb
R 5-bbfe   00  bc   ; jmp   ->b396    33eL:5-b33c
R 5-bbff   40  58   ; (04 97 05)  fd  1c7 =ca =b6+14     33eL:5-b33d
;Total XXXX FD 1C7


[Satellite AutoTrack]
S=Checked
> Automatic Satellite Track starting at down-count = zero.
>
> The scope will start to track a satellite when the timing count-down hits zero.
> Unlike the "normal" firmware, the beep will NOT sound when tracking starts.
R   9-d664  bd   20  (-9d)      AutoTrack  [ 40eb
R   9-d665  00   21  (+21)=-7c  AutoTrack  [ [40eb
;Total  XXXX  C5      C5


[LPI Autoguiding for Alt/Az]
S=Checked
> Allow LPI Autoguiding for Alt/Az as well as polar mode.
> 
> NOTE: Field Rotation issues apply to Alt/Az.
R  8-dfeb   1f  20 autoguide alt/az too [(brclr->bra+02) [40eb
R  8-dfec   00  02    autoguide for alt/az too [   [40eb
;Total XXXX 27 27

[DSI Autoguiding for Alt/Az]
S=Unchecked
> The DSI autoguiding software checks to see if the scope is Polar mounted.
> If it's Alt/Az mounted, it only offers AutoTrack, not AutoGuide.
> This patch causes the scope to -always- report that it's Polar mounted.
> I don't think this lie has any other negative consequences, but i'm leaving this
>  optional patch -not- selected as the default.  
> Tick it to have your scope always claim that its mount is "Polar",
> even if it's Alt/Az.
> No effect upon normal Autostar operations.
;
R 8-ed23 41  50    change ACK response from "A" to "P" [40eb

;Total  4


[Editing of Training Values]
S=Checked
> Display and Editing of Training Values.
>
> Autostar Menu items added by this patch:
>
> Under Setup > Telescope > Train Drive 
> are now "Az/RA Train" and "Alt/Dec Train" if you
> [scroll up] or [scroll down]  from the usual entries.
>
> 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.
;=================================
; automatic menu patches v40eb
R      13D7E    2D    2D     CityDwn to Street
R      13D7F    9A    6A     CityDwn to Street

R      13D70    2D    2D     StrtUp to City
R      13D71    8A    7A     StrtUp to City

R      13D8A    03    02     ZipAddr->Tr Drv msg
R      13D8B    00    E4     ZipAddr->Tr Drv msg
R      13D8C    03    01     Zip->AzTrnMsg(postal)
R      13D8D    04    90     Zip->AzTrnMsg(postal)
R      13D90    2D    2C     Zip(AzEd) up to AltTrn
R      13D91    9A    1A     Zip(AzEd) up to AltTrn
R      13D92    2D    2B     ZipMode to TrnDrvs
R      13D93    5A    AA     ZipMode to TrnDrvs
R      13D97    05    b      action page to Patch page
R      13D98    8F    b5     ZipAct adr to Ptch adr
R      13D99    2A    5d     ZipAct adr to Ptch adr

R      13C1E    2C    2D     AltTrnDwn to AzEd/Zip
R      13C1F    0A    8A     AltTrnDwn to AzEd/Zip

R      13D9A    03    02     StateAddr->Tr Drv msg
R      13D9B    00    E4     StateAddr->Tr Dev msg
R      13D9C    03     1     State->AltTrnMsg(DoB)
R      13D9D    03    91     State->AltTrnMsg(DoB)
R      13D9E    2D    2C     SteDwn to AzTrn
R      13D9F    8A    0A     SteDwn to AzTrn
R      13DA0    2D    2D     SteUp to Zip(AzEd)
R      13DA1    7A    8A     SteUp to Zip(AzEd)
R      13DA2    2D    2B     SteMode to TrnDrvs
R      13DA3    5A    AA     SteMode to TrnDrvs
R      13DA7    05    b      action page to Patch page
R      13DA8    8E    b5     act adr to Patch adr
R      13DA9    E3    89     act adr to Patch adr

R      13C10    2C    2D      AzTrnUp to AltEdit/State
R      13C11    1A    9A      AzTrnUp to AltEdit

R      13D8E    2D    2D     Zip(AzEdit)dn->State(AltEdit)
R      13D8F    6A    9A     Zip(AzEdit)dn->State(AltEdit)


R      A1AAC  50  45 ; P->E
R      A1AAD  6F  64 ; o->d
R      A1AAE  73  69 ; s->i
R      A1AAF  74  74 ; t->t
R      A1AB0  61  20 ; a-> 
R      A1AB1  6C  41 ; l->A
R      A1AB2  2F  7A ; /->z
R      A1AB3  5A  20 ; Z-> 
R      A1AB4  69  54 ; i->T
R      A1AB5  70  72 ; p->r
R      A1AB6  20  61 ;  ->a
R      A1AB7  43  69 ; C->i
R      A1AB8  6F  6E ; o->n
R      A1AB9  64  3A ; d->:
R      A1ABA  65  20 ; e-> 
R      A1ABC  44  45 ; D->E
R      A1ABD  61  64 ; a->d
R      A1ABE  74  69 ; t->i
R      A1ABF  65  74 ; e->t
R      A1AC0  20  20 ;  -> 
R      A1AC1  6F  41 ; o->A
R      A1AC2  66  6C ; f->l
R      A1AC3  20  74 ;  ->t
R      A1AC4  42  20 ; B-> 
R      A1AC5  69  54 ; i->T
R      A1AC6  72  72 ; r->r
R      A1AC7  74  6E ; t->n
R      A1AC8  68  3A ; h->:

;=======================================
; Az: b-b55d Alt: b-b589, 8-b is 044xxx 9-b is 04Cxxx  b-b is 05Cxxx
;       [40b:b-b55d]   AZ   Train display [40b: b-b55d 
R       05c55d  FF      3C      pshx
R       05c55e  FF      BD      jsr
R       05c55f  FF      08      clrscrn [40b: L0844
R       05c560  FF      44      clrscrn [40b: L0844
R       05c561  FF      FC      ldd
R       05c562  FF      B6      azTrain  
R       05c563  FF      0B      azTrain  [b60b
R       05c564  FF      30      tsx
R       05c565  FF      ED      std
R       05c566  FF      00      0.x
R       05c567  FF      CC      ldd
R       05c568  FF      01      msgNum [Postal: 
R       05c569  FF      90      az     [Postal: 
R       05c56a  FF      BD      jsr
R       05c56b  FF      00      dispatch
R       05c56c  FF      40      dispatch [32Ei: 0040
R       05c56d  FF      0a      page
R       05c56e  FF      c9      d->msg  [40b: a-c92d
R       05c56f  FF      2d      d->msg  [40b
R       05c570  FF      BD      jsr
R       05c571  FF      08      msg->scrn [ 40b: 0874 
R       05c572  FF      74      msg->scrn [ 40b: 0874 
R       05c573  FF      C6      lda#01
R       05c574  FF      01      #01
R       05c575  FF      37      pshb
R       05c576  FF      5C      incb
R       05c577  FF      BD      jsr
R       05c578  FF      07      cursor [  40b: 07f8
R       05c579  FF      f8      cursor [  40b: 07f8
R       05c57a  FF      31      ins
R       05c57b  FF      30      tsx
R       05c57c  FF      8F      xgdx
R       05c57d  FF      BD      jsr
R       05c57e  FF      00      dispatch
R       05c57f  FF      40      dispatch [  40b: 0040
R       05c580  FF      08      page
R       05c581  FF      9b      IntegerInput [  40b:8-9b09
R       05c582  FF      09      IntegerInput [  40b: 8-9b09
R       05c583  FF      CE      ldx#
R       05c584  FF      B6      azTrain
R       05c585  FF      0B      azTrain [  40b: ]
; variation: jump to common exit code. (could branch, jump's easier)
R       05c586  ff    7e   jmp
R       05c587  ff    b5   [30Ed-32: common: b5b2 ]
R       05c588  ff    b2   [30Ed-32: common: b5b2 ]

;              ALT Train display [8-b589]
R       05c589  FF      3C      pshx
R       05c58A  FF      BD      jsr
R       05c58B  FF      08      clrscrn [ 40b: L0844  34ec
R       05c58C  FF      44      clrscrn [ 40b: L0844
R       05c58D  FF      FC      ldd
R       05c58E  FF      B6      altTrain
R       05c58F  FF      09      altTrain 
R       05c590  FF      30      tsx
R       05c591  FF      ED      std
R       05c592  FF      00      0,x
R       05c593  FF      CC      ldd# 
R       05c594  FF      01      msg:Alt [Date of Birth]
R       05c595  FF      91      Alt [ 40b: 0191
R       05c596  FF      BD      jsr
R       05c597  FF      00      dispatch
R       05c598  FF      40      dispatch [ 40b: 0040
R       05c599  FF      0a      page
R       05c59A  FF      c9      d->msg [ 40b 33El: a-c92d
R       05c59B  FF      2d      d->msg [ 40b 33El: a-c92d
R       05c59C  FF      BD      jsr
R       05c59D  FF      08      d->scrn [ 40b: 0874
R       05c59E  FF      74      d->scrn [ 40b: 0874
R       05c59F  FF      C6      ldb#
R       05c5a0  FF      01      #01
R       05c5a1  FF      37      pshb
R       05c5a2  FF      5C      incb
R       05c5a3  FF      BD      jsr
R       05c5a4  FF      07      cursor [ 40b: 07f8
R       05c5a5  FF      f8      curs  [  40b: 07f8
R       05c5a6  FF      31      ins
R       05c5a7  FF      30      tsx
R       05c5a8  FF      8F      xgdx
R       05c5a9  FF      BD      jsr
R       05c5aA  FF      00      dispatch
R       05c5aB  FF      40      dispatch [ 40b: 0040
R       05c5aC  FF      08      page
R       05c5aD  FF      9b      IntInput [ 40b: 8-9b09
R       05c5aE  FF      09      IntIn [  40b: 8-9b09
R       05c5aF  FF      CE      ldx#
R       05c5b0  FF      B6      altTrain
R       05c5b1  FF      09      altTrain [32Ei]
R       05c5b2  FF      3C      pshx   <-- common  [32Ei: b5b2
R       05c5b3  FF      30      tsx
R       05c5b4  FF      EC      ldd
R       05c5b5  FF      02      2,x
R       05c5b6  FF      BD      jsr
R       05c5b7  FF      04      burnWd
R       05c5b8  FF      dd      burn [40b: 04dd
R       05c5b9  FF      38      pulx
R       05c5bA  FF      38      pulx
R       05c5bB  FF      39      rts
;Total  xxxx  75F1    3D9A


[4504/114eq vs DS-70]
S=UNchecked
> Adds "4504/114eq" (a GEM scope!) to Known Models.
> This replaces the DS-70 (use the DS-60 for -70 if you need to)
> and adds PEC for the 4504 (100 teeth).
>
> 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)

; version number reflects 4504

R       000b    62      34      (b->4) [ 40b4] version
R       0143Ff  62      34      (33ff) [ 40b4] version

R      A2055  72  34 ; r->4
R      A2056  65  35 ; e->5
R      A2057  61  30 ; a->0
R      A2058  6B  34 ; k->4
R      A2059  6D  2F ; m->/
R      A205A  61  31 ; a->1
R      A205B  73  31 ; s->1
R      A205C  6B  34 ; k->4
R      A205D  20  65 ;  ->e
R      A205E  5B  71 ; [->q

; 4504/114eq replacing DS-70  23xxx=4-a000 [34ec:
;   model name 34ec:4-b39b++
R      4-bb7b   01  02   DS-70->4504msg [40eb: 4-b2ad 01ac->020c 1ae->0211
R      4-bb7c   af  12   DS-70->4504msg [40eb: 1af->0212
;   parameters  34ed:4-acb4++
R       23e46   02      03     900 FL [40b: 4-ae46
R       23e47   bc      84   [
R       23e51   0f      12      4800_max_elev [40b: 4-ae51
R       23e52   78      c0   [
R       23e5c   fe      fd     -600_min_elev [40b: 4-ae5c
R       23e5d   5c      a8   [
R       23e65   04      0b    3-f05a_branch [40eb  33El: 4-ac18  0b (05Cxxx)
R       23e66   aa     B5    3-f05a_branch  [40eb: 0b-b5-bc 
R       23e67   f6     bc    3-f05a_branch  [40eb: 0b-b5-bc 

; patch requires x4f bytes  ..from (32Ei)8-b5bc..
R       05c5bc   ff      3c  at   [33El,34ec: b-b5bc
R       05c5bd   ff      3c   pshx,pshx
R       05c5be   ff      cc   ldd_03ca 4504 ratio  4.562963
R       05c5bf   ff      03
R       05c5c0   ff      CA
R       05c5c1   ff      30   tsx
R       05c5c2   ff      ed   std_2,x
R       05c5c3   ff      02
R       05c5c4   ff      cc   ldd_4092
R       05c5c5   ff      40
R       05c5c6   ff      92
R       05c5c7   ff      ed   std_0,x
R       05c5c8   ff      00
R       05c5c9   ff      bd   dispatch [34ec: 0040
R       05c5ca   ff      00
R       05c5cb   ff      40   [34ec: 0040]
R       05c5cc   ff      0a  setAzratio [33Ef: a-D66E 33El,34ec: a-d670
R       05c5cd   ff      d5   [ 40eb: a-d592
R       05c5ce   ff      92   [ 40eb: a-d592
R       05c5cf   ff      cc   ldd_0194 4504 ratio=4.562693
R       05c5d0   ff      01
R       05c5d1   ff      94
R       05c5d2   ff      30   tsx
R       05c5d3   ff      ed   std_2,x
R       05c5d4   ff      02
R       05c5d5   ff      cc   ldd_4092
R       05c5d6   ff      40
R       05c5d7   ff      92
R       05c5d8   ff      ed   std_0,x
R       05c5d9   ff      00
R       05c5da   ff      bd   dispatch  ([32ei: 0040
R       05c5db   ff      00   [32ei: 0040
R       05c5dc   ff      40   [32ei: 0040
R       05c5dd   ff      0a   setALTratio [ 33El,34ec: a-d6a5
R       05c5de   ff      d5    [ 40eb: a-d5c7
R       05c5df   ff      c7    [ 40eb: a-d5c7
R       05c5e0   ff      cc   ldd_B73E_(status_bits)[31ee]
R       05c5e1   ff      b7
R       05c5e2   ff      3e
R       05c5e3   ff      30   tsx
R       05c5e4   ff      ed   std_0,x
R       05c5e5   ff      00
R       05c5e6   ff      f6   ldab_B73e [31ee]
R       05c5e7   ff      b7
R       05c5e8   ff      3e
R       05c5e9   ff      ca   orab_x18_(GEM,Polar)
R       05c5ea   ff      18
R       05c5eb   ff      bd   jst_burn_Byte   [ 40eb: L04f1
R       05c5ec   ff      04      [ 40eb: L04f1
R       05c5ed   ff      f1      [ 40eb: L04f1
R       05c5ee   ff      cc   ldd_B73d_(more_status)
R       05c5ef   ff      b7
R       05c5f0   ff      3d   [40eb]
R       05c5f1   ff      30   tsx
R       05c5f2   ff      ed   std_0,x
R       05c5f3   ff      00
R       05c5f4   ff      f6   ldab_b73d [40eb]
R       05c5f5   ff      b7
R       05c5f6   ff      3d
R       05c5f7   ff      ca    orab_x08_(cord_wrap)
R       05c5f8   ff      08
R       05c5f9   ff      bd   jsr burnByte    [ 40eb: L04f1
R       05c5fa   ff      04   [   [ 40eb: L04f1
R       05c5fb   ff      f1   [   [ 40eb: L04f1
R       05c5fc   ff      38   pulx
R       05c5fd   ff      38   pulx
R       05c5fe   ff      39   rts  [at b-b5fe]
; end of 4504 basic patch
; 40b: major portion of 4504 PEC patch -removed- due to lack of space
;  in that area of the Autostar.  If you really need PEC, use the
; LXD patch (below) and choose the 100-tooth option.

;  4504patchTOO  32i:3-ecb5 33f: 4-9de9  22de9 33El: 4-9de6  34ec:4-9e74
;   cmpb 1 ; beq ecc9 -> jmp here (4-ffb8) ecb5 ffb8
R	4-9e84 	c1	7e		
R	4-9e85 	01	ff		to 4-ffb8 28fb8  34ec: 40b:ffb8
R	4-9e86 	27	b8		

; cmpb 1 ; bne +3; jmp ecc9 ; cmpb 3 ; beq +3; jmp ecb9	
R	28FB8	ff	c1		cmb 01
R	28FB9	ff	01		
R	28FBA	ff	26		bne +3
R	28FBB	ff	03		
R	28FBC	ff	7e	jmp (33f:9dfd  9-ecc5 ecc9 40b:9ea2
R	28FBD	ff	9E  	<patch return1	[40b:9ea2
R	28FBE	ff	a2  		[40b:9ea2
R	28FBF	ff	c1		cmb 03  ds70
R	28FC0	ff	03		
R	28FC1	ff	27		beq +3
R	28FC2	ff	03		
R	28FC3	ff	7e	jmp 
R	28FC4	ff	9E 		<patch return2  [ 40b: 9e88
R	28FC5	ff	88 		  [ 40b: 9e88
; ((loadtime)) jmp ece5 ;  time: 1402.407422 (44AF 4D0A)	
R	28FC6	ff	cc		ldd 44af
R	28FC7	ff	44		
R	28FC8	ff	af		
R	28FC9	ff	ed		std b2,x
R	28FCA	ff	b2		
R	28FCB	ff	cc		ldd 4d0a
R	28FCC	ff	4d		
R	28FCD	ff	0a		
R	28FCE	ff	7e	jmp 
R	28FCF	ff	9e 		<patch return3   [40b: 9ebe
R	28FD0	ff	be 		  [40b: 9ebe
; end of 4504/100 tooth PEC patch
;Total 2E29942 9AEE 4F9C


[PEC Editor Hook]
S=Checked
> Adds  Periodic Error Correction Editor Hooks.
>
> This patch allows for compatibility with Andrew Johansen's
> PEC editor available at:
> http://members.optusnet.com.au/johansea/
; start of Peek'n'Poke Patch
;  at line immediately after "cmpb "R": (33el:8-cfba 34ec:8-bef3
R 8-d1a4    26 7e   old: bne +3 ; jmp [40b:8-d1a4 
R 8-d1a5    03 b5   new: jmp {patch}  [33El,34ec,40b: 8-b5cc] 44xxx  
R 8-d1a6    7e cc                     [33El,34ec,40b: 8-b5cc]

; 40eb: b5cc-b5f5  044xxx
R	 445cC	ff	26	bne+3
R	 445cD	ff	3	
R	 445cE	ff	7e	jmp (:ER)  40b: d36e
R	 445cF	ff	d3     	  [<<return1   [ 40b: d36e
R	 445d0	ff	6e     	               [ 40b: d36e
R	 445d1	ff	c1	cmp "P"
R	 445d2	ff	50	
R	 445d3	ff	27	beq+3
R	 445d4	ff	3	

R	 445d5	ff	7e	jmp (:E??) [ Poke: b53d-b5
R	 445d6	ff	b5  	  [to POKE (below)
R	 445d7	ff	3d  	  [

R	 445d8	ff	30	tsx
R	 445d9	ff	ec	ldd 38,x  (buffer)
R	 445dA	ff	38	
R	 445dB	ff	c3	addd 3   (past the EP)
R	 445dC	ff	0	
R	 445dD	ff	3	
R	 445dE	ff	bd	dispatch  [32:0040
R	 445dF	ff	00	 [32:0040
R	 445e0	ff	40	 [32:0040
R	 445e1	ff	8	 ParseNumericFPString [40b: 8-cccd
R	 445e2	ff	cc  	 [ 40b: 8-cccd
R	 445e3	ff	cd  	 [ 40b: 8-cccd
R	 445e4	ff	bd	jsr  Flt->Int32    [40b:20a0
R	 445e5	ff	20	  [40b: 20a0
R	 445e6	ff	a0	  [40b: 20a0
R	 445e7	ff	30	tsx
R	 445e8	ff	ee	ldx 2,x
R	 445e9	ff	2	
R	 445eA	ff	ec	ldd 0,x
R	 445eB	ff	0	
R	 445eC	ff	30	tsx
R	 445eD	ff	bd	dispatch   Int16->rs232 [40b:8-84b9
R	 445eE	ff	00	 [32:0040
R	 445eF	ff	40	 [32:0040
R	 445f0	ff	8	[40b:8-84b9
R	 445f1	ff	84 	[40b:8-84b9
R	 445f2	ff	b9 	[40b:8-84b9
R	 445f3	ff	7e	jmp dc7d (end of :EQ code)  [32h:826f 8253
R	 445f4	ff	d3 	   [ 40b:8-d367
R	 445f5	ff	67 	   [ 40b:8-d367
;; end of 497 peek patch
;;  497 POKE patch
;  b53d  = 4453d-445cb available

R 4453d   ff  c1    cmpb  "N"
R 4453e   ff  4e   :N:
R 4453f   ff  27    beq +3
R 44540   ff  03
R 44541   ff  7e    jmp original code (patch return 2)
R 44542   ff  d1  be  cf		[40b:d1a9
R 44543   ff  a9  f8  bf

R 44544	ff	30	tsx
R 44545	ff	ec	ldd 38,x  (buffer)
R 44546	ff	38	
R 44547	ff	c3	addd 3   (past the EP)
R 44548	ff	0	
R 44549	ff	3	
R 4454a	ff	bd	dispatch  [32:0040
R 4454b	ff	00	 [32:0040
R 4454c	ff	40	 [32:0040
R 4454d	ff	8	 ParseNumericFPString [33El: 8-cae3 34ec: 8=ba1c 40b:8-cccd
R 4454e	ff	cc 	 [  40b:8-cccd
R 4454f	ff	cd 	 [  40b:8-cccd
R 44550	ff	bd	jsr  Flt->Int32    [ 40b: 20a0
R 44551	ff	20	  [ 40b: 20a0
R 44552	ff	a0	  [ 40b: 20a0
R 44553	ff	30	tsx
R 44554	ff	e6   ee	ldb 3,x (lowest byte of argument)
R 44555	ff	3	
R 44556	ff	ee	ldx 1,x  (next two msb's)
R 44557	ff	1	
;
R 44558  ff  8f   xgdx    swap d/x
R 44559  ff	 c3     addd  #B600   add the base address
R 4455a  ff   b6
R 4455b  ff   00
R 4455c  ff   8f    xgdx    swap d/x
;
R 4455d  ff      3c     pshx  (address to stack)
R 4455e	ff	30	tsx
R 4455f  ff   bd    jsr burnbyte=L04f1 (push addr, data->b)
R 44560  ff   04		[40b:04f1
R 44561  ff   f1
R 44562  ff  38   pulx  (pop stack)
R 44563  ff  7e    return to normal (c0b6 for #, cobb for silence)
R 44564  ff  d3  c0  d1   [34ec: c0bb   40b:8-d367
R 44565  ff  67  b6 bb  82   [34ec: c0bb

;  end of PEEK and POKE
;Total C09606 2A7D 140F


[LXD N-tooth PEC]
S=Unchecked
> LXD N-tooth Periodic Error Correction.
>
> Changes all LXD models to have customized PEC Training parameters
> based on an N-tooth gear (factory LXD gear is 144 teeth).
>
> When operating your telescope, select -any- LXD model,
> enter your Ratios directly into the Setup/Telescope/Ratio
> (both RA and DEC) fields from the keypad, and PEC should become operational.
>
> NOTE: Requires selection of one of the indented "N-tooth" settings.
; start of LXD substitute patches
;  replaces LXD PEC insertions  5-b1e2  2c1e2 33El:5-bcc2 34ec:5-bcbe
;  Time Interval is patched directly in-line   40b: free begins at b5f4, ffb9
;  PEC Factors are patched out-line (here) 5-b4ca 2c4ca 5-bcbe
R   5-c121  fd  bd   clrb, clra, std -> jmp b4ca  40b: 5-c121
R   5-c122  36  00
R   5-c123  e7  40
R   5-c124  fd  0b
R   5-c125  fd  ff
R   5-c126  fd  9A
R   5-c127  fd  01
R   5-c128  fd  01

;  values here are for LXD.  Optional patches cause changes  60xxx
R	60f9A	ff	cc	fac2.msw	ldd #0000     **dick**
R	60f9B	ff	00	fac2.msw	
;R	60f9C	ff	00	fac2.msw	
R	60f9D	ff	fd	std  (33f:36df
R	60f9E	ff	36		
R	60f9F	ff	df		
R	60fa0	ff	cc	fac2.lsw	ldd #2328
;R	60fa1	ff	23	fac2.lsw	
;R	60fa2	ff	28	fac2.lsw	
R	60fa3	ff	fd	std  (33f:36e1
R	60fa4	ff	36		
R	60fa5	ff	e1		
R	60fa6	ff	cc	fac3.msw	ldd #0000
R	60fa7	ff	00		
R	60fa8	ff	00		
R	60fa9	ff	fd	std  (33f:36e7
R	60faA	ff	36		
R	60faB	ff	e7		
R	60faC	ff	cc	fac3.lsw	ldd #003c
;R	60faD	ff	00	fac3.lsw	
;R	60faE	ff	3c	fac3.lsw	
R	60faF	ff	fd	std (33f:36e9
R	60fb0	ff	36		
R	60fb1	ff	e9		
R	60fb2	ff	cc	fac4.msw	ldd #0000
R	60fb3	ff	00		
R	60fb4	ff	00		
R	60fb5	ff	fd	std (33f:36e3
R	60fb6	ff	36		
R	60fb7	ff	e3		
R	60fb8	ff	cc	fac4.lsw	ldd #0001
;R	60fb9	ff	00	fac4.lsw	
;R	60fbA	ff	01	fac4.lsw	
R	60fbB	ff	fd	std (33f:36e5
R	60fbC	ff	36		
R	60fbD	ff	e5
R	60fbE	ff	39	rts 


;Total  6950CD   2488    1567


[----- 100 tooth]
S=Unchecked
> Selects 100 tooth gear for LXD PEC.
>
> NOTE: Requires selection of "LXD N-tooth PEC" patch.
;   100 tooth fac2: 64800. (fd20) fac3: 12960. (32a0) fac4: 5
;   100 tooth  time: 1402.407422 (44AF 4D0A)
R 22eb7  44  44	interval.msw  4-9e12  [40b:4-9eb6+1
R 22eb8  73  af
R 22ebc  79  4d	interval.lsw    [ 40b:9ebb+1
R 22ebd  38  0a
; fac2 5-b4d1
R	60f9C	ff  00  fac2.msw	
R	60fa1	ff  fd	fac2.lsw	
R	60fa2	ff  20	fac2.lsw	
; fac3 5-b4dd 
R	60faD	ff  32	fac3.lsw	
R	60faE	ff  a0	fac3.lsw	
; fac4 5-b4e9
R	60fb9	ff  00	fac4.lsw	
R	60fbA	ff  05	fac4.lsw	
; end of 100
;Total  1C1A45     861     33E


[----- 130 tooth]
S=Unchecked
> Selects 130 tooth gear for LXD PEC.
>
> NOTE: Requires selection of "LXD N-tooth PEC" patch.
;  130-tooth: fac2: 129600 (1fa40)  fac3: 864 (x0360)  fac4: 13 (x0d)
; 130 tooth interval:  1078.775 ( 4486 d8cd )
; 130 tooth ratio:  2.96593  ( 403D D1CC ) or(C03D D1CC)
R 22eb7  44  44	interval.msw  4-9e12  [33El: 4-9e0e 34ec:9e9c+1 40b:4-9eb6+1
R 22eb8  73  86
R 22ebc  79  d8	interval.lsw   [33El: 4-9e14  34ec:9ea2
R 22ebd  38  cd
; fac2 5-b4d1
R	60f9C	ff  01  fac2.msw
R	60fa1	ff  fa	fac2.lsw	
R	60fa2	ff  40	fac2.lsw	
; fac3 5-b4dd 
R	60faD	ff  03	fac3.lsw	
R	60faE	ff  60	fac3.lsw	
; fac4 5-b4e9
R	60fb9	ff  00	fac4.lsw	
R	60fbA	ff  13	fac4.lsw	
; end of 130
;Total  1C1A45     861     420


[----- 144 tooth]
S=Unchecked
> Selects 144 tooth gear for LXD PEC.
>
> This is the normal (default) setting for the LXD.
> NOTE: Requires selection of "LXD N-tooth PEC" patch.
R	60f9C	ff	00	fac2.msw	
R	60fa1	ff	23	fac2.lsw	
R	60fa2	ff	28	fac2.lsw	
R	60faD	ff	00	fac3.lsw	
R	60faE	ff	3c	fac3.lsw	
R	60fb9	ff	00	fac4.lsw	
R	60fbA	ff	01	fac4.lsw	
;Total  1361FD     6F9      88


[----- 180 tooth]
S=Unchecked
> Selects 180 tooth gear for LXD PEC.
>
> NOTE: Requires selection of "LXD N-tooth PEC" patch.
;  180 tooth fac2: 1c20  fac3: 30  fac4: 1  
;  180 tooth Interval: 779.1153 4442 c761
R 22eb7  44 44 	interval.msw  4-9e12  [33El: 4-9e0e  34ec:9e9c+1 40b:4-9eb6+1
R 22eb8  73 42
R 22ebc  79 c7 	interval.lsw   [33El: 4-9e14  34ec:9ea2
R 22ebd  38 61
; fac2 5-b4d1
R	60f9C	ff  00  fac2.msw	
R	60fa1	ff  1c	fac2.lsw	
R	60fa2	ff  20	fac2.lsw	
; fac3 5-b4dd 
R	60faD	ff  00	fac3.lsw	
R	60faE	ff  30	fac3.lsw	
; fac4 5-b4e9
R	60fb9	ff  00	fac4.lsw	
R	60fbA	ff  01	fac4.lsw	
; end of 180
;Total  1C1A45     861     21B


[----- 359 tooth]
S=Unchecked
> Selects 359 tooth gear for LXD PEC.
>
> NOTE: Requires selection of "LXD N-tooth PEC" patch.
; 359 tooth fac2: 13c680 fac3: 21c0 fac4: 167 
;   Interval: 390.6428  43c3 5246
R 22eb7  44  43	interval.msw  4-9e12  [33El: 4-9e0e  34ec:9e9c+1 40b:4-9eb6+1
R 22eb8  73  c3
R 22ebc  79  52	interval.lsw   [33El: 4-9e14  34ec:9ea2
R 22ebd  38  46
; fac2 5-b4d1
R	60f9C	ff  13	fac2.msw	
R	60fa1	ff  c6	fac2.lsw	
R	60fa2	ff  80	fac2.lsw	
; fac3 5-b4dd 
R	60faD	ff  21	fac3.lsw	
R	60faE	ff  c0	fac3.lsw	
; fac4 5-b4e9
R	60fb9	ff  01	fac4.lsw	
R	60fbA	ff  67	fac4.lsw	
; end of 359
;Total  1C1A45     861     440


[----- 360 tooth]
S=Unchecked
> Selects 360 tooth gear for LXD PEC.
>
> NOTE: Requires selection of "LXD N-tooth PEC" patch.
;  360 tooth fac2: 0e10  fac3: 18  fac4: 1  float: 43c2 c761
; 360 interval:  389.5576  43c2 c761
R 22eb7  44 43	interval.msw  4-9e12  [33El: 4-9e0e  34ec:9e9c+1 40b:4-9eb6+1
R 22eb8  73 c2
R 22ebc  79 c7	interval.lsw   [33El: 4-9e14  34ec:9ea2
R 22ebd  38 61
; fac2 5-b4d1
R	60f9C	ff  00  fac2.msw	
R	60fa1	ff  0e	fac2.lsw	
R	60fa2	ff  10	fac2.lsw	
; fac3 5-b4dd 
R	60faD	ff  00	fac3.lsw	
R	60faE	ff  18	fac3.lsw	
; fac4 5-b4e9
R	60fb9	ff  00	fac4.lsw	
R	60fbA	ff  01	fac4.lsw	
; end of 360
;Total  1C1A45     861     264
;
;;;; end of kit for 34Ec ;;;;;
;; remember/restore custom tracking rate for v34ec 
;; mini-patch (c) 9/3/2005 Richard Seymour
; save data at B6B0 (in Zip)
; trackrate: 3725 (34ec) 
; save at 4-bd26   (patch at 4-ff90)
;  restore at 5-f0de  (patch at 5-ffb0)
;
[Custom Tracking Rate]
S=Unchecked
> Restore Custom Tracking Rate at Power Up.
> Default operation of the Autostar is to reset the Tracking Rate to
>  Sidereal upon power-up.  This patch remembers a Custom Rate if you
> specified one during your session.  Note: it will restore that Custom
>  rate, even if you later clicked Sidereal in  the menu.  To reset
> the retained rate to zero, you must enter zero as a Custom Rate.
>
> Note: this stores the value in your "Owner Info Postal Code" area.
>  Do not attempt to use "Owner Info" if you install this patch
>  (it does not interfere with using Zip as your Site indentifier)
;
; saveTR:    std 3734->save trkrate patch (4-ffa0)
R 4-c1f3  fd   7e
R 4-c1f4  37   ff
R 4-c1f5  34   a0  (return to 4-c1f6)


; Reinstate Tracking Rate  ldab FF, stab 3A9D->save patch (ff90)
R 8-8458  c6  7e      40b:8-8458
R 8-8459  ff  ff
R 8-845a  f7  90   (return to 5-f0e3)
    
;------------
; save trkrate: ldd TrkRate(36b2), , burn(zip), restore d,return

R  4-ffa0  ff  fd    std 3723   40b: 3734  40b: at 4-ffa0
R  4-ffa1 ff   37 
R  4-ffa2 ff   34    
R  28fa3  ff  cc   ldd #destination  34ec:b6b0
R  28fa4   ff  b6   
R  28fa5   ff  b0
R  28fa6   ff  ed    std 0,x
R  28fa7   ff  00    std 0,x
R  28fa8   ff  fc   ldd TrkRat  10L:36c2  34ec: 3725 (34ec) 40b: 3736
R  28fa9   ff  37
R  28faa   ff  36
R  28fab   ff  bd    burnword  40b: 04dd
R  28fac   ff  04 
R  28fad   ff  dd     
R  28fae   ff   7e   jmp bd29  40b: c1f6
R  28faf   ff   c1
R  28fb0   ff   f6 
; end of save TR
;
; start of retrieve TR  (40b: 8-ff90)(28f90)
R 48f90  ff  fc   ldd  Zip+8  10L:3ead  34ec: b6b0
R 48f91  ff  b6
R 48f92  ff  b0
R 48f93  ff  1a   cmpb 20  (avoid +32)    1a 83 20 20  cpd 2020
R 48f94  ff  83
R 48f95  ff  20
R 48f96  ff  20
R 48f97  ff  27      beq noTR  (+3)
R 48f98  ff  03
R 48f99  ff  fd    std  3725  40b: 3736
R 48f9a  ff  37
R 48f9b  ff  36
R 48f9c   ff  c6  ldab ff
R 48f9d   ff  ff  
R 48f9e   ff  f7  stab  3a9d  40b: 3ab6
R 48f9f   ff  3a
R 48fa0   ff  b6
R 48fa1   ff  7e   jmp back to original  40b: 845d
R 48fa2   ff  84   
R 48fa3   ff  5d
;; end of restore Tracking Rate
;;;; end of revised 40b4 kit