TurboBASIC XL time fix

From: Ted Skrecky (ud264@freenet.Victoria.BC.CA)
Date: 09/21/94-09:24:55 PM Z


From: ud264@freenet.Victoria.BC.CA (Ted Skrecky)
Subject: TurboBASIC XL time fix
Date: Wed Sep 21 21:24:55 1994


The following three programs will fix all known versions of Turbo BASIC
and RUNTIME.COM for NTSC time (if I could get enthusiastic about BASIC
I might consider combining them into one). With the 800 version (aka
FROST BASIC) you must boot the Turbo disk as the BASIC is part of
"DOS.SYS". The other versions simply require some version of Turbo to
run.

Enjoy,

John Picken
Victoria, Canada



1 . Turbo BASIC Mod jkp 11 Dec 93
2 .
3 . This works with Turbo BASIC XL
4 . and with TB32Q.COM (Tom Hunt's
5 . SpartaDOS mod).
6 .
8 CLS :? :LIST 100,140:? :? "Set line 110 then enter CONT"
9 STOP
10 ------------------------------
11 M=18400:DIM T$(M),F$(64),N$(13),S$(64):T$(M)=CHR$(0):POKE 82,8:
POKE 694,0:POKE 702,64:CLS :PRINT
100 ------------------------------
110 N$="D1:*?????.ARB"
120 . New autorun filespec. You can  make it "D8:?????*.ARB", etc. If you
don't want to make any change then 
130 .  make N$="D:AUTORUN.BAS". Whatever you do, the length of N$ must be 13.
140 ------------------------------ 
150 ?  " TURBO-BASIC Modifier":PRINT 
160 ? "CAUTION work on a copy":?  "This program is FINAL.":?  "It won't work
 on files"
170 ? "once they are modified":? "(including this mod!)"
180 ? :? "Insert TURBO-BASIC disk":? "Enter complete  filespec":? :
INPUT "=> ",F$
190 TRAP 900:OPEN #1,4,0,F$
200 TRAP 210:BGET #1,ADR(T$),M
210 CLOSE :T$=T$(1,DPEEK($0358))
220 .
230 . Look for floating point
240 . number for jiffies per day
250 .
260 FOR X=1 TO 6:READ Y:S$(X)=CHR$(Y):NEXT X:DATA 67,4,50,0,0,0
270 X=INSTR(T$,S$):ON X=0 GOTO 890
280 .
290 . Change it for NTSC
300 .
310 T$(X+1,X+1)=CHR$(5)
320 T$(X+2,X+2)=CHR$(24)
330 T$(X+3,X+3)=CHR$(64)
340 .
350 . Look for two jsr's in TBXL.
360 . These are multiply by 5 and
370 . then multiply by 10 calls.
380 .
390 RESTORE 390:FOR X=1 TO 6:READ Y:S$(X)=CHR$(Y):NEXT X:DATA 32,242,251,
32,236,251
400 X=INSTR(T$,S$):ON X=0 GOTO 530
410 .
420 . Replace with a single call to
430 . a multiply by 60 routine and
440 . three NOP's as space filler.
450 . .
460 RESTORE 460:FOR X=X TO X+5:READ Y:T$(X,X)=CHR$(Y):NEXT X:DATA 32,19,
252,234,234,234
470 GOTO 610
480 .
490 . Look for two jsr's in TB32Q
500 . Same calls but to different
510 . addresses.
520 .
530 RESTORE 530:FOR X=1 TO 6:READ Y:S$(X)=CHR$(Y):NEXT X:DATA 32,152,82,32
,172,82
540 X=INSTR(T$,S$):ON X=0 GOTO 890
550 .
560 . Replace as above but to
570 . different address
580 .
590 RESTORE 590:FOR X=X TO X+5:READ Y:T$(X,X)=CHR$(Y):NEXT X:DATA 32,205,
82,234,234,234
600 VERSION=1:. Flag TB32Q
610 X=INSTR(T$,"YDAER"):ON X=0 GOTO 890
620 .
630 . Change the prompt here. Note
640 . that it must be 5 characters
650 . long and is in reverse order.
660 .
670 IF VERSION
680   T$(X,X+4)="obruT":. TB32Q
690 ELSE
700   T$(X,X+4)="OBRUT":. Turbo XL
710 ENDIF
720 .
730 X=INSTR(T$,"D:AUTORUN.BAS"):ON X=0 GOTO 890
740 T$(X,X+12)=N$
750 ? :? "TURBO-BASIC patched":? "for NTSC.";
760 IF N$<>"D:AUTORUN.BAS" THEN ? "   Autorun":? "filespec changed."
770 ? :? "START to write file"
780 R=PEEK(53279):ON R<>6 GOTO 780
790 S$="":? :? :? "Ready to write file.":? :? "Enter new filespec or"
800 ? "(caution) to write to":? F$:PRINT
810 ? CHR$(156);"just hit Return":INPUT "=> ",S$:IF S$="" THEN S$=F$
820 ? S$:F$=S$:TRAP 830:UNLOCK S$
830 TRAP 900:OPEN #1,8,0,S$
840 BPUT #1,ADR(T$),LEN(T$):CLOSE
850 ? :? "Another copy START":? :? "Quit program OPTION"
860 M=PEEK(53279):ON M=6 GOTO 810:ON M<>3 GOTO 860
870 POKE 82,2:? :TRAP 40000:END
880 . Crude error handlers
890 ? "File previously modified":GOTO 870
900 CLOSE :? :? " DISK ERROR  #";ERR:? :ON S$="" GOTO 180:GOTO 850



