Commit 929cd22
committed
USB: Follow the PCRTC video mode for GunCon2 aim
The per-serial calibration table is applied once by AutoConfigure() and
never revisited, but its values are video mode dependent -- the table
carries commented-out 480i/480p twins for three discs to prove it.
Time Crisis 2 and 3 halve the vertical mode when entering split-screen
co-op (640x448 -> 640x224). The range of positions the gun can report
halves with it while the frozen scale keeps sending the full range, so
aim travels twice as far as it should.
Scale the vertical deflection by the ratio between the live PCRTC
resolution and the one latched on first use. The ratio is exactly 1.0
for a game that never changes mode, so output is unchanged everywhere
else, and the correction is only armed when a table row actually
matched -- manually configured guns and unlisted games are untouched.
Only the vertical is corrected. The horizontal reading also moves when
one of the two display circuits is disabled (Time Crisis 3 reports
320x224 for several frames while transitioning), which is a change in
what is being composited rather than in video timing.
The ratio is clamped so it can only reduce the deflection. The
reference is not saved to the state, so a state made in split-screen
latches the reduced height on load; the clamp keeps that inert rather
than letting it overshoot by 2x when the game returns to full height.1 parent fa50a11 commit 929cd22
3 files changed
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
665 | 680 | | |
666 | 681 | | |
667 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| |||
362 | 368 | | |
363 | 369 | | |
364 | 370 | | |
| 371 | + | |
365 | 372 | | |
366 | 373 | | |
367 | 374 | | |
| |||
392 | 399 | | |
393 | 400 | | |
394 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
395 | 429 | | |
396 | 430 | | |
397 | 431 | | |
| |||
0 commit comments