From: duck@pembvax1.pembroke.edu
Newsgroups: comp.sys.cbm
Subject: Commodore Hacking Issue #4 5/5
Date: 5 Oct 92 14:03:18 GMT
Organization: Pembroke State University
NNTP-Posting-Host: pembvax1.pembroke.edu

.%708!  clusterBuf = trackbuf+4608
.%709!  fatbuf     = clusterBuf+1024
.%710!  dirbuf     = fatbuf+1536
.%711!  end        = dirbuf+4096

5. USER-INTERFACE PROGRAM

This section presents the listing of the user-interface BASIC program.  You
should be aware that you can easily change some of the defaults to your own
preferences if you wish.  This program is not listed in the ".%nnn!" format
that the assembler listing is since you can recover this listing from the
uuencoded binary program file.  This program should be a little easier to
follow than the assembler listing since BASIC is a self-commenting language. :-)

10 rem little red reader, by craig bruce, 30-sep-92, for c= hacking netmag
11 :

These lines set up the default CBM-DOS and MS-DOS device numbers, taking care
to disallow them to be the same device.  You can change this to your own drive
configuration.

20 cd=peek(186)  : rem ** default cbm-dos drive **
25 dv=9:dt=0  :  rem ** ms-dos drive, type (0=1571,255=1581)
26 if dv=cd then dv=8:dt=0 : rem ** alternate ms-dos drive
27 :
30 print chr$(147);"initializing..." : print
40 bank0 : pk=dec("8000")
50 if peek(pk+9)=dec("cb") and peek(pk+10)=131 then 60
55 print"loading machine language routines..." : bload"lrr.bin",u(cd)
60 poke pk+16,dv : poke pk+17,dt : sys pk

I "dim" the following variables before the arrays to avoid the overhead of
pushing the arrays around when creating new scalar variables.

70 dim t,r,b,i,a$,c,dt$,fl$,il$,x,x$
80 dim di$(128),cl(128),sz(128)
90 if dt=255 then dt$="1581" :else dt$="1571"
100 fl$=chr$(19)+chr$(17)+chr$(17)+chr$(17)+chr$(17)
110 il$=fl$:fori=1to19:il$=il$+chr$(17):next
120 goto 500
130 :
131 rem ** load ms-dos directory **
140 print"loading directory..." : print
150 sys pk : sys pk+3
160 dl=0

The "rreg" instruction returns the return values of the .A, .X, .Y, and .S
registers from the last "sys" call.  I check the 1-bit of the .S register
(the Carry flag) for error returns.

170 rreg bl,dc,bh,s : e=peek(pk+15)
180 if (s and 1) then gosub 380 : return
190 print"scanning directory..." : print
200 db=bl+256*bh
210 if dc=0 then 360
220 for dp=db to db+32*(dc-1) step 32
230 if peek(dp)=0 or peek(dp)=229 then 350
240 if peek(dp+12) and 24 then 350
250 dl=dl+1

This next line is where I set the default selection status, translation type,
and CBM file type for the MS-DOS files.  You can change these defaults simply
by overtyping the string in   (  |  |||  |||  ) the "V" locations.
                                 V  VVV  VVV
260 d$=right$(" "+str$(dl),3)+"     asc  seq  " : rem ** default sel/tr/ft **
270 a$="" : fori=0to10 : a$=a$+chr$(peek(dp+i)) : next
280 a$=left$(a$,8)+"  "+right$(a$,3)
290 print dl; a$
300 d$=d$+a$+"  "
310 cl(dl)=peek(dp+26)+256*peek(dp+27)
320 sz=peek(dp+28)+256*peek(dp+29)+65536*peek(dp+30)
330 di$(dl)=d$+right$("    "+str$(sz),6)
340 sz(dl)=sz
350 next dp
360 return
370 :
371 rem ** report ms-dos disk error **
380 print chr$(18);"ms-dos disk error #";mid$(str$(e),2);
390 print " ($";mid$(hex$(e),3);"), press key.";chr$(146)
400 getkey a$ : return
410 :
411 rem ** screen heading **
420 printchr$(147);"ms-dev=";mid$(str$(dv),2);"    ms-type=";dt$;
430 print"    cbm-dev=";mid$(str$(cd),2):print
440 return
450 :
451 rem ** screen footing **
460 print il$;"d=directory  m=ms-dev  f=cbm-dev q=quit"
470 print"t=toggle-column, c=copy-files, +/- page";
480 return
490 :
491 rem ** main routine **
500 t=1 : c=0
510 r=0
520 gosub 420
530 print "num  s  trn  typ  filename  ext  length"
540 print "---  -  ---  ---  --------  ---  ------"
550 gosub 460
560 b=t+17 : if b>dl then b=dl
570 print fl$;: if t>dl then 590
580 for i=t to b : print di$(i) : next
590 if dl=0 then print chr$(18);"<no files>";chr$(146)
600 if dl=0 then 660
610 print left$(il$,r+5);chr$(18);
620 on c+1 goto 630,640,650
630 print spc(4);mid$(di$(t+r),5,3) : goto 660
640 print spc(7);mid$(di$(t+r),8,5) : goto 660
650 print spc(12);mid$(di$(t+r),13,5) : goto 660
660 getkey a$

