Where to write BASIC programs?

By BananaPie

Resident (52)

BananaPie의 아바타

07-04-2021, 16:35

Is it easier to write it on the physical machine (which I like) or better to write in an emulator? But then how do I get the BASIC program to my MSX computer?

Login or 등록 to post comments

By Mafcase

Master (242)

Mafcase의 아바타

07-04-2021, 17:36

This is how I do it (I work with windows and BlueMSX):

- First write a program and save it in utf8 format (.txt for example)
- Open a diskimage in Disk Manager (from Lex Lechz) and copy/paste your .txt file into this diskimage and save it
- Insert the diskimage in the emulator and load the .txt file
(Note: The file is in ASC format so loading will be longer. Once loaded and saved in basic it will load faster)

For the other way around:
- Save a basic file in ASC format. for example save"program.bas",a
This way the program can be read by your non MSX text-editor

By Manuel

Ascended (17783)

Manuel의 아바타

07-04-2021, 21:23

I'd use a modern editor, save it to ASCII file (with DOS CR/LF line endings). In the emulator, use dir-as-disk and load the file directly in basic. (This works in openMSX, not sure about other emulators.) This is the fastest method and the most convenient, I think.
As loading an ASCII file is indeed slow, you could speed it up by hitting the 'full speed' button for the time it takes, like F9 in openMSX.

In the end, you're totally free to decide how to edit and write your BASIC programs Smile

By thegeps

Paladin (748)

thegeps의 아바타

08-04-2021, 06:51

Both valid ways. Writing your program on a .txt file and copying it to a directory chosen as disk works on blueMSX too, but it can't be saved by the emulator if modified inside it (not in that folder, you have to save it on a .dsk image file). If you have a SD mapper or similar cartridge you can copy that .txt file there and use it on your real hardware. Else you can save it as a .cas file from your favourite emulator, copy the .cas file on your android smartphone and load on your real hardware using msx2cas app

By turbor

Champion (472)

turbor의 아바타

08-04-2021, 10:37

thegeps wrote:

Writing your program on a .txt file and copying it to a directory chosen as disk works on blueMSX too, but it can't be saved by the emulator if modified inside it (not in that folder, you have to save it on a .dsk image file).

Saving to dir-as-disks works perfectly fine in openMSX. Don't forget to save your basic programs with the ,a at the end otherwise you will save a tokenized version of the program and then your text editor might go whonky on it.
save "program.bas",a
Most modern editors will pick up on the fact that the file has been changed while editing and will automatically (ask you to) load the new version of the file. So editing in the emulated MSX can be done when fixing a typo f.i.

By gdx

Enlighted (4282)

gdx의 아바타

08-04-2021, 10:51

The big problem with a text editor is the MSX characters which cannot be used.
The big problem with emulators is the keyboard. We have to look for certain keys and sometimes they are not even accessible.

By thegeps

Paladin (748)

thegeps의 아바타

08-04-2021, 13:25

turbor wrote:
thegeps wrote:

Writing your program on a .txt file and copying it to a directory chosen as disk works on blueMSX too, but it can't be saved by the emulator if modified inside it (not in that folder, you have to save it on a .dsk image file).

Saving to dir-as-disks works perfectly fine in openMSX. Don't forget to save your basic programs with the ,a at the end otherwise you will save a tokenized version of the program and then your text editor might go whonky on it.
save "program.bas",a
Most modern editors will pick up on the fact that the file has been changed while editing and will automatically (ask you to) load the new version of the file. So editing in the emulated MSX can be done when fixing a typo f.i.

I know it is doable on openMSX. Infact I said it can't ne done on blueMSX

By NetNomad

Rookie (25)

NetNomad의 아바타

08-04-2021, 16:17

Depending on your needs, MSXPen could be useful! You write BASIC into a text box on the website and it gets automatically loaded into webMSX, and then when you're done you can download the dsk file with your (i believe tokenized) BASIC code on it. It's very fast! The only catch is every time you run your code the disk gets wiped before your new code is added, so if you're BLOADing anything you have to race to add it to the disk again before the machine fully boots (unless there's a trick do it i don't know). I think it's the fastest way to at least prototype, and then when you want to add backgrounds or music or whatever you can move to a regular emulator or MSX.