Thomas Jentzsch Posted June 12, 2023 Share Posted June 12, 2023 Just now, Thomas Jentzsch said: @Dionoid The mapping is a bit hard to explain, so please ask if anything stays unclear. Every input (e.g. left joystick up, cursor up, ESC pressed, ...) in Stella creates an event. The mappings between the computer keyboard and the attached physical controllers are stored in two hash maps. These maps are the center of the event mapping. The mappings get loaded from and stored to Stella's database. And these mappings are used to create the correct events from user input. Besides the user input, the state of the emulator is considered. E.g. during emulation other events are created than while navigating a menu or during debugging. Based on that, each computer keyboard or physical controller input creates a single event. There can be multiple inputs per event defined, but not vice versa (obviously). In our example, e.g. 2nd physical controller (C1) up creates a right port joystick up event. To create the same event via QT3 joystick up, one of the central hash maps would have to be modified. But this new mapping would automatically be stored in the database. Then right port up wouldn't work anymore. So before storing the hash maps back to the database, the map modifications would have to be undone. The mapping code is pretty abstract and tailored to its current needs. Therefore changing the mappings forth and back is error prone. And then there are side effects (e.g. controller visualization in debugger, input mapping dialog) which make things even more complicated. Hope that makes some sense. Regarding the Savekey, who should auto-detect it? Stella or the 6507 code? In Stella this works by using standard code (from i2c.h). Or you can provide a command line parameter. In 6507 code it works like you describe and that's how WoW does it. There was some discussion here. Quote Link to comment Share on other sites More sharing options...
Dionoid Posted June 12, 2023 Share Posted June 12, 2023 (edited) @Thomas Jentzsch Yes, I think I understand your answer: event mapping in Stella is global and synced to Stella's database. Still it seems like the mapping of the physical controllers in Stella is done when one ore more physical controllers are detected. Or is physical controller C1 always mapped to Stella's right joystick, but maybe hidden in the 'Input settings' UI when C1 isn't available? Regarding the SaveKey detection: would it be possible for Stella to *auto-detect* the following (see screenshots below)? Then P1 and P2 joystick mappings would work as normal (left joystick and right joystick), while highscore storing on SaveKey is supported using right port with dump ports enabled. Edited June 12, 2023 by Dionoid Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 12, 2023 Share Posted June 12, 2023 4 minutes ago, Dionoid said: @Thomas Jentzsch Yes, I think I understand your answer: event mapping in Stella is global and synced to Stella's database. Still it seems like the mapping of the physical controllers in Stella is done when one ore more controllers are detected. Or is controller C1 always mapped to Stella's right port, but maybe hidden in the 'Input settings' UI when C1 isn't available? C1 is mapped to the right port when no C0 is available (plugged in), else it is mapped to the left port. Probably there is room for improvement to be more flexible here. 4 minutes ago, Dionoid said: Regarding the SaveKey detection: would it be possible for Stella to auto-detect the following (see screenshots below)? I don't think so. Stella detects controllers by static code analysis, looking for certain pattern. Here the pattern is the same for P2 and P4. Finding out which is correct could only be done at runtime. BTW: Why can't you use command line switches? Quote Link to comment Share on other sites More sharing options...
Dionoid Posted June 12, 2023 Share Posted June 12, 2023 (edited) 3 minutes ago, Thomas Jentzsch said: BTW: Why can't you use command line switches? Reason I'm asking all this, is because I want to have a 2-player version of Tower of Rubble running on the AtariVCS (using Stella 6.6), and still support highscore saving using the (virtual) Savekey. Command line switches are possible in theory, but require changes beyond my control Edited June 12, 2023 by Dionoid 1 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 12, 2023 Share Posted June 12, 2023 I see. Complicated... 1 Quote Link to comment Share on other sites More sharing options...
Dionoid Posted June 12, 2023 Share Posted June 12, 2023 (edited) @Thomas Jentzsch About the command line switches: that doesn't allow to set mappings, right? But I could use that to set Stella's QuadTari controller properties with the -aq argument, so that's indeed a way to solve it. Edited June 12, 2023 by Dionoid Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted June 12, 2023 Share Posted June 12, 2023 15 minutes ago, Dionoid said: @Thomas Jentzsch About the command line switches: that doesn't allow to set mappings, right? Right. 15 minutes ago, Dionoid said: But I could use that to set Stella's QuadTari controller properties with the -aq argument, so that's indeed a way to solve it. -aq sets all four controllers at once. Better use e.g. -rq2. 1 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.