KCMO Posted December 28, 2016 Share Posted December 28, 2016 Can someone please suggest how I can save my basic program to my PC hard drive using the Altirra emulator? I have been using an earlier version of Altirra and saving my code by saving the state. I just installed the latest version of Altirra and, unfortunately, I it won't let me load a saved state from an earlier version. Using an actual Atari, I guess I would type something like SAVE "D1:TEST.BAS". Using the Altirra emulator, of course that doesn't work. 1 Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted December 28, 2016 Share Posted December 28, 2016 As long as you have a DOS disk in the virtual D1: you can indeed just save it to an image, in the file disk drives rollout Altirra can create a formatted virtual image, normally I would make it on D2: after booting up your work via a dos disk and then make the Image, set it to read write mode and after you have created your basic program just type SAVE"D2:name.BAS" There are ways to use the H: handler to save directly as to a PC drive ie the bas file and not the ATR but I've never played with that. To be honest its better to keep it as near as to the way its done in the real word, that way you make an ATR file with the bas file(s) on and if you want to look at them as bas files on the PC then you can use the explorer tool in tools and drag it on to the PC 1 Quote Link to comment Share on other sites More sharing options...
+skr Posted December 28, 2016 Share Posted December 28, 2016 Actually it´s nearly as easy as you describe it: In Altirra go to "System -> Devices", choose "Add" and then scroll down to "Host device" and add it. Double click Host device and choose a path on your machine. To save a BASIC program now use LIST"H6:name.ext" and there you go with a text file of your BASIC program on your Mac, PC or whatever. 5 Quote Link to comment Share on other sites More sharing options...
vitoco Posted December 28, 2016 Share Posted December 28, 2016 I guess that the saved state has no DOS included and that's why you cannot do a SAVE "D1:TEST.BAS". Which version of Altirra were you using? Can you mount a virtual tape and CSAVE your BASIC program to it? Then you could CLOAD it in a newer version of the emulator. I don't remember in which version was introduced the ability to write into tapes (CAS files). Another option could be LIST "P:" and capture that printer output. I know that Altirra can also manage BASIC programs using its debugger, but I don't know if it is possible to retrieve the tokenized file and save it to PC. Finally, I guess it could be possible to use an hex editor in the PC and cut the portion of the state file to rebuild a TEST.BAS file adding the proper binary headers. 1 Quote Link to comment Share on other sites More sharing options...
KCMO Posted December 28, 2016 Author Share Posted December 28, 2016 Thank you all for your prompt offers of help! I tried Dragonstomper's suggestion and it worked like a charm! Dragonstomper, thank you so much! Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted December 29, 2016 Share Posted December 29, 2016 Actually it´s nearly as easy as you describe it: In Altirra go to "System -> Devices", choose "Add" and then scroll down to "Host device" and add it. Double click Host device and choose a path on your machine. To save a BASIC program now use LIST"H6:name.ext" and there you go with a text file of your BASIC program on your Mac, PC or whatever. I presume save does not work as it tries to write sectors while list simply does exactly that...ie sends a listing be it to H: or S: Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted December 29, 2016 Share Posted December 29, 2016 SAVE should work fine, since both that and list call the CIO. Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted December 29, 2016 Share Posted December 29, 2016 Thank you Jon, I rarely ever mess around with the H: device and always forget what to do because I use it so rarely... I'm simply a vintage 'slap that disk in and see if it loads and if there's an issue try and work it out or file a report' type of man... Phew, I'm out of virtual breath after that Quote Link to comment Share on other sites More sharing options...
+skr Posted December 29, 2016 Share Posted December 29, 2016 SAVE should work fine, since both that and list call the CIO.Should. But doesn´t. When I use SAVE on H6: my pure BASIC listing looks like this: ‡Û +@l&(@AAADDDBBDDDCCCDBDDAAAI(@ADDADBDDBDCDDDDBDADDDl(@ADADDBDDBDDCCDDBDADDDI&(@ADDADBBBBDDDDCDBDADDDI(@AAADDBDDBDCCCDDBDDAAA((*** 10LINERS 2017 ***ÄH6:TEST.BAS LIST works fine and shows the complete listing including line breaks. Quote Link to comment Share on other sites More sharing options...
vitoco Posted December 29, 2016 Share Posted December 29, 2016 Should. But doesn´t. When I use SAVE on H6: my pure BASIC listing looks like this: ‡Û +@l&(@AAADDDBBDDDCCCDBDDAAAI(@ADDADBDDBDCDDDDBDADDDl(@ADADDBDDBDDCCDDBDADDDI&(@ADDADBBBBDDDDCDBDADDDI(@AAADDBDDBDCCCDDBDDAAA((*** 10LINERS 2017 ***ÄH6:TEST.BAS LIST works fine and shows the complete listing including line breaks. That is the tokenized form of the BASIC program. It can be loaded back using LOAD instead of ENTER. 1 Quote Link to comment Share on other sites More sharing options...
+skr Posted December 29, 2016 Share Posted December 29, 2016 That is the tokenized form of the BASIC program. It can be loaded back using LOAD instead of ENTER. I normally do not write tokenized BASIC on my Mac. Quote Link to comment Share on other sites More sharing options...
KCMO Posted December 29, 2016 Author Share Posted December 29, 2016 Yes, I used Save / Load and it worked fine. I also make a habit of saving my basic programs with a .bas extension. Since I now associate this extension with the Altirra program, I only need to double click on the filename in windows explorer and it automatically starts Altirra and loads and runs the program. I also experimented with loading a LIST file into MSWORD and replacing the funky line character with a paragraph marker (^p). It looks perfectly readable. But I couldn't ENTER it back into Altirra with paragraph markers. Quote Link to comment Share on other sites More sharing options...
+skr Posted December 30, 2016 Share Posted December 30, 2016 Might be a WORD issue. Make sure to save a pure txt-file. I use Brackets (free from Adobe) as Editor. For example I copied the last BASIC-listing on that page: https://www.hintermueller.de/dereatari-chapter-4 Pasted it in Brackets and saved it to my hd-folder as test.bas. Then opened Altirra and loaded it by typing "ENTER"H6:TEST.BAS". You just have to make sure that your file ends with a EOF (return), otherwise the last line will be ignored by ATARI BASIC. 1 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted December 30, 2016 Share Posted December 30, 2016 Might be a WORD issue. Make sure to save a pure txt-file. I use Brackets (free from Adobe) as Editor. For example I copied the last BASIC-listing on that page: https://www.hintermueller.de/dereatari-chapter-4 Pasted it in Brackets and saved it to my hd-folder as test.bas. Then opened Altirra and loaded it by typing "ENTER"H6:TEST.BAS". You just have to make sure that your file ends with a EOF (return), otherwise the last line will be ignored by ATARI BASIC. The key being that H6 does auto conversion between the $0D/0A line endings, and the Atari's $9B while H1 preserves the file. 2 Quote Link to comment Share on other sites More sharing options...
repetto74 Posted March 1, 2017 Share Posted March 1, 2017 Hi, I can't really figure out how to save on a virtual disk as explained by Dragonstomper. I always get an error 135 or 150 (?). The only possible solution is to save a state if I want to keep a program. Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted March 1, 2017 Share Posted March 1, 2017 Just to save complication, it was Skr you meant, Dragonstomper is part of the forum ranking system, user name is the blue bit above that.. Quote Link to comment Share on other sites More sharing options...
repetto74 Posted March 1, 2017 Share Posted March 1, 2017 Hi Mclaneinc Yes sorry I was too quick on this one Quote Link to comment Share on other sites More sharing options...
toddtmw Posted March 1, 2017 Share Posted March 1, 2017 Regarding linefeeds when you list and enter, there is a way to deal with that built into Altirra. From the help file: 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. Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted March 2, 2017 Share Posted March 2, 2017 Indeed, Altirra again saves you the hassle.. Well spotted that man.. Quote Link to comment Share on other sites More sharing options...
toddtmw Posted March 3, 2017 Share Posted March 3, 2017 It is truly an incredible piece of software. 2 Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted March 3, 2017 Share Posted March 3, 2017 Yes, it is. Quote Link to comment Share on other sites More sharing options...
phaeron Posted March 4, 2017 Share Posted March 4, 2017 Just want to point out that the H6:-H9: setup wasn't my idea -- it was implemented earlier by Atari800. 1 Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted March 4, 2017 Share Posted March 4, 2017 (edited) Just want to point out that the H6:-H9: setup wasn't my idea -- it was implemented earlier by Atari800. The joys of more than one emulator in ongoing development, great idea's from all directions.. Also its the way its implemented for us beholden to the Windows world, Atari800 is great but the DOS interface isn't the most fun to use. Edited March 4, 2017 by Mclaneinc 1 Quote Link to comment Share on other sites More sharing options...
Simon Carter Posted August 12, 2022 Share Posted August 12, 2022 On 3/1/2017 at 4:27 PM, repetto74 said: Hi, I can't really figure out how to save on a virtual disk as explained by Dragonstomper. I always get an error 135 or 150 (?). The only possible solution is to save a state if I want to keep a program. Cant see any other answers to this question, but I had the same problem. Solved by going this route: "System>Configure System>select Host Device (assuming you've already added it)>Settings>uncheck Read Only" This works fine for me Regards Si Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted August 12, 2022 Share Posted August 12, 2022 I've never been able to get the "H" device to work, it's mapped to a folder on my PC, but always says D5:>DIR H: 138 Device does not respond But what I use instead is PCLINK so I get a PCL: device which works fine. Obviously I'm using U1M and SIDE 3, same as my real hardware. 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.