Jump to content
IGNORED

Any way to remember controller settings between compiles?


Recommended Posts

I fear I am in store for bad news, but let me ask anyway just in case! :)

 

Is there any way to make Stella remember your controller settings for a game you're working on, and not forget when you compile?

 

I'm working on a game that uses keyboard controllers. I think the steps I have to follow every time I want to test the game are these:

 

1. Compile and Run in Stella (F5 in Atari Dev Studio, so easy!)

3. Go into OPTIONS->GAME PROPERTIES->CONTROLLER and select "keyboard" for both the left and right 

4. exit Stella (I don't understand why this is necessary but it seems to be)

5. start Stella up again

6. enjoy!

 

I understand that Stella uses a checksum to ID your rom, and that's why it forgets your settings when you compile. But maybe there's some other file somewhere that you can use to save settings for a whole project that is remembered by some other identifier? One that persists between compiles? 

 

Any info is greatly appreciated! Thanks! :D

Link to comment
Share on other sites

I realize I forgot to include step 2. That's because I didn't have a step to back then. But now I do!

 

1. Compile and Run in Stella 

2. Come back and check forums to see if anyone's posted a response to this question.

3. Go into OPTIONS->GAME PROPERTIES->CONTROLLER...

 

:)

Link to comment
Share on other sites

According to the Stella Manual, you can set command line options for controllers

https://stella-emu.github.io/docs/index.html#Properties
 

- bc Keyboard


I suppose where you set the path in Atari Dev Studio to Stella.exe, you can just include the command line arguments (hopefully, haven’t tested that yet)

 

Keyboard Also known as the Star Raiders controller, functionally identical to the Kid's Controller and Keyboard Controller. Game included an overlay with commands, for use with Star Raiders.
-lc <type>
Set "Controller.Left" property. See the Game Properties section for valid types.
-rc <type>
Set "Controller.Right" property. See the Game Properties section for valid types.
-bc <type>
Sets both "Controller.Left" and "Controller.Right" properties. See the Game Properties section for valid types.
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Thanks for the fast replies, you guys!

 

That's exciting news, @SpiceWare! I look forward to that update!

 

And that's a great tip, @CapitanClassic! That looks like it should work great.

 

Hm, but when I try it, it only works for the right keypad. Whether I use -lc or -bc, the left controller is just dead. Right controller works great though. (I'm testing this with my laptop keyboard).

 

Maybe I'm doing something wrong...?

 

(PSI'd like to take this opportunity to thank everyone who works on this amazing emulator! very lucky to have it!)

Link to comment
Share on other sites

The per-game property file feature in Stella is almost fully implemented already:

The emulator will read such file (same filename with .pro extension, in the same directory as the game), and the file can be created within Stella itself using the "save" button in the "game properties" dialog.
The only thing missing is the ability to read the property file when it's in a zip archive together with the rom.

 

Anyway, the property file contains the md5sum of the rom, so it must be updated each time you make a change and reassemble.

What I do is to first generate the property file in Stella, delete the first line (the md5sum field) and save as "template.pro" in the same dir as the source.


I then generate the md5sum field with this simple bash script

#!/bin/sh
md5=$(echo "$(md5sum $@)" | awk '{print $1;}')
echo "\"Cart.MD5\"    \"$md5\" "

Finally, I concatenate it with the template into a new property file.

Since I already use a bash script to assemble different versions of a rom (e.g. different TV formats) by passing parameters to dasm, I added the property file generation to it as well.

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

4 hours ago, CapitanClassic said:

According to the Stella Manual, you can set command line options for controllers

https://stella-emu.github.io/docs/index.html#Properties
 

- bc Keyboard


I suppose where you set the path in Atari Dev Studio to Stella.exe, you can just include the command line arguments (hopefully, haven’t tested that yet)

 

Keyboard Also known as the Star Raiders controller, functionally identical to the Kid's Controller and Keyboard Controller. Game included an overlay with commands, for use with Star Raiders.

-lc <type>
Set "Controller.Left" property. See the Game Properties section for valid types.

-rc <type>
Set "Controller.Right" property. See the Game Properties section for valid types.

-bc <type>
Sets both "Controller.Left" and "Controller.Right" properties. See the Game Properties section for valid types.

Hi,

 

In Atari Dev Studio you can add command-line args via the Settings here:

ads-stella.thumb.png.71e0e26c9f45844bb0a524f8766ac30c.png

 

Please let me know if something doesn't work here and I can check that out.  

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

Just wanted to back up everything that's been said about Stella here.

  • There are commandline parameters that force settings, no matter what ROM is being used.
  • A separate .pro file can be in the same dir as the ROM (and named the same as the ROM), but since it has the MD5 embedded in it, it would still need to be edited when the ROM changes.
  • Loading the .pro file from a ZIP archive is not yet supported, but I do already have the code here; just not committed yet.

For your use-case, if you're using an IDE, I suggest setting it up to pass the commandline parameters needed.  If you're just compiling from the commandline directly, write a small script that launches Stella with the required parameters.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Thanks, everybody! I tried this from the command line and it works great! Keyboard controller game, full speed ahead! :D

 

@mksmith, when I add "-bc Keyboard" to the path in Atari Dev Studio, I get a warning saying it can't find my Stella and uses it's built in Stella and ignores the parameters. I tried it "-bc Keyboard" and "- bc Keyboard" and various mixtures of quotes and brackets. Am I doing it wrong?

 

1248275717_stellankeyboards.thumb.jpg.d8f39ae59bddb0122642074639379949.jpg

Link to comment
Share on other sites

I suspect the last message is because you're changing the command that the IDE is using to launch Stella.  So it's looking for a command called "Stella.exe -bc keyboard".  There's obviously no such command, so the call fails.  What is needed is a way to change the commandline arguments passed to Stella.  Note that this isn't the same as the command itself.  So you need to add "-bc keyboard" to the optional arguments, and leave the path itself alone.

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

1 hour ago, quohog said:

Thanks, everybody! I tried this from the command line and it works great! Keyboard controller game, full speed ahead! :D

 

@mksmith, when I add "-bc Keyboard" to the path in Atari Dev Studio, I get a warning saying it can't find my Stella and uses it's built in Stella and ignores the parameters. I tried it "-bc Keyboard" and "- bc Keyboard" and various mixtures of quotes and brackets. Am I doing it wrong?

 

1248275717_stellankeyboards.thumb.jpg.d8f39ae59bddb0122642074639379949.jpg

Yes see the pic a few posts up - you need to add the parameters to the Emulator > Stella: Args entry box rather than the Path entry box.

 

Thanks for jumping in there @stephena ?

  • Thanks 1
Link to comment
Share on other sites

Oh my gosh that was it! Total user error, of course. :)

 

Thanks everybody! I am now booting up Stella from ADS and keyboard controllers are selected every time. It's like magic. :D

 

Thanks for answering my questions, and for making and supporting such amazing tools!

  • Like 1
Link to comment
Share on other sites

4 hours ago, quohog said:

Oh my gosh that was it! Total user error, of course. :)

 

Thanks everybody! I am now booting up Stella from ADS and keyboard controllers are selected every time. It's like magic. :D

 

Thanks for answering my questions, and for making and supporting such amazing tools!

Great to hear!

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