Oh shi^Hoot.  I screwed up the following line in the string after the
"+chr$(13)+" part.  You'll notice that I have avoided putting cursor control
characters into the strings everywhere else, but I forgot to do that here.
The "{stuff}" should be CursorUp, CursorDown, CursorLeft, CursorRight,
CursorHome, and CursorCLR control characters, respectively.  These characters
give the index for the "on" statement below.

670 i=instr("dmftc+-q "+chr$(13)+"{stuff}",a$)
680 print left$(il$,r+5);di$(t+r)
690 if i=0 then 600
700 onigoto760,1050,1110,950,1150,1000,1020,730,860,860,770,790,810,830,850,500
710 stop
720 :
721 rem ** various menu options **
730 print chr$(147);"have an awesome day."
740 end
760 gosub 420 : gosub 140 : goto 500
770 r=r-1 : if r<0 then r=b-t
780 goto 600
790 r=r+1 : if t+r>b then r=0
800 goto 600
810 c=c-1 : if c<0 then c=2
820 goto 600
830 c=c+1 : if c>2 then c=0
840 goto 600
850 r=0 : c=0 : goto 600
860 if dl=0 then 600
870 x=t+r : on c+1 gosub 890,910,930
880 print left$(il$,r+5);di$(x) : goto 600
890 if mid$(di$(x),6,1)=" " then x$="*" :else x$=" "
900 mid$(di$(x),6,1)=x$ : return
910 if mid$(di$(x),9,1)="a" then x$="bin" :else x$="asc"
920 mid$(di$(x),9,3)=x$ : return
930 if mid$(di$(x),14,1)="s" then x$="prg" :else x$="seq"
940 mid$(di$(x),14,3)=x$ : return
950 if dl=0 then 600
960 for x=1 to dl
970 on c+1 gosub 890,910,930
980 next x
990 goto 520
1000 if b=dl then t=1 : goto 510
1010 t=t+18 : goto 510
1020 if t=1 then t=dl-(dl-int(dl/18)*18)+1 : goto 510
1030 t=t-18 : if t<1 then t=1
1040 goto 510
1050 print il$;chr$(27);"@";
1060 input"ms-dos device number (8-30)";dv
1061 if cd=dv then print"ms-dos and cbm-dos devices must be different!":goto1060
1070 input"ms-dos device type  (71/81)";x
1080 if x=8 or x=81 or x=1581 then dt=255:dt$="1581" :else dt=0:dt$="1571"
1090 poke pk+16,dv : poke pk+17,dt : sys pk
1100 goto 520
1110 print il$;chr$(27);"@";
1120 input "cbm-dos device number (0-30)";cd
1130 if cd=dv then print"ms-dos and cbm-dos devices must be different!":goto1120
1140 goto 520
1141 :
1142 rem ** copy files **
1150 print chr$(147);"copy files":print:print
1160 if dl=0 then fc=0 : goto 1190
1170 fc=0 : for f=1 to dl : if mid$(di$(f),6,1)="*" then gosub 1200
1180 next f
1190 print : print"files copied =";fc;" - press key"
1191 getkey a$ : goto 520
1200 fc=fc+1
1210 x$=mid$(di$(f),19,8)+"."+mid$(di$(f),29,3)
1220 cf$="":fori=1tolen(x$):if mid$(x$,i,1)<>" " then cf$=cf$+mid$(x$,i,1)
1230 next
1231 if right$(cf$,1)="." then cf$=left$(cf$,len(cf$)-1)
1232 cf$=cf$+","+mid$(di$(f),14,1)
1240 print str$(fc);". ";chr$(34);cf$;chr$(34);tab(20);sz(f)"bytes";
1245 print tab(35);mid$(di$(f),9,3)
1250 cl=cl(f) : lb=sz(f) - int(sz(f)/65536)*65536

