Jump to content
pedgarcia

Sending keystrokes to Atari800 (or Atari800MacX) emulator via command line parameters

Recommended Posts

I know it is possible in Altirra to call it via command line passing the parameter /type "keys" which will type the "keys" after launching the emulator.

 

I don't see similar option on Atari800 or Atar800MacX. Do you guys know if there is any?

 

If not what are the alternatives? I am running on Mac.

 

Thanks

 

 

Edited by pedgarcia

Share this post


Link to post
Share on other sites

Just wondering what your trying to do, if it's launch programs or set environment variables or copy stuff to RAM disk

you can always use a batch file to do this for you (think the name of the file depends on the DOS you use, usually AUTOEXEC.BAT)

 

In Altirra if AUTOEXEC.BAT is on the root of your boot drive, it will run once SDX is loaded

Share this post


Link to post
Share on other sites

That's actually a good point. My objective in this case would be able to compile an Action program that way. After I open the emulator with the Action cartridge, I would want to issue the commands to make it compile a program I added to the hard drive folder, for example.

 

Thanks

 

 

Share this post


Link to post
Share on other sites

I'm wondering if AppleScript might work that way.  I've not implemented any AppleScript dictionary in the emulator itself, but maybe open the program then do a Paste?  That would get the keystrokes in, not sure if there is a way in AppleScript to do a copy directly.   The other issue may be that they are control characters in there, not sure those are handled by Paste in the emulator would have to test that.

Share this post


Link to post
Share on other sites
On 10/14/2020 at 10:56 PM, pedgarcia said:

I know it is possible in Altirra to call it via command line passing the parameter /type "keys" which will type the "keys" after launching the emulator.

 

I don't see similar option on Atari800 or Atar800MacX. Do you guys know if there is any?

 

If not what are the alternatives? I am running on Mac.

 

Thanks

 

 

I don't think Atari800 supports that,  but I have gotten Altirra working under Wine, if that's an option for you

Share this post


Link to post
Share on other sites

In some respects, this is similar to me wanting to run Pokey Explorer multiple times with different setting. The route I have decided to go is one where no keypresses are needed. That's easy, because I have the source of my own program :)  Patching Action! to not require any keypresses to do what you want, is an entirely different thing.

 

Here's an idea. I assume the Action! cartridge boots DOS, otherwise you cannot write to disk. I also assume it loads AUTORUN.SYS, then goes to DUP where you press B to enter the cartridge. The last assumption is that Action! uses CIO to read the keyboard.

 

Now, you could write a simple CIO K: handler that, instead of reading keypresses, just sends a predefined key from a list and advances the list pointer. That should easily fit in page six. If you do so, please share your code :)

 

Share this post


Link to post
Share on other sites

I am ok using Altirra but my plan was to call it with the Action! cartridge on and issue a CTRL+SHIFT+M to enter de monitor and then compile and I don't think Altirra /type parameter supports that.

I could follow the idea @zbyti  gave me to load using a saved state already in the monitor, but I couldn't find an option for Altirra to load a saved snapshot. I know Atari800 has this option.

 

For a macOS only solution I like the idea of using the Automator (Apple Script) and keep using my favourite Atari800MacX, but again this is a macOS only solution.

 

I like your idea @ivop but I think such program is above my head :)

 

I will also explore MAME. I've never used it to emulate Atari 8-bit but I remember I managed to do something similar of what I am thinking for the TRS80 CoCo.

 

Thanks for the suggestions, I will post an update when I have something :)

 

 

Cheers

 

Share this post


Link to post
Share on other sites

Yesterday I spent some time trying MAME and it has everything I needed except that Action! doesn't seem to work there :( - Only that small detail missing....

 

 

Share this post


Link to post
Share on other sites

Screenshot_2020-10-18_17-40-35.thumb.png.526a46696e839af43f51b46d5d889640.png

 mame a800xl -cart ~/Retro/Atari/tools/Action/car/ACTION-36-ROM-OSS.car 

 

Edited by zbyti
pic added

Share this post


Link to post
Share on other sites
On 10/16/2020 at 5:04 PM, ivop said:

you could write a simple CIO K: handler that, instead of reading keypresses, just sends a predefined key from a list and advances the list pointer.

 

14 hours ago, pedgarcia said:

I like your idea @ivop but I think such program is above my head :)

 

I have been thinking about this some more, as it might help with automating Pokey Explorer or any other program. Implementing the K: CIO handler that sends predefined keys won't be a problem for me. But(!) for example my Pokey Explorer checks CH (764/$2FC) to check if a key is pressed. A call to get a byte through CIO is blocking, so you can't do anything else in the mean time, like reading joystick values, pot values, CONSOL status, et cetera. I want to check for the START key, so my loop is:

 

loop

    check CONSOL and act upon it if necessary

    check CH if a key has been pressed

    bne loop

 

    read key through CIO and act on it if necessary

    jmp loop

 

TL;DR my idea of a "fake" K: handler can only work if Action! or any other program only uses CIO calls and not relies on CH changing on a keyboard IRQ.

 

Edited by ivop

Share this post


Link to post
Share on other sites
37 minutes ago, zbyti said:

@ivop maybe simplest way (in your case) will be learn how to prepare "record file" for the atari800?

 

For Pokey Explorer, the easiest way is to replace reading keys by running a predefined list of pokey and sweep settings, which I am doing at the moment (see github). But for programs of which you don't have the source, it would be nice to have a generic solution (AUTOKEYS.SYS :))

 

Is there another way to check whether a call to CIO will block?

 

Edit: and we want Altirra Pokey emulation during sweeps, not atari800 :)

Edited by ivop

Share this post


Link to post
Share on other sites
6 hours ago, zbyti said:

Screenshot_2020-10-18_17-40-35.thumb.png.526a46696e839af43f51b46d5d889640.png

 mame a800xl -cart ~/Retro/Atari/tools/Action/car/ACTION-36-ROM-OSS.car 

 

Hm, that's odd. When I tried I could "hear" that Action was online but I didn't have any image on Display whatsoever 😕 - Gonna try again.... I am not aware how debugging works on Mame which is a huge downside if it is not good, but it is worth trying.

 

Thanks @zbyti!

  • Like 1

Share this post


Link to post
Share on other sites

Ok, I don't know what I did before. Maybe it was a glitch and I didn't spend enough time debugging. Now MAME works and I almost got to the point where I can do what I wanted to do (I will share later) but now I am thinking if I really need to do that at all. The end goal is to call an emulator, compile the code and run it, all through a external command (Host text editor). I will finish the MAME setup and share here to gather opinions :)

 

Cheers

 

Paulo

Share this post


Link to post
Share on other sites

@pedgarcia In first place I used atari800 recorded "session" (-record) with writing to XEX object in turbo mode (-t:D but this is not a good solution if program did not compile ;) 

Edited by zbyti
(not) good solution :]

Share this post


Link to post
Share on other sites

Nice @zbyti, looks very easy to get around!

 

After some thought I am going a not so good approach for now, just using the external editor. I will probably finish it tonight and gonna post tomorrow morning.

 

Cheers

Share this post


Link to post
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.

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