CPCWiki forum

General Category => Programming => Topic started by: SRS on 17:46, 12 March 13

Title: run"$ - or another disc directory tool
Post by: SRS on 17:46, 12 March 13
[attachimg=1]

Some of you may remember this other computer where you used to run"$ to see the discs directory ?

During late 80's I wrote a little 1k programm to handle discs (cat, rename, "type" ...) on my 464 mor easy.

I managed to copy it to my PC lately so I like to share it.

It needs 1k on every disc ... and starts with run"$

Here is the basic listing:


10 MODE 2:INK 0,13:INK 1,0:PEN 1:PAPER 0:BORDER 13:FOR a=4089 TO 4115:READ b$:b=VAL("&"+b$):POKE a,b:NEXT a:CALL &1000:DATA cd,60,bb,32,c2,b,c9,21,a,10,df,7,10,c9,d,c6,7,23,0,c8,0,1,1,a,0,3,0:CAT
11 PRINT SPC(13);:CALL &BB9C:PRINT"ENTER=RUN f1=CAT f2=USER f3=ERA f4=A/B f5=REN f6=SHOW":CALL &BB9C:m=VPOS(#0)
12 LOCATE 1,m+1:IF NOT INKEY(0)THEN y=MAX(0,y-1) ELSE IF NOT INKEY(2)THEN y=MIN(y+1,m) ELSE IF NOT INKEY(8)THEN x=MAX(0,x-20) ELSE IF NOT INKEY(1)THEN x=MIN(60,x+20) ELSE IF NOT INKEY(18)AND NOT n$=STRING$(12,32) THEN RUN n$ ELSE IF NOT INKEY(13)THEN RUN
13 IF NOT INKEY(14)THEN 15 ELSE IF NOT INKEY(5)THEN |ERA,@n$:RUN ELSE IF NOT INKEY(20)THEN 17 ELSE IF NOT INKEY(12)THEN 16 ELSE IF NOT INKEY(4)THEN OPENIN n$:CLS:WHILE NOT EOF:LINE INPUT#9,a$:PRINT a$:WEND:RUN
14 n$="":FOR c=1 TO 12:LOCATE x+c,y+4:CALL 4089:n$=n$+CHR$(PEEK(3010)):NEXT c:CALL &BB9C:LOCATE x+1,y+4:PRINT n$:CALL &BB18:CALL &BB9C:LOCATE x+1,y+4:PRINT n$:GOTO 12
15 INPUT"0-FF";u:IF u<0 OR u>255 THEN PRINT CHR$(7):GOTO 15 ELSE POKE &A701,u:RUN
16 INPUT"in";u$:|REN,@u$,@n$:RUN
17 POKE &A700,PEEK(&A700) XOR 1:RUN
Title: Re: run"$ - or another disc directory tool
Post by: McKlain on 18:01, 12 March 13
Quote from: SRS on 17:46, 12 March 13
Some of you may remember this other computer where you used to run"$ to see the discs directory ?

Nice tool!  ;D 

Not to be nitpicking but the actual statement was

LOAD"$",8
LIST


Locomotive Basic rules!  :P
Title: Re: run"$ - or another disc directory tool
Post by: TFM on 19:10, 12 March 13
wasn't it ,8,1 ???
Title: Re: run"$ - or another disc directory tool
Post by: McKlain on 19:18, 12 March 13
QuoteOn the Commodore 64, entering LOAD "$",8,1 will flood the screen with garbage instead of loading the directory into BASIC RAM. This is because the drive assigns the directory a load address of $0401 (1025), which is equivalent to the start of BASIC for the Commodore PET, but corresponds to the default screen memory in the C64.
Title: Re: run"$ - or another disc directory tool
Post by: SRS on 20:52, 12 March 13
Ah well, you see how much C64 experience I have & remember :D
Title: Re: run"$ - or another disc directory tool
Post by: McKlain on 20:55, 12 March 13
The C64 was a quick & dirty job. It turned out pretty well after all  ;D
Title: Re: run"$ - or another disc directory tool
Post by: Bryce on 17:23, 14 March 13
So you've written a program, that makes my beloved CPC more like a C64?? Why am I not impressed? :D

Bryce.
Title: Re: run"$ - or another disc directory tool
Post by: TFM on 18:53, 14 March 13
Because you don't like Black on Grey! :P
Title: Re: run"$ - or another disc directory tool
Post by: Gryzor on 19:42, 22 March 13
Hey, a file manager in 1K? I'm sold. Wish I had this back in the day, quite neat!!!
Title: Re: run"$ - or another disc directory tool
Post by: copychr$ on 00:07, 18 June 13
Hi SRS,

Seems we had twins way back ...
Our progs basically do the same thing, but we got to it by different means.

As a 10-liner yours is sensational. Also it works on the 464.
Sure hope you did the job faster than me. Took ages to get the ball rolling ;-)

Please take a look at Copychr$ to the Fore @ Interesting Type-Ins. (http://www.cpcwiki.eu/forum/programming/interesting-type-ins/msg63972/#msg63972)
Title: Re: run"$ - or another disc directory tool
Post by: SRS on 19:30, 18 June 13
Way cool !

Seems we had the same need , but as it was that days you had no inet to look for a nice cpc programm.

IIRC it took me a saturday night to push it into 1k, wanted to sell it to the CPCAI but they never answered ... sigh


Title: Re: run"$ - or another disc directory tool
Post by: copychr$ on 20:54, 18 June 13
Yup, not much interaction ... Just the local mags and the manual.
They had some good instructional type-ins though.

Starting point was envy of the menu system of Lotus 123 at the time.
Well, lookit, Lotus is history and here we are ...

Still, being able to catch file names and menu items on the fly, just in the basic environment, makes everything a cinch.
I feel like a caveman, typing CAT ...

Here is a link to the excellent downgrading page of Sean McManus, about getting equivalent Basic 1.1 routines for the 464.
Copychar$ is also treated and it seems your routine is the same.

http://www.sean.co.uk/books/amstrad/amstrad2.shtm#COPYCHR (http://www.sean.co.uk/books/amstrad/amstrad2.shtm#COPYCHR)


Powered by SMFPacks Menu Editor Mod