  We perform a time-dependent amplitude analysis of $B^0 \to K^0_S\pi^+\pi^-$
decays to extract the CP violation parameters of $f_0(980) K^0_S$ and
$\rho^0(770) K^0_S$ and the direct CP asymmetry of $K^{*+}(892) \pi^-$. The
results are obtained from a data sample of $(383 \pm 3) \times 10^6$ $B\bar{B}$
decays, collected with the BABAR detector at the PEP-II asymmetric-energy $B$
factory at SLAC. We find two solutions, with an equivalent goodness-of-fit.
Including systematic and Dalitz plot model uncertainties, the combined
confidence interval for values of the CP parameter $\beta_{eff}$ in $B^0$
decays to $f_0(980) K^0_S$ is $18^o < \beta_{eff} < 76^o$ at 95% confidence
level (C.L). CP conservation in $B^0$ decays to $f_0(980) K^0_S$ is excluded at
$3.5\sigma$ including systematic uncertainties. For $B^0$ decays to
$\rho^0(770) K^0_S$, the combined confidence interval is $-9^o < \beta_{eff} <
57^o$ at 95% C.L. In decays to $K^{*+}(892) \pi^-$ we measure the direct CP
asymmetry to be $A_{CP}=-0.20 \pm 0.10 \pm 0.01 \pm 0.02$. The measured phase
difference (including $B^0\bar{B}^0$ mixing) between decay amplitudes of $B^0
\to K^{*+}(892) \pi^-$ and $\bar{B}^0 \to K^{*-}(892) \pi^+$, excludes the
interval $-137^o < \Delta\Phi(K^{*+}(892) \pi^-) < -5^o$ at 95% C.L.
