BASIC IDE for CPC (Part 1 – Emulators)

Having an IDE to develop BASIC programs is certainly something nice to have. For the C64 there are several IDEs, even for the Spectrum there are some. But for the CPC? Wouldn’t it be nice to write your code within an advanced editor and just press one key to run it in an emulator?

I searched for a way to accomplish this. So, how did it work out?

I check different emulators that I had installed.

Caprice is still updated regularly. I used the most current version 21.6. But there is nothing like a special BASIC support or an editor included. Features like pasting from clipboard or starting bin files directly (which was suggested by me) might come in handy later on.

WinApe has a build in debugger and a Z80 assembler. There it can read BASIC programs from memory. But unfortunately, I found no way to send these programs back to the emulator.

CPCEC is also updated often. But there I also couldn’t find any option for my use case.

So, my next step was using JavaCPC (version 2.9.8f). This emulator is rather huge, but it also offers many possibilities. For this emulator I remembered that I could have a virtual printer. You must open the printer and turn in on. Then you can send the current BASIC program to the printer by typing “LIST #8”. Normally, a printer is only an output device. I this case you can change the printer output. This means you can write on your BASIC program, and after that you can send it back to the emulator just by clicking “Send to CPC”.

These steps are already very similar to an IDE. You can write your program within simple text editor, there is no need for list and edit commands or complicated copy operations, and you can send the program back to the emulator. But there are mainly two drawbacks. First, the editor is very simple and there is no advanced features like syntax highlighting. Second, sending the program to the CPC means that it is pasted into the program window only, which would take a very long time for bigger programs, and it would also be very error prone, for example if you renumber lines.

Doing some research, I also came across CPC Basic 3 (http://www.cpcbasic.tk/). Unluckily, this is not the exactly the version of BASIC I was looking for. In fact, this is a compiled BASIC which slightly differs from the original Locomotive BASIC and therefor I didn’t take this one into consideration.

A very promising approach though is CPCBasic (https://github.com/benchmarko/CPCBasic). CPCBasic is a JavaScript-based emulation of Locomotive BASIC. This said, you can run BASIC programs for the CPC within your browser. There you find one field to type in your program and one part, where you can execute the code just like in an emulator. But also, this solution does have its advantages. Again, the code is compiled, although it should be rather close to the original Locomotive BASIC. Moreover the “text field” doesn’t offer any advance editing features.

It would require some more testing to find out, which features are missing withing the last two proposed solutions. One thing though is certain: The support for special characters like control codes might get very complicated within all solutions above.

When starting a BASIC project, you definitely need to know which features are important to you. Then you can check if a solution mentioned above is helpful for you. Most likely you will have to live with some compromises.

Leave a comment

Your email address will not be published. Required fields are marked *