Jump to content
IGNORED

Altirra question - Saving to Hard Drive


KCMO

Recommended Posts

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.

  • Like 1
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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.

  • Like 5
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

  • 2 months later...

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.

Link to comment
Share on other sites

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 by Mclaneinc
  • Like 1
Link to comment
Share on other sites

  • 5 years later...
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

Link to comment
Share on other sites

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.

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...