Commit Graph
4 Commits
Author SHA1 Message Date
Peter YooandClaude Fable 5.1 5ff096e9d4 Guard clkcnt division against a zero line count
get_status() divides before check_linecnt() validates totlines; with no
lines measured the divisor is zero (RISC-V returns all ones silently).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WiXHy7Jhh5yTdsBaenucgw
2026-09-18 22:10:53 +09:00
Peter YooandClaude Fable 5.1 5fd71e8312 Add "PC SoG/CS coast" compatibility option
tvp_source_setup() disables the TVP7002 internal H-PLL coast for every
PC-type preset. That is right for RGBHV, but with sync-on-green or
composite sync the serration pulses during vsync disturb the H-PLL every
frame; on a NeXTstation Color (1120x832, SoG) this caused continuous
horizontal jitter, jitter in the top third of the picture and a periodic
HDMI re-sync. With the option on, coast is re-enabled after setup when the
sync source is SOG or CSYNC; RGBHV is untouched. Default Off, so existing
behaviour is unchanged. Stored as profile item id 68.

On the NeXT, this option together with the existing settings Analog sync
LPF = 10 MHz, ADC PLL BW = Low and H-PLL Pre/Post-Coast = 4/4 ran 19
minutes without a sync loss, mode re-program or IT6613 video-stable
change. SPARCstation 20 framebuffers (ZX, TurboGX) over composite sync are
stable without it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WiXHy7Jhh5yTdsBaenucgw
2026-09-18 22:10:53 +09:00
Peter YooandClaude Opus 5 f3b2419da8 Add workstation presets: NeXT 1120x832@72, Sun 1152x900 and 1280x1024
All entries go into GROUP_FIXED_VHZ at the end of the table, so they are
considered only for sources with the matching refresh rate; every other
source is matched exactly as before.

- 1120x832@72 (NeXTstation Color, ADB configuration): 868 total lines,
  62.50 kHz, 90.000 MHz pixel clock (h_total 1440), 1.22 us hsync (110 px),
  3-line vsync; back porches 185/30 and a 45 degree sampling phase tuned on
  hardware. Without it the signal matched 1024x768 and was cropped.
- Sun, timings from the cg6 (GX/TGX) and cg14 (SX) framebuffer PROMs:
  1152x900@66 (94.5 MHz, 1528x937), 1152x900@76 (108 MHz, 1504 total;
  cg6 937 lines @ 76.64 Hz as "1152x900H", cg14 943 lines @ 76.15 Hz as
  "1152x900HS"), 1280x1024@67 (118.125 MHz, 1648x1075, "1280x1024L") and
  1280x1024@76 (135 MHz, 1664x1066, "1280x1024H"). Previously these matched
  1280x960 or the VESA-timed 1280x1024 preset (h_total 1688).

1152x900@66 was verified on a SPARCstation 20 with ZX (Leo) and TurboGX
boards; the other Sun entries are not yet verified on hardware. Mode names
are limited to 10 characters, hence the H/HS/L suffixes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WiXHy7Jhh5yTdsBaenucgw
2026-09-18 22:10:53 +09:00
Peter YooandClaude Opus 5 b2fd00d439 Add fixed-refresh preset group for workstation modes
get_pure_lm_mode() picks the preset with the nearest total line count.
Several workstation display modes share line counts with each other or with
VESA modes while having one fixed refresh rate (e.g. Sun 1152x900 is 937
lines at both 66 Hz and 76.6 Hz on cg6 boards, and Sun 1280x1024@76 has the
1066 lines of VESA 1280x1024).

Add GROUP_FIXED_VHZ. Presets in this group are candidates only when the
measured refresh is within +-0.3 Hz of the preset (the measured refresh is
exact to about 0.01 Hz). They are appended at the end of the table, so the
early exit of the search loop is replaced by a flag that skips the
remaining regular presets exactly as before but still lets fixed-refresh
presets take part, including the existing equal-line refresh tie-break
(group >= GROUP_720P). Group-indexed arrays in video_modes.c and
controls.c get the extra entry.

No preset uses the group yet, so behaviour is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WiXHy7Jhh5yTdsBaenucgw
2026-09-18 22:10:33 +09:00