I had to use a DOPEN statement here for disk files because the regular OPEN
statment does not redirect the DS and DS$ pseudo-variables.  You'll notice
that the non-disk OPEN statment below has a secondary address of 7.  This is
to put the printer into lowercase mode if you are outputting directly to it.
You can replace this with a 5 (or whatever) if you have a special interface
to an IBM-compatible printer and you want to print directly in ASCII.  In this
case, you would select the "BIN" translation mode for the file you are routing
directly to the printer.

1260 if cd>=8 then dopen#1,(cf$+",w"),u(cd) :else if cd<>0 then open 1,cd,7
1265 if cd<8 then 1288
1270 if ds<>63 then 1288
1275 x$="y" : print "file exists; overwrite (y/n)";
1280 close 1 : input x$ : if x$="n" then fc=fc-1 : return
1285 scratch(cf$),u(cd)
1286 dopen#1,(cf$+",w"),u(cd)
1288 if cd<8 then 1320
1300 if ds<20 then 1320
1310 print chr$(18)+"cbm disk error: "+ds$ : fc=fc-1 : close1 : return
1320 poke pk+19,cl/256 : poke pk+18,cl-peek(pk+19)*256
1330 poke pk+21,lb/256 : poke pk+20,lb-peek(pk+21)*256
1340 tr=0 : if mid$(di$(f),9,1)="a" then tr=255
1346 x=1 : if cd=0 then x=0
1350 sys pk+6,tr,x
1355 rreg x,x,x,s : e=peek(pk+15)
1356 if (s and 1) then gosub 380 : fc=fc-1
1360 if cd<>0 and cd<8 then close1
1370 if cd>=8 then dclose#1 : if ds>=20 then 1310
1380 return

6. UUENCODED FILES

Here are the binary executables in uuencoded form.  The CRC32s of the two
files are as follows:

   "lrr.128"    1106058594
   "lrr.bin"     460671650

The "lrr.128" file is the main BASIC program and the "lrr.bin" file contains
the machine lanugage disk-accessing routines.

