Jump to content
IGNORED

Saving to PC, editing, and then running the program in Altirra


pmgraphics

Recommended Posts

I am experimenting with saving a BASIC program from Altirra to the PC, editing the saved program in notepad++, and then loading it again in Altirra.

 

In my procedures below two programs had different end-of-line characters as displayed in notepad++, a right pointing carrot (not a greater than symbol) and the box below that was actually the letters CSI in inverse (black background and white text). Things worked great for the program that used the CSI as the end of line, I saved, edited in notepad++, and ran the edited program in Altirra. The program that used the right pointing carrot, even though it loaded in Altirra after editing in notepadd++ with no error and the code looked good, the program crashed Altirra at run.

 

Is there a safer/better way to do what I am doing? What I like about my procedures below is going from Altirra to PC back to Altirra all special characters, case, and inverses were retained.

 

My procedures:

-Setup Host Device
Click System > Configure > Devices
Click Add
Under HLE select Host Devices (H:)
Browse to an existing directory
Uncheck Read only
-save a BASIC program in Altirra as a text file for the PC
LIST "H:name.ext"
-edit file
Open the name.ext file in notepad++
Clean up by replacing end of line (› or or...) with end of line\n: find replace with \n
--Search mode: Extended
When done editing and before saving, replace all the added \n with nothing by not entering anything the replace box
-load the edited file in Altirra

ENTER "H:name.ext"

Link to comment
Share on other sites

There is a program by Joyfullcoder here in the forums and It will do a much better job at editing a listed basic file. plus it will change all the end of line characters to Atari standard.

 

http://joyfulcoder.com/memopad/MemoPad-R26.zip

Memopad worked great for my LIST "H:name.ext" that broke in notepad++.

 

I tried the import Atari Basic, since the original is a .BAS file. It imported fine. I made a change and did a save as. In Altirra I loaded the .bas file using File > Boot image and got ERROR 21 and 130. Is there a step required before saving the changes to make the new BAS file work? Thanks

Link to comment
Share on other sites

Also, rather when mapping your H: drive, also check to map that as a D: drive.

That way you can also use LIST/ENTER "D6:name.ext" and the cr/lf to $9B conversion is handled for you.

Can you explain further what this does? Is D6 always used or I can start with D, as my H is just H for being only 1? thanks.

Edited by pmgraphics
Link to comment
Share on other sites

All listed programs are ATASCI and not tokenized so need to be save in the basic you are using even if it is named BAS it is still a listed file ... memopad just converts the end of line to 9B instead of the PC EOL of control J and control M

 

 

From basic in the emulator Altirria ENTER "H:filename.LST Just rename to filename.BAS still needs to be entered ENTER "H:FILENAME.BAS

Edited by rdea6
  • Like 1
Link to comment
Share on other sites

End-of-line character translation
By default, the H: device does not do any translations on read or written data.
This is inconvenient for text files since the host-based text programs use a
LF or CR/LF convention instead of the Atari's $9B end-of-line character. To deal
with this, the host device maps H6: through H9: to the same paths as H1:-H4:, but
accesses through the H6-H9: aliases do EOL conversion. On read, CR, LF, or CR/LF
pairs are converted to ATASCII EOL characters, and on write, EOL is converted
back to CR/LF.

All file sizes and file positions seen by the emulation are in the
ATASCII version of the file stream and are consistent with GET/PUT
commands.

Link to comment
Share on other sites

I was able to import a .bas file into memopad, edit the file, save the file, and in Altirra use ENTER"H:FILE.BAS" to load the file and run the program. Since I had started Altirra with a dos2 formatted atr file attached to Drive 1, with a program already on it thus I know I can load and save to it (I tested it), when I do SAVE"D:FILE.BAS" to the atr file I keep getting ERROR 165, Invalid filename.

 

What is preventing me from loading a program from the H: and saving it to and atr file attached to Drive 1?

Link to comment
Share on other sites

I was able to import a .bas file into memopad, edit the file, save the file, and in Altirra use ENTER"H:FILE.BAS" to load the file and run the program. Since I had started Altirra with a dos2 formatted atr file attached to Drive 1, with a program already on it thus I know I can load and save to it (I tested it), when I do SAVE"D:FILE.BAS" to the atr file I keep getting ERROR 165, Invalid filename.

 

What is preventing me from loading a program from the H: and saving it to and atr file attached to Drive 1?

Make sure disk is not locked. and a directory tree has free sectors. and also try SAVE "D1:FILE.BAS".. I believe that some Dos variants don't like the name without the drive number..

Link to comment
Share on other sites

Make sure disk is not locked. and a directory tree has free sectors. and also try SAVE "D1:FILE.BAS".. I believe that some Dos variants don't like the name without the drive number..

The disk is not locked. it is set to R/W. Trying D1 produces the same error as before. I just tested it and saved a onliner program. I just cannot save a program loaded from H:. The disk has 565 free sectors.

Edited by pmgraphics
Link to comment
Share on other sites

Problem solved. My file name started with a number SAVE"D:104T.SAV" I changed it to SAVE"D:TENFOURT.SAV" and it saved. Is it not allowed in ATARI to start files with a number?

 

Correction: the long name did not work, but I also saved it as short name, T2.SAV and that did work. I loaded the saved T2.SAV program and it ran. Sorry for the head scratching if provided my actual file name as starting with a number would have answered the question earlier.

Edited by pmgraphics
Link to comment
Share on other sites

Problem solved. My file name started with a number SAVE"D:104T.SAV" I changed it to SAVE"D:TENFOURT.SAV" and it saved. Is it not allowed in ATARI to start files with a number?

 

Correction: the long name did not work, but I also saved it as short name, T2.SAV and that did work. I loaded the saved T2.SAV program and it ran. Sorry for the head scratching if provided my actual file name as starting with a number would have answered the question earlier.

Dos 2 and variants will not allow it. Real DOSes like Sparta Dos and Sparta DOS X do.

  • Like 2
Link to comment
Share on other sites

Dos 2 and variants will not allow it. Real DOSes like Sparta Dos and Sparta DOS X do.

 

Heh, I was burned by this recently as well... Trying to dump the 850 ROM.... to a file called "850.ROM"... WTF I was thinking.. took me while to figure it out! I have been spoiled by SpartaDOS as well. :)

 

Here's the passage from the DOS II manual: https://archive.org/details/atari-dos-2-ref/page/n16

 

post-53052-0-05301800-1556434583.png

Would love to know the rationale behind that design decision...

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...