CPCWiki forum

General Category => Programming => Topic started by: Paulo Garcia on 18:44, 11 August 15

Title: BASIC Editor outside emulator
Post by: Paulo Garcia on 18:44, 11 August 15
Hi


this is probably a very noob question and I swear I looked around and couldn't find an answer for it :)


Is there any option to use any text editor to create Locomotive BASIC programs and load them on an emulator. I'm learning about the Locomotive, but typing in the emulator is not very productive....


I wonder if the workflow would be:


1-Use any editor
2-Generate a disk image
3-Startup emulator loading the image
4-BAM!


Is this is correct? what would be the tools to accomplish the item 2?


Thanks


Title: Re: BASIC Editor outside emulator
Post by: Devilmarkus on 19:03, 11 August 15
Hello Paolo,
sure, you can use a texteditor to edit BASIC programs.
You then can transfer them as ASCII file on a DSK (WinApe can do that, by pressing CTRL + F1, JavaCPC can do that on Windows PC by using integrated DSKUtil)
Or, if you cannot transfer the txt file on a DSK, just copy the text and paste it into the emulator using Autotype feature (Most emulators feature that)

Important: When you copy it to DSK as ASCII file, rename it to .BAS instead of .TXT!
Amsdos can read ASCII BASIC files, as well, as regular ones (but loading takes a bit longer)
Title: Re: BASIC Editor outside emulator
Post by: Paulo Garcia on 19:44, 11 August 15
Hey, thanks for the tips..


I forgot to mention I am on Mac OSX. You say JavaCPC only has that feature on Windows, right?


Are you aware of a multiplatform disk tool? I can also try to wrap DSKUtil around Wine. Sometimes it works very well...


Cheers



Title: Re: BASIC Editor outside emulator
Post by: Devilmarkus on 20:15, 11 August 15
JavaCPC works on most MACs... But the integrated DSKUtil uses CPCXFS, which is a Windows shell application...
But JavaCPC has Autotype ;)
Title: Re: BASIC Editor outside emulator
Post by: TFM on 20:15, 11 August 15
Oh, and you can save any BASIC program as ASCII file, so you can edit it in any text editor. Example:


save"program.txt",a


Title: Re: BASIC Editor outside emulator
Post by: Paulo Garcia on 20:23, 11 August 15
So that means if I build cpcxfs for Mac you will add it to JavaCPC (Which I am already happily using) ???  :D


(*) I've found the source in this thread: cpcxfs (http://www.cpcwiki.eu/forum/applications/cpcxfs/) - Not sure if it is the latest & greatest though


@TFM (http://www.cpcwiki.eu/forum/index.php?action=profile;u=179) - Nice tip since I had type few small programs on the emulator already :)


Cheers
Title: Re: BASIC Editor outside emulator
Post by: Devilmarkus on 21:02, 11 August 15
Sorry, as I dont know how to call MAC executables from Java...
(Maybe works the same, but as I cant test it: Better not)
Title: Re: BASIC Editor outside emulator
Post by: Paulo Garcia on 21:43, 11 August 15
Thanks anyway. I've found iDSK which already compiles well on Mac, so I don't mind at all to add files first and then load them on the emulator as a second step.


Thanks
Title: Re: BASIC Editor outside emulator
Post by: Executioner on 22:10, 12 August 15
Quote from: Devilmarkus on 21:02, 11 August 15
Sorry, as I dont know how to call MAC executables from Java...
(Maybe works the same, but as I cant test it: Better not)

Download Oracle VirtualBox and find a Mac OS X image to install on a VM, then you can test JavaCPC on that :)
Title: Re: BASIC Editor outside emulator
Post by: arnoldemu on 09:10, 13 August 15
Quote from: Executioner on 22:10, 12 August 15
Download Oracle VirtualBox and find a Mac OS X image to install on a VM, then you can test JavaCPC on that :)
You make it sound simple, and it's not, unless you run the virtualbox on the mac ;)

You are effectively making a virtual hackintosh and depending on which osx you have and which virtualbox, and depending on which "version" of mac osx you download you'll find it hard to get going.
Title: Re: BASIC Editor outside emulator
Post by: Executioner on 14:31, 13 August 15
maybe it's not easy, but I installed iDeneb ages ago over Oracle VM and it just works.
Title: Re: BASIC Editor outside emulator
Post by: Devilmarkus on 21:10, 13 August 15
Just installed Mac OS X (Yosemite) 64bit in VirtualBox...
Performance = old coffee machine...
Installing Netbeans + Java JDK 8, too, now...
But I don't think it will run well

Title: Re: BASIC Editor outside emulator
Post by: cpcitor on 08:37, 21 December 17
Old thread I know.  :)

Quote from: Paulo Garcia on 18:44, 11 August 15
Is there any option to use any text editor to create Locomotive BASIC programs and load them on an emulator. I'm learning about the Locomotive, but typing in the emulator is not very productive....

I wonder if the workflow would be:

1-Use any editor
2-Generate a disk image

Is this is correct?

This is correct.
When creating color-flood-for-amstrad-cpc (https://github.com/cpcitor/color-flood-for-amstrad-cpc) using cpc-dev-tool-chain (https://github.com/cpcitor/cpc-dev-tool-chain) I wanted to insert a small BASIC loader (not necessary for the game, mainly to show that it is possible to return from C to BASIC).

So I created a simple makefile rule to convert an ASCII file to proper linefeed convention (from platform-specific 10 Unix/Mac, 13 traditional Mac, 13+10 Windows) and a project-specific rule to insert that into disk or tape image. (character set conversion from utf-8 would be timely)

Quote from: Paulo Garcia on 18:44, 11 August 15
what would be the tools to accomplish the item 2?

cpc-dev-tool-chain (https://github.com/cpcitor/cpc-dev-tool-chain) could be adjusted to support your workflow out-of-the-box. I created a wish/enhancement issue More flexible tape/disk targets/layout · Issue #12 · cpcitor/cpc-dev-tool-chain (https://github.com/cpcitor/cpc-dev-tool-chain/issues/12)

Quote from: Paulo Garcia on 18:44, 11 August 15
3-Startup emulator loading the image
4-BAM!

Regarding your step 4 I have a solution: https://www.smbc-comics.com/comic/2011-02-17#smbc_doom (https://www.smbc-comics.com/comic/2011-02-17#smbc_doom)

(https://www.smbc-comics.com/comics/20110217.gif)

Ref: cpcitor/color-flood-for-amstrad-cpc: A puzzle game for 2 to 4 player. Written in portable C as an experiment: can a program with non-trivial algorithmic logic be compiled and run on an 8-bit platform? Answer: yes. (https://github.com/cpcitor/color-flood-for-amstrad-cpc).
Powered by SMFPacks Menu Editor Mod