mirror of https://github.com/stella-emu/stella.git
Fix paddle input if no paddles are not connected.
Don't charge cap if resistance is maxed.
This commit is contained in:
parent
75bd732525
commit
39f756f821
|
@ -97,6 +97,7 @@ void PaddleReader::updateCharge(double timestamp)
|
|||
{
|
||||
if (myIsDumped) return;
|
||||
|
||||
if (myValue >= 0)
|
||||
myU = USUPP * (1 - (1 - myU / USUPP) *
|
||||
exp(-(timestamp - myTimestamp) / (myValue * RPOT + R0) / C / myClockFreq));
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "TIA.hxx"
|
||||
#include "M6502.hxx"
|
||||
#include "Console.hxx"
|
||||
#include "Control.hxx"
|
||||
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
#include "CartDebug.hxx"
|
||||
|
@ -1291,8 +1292,11 @@ void TIA::updatePaddle(uInt8 idx)
|
|||
throw runtime_error("invalid paddle index");
|
||||
}
|
||||
|
||||
myPaddleReaders[idx].update(double(resistance) / MAX_RESISTANCE,
|
||||
myTimestamp, myFrameManager.tvMode());
|
||||
myPaddleReaders[idx].update(
|
||||
(resistance == Controller::maximumResistance ? -1 : double(resistance)) / MAX_RESISTANCE,
|
||||
myTimestamp,
|
||||
myFrameManager.tvMode()
|
||||
);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in New Issue