begin 640 lrr.128
M?1Q+'?H?CR!,25143$4@4D5$(%)%041%4BP@0ED@0U)!24<@0E)50T4L(#,P
M+5-%4"TY,BP@1D]2($,]($A!0TM)3D<@3D5434%'?%$<"P?Z?(?<%?!#1++"
M*#$X-BD@(#H@CR?J*B!$149!54Q4($-"32U$3U,@1%))5D4@*BH?O!P9?$16
MLCDZ1%2R,"?@.B?@CR?J*B!-4RU$3U,@1%))5D4L(%194$4@*#?],34W,2PR
M-34],34X,2D?\AP:?(L@1%:R0T0@IR!$5K(X.D14LC?@.B"/("HJ($%,5$52
M3D%412!-4RU$3U,@1%))5D4?^!P;?#H?&QT>?)D@QR@Q-#<I.R))3DE424%,
M25I)3D<N+BXB(#H@F0?R'2@?_@(P(#H@4$NRT2@B.#?P,"(I?%P=,@"+(,(H
M4$NJ.2FRT2@B0T(B*2"O(,(H4$NJ,3?ILC$S,2"G(#8P?)P=-P"9(DQ/041)
M3D<@34%#2$E.12!,04Y'54%'12!23U5424Y%4RXN+B(@.B#^$2),4E(N0DE.
M(BQ5*$-$*0"_'3P?ER!02ZHQ-BQ$5B?Z()<@4$NJ,3<L1%0@.B">(%!+?.,=
M1@"&(%0L4BQ"+$DL020L0RQ$5"0L1DPD+$E,)"Q8+%@D??(>4?"&($1))"@Q
M,C@I+$-,*#$R."DL4UHH,3(X*0?J'EH?BR!$5+(R-34@IR!$5"2R(C$U.#$B
M(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("0?<BB.(8&HI>&
M!ZX6@$S3@:D.C0#_J0"@?"#?@2!H@9?!8(4"A?.@#;$"C1:?R0.0!ZD\C0^?
M.&"@$+$"R0+0\:?6L0*-%X#)!+#FH!&Q?HT9@,F!L-M*2DI*C1B?H!.Q?HT:
M@,BQ?HT;@*?8L0+)"="_H!JQ?LD"T+>@#K$"R0'0KZT7@?H8:0&-'8?8;1B?
MC1R?K1J?K!N?..T<@+?!B(T>@(P?@*T6@,D"T?9.'X!N'H"I.*";A0:$!ZD!
MH?"N%X?@TX&0?6"I.*"AA0:$!ZT=@*??KAB?(-.!D?%@J3B@H:X9@!A@A06$
M?T8#:H4$I@,*)@,8902%?HIE?X4#&*4":3B%?J4#:9N%?Z?"L0*9!@"($/BE
M!2D!T?BE!RD/J*4&8*4'H@1&"&K*T/JD"&"E9*1E("6"D?%@J3B@EX5@A&&I
M?(5BK1:?"H5CI62D92?E@X5DA&7)_]?@P?_0'*T4@(5BJ0&N%H#@???"J0,M
M%8#0!:X4@/?"A6,@OH-@I@_0?AA@(,G_D?2-#X!@J?^F8]?"I6*%9J??L6?D
M#A?&JKTXA/?#(-+_R,1FT.P8I6!E9H5@D?+F83BE8N5FA6*P?L9CI6(%8]#$
M(,S_&&"@#HP?_X4.A@^M$H"L$X"%9(1E3"J$(&^#D?%@I63)_]#TI67)#]#N
M&&???????????!0)#0"3?????????????????????????"?A(B,D)28G*"DJ
M*RPM+B\P,3(S-#4V-S@Y.CL\/3X_0,'"P\3%QL?(R<K+S,W.S]#1TM/4U=;7
MV-G:6UQ=7E_?04)#1$5&1TA)2DM,34Y/4%%24U155E=865K;W-W>WP??????
M????????????????????????????????????????????????????????????
M????????????????????????????????????????????????????????????
A????????????????????????????????????????????????
?
end

7. BIBLIOGRAPHY

The following works were consulted in creating this article:

[1] Jim Butterfield, "Jim Butterfield's Complete C128 Memory Map",
    _The_Transactor_, Volume 7, Issue 01, July 1986 (A Must!).

[2] Commodore Business Machines, _Commodore_1571_Disk_Drive_User's_Guide_,
    CBM, 1985.

[3] Some program called "msdos-to-128" included with "cs-dos" by
    M. G-something.  Originally published in COMPUTE!'s Gazzette, I think.

[4] Commodore Business Machines, _Commodore_128_Programmer's_Reference_Guide_,
    Bantam Books, 1986.

[5] _The_Transactor_, Volume 4, Issue 05 ("The Reference Issue"), May 1983.

=============================================================================
Next Issue:       

Learning Machine Language - Part 5

The SPACE INVASION is continued with the design and implementation of the
player and alien animation along with a look at device scanning for the 
1351 mouse, joystick and keyboard.

The 1351 Mouse Demystified

Finally! - After 2 delays, this article will explain how the 1351 mouse
works as well as provide a easy to use interface in machine language for
both basic and machine language programmers.  An example program will be
given to illustrate both the 1351 mouse and the multi-tasking system.

Multi-tasking on the C=128

A rudimentary multi-tasking system will be implemented for tasks to run
con-currently with each other. While intended for machine language programmers
some discussion of how to use this within basic will be given so that more than
one basic / ml program can be run at a time. An example program will be given to
illustrate both the 1351 mouse and the multi-tasking system.

Stretching sprites

You might have heard that it is possible to expand sprites to more than twice
their original size. But there is no need to expand all of them equally. This
article will examine on how to expand them 2,3 or more multiples of their 
original size.

LITTLE RED WRITER: MS-DOS file writer for the 128 and 1571/81 drives.

This article will extend the Little Red Reader program to be able to write
Commodore-DOS files to an MS-DOS disk.
=============================================================================

-- 

- Craig Taylor   || Standard Disclaimer Applies (of course!)
duck@pembvax1.pembroke.edu (Pembroke State University)

Oregon, n.:
	Eighty billion gallons of water with no place to go on Saturday
	night.