ASCII to CAS in Perl?

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
tjewell
Posts: 347
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

ASCII to CAS in Perl?

Post 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 ...
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: ASCII to CAS in Perl?

Post 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 :)
tjewell
Posts: 347
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: ASCII to CAS in Perl?

Post 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.
pser1
Posts: 1668
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: ASCII to CAS in Perl?

Post 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
tjewell
Posts: 347
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: ASCII to CAS in Perl?

Post 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 ...
Sarah
Posts: 177
Joined: Wed Apr 13, 2011 3:36 pm
Contact:

Re: ASCII to CAS in Perl?

Post by Sarah »

Dragon Convert (DC) also does this conversion; although you asked for a Perl script!
tjewell
Posts: 347
Joined: Mon Oct 19, 2009 4:58 pm
Location: Cambridge, England

Re: ASCII to CAS in Perl?

Post 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!
Post Reply