@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@P!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `1  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D1:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D1:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu  } 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG*}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES+}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N',}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx -}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL/}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD0}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.1}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC2}COPY--FROM, TO?OPTION NOT ALLOWED736 FREE SECTORS COPYING---D1:DIRECK.COMl# 0|D .L/%#3}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY4}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E 5}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A6}LLOWED IN DESTINATION 0 <.|K}N 2 FORMAT. t* 5) 1L!`) 0NΞ 0 L1) 1 L!BAD LOAD FILELOAD FROM WHAT FILE?) 0 ?}0#B 1L!WHAT FILE TO LOCK?) 0 0$B 1L!WHAT FILE TO UNLOCK?DUP DISK-SOURCE,DEST DRIVES?TYPE "Y" IF OK TO US@}E PROGRAM AREACAUTION: A "Y" INVALIDATES MEM.SAV.FE! +L1   `*  70 2 2A} 0.* 1 y0 0)INSERT BOTH DISKS, TYPE RETURN^, 1 y038逍 N, 1L! ,B}C, t*  Lx+, 0 ^, 1 y0 , ,0,0 ,L+ ,I0 ,Vǭ0C}Ξ, 0 }, 1 y0C,ШC, 0K'!" H H 'h h Lx+!EF 5L1L!D,I,HhD}` NOT ENOUGH ROOMINSERT SOURCE DISK,TYPE RETURNINSERT DESTINATION DISK,TYPE RETURNE}`  `8 rL1`-* 1P* 1 y0Y`hhL!NAME OF FILE TO MOVE?- 0 0|DL% <.F},^ 1 70 0 .@L# .BJ 1  DEHIB V L1 ,} 1 70,L.  G}JB|,#P#DE 1 HI BDEHHII 1 B 1 ,^ 1 70,0La- B V,#PH},^ 1 70 0L#L!-* 1P* 1 y0Yj383}mm ݭI}}`8}``|* ? ɛ,`|:-)| / 1L!`DESTINATION CANT BE DOJ}S.SYS0 0H{ 24Δ 28/L!/) 2 Π 2 0 ξK}hAΞB,0 J 1 BDEHI,HÝDE 1HIHIDELSAVE-GIVE L}FILE,START,END(,INIT,RUN)O S0 1`BDEPHI V` S0H 1 L!M}0 0 1L~0`PLEASE TYPE 1 LETTER,0`hhL! 70 1L0L<1 ,;ɛ7,"ɛ:ݦ1ݥN}A"D|ݤD|ȩ:|ȩ|ɛ,,(/+.ީ1 1,ɛ`轤{NAMEO} TOO LONG B VL!` L1I H1EΝDL1|mDiE` V0`8d/8 i:222 1 LP}!ERROR- 138ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uFiles included (all are ARC'd):--------------------------------------XL2.ARC XL2.COM | All are described in XL2.CNF T} | XL2.TX1/2 XL2XE.COM | XL2XE.CNF | XFIX.COM | SAVECNF.COM | COPYSYS.COM | XL2CNF.LST | TSETUSR.LSTU} | TSETUSR.OBJ | XL2.TX1 | Unformatted text files XL2.TX2 | documenting XL2 and all | auxillariV}es XL2KEY.DOC List of key functions SETTD.DOC Summary of how to set td without SpartaDOS-------W}-------------------------------XL2SRC.ARC Source for XL2 and all auxillaries--------------------------X}------------RD.ARC RD.COM New SpartaDOS RAMdisk RDNUMBER.COM Utility to renumber it RD.TXT DocumentatioY}n for both--------------------------------------RDSRC.ARC Complete source for RD and RDNUMBER-------Z}-------------------------------MYDOS451.ARC READ.ME The authors' intro to MYDOS 4.51 CHANGES [} A file by the authors describing changes from version 4.50. Note documentat\}ion for 4.50 is required. MYDOS.TXT A text file explaining the mods, options and ]} their usage MYDOS451.DSK | Use DiskComm on these XEDOS451.DSK | to produce bootable XLDOS451.DSK | copies of D^}os/Dup MODS.TXT A short text file for m/l programmers BUILD.OBJ | The m/l programs to MDOS.OBJ _} | create DOS and DUP MDUP0.OBJ | MDUP1.OBJ | MDUP2.OBJ |--------------------------------------MYDOSSRC.ARC `} DOS source files--------------------------------------MYDUPSRC.ARC DUP source files and source fora} all mods--------------------------------------MISC.ARC RAMFIX.COM | Documented below CART.COM | MISC.TX1 b}| Text files on RAM/ROM MISC.TX2 | control and docs for | CART and RAMFIX RAMFIX.SRC | Source codec} CART.SRC | ABAT.COM | Documented below WARM.COM | TURBOFIX.LST | TB800FIX.LST | MISC.TX3 Docsd} for the above--------------------------------------Notes: Source is not provided for ABATas it is a mod to AUTOBAT whiche} iscopyright Fine Tooned Engineering.Source for the Turbo patches wasreleased in PSAN several years ago.MAC/65 users wif}ll have to ENTER ...,Athe source files for use. They areincluded this way to allow examinationwith TextPro and use with otg}herassemblers. ...,Athe source files for use. They areincluded this way to allow examinationwith TextPro and use with otThis disk contains program and text files created or modified by John Picken of the Garden City Atari Computer Enthusiasts, V i}ictoria, B.C. Canada. If you have questions or comments regarding these programs, John can be reached at the following addres j}s.John Picken2214 Belmont AvenueVictoria, British ColumbiaCANADA V8R 3Z8ms, John can be reached at the following addres N04` 2 4(4A/ 21 20'ܝD4E 2043b4V 2 V3*R3xR3#Rl}3c33RӅSӠTWUW =33͝R#RxR *RRکӠՌxWyW*m}%TW;ɽ Ƶ0#Z1 3 2 23 23 20i3m13n} E3`䝪3$3\W `WZWXWӅ TW:ө 3 3 3 3L5 3^W_Wo}bWcWT 3JWNWKWOWR 3LWPWMWQW` 3dWhWlWpW= 3eWiWmWqWk 3fWjWnWrWt 3gWkWoWsW33 3RWSWp}VWWW 2R 2D3 TW 3 3 2 2Ӡ2 \@X` =3Ӻ3ӍvWwWzW{W R"/3 23LQ pB Vq}`ӽ3233234`e e ` #WN4 >Ƚ4  x` ,E,,,DHԭHύr} RhhXLb`HHԍXhh/8$ӢΎLPӰLLpp0B3s} ,Ll.Nn쎮@@P@@P@X@@@@@(@TD OFFKEY OFF 34g <4 D:XL2.CNF}  t}  (c) Sep '93  John Picken   u}PuWHRV01̢P͡P.>=i3>iș3=AP0=ȭP1='W- Ҽ)W0]8didH Th TU TT Tw}P,0'%Wp+) Th8L3I R /kP/x/ԎԝtWhvWIPՙxWzWxQQ@{Q~Qx}=@@xQQ{Q~Q=8RRLPxWվzWkP dWȝSPQdWȝRdWȝPP5SASdWȝTy} )T Si T/HtWHvW@ Ԉ/L3آXʩ0¢@Ӎ$.'*ؾXX$.'*$0ōZbez}nӹ@ƎӾ@@ә@Zbenة΍LQLw SWA WR%WH i WJW"RWWW{}hHP(P%W mP\W`W `p V `V `P2#W*380=ȹ31>=A==ȥ>=` |}b I@v)* -S()?' / T//M+8`V S}}V SV SP` T "T T T T Teee` "T&&`ʊaP8}VVVK V)iaPV8ݮVmVV%~}V ) dVVVP#WV TV TV TV TVV TV TV TV8 i H ThHJJJJ }Th) ii3`+W` VHVHP` T P'WLT T LT V'?I?0U V? V?0U}I]`8SU^^0 qVS2ȱ?)]IP] V]P VSU+,v` qVS?S۱? qV U U U}R? hhSU)M`0JJJJ`nIn`AIA`I`)WI)W`AWR W i WW}W` V`U8_V@` sVSȈU?`?H)?!;hI@`h`UUUUUUUUVVVVVVUUUUUUVrŬ6$-3G`_<<< }     ^ ' 33}3333DD33yy33333333330 33-^ ' 33g04` 2 4(4A/ 21 20'ܝD4E 2043b4V 2 V3*R3xR3#R}3c33RӅSӠTWUW =33͝R#RxR *RRکӠՌxWyW*}%TW;ɽ Ƶ0#Z1 3 2 23 23 20i3m13} E3`䝪3$3\W `WZWXWӅ TW:ө 3 3 3 3L5 3^W_W}bWcWT 3JWNWKWOWR 3LWPWMWQW` 3dWhWlWpW= 3eWiWmWqWk 3fWjWnWrWt 3gWkWoWsW33 3RWSW}VWWW 2R 2D3 TW 3 3 2 2Ӡ2 \@X` =3Ӻ3ӍvWwWzW{W R"/3 23LQ pB V}`ӽ3233234`e e ` #WN4 >Ƚ4  x` ,E,,,DHԭHύ} RhhXLb`HHԍXhh/8$ӢΎLPӰLLpp0B3} ,Ll.Nn쎮@@P@@P@X@@@@@(@TD OFFKEY OFF 34g <4 D:XL2.CNF}  }  (c) Sep '93  John Picken   }PuWHRV01̢P͡P.>=i3>iș3=AP0=ȭP1='W- Ҽ)W0]8didH Th TU TT T}P,0'%Wp+) Th8L3I R /kP/x/ԎԝtWhvWIPՙxWzWxQQ@{Q~Q}=@@xQQ{Q~Q=8RRLPxWվzWkP dWȝSPQdWȝRdWȝPP5SASdWȝT} )T Si T/HtWHvW@ Ԉ/L3آXʩ0¢@Ӎ$.'*ؾXX$.'*$0ōZbe}nӹ@ƎӾ@@ә@Zbenة΍LQLw SWA WR%WH i WJW"RWWW}hHP(P%W mP\W`W `p V `V `P2#W*380=ȹ31>=A==ȥ>=` }b I@v)* -S()?' / T//M+8`V S}V SV SP` T "T T T T Teee` "T&&`ʊaP8}VVVK V)iaPV8ݮVmVV%}V ) dVVVP#WV TV TV TV TVV TV TV TV8 i H ThHJJJJ }Th) ii3`+W` VHVHP` T P'WLT T LT V'?I?0U V? V?0U}I]`8SU^^0 qVS2ȱ?)]IP] V]P VSU+,v` qVS?S۱? qV U U U}R? hhSU)M`0JJJJ`nIn`AIA`I`)WI)W`AWR W i WW}W` V`U8_V@` sVSȈU?`?H)?!;hI@`h`UUUUUUUUVVVVVVUUUUUUVrŬ6$-3G`_<<< }     ^ ' 33}3333DD33yy33333333330 33-^ ' 33g03`Ӆ2̝RL2c3Ȍ)3#RxR*R b2 22BȌ/ i2& d20D3E d20 }b3V b2S Ӡ 2ӠՄ*%;ɽ Ƶ0#ٗ0 } ȌӠ 3_o3#r30i|3m1}3P\W `W XW ZWxWtWӥTW .2 } .2 .2i .2P5e ^We bW HT B2R B2i B2h ` O2= O2k O2t O2 3  m2 m2Ӡ2 \ }@X*өaPӢ V"/` 2ӤӬPvWzW RLQL =2e =2e `e J2e JW`e dWy3e hWz3` pB V }` #WN2 >Ƚ2  x` ,Ll.Nn쎮 2g 2 TD OFFKEY OFFD:XL2.CNFXL2 re-installed }亠 XL2 handler not found! ,E,,,DHԭHύ RhhXLb`HHԍXhh/8$ӢΎ }LPӰLLpp0B~3BK 2$ 0`HHԍXhh/8$ӢΎ U0J1`0xԭӍ01͝R 0(1ALVӢ 0#R 0xR 0*R 0P 7VbVO1 0 0D0E$ $}0 11BA1 00KD1E 00 ;1D 0 pBLVөX`K1K1` Disk errorD:XL2.CNFCre$}ated XL2 monitor not found ,Ll.Nn쎮 0! 0 00g0 Disk errorD:XL2.CNFCre$]02`xԌ/ԭӅ1̝RөX V`#RⅲxRم*RЅөʍD1EH 00(}խPIxWtW#W#W%W%W'W'W)W)WTWTWXWXWZWZW\W\W`W`W^W^WbWbW 7V HIRWRWSWSWJWJWȘ)(}h IdWdWȘ) 1 1aP 1 1 1 1ӦՠC1@ԩ \X`xԭӤӤvWkPHzW"/JW"KW#(} 1hӢ Lbӽ1111111`؀@@@X@@@(@@@@@System duplicated亠 XL2 ha(}ndler not found! ,Ll.Nn쎮BI 1#0111`؀@@@X@@@(@@@@@System duplicated亠 XL2 ha(3100 REM ̲Ơ102 REM 104 REM Filespec must include device106 REM and may include a path108 REM 110 REM If,} you change the extender to112 REM .COM, the program will read114 REM in and modify the com file116 REM itself so you won',}t need a118 REM cnf. (USE A BACKUP COPY)120 REM 122 DATA D1:XL2.CNF124 REM 126 REM The 1st data line128 REM,} is used. REM out all those130 REM preceeding the banks desired132 REM 134 REM Values are with Basic off136 REM and OS on,}138 REM 140 REM Standard 130xe banks $E3-$EF142 DATA 227,231,235,239144 REM 146 DATA 195,199,203,207, $C3-$CF148 DAT,}A 163,167,171,175, $A3-$AF150 DATA 131,135,139,143, $83-$8F152 REM 154 REM 2nd 256k block156 DATA 225,229,233,237, ,} $E1-$ED158 DATA 193,197,201,205, $C1-$CD160 DATA 161,165,169,173, $A1-$AD162 DATA 129,133,137,141, $81-$8D164,} REM 166 REM 3rd 256k block168 DATA 99,103,107,111, $63-$6F170 DATA 67,71,75,79, $43-$4F172 DATA 35,39,43,47, ,} $23-$2F174 DATA 3,7,11,15, $03-$0F176 REM 178 REM 4th 256k block180 DATA 97,101,105,109, $61-$6D182 ,}DATA 65,69,73,77, $41-$4D184 DATA 33,37,41,45, $21-$2D186 DATA 1,5,9,13, $01-$0D188 REM ----------,}-------------190 REM is file position count-192 REM ing from 1 (inc. bank table)194 REM 196 REM day,month,year19,}8 DATA 16,5,94200 REM 202 REM hour,minutes,seconds204 DATA 13,39,0206 REM 208 REM Enter months in normal ASCII.210 ,}REM The program will convert to212 REM them to inverse screen code.214 REM 216 REM 218 DATA J,F,M,A,M,J,J,A,S,O,N,D22,}0 DATA a,e,a,p,a,u,u,u,e,c,o,e222 DATA n,b,r,r,y,n,l,g,p,t,v,c224 REM 226 REM . example for French228 REM 230 REM DATA j,},f,m,a,m,j,j,a,s,o,n,d232 REM DATA a,e,a,v,a,u,u,o,e,c,o,e234 REM DATA n,v,r,r,i,n,l,u,p,t,v,c236 REM 238 REM -----------,}---------------240 REM 242 REM System defaults for A,B244 REM 246 REM Disk noise 1=on 0=off248 DATA 1,1250 REM 252,} REM Left margin254 DATA 2,2256 REM 258 REM Tabs, line 1, system A260 DATA 1,1,1,1262 REM Tabs, line 1, syst,}em B264 DATA 1,1,1,1266 REM 268 REM Color 1-4 system A270 DATA 12,0,0,0272 REM Color 1-4 system B274 DATA 12,0,,}0,0276 REM 278 REM Krpdel,Keyrep,Noclik A280 DATA 24,3,1282 REM Helpfg always 0284 DATA 0286 REM Krpdel,Key,}rep,Noclik B288 DATA 24,3,1290 REM Helpfg always 0292 DATA 0294 REM 296 REM Td line 0=off 1=on298 DATA 1,1300 ,}REM 302 REM Key handler 1=on 0=off304 DATA 1,1306 REM 308 REM Drive to display310 DATA 1,1312 REM 314 REM ,}Disp. code 0=scr 255=kbd316 DATA 255,255318 REM 320 REM 322 REM 324 REM ,}326 REM 328 REM Keys 0-9 are reserved for330 REM drive display selection332 REM 334 REM Repeatable Keys3,}36 REM 338 REM Increment screen color340 DATA 206342 REM Decrement screen color344 DATA 207346 REM Increment,} text luminance348 DATA 237350 REM Move to quotation mark352 DATA 239354 REM Move to word left356 DATA 224358 R,}EM Move to word right360 DATA 226362 REM Toggle character case364 DATA 252366 REM Invert character368 DATA 2,}31370 REM 372 REM Non-repeatable Keys374 REM 376 REM Save defaults378 DATA 236380 REM Toggle key click382 DATA,} 227384 REM Toggle disk noise386 DATA 250388 REM Toggle fast key390 DATA 248392 REM Toggle fine scroll394 D,}ATA 254396 REM Toggle screen/kbd code398 DATA 200400 REM Clear screen402 DATA 220404 REM Move to left margin,}406 DATA 246408 REM Move to right eot410 DATA 247412 REM Invert to end of text414 DATA 205416 REM Toggle li,}ne case418 DATA 225420 REM Delete all right422 DATA 244424 REM Set clock426 DATA 203428 REM -------------------,}----430 REM 432 REM Program start point434 REM 436 REM -----------------------1000 CLOSE #11002 DIM FILE$(64),CNF$(103),},L$(10)1004 DIM EXT$(4),PRG$(4000)1006 PRG$(4000)="."1008 GOSUB 1252:REM Setup usr code1010 BG=ADR(CIO$):REM Bget entry1,}012 BP=BG+2:REM Bput entry1014 TRAP 11281016 RESTORE 1018 READ FILE$1020 TRAP 11981022 EXT$=FILE$(LEN(FILE$)-3)1024 IF ,}EXT$=".CNF" THEN 10501026 IF EXT$<>".COM" THEN 11981028 TRAP 11281030 OPEN #1,4,0,FILE$1032 REM bget #1,addr,len1034 Y=U,}SR(BG,1,ADR(PRG$),4000)1036 CLOSE #11038 PRG$=PRG$(1,Y)1040 IF Y=3170 THEN 10501042 PRINT "File length error!"1044 PRINT,} FILE$;" corrupted"1046 GOTO 11221048 REM -------------1050 A=1:B=4:REM Get bank table1052 GOSUB 11561054 REM 1056 REST,}ORE 198:REM Point to date1058 A=5:B=10:REM Get date/time1060 GOSUB 11561062 REM 1064 REM Get month names and convert1066,} REM to inverse screen code1068 REM 1070 FOR X=11 TO 461072 READ L$1074 Z=PEEK(183)+PEEK(184)*2561076 IF LEN(L$)>1,} THEN 11821078 Y=ASC(L$)1080 IF Y>127 THEN Y=Y-1281082 IF Y>95 THEN 10881084 IF Y<32 THEN Y=Y+64:GOTO 10881086 ,} Y=Y-321088 Y=Y+1281090 CNF$(X)=CHR$(Y)1092 NEXT X1094 REM 1096 A=47:B=103:REM The rest1098 GOSUB 11561100 REM 11,}02 TRAP 11061104 XIO 36,#1,0,0,FILE$:REM unlock1106 TRAP 11281108 OPEN #1,8,0,FILE$1110 IF EXT$=".CNF" THEN PRG$=CNF$:GOT,}O 11181112 PRG$(999,1002)=CNF$(1,4)1114 PRG$(3012,3110)=CNF$(5)1116 REM bput len bytes from adr1118 Y=USR(BP,1,ADR(PRG$),,}LEN(PRG$))1120 IF Y<>1 THEN 11301122 TRAP 400001124 END 1126 REM ------------------------1128 Y=PEEK(195)1130 IF Y=6 TH,}EN PRINT ""1132 IF Y>127 THEN PRINT " ";Y1134 IF Y<128 AND Y<>6 THEN PRINT ",} ";Z:LIST Z1136 GOTO 11221138 REM --------------------------1140 REM Subr to read and verify data1142 REM items are inte,}ger bytes. It1144 REM catches typos where period1146 REM is pressed instead of comma1148 REM between items. 183/184 is115,}0 REM where Basic stores line no.1152 REM for the last item read.1154 REM 1156 FOR X=A TO B1158 READ L$1160 Z=PEEK(1,}83)+PEEK(184)*2561162 Y=VAL(L$)1164 IF Y<>INT(Y) THEN 11821166 L=LEN(L$)1168 IF Y<10 AND L>1 THEN 11821170 IF ,}Y<100 AND L>2 THEN 11821172 IF L>3 THEN 11821174 CNF$(X)=CHR$(Y)1176 NEXT X1178 RETURN 1180 REM 1182 PRINT " ,} ";Z1184 PRINT 1186 PRINT L$1188 PRINT 1190 LIST Z1192 STOP 1194 RUN 1196 REM ===========================,}1198 PRINT "Invalid filespec"1200 PRINT FILE$1202 END 1204 REM ===========================1206 REM 1208 REM . Cio Bget/B,}put Routine1210 REM 1212 REM Combines bget/bput in one.1214 REM More convenient than Turbo1216 REM because it reports act,}ual1218 REM length when error 136 occurs1220 REM 1222 REM User must have opened iocb1224 REM 1226 REM bget len bytes to ,}buffer adr1228 REM y=usr(cio,iocb,adr,len)1230 REM 1232 REM bput len bytes from addr1234 REM y=usr(cio+2,iocb,adr,len)12,}36 REM 1238 REM reports: on successful bget1240 REM y is bytes transferred; on1242 REM failed bget or any bput y is1244 R,}EM actual cio status.1246 REM 1248 REM routine does not close iocb1250 REM 1252 DIM CIO$(65)1254 RESTORE 12781256 TRAP ,}12721258 FOR X=1 TO 651260 READ Y1262 CIO$(X)=CHR$(Y)1264 NEXT X1266 TRAP 400001268 RETURN 1270 REM 1272 PRINT "D,}ata error in usr routine"1274 END 1276 REM 1278 DATA 24,36,56,104,104,1331280 DATA 213,104,8,10,10,101282 DATA 10,170,40,},104,157,691284 DATA 3,104,157,68,3,1041286 DATA 157,73,3,104,157,721288 DATA 3,8,169,7,144,21290 DATA 169,11,157,66,3,32,}1292 DATA 86,228,40,176,15,1521294 DATA 16,4,192,136,208,81296 DATA 188,72,3,189,73,31298 DATA 133,213,132,212,9666,3,32,v10 REM Sample program to adjust time11 REM to 4:08:30pm assuming current12 REM date is correct13 REM 14 CLOSE #115 TRAP 0}6316 REM 17 REM The following is a Bload18 REM with Sparta or Mydos. If19 REM you use Dosxl, you'll have20 REM Load the 0}Usr file from Dos21 REM before entering Basic and22 REM delete lines 14-26.23 REM 24 XIO 40,#1,4,0,"D1:TSETUSR.OBJ"25 TR0}AP 4000026 REM 27 REM dt$ holds date/time in order:28 REM day,month,year,hour,mins,secs29 REM 30 DIM DT$(6)31 DT$="DMYh0}ms":REM establish length32 REM 33 REM DAY=day of month (1-31)34 REM MON=month of year (1-12)35 REM YEAR=current year (0-90}9)36 REM 37 HOUR=16:REM current hour (0-23)38 MINS=8:REM " minutes (0-59)39 SECS=30:REM ." seconds (0-59)40 REM 41 REM 0}read current setting42 REM 43 X=USR(1536,ADR(DT$),0)44 IF X=0 THEN 5445 REM 46 REM Get error, display, quit47 REM 48 I0}F X>255 THEN PRINT "Handler not found"49 IF X<256 THEN PRINT "USR parameters<>2"50 GOTO 5951 REM 52 REM set new time into0} string53 REM 54 DT$(4)=CHR$(HOUR)55 DT$(5)=CHR$(MINS)56 DT$(6)=CHR$(SECS)57 X=USR(1536,ADR(DT$),1)58 IF X>0 THEN 48:RE0}M Oops59 END 60 REM 61 REM Not required with Dosxl62 REM 63 PRINT "Disk Error #";PEEK(195)(DT$),1)58 IF X>0 THEN 48:RE0`hՈ`hhhhhh媠xԭH͝R07#R0xR)*R"ԅՠV S V4}hӠX` ,Ll.Nn쎮xԭH͝R07#R0xR)*R"ԅՠV S V4(New Utilities For Your XL/XE(Part 2)by John PickenXL2.COM (SpartaDOS/MYDOS/DOSXL)XL2 (turns a 130XE into two XL's) is s8}imilar in concept to Tom Hunt's SnapShot but there, most similarity ends. With XL2 installed you have two virtual computers i8}n memory and can switch between them at will. XL2 is designed for use with a limited number of disk-based FMS--it is not desi8}gned for use with boot disks. The present version may work with SpartaDOS-X but will not support SDX on in only one system. I8}t may work with the R Time-8 but will not use the RT8 clock.WHAT YOU GAIN- two complete and fully independant computer sy8}stems which may be swapped in about two seconds,- additional keyboard editing functions,- keyboard control of some system9} characteristics,- the ability to make some of your defaults "Reset-proof",- a calendar/clock with a display line which w9}orks with all three supported FMS,- with SpartaDOS, a saving of 586 bytes at low memory using XL2 in place of TDLINE, and9}- display of disk drive information or alternatively, programming information.WHAT YOU LOSE156 bytes of low memory are ta9}ken for entry and exit points and the TD line. This means that a two-part FMS must reserve space under DUP for resident handl9}ers. In other words, to use XL2, you must use MYDOS or else a command line FMS; you lose the option of selecting any other.9}Four banks of extended memory are needed to store the alternate system--all you've got with a 130XE. With larger upgrades, yo9}u must reserve the XL2 memory when setting up your RD.XL2 makes frequent, temporary use of four bytes on page zero required9} (also temporarily) by the OS only for cassette operations. All other functions occur in an area of extended memory that is e9}ssentially free and invisible.With SpartaDOS, the keyboard buffer is permanently disabled. Also, XL2 does not provide a for9 }matted time/date return, but does respond correctly to TIME, DATE, and TD commands, and does provide correct t/d information 9 }to DOS for file creation.1200XL function keys will not work when the XL2 key handler is enabled. Since the OS code for thes9 }e doesn't accomplish much, but does play with PORTB to set LED's, this is probably a gain rather than a loss.INSTALLING XL29 }XL2 may be installed anytime after boot. Presence or absence of BASIC or an OSS cartridge is unimportant; it works in any c9 }onfiguration. There are no parameters to pass or keys to press, just run (load) it. I do not recommend its use as an autorun 9}or in a startup batch for reasons that will become apparent.Once installed, you have two identical computer systems in memo9}ry and are free to run different applications in each. Either may be re-booted to a different XL2-compatible DOS.SWAPPING S9}YSTEMSPress Control-Help to switch systems. A swap will execute any time the screen is on and interrupts are enabled. For e9}xample, pressing Control-Help while in DDT (MAC/65 cartridge) appears to do nothing but, the instant you exit DDT and normal 9}interrupts are restored, the swap occurs.XL2 is compatible with Turbo BASIC, BASIC XE, MAC/65, Action! and TextPro+ and it 9}can operate with a cartridge enabled in one system while disabled in the other.KEYBOARD FEATURESXL2 provides additional s9}creen editing functions and allows modification of some OS defaults. When the new key handler is enabled, the normal clear sc9}reen keys no longer do. You clear the screen using [Shift][Control][Esc] (designed to eliminate the frustration of staring at9} a blank screen when I hit the wrong key when attempting to insert).XL2 KEYBOARD FUNCTIONSKeys With [Select] 9}[Reset] Cold start[Shift][Control][U] Set clockKeys With [Control] [Help] Swap systems [Clear] w Turn TD line offKe9}ys With [Shift] [Help] Toggle key handler on/off [Clear] w Turn TD line onKeys With [Shift][Control] (system)[Return]9} Turn off screen [-] r Increase screen color [=] r Decrease screen color [T] r Increase text luminance 9}[D] Toggle disk noise [F] Toggle fast key [N] Toggle key click [S] Toggle fine scroll [1]-[9] Selec9}t drive to display [0] Select x-y (cursor) display [O] Toggle code display [Tab] Save defaults for reset9}Keys With [Shift][Control] (editing) [Esc] Clear screen [Atari] r Invert character [I] Invert to end of text [9}Caps] r Toggle character case [Space] Toggle line case [Del] Delete all right [<] Move to left margin [>]9} Move to end of text [,] r Move to word left "[" [.] r Move to word right "]" [Q] r Advance to " or inverse 9}" Keys marked "w" wait for release Keys marked "r" repeat if heldSystem functions are mostly self-explanatory. The9 } [Return] function turns off the screen until any key is pressed. Keys referring to "display" will make sense when you read t9!}he following section. Defaults saved for Reset are screen colors, the first four bytes in the tab map, left margin, keyboard 9"}speed and click, and disk noise on or off.Editing functions work on the current screen line only. Rather than describe them9#}, I suggest you try them out using the guide above. Combined with the display features they can be a real convenience for pro9$}gramming.Note: The MIO board uses the Select-Reset combination so MIO users will not be able to cold start in that way.TI9%}ME/DATE SUPPORTXL2 maintains a fairly accurate software clock which works independant of the currently selected system. Thi9&}s means you can switch from a Sparta to a MYDOS system, work there for as long as you like, and return to Sparta without havi9'}ng to reset the time. This is the principal reason the clock was incorporated; I like time/date stamped files and I hate rese9(}tting the time.Following system swap, the Atari real-time clock is set from the XL2 clock (for Turbo). To demonstrate my be9)}lief in the durability of the Atari-8, I designed it to handle date changes correctly until 1 March 2100 when no leap year oc9*}curs and I don't plan to be around to answer complaints.To improve accuracy, the clock corrects itself at the end of every 9+}hour when you will notice a jump of four or five seconds. Serial and RAMdisk i/o can cause the clock to lose time, so you may9,} have to reset it periodically, depending on how much i/o you do. Also programs such as DDT and BobTerm take over the immedia9-}te Vblank so XL2 and the clock are disabled until you exit and have to reset the time.Setting time and date is easy with Sp9.}arta--use the TIME and DATE commands. With other FMS it's a little more complex. It can be done with machine language (not ye9/}t written) or using the XL2 key handler as follows:POKE 960,DAY (1 to 31)POKE 961,MONTH (1 to 12)POKE 962,YEAR (0 t90}o 99)POKE 963,HOUR (0 to 23)POKE 964,MINUTE (0 to 59)POKE 965,SECOND (0 to 59)Then hold [Select] and press [Shift][Con91}trol][U] to set the new value into the clock. All six values must be POKEd and there is no error checking which is why the ke92}y combination is intentionally awkward. Note also that you must set the values into the clock before any printer operation is93} carried out.DISPLAY LINE INFORMATIONThe time/date display also monitors disk read/write for any drive from 1 to 9 or, cu94}rsor position and either of keyboard or screen code. Here are three sample readouts: 2 W 0168 8B XL2-A 21:46:19 12 Jun 9395}The above line shows you in system "A" at 9:46:19 p.m. The last operation on D2: was a write with verify to sector $168 whi96}ch failed (error $8B--there went the %*#@ VTOC). Only read and write commands are displayed and the actual SIO command is sho97}wn so you know what DOS is doing. 242 x10 y22 XL2-B 07:30:22 13 Jun 93Now you're in system "B" on the following morning98} and you've selected x-y display using Shift-Control-0 (zero). The keyboard code for the last key pressed (Shift-Control-0) i99}s 242 and the cursor is at POSITION 10,22. Unlike the drive display, all values here are decimal. 220 x02 y00 XL2-B 07:349:}:59 13 Jun 93About five minutes later you're still in system "B" having just cleared the screen using the new key handler (9;}key code 220) and the cursor is at POSITION 2,0. If you press Shift-Control-O (that's "Oh" for "Other" not "zero"), the code 9<}changes to 000 indicating that the cursor is on a space (screen code 0). Until you toggle back to key code or select a drive 9=}display, you get a continuous report of screen code for the character under the cursor.The TD line is controlled by Sparta'9>}s TD command and/or the Clear Screen keys.RESETXL2 is "Reset-proof" with one exception: Reset during a system swap will g9?}uarantee a lock-up. On Reset, XL2 protects itself, restores defaults and sets the Atari clock as it would for a system swap. 9@}This means the clock used by Turbo BASIC for time functions is now "Reset-proof".Also, the key handler and TD line are rest9A}ored to the last selected status. Under Sparta, KEY and TD commands have priority in determining status; i.e. if you execute 9B}a TD OFF and then turn it back on using Shift-Clear, Reset will turn the line off again.rmining status; i.e. if you execute 8YXL2CNF.LSTWhen run XL2 looks for D:XL2.CNF. If not found it uses defaults. The CNF determines memory bank usage. The progra=D}m released as XL2XE.COM uses the 130XE banks while XL2.COM uses the second 64k, leaving the XE banks free for TextPro+, the W=E}edge, etc. The two CNF files are similarly set up, so if you want to use the 130XE banks, you must erase XL2.CNF and rename X=F}L2XE.CNF to XL2.CNF.The CNF also holds system defaults, keycodes, and the text for the month display (make it French or wha=G}tever you want). You can create a CNF file or modify XL2 itself using this BASIC program. I didn't waste a lot of time here; =H}LIST, read the REM's, make your changes and RUN.BASIC programmers may wish to borrow the CIO USR routine out of this progra=I}m as it works with Atari or Turbo and is more flexible than Turbo's BGET and BPUT routines. It is documented in the programmi=J}ng listing.AUXILLARY PROGRAMSThe following programs are for use with XL2. None require any syntax or input and none need =K}be modified for RAM assignment. When run they look for the banks in use and all abort harmlessly if an incorrect sequence is =L}detected.SAVECNF.COMThis is just a fast way to create D:XL2.CNF. You can't change the filename and you can't change text =M}and keycodes. But you do save currently selected colors, etc. as well as time and date. So if you're about to re-boot and use=N} this just beforehand, your time and date will be accurate to within about 30" or so once the boot is complete.XFIX.COMXF=O}IX is used to reenable XL2 after a re-boot and will restore defaults from the CNF file if found (but it ignores the RAM bank=P} table). It assumes you're smart enough not to run it twice without a re-boot.An example of its use is as follows: You boot=Q} Sparta, set up your system, and then run XL2. Following this you re-boot to MYDOS and load XFIX. Assuming the time was set i=R}n the Sparta system or, if the CNF is present and was updated just before boot, the time and date will remain correct.You t=S}hen enter Turbo and find that the XL2 key functions are available and at any time, a press of Control-Help takes you back to =T}the Sparta system where you might be working in TP or a cartridge.XFIX is the program to use in a startup batch or as an au=U}torun. If you were to use XL2 itself, it would overwrite the alternate system and defeat the whole purpose. The program execu=V}tes as soon as loaded and may, therefore, be part of a compound autorun file.COPYSYS.COMCOPYSYS duplicates the current sy=W}stem into the alternate. In the XFIX example, if you've finished with MYDOS and want Sparta in both, COPYSYS will handle the =X}job in about two seconds--considerably faster than a re-boot.USING XL2All XL2 features operate during interrupts which me=Y}ans they steal time from the computer. To get the fastest processing time in a program, turn off anything you're not using, e=Z}specially the TD line. Also, you usually have to disable the key handler and/or TD line when running applications with custom=[} key handlers or display lists (Sparta users are familiar with this).The best setup sequence is to install the RD and any o=\}ther features you want in both systems before XL2; otherwise you'll have to repeat the installations after the first swap. Th=]}is will not work with any (fairly rare) program which uses the immediate vertical blank vector; these must be installed after=^} XL2 and may knock it out depending on how they're coded.Potential uses are up to you. I often find it convenient to have T=_}extPRO in both systems and work on two different files at once. I can refer back and forth without losing cursor position in =`}either and use the RD to pass files between the two. Another favorite is Sparta in one system and MYDOS/Turbo in the other.=a}GLITCHES AND RESTRICTIONSSIO disables other interrupts so usage of cassette zero page locations should cause no conflict if=b} you actually do tape i/o. If however, you're using a custom OS (RAM or chip), XL2's use of the area may cause a problem sinc=c}e most programmers assume you won't be using tape. If you have a problem with this, you'll have to get in touch with me for t=d}he source code or a modification. There are other free bytes on page zero dependant on the operating system you're using.Th=e}e disk information portion of the TD line is updated during the immediate vertical blank so it could conceivably contribute t=f}o "time out" problems with a slow drive. The solution is to switch to x-y display or, better still, turn off the TD line.XL=g}2 has been extensively tested and very few problems have been encountered. Those associated with (what I consider to be) impo=q}B%DOS SYSB*)DUP SYSBSFILES DOCBhREADME BkXL2 COMBXL2 CNFBXL2XE COMBXL2XE CNFBXFIX COMBSAVECNF COMBCOPYSYS COMB=XL2CNF LSTB TSETUSR LSTBTSETUSR OBJBIXL2 TX1BECXL2 TX2B XL2KEY DOCBSETTD DOCBXL2 SRCBEQUATES SRCBFINST SRCB LOCODE SRCB IVB SRCBDVB SRCB *SWAP SRCB0JSUBS SRCB;zKEYSUBS SRCBSTOW SRC6XFIX SRCSAVECNF SRC COPYSYS SRC 4XL2REFS SRC?TSETUSR SRCZRD COMnRDNUMBERCOMOrRD TXTrtant software and ways around them, are described below:BASIC XEUnder Sparta, installation of the extensions, with XL2 a=r}ctive, hangs up. After giving it a few seconds, a Reset fixes the problem and everything appears to function correctly. It wo=s}rks better if you enter the cartridge first, then exit to DOS to install XL2.BobTermTurn off the key handler before enter=t}ing BT. You cannot swap systems or use any XL2 feature while in BT. Once you exit BT, XL2 is restored to entry status though =u}you will have to reset the clock.DaisyDotThe key handler should be turned off, at least for use with the font editor.MA=v}C/65The key handler must be off before entering DDT. You can use the new editing functions on source code--just remember to=w} press Shift-Help before going to DDT. There are no restrictions with the disk version of MAC/65.SpartaDOS 3.2dThe only p=x}roblem I've encountered is an infrequent tendency to drop out to the main directory when swapping systems while working withi=y}n subdirectories. This occurs most often with TP and can be minimized by installing XL2 (or using XFIX) only while in the Mai=z}n directory. I've spent nearly 50 hours attempting to fix this and don't think the minor inconvenience rates much more attent={}ion.TextPro+Before you enter TP, turn the key handler off. If you forget, press Shift-Help. To access the XL2 keys (to ch=|}ange the TD line for example) it's best to go to the disk menu first. Then turn the key handler on, change your TD display, t=}}oggle the keyboard off, and return to the edit screen. Note that TP maintains its own set of screen pointers so the only x-y =~}information that is meaningful is keyboard code.With a large file in the text buffer, it's best to turn off the TD line to =}gain speed otherwise you get much slower response to your key presses. By the way, all references to TP are to version 4.54; =}I haven't tested XL2 with later versions yet as I don't have doc's for them.Turbo BASIC XLXL2 and its auxillary COMs may =}not be BRUN. You must load them from MYDOS before using Turbo. Obviously you can't use Turbo with Sparta and I think DOSXL's =}Memlo is a bit too high (it's been a long time since I played with DXL). Otherwise there are no restrictions.The SpartaDOS =}WedgeI suggest you run the Wedge after XL2 so that you can use the EXIT option without requiring a re-boot. There are no re=}strictions except as below:To use the BXE Extensions, the Wedge or newer versions of TP you will have to use XL2 and not XL=}2XE. You will also obviously need an RD handler that reserves more than the XE banks (coming up in the next article).FUTURE=} VERSIONS OF XL2This is the "Beta" version of XL2. While "Alpha" did work with DOS 2 and clones, it used fixed memory locat=}ions in low RAM and any corruption of the area invariably resulted in a lockup. Since XL2 is a utility for large RAM computer=}s, I see no point in writing code for FMS which do not, in any case, properly support such upgrades. In other words it will n=}ot become compatible with DOS 2.yech.I wasn't planning to take this too much further but as I've managed to borrow SDX, I w=}ill attempt to add the capability to run a different DOS in one system. In addition, XL2 presently does not work with the Exp=}ress Pro BBS or use the RT8 clock so I'll be looking at fixing both of these. In all liklihood, this will require more RAM so=} a number of the keyboard functions will have to be dropped.If it turns out that I have to drop the immediate vblank routin=}e, the drive display may also disappear. As it is, it is not frequent enough to catch all sector access on load/copy/save ope=}rations. So attempting this on the deferred vblank would only worsen things.For the present, it works well within the restr=}ictions outlined. There may be two final versions: one for Express Pro SysOps and the other for non-SysOps. Hopefully, both w=}ill work with the RT8 and the second with SDX as well.for Express Pro SysOps and the other for non-SysOps. Hopefully, both w<7XL2 KEYBOARD FUNCTIONSKeys With [Select] [Reset] Cold start[Shift][Control][U] Set clockKeys With [Control]A} [Help] Swap systems [Clear] w Turn TD line offKeys With [Shift] [Help] Toggle key handler on/off [Clear] w Turn TA}D line onKeys With [Shift][Control] (system)[Return] Turn off screen [-] r Increase screen color [=] r DecreasA}e screen color [T] r Increase text luminance [D] Toggle disk noise [F] Toggle fast key [N] Toggle kA}ey click [S] Toggle fine scroll [1]-[9] Select drive to display [0] Select x-y (cursor) display [O] TA}oggle code display [Tab] Save defaults for resetKeys With [Shift][Control] (editing) [Esc] Clear screen [Atari] A}r Invert character [I] Invert to end of text [Caps] r Toggle character case [Space] Toggle line case [Del] DA}elete all right [<] Move to left margin [>] Move to end of text [,] r Move to word left "[" [.] r MovA}e to word right "]" [Q] r Advance to " or inverse " Keys marked "w" wait for release Keys marked "r" repeat if A}heldword right "]" [Q] r Advance to " or inverse " Keys marked "w" wait for release Keys marked "r" repeat if @Setting Time/Date (MYDOS/DOSXL)a. Enable key handlerb. POKE 960,day (1 to max for month) POKE 961,month (1 to 12)E} POKE 962,year (0 to 99) POKE 963,hour (o to 23) POKE 964,minute (0 to 59) POKE 965,second (0 to 59)c. PressE} [Shift][Control][U]Notes:1. All six values must be POKEd.2. There is no check on values entered.3. Step c. must be cE}arried out before any printer operation.values must be POKEd.2. There is no check on values entered.3. Step c. must be cD) .OPT NO LIST,NO MLIST .OPT NO CLIST,NO EJECT;; SAVE #D1:XL2.M65;;; SAVE #D2:XL2.M65;;; PRINT #D1:XL2;;;; I} ASM,#D1:XL2.REF,#D1:XL2.OBJ; .TITLE "XL2";; Programmed by John Picken; Last rev 29 Sep 93; .IF .NOT .DEF DOSINI .I}INCLUDE #D1:EQUATES.M65 .ENDIF .INCLUDE #D1:INST.M65 .INCLUDE #D1:LOCODE.M65 .IF *>$4000 .ERROR "Bank0 Overflow" I}.ENDIF .INCLUDE #D1:IVB.M65 .INCLUDE #D1:DVB.M65 .INCLUDE #D1:SWAP.M65 .INCLUDE #D1:SUBS.M65 .INCLUDE #D1:KEYSUBS.MI}65 .INCLUDE #D1:STOW.M65ENDHI .= *-1 .IF *>$5800 .ERROR "Bank1 Overflow" .ENDIF *= INITAD .WORD START;; XL2 inI}ternal references; .OPT LISTXX .= STAGE1XX .= CURSYSXX .= BUMPFGXX .= SDMSAVXX .= FIXUPXX .= REF0XX .= REF1XX .= RI}EF2XX .= REF3XX .= NOBOOTXX .= MYCODEXX .= FIXCLKXX .= SAVDEFXX .= DATSAVXX .= ENDHIXX .= L.LOCODEXX .= L.CNF .OPTI} NO LIST .ENDX .= NOBOOTXX .= MYCODEXX .= FIXCLKXX .= SAVDEFXX .= DATSAVXX .= ENDHIXX .= L.LOCODEXX .= L.CNF .OPTH; SAVE #D1:EQUATES.M65; Last rev 29 Sep 93;; SAVE #D2:EQUATES.M65;;; PRINT #D1:EQUATES;;;; LOAD #D1:XL2.M65; M} .MACRO SKIPB .BYTE $24 .ENDM; .MACRO SKIPW .BYTE $2C .ENDM; .MACRO BLANK .BYTE [%1-1]*$10 .ENDM; .MACROM} LMS .BYTE $42 .WORD %1 .ENDM; .MACRO JUMP .BYTE $01 .WORD %1 .ENDM; ------------------; Free zero page locsM}; *= $00LNFLG *= *+1 used on bootNGFLAG *= *+1 used by Sdos sioCASINI *= *+2 might be used; *= $1CM} unused on xl/xeABUFPT *= *+2 For tdline *= *+2 For keys;; sio cassette use only; *= $3DZCOUNTZDLISTM} *= *+2 xl2 for tdlineLINORG *= *+2 xl2 for keys;; 1200xl fnkey tbl ptr; *= $60FKDEF *= *+2; -----------M}-------; Keyboard codes;LTAROW = 134RTAROW = 135UPAROW = 142DNAROW = 143; ------------------; SpartaDOS Equates;VGEM}TTD = $FFC0VSETTD = $FFC3VTDON = $FFC6VINITZ = $FFCCVXCOMLI = $FFD2VKEYON = $FFDB; -------------------; Atari OS EquatM}es;WARMST = $08 reset=$FFBOOT? = $09 disk=1DOSVEC = $0ADOSINI = $0CPOKMSK = $10BRKKEY = $11 non-0=normalM}RTCLOK = $12SOUNDR = $41ATRACT = $4DLMARGN = $52RMARGN = $53ROWCRS = $54COLCRS = $55SAVMSC = $58OLDCHR = $5DOLDADR =M} $5ERAMTOP = $6AFR0 = $D4;VKEYBD = $0208CDTMV3 = $021CCDTMF3 = $022AVVBLKI = $0222VVBLKD = $0224SRTIMR = $022BSDMCTM}L = $022FSDLSTL = $0230SDLSTH = $0231COLDST = $0244 cold=$ffFINE = $026ETABMAP = $02A3COLOR1 = $02C5COLOR2 = $02C6CM}OLOR4 = $02C8KRPDEL = $02D9KEYREP = $02DANOCLIK = $02DBHELPFG = $02DCDMASAV = $02DDRUNAD = $02E0INITAD = $02E2MEMLO =M} $02E7CRSINH = $02F0KEYDEL = $02F1CH1 = $02F2CHBAS = $02F4CH = $02FCSSFLAG = $02FF;DDEVIC = $0300DUNIT = $0301DCOMNM}D = $0302DSTATS = $0303DAUX1 = $030ADAUX2 = $030B;HATABS = $031A;ICHID = $0340ICCOM = $0342ICBAL = $0344ICBAH = $03M}45ICBLL = $0348ICBLH = $0349ICAX1 = $034AICAX2 = $034B;PRNBUF = $03C0CARTCK = $03EBBASICF = $03F8GINTLK = $03FA;CAM}RTINI = $BFFE;TRIG3 = $D013GRACTL = $D01DCONSOL = $D01FKBCODE = $D209IRQEN = $D20ESKSTAT = $D20F;PORTB = $D301;DMAM}CTL = $D400WSYNC = $D40ANMIEN = $D40E;CIOV = $E456SETVBV = $E45CSYSVBV = $E45FXITVBV = $E462WARMSV = $E474COLDSV = $M}E477;; Available low ram;PRNBUF = $03C0 ; ->$3E7CASBUF = $03FD ; ->$47FBSTACK = $0480LBUFF = $0580PAGE6 = $0600;M}; Mac/65 Cartridge ram use;; $80-$AF mac ddt ptrs/temp; $B0-$D3 mac ptrs/temp; $D4-$FF mac float pnt; $M}3FD-$47F ddt bufr/disp casbuf; $480-$57F mac ddt bufr/disp; $580-$67F mac bufr/work; $680-$6FFc float pnt; $Lj; SAVE #D1:INST.M65; last rev 29 Sep 93;; SAVE #D2:INST.M65;;; PRINT #D1:INST;;;; LOAD #D1:XL2.M65; *= $B0ZQ}PORTB *= *+1ZSTACK *= *+2ZINDEX *= *+2ZPAGES *= *+1; *= $3000;; Get cnf file into buffer; RTSSTART JSR Q}CLOSE7 x=$70 STX CRSINH Kill cursor;; Set up iocb 7 for cnf; and iocb 0 for print; LDY #10LOOPA LDA DFDATA-1,Y Q} STA ICCOM+$70-1,Y LDA PRDATA-1,Y STA ICCOM-1,Y DEY BNE LOOPA; STY SDMCTL Screen off STY DMACTL; JSR GOCIO Q} do status BPL OPENIT; CPY #167 Ok if protected BNE CNFDUN else skip it;OPENIT LDA #3 open file JSR SETQ}COM BMI CLOSIT; LDA # TABBUF buffer STA ICBAH,X LDA #7 JSR SETCOM BMI CQ}LOSIT;; If cnf loaded use cnf bank; table and defaults; LDY #3LOOPB LDA TABBUF,Y STA BTABLE,Y DEY BPL LOOPB;Q} LDY #L.CNF-1LOOPC LDA CNFBUF,Y STA DATSAV,Y DEY BPL LOOPC;CLOSIT JSR CLOSE7;CNFDUN LDX #0 JSR CIOV prQ}int message STX CRSINH;; Set access values into code; LDY BTABLE DEY STY REF0; LDY BTABLE+1 DEY STY REF1;Q} LDY BTABLE+2 DEY STY REF2; LDY BTABLE+3 STY TORESET+1 DEY STY TOINT+1 STY REF3; LDA PORTB STA ZPORTB;Q} LDA $0700 CMP #'S BNE OVRSDS; LDA #$FE STA PORTB LDY #0 STY SPARTA STY SPARTA+1 JSR VKEYON key off for noQ}w;OVRSDS JSR NOINTS;; Look for previous installation; LDX #15KLOOP LDA TTABLE,X Find bank 3 STA PORTB controlQ} value CMP REF3 BNE NXT64K; SBC #4 Check values CMP REF2 for banks 2,1,0 BNE NXT64K Ok if any err; SBCQ} #4 CMP REF1 BNE NXT64K; SBC #4 CMP REF0 BNE NXT64K;; Ensure aux coms will not; use previous installation; SQ}TA REF3;NXT64K DEX BPL KLOOP; LDA #$FD STA PORTB; LDY #8 Assume no cart LDA GINTLK Check assumption BQ}EQ GOTBNK Go if true; LDY $AFFF Save bank STA $D508 Kill cart;GOTBNK STY CBSAVE Save cart bank STY CBSAVE+1Q}; LDX $A000 See if any Basic INC $A000 CPX $A000 BEQ GOTBAS; STX $A000 CLC;GOTBAS ROL A a=gintlk*2+cQ}y;; cart+bas: a=3 cart only: a=2; bas only: a=1 no roms: a=0; only 1 is valid for basic on; TAX LDA #$02 For Q}basic flag STA ZPAGES DEX BNE FLAGIT was not 1; AND ZPORTB If bas was on a=0;FLAGIT STA BASICF on=0 off=2 OQ}RA ZPORTB If off set b1=1 STA ZPORTB Fix Portb later; LDX SPARTA If not Sparta BNE OVRSTK no stack; STX ZINDEXQ} LDA # >$0700 STA ZINDEX+1;; Find Lda Address,X;GETLDA LDA (ZINDEX,X) x=0 thruout CMP #$BD BEQ GOTLDANXTBYT IQ}NC ZINDEX BNE GETLDA INC ZINDEX+1 DEC ZPAGES BPL GETLDA BMI OVRSTK Abort, not found;; Check next op is Sta PortbQ};GOTLDA LDY #5STAPB? LDA (ZINDEX),Y CMP PBREST-3,Y Go back if BNE NXTBYT any fail test DEY else check Q} CPY #2 all 3 bytes BNE STAPB?;; Get stack address; LDA (ZINDEX),Y msb STA ZSTACK+1 DEY LDA (ZINDEX),Y lsbQ} STA ZSTACK;; Correct all eight values; LDY #7FIXSTK LDA (ZSTACK),Y ORA BASICF STA (ZSTACK),Y DEY BPL FIXSTKQ};OVRSTK;; Start ram copy banks 1 & 2; Cart is off; LDX #0 table index LDY BTABLE+2 JSR YCOPY m2->x2 LDQ}Y #$FF JSR YCOPY m1->m2 LDY BTABLE+1 JSR YCOPY m2->x1 LDY BTABLE+2 JSR YCOPY x2->m2;; Start address save/coQ}rr; LDA #$FF os onPBREST STA PORTB; CLC LDA SDLSTL set jmp in ADC #3 dlist STA TDLXIT+1 TYA Q} y=0 from copy ADC SDLSTH STA TDLXIT+2; LDX #1LOOPD LDA DOSINI,X locode STA OLDINI+1,X addresses; LDA SYSVBV+1Q},X Kill any other STA OLDIVB+1,X imm vblank; LDA VVBLKD,X STA OLDDVB+1,X; LDA VKEYBD STA OLDKSL,X LDA VKEYBD+1Q} STA OLDKSH,X; LDA MEMLO+1 STA OISAVH,X TAY LDA MEMLO STA OISAVL,X DEX BPL LOOPD; STA DOSINI STY DOSINI+Q}1; LDA SPARTA BNE OVRVEC; DEC PORTB; LDA # TEMPVB LDA #6 JSR SETVBV LDA #$40 STA NMIEN CLI RTS; --------Q}------------;; Temp. ivblank Sys a;TEMPVB JSR NOINTS LDA PORTB TSX LDY BTABLE+3 Ext bank 3 STY PORTB STA PBSAQ}VE STA PBSAVE+1 STX SPSAVE STX SPSAVE+1;; Fix low ram; JSR NOBOOT LDA #34 Restore dma on STA SDMCTL stageQ}2 vblank;; Copy bank 0 to ext 0; LDY BTABLE LDX #8 JSR YCOPY y=0;; LDA #12; STA CH+$4000;; Fix monitor for Q}sys a; LDX BTABLE+3 STX PORTB JMP FIXUP; --------------------;; Subroutines for installation;; Cio access for cnfQ};CLOSE7 LDA #12SETCOM LDX #$70 STA ICCOM,XGOCIO JSR CIOV RTS;; Bank copy: Entry:; x=table offset, y=portb;Q}; Exit:; x=table offset+1, y=0;YCOPY STY PORTB;; Entry:; x=table offset, portb pre-set;COPY LDA STBL,X STA SQ}RCE+2 LDA DTBL,X STA DEST+2 LDY #0SRCE LDA $FF00,Y Page loopDEST STA $FF00,Y INY BNE SRCE INC SRCE+2 Bank Q}loop INC DEST+2 DEC PAGES,X BNE SRCE INX RTS;; Add byte in a to (dosini); return lsb in y, msb in a;ADJUST CQ}LC ADC DOSINI TAY LDA #0 ADC DOSINI+1 RTS;; Execute command line; Enter y=0 if td, 2 if key;DOCMD TYA ASL Q}A ASL A a=0 or a=8 TAX LDA TDFLAG,Y BEQ TURNOF LDA #'N STA CMD+5,X LDA #0TURNOF LDY #10 STA (DOSVEC)Q},Y LDY #62 DEXLOOPL INX INY LDA CMD,X STA (DOSVEC),Y BPL LOOPL JSR VXCOMLI;; Kill all interrupts;NOINTSQ} SEI LDY #0 STY NMIEN RTS;; Data for installation;; PortB access defaults;BTABLE; .BYTE $E3,$E7,$EB,$EF ;130xeQ} .BYTE $C3,$C7,$CB,$CF;; Test values to search for; previous installation;TTABLE .BYTE $0C,$2C,$4C,$6C .BYTE $0E,$Q}2E,$4E,$6E .BYTE $8C,$AC,$CC,$EC .BYTE $8E,$AE,$CE,$EE;; Source/Dest msbs, page counts; for copy subroutine;STBL .Q}BYTE $80 m2->x2 .BYTE $40 m1->m2 .BYTE $80 m2->x1 .BYTE $40 x2->m2; .BYTE $50 mon->$8000 .BYTE $80 monQ}->x3 .BYTE $C0 m3->x3 os low .BYTE $D8 m3->x3 os high .BYTE $00 m0->x0;DTBL .BYTE $40 m2->x2 .BYTE $80 Q}m1->m2 .BYTE $40 m2->x1 .BYTE $80 x2->m2; .BYTE $80 mon->$8000 .BYTE $50 mon->x3 .BYTE $40 m3->x3 .BYTQ}E $58 m3->x3 .BYTE $40 m0->x0;PAGES .BYTE $40 m2->x2 .BYTE $40 m1->m2 .BYTE $40 m2->x1 .BYTE $40 x2->Q}m2; .BYTE $08 mon->$8000 .BYTE $08 mon->x3 .BYTE $10 m3->x3 .BYTE $28 m3->x3 .BYTE $40 m0->x0;; CommanQ}d lines for Docmd;CMD .BYTE "TD OFF",155 .BYTE "KEY OFF",155;DFDATA .WORD 13 Status .WORD FSPEC .WORD 0 .Q}WORD L.CNF+4 .WORD 4;PRDATA .WORD 11 .WORD HELLO .WORD 0 .WORD L.HELLO .WORD 12;FSPEC .BYTE "D:XL2.CNF"HELQ}LO .BYTE 125,155,155,127 .BYTE " " .BYTE 155,127 .BYTE " " .BYTE 155,Q}127 .BYTE " (c) Sep '93 " .BYTE 155,127 .BYTE " John Picken " .BYTE 155,127 .BYTE " R} " .BYTE 155,127 .BYTE " " .BYTE 155,155L.HELLO = *-HELLOTABBUF *= *+4CNFBUF R} *= *+99 " .BYTE 155,127 .BYTE " " .BYTE 155,155L.HELLO = *-HELLOTABBUF *= *+4CNFBUF P ; SAVE #D1:LOCODE.M65; last rev 13 Sep 93;; SAVE #D2:LOCODE.M65;; PRINT #D1:LOCODE;; code at memlo; sv.b dizc; ..V}.. .1.1 reset 05; .1.. .1.1 keyon 45; 11.. .1.. gettd C4; 1... .1.. settd 84; .1.. .1.. on.off 44; .... .1.. keV}yirq 04LOCODEOLDINI JSR $FFFF sv.b dizc LDX #$05 .... .1.1 SKIPWJKEYON LDX #$45 .1.. .1.1 SKIPWJGETTDV} LDX #$C4 11.. .1.. SKIPWJSETTD LDX #$84 1... .1.. SKIPWJONOFF LDX #$44 .1.. .1..EXEC LDA NMIEN PHAV} LDA #0 STA NMIEN LDA PORTB PHATORESET LDA #$CF os on STA PORTB JSR MYCODE PLA STA PORTB PLA STA NMIV}EN CLI BCC TORTSXITIRQ JMP XITVBVTORTS RTSMYKIRQ TXA PHA TYA PHA LDX #$04 .... .1.. 04 BPL EXEC V}Go alwaysEXSWAP STA PORTB Exit swap CLI Enable stage2 STX NMIEN and stage1WAIT1 CPY RTCLOK+2 BNE WAITV }1 PLA STA NMIEN allow dlis PLA STA SDMCTL dma BCS XITIRQ alwaysMYVBD SEC SKIPBMYVBI CLC LDA PORTBTOIV }NT LDX #$CE os off STX PORTB JMP STAGE1XITINT STA PORTB BCS OLDDVBOLDIVB JMP $FFFFOLDDVB JMP $FFFFDLISTV } BLANK 8 BLANK 8 BLANK 4LMSCANA.10 LMS NEWTDLTDLXIT JUMP $FFFFNEWTDL .SBYTE "Ҡ̲V }𠹳"L.LOCODE = *-OLDININEWMEM = * LMS NEWTDLTDLXIT JUMP $FFFFNEWTDL .SBYTE "Ҡ̲T-; SAVE #D1:IVB.M65; last rev 17 Sep 93;; SAVE #D2:IVB.M65;;; PRINT #D1:IVB;;;; LOAD #D1:XL2.M65 *= $5000;; VZ}blank regs on stack, os off,; nmis on, i set by int,; a=portb normal;STAGE1 PHA BCS STAGE2; DEC JIFFY BNE OVRBZ}MP; LDX #60 Reset counter STX JIFFY and flag inc INC BUMPFG on deferred;OVRBMPCURSYS = *+1 LDX #0; LDA Z}TDFLAG,X Skip display AND DDEVIC if tdl off or BEQ NODISK if not disk,; LDA DRIVE,X Also if not CMP DUNIT monitoZ}red, or BNE NODISK; LDY DSTATS if Dstats TYA is $80 AND #$3F or $40 BEQ NODISK ; LDA DCOMND Also sZ}kip if CMP #'R not read, BEQ ISDISK; CMP #'P put, BEQ ISDISK or; CMP #'W write sector BNE NODISK;Z}ISDISK EOR #$E0 to inverse sbyte LDX #3 JSR SBYTE LDA DAUX2 update sec num JSR BIN2HEX LDA DAUX1 JSR BIN2Z}HEX+1 skip inx TYA set status JSR BIN2HEX;NODISK CLC stage1 exitXITMID PLA recover PortbGZ}OLOW0 JMP XITINTA set status JSR BIN2HEX;NODISK CLC stage1 exitXITMID PLA recover PortbGX; SAVE #D1:DVB.M65; last rev 17 Sep 93;; SAVE #D2:DVB.M65;;; PRINT #D1:DVB;;;; LOAD #D1:XL2.M65;; Deferred Vbi^} regs on stack,; os on, nmis on, i set by int,; portb normal on stack;STAGE2 LDA GINTLK Check if vibration CMP TRIG^}3 turned on unwanted BCS BUMP? cart. Go if not; STA $D508 Else kill it again;BUMP?BUMPFG = *+1 LDX #0 Ne^}ed clok inc? BEQ GETSYS; JSR BUMPIT;GETSYS LDX CURSYSSDMSAV = *+1 LDA #0 BEQ NOSWAP; JMP SWAP;NOSWAP LDA^} DOSINI+1 If dosini>= CMP OISAVH,X my reset BCS DL? then all ok; LDA OISAVL,X Else Dup.Sys STA DOSINI took it s^}o LDA OISAVH,X take it back STA DOSINI+1;DL? LDA TDFLAG,X Skip if BEQ DLOK td off;; verify dlist address; L^}DA SDLSTL LDY SDLSTH CPY MINE1+2 BNE TAKEDL; CMP MINE1+1 BEQ DLOK;TAKEDL STY ZDLIST+1 LDY #7 STA ZDLIST ^}CLC ADC #3MINE1 STA DLIST,Y Put os dlist LDA ZDLIST+1 addr+3 into ADC #0 jump at end INY of mineMINE^}2 STA DLIST,Y; LDY #6FINDJP LDA (ZDLIST),Y Find jmp/lms INY at end of CMP #$41 os dlist BNE FINDJP;^} LDA MINE1+1 Point shadow STA SDLSTL and jump to STA (ZDLIST),Y mine INY LDA MINE1+2 STA SDLSTH STA (ZDLIST),Y^ };DLOK LDY DRIVE,X Go if not x-y BNE HELPCK display; LDA KBCODE Assume keybd LDY WATCOD,X Is it? BMI GOTCOD Ye^!}s, go; LDA OLDCHR Screen code DEY y=$FF;GOTCOD SEC;SUB100 INY Subtract 100 SBC #100 until ^"}too many BCS SUB100; ADC #100 Add one back PHA Save modulus TYA Get integer LDX #1 Display^#} JSR ISDEC hundreds PLA Display JSR BIN2DEC+1 tens, ones INX LDA COLCRS and cursor JSR BIN2DEC positio^$}n INX LDA ROWCRS JSR BIN2DEC LDX CURSYS;HELPCK BIT HELPFG Invoke swap if BMI INVOKE Control-Help; LDA KSTA^%}TS,X o/flow unchanged BVS KTOGGL Go if Shift-Help; BEQ EXIT2 Go if my key off; CMP SRTIMR or debnce won't BNE E^&}XIT2 expire on stage2; LDA SKSTAT or last key not AND #4 still pressed BNE EXIT2; LDY #L.KREP-1 Look for my^'} LDA KBCODE repeatable key JSR KCHECK exec if found;EXIT2 PLA Portb SEC Flag stage2GOLOW1 JMP ^(}XITINT exit;KTOGGL EOR #$01 Toggle key JSR XKEY z flag valid BCC EXIT2H Go always;INVOKE LDA SDMCTL Set ^)}up for STA SDMSAV swap on next STX SDMCTL vblank;EXIT2H LDA #0 Clear Help STA HELPFG BEQ EXIT2 Alwayst \{; SAVE #D1:SWAP.M65; last rev 23 Sep 93;; SAVE #D2:SWAP.M65;;; PRINT #D1:SWAP;;;; LOAD #D1:XL2.M65; Execute swab+}p:; os off, ints on; stack as per vbi entry; portb entry on stack; x=cursys a=sdmsav;SWAP SEI STA SDMCTL; LDb,}A NMIEN STX NMIEN STA NMISAV,X; PLA STA PBSAVE,X; TXA Cursys to a TAY and y EOR #$01 Togglb-}e system STA CURSYS; LDA #8 Assume no LDX GINTLK cart BEQ SAVEIT Go if true; LDA $AFFF else get bank Sb.}TA $D508 kill cart;SAVEIT STA CBSAVE,Y Save bank TSX and stack TXA pointer STA SPSAVE,Y;; y wilb/}l be 0 at end of; every swap loop; LDY #0; LDA #$C0 Exchange 4k STA EX4K+2 from C0-CF STA EX4K+12 with 40-4F b0} LDA #$40 in ext bank 3 STA EX4K+5 STA EX4K+8 LDA #$10 Do 16 pages STA ZCOUNTEX4K LDA $C000,Y main to a LDb1}X $4000,Y ext to x STA $4000,Y a to ext TXA x to a STA $C000,Y a to main INY BNE EX4K page loop; INC b2}EX4K+2 INC EX4K+12 INC EX4K+5 INC EX4K+8 DEC ZCOUNT BNE EX4K bank loop; SEC Flag 1st reloc;; Exchanb3}ge swap code with os ram; First exch moves code to $C000; Second restores $C000 and moves; code back to monitor;RELOC b4}LDA $C000,Y Major bug LDX HICODE,Y fixed here STA HICODE,Y TXA STA $C000,Y INY BNE RELOC; BCC FIXUP Go ifb5} swapped JMP $C000 Else do it;; Ext 3, os off;FIXUP;; Fix code for new system; LDY CURSYS LDX CBSAVE,Y Set newb6} cart STA $D500,X status LDX SPSAVE,Y Set stack TXS pointer; LDX #0 STX SDMSAV Clear flag; TYA ASL Ab7} ASL A ASL A TAY;LOOPO LDA ADSAVE,Y INY STA GOLOW0+1,X STA GOLOW1+1,X; LDA ADSAVE,Y INY STA GOLOW2+1,Xb8}; LDA ADSAVE,Y INY STA MINE1+1,X STA MINE2+1,X STA MINE3+1,X STA MINE4+1,X; LDA ADSAVE,Y INY STA SBYTE+1,b9}X INX CPX #2 BNE LOOPO; JSR BUMPIT set myclok and JSR FIXCLK rtclok, y=cursys TYA ADC #33+$80 line LDX #18b:} JSR SBYTE y unchanged; LDA SDMCTL Set up for PHA one vblank LDA NMISAV,Y delay with PHA no dlib;}s LDA PBSAVE,Y LDX #$40 LDY #5 Ensure vblank STA WSYNC started if on;LOOPP DEY line $7C (same BNb<}E LOOPP as Setvbv); STY SDMCTL LDY RTCLOK+2 INY;GOLOW2 JMP EXSWAP;; Code executes in os ram; length = 139;b=}OFFSET = $C000-*;; arrive roms off, y=0, c=1; in ext bank 3;HICODE LDA #$D8 Swap pages D8-FF LDX #$58 with exb>}t bank 3 BPL SWB1 return a=0;; ;RTN.ZEROREF2 = *+1 LDY #$CA Swap 80-BF LDA #$80 with ext bank 2 Bb?}MI SWAPBANK return a=$C0;; ;RTN.NEG TYA Swap 00-3FREF0 = *+1 LDY #$C2 with ext bank 0;; relative b@}subroutine; entry: a=src y=portb;SWAPBANK LDX #$40 Entry STY PORTB for full bank;SWB1 STA SWB2+2 Entry forbA} STA SWB2+12 partial copy STX SWB2+5 from (a) to STX SWB2+8 top of bank LDY #0 portb preset;SWB2 = *+OFFSETSbB}WLOOP LDA $D800,Y main to a LDX $5800,Y ext to x STA $5800,Y main to ext TXA ext to a STA $D800,Y ext to mabC}in INY BNE SWLOOP page loop; INC SWB2+2 INC SWB2+12 INC SWB2+5 INC SWB2+8 BPL SWLOOP 16k loop; LDA SWB2+2bD} msb main srce BEQ RTN.ZERO rolled D8=>00 BMI RTN.NEG rolled 80=>C0;; else rolled 00=>40, fall thru; STA BANK1+2 bE}STA BANK1+10 STA BANK1+13 STA BANK1+22;; ; LDX #$FE STX PORTB;BANK1 = *+OFFSETBANK1R LDA $4000,Y main tbF}o aB01.HIREF1 = *+1;; ; LDX #$C6 STX PORTB LDX $4000,Y STA $4000,Y TXA;; ; LDX #$FE STX PORbG}TB STA $4000,Y INY BNE BANK1R page; INC BANK1+2 INC BANK1+10 INC BANK1+13 INC BANK1+22 BPL BANK1R bank;;bH} ;REF3 = *+1B03.HI LDA #$CE STA PORTB both roms off CLC Flag swap done JMP RELOCL.HICODE = *-HICObI}DE;REF3 = *+1B03.HI LDA #$CE STA PORTB both roms off CLC Flag swap done JMP RELOCL.HICODE = *-HICO`; SAVE #D1:SUBS.M65; last rev 29 Sep 93;; SAVE #D2:SUBS.M65;;; PRINT #D1:SUBS;;;; LOAD #D1:XL2.M65;RESET CfK}MP CONSOL a=5 if reset BNE NOBOOT Os is on; STA $D500 Mod. 29 Sep JMP COLDSV;NOBOOT JSR FIXCLK y=cursys LDAfL} SOUNDS,Y STA SOUNDR LDA LMGSAV,Y STA LMARGN; LDA KSTATS,Y Mod. 29 Sep PHA; TYA ASL A ASL A ADC #3 TAYfM} LDX #3RESLP LDA TABSAV,Y STA TABMAP,X LDA MYVBIA,Y STA VVBLKI,X LDA MEMLOA,Y STA MEMLO,X LDA COLSAV,Y STA fN}COLOR1,X LDA KEYSAV,Y STA KRPDEL,X DEY DEX BPL RESLP;; LDX CURSYS; LDA KSTATS,X; PLA Mod. 29 Sep;fO} BPL DOKEY Always;; Arrive: ext 3, nmis off, os on; sv.b dizc; .... .1.1 reset 05; .1.. .1.1 keyon 45; 11.. .1..fP} gettd C4; 1... .1.. settd 84; .1.. .1.. on.off 44; .... .1.. keyirq 04;MYCODE TXA PHA LDX CURSYS PLP BCfQ}C TD?; BVC RESET;; Arrive via Vkeyon; x=cursys; TYA;; Arrive via Shift-Help;XKEY STA KSTATS,X;; Arrive viafR} Reset; x=cursys a=kstats;DOKEY ASL A a=0 or 2 ADC CURSYS a=0,1,2 or 3 TAX LDA OLDKSL,X STA VKEYBD LDfS}A OLDKSH,X STA VKEYBD+1 RTS;; sv.b dizc; 11.. .1.. gettd C4; 1... .1.. settd 84; .1.. .1.. on.off 44; .... .1.fT}. keyirq 04;TD? BPL ONOFF?; LDY #18 BVS LOOPS;LOOPR LDA (DOSVEC),Y STA DATSAV-13,Y DEY CPY #13 BCS LOOPfU}R RTS;LOOPS LDA DATSAV-13,Y STA (DOSVEC),Y DEY CPY #13 BCS LOOPS RTS;; sv.b dizc; .1.. .1.. tdon 44; .fV}... .1.. keyirq 04;ONOFF? BVC KEYINT;; Arrive via vtdon;ONOFF TYA;; Arrive via Clear key; z flag valid for a;fW}ON.OFF STA TDFLAG,X If on, vblank BNE TDXIT2 fixes it;TDOFF LDY #7MINE3 LDA DLIST,Y SEC SBC #3 STA SDLSTL fX} STA ZDLIST INYMINE4 LDA DLIST,Y SBC #0 STA SDLSTH STA ZDLIST+1 LDY #6;LOOPT LDA (ZDLIST),Y INY CMP #$41fY} BNE LOOPT; LDA ZDLIST STA (ZDLIST),Y INY LDA ZDLIST+1 STA (ZDLIST),Y;TDXIT2 CLC RTS;; Key irq must retufZ}rn set carry;KEYINT LDY KBCODE Key same as CPY CH1 last accepted? BNE GOTKEY No; LDA KEYDEL Debounce done?f[} BNE EXITKB No;GOTKEY CPY #159 BNE NOFREZ; LDA SSFLAG Control-1? EOR #$FF STA SSFLAG BCS KRESET Go alwaysf\};NOFREZ CPY #118 Shift Clear? BEQ LOOPU Yes, do td on; CPY #182 Control Clear? BNE HLP? No, check Help;f]} CLC Yes, do td offLOOPU LDA SKSTAT Wait for key AND #4 release BEQ LOOPU; LDA #0 Move carry tf^}o a ROL A z flag valid JSR ON.OFF BCC KRESET Go always;HLP? TYA AND #$3F Mask Shft/Ctrl CMP #17 Hf_}elp? BNE KRET? No!; STY HELPFG Save actual BEQ KRSET2 Go always;KRET? CPY #204 Shft/ctrl Ret? BNE KSTOW;f`} LDA SDMCTL If off BEQ KRSET0 turn on; STA DMASAV Else save LDA #0 and kill BEQ KRSET1;KSTOW STY CH1 fa} STY CH TYA LDY #L.DRVKEY-1 Check my key JSR KCHECK execute if found;KRESET LDA SDMCTL BNE KRSET2;KRSET0 LDAfb} DMASAV;KRSET1 STA SDMCTL;KRSET2 LDA #3 Valid key exit STA KEYDEL Set bounce delay LDA #0 STA ATRACT Kilfc}l atract;EXITKB LDA KRPDEL Reset key STA SRTIMR repeat timer SEC RTS;; Set rtclok from myclok;DAY = DATSAVMOfd}NTH = DATSAV+1YEAR = DATSAV+2HOUR = DATSAV+3MINS = DATSAV+4SECS = DATSAV+5;FIXCLK CLC LDA #0 STA RTCLOK STA RTCfe}LOK+1 STA RTCLOK+2 LDA HOUR JSR MUL60 LDA MINS JSR MUL60 LDA SECS JSR MUL60;EXITCLK LDY CURSYS RTS;MUL6ff}0 LDX #0 LDY #0 JSR ADD sub=clok+a JSR X2 clok=*2 JSR ADD sub=sub+clok=*3 JSR X4 clok=*12 JSRfg} SUBTOT sub=*12 JSR X4 clok=*48;; Add subtotal in a,x,y; to rtclok;ADD ADC RTCLOK+2 STA RTCLOK+2 TXA ADfh}C RTCLOK+1 STA RTCLOK+1 TYA ADC RTCLOK c clear STA RTCLOK after this;; Put subtotal in a,x,y;SUBTOT LDA RTCLOfi}K+2 LDX RTCLOK+1 LDY RTCLOK RTS;X4 JSR X2 rtclok*4;X2 ASL RTCLOK+2 rtclok*2 ROL RTCLOK+1 ROL RTCLOKX2fj}RTS RTS;; Add secs to myclok; Inc other regs as req; update display; Arrive: x=secs to add;BUMPIT DEX Use fk}1 less TXA with set carry LDY #0 STY BUMPFG LDX #2 SEC;BLOOP ADC HOUR,X STA HOUR,X CMP TMAX,X BCCfl} DISPLAY;ROLOVR CPX #1 Doing mins? BNE FIXVAL No skip;; Fix clock error of -104" per; day. Adds 5" on odd houfm}rs; and 4" on even hours except; at 0159. Total is +104"; LDA HOUR No adj BEQ FIXVAL at 00:59; AND #$01 Add fn}3 or 4(+cy) ADC #$03 during STA BUMPFG following vblank;FIXVAL TYA y=a=0 STA HOUR,X Reset clock,x SEfo}C Leave cy set DEX BPL BLOOP;; Incr date: a=0 c=1; LDX MONTH ADC DAY Day=day+0+cy CMP DAYMAX-1,X Witfp}hin mon BCC GOTDAY limit? Yes go; LDY YEAR CPX #2 February? BNE ADDMON No; TYA AND #$03 Leap yr? BNfq}E ADDMON No add mon; LDA #29 Yes day=29 BNE GOTDAY;ADDMON LDA #1 Day=1 INX Mon=mon+1 CPX #13 fr} End year? BCC GOTMON No set mon; TAX Mon=1 INY Yr=yr+1 CPY #100 Cent? BCC NOCENT No; LDfs}Y #0 Yes roll;NOCENT STY YEAR;GOTMON STX MONTH;GOTDAY STA DAY;DISPLAY LDX CURSYS Skip LDY TDFLAG,X ifft} off BEQ X2RTS; LDX #21 LDA HOUR JSR BIN2DEC+1 LDA MINS JSR BIN2DEC LDA SECS JSR BIN2DEC; LDA DAY JSR Bfu}IN2DEC INX LDY MONTH LDA MONTXT-1,Y JSR SBYTE LDA MONTXT+12-1,Y JSR SBYTE LDA MONTXT+24-1,Y JSR SBYTE LDA Yfv}EAR;; a=byte x=line posit-1;BIN2DEC INX SEC LDY #$FF;SUB10 INY SBC #10 BCS SUB10; ADC #10 PHA TYA fw}JSR ISDEC PLA BPL ISDEC;; a=byte to convert; x=line posit-1;BIN2HEX INX PHA LSR A LSR A LSR A LSR A JSfx}R SCODE PLA AND #$0F;SCODE CMP #9+1 BCC ISDEC;; add offset A-F ADC #6 plus carry;ISDEC CLC;; Invertfy}; ADC #$90;; Store in tdline;SBYTE STA NEWTDL,X INX RTSet A-F ADC #6 plus carry;ISDEC CLC;; InvertdD SAVE #D1:KEYSUBS.M65; Last rev 29 Sep 93;; SAVE #D2:KEYSUBS.M65;;; PRINT #D1:KEYSUBS;;;;LOAD #D1:XL2.M65;; j{} Keys With [Select];; [Reset] Cold start; [Shift][Control][U] Update time/date;; Special Keys;; [j|}Control][Help] Swap systems; [Shift][Help] Toggle keys; [Control][Clear] Tdline off; [Shift][Clear] Tdline on;; j}} [Shift][Control] Keys;; [Esc] Clear screen; [Atari] Invert character; [Space] Toggle line case; [Caps] Toggle chj~}aracter case; [Bk Sp] Delete all right; [Tab] Save reset defaults; [Return] Kill screen;; [>] To end of text; [<] Tj}o left margin; [-] Screen color up; [=] Screen color down; [,] To word left; [.] To word right; [/]; [1]-[9] Select drij}ve display; [0] Select x-y display;; [D] Disk noise toggle; [E]; [F] Fast key toggle; [G]; [H]; [I] Invert line; [M]j}; [N] Key click toggle; [O] Screen/key code toggle; [P]; [Q] Advance to quote; [R]; [S] Fine scroll toggle; [T] Text lj}uminance; [W]; [Y]; No keys: a b c j k l v x z; ----------------------------; Look for special key; execute if found; j} arrive: a=kbcode, s valid; y=table length-1KCHECK CMP MYKTAB,Y BEQ EXECKY DEY BPL KCHECK RTS;EXECKY j} LDX #0 CPY #L.KTAB BCS CHGDRV; LDA KMSB,Y PHA LDA KLSB,Y PHA LDY CURSYS CLV RTS;CHGDRV LDA #$80DTLOOj}P JSR SBYTE Clear first 12 CPX #12 bytes in Tdline BCC DTLOOP Leave c set; TYA Calculate drive LDY j}CURSYS number to SBC #L.KTAB monitor and STA DRIVE,Y store it BEQ XY No drive if 0; LDX #1 Else stick Jj}MP ISDEC number in line;XY LDA #' LDX #5 JSR SBYTE LDA #' LDX #9 JMP SBYTE;; [I] Invert to end of text;j}INVEOT JSR FLAST BCC CCEXIT;IVT1 LDA (LINORG),Y EOR #$80 STA (LINORG),Y DEY BMI CURCHR; CPY COLCRS BCS Ij}VT1 BCC CURCHR;; [Space] Change case to eot;CASELN JSR FLAST BCC CCEXIT;CL LDA (LINORG),Y JSR SHIFTY STA (Lj}INORG),Y DEY BMI CURCHR; CPY COLCRS BCS CL;CURCHR INY y=colcrs;CC2 EOR #$80 STA OLDCHR;CCEXIT j}RTS;; [Del] Delete all right;DELEOT SEC LDA RMARGN SBC COLCRS TAY TXA a=x=0;DL STA (OLDADR),Y DEYj} BNE DL; LDA #$80 STA (OLDADR),Y BMI CC2;; * [Q] Move right to ";TOQUOT JSR SETORG y = colcrsFQ CPY RMARGNj} BCS RABORT; INY LDA (LINORG),Y AND #$7F Mask inverse CMP #2 Sbyte " BNE FQ BEQ ATRMGN;; * [Atari] Ij}nvert, advance;INVCHR LDA OLDCHR EOR #$80 BVC CCH2 always;; * [Caps] Change case, advance;CASECH LDA OLDCHRj} JSR SHIFT;CCH2 STA OLDCHR BVC MOVERT always;; [>] To space past eot;RT2EOT JSR FLAST Find last char;RTEXITj} CPY RMARGN Go if not BNE EXITRT at margn;ATRMGN DEY back from margn;EXITRT STY COLCRS;MOVERT LDA #j}RTAROW LDX KEYREP For repeatable STX SRTIMR keys on vblank; SKIPW;; [Esc] Clear screen;CLSCRN LDA #118;STASHj} STA CH;RABORT RTS;; * [.] Advance to word right;WORDRT JSR SETORG y=colcrs DEY;WDRT1 INY Move rigj}ht CPY RMARGN to space BCS RABORT if possible; LDA (LINORG),Y BNE WDRT1; DEY Point last spc;WDRT2 Ij}NY Move right CPY RMARGN to character BEQ ATRMGN Quit at margn; LDA (LINORG),Y BEQ WDRT2 Loop til char j} BNE ATRMGN back 1 and exit;; * [,] Back to word left;WORDLT JSR SETORG y=colcrs INY Check cur chrWL1 JSj}R CHARLT Find spc left BNE WL1WL2 JSR CHARLT Find chr left BEQ WL2WL3 JSR CHARLT Find spc left BNE WL3 BEQ Ej}XITRT;; Move one position left; Return: z valid for character; c clear if past left margin;CHARLT DEY CPY LMARGN j}LDA (LINORG),Y BCS COLXIT PLA PLA;; [<] Cursor to left margin;TOLMRG LDY RMARGN Do it with STY COLCRS wrap arj}ound BPL MOVERT;; * [=] Decrease screen color;SCRDEC DEC COLOR2 DEC COLOR2;; * [-] Increase screen color;SCRINCj} INX;; * [T] Increase text luminance;TXTINC INC COLOR1,X; LDA COLOR2 STA COLOR4 AND #$0F EOR COLOR1 STA COj}LOR1COLXIT RTS;; [F] Toggle fastkey;FASTKY LDA #48 CMP KRPDEL BNE NEWDEL; LSR A;NEWDEL STA KRPDEL LSR Aj} LSR A LSR A STA KEYREP RTS;; [S] Toggle fine scroll;SCROLL LDA FINE EOR #$FF STA FINE RTS;; [D] Togglej} disk noise;NOISE LDA SOUNDR EOR #$01 STA SOUNDR RTS;; [N] Toggle key noise;CLICK LDA NOCLIK EOR #$01 STAj} NOCLIK RTS;; [O] Toggle screen/key code; requires y=cursys;CODE LDA WATCOD,Y EOR #$FF STA WATCOD,Y RTS;; j}[Tab] Save defaults; requires y=cursys;SAVDEF LDA SOUNDR STA SOUNDS,Y LDA LMARGN STA LMGSAV,Y TYA ASL A ASj}L A ADC #3 TAY LDX #3STALP LDA TABMAP,X STA TABSAV,Y LDA COLOR1,X STA COLSAV,Y LDA KRPDEL,X STA KEYSAV,Y j} DEY DEX BPL STALP RTS;; [U] Set time date from; values stored in Prnbuf;; Requires [Select] key as; well as j}[Shift][Control][U];; dy,mo,yr,hr,mn,sc;TDLSET LDX #5 CPX CONSOL BNE TDLSXTTDLS2 LDA PRNBUF,X STA DATSAV,X Dj}EX BPL TDLS2TDLSXT RTS;; Point Linorg to start; of line at rowcrs; Return: y=colcrs;SETORG LDY COLCRS;; use zj}ero page wrap around to; save a few bytes here;SETOR0 DEX x=$FF SECSETOR1 LDA OLDADR+1,X SBC COLCRS+1,X j} STA LINORG+1,X INX BEQ SETOR1 CLV RTS;; Point y to last non-space; return: c=0 if failed;FLAST JSR SETOR0 j}LDY RMARGN INY;FLST1 DEY Find char CPY COLCRS left BCC FLQUIT; LDA (LINORG),Y BEQ FLST1;FLQUIT RTj}S;; Shift/unshift letter at y;SHIFTY LDA (LINORG),Y;; Shift/unshift letter in a;SHIFT PHA AND #$3F CMP #'A-32j} BCC NOTLTR; CMP #'Z+1-32 BCS NOTLTR; PLA EOR #$40 RTS;NOTLTR PLA RTS;; Move one position left; Returnj}: z valid for character; c clear if past left margin;;CHARLT; DEY; CPY LMARGN; LDA (LINORG),Y; RTS; -------------j}----------; Keyboard jump table.; Must be in same order as; key table in cnf file.; First 8 must always be; first as thej}y repeat.;KMSB .BYTE >SCRINC-1 ; - 206 .BYTE >SCRDEC-1 ; = 207 .BYTE >TXTINC-1 ; t 237 .BYTE >TOQUOT-1 ; j}q 239 .BYTE >WORDLT-1 ; , 224 .BYTE >WORDRT-1 ; . 226 .BYTE >CASECH-1 ; cap 252 .BYTE >INVCHR-1 ; ata 231;j} .BYTE >SAVDEF-1 ; tab 236 .BYTE >CLICK-1 ; n 227 .BYTE >NOISE-1 ; d 250 .BYTE >FASTKY-1 ; f 248 .BYTE j}>SCROLL-1 ; s 254 .BYTE >CODE-1 ; o 200 .BYTE >CLSCRN-1 ; esc 220 .BYTE >TOLMRG-1 ; < 246 .BYTE >RT2EOT-1j} ; > 247 .BYTE >INVEOT-1 ; i 205 .BYTE >CASELN-1 ; spc 225 .BYTE >DELEOT-1 ; del 244 .BYTE >TDLSET-1 ; u 2j}03;KLSB .BYTE j} 247 .BYTE hy; SAVE #D1:STOW.M65; Last rev 22 Sep 93;; SAVE #D2:STOW.M65;;; PRINT #D1:STOW;;;; LOAD #D1:XL2.M65;JIFFY .BYn}TE 60;; Data for clock (max values+1);TMAX .BYTE 24,60,60 hh,mm,ss;DAYMAX .BYTE 32,29,32,31 days per .BYTE 32,31,n}32,32 month .BYTE 31,32,31,32; -----------------------------;; User selected system defaults; modifiable in cnf file;n}DATSAV .BYTE 29,9,93 dd,mm,yyMYCLOK .BYTE 13,0,0 hh,mm,ss;MONTXT .SBYTE "" .SBYTE "" .SBn}YTE "";SOUNDS .BYTE 1,1 off if 0LMGSAV .BYTE 2,2TABSAV .BYTE 0,0,0,0 .BYTE 0,0,0,0COLSAV .BYTE 1n}2,0,0,0 .BYTE 12,0,0,0KEYSAV .BYTE 24,3,1,0 Del,Rep,Clik,Helpfg .BYTE 24,3,1,0TDFLAG .BYTE 1,1KSTATS .BYTE 1,1 n} On=1 off=0DRIVE .BYTE 1,1WATCOD .BYTE $FF,$FF Scode=0 Kcode=$FF;MYKTAB; Repeatable keys; (shift+control keycodn}es); - = t q .BYTE 206,207,237,239;; [ ] cap inv .BYTE 224,226,252,231L.KREP = *-MYKTAB;; n}Non-repeatable keys;; tab n d f .BYTE 236,227,250,248;; s o esc < .BYTE 254,200,220,246;; n} > i spc del u .BYTE 247,205,225,244,203L.KTAB = *-MYKTABL.CNF = *-DATSAV End of cnf; ------------------------; n}Drive keys 0-9 must follow ktab .BYTE 242,223,222,218,216 .BYTE 221,219,243,245,240L.DRVKEY = *-MYKTAB;; Used on Resetn} to retake vectors;MYVBIA .WORD MYVBI Sys a .WORD MYVBD .WORD MYVBI Sys b .WORD MYVBD;; Reset loop stores 4 bytesn} so; place Dos flags between systems; here. They get stored to Memlo; +2 and +3 which are not used on; reset. If sys b, tn}he 2 bytes at; Oisavl are similarly stored.;MEMLOA .WORD NEWMEM Sys a;SPARTA .BYTE $FF,$FF Sparta=0; .WORD NEWMEMn} Sys b;OISAVL .BYTE OLDINI Sys a .BYTE >OLDINI Sys b;; Usedn} by key on/off routine;OLDKSL .BYTE 0,0 Os key irqMYKSVL .BYTE MYKIRQ .BYTE >MYKIRQ;; System a low ram addresses;ADSAVE .BYTE XITINT .BYTE >EXSWAP .BYTE >DLIST n} .BYTE >NEWTDL;; System b low ram addresses; .BYTE XITINT .BYTE >EXSWAP .BYTE >DLIST .BYTE >NEWTDL;; saved on entry to swap;NMISAV .BYTE $E0,$E0PBSAVE *= *n}+2CBSAVE *= *+2SPSAVE *= *+2 >DLIST .BYTE >NEWTDL;; saved on entry to swap;NMISAV .BYTE $E0,$E0PBSAVE *= *l# .OPT NO LIST,NO MLIST .OPT NO CLIST,NO EJECT; SAVE #D1:XFIX.M65; Last rev 19 Nov 93;; SAVE #D2:XFIX.M65;;; PRr}INT #D1:XFIX;;;; ASM ,,#D1:XFIX.OBJ; .IF .NOT .DEF DOSINI .INCLUDE #D1:EQUATES.M65 .INCLUDE #D1:XL2REFS.M65 .ENDr}IF; *= $F0ZPORTB *= *+1ZSTACK *= *+2ZINDEX *= *+2ZPAGES *= *+1ZBANK3 *= *+1ZSPARTA *= *+1ZCBANK *= *+r}1; *= $3000;INIT LDA #$60 STA INIT LDA PORTB STA ZPORTB JSR NOINTS STY SDMCTL STY DMACTL; LDX #15LOOPBr} LDY TTABLE,X Find bank 3 STY PORTB control value CPY REF3 BEQ FOUND1; DEX BPL LOOPB;ABORT DEC NMIEN CLIr} JMP EXIT;FOUND1 STY ZBANK3 Save control bank STY TOINT+1 Start fix of low TYA code INY STY TORESET+1r}; SBC #4 Verify values CMP REF2 for banks 2,1,0 BNE ABORT Quit if any err; SBC #4 CMP REF1 BNE ABORT;r} SBC #4 CMP REF0 BNE ABORT; INC PORTB os on in bank 3 DEC NMIEN ints on CLI JSR CLOSE7 x=$70;; Set up ir}ocb 7 for status; and iocb 0 for ok message; LDY #9LOOPA LDA DFDATA,Y STA ICCOM+$70,Y LDA PRDATA,Y STA ICCOM,Y r} DEY BPL LOOPA; STY ZSPARTA Default not SDos; JSR GOCIO Exec status BPL OPENIT; CPY #167 BNE CNFDUN;OPENITr} LDA #3 JSR SETCOM Open file BMI CLOSIT; LDA # TABBUF buffer STA ICBAH,Xr} LDA #7 JSR SETCOM BMI CLOSIT;; Got cnf, set defaults; LDY #L.CNF-1LOOPC LDA CNFBUF,Y STA DATSAV,Y DEY BPr}L LOOPC;CLOSIT JSR CLOSE7;CNFDUN LDA $0700 CMP #'S BNE OVRSDS; INC ZSPARTA DEC PORTB os off LDY #0 JSRr} VKEYON key off for now;OVRSDS JSR NOINTS LDA #$FDPBREST STA PORTB LDY #8 Assume no cart LDA GINTLK Checkr} assumption BEQ GOTBNK Go if true; LDY $AFFF Save bank in y STA $D508 Kill cart;GOTBNK LDX $A000 See if anyr} Basic INC $A000 CPX $A000 BEQ GOTBAS; STX $A000 CLC;GOTBAS STA $D500,Y restore cart STY ZCBANK ROL A r} a=gintlk*2+cy;; cart+bas: a=3 cart only: a=2; bas only: a=1 no roms: a=0; only 1 is valid for basic on; TAX LDr}A #$02 For basic flag STA ZPAGES DEX BNE FLAGIT was not 1; AND ZPORTB If bas was on a=0;FLAGIT STA BASICF r}on=0 off=2 ORA ZPORTB If off set b1=1 STA ZPORTB Fix Portb later; LDX # <$0700 STX ZINDEX LDA # >$0700 STA ZINr}DEX+1; LDY ZSPARTA BEQ GETLDA;; Look for ver 2.3 and fix; stack if found but don't; flag it as Sparta; LDY #$0BVr}23CHK CMP $0700,Y BNE OVRSTK; DEY DEY BPL V23CHK;; Find Lda Address,X;GETLDA LDA (ZINDEX,X) x=0 thruout CMr}P #$BD BEQ GOTLDA;NXTBYT INC ZINDEX BNE GETLDA INC ZINDEX+1 DEC ZPAGES BPL GETLDA BMI OVRSTK Abort, not founr}d;; Check next op is Sta Portb;GOTLDA LDY #5STAPB? LDA (ZINDEX),Y CMP PBREST-3,Y Go back if BNE NXTBYT any failr} test DEY else check CPY #2 all 3 bytes BNE STAPB?;; Get stack address; LDA (ZINDEX),Y msb STA ZSTAr}CK+1 DEY LDA (ZINDEX),Y lsb STA ZSTACK;; Correct all eight values; LDY #7FIXSTK LDA (ZSTACK),Y ORA BASICF Sr}TA (ZSTACK),Y DEY BPL FIXSTK;OVRSTK LDY ZBANK3 INY STY PORTB bank 3, os on; LDY #2LOOPD LDA DOSINI-1,Y Fir}x locode STA OLDINI,Y addresses LDA SYSVBV,Y Kill any other STA OLDIVB,Y imm vblank LDA VVBLKD-1,Y STA OLDDVB,Y Dr}EY BNE LOOPD; CLC LDA SDLSTL set jmp in ADC #3 dlist STA TDLXIT+1 TYA ADC SDLSTH STA TDLXIT+2; LDX r}CURSYS; LDA ZCBANK STA CBSAVE,X LDA #$C0 STA NMISAV,X; LDA VKEYBD STA OLDKSL,X LDA VKEYBD+1 STA OLDKSH,X;r} LDA MEMLO STA DOSINI STA OISAVL,X LDA MEMLO+1 STA DOSINI+1 STA OISAVH,X; DEC PORTB bank 3, os off; LDA ZSr}PARTA STA SPARTA,X BNE OVRVEC; LDX # TEMPVB LDA #6 STA Cr}DTMV3 JSR SETVBV LDA #$C0 STA NMIEN CLILOOPZ LDA CDTMF3 BNE LOOPZ; LDA ZBANK3 STA PORTB LDA #20 Add 2r}0" for boot STA BUMPFG;EXIT LDA ZPORTB STA PORTB LDX #0 JSR CIOV LDA #34 STA SDMCTL RTS; -----------------r}---;; Temp. ivblank;TEMPVB JSR NOINTS LDA PORTB LDY ZBANK3 Ext bank 3 STY PORTB LDY CURSYS STA PBSAVE,Y TSr}X TXA STA SPSAVE,Y JSR NOBOOT Fix low ram JMP FIXUP Fix monitor; --------------------;TAKESV LDA #$4C JSR Sr}SV TXA ADC DOSINI JSR SSV LDA #0 ADC DOSINI+1SSV STA VGETTD,Y INY RTS;SETMYV ADC DOSINI JSR SMV TYAr} ADC DOSINI+1SMV STA MYVBIA,X INX RTS;SETADR ADC DOSINI STA ADSAVE,X STA LMSCAN+1 TYA ADC DOSINI+1 STA r}ADSAVE+4,X STA LMSCAN+2 INX RTS;; Cio access for cnf;CLOSE7 LDA #12SETCOM LDX #$70 STA ICCOM,XGOCIO JSR Cr}IOV RTS;; Execute command line; Enter y=0 if td, 2 if key;DOCMD TYA ASL A ASL A a=0 or a=8 TAX LDA TDFr}LAG,Y BEQ TURNOF LDA #'N STA CMD+5,X LDA #0TURNOF LDY #10 STA (DOSVEC),Y LDY #62 DEXLOOPL INX INY LDAr} CMD,X STA (DOSVEC),Y BPL LOOPL JSR VXCOMLI;; Kill all interrupts;NOINTS SEI LDY #0 STY NMIEN RTS; -------r}-------------TTABLE .BYTE $0C,$2C,$4C,$6C .BYTE $0E,$2E,$4E,$6E .BYTE $8C,$AC,$CC,$EC .BYTE $8E,$AE,$CE,$EEDFDATA r} .WORD 13 .WORD FSPEC .WORD 0 .WORD L.CNF+4 .WORD 4PRDATA .WORD 11 .WORD IMSG .WORD 0 .WORD L.IMSG .WORD 1r}2CMD .BYTE "TD OFF",155 .BYTE "KEY OFF",155FSPEC .BYTE "D:XL2.CNF"IMSG .BYTE 155 .BYTE "XL2 re-installed" .BYr}TE 155AMSG .BYTE 155L.IMSG = *-IMSG .BYTE "亠 XL2 handler not found!" .BYTE 155,155L.AMSG = *-AMSG; .INCLr}UDE #D1:LOCODE.M65;TABBUF *= *+4CNFBUF *= *+100; *= ICCOM .WORD 11 .WORD AMSG .WORD 0 .WORD L.AMSG .WORD r}12; *= INITAD .WORD INIT .OPT NO LIST .END00; *= ICCOM .WORD 11 .WORD AMSG .WORD 0 .WORD L.AMSG .WORD p4 .OPT NO LIST,NO MLIST .OPT NO CLIST,NO EJECT; SAVE #D1:SAVECNF.M65; Last rev 29 Sep 93;; SAVE #D2:SAVECNF.M65;;w}; PRINT #D1:SAVECNF;;;; ASM ,,#D1:SAVECNF.OBJ; .IF .NOT .DEF DOSINI .INCLUDE #D1:EQUATES.M65 .INCLUDE #D1:XL2REFw}S.M65 .ENDIF; *= $3000INIT LDA #$60 STA INIT SEI LDA #0 STA NMIEN LDA PORTB STA INTSON+1; LDX #15LOOPw}A LDA TTABLE,X value with os STA PORTB off CMP REF3 BEQ FOUND1 DEX BPL LOOPA;ABORT JSR INTSON LDX #8LOOPw}B LDA ABDATA-1,X STA ICCOM-1,X DEX BNE LOOPB JMP CIOV;; Xbank 3, os on;FOUND1 INC PORTB LDX #3 JSR SUB4 w} CMP REF2 BNE ABORT JSR SUB4 CMP REF1 BNE ABORT JSR SUB4 CMP REF0 BNE ABORT JSR SUB4 save last val; LDYw} CURSYS JSR SAVDEF LDY #L.CNF-1LOOPC LDA DATSAV,Y STA CNFBUF,Y DEY BPL LOOPC; JSR INTSON;; Main ram, entry w}status; JSR CLOSE7 LDA # FSPEC STA ICBAH,X LDA #36 unprotect JSR SETCOM; LDY w}#9LOOPD LDA DEDATA,Y disk err msg STA ICCOM,Y setup LDA DFDATA,Y cnf data for STA ICCOM+$70,Y open DEY BPL LOOPDw }; JSR SETCOM Open #7,8,0,fspec BMI DONE Abort on err here; LDA # TABBUF STA ICBAw }H,X LDA #11 JSR SETCOM Bput #7,tabbuf,103 BMI DONE; LDY #5LOOPE LDA OKDATA,Y Set up success STA ICBAL,Y messagw }e DEY BPL LOOPE;DONE JSR CLOSE7 LDX #0 BEQ GOCIO; --------------CLOSE7 LDA #12SETCOM LDX #$70 STA ICCOM,w }XGOCIO JMP CIOV; --------------INTSON LDA #$FF STA PORTB LDA #$E0 STA NMIEN CLI RTS; --------------SUB4 w }STA TABBUF,X INC TABBUF,X DEX SBC #4 RTS; -------------------DEMSG .BYTE 155 .BYTE " Disk error"OKMSGw} .BYTE 155L.DEMSG = *-DEMSGFSPEC .BYTE "D:XL2.CNF" .BYTE 155 .BYTE "Created"AMSG .BYTE 155L.OKMSG = *-OKMSG .w}BYTE " XL2 monitor not found" .BYTE 155L.AMSG = *-AMSG;TTABLE .BYTE $0C,$2C,$4C,$6C .BYTE $0E,$2E,$4E,$6E w} .BYTE $8C,$AC,$CC,$EC .BYTE $8E,$AE,$CE,$EE;ABDATA .WORD 11 .WORD AMSG .WORD 0 .WORD L.AMSG;DEDATA .WORD 11w} .WORD DEMSG .WORD 0 .WORD L.DEMSG .WORD 12;OKDATA .WORD OKMSG .WORD 0 .WORD L.OKMSG;DFDATA .WORD 3 opw}en .WORD FSPEC .WORD 0 .WORD L.CNF+4 .WORD 8;TABBUF *= *+4CNFBUF *= *+L.CNF; *= RUNAD .WORD INIT .OPT Nw}O LIST .ENDEC .WORD 0 .WORD L.CNF+4 .WORD 8;TABBUF *= *+4CNFBUF *= *+L.CNF; *= RUNAD .WORD INIT .OPT Nt .OPT NO LIST,NO MLIST .OPT NO CLIST,NO EJECT; SAVE #D1:COPYSYS.M65; Last rev 29 Sep 93;; SAVE #D2:COPYSYS.M65;;{}; PRINT #D1:COPYSYS;;;; ASM ,,#D1:COPYSYS.OBJ; .IF .NOT .DEF DOSINI .INCLUDE #D1:EQUATES.M65 .INCLUDE #D1:XL2REF{}S.M65 .ENDIF; *= $B0BTABLE *= *=4ZPORTB *= *+1ZNEWSYS *= *+1ZCBANK *= *+1; *= $3000; RTS;INIT SEI{} LDY #0 STY NMIEN STY SDMCTL STY DMACTL LDA PORTB STA ZPORTB; LDX #15 STX CRSINHFLOOP LDY TTABLE,X STY P{}ORTB CPY REF3 BEQ FOUND1 DEX BPL FLOOP;ABORT LDA ZPORTB STA PORTB LDA #$E0 STA NMIEN CLIPRINT LDX #0 {} JSR CIOV STX CRSINH RTS;FOUND1 TYA STA BTABLE+3 SBC #4 CMP REF2 BNE ABORT STA BTABLE+2 SBC #4 CMP REF1{} BNE ABORT STA BTABLE+1 SBC #4 CMP REF0 BNE ABORT STA BTABLE; INC PORTB os on LDA # IMSG STA ICBAH LDA #L.IMSG STA ICBLL JSR PRINT; LDA $AFFF LDX GINTLK BNE GOTCBK LDA #8GOTCBK STA ZCB{}ANK STA $D508 kill cart; LDA CURSYS TAX EOR #1 TAY STA ZNEWSYS; LDA ZCBANK STA CBSAVE,Y LDA #$E0 STA {}NMISAV,Y; LDA TDFLAG,X STA TDFLAG,Y LDA KSTATS,X STA KSTATS,Y LDA DRIVE,X STA DRIVE,Y LDA WATCOD,X STA WATCO{}D,Y LDA SPARTA,X STA SPARTA,Y LDA OISAVL,X STA OISAVL,Y LDA OISAVH,X STA OISAVH,Y LDA OLDKSL,X STA OLDKSL,Y {} LDA OLDKSH,X STA OLDKSH,Y LDA MYKSVL,X STA MYKSVL,Y LDA MYKSVH,X STA MYKSVH,Y; JSR SAVDEF go with y=newsys; { } LDA ZNEWSYS ASL A ASL A PHA TAY EOR #$04 TAX; LDA MEMLOA,X STA MEMLOA,Y LDA MEMLOA+1,X STA MEMLOA+1,YL{!}OOPA LDA MYVBIA,X STA MYVBIA,Y INX INY TYA AND #$03 quit when y=4 BNE LOOPA or y=8; PLA ASL A TAY {"} EOR #$08 TAXLOOPB LDA ADSAVE,X STA ADSAVE,Y INX INY TYA AND #$07 quit when y=8 BNE LOOPB or y=16; T{#}AX DEC PORTB os off JSR COPY m3 => x3 JSR COPY m3 => x3 STX BUMPFG x=2; LDY BTABLE+2 JSR YCOPY m2 => {$}x2 LDY #$FF JSR YCOPY m1 => m2 LDY BTABLE+1 JSR YCOPY m2 => x1 LDY BTABLE+2 JSR YCOPY x2 => m2; LDA ZPOR{%}TB STA PORTB LDX ZCBANK STA $D500,X LDY # TEMPVB LDA #$40 STA NMIEN LDA #6 JSR SETVBV CLI{&} RTS; -------------------TEMPVB SEI LDX #0 STX NMIEN LDA PORTB; LDY BTABLE+3 bank3 STY PORTB; LDY ZNEWSYS{'} STA PBSAVE,Y STX SDMSAV TSX PHA TXA STA SPSAVE,Y LDA #34 STA SDMCTL LDA MYVBIA STA VVBLKI LDA MYVBIA+1{(} STA VVBLKI+1; LDY BTABLE bank0 LDX #6 JSR YCOPY; PLA STA PORTB LDX #5 STA WSYNCLOOPZ DEX BNE LOOPZ {)}LDA #$E0 STA NMIEN JMP XITVBV;; Bank copy subroutine; Entry: x=table offset; y=portb; Exit: x=table offset+1{*}; y=portbYCOPY STY PORTBCOPY LDA STBL,X STA SRCE+2 LDA DTBL,X STA DEST+2 LDY #0;SRCE LDA $FF00,Y Pa{+}ge loopDEST STA $FF00,Y INY BNE SRCE; INC SRCE+2 Bank loop INC DEST+2 DEC PAGES,X BNE SRCE; LDY PORTB I{,}NX RTS; ------------------------; Source msb's for copy;STBL .BYTE $C0 m3 => x3 os low .BYTE $D8 m3 => x3 os hi{-}gh .BYTE $80 m2 => x2 .BYTE $40 m1 => m2 .BYTE $80 m2 => x1 .BYTE $40 x2 => m2 .BYTE $00 m0 => x0;; Des{.}tination msb's;DTBL .BYTE $40 m3 => x3 .BYTE $58 m3 => x3 .BYTE $40 m2 => x2 .BYTE $80 m1 => m2 .BYTE $40{/} m2 => x1 .BYTE $80 x2 => m2 .BYTE $40 m0 => x0;; Page counts;PAGES .BYTE $10 m3 => x3 .BYTE $28 m3 => {0}x3 .BYTE $40 m2 => x2 .BYTE $40 m1 => m2 .BYTE $40 m2 => x1 .BYTE $40 x2 => m2 .BYTE $40 m0 => x0;IMSG{1} .BYTE 155 .BYTE "System duplicated"AMSG .BYTE 155L.IMSG = *-IMSG .BYTE "亠 XL2 handler not found!" .BYTE {2}155L.AMSG = *-AMSG;TTABLE .BYTE $0C,$2C,$4C,$6C .BYTE $0E,$2E,$4E,$6E .BYTE $8C,$AC,$CC,$EC .BYTE $8E,$AE,$CE,$EE{3}; *= ICCOM .WORD 11 .WORD AMSG .WORD 0 .WORD L.AMSG; *= INITAD .WORD INIT .OPT NO LIST .ENDE,$AE,$CE,$EExo; SAVE #D1:XL2REFS.M65;;; SAVE #D2:XL2REFS.M65;;; PRINT #D1:XL2REFS.SRC;L.LOCODE = 156STAGE1 = $5000CURSYS 5} = $5011BUMPFG = $5061SDMSAV = $506BFIXUP = $51ACREF0 = $522AREF1 = $5278REF2 = $52236}REF3 = $529DNOBOOT = $52B0MYCODE = $52EEFIXCLK = $53D5SAVDEF = $5637DATSAV = $56DD *7}= DATSAV *= *+3MYCLOK *= *+3MONTXT *= *+36SOUNDS *= *+2LMGSAV *= *+2TABSAV *= *+4 *= 8} *+4COLSAV *= *+4 *= *+4KEYSAV *= *+4 *= *+4TDFLAG *= *+2KSTATS *= *+2DRIVE *= *+2W9}ATCOD *= *+2MYKTAB *= *+8L.KREP = *-MYKTAB *= *+13L.KTAB = *-MYKTABL.CNF = *-DATSAV :} *= *+10L.DRVKEY = *-MYKTABMYVBIA *= *+4 Sys a imm/def *= *+4 Sys b imm/defMEMLOA *= *+2 Sy;}s a lomemSPARTA *= *+2 *= *+2 Sys b lomemOISAVL *= *+2OISAVH *= *+2OLDKSL *= *+2MYKSVL *= *<}+2OLDKSH *= *+2MYKSVH *= *+2; xitint, exswap,dlist,newtdlADSAVE *= *+4 Sys a lsbs *= *+4 msbs=} *= *+4 Sys b lsbs *= *+4 msbsNMISAV *= *+2PBSAVE *= *+2CBSAVE *= *+2SPSAVE *= *+2>}ENDHI = *-1 Sys b lsbs *= *+4 msbsNMISAV *= *+2PBSAVE *= *+2CBSAVE *= *+2SPSAVE *= *+2| .OPT NO LIST .OPT OBJ; SAVE #D1:TSETUSR.M65; Last rev 07 May 94;; SAVE #D2:TSETUSR.M65;;; PRINT #D1:TSETUSR;@}; A usr routine to get and set; time and date with xl2 installed;; Syntax:;; x=usr(adr(tset$),adr(td$),0) gettd;; x=uA}sr(afr(tset$),adr(td$),1) settd; the 2nd par is anything>0;; Note 1: there is no check on the; number of or values of tB}he params;; Note 2: if the TD handler cannot; be found the routine aborts and; returns a non-zero value so the; it can sC}afely be included in any; program for use without xl2;; Note 3: turbo's time$= function; will not set the xl2 clock;; SD}ample usage to adjust the time; assuming date is already correct;; 10 DIM TSET$(117),TD$(6):REM init; 20 TSET$="..":REM aE}s in TSET.LST; 30 TD$="DMYhms":REM establish length; 31 REM; 32 REM DAY=day of month (1-31); 33 REM MON=month of year (1-F}12); 34 REM YEAR=current year (0-99); 35 REM; 36 HOUR=current hour (0-23); 37 MINS=current minutes (0-59); 38 SECS=curreG}nt seconds (0-59); 40 REM; 50 REM read current setting; 51 REM; 60 X=USR(ADR(TSET$),ADR(TD$),0); 70 IF X=0 THEN 100; 71H} REM; 80 PRINT "Handler not found"; 90 GOTO 140; 91 REM; 92 REM set new time; 93 REM; 100 TD$(4)=CHR$(HOUR); 110 TD$(5I})=CHR$(MINS); 120 TD$(6)=CHR$(SECS); 130 X=USR(ADR(TSET$),ADR(TD$),1); 140 END;FR0 = $D4DATSAV = $56DDREF0 = $522AREFJ}1 = $5278REF2 = $5223REF3 = $529DFIXCLK = $53D5PORTB = $D301NMIEN = $D40E; *= $B0STRADR *= *+2; *= $7000STARTK} PLA number of pars=2 TAY BNE GOTPAR1;PARERR STY FR0+1 return error 255 DEY for parameterL} STY FR0 error RTS;GOTPAR1 PLA STA STRADR+1 get msb PLA STA STRADR and lsb DEY BEQ PARERR only M}1; PLA msb will be 0 PLA lsb is 0 or non-0 DEY BEQ GOTPAR2;FIXSTK PLA Clear extrasN} from PLA stack DEY BNE FIXSTK BEQ PARERR;GOTPAR2 SEI Kill all ints STY NMIEN TAX O} Save flag LDA PORTB PHA; LDY #TTABLE-START+15FLOOP LDA (FR0),Y Look for the xl2 STA PORTB handler. Only P}the CMP REF3 current installation BEQ FOUND will match; DEY CPY #TTABLE-START-1 BNE FLOOP BEQ EXIT;; Q}table of possible values for; xl2 control bank searched from; xe banks first and working back;TTABLE .BYTE $0C,$2C,$4C,R}$6C .BYTE $0E,$2E,$4E,$6E .BYTE $8C,$AC,$CC,$EC .BYTE $8E,$AE,$CE,$EE;FOUND SBC #4 Now verify the CMP REF2 S} next three Portb BNE EXIT values; SBC #4 If any fail the CMP REF1 handler is corrupted BNE EXIT or nT}ot there; SBC #4 Note fr0 has to be CMP REF0 greater than 255 as BNE EXIT strings not on page 0; LDA #0 U} Flag success STA FR0 STA FR0+1; LDY #5 TXA Recover entry flag BNE SETTD Any>0 means set it;GETTDV} LDA DATSAV,Y Copy td to callers STA (STRADR),Y string DEY BPL GETTD BMI EXIT;SETTD LDA (STRADR),Y Copy strW}ing to td STA DATSAV,Y DEY BPL SETTD JSR FIXCLK and set the clock;EXIT PLA Fix things up STA PX}ORTB and exit LDA #$E0 STA NMIEN CLI RTS .OPT LIST ;LAST = *-1;BSAVE #D1:TSET.OBJ <7000,LAST .OPT NO Y}LIST .ENDnd exit LDA #$E0 STA NMIEN CLI RTS .OPT LIST ;LAST = *-1;BSAVE #D1:TSET.OBJ <7000,LAST .OPT NO 1:`16)ҩR 3xԠ ;9 <9w Ӆ0Ӡծ*%000[}ɽ 0#:1 H?e6ӭP:?e6ӌPPe6ә:P):\}P@ 3hz9JJ i? 08 3ȱ 3 3&" }8)  3e9 34$ /Lj3ȱ 0"EAL]}N٥΢C8 3 3\8 3X9Z9 3(88 3 3Z9 38 e9 38 3 3$0 Շ^}3 3z9it83i93i:>959i9C9$H63973883839393 M5:98 o9P9H ȱ p9Q99 =9$0:9 _}3;9<9 R60өX`Lh9o8f88` H6ʈh`!7D+7E57HI BLV6 3 3xԬ`}Z9:ӊ@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdea}fghijklmnopqrstuvwxyz{|}~L3z9L3Z9:Ӣ*6@Ji@Ȍb} @Ȍ@Ȅ񩀅2J32@e223 @8 @@N@n@( 2i?32@2P620L3H/U6hc}23h0h10108284395 ?66e46ȱ6e56 ?6 6e46L5 ?6 M6e46e56L5 ?6ȱ6e466e56L5;(-d}829382:1H0HU6/`8e:8e992e:2e338293:82 M66 M676`<<=`e}ϣ͡cgkoCGKO#'+/ aeimAEIM!%)- L0 1024k RD Ef}MAIN 64 128 192 256 320 384 448 512 576 640 704 768 832 896 9601024?q1Jc|77888888882Mega XE RAMdisk verg} 4.5(c) 1993 by John PickenSyntax RD Dx: [/[N][E][A]]Where x = drive (1-8) N = do not format E = reserve 64h}k A = aux RAMdiskE and A may be repeatedas required, to reserveadditional 64k blocks.Extended RAM kResi}erved RAM kNo RAM Available for RDD1: RAMdisk Size k Formatting RAMdiskD8: RAMdisk Size k Drivej} redirection ON Handler not Reset-proofC3F3P3S3\9|9999999993:6:9:N:Q:T::::c3I3>9e3:V3HC9 :k}`I1L1Z98 `1@99xԅ423ӄ0$1PD N :20oO 2:0a""l}:: :45@0!S2P ͩ:jJ:j2ȩ2,0R:PW,0өԘX`0=:I: i:Ӈm}2ӑ4Pьe: i:Y:0ӱ4ӑ2P 5 5*,05*m99hh5JJf4 @5:Ӡ`(0=:I: i:ӄm01x`0R 0 6i 8ȱ 7i9 6ٕ108ٟ1$ i? 0 0ȱ 0 0, 0RX`" ]1)8ɋo} ov1fw1x16 6L0D0E0H BILVH`0110M13RAMdisk Renumber UtilityVer. 4.5 by Johp}n Pickenuse with Mega XE RD v4.5 Syntax: RDNUMBER Dx: where x is drive (1-8)RAMdisk responds as D1:Drive redirectioq}n is ON Ġ I1L118 `1@disk responds as D1:Drive redirectioWNew Utilities For Your XL/XE(Part 3)by John PickenAfter writing the first version of XL2, I realized that a common Spartas}/MYDOS RAMdisk would make XL2 itself far more useful. First attempts at this were written on a 320XE and, allowing for XL2 RAt}M, left twelve extra banks to play with so I went with the old standby first written by Claus Bucholz--two single density or u}one double density RD(s). For the 256XL, I wrote a 1050 emulator which simply told lies about the nonexistant final 16 sectorv}s.The problems with these approaches were several: They required separate versions for 256k and 320k machines. They needed w}seven patches into MYDOS plus another into DUP. Using MYDOS format meant no time/date information with Sparta and, what reallx}y burned me, the 320k version wasted 12k. I might have put up with these but then I got a 1088k XE....The first thing I disy}covered was that there were no good RD handlers for anything past 512k. For starters some were written in compiled Action! Whz}ile that's probably the closest to true machine language you're going to get with any compiler, it's still not machine langua{}ge. Additionally with some, syntax was not standard Sparta stuff. Like it or not the syntax defined by ICD is the de facto st|}andard and users should not have to learn a whole new one.The objects then, in coming up with a new RD handler were to allo}}w MYDOS access, to ensure compatibility with ICD syntax, to make it completely machine language, to make it as fast as possib~}le, and to use the absolute minimum possible of low RAM. I think I've done it.RD.COMRD for SpartaDOS version 2+, works wi}th any amount of XE-compatible memory up to one megabyte and provides some features you won't get with other handlers. First,} it only uses main RAM it actually needs. This means that on a 130XE it uses 60 bytes less than it does on a mega XE. With ot}her upgrades savings are comparable: for every 64k less than one meg you save four bytes.The resident handler operates with}out a buffer which saves a full page (256 bytes) of low memory. Coincidentally this method, and use of self-modifying code, e}nables it to access sectors 40-50% faster than ICD handlers.The program has been successfully tested on 1088k, 320k, and 25}6k (Rambo) machines as well as on a stock 130XE. It should work with all XE-compatible upgrades as the memory test does not q}uit until all possible banks have been tested.If installed using normal Sparta syntax you get the expected results. The onl}y exception occurs on a 512k+ computer with BASIC switched on where RD size will be twice as large (2048 sectors) because the} RAM test picks up the two banks mentioned with the bank table in Part 1.Any time you run RD, it corrects the BASIC bit pro}blem described in Part 1. When you run it correctly, you get a report of the installation. If called with incorrect syntax th}e program responds with the following:Mega XE RAMdisk Handlerver. 4.5 by John PickenSyntax RD Dx: [/[N][E][A]]Where }x = drive (1-8) N = do not format E = reserve 64k A = aux RAMdiskE and A may be repeatedas required, to }reserveadditional 64k blocks.THE NEW STUFFObviously there are some extra options here. First you may reserve more extend}ed RAM by repeating the "E" switch. For example: "/EE" reserves the 130XE banks plus the next 64k. You can also opt to instal}l an auxillary RD accessible to both SpartaDOS and (modified) MYDOS 4.51. To this end, the "A" switch works exactly like the }"E" switch.RAM is reserved in the same order as in the bank table, starting with the 130XE banks. "E" banks preceed "A" ban}ks which, in turn, preceed the main RD banks. Order of switches is unimportant, "/AENEA" produces the same result as "/NEEAA"}.When used with N, the number of E's and A's must be the same as on original installation. You could however, change all or} some of the E's to A's or vice versa as long as the total remains the same (you would of course have to format the auxillary} RD if installed).Finally, there is an option which is not displayed since it should not be used by anyone who has not read} and understood this documentation. "L" (lowest memory) causes installation without a Reset handler. This saves another 14 by}tes of low memory (not much but I'm a miser that way).To use "L" you must install a permanent handler at low memory (XL2, T}DLINE, etc.) after the RD. From then on the RD is protected by the second handler's code. But until then, Reset will permit o}verwrite of the RD. Since Sparta's disk vector is pointing to this area, who knows what could result? If you don't understand} the implications of "L" do not use it.FORMATTINGAnytime either RD is formatted under Sparta, all RAM in its assigned ran}ge is cleared to zero. This permits use of SCOPY to duplicate the RD to/from a file or disk without filling unused sectors wi}th garbage.The main RD is always formatted when installed unless the "N" switch is included. Formatting on installation tak}es less time than formatting with SCOPY or XINIT as the code is much faster (and longer) than that in the resident handler. O}n installation, formatting a megabyte takes about three seconds while using the resident handler it requires about seven.DR}IVE REDIRECTIONAnytime the main RD is installed as D1: it causes all other drives, except the auxillary RD, to respond as D}(n+1): For example, if on a two-drive system the RD is installed as D1: real drive 1 henceforth responds as D2: and real 2 as} D3: But, if on the same system, the RD is installed as D2: real drive 2 will be unavailable as the RD will intercept all cal}ls for it. Redirection is automatic and can only be defeated by numbering the RD higher than 1.SAMPLE INSTALLATIONSHere i}s the installation report for a mega XE following the command line "RD D1: /AAEE":Extended RAM 1024kReserved RAM } 128kAux RAMdisk (D8:) 128kD1: RAMdisk Size 768k Formatting RAMdisk Drive redirection ONThe above reflects th}e configuration I use with my one-meg XE. From it you see I reserve the XE banks for DiskComm, TextPro, the Wedge or whatever}, and the next 64k for XL2. I install D8: with sufficient RAM to allow it to be formatted in single density (formatted under }MYDOS it reports 1010 free sectors). Finally, since the main RD is D1: drive redirection is enabled.Here's an example for a} 320k XE resulting from "RD D2: /NEA" (you get the same report with 512k+ and BASIC switched on though you're using different} banks):Extended RAM 256kReserved RAM 64kAux RAMdisk (D8:) 64kD2: RAMdisk Size 128k Drive redirect}ion offAnd here's the result of "RD D4:" on a 256XL:Extended RAM 192kD4: RAMdisk Size 192k Formatting RAMdis}k Drive redirection offNote that several of the lines only appear if applicable and the assigned drive number appears in }the RD size line. In all cases the volume name for the main RD will reflect the size. In the examples the volumes read "768k }RD", "128k RD" and "192k RD".USING THE AUXILLARY RAMDISKThe auxillary RD, under Sparta, imitates a single density drive a}nd Sparta will never write to any sector number greater than 720. Regardless of the number assigned by MYDOS, it always respo}nds as D8: to Sparta and is looked for before the main RD. This means that if installed, you cannot use a drive number greate}r than 7 for the main one. The program does not check for this--I should code for total lack of common sense?D8: is never f}ormatted on installation. It may be formatted (without zeroing) to maximum size from the MYDOS menu or, as a single density d}rive, using AINIT, SCOPY, XINIT, etc. It will refuse configuration and enhanced density commands and, with both RD's, rememb}er to use the "/R" switch with SCOPY.It is possible to assign all extra RAM to D8: in which case the program still requires} a valid drive number in the command line (it gets changed to 0). In this case, MYDOS can use all the RAM assigned but Sparta} is still restricted (on write) to the first 720 sectors. One use for this configuration would be to set up a common MYDOS/Sp}arta RD on a 130XE.When D8: is assigned less than 128k, Sparta can format it and believe it really has sufficient RAM to ho}ld a full single density disk. The RD will not overflow, but DOS will not know it's only 512 sectors in size until it tries t}o access the non-existant ones. If formatted under MYDOS, the free sector count will be correct and Sparta will respect it.}One other problem can occur with the auxillary RD. If you format in Sparta format and later switch to MYDOS and reformat, Spa}rta will no longer be able to access it. The problem is that MYDOS does not zero sectors when it formats so Sparta reads the }boot sectors and figures it's still working with a Sparta disk. The result is normally an error 139. The solution is to use A}INIT before switching to MYDOS. This will clear all sectors and a succeeding format under MYDOS will produce the correct size}.RDNUMBER.COMThis program allows you to renumber the main RD without reinstallation if the handler can be found. About th}e only way RDNUMBER couldn't find the handler would be installation of another custom disk handler (RDBASIC etc.) after RD it}self.Syntax is "RDNUMBER Dx:" and drive redirection will be enabled or disabled and reported as appropriate. The principal }use for RDNUMBER is to change the number when working with a program which accesses the disk using the OS routines bypassing }DOS. An example is DiskComm which does not like working with a RAMdisk as D1:RDNUMBER is the only correct way to renumber t}he RAMdisk--reinstallation with a different drive number using the "N" option is not. Reinstallation should only be done afte}r a cold start.stallation with a different drive number using the "N" option is not. Reinstallation should only be done afte?