mirror of https://github.com/stella-emu/stella.git
Use a more realistic resistance in dump mode.
This commit is contained in:
parent
31260facef
commit
0ea4515bbf
|
@ -83,17 +83,17 @@ void PaddleReader::setConsoleTiming(ConsoleTiming consoleTiming)
|
|||
myConsoleTiming = consoleTiming;
|
||||
|
||||
myClockFreq = myConsoleTiming == ConsoleTiming::ntsc ? 60 * 228 * 262 : 50 * 228 * 312;
|
||||
myUThresh = USUPP * (1. - exp(-TRIPPOINT_LINES * 228 / myClockFreq / (RPOT + R0) / C));
|
||||
myUThresh = U_SUPP * (1. - exp(-TRIPPOINT_LINES * 228 / myClockFreq / (R_POT + R0) / C));
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void PaddleReader::updateCharge(uInt64 timestamp)
|
||||
{
|
||||
if (myValue >= 0 && !myIsDumped)
|
||||
myU = USUPP * (1 - (1 - myU / USUPP) *
|
||||
exp(-static_cast<double>(timestamp - myTimestamp) / (myValue * RPOT + R0) / C / myClockFreq));
|
||||
myU = U_SUPP * (1 - (1 - myU / U_SUPP) *
|
||||
exp(-static_cast<double>(timestamp - myTimestamp) / (myValue * R_POT + R0) / C / myClockFreq));
|
||||
else
|
||||
myU *= exp(-static_cast<double>(timestamp - myTimestamp) / R0 / C / myClockFreq);
|
||||
myU *= exp(-static_cast<double>(timestamp - myTimestamp) / (myIsDumped ? R_DUMP : R0) / C / myClockFreq);
|
||||
|
||||
myTimestamp = timestamp;
|
||||
}
|
||||
|
|
|
@ -67,8 +67,9 @@ class PaddleReader : public Serializable
|
|||
static constexpr double
|
||||
R0 = 1.8e3,
|
||||
C = 68e-9,
|
||||
RPOT = 1e6,
|
||||
USUPP = 5;
|
||||
R_POT = 1e6,
|
||||
R_DUMP = 50,
|
||||
U_SUPP = 5;
|
||||
|
||||
static constexpr double TRIPPOINT_LINES = 379;
|
||||
|
||||
|
|
Loading…
Reference in New Issue