pmgraphics Posted April 25, 2019 Share Posted April 25, 2019 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" Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted April 25, 2019 Share Posted April 25, 2019 (edited) 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 Edited April 25, 2019 by rdea6 2 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted April 25, 2019 Share Posted April 25, 2019 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. Quote Link to comment Share on other sites More sharing options...
pmgraphics Posted April 25, 2019 Author Share Posted April 25, 2019 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 Quote Link to comment Share on other sites More sharing options...
pmgraphics Posted April 25, 2019 Author Share Posted April 25, 2019 (edited) 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 April 25, 2019 by pmgraphics Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted April 25, 2019 Share Posted April 25, 2019 (edited) 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 April 25, 2019 by rdea6 1 Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted April 26, 2019 Share Posted April 26, 2019 End-of-line character translationBy 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 aLF or CR/LF convention instead of the Atari's $9B end-of-line character. To dealwith this, the host device maps H6: through H9: to the same paths as H1:-H4:, butaccesses through the H6-H9: aliases do EOL conversion. On read, CR, LF, or CR/LFpairs are converted to ATASCII EOL characters, and on write, EOL is convertedback to CR/LF. All file sizes and file positions seen by the emulation are in theATASCII version of the file stream and are consistent with GET/PUTcommands. Quote Link to comment Share on other sites More sharing options...
pmgraphics Posted April 26, 2019 Author Share Posted April 26, 2019 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? Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted April 26, 2019 Share Posted April 26, 2019 Maybe ensure your "Also install as D:" is unchecked? You can still save to (LIST) and load from (ENTER) H6 and then you should be able work on the file outside of the Atari in cr/lf mode Quote Link to comment Share on other sites More sharing options...
Irgendwer Posted April 26, 2019 Share Posted April 26, 2019 Hopefully I do not derail the thread, but did you tried "Turban"? http://atariage.com/forums/topic/244686-turban-turbobasic-nifty/ It supports Atari-Basic too. Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted April 26, 2019 Share Posted April 26, 2019 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.. Quote Link to comment Share on other sites More sharing options...
pmgraphics Posted April 26, 2019 Author Share Posted April 26, 2019 For Host devices (H:) Also installas D: is not checked. Both SAVE and LIST produce the error 165, when trying to save the program to the ATR file attached to Drive 1. Quote Link to comment Share on other sites More sharing options...
pmgraphics Posted April 26, 2019 Author Share Posted April 26, 2019 (edited) 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 April 26, 2019 by pmgraphics Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted April 26, 2019 Share Posted April 26, 2019 I think it is time for a newdisk attached to D1 and start over fresh. Quote Link to comment Share on other sites More sharing options...
pmgraphics Posted April 26, 2019 Author Share Posted April 26, 2019 (edited) 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 April 26, 2019 by pmgraphics Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted April 26, 2019 Share Posted April 26, 2019 No it isn't typically permitted 2 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted April 26, 2019 Share Posted April 26, 2019 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. 2 Quote Link to comment Share on other sites More sharing options...
+Nezgar Posted April 28, 2019 Share Posted April 28, 2019 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 Would love to know the rationale behind that design decision... 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.