Fixed potential bug in dynamically swapping Stelladaptor devices;

events generated by one device would never receive the 'turn off'
event when it was swapped out.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2407 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-03-11 14:25:47 +00:00
parent 2ff4226e67
commit d0b8bd57e5
2 changed files with 16 additions and 1 deletions

View File

@ -20,7 +20,9 @@
device.
* Added ability to dynamically swap the port order of Stelladaptor/
2600-daptor devices with the 'Control-1' key combo.
2600-daptor devices with the 'Control-1' key combo (useful if you
have only one 2600-daptor and want to use it as a left port
normally, but as a right port for Star Raiders, etc).
* Fixed bug in BoosterGrip controller emulation; the functionality
of the booster and trigger buttons was reversed. Related to this,

View File

@ -276,6 +276,19 @@ void EventHandler::mapStelladaptors(const string& saport)
}
}
myOSystem->settings().setString("saport", saport);
// We're potentially swapping out an input device behind the back of
// the Event system, so we make sure all Stelladaptor-generated events
// are reset
for(int i = 0; i < 2; ++i)
{
for(int j = 0; j < 2; ++j)
myEvent.set(SA_Axis[i][j], 0);
for(int j = 0; j < 4; ++j)
myEvent.set(SA_Button[i][j], 0);
for(int j = 0; j < 12; ++j)
myEvent.set(SA_Key[i][j], 0);
}
#endif
}