CPCWiki forum

General Category => Technical Support - Software related => Topic started by: cwpab on 19:30, 11 November 23

Title: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: cwpab on 19:30, 11 November 23
I'm planning to edit the BAS file of a game to modify it. My goal is to create a very similar game, a homebrew game from the mid 80s that has been lost forever.

I know I can edit BAS files from the Amstrad CPC or an emulator, and I know you can extract any file from a DKS with some tools. But I don't have too much time to do research, so I decided to ask here.

If anyone has edited BAS files before, what is the fastest way to do it so you can also test it? I assume doing it directly on the CPC or emulator is not the best way... Thanks in advance!
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: VincentGR on 21:14, 11 November 23
If you save a bas file with ,a at the end, the it becomes an ascii file which still works on the Amstrad side.
On winape you navigate to File:Drive A:Edit disc
Then drag your file on your desktop.
Notepad++ is a good tool.
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: robcfg on 23:12, 11 November 23
If I remember correctly, you can copy the basic text from your editor and paste it on JavaCPC.
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: Jean-Marie on 03:10, 12 November 23
Load your file under WinAPE, and press F3 to show up the Code editor.
Select File from the menu, then Read BASIC.
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: Prodatron on 14:06, 12 November 23
That is cool, I never recognized this feature before! :)
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: genesis8 on 10:45, 13 November 23
You can edit locomotive basic in Visual Studio Code and run it inside with the extension Amstrad Basic Helper by cebe74.

It's using CPCBasic by Marco Vieth (javascript code to run locomotive basic), there is a github page, but latest version is CPCBasicTS using TypeScript instead of javascript?
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: roudoudou on 11:18, 13 November 23
Quote from: genesis8 on 10:45, 13 November 23You can edit locomotive basic in Visual Studio Code and run it inside with the extension Amstrad Basic Helper by cebe74.

It's using CPCBasic by Marco Vieth (javascript code to run locomotive basic), there is a github page, but latest version is CPCBasicTS using TypeScript instead of javascript?
CPCBasic is a great and ultimate solution, no need to pass into an emulator (even if it's easy, CPCBasic is easier!)


Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: SerErris on 22:31, 16 November 23
Is CPCBasic able to run all the hardware based parts ? Graphics, Sound etc?
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: GUNHED on 15:06, 17 November 23
IIRC also JavaCPC offers some BASIC features...
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: seanmcmanus on 00:23, 01 December 23
I wrote an article here about copying BASIC programs in an editable form between Winape and the host machine. 

You can use print to file to export code from the emulator as a text file, and Autotype to get code in again. 

Once you have a text file, you can use any code or text editor.

https://www.sean.co.uk/books/amstrad/export_basic_code_as_text_emulator.shtm
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: Johnny Olsen on 12:07, 23 February 24
Quote from: Jean-Marie on 03:10, 12 November 23Load your file under WinAPE, and press F3 to show up the Code editor.
Select File from the menu, then Read BASIC.

Due to a bug in WinApe, there is a problem using your method. If the file contains some symbols of the formula
SYMBOL 237,&X10001100 WinApe changes the bytes to
SYMBOL 237,&X00110001
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: McArti0 on 13:39, 23 February 24
SAVE"FILE.BAS",a

and copy from WinAPE disc editor to Windows explorer. Modify in notepad as ascii txt and back to the WinAPE disc editor.

Open FILE.BAS in https://crocods.org/web/ emulator
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: trocoloco on 18:28, 23 February 24
if you're using Winape, go to Settings,Other and set the printer to File and assign a txt output file, then when you load any .BAS on the emulator just type "list#8" and it will save the listing in the txt. 

When you want to test it, you just press on Winape CRTL+F5 and paste it 
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: genesis8 on 19:18, 23 February 24
Quote from: SerErris on 22:31, 16 November 23Is CPCBasic able to run all the hardware based parts ? Graphics, Sound etc?
Sorry for the late answer, yes, you can check : https://www.genesis8bit.fr/archives/index.php?news_id=2159 (https://www.genesis8bit.fr/archives/index.php?news_id=2159)

And of course the examples of Marco Vieth : https://benchmarko.github.io/CPCBasicApps/ (https://benchmarko.github.io/CPCBasicApps/)

Github : https://github.com/benchmarko/CPCBasicTS/ (https://github.com/benchmarko/CPCBasicTS/)
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: Jean-Marie on 06:08, 24 February 24
@Johnny Olsen , you can test your luck with Caprice Forever, it has the same function :
Title: Re: What's the easiest way to edit a BAS program from Windows (and test it on CPC)?
Post by: Johnny Olsen on 10:34, 24 February 24
Thanks guys. I know what I have to do. It was just meant as a warning about the bug in WinApe.
Powered by SMFPacks Menu Editor Mod