CPCWiki forum

General Category => Emulators => Topic started by: jwm on 00:50, 31 December 11

Title: how do I convert a text file to .bas?
Post by: jwm on 00:50, 31 December 11
Hi,

I've just typed in some code from a magazine scan and saved it as a text file on my Linux box. I then used iDSK (along with translate.google.com) to put the file as a .bas within a dsk file. It didn't work. I then remembered that in cpc memory commands are not stored as text. I assume then that a .bas file isn't a real text file? If not, how can I convert it?

Cheers,
James.
Title: Re: how do I convert a text file to .bas?
Post by: Devilmarkus on 01:24, 31 December 11
Perhaps my little tool can help you...

http://www.cpcwiki.eu/forum/applications/baslist-java-tool-to-list-basic-files/msg29481/#msg29481 (http://www.cpcwiki.eu/forum/applications/baslist-java-tool-to-list-basic-files/msg29481/#msg29481)

Cheers,
Markus

Edit:
Got it wrong first:
To transform a .TXT file to .BAS:
- Put a .TXT file on your DSK without adding an Amsdos header
- Rename it to xxxx.BAS
- LOAD"xxxx.BAS"
- SAVE"xxxx.BAS"

Then you should have your proper .BAS file
Title: Re: how do I convert a text file to .bas?
Post by: TFM on 02:05, 31 December 11
Why not just typing it in on a real CPC?
Title: Re: how do I convert a text file to .bas?
Post by: jwm on 12:10, 31 December 11
Quote from: TFM/FS on 02:05, 31 December 11
Why not just typing it in on a real CPC?

Around ten years ago I donated my real CPC 464 to an old landlord because I couldn't be bothered to take it with me when I moved and I had a PC. :(

Typing within the emulator (arnold) is impossible; for example to type the + character I had to copy the output of print chr$(43).



Title: Re: how do I convert a text file to .bas?
Post by: Devilmarkus on 12:31, 31 December 11
JavaCPC Autotype
http://retropower.eu/basictype/ (http://retropower.eu/basictype/)
Title: Re: how do I convert a text file to .bas?
Post by: jwm on 12:47, 31 December 11
Hi Markus,

I tried your tool but had no luck with that - I got lots of errors on the console.

I also tried your other suggestion. After renaming it and I do the load I get a "Memory Full" error.

I'm trying to get CPCtools to work but for that, I also need libserial to build and I keep getting a python error during make... I don't know python but am going to try to look into it.

Cheers,
James.
Title: Re: how do I convert a text file to .bas?
Post by: Morn on 12:49, 31 December 11
You can save the BASIC source code as an ASCII file to the DSK image (with iDSK -t 0). It will load about 10 times or so slower on the CPC than a binary BASIC file though. Then save the code in the emulator in standard binary format.

You also have to convert line endings to the standard CP/M / DOS CR/LF convention first if you are using e.g. a Mac, otherwise the BASIC interpreter won't read the ASCII file.
Title: Re: how do I convert a text file to .bas?
Post by: mr_lou on 12:57, 31 December 11
Quote from: jwm on 12:10, 31 December 11Typing within the emulator (arnold) is impossible; for example to type the + character I had to copy the output of print chr$(43).

Good to hear I'm not the only one.
To load from tape I have to first print chr$(124) to get the | character, then copy that and type TAPE
Title: Re: how do I convert a text file to .bas?
Post by: Devilmarkus on 15:22, 31 December 11
Please email me your textfile (or MSN)
webmaster[at]cpc-live.com
Title: Re: how do I convert a text file to .bas?
Post by: Devilmarkus on 16:36, 31 December 11
Here's your DSK:

But I also adapted this game from speccy:
http://www.cpc-power.com/index.php?page=detail&num=6262 (http://www.cpc-power.com/index.php?page=detail&num=6262)

Advanced Lawnmower Simulator for Amstrad CPC (http://www.youtube.com/watch?v=wnO30C0XGPQ#)

;)

DUMMY.BAS: Your textfile (ASCII)
LWM.BAS the adapted file to BASIC code

You had an error in line 430... (There are some more bugs but you'll find that out)
Title: Re: how do I convert a text file to .bas?
Post by: jwm on 17:31, 31 December 11
Thanks Markus,

Have to say I'd forgotten how bad that game was. I was proud to get it printed in Amstrad Action at the time..

http://cpcoxygen.fxwebdevelopment.com/aa_depot/052JS.html (http://cpcoxygen.fxwebdevelopment.com/aa_depot/052JS.html)

I've watched a few videos of Advanced Lawnmower Simulator on youtube, never saw it until now.

James.






Title: Re: how do I convert a text file to .bas?
Post by: Gryzor on 19:21, 31 December 11
It was yours? My, never mind how bad it was, it's got a cult status... :)
Title: Re: how do I convert a text file to .bas?
Post by: 00WReX on 03:32, 01 January 12
Hahaha...classic.

Love it near the end of the video..."You Have Been Killed"... :D
Sh!t I was only mowing the grass...

Cheers,
Shane
Title: Re: how do I convert a text file to .bas?
Post by: Devilmarkus on 11:20, 01 January 12
Now you can also play it online!
(http://java.cpc-live.com/games/-A-/advancedlawn.png) (http://java.cpc-live.com/applet/cpc.php?game=advancedlawn)

Happy New Year! ;)
Powered by SMFPacks Menu Editor Mod