Page 1 of 1

ASCII to CAS in Perl?

Posted: Mon Sep 14, 2015 7:25 pm
by tjewell
Hi all,

As part of a little hacking I'm doing here, I'm trying to avoid re-inventing the wheel. I'd like a little perl script that could take an ascii basic program and make a loadable .CAS file from it. I know there's a couple scripts that pretty much do this - Sixxie's bin2cas.pl and Jedie's PyDC_cli.py, but both are much cleverer scripts than I need, and I can't quite work out which bits to extract to get what I want. I was hoping someone might have a little script somewhere that does just this - then I can add the few little extra bits I need for my own project.

I'm sure I could write this from scratch - I've had a look at the docs - but if someone's already got this, it would speed me up no end!

Many thanks in advance ...

Re: ASCII to CAS in Perl?

Posted: Mon Sep 14, 2015 8:56 pm
by sixxie
I don't think bin2cas.pl will do it, that's mostly targetted at binaries.

I know it's not properly answering your question, but if you need something...

Code: Select all

xroar -ui null -ao null -tape-rewrite -tape-write outfile.cas -timeout-motoroff 1 infile.asc
But yeah, it's not hard to wrap the ASCII up in the appropriate decoration to turn it into a normal loadable image. I don't think the script exists now though, maybe that's your job :)

Re: ASCII to CAS in Perl?

Posted: Mon Sep 14, 2015 10:06 pm
by tjewell
Thanks Sixxie!

Well, so far, I've cobbled together a script of almost unbelievable ugliness that produced output that loaded into Xroar! Hurrah! But there's no way I'm sharing this until it's at least a little prettier. But thank god for Xroar, this job would be near impossible with a real Dragon. It's a great piece of software.

Re: ASCII to CAS in Perl?

Posted: Mon Sep 14, 2015 10:38 pm
by pser1
Tony,
I think that you don't need to do anything.
If you just want to load an ASCII file that contains a BASIC Dragon program, just use DW4 and my dweeb LDA
That way I loaded a big basic program with the name ELIZA.BAS without problems into my Dragon64.

You can find the dweeb here (in versions: normal and fast)
viewtopic.php?f=5&t=4968&start=10

regards
pere

Re: ASCII to CAS in Perl?

Posted: Mon Sep 14, 2015 10:59 pm
by tjewell
Thanks Pere! Actually, it's part of some fiddling around I've been doing with the Orch-90 - but it's early days and it might not work yet! First stage was to create .CAS files it can load, and I seem to be getting there slowly ...

Re: ASCII to CAS in Perl?

Posted: Tue Sep 15, 2015 2:43 am
by Sarah
Dragon Convert (DC) also does this conversion; although you asked for a Perl script!

Re: ASCII to CAS in Perl?

Posted: Sun Sep 20, 2015 2:08 pm
by tjewell
Hi all,

I've made my script, although I'll be the first to admit it's a bit primitive. It's used for converting 'ascii' Orchestra-90 files into .cas files (I say 'ascii', because they ultimately needed a bit of processing to convert properly). You can read more here - viewtopic.php?f=5&t=5390&p=14047#p14047

It's been fun building this script and writing out something my old Dragon can read - I shall have to think of something more ambitious now!