How to edit simple Basic programs outside atari800 emulator?

Machine language, BASIC, technical questions...

Moderators: Atari Frog, Andre

Post Reply
dusan
Posts: 1
Joined: Tue Sep 16, 2014 7:14 am

How to edit simple Basic programs outside atari800 emulator?

Post by dusan » Wed Sep 17, 2014 8:49 am

Hi.

I currently write simple Basic programs in this way: First I start atari800 emulator:

atari800 -xlxe_rom ATARIXL.ROM -basic_rom ATARIBAS.ROM -basic

This shows the "READY" screen where I can write Basic program. Then I can use Alt+S to save emulator state, later Alt+L to load state. This works and generally is usable for very simple Basic programming.

But I would like to write those Basic programs outside emulator in some normal text editor on my PC (linux) and then "convert" them into something that can be loaded into emulator and run.

How can I do that? Thanks.
livorno
Posts: 2
Joined: Sat Mar 23, 2019 2:42 pm

Re: How to edit simple Basic programs outside atari800 emulator?

Post by livorno » Mon Apr 15, 2019 3:33 pm

Hi dusan,

I'm only 4.5 years late in replying, but here's hoping this tip can help you or someone else. One neat trick about both the Atari800Win and Altirra emulators is the ability to import and export files. Here are my notes for setting up the device:

In Atari800Win 4.0:
-Under Menu->Atari->Settings, Check "Enable H: patch" and uncheck "Use H: in Read Only"
-Under Menu->Atari->Hard disks, put the path to your local hard drive. I created a directory near my Atari800Win program directory called H1. The emulator on one of my machines causes a memory fault or something when I click the H1 button, so I just paste my directory path in the blank next to it without using the button.
-To export from the Atari BASIC to the PC directory, type LIST "H6:FILENAME.TXT". The H6 will force Linux style line breaks (\n) instead of the Atascii line break which is ALT+0155/ASCII 155/›. If you use LIST "H1:FILENAME.TXT", you'll have to contend with all lines being joined by the 155 character.
-To import from the PC directory to Atari BASIC, just put a text file into the H1 device directory, preferably with an 8.3 filename. I would edit the text file before importing to remove all instances of Carriage Return (\r) and make sure the last line of code ends with Line Feed (\n). Then within BASIC, type ENTER "H6:FILENAME.TXT"

In Altirra 3.10:
-Under System->Configure System->Devices, choose Add->High-level emulation (HLE) devices->Host device(H:) and specify a hard drive directory.
-To export from within BASIC, type LIST "H6:FILENAME.TXT". Again, LIST "H1:FILENAME.TXT" joins all lines with the Atascii 155 line break.
-To import from PC to BASIC, type ENTER "H6:FILENAME.TXT". The Altirra emulator seems to forgive the presence of the Windows Carriage Return (\r) before every Line Feed (\n). Atari800Win will error out on every line it encounters with \r.

-In both emulators, I use the same H: device to save and load individual .BAS files and they are listable from DOS 2.0S option A, H1:. MyDOS 4.53/4 seems to require that I specify H:*.* or H1:*.*. I haven't run into storage or filename number limits...yet. This cuts way down on shuffling .atr images in the emulated disk drives.

I have not tried to recreate the Atascii control characters or inverse characters outside of the emulator short of noticing that the right curly brace "}" often listed in type-ins imports as the clear screen character. If a BASIC LISTing contains a lot of these characters, normal text editors tend to show gibberish. I think the good news is that once you set the right characters from within the emulators, a cycle of export/import retains the correct character codes.

I wanted to view/print the exported Atascii source outside the emulator so I wrote a javascript program to read text files and show them in Firefox browser using Mark L. Simonson's Atari Classic TrueType Font 2.0
found at http://members.bitstream.net/marksim/at ... fonts.html. I can post my HTML/Javascript code if anyone is interested.
Good luck, Have fun!
Livorno
Post Reply