10 . TB800FIX must be run under the
20 . 800 version (DOS.SYS)
30 .
40 DIM A$(13),P$(5),E$(40)
50 .
60 . Change DOS write command here
70 .
80 A$="P":. Use "W" for verify
90 IF A$<>"W" THEN A$="P"
100 POKE 1913,ASC(A$)
110 .
120 . Change autorun filespec here
130 . It must be 13 chars long
140 .
150 . A$="D:AUTORUN.BAS"
160 A$="D1:*?????.ARB"
170 .
180 IF LEN(A$)<>13 THEN E$="Error in Autorun filespec length":GOTO 580
190 E$="Error in Autorun filespec device"
200 IF A$(1,1)<>"D" THEN 580
210 IF A$(2,2)<>":" AND A$(3,3)<>":" THEN 580
220 FOR X=1 TO 13
230   POKE 10255+X,ASC(A$(X))
240 NEXT X
250 .
260 . Change prompt here
270 . It must be 5 chars long but
280 . could be something
290 . like ">    " or whatever
300 .
310 . P$="READY"
320 P$="Turbo"
330 IF LEN(P$)<>5 THEN E$="Error in Prompt length":GOTO 580
340 FOR X=5 TO 1 STEP -1
350   POKE 14511+X,ASC(P$(X))
360 NEXT X
370 .
380 . Fix DOS 2 for burst i/o bug
390 . and time for North America
400 TRAP 460
410 DO
420   READ X,Y
430   POKE X,Y
440 LOOP
450 .
460 ? "Done! ";
470 INPUT "Press Return to write",A$
480 CLOSE #1
490 TRAP 510
500 UNLOCK "D1:DOS.SYS"
510 TRAP 600
520 OPEN #1,8,0,"D1:DOS.SYS"
530 CLOSE #1
540 TRAP 40000
550 PRINT
560 ? "Press Break to quit"
570 GOTO 470
580 ? E$
590 END
600 ? " Disk error  #";ERR
610 GOTO 550
620 .
630 . Fix a bug in DOS 2 burst i/o.
640 . Refer to Mapping The Atari
650 .
660 DATA 2592,130,2593,19,2594,73,2595,12,2596,240,2597,36,2598,106,2599,
234,2625,16,2773,31
670 .
680 . Fix Turbo time functions for NTSC
690 .
700 DATA 21033,5,21034,24,21035,64,21085,205,21087,234,21088,234,21089,234



10 . Runtime mod jkp 8 Jul 94
11 . Fixes the time in
12 . runtime.com for NTSC
13 M=11000:DIM T$(M),F$(64),S$(64)
14 T$(M)=CHR$(0):POKE 82,8:CLS
15 ?:?"RUNTIME.COM Modifier"
16 ?:?"Insert source disk and"
17 ?"enter complete filespec"
18 ?:INPUT "=> ",F$
19 TRAP 81:OPEN #1,4,0,F$
20 ?:?"Reading ";F$
21 TRAP 22:BGET #1,ADR(T$),M
22 CLOSE:T$=T$(1,DPEEK($0358))
23 ?:?"Modifying ";F$(4)
24 .
25 . Look for floating point
26 . number for jiffies per day
27 .
28 DATA 67,4,50,0,0,0
29 . $43 Bcd exponent (excess 64)
30 . $04,$50 mantissa=4.500000 (*100^3)
31 .
32 FOR X=1 TO 6
33 READ Y:S$(X)=CHR$(Y)
34 NEXT X
35 X=INSTR(T$,S$):ON X=0 GOTO 79
36 .
37 . Change it for NTSC: exponent
38 . unchanged, mantissa becomes
39 . 5.184000
40 .
41 T$(X+1,X+1)=CHR$(5):. $05
42 T$(X+2,X+2)=CHR$(24):. $18
43 T$(X+3,X+3)=CHR$(64):. $40
44 .
45 . Look for two jsr's in RT.
46 . These are multiply by 5 and
47 . then multiply by 10 calls.
48 .
49 DATA 32,12,252,32,6,252
50 FOR X=1 TO 6
51 READ Y:S$(X)=CHR$(Y)
52 NEXT X
53 X=INSTR(T$,S$):ON X=0 GOTO 79
54 .
55 . Replace with a single call to
56 . a multiply by 60 routine and
57 . three NOP's as space filler
58 .
59 DATA 32,45,252,234,234,234
60 FOR X=X TO X+5
61 READ Y:T$(X,X)=CHR$(Y)
62 NEXT X
63 ?:?"RUNTIME.COM patched for"
64 ?"NTSC. Ready to write file."
65 ?:?"Enter new filespec or to"
66 ?"write to ";F$
67 ?"just hit Return":?
68 S$="":INPUT "=> ",S$
69 IF S$="" THEN S$=F$
70 F$=S$:TRAP 71:UNLOCK S$
71 TRAP 81:OPEN #1,8,0,S$
72 BPUT #1,ADR(T$),LEN(T$):CLOSE
73 ?:?"Press Start for another copy"
74 ?:?"Press Option to exit program"
75 M=PEEK(53279):ON M=6 GOTO 65
76 ON M<>3 GOTO 75
77 TRAP 40000:POKE 82,2:END
78 . Crude error handlers
79 ?"File previously modified"
80 GOTO 77
81 CLOSE :?:?"DISK ERROR #";ERR:?
82 ON S$="" GOTO 16:GOTO 77


-----------------------------------------
Return to message index