Commit ef38ec1
committed
fix: drive both modes from the native NTSC timing for clean CRT sync
The previous commit kept the original cosine timing block (H_TOTAL=638,
forced_scandoubler-conditional ce_pix) but switched the PLL to 27.027 MHz.
That produced a line rate of ~42 kHz scandoubled or ~21 kHz interlaced —
nothing standard, so a CRT could not lock on the analog VGA output.
This commit makes native_video_timing the single source of truth for sync
and DE in both modes:
- ce_pix is now a fixed /4 divider of CLK_VIDEO -> 6.756 MHz pixel rate
-> 15.749 kHz line rate (within 0.1% of NTSC 15.734 kHz).
- VGA_HS/VS/DE always come from native_video_top regardless of status[9].
- The cosine + LFSR fallback paints into the active area only; outside DE
we drive black so sync stays clean.
- vvc steps on native_new_frame instead of the old vc wrap; cos LUT is
indexed by vcount from the shared timing.
- native_video_top exposes vcount and new_frame so the cosine path can
reuse the same vertical position the FB reader sees.
The cosine pattern still renders (it was always intended as fallback noise),
but now at NTSC-spec 320x240 timing instead of broken 27 MHz / 638-cycle
timing. Sync locks on real CRTs.
PAL parametrisation is deferred — native_video_timing is currently NTSC-only.
forced_scandoubler is still wired from hps_io but unused; preserve it as a
known placeholder for the eventual PAL/scandoubler follow-up.1 parent 50bf5cc commit ef38ec1
2 files changed
Lines changed: 59 additions & 85 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
500 | 467 | | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
524 | 471 | | |
525 | 472 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
533 | 477 | | |
534 | 478 | | |
535 | 479 | | |
| |||
538 | 482 | | |
539 | 483 | | |
540 | 484 | | |
| 485 | + | |
| 486 | + | |
541 | 487 | | |
542 | 488 | | |
543 | 489 | | |
| |||
565 | 511 | | |
566 | 512 | | |
567 | 513 | | |
| 514 | + | |
| 515 | + | |
568 | 516 | | |
569 | 517 | | |
570 | 518 | | |
571 | 519 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
577 | 547 | | |
578 | 548 | | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
585 | 555 | | |
586 | 556 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
0 commit comments