Compare commits

..
Author SHA1 Message Date
marqs 14e7258bfc adapt review comments
* automate coast enable/disable based on sync type
* move glitch filter under sync menu
2026-09-28 21:46:19 +03:00
marqs 0e7345464b fix overlapping setting IDs 2026-09-28 21:16:44 +03:00
Peter YooandClaude Fable 5.1 88577e1467 Add "Sync glitch filt" compatibility option
While an input is locked, single-shot deviations of the frontend
measurements (line count, field period beyond PCNT_TOLERANCE, hsync width
beyond HSYNC_WIDTH_TOLERANCE, activity flag or the validity check) make
get_status() re-program the mode or drop sync. A NeXT SoG source produced
such glitches (868 -> 814 -> 868 lines) every few minutes, each one a
visible blink.

With this option on, a deviation is acted upon only once it has been seen
on three consecutive status reads; the first two deviating reads are
replaced by the previous stable values. That is 30 ms in the normal case
and up to about 105 ms if the vsync wait in get_status() times out on every
read. Counting deviating reads (rather than requiring identical readings)
guarantees that a real mode change or sync loss is always accepted on the
third read. The counter is cleared whenever the input is not locked or the
option is off. Default Off (stock behaviour). Stored as profile item id 69.

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 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
marqs e800f095de fix 384col and 480p preset processing when PR2x is disabled 2026-09-05 12:26:19 +03:00
marqs 56509de3b6 add JTAG UART command to disable/enable infrared remote 2026-08-27 21:53:22 +03:00
marqs e6e76171f6 add support for input/profile select via JTAG UART 2026-07-03 23:01:54 +03:00
marqs d653b67ffc add compatibility option for disabling HDMI PR2x 2026-06-28 13:05:51 +03:00
marqs 35f8595a05 misc fixes
* fix compiler warnings
* fix Last Used initial input
* remove duplicate gtia_pal branch
* include hdmi_ar into saved profile
2026-06-25 18:35:05 +03:00
marqs 20bf6d32d7 boot into newly installed firmware after update 2026-06-23 18:49:40 +03:00
marqs e6e2a3305e better support for GBI Line3x generic 2026-06-23 18:49:40 +03:00
16 changed files with 267 additions and 111 deletions

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ typedef union {
// char regs
typedef struct {
char data[160];
alt_u32 data[5];
} pll_config_data_regs;
typedef struct {
+22 -9
View File
@@ -163,8 +163,6 @@ set_location_assignment PIN_129 -to btn[1]
set_location_assignment PIN_128 -to btn[0]
set_global_assignment -name USE_CONFIGURATION_DEVICE ON
set_global_assignment -name CRC_ERROR_OPEN_DRAIN OFF
set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO"
@@ -220,20 +218,33 @@ set_global_assignment -name USE_SIGNALTAP_FILE output_files/ossc_new.stp
set_global_assignment -name FITTER_EFFORT "AUTO FIT"
set_global_assignment -name SEED 1
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_BD[0]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_BD[1]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_BD[2]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_BD[3]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_BD[4]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_BD[5]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_BD[6]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_BD[7]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_GD[0]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_GD[1]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_GD[2]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_GD[3]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_GD[4]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_GD[5]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_GD[6]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_GD[7]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_RD[0]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_RD[1]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_RD[2]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_RD[3]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_RD[4]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_RD[5]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_RD[6]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_RD[7]
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_HS
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_VS
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_DE
set_global_assignment -name VERILOG_FILE rtl/videogen.v
@@ -259,4 +270,6 @@ set_global_assignment -name SEARCH_PATH software/sys_controller/mem_init/
set_global_assignment -name SEARCH_PATH ip/ibex_qsys/rtl_extra
set_global_assignment -name VERILOG_MACRO "SYNTHESIS=<None>"
set_global_assignment -name STRATIXIII_UPDATE_MODE REMOTE
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
+4 -4
View File
@@ -43,10 +43,10 @@ foreach_in_collection c [get_clocks "pclk_tvp*"] {
set_input_delay -clock $c -max $TVP_dmax $critinputs -add_delay
}
# output delay constraints as documented in the IT6613 datasheet
# -- increased IT_Tsu from 1.0 to 1.5 due to #52
set IT_Tsu 1.5
set IT_Th -0.5
# output delay constraints based on params from IT6613 datasheet (S=1ns, H=0.5ns)
# shifted aperture window due to issues #52 and #56
set IT_Tsu 2.0
set IT_Th -0.2
set critoutputs_hdmi [get_ports {HDMI_TX_RD* HDMI_TX_GD* HDMI_TX_BD* HDMI_TX_DE HDMI_TX_HS HDMI_TX_VS}]
foreach_in_collection c [get_clocks pclk_*_out] {
set_output_delay -clock $c -min $IT_Th $critoutputs_hdmi -add
+39 -30
View File
@@ -62,17 +62,16 @@ extern mode_data_t video_modes_plm[];
extern ypbpr_to_rgb_csc_t csc_coeffs[];
extern alt_u16 rc_keymap[REMOTE_MAX_KEYS];
extern alt_u16 rc_keymap_default[REMOTE_MAX_KEYS];
extern alt_u32 remote_code;
extern alt_u32 btn_code, btn_code_prev;
extern alt_u8 remote_rpt, remote_rpt_prev;
extern avconfig_t tc;
extern alt_u8 vm_sel;
extern char target_profile_name[USERDATA_NAME_LEN+1];
tvp_input_t target_tvp;
tvp_sync_input_t target_tvp_sync;
alt_u8 target_type;
video_format target_format;
video_type target_type;
alt_u8 update_cur_vm;
static alt_u8 glitch_dev_ctr; // "Sync glitch filt": consecutive deviating status reads while locked
// Default settings
const settings_t ts_default = {
@@ -87,7 +86,7 @@ alt_u8 profile_sel, profile_sel_menu, sd_profile_sel_menu, input_profiles[AV_LAS
char row1[LCD_ROW_LEN+1], row2[LCD_ROW_LEN+1], menu_row1[LCD_ROW_LEN+1], menu_row2[LCD_ROW_LEN+1];
extern alt_u8 menu_active;
avinput_t target_input;
avinput_t target_input, last_input;
alt_u8 pcm1862_active;
@@ -372,9 +371,37 @@ status_t get_status(tvp_sync_input_t syncinput)
pcnt_field = (unsigned long)sc->fe_status2.pcnt_field;
hsync_width = (unsigned long)sc->fe_status2.hsync_width;
clkcnt = pcnt_field/(totlines>>!progressive);
valid_mode = (pcnt_field > 0) && check_linecnt(progressive, totlines);
// Optional glitch filter: while locked, act on a changed measurement (line count, field period, hsync width,
// activity flag or validity) only once it has deviated on 3 consecutive status reads (30 ms, up to ~105 ms if
// the vsync wait above times out on every read); until then keep the previous values. Single-shot glitches
// (e.g. 868 -> 814 -> 868 lines seen on a NeXT SoG source) otherwise trigger a mode re-program or a
// sync-loss/re-lock cycle. Counting reads rather than requiring identical candidate values guarantees that a
// real change or loss is always accepted on the third read.
if (!tc.sync_glitch_filt || !cm.sync_active) {
glitch_dev_ctr = 0;
} else {
alt_u8 deviates = !sync_active || !valid_mode ||
(totlines != cm.totlines) || (progressive != cm.progressive) ||
(pcnt_field < (cm.pcnt_field - PCNT_TOLERANCE)) || (pcnt_field > (cm.pcnt_field + PCNT_TOLERANCE)) ||
(abs(((int)hsync_width - (int)cm.hsync_width)) > HSYNC_WIDTH_TOLERANCE);
if (!deviates) {
glitch_dev_ctr = 0;
} else if (glitch_dev_ctr < 2) {
glitch_dev_ctr++;
sync_active = 1;
valid_mode = 1;
totlines = cm.totlines;
progressive = cm.progressive;
pcnt_field = cm.pcnt_field;
hsync_width = cm.hsync_width;
}
}
clkcnt = (totlines>>!progressive) ? pcnt_field/(totlines>>!progressive) : 0;
// Check sync activity
if (!cm.sync_active && sync_active && valid_mode) {
cm.sync_active = 1;
@@ -717,6 +744,7 @@ void program_mode()
(alt_u8)h_synclen_px,
(alt_8)(cm.cc.clamp_offset-SIGNED_NUMVAL_ZERO),
vmode_changed);
set_lpf(cm.cc.video_lpf);
set_csc(cm.cc.ypbpr_cs);
@@ -1029,21 +1057,18 @@ void update_settings(int init_setup) {
refresh_osd();
}
if (init_setup)
target_input = ts.def_input;
target_input = (ts.def_input == AV_LAST) ? last_input : ts.def_input;
memcpy(&cs, &ts, sizeof(settings_t));
}
int main()
int main(int argc, char **argv, char **envp)
{
ths_input_t target_ths = 0;
pcm_input_t target_pcm = 0;
video_format target_format = 0;
status_t status;
alt_u32 input_vec;
alt_timestamp_type start_ts;
alt_timestamp_type auto_input_timestamp = 0;
alt_u8 auto_input_changed = 0;
@@ -1082,24 +1107,6 @@ int main()
while(1) {
start_ts = alt_timestamp();
// Read remote control and PCB button status
input_vec = IORD_ALTERA_AVALON_PIO_DATA(PIO_1_BASE);
remote_code = input_vec & RC_MASK;
btn_code = ~input_vec & PB_MASK;
remote_rpt = input_vec >> 24;
if ((remote_rpt == 0) || ((remote_rpt > 1) && (remote_rpt < 6)) || (remote_rpt == remote_rpt_prev))
remote_code = 0;
remote_rpt_prev = remote_rpt;
if (btn_code_prev == 0) {
btn_code_prev = btn_code;
} else {
btn_code_prev = btn_code;
btn_code = 0;
}
// Auto input switching
if ((cs.auto_input != AUTO_OFF) && (cm.avinput != AV_TESTPAT) && !cm.sync_active && !menu_active
&& (alt_timestamp() >= auto_input_timestamp + 300 * (alt_timestamp_freq() >> 10)) && (auto_input_ctr < AUTO_MAX_COUNT)) {
@@ -1145,6 +1152,7 @@ int main()
auto_input_timestamp = alt_timestamp();
}
read_controls();
man_input_change = parse_control();
if (menu_active)
@@ -1223,6 +1231,7 @@ int main()
cm.avinput = target_input;
cm.sync_active = 0;
last_input = target_input;
ths_source_sel(target_ths, (cm.cc.video_lpf > 1) ? (VIDEO_LPF_MAX-cm.cc.video_lpf) : THS_LPF_BYPASS);
tvp_powerdown();
DisableAudioOutput();
@@ -1258,7 +1267,7 @@ int main()
cm.clkcnt = 0; //TODO: proper invalidate
}
if (tc.tx_mode != TX_DVI) {
if (tc.hdmi_itc != cm.cc.hdmi_itc || tc.hdmi_ar != cm.cc.hdmi_ar) {
if ((tc.hdmi_itc != cm.cc.hdmi_itc) || (tc.hdmi_ar != cm.cc.hdmi_ar)) {
//EnableAVIInfoFrame(FALSE, NULL);
printf("setting ITC to %d\nsetting Aspect-Ratio to %d\n", tc.hdmi_itc, tc.hdmi_ar);
HDMITX_SetAVIInfoFrame(vmode_out.vic, (tc.tx_mode == TX_HDMI_RGB) ? F_MODE_RGB444 : F_MODE_YUV444, tc.hdmi_ar, 0, tc.hdmi_itc, vm_conf.hdmitx_pixr_ifr);
@@ -17,7 +17,7 @@
#ifdef SUPPORT_SYNCEMBEDDED
#pragma message("defined SUPPORT_SYNCEMBEDDED for Sync Embedded timing input or CCIR656 input.")
#pragma message("defined SUPPORT_SYNCEMBEDDED for Sync Embedded timing input or CCIR656 input.")
#endif
#ifndef _MCU_ // DSSSHA need large computation data rather than 8051 supported.
@@ -52,7 +52,6 @@
//#define NULL 0
//typedef unsigned char bool;
typedef unsigned char bool;
#include "sysconfig.h"
// Hardwired to CPU reset
@@ -395,22 +395,6 @@ void tvp_source_setup(video_type type, alt_u16 h_samplerate, alt_u16 pixs_per_li
// Clamp and ALC
tvp_set_clamp_alc(type, clamp_ref_offset, clamp_user_offset, 1);
// Setup Macrovision stripper and H-PLL coast signal.
// Coast needs to be enabled when HSYNC is missing during VSYNC. RGBHV mode cannot use it, so turn off the internal signal for this mode.
// Macrovision stripper filters out glitches and serration pulses that may occur outside of sync window (HSYNC_lead +- TVP_MVSWIDTH*37ns). Enabled for all inputs.
switch (type) {
case VIDEO_PC:
tvp_writereg(TVP_MISCCTRL4, 0x0D);
break;
//case VIDEO_LDTV:
case VIDEO_SDTV:
case VIDEO_EDTV:
case VIDEO_HDTV:
default:
tvp_writereg(TVP_MISCCTRL4, 0x09);
break;
}
tvp_setup_hpll(h_samplerate, pixs_per_line, refclks_per_line, plldivby2);
}
@@ -458,6 +442,14 @@ void tvp_source_sel(tvp_input_t input, tvp_sync_input_t syncinput, video_format
else
tvp_writereg(TVP_SYNCBYPASS, 0x00);
// Setup Macrovision stripper and H-PLL coast signal.
// Coast needs to be enabled when HSYNC is missing during VSYNC. RGBHV mode cannot use it, so turn off the internal signal for this mode.
// Macrovision stripper filters out glitches and serration pulses that may occur outside of sync window (HSYNC_lead +- TVP_MVSWIDTH*37ns). Enabled for all inputs.
if (fmt == FORMAT_RGBHV)
tvp_writereg(TVP_MISCCTRL4, 0x0D);
else
tvp_writereg(TVP_MISCCTRL4, 0x09);
//TODO:
//TVP_ADCSETUP
+2
View File
@@ -107,6 +107,7 @@ typedef struct {
alt_u8 fpga_pll_bw;
alt_u8 panasonic_hack;
alt_u8 o480p_pbox;
alt_u8 hdmi_pr2x_disable;
/* Postprocessing settings */
alt_u8 sl_mode;
@@ -142,6 +143,7 @@ typedef struct {
alt_u8 alc_v_filter;
color_setup_t col;
alt_u8 full_vs_bypass;
alt_u8 sync_glitch_filt;
/* Audio settings */
alt_u8 audio_dw_sampl;
+1
View File
@@ -65,6 +65,7 @@ typedef enum {
void setup_rc();
void set_default_keymap();
void read_controls();
int parse_control();
#endif
+2 -2
View File
@@ -24,7 +24,7 @@
#include "sysconfig.h"
#define FW_VER_MAJOR 1
#define FW_VER_MINOR 21
#define FW_VER_MINOR 23
#ifdef OSDLANG_JP
#define FW_SUFFIX "j"
@@ -61,7 +61,7 @@ typedef struct {
} rem_update_dev;
int fw_init_secondary();
int fw_update();
int fw_update(char *dirname, char *filename);
void fw_update_commit(uint32_t* cluster_idx, uint32_t bytes_to_copy, uint16_t fs_csize, uint16_t fs_startsec, uint32_t flash_addr);
#endif
@@ -70,8 +70,11 @@ typedef enum {
GROUP_720P = 8,
GROUP_1080I = 9,
GROUP_1080P = 10,
GROUP_FIXED_VHZ = 11, // fixed-refresh workstation modes: only matched when the input refresh is within FIXED_VHZ_TOL_X100
} video_group;
#define FIXED_VHZ_TOL_X100 30 // +-0.30 Hz (measured refresh is exact to ~0.01 Hz)
typedef enum {
MODE_INTERLACED = (1<<0), //deprecated
MODE_CRT = (1<<1),
+87 -6
View File
@@ -20,6 +20,7 @@
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include "system.h"
#include "alt_types.h"
#include "controls.h"
@@ -28,9 +29,13 @@
#include "video_modes.h"
#include "userdata.h"
#include "firmware.h"
#include "utils.h"
#include "lcd.h"
#include "altera_avalon_jtag_uart.h"
#include "altera_avalon_pio_regs.h"
#define UART_RX_BUF_SIZE 15
static const char *rc_keydesc[REMOTE_MAX_KEYS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", \
"MENU", "OK", "BACK", "UP", "DOWN", "LEFT", "RIGHT", "INFO", "LCD_BACKLIGHT", "SCANLINE_MODE", \
"SCANLINE_TYPE", "SCANLINE_INT+", "SCANLINE_INT-", "SHMASK_MODE+", "SHMASK_MODE-", "SHMASK_INT+", "SHMASK_INT-", "LINEMULT_MODE", "PHASE+", "PHASE-",
@@ -56,9 +61,17 @@ extern volatile osd_regs *osd;
extern menu_t menu_scanlines, menu_advtiming, menu_postproc;
extern altera_avalon_jtag_uart_state jtag_uart_0;
extern int altera_avalon_jtag_uart_read(altera_avalon_jtag_uart_state* sp, char* buffer, int space, int flags);
extern int altera_avalon_jtag_uart_write(altera_avalon_jtag_uart_state* sp, const char * ptr, int count, int flags);
char uart_rx_buf[UART_RX_BUF_SIZE+1];
char *uart_rx_buf_ptr = uart_rx_buf;
alt_u32 remote_code;
alt_u8 remote_rpt, remote_rpt_prev;
alt_u32 btn_code, btn_code_prev;
int uart_rx_ret, rc_disable;
void setup_rc()
{
@@ -121,16 +134,47 @@ void set_default_keymap() {
memcpy(rc_keymap, rc_keymap_default, sizeof(rc_keymap));
}
void read_controls() {
uint32_t input_vec;
// Read remote control and PCB button status
input_vec = IORD_ALTERA_AVALON_PIO_DATA(PIO_1_BASE);
remote_code = input_vec & RC_MASK;
btn_code = ~input_vec & PB_MASK;
remote_rpt = input_vec >> 24;
if (rc_disable || (remote_rpt == 0) || ((remote_rpt > 1) && (remote_rpt < 6)) || (remote_rpt == remote_rpt_prev))
remote_code = 0;
remote_rpt_prev = remote_rpt;
if (btn_code_prev == 0) {
btn_code_prev = btn_code;
} else {
btn_code_prev = btn_code;
btn_code = 0;
}
uart_rx_ret = altera_avalon_jtag_uart_read(&jtag_uart_0, uart_rx_buf_ptr, UART_RX_BUF_SIZE-(uart_rx_buf_ptr-uart_rx_buf), O_NONBLOCK);
if (uart_rx_ret > 0) {
// echo
altera_avalon_jtag_uart_write(&jtag_uart_0, uart_rx_buf_ptr, uart_rx_ret, 0);
uart_rx_buf_ptr += uart_rx_ret;
}
}
int parse_control()
{
int i, prof_x10=0, ret=0, retval;
int i, prof_x10=0, ret;
alt_u32 btn_vec, btn_vec_prev=1;
alt_u8 pt_only = 0;
avinput_t man_target_input = AV_LAST;
char *pos;
unsigned uart_rx_arg;
// one for each video_group
alt_u8* pmcfg_ptr[] = { &pt_only, &tc.pm_240p, &tc.pm_240p, &tc.pm_384p, &tc.pm_480i, &tc.pm_480i, &tc.pm_480p, &tc.pm_480p, &pt_only, &tc.pm_1080i, &pt_only };
alt_u8 valid_pm[] = { 0x1, 0x3f, 0x3f, 0x7, 0xf, 0xf, 0x7, 0x7, 0x1, 0x3, 0x1 };
alt_u8* pmcfg_ptr[] = { &pt_only, &tc.pm_240p, &tc.pm_240p, &tc.pm_384p, &tc.pm_480i, &tc.pm_480i, &tc.pm_480p, &tc.pm_480p, &pt_only, &tc.pm_1080i, &pt_only, &pt_only };
alt_u8 valid_pm[] = { 0x1, 0x3f, 0x3f, 0x7, 0xf, 0xf, 0x7, 0x7, 0x1, 0x3, 0x1, 0x1 };
avinput_t next_input = (cm.avinput == AV3_YPBPR) ? AV1_RGBs : (cm.avinput+1);
@@ -271,7 +315,7 @@ int parse_control()
break;
}
if (video_modes_plm[cm.id].group > GROUP_1080P) {
if (video_modes_plm[cm.id].group > GROUP_FIXED_VHZ) {
printf("WARNING: Corrupted mode (id %d)\n", cm.id);
break;
}
@@ -339,8 +383,8 @@ Prof_Hotkey_Prompt:
if ((i == RC_BTN0) || (i < (RC_BTN1 + (prof_x10 == (MAX_PROFILE/10)) ? (MAX_PROFILE%10) : 9))) {
profile_sel_menu = prof_x10*10 + ((i+1)%10);
retval = load_profile();
sniprintf(menu_row2, LCD_ROW_LEN+1, "%s", (retval==0) ? "Done" : "Failed");
ret = load_profile();
sniprintf(menu_row2, LCD_ROW_LEN+1, "%s", (ret==0) ? "Done" : "Failed");
ui_disp_menu(1);
usleep(500000);
break;
@@ -376,9 +420,46 @@ Button_Check:
if (btn_code & PB1_BIT)
tc.sl_mode = tc.sl_mode < SL_MODE_MAX ? tc.sl_mode + 1 : 0;
// Parse UART RX buffer
if (uart_rx_ret > 0) {
pos = strpbrk(uart_rx_buf, "\r\n");
if (pos != NULL) {
*pos = 0;
if (sscanf(uart_rx_buf, "input %u", &uart_rx_arg) == 1) {
if ((uart_rx_arg > AV_TESTPAT) && (uart_rx_arg <= AV3_YPBPR)) {
man_target_input = uart_rx_arg;
dd_printf("Input %u selected\n", uart_rx_arg);
} else {
dd_printf("Invalid input ID\n");
}
} else if (sscanf(uart_rx_buf, "prof %u", &uart_rx_arg) == 1) {
if (uart_rx_arg <= MAX_PROFILE) {
ret = read_userdata(uart_rx_arg, 0);
if (ret >= 0)
dd_printf("Profile %u loaded\n", uart_rx_arg);
else
dd_printf("Profile load failed\n");
} else {
dd_printf("Invalid profile ID\n");
}
} else if (sscanf(uart_rx_buf, "rc %u", &uart_rx_arg) == 1) {
rc_disable = !uart_rx_arg;
} else {
dd_printf("Unrecognized command\n");
}
uart_rx_buf_ptr = uart_rx_buf;
} else if (uart_rx_buf_ptr >= uart_rx_buf+UART_RX_BUF_SIZE) {
dd_printf("\nUnrecognized sequence, RX buffer cleared\n");
uart_rx_buf_ptr = uart_rx_buf;
}
}
if (man_target_input != AV_LAST) {
target_input = man_target_input;
ret = 1;
} else {
ret = 0;
}
sys_ctrl &= ~(3<<LCD_BL_TIMEOUT_OFFS);
+2
View File
@@ -271,6 +271,8 @@ void __attribute__((noinline, flatten, noreturn, __section__(".text_bram"))) fw_
// flush command FIFO before FPGA reconfiguration start
*(volatile uint32_t*)(INTEL_GENERIC_SERIAL_FLASH_INTERFACE_TOP_0_AVL_MEM_BASE);
rem_reconfig_dev.regs->image_addr[0] = flash_addr;
rem_reconfig_dev.regs->wdog_enable[0] = 0;
rem_reconfig_dev.regs->reconfig_start = 1;
while (1) {}
+2 -3
View File
@@ -189,6 +189,7 @@ MENU(menu_sync, P99_PROTECT({ \
{ "H-PLL Post-Coast", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.post_coast, OPT_NOWRAP, 0, PLL_COAST_MAX, lines_disp } } },
{ "ADC PLL BW", OPT_AVCONFIG_SELECTION, { .sel = { &tc.adc_pll_bw, OPT_WRAP, SETTING_ITEM(adc_pll_bw_desc) } } },
{ "FPGA PLL BW", OPT_AVCONFIG_SELECTION, { .sel = { &tc.fpga_pll_bw, OPT_WRAP, SETTING_ITEM(fpga_pll_bw_desc) } } },
{ "Sync glitch filt", OPT_AVCONFIG_SELECTION, { .sel = { &tc.sync_glitch_filt, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
}))
MENU(menu_lm, P99_PROTECT({ \
@@ -247,6 +248,7 @@ MENU(menu_compatibility, P99_PROTECT({ \
{ "Full VSYNC bypas", OPT_AVCONFIG_SELECTION, { .sel = { &tc.full_vs_bypass, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
{ "Default HDMI VIC", OPT_AVCONFIG_NUMVALUE, { .num = { &tc.default_vic, OPT_NOWRAP, 0, HDMI_1080p50, value_disp } } },
{ "Panasonic hack", OPT_AVCONFIG_SELECTION, { .sel = { &tc.panasonic_hack, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
{ "Disable PR2x", OPT_AVCONFIG_SELECTION, { .sel = { &tc.hdmi_pr2x_disable, OPT_WRAP, SETTING_ITEM(off_on_desc) } } },
}))
MENU(menu_audio, P99_PROTECT({ \
@@ -705,9 +707,6 @@ int load_lc_palette_set(char *dirname, char *filename) {
} else if (strncmp(tmpbuf, "maria_pal", 10) == 0) {
offset = offsetof(lc_palette_set, maria_pal)/4;
entries_remaining = 256;
} else if (strncmp(tmpbuf, "gtia_pal", 10) == 0) {
offset = offsetof(lc_palette_set, gtia_pal)/4;
entries_remaining = 128;
} else if (strncmp(tmpbuf, "sms_pal", 10) == 0) {
offset = offsetof(lc_palette_set, sms_pal)/4;
entries_remaining = 64;
+6 -1
View File
@@ -50,6 +50,7 @@ extern uint8_t update_cur_vm;
extern SD_DEV sdcard_dev;
extern c_shmask_t c_shmask;
extern c_lc_palette_set_t c_lc_palette_set;
extern avinput_t last_input;
char target_profile_name[USERDATA_NAME_LEN+1], cur_profile_name[USERDATA_NAME_LEN+1];
@@ -67,6 +68,7 @@ const ude_item_map ude_initcfg_items[] = {
UDE_ITEM(10, 120, ts.osd_status_timeout),
UDE_ITEM(11, 120, ts.osd_highlight_color),
UDE_ITEM(12, 120, ts.phase_hotkey_enable),
UDE_ITEM(13, 122, last_input),
};
const ude_item_map ude_profile_items[] = {
@@ -140,6 +142,9 @@ const ude_item_map ude_profile_items[] = {
// 65 reserved
UDE_ITEM(66, 120, tc.panasonic_hack),
UDE_ITEM(67, 120, tc.o480p_pbox),
UDE_ITEM(68, 122, tc.hdmi_ar),
UDE_ITEM(69, 122, tc.hdmi_pr2x_disable),
UDE_ITEM(70, 123, tc.sync_glitch_filt),
};
int write_userdata(uint8_t entry) {
@@ -234,7 +239,7 @@ int read_userdata(uint8_t entry, int dry_run) {
if (strncmp(hdr.userdata_key, "USRDATA", 8)) {
printf("No userdata found on entry %u\n", entry);
return 1;
return -2;
}
strlcpy(target_profile_name, hdr.name, USERDATA_NAME_LEN+1);
+73 -36
View File
@@ -133,7 +133,7 @@ uint32_t calculate_pclk(uint32_t src_clk_hz, mode_data_t *vm_out, vm_proc_config
int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm_proc_config_t *vm_conf)
{
int i, diff_lines, diff_v_hz_x100, mindiff_id=0, mindiff_lines=1000, mindiff_v_hz_x100=10000, x_rpt_decr=0;
int i, diff_lines, diff_v_hz_x100, mindiff_id=0, mindiff_lines=1000, mindiff_v_hz_x100=10000, x_rpt_decr=0, skip_hv_mult=0, settled=0;
mode_data_t *mode_preset;
mode_flags valid_lm[] = { (MODE_PT | (cc->pt_mode ? (MODE_L5_GEN_4_3<<(cc->pt_mode-1)) : 0)),
(MODE_L2 | (MODE_L2<<cc->l2_mode)),
@@ -146,15 +146,27 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
uint8_t upsample2x = cc->upsample2x;
// one for each video_group
uint8_t* group_ptr[] = { &pt_only, &cc->pm_240p, &cc->pm_240p, &cc->pm_384p, &cc->pm_480i, &cc->pm_480i, &cc->pm_480p, &cc->pm_480p, &pt_only, &cc->pm_1080i, &pt_only };
uint8_t* group_ptr[] = { &pt_only, &cc->pm_240p, &cc->pm_240p, &cc->pm_384p, &cc->pm_480i, &cc->pm_480i, &cc->pm_480p, &cc->pm_480p, &pt_only, &cc->pm_1080i, &pt_only, &pt_only };
for (i=0; i<num_video_modes_plm; i++) {
mode_preset = &video_modes_plm[i];
// Workstation presets share line counts with each other and with VESA modes but each has one fixed refresh
// rate; consider them only when the refresh matches, so other sources are matched exactly as before and a
// small line-count wobble cannot flip between them.
if ((mode_preset->group == GROUP_FIXED_VHZ) &&
(abs((int)vm_in->timings.v_hz_x100 - (int)mode_preset->timings.v_hz_x100) > FIXED_VHZ_TOL_X100))
continue;
// After the early exit below, only the fixed-refresh presets (appended at the end of the table) may still
// compete, so a preset sharing its line count with a VESA mode can win the equal-line refresh tie-break.
if (settled && (mode_preset->group != GROUP_FIXED_VHZ))
continue;
switch (mode_preset->group) {
case GROUP_384P:
//fixed Line2x/3x mode for 240x360p/400p
valid_lm[2] = MODE_L3_GEN_16_9;
valid_lm[2] = MODE_L3_GEN_16_9 | MODE_L3_GEN_4_3;
valid_lm[3] = MODE_L2_240x360;
valid_lm[4] = MODE_L3_240x360;
if ((!vm_in->timings.h_total) && (mode_preset->timings.v_total == 449)) {
@@ -174,7 +186,7 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
valid_lm[3] = MODE_L4_GEN_4_3;
break;
case GROUP_480P:
if (mode_preset->vic == HDMI_480p60) {
if (mode_preset->vic == HDMI_480p60) {
switch (cc->s480p_mode) {
case 0: // Auto
if (vm_in->timings.h_synclen > 82)
@@ -213,8 +225,8 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
mindiff_v_hz_x100 = diff_v_hz_x100;
mindiff_lm = target_lm;
} else if ((mindiff_lines <= 2) && (diff_lines > mindiff_lines)) {
// Break out if suitable mode already found
break;
// Stop considering regular presets once a suitable mode has been found
settled = 1;
}
}
}
@@ -244,7 +256,6 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
vm_out->vic = HDMI_Unknown;
memset(vm_conf, 0, sizeof(vm_proc_config_t));
vm_conf->si_pclk_mult = 1;
mindiff_lm &= mode_preset->flags; //ensure L2 mode uniqueness
@@ -281,7 +292,6 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
while ((((vm_out->timings.v_hz_x100*vm_out->timings.v_total)/100)*vm_out->timings.h_total*(vm_conf->h_skip+1))>>vm_out->timings.interlaced < 25000000UL) {
vm_conf->x_rpt = vm_conf->h_skip = 2*(vm_conf->h_skip+1)-1;
}
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
break;
case MODE_L2:
// Upsample / pixel-repeat horizontal resolution of 384p/480p/960i modes
@@ -289,16 +299,15 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
if (upsample2x) {
vmode_hv_mult(vm_in, 2, 1);
vmode_hv_mult(vm_out, 2, VM_OUT_YMULT);
skip_hv_mult = 1;
} else {
vm_conf->x_rpt = 1;
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
}
} else {
if (cc->o480p_pbox) {
vm_conf->x_rpt = vm_conf->h_skip = 3;
x_rpt_decr += 1;
}
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
}
break;
case MODE_L3_GEN_16_9:
@@ -307,15 +316,20 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
if (upsample2x) {
vmode_hv_mult(vm_in, 2, 1);
vmode_hv_mult(vm_out, 2, VM_OUT_YMULT);
skip_hv_mult = 1;
} else {
vm_conf->x_rpt = 1;
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
}
} else {
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
} else if (cc->hdmi_pr2x_disable && ((mode_preset->group == GROUP_480P) || (mode_preset->group == GROUP_576P))) {
vm_conf->x_rpt = 1;
}
break;
case MODE_L3_GEN_4_3:
// Upsample by 3x on GBI Line3x generic
if (mode_preset->group == GROUP_384P) {
vmode_hv_mult(vm_in, 3, 1);
vmode_hv_mult(vm_out, 3, 1);
}
vm_conf->x_size = vm_out->timings.h_active-2*vm_in->mask.h;
vm_out->timings.h_synclen /= 3;
vm_out->timings.h_backporch /= 3;
@@ -323,6 +337,8 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
vm_out->timings.h_total /= 3;
vm_out->timings.h_total_adj = 0;
vmode_hv_mult(vm_out, 4, VM_OUT_YMULT);
skip_hv_mult = 1;
vm_conf->si_pclk_mult = 4;
break;
case MODE_L4_GEN_4_3:
// Upsample / pixel-repeat horizontal resolution of 480i mode
@@ -330,17 +346,30 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
if (upsample2x) {
vmode_hv_mult(vm_in, 2, 1);
vmode_hv_mult(vm_out, 2, VM_OUT_YMULT);
skip_hv_mult = 1;
} else {
vm_conf->x_rpt = 1;
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
}
} else {
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
}
break;
case MODE_L5_GEN_4_3:
if (cc->hdmi_pr2x_disable && mode_preset->group == GROUP_288P) {
vmode_hv_mult(vm_in, 2, 1);
vmode_hv_mult(vm_out, 2, VM_OUT_YMULT);
skip_hv_mult = 1;
}
break;
case MODE_L6_GEN_4_3:
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
if (cc->hdmi_pr2x_disable) {
if (mode_preset->group == GROUP_288P) {
// upsampled active would exceed 2048, must pixel-repeat
vm_conf->x_rpt = 1;
} else {
vmode_hv_mult(vm_in, 2, 1);
vmode_hv_mult(vm_out, 2, VM_OUT_YMULT);
skip_hv_mult = 1;
}
}
break;
case MODE_L2_512_COL:
case MODE_L2_384_COL:
@@ -351,13 +380,13 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
} else {
vm_conf->x_rpt = vm_conf->h_skip = 1;
}
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
break;
case MODE_L3_512_COL:
case MODE_L4_512_COL:
case MODE_L6_512_COL:
vm_conf->x_rpt = vm_conf->h_skip = 1;
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
break;
case MODE_L6_512_COL:
vm_conf->x_rpt = vm_conf->h_skip = cc->hdmi_pr2x_disable ? 3 : 1;
break;
case MODE_L2_256_COL:
if (cc->o480p_pbox) {
@@ -366,34 +395,37 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
} else {
vm_conf->x_rpt = vm_conf->h_skip = 2;
}
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
break;
case MODE_L3_384_COL:
case MODE_L4_384_COL:
case MODE_L5_512_COL:
case MODE_L6_384_COL:
case MODE_L6_320_COL:
vm_conf->x_rpt = vm_conf->h_skip = 2;
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
break;
case MODE_L6_384_COL:
vm_conf->x_rpt = vm_conf->h_skip = cc->hdmi_pr2x_disable ? 4 : 2;
break;
case MODE_L6_320_COL:
vm_conf->x_rpt = vm_conf->h_skip = cc->hdmi_pr2x_disable ? 5 : 2;
break;
case MODE_L3_240x360:
vm_conf->x_rpt = vm_conf->h_skip = 7;
break;
case MODE_L3_320_COL:
case MODE_L4_320_COL:
case MODE_L5_384_COL:
case MODE_L6_256_COL:
vm_conf->x_rpt = vm_conf->h_skip = 3;
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
break;
case MODE_L6_256_COL:
vm_conf->x_rpt = vm_conf->h_skip = cc->hdmi_pr2x_disable ? 7 : 3;
break;
case MODE_L2_240x360:
case MODE_L3_256_COL:
case MODE_L4_256_COL:
case MODE_L5_320_COL:
vm_conf->x_rpt = vm_conf->h_skip = 4;
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
break;
case MODE_L5_256_COL:
vm_conf->x_rpt = vm_conf->h_skip = 5;
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
break;
default:
printf("WARNING: invalid mindiff_lm\n");
@@ -401,20 +433,25 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
break;
}
// Set clock multiplication factor
if (mindiff_lm == MODE_L3_GEN_4_3)
vm_conf->si_pclk_mult = 4;
else
if (!skip_hv_mult)
vmode_hv_mult(vm_out, VM_OUT_XMULT, VM_OUT_YMULT);
// Set clock multiplication factor if not done earlier
if (!vm_conf->si_pclk_mult)
vm_conf->si_pclk_mult = VM_OUT_PCLKMULT;
// Reduce x_rpt for 1:1 PAR 256col mode
if (mindiff_lm & (MODE_L2_256_COL|MODE_L4_256_COL|MODE_L5_256_COL))
vm_conf->x_rpt -= cc->ar_256col;
else if (mindiff_lm & (MODE_L3_256_COL|MODE_L6_256_COL))
else if (mindiff_lm & MODE_L3_256_COL)
vm_conf->x_rpt = cc->ar_256col ? 2 : 3;
else if (mindiff_lm & MODE_L6_256_COL)
vm_conf->x_rpt = cc->ar_256col ? (cc->hdmi_pr2x_disable+1)*3-1 : (cc->hdmi_pr2x_disable+1)*4-1;
if (mindiff_lm & (MODE_L3_320_COL|MODE_L2_240x360|MODE_L3_240x360))
if (mindiff_lm & (MODE_L3_320_COL|MODE_L2_240x360))
x_rpt_decr += 1;
else if (mindiff_lm & (MODE_L3_240x360))
x_rpt_decr += 2;
vm_conf->x_rpt -= x_rpt_decr;
@@ -424,9 +461,9 @@ int get_pure_lm_mode(avconfig_t *cc, mode_data_t *vm_in, mode_data_t *vm_out, vm
}
// Force TX pixel-repeat for high bandwidth modes
if (((mindiff_lm == MODE_L5_GEN_4_3) && (mode_preset->group == GROUP_288P)) ||
if (!cc->hdmi_pr2x_disable && (((mindiff_lm == MODE_L5_GEN_4_3) && (mode_preset->group == GROUP_288P)) ||
((mindiff_lm == MODE_L3_GEN_16_9) && ((mode_preset->group == GROUP_480P) || (mode_preset->group == GROUP_576P))) ||
(mindiff_lm == MODE_L3_240x360) || (mindiff_lm >= MODE_L6_GEN_4_3))
(mindiff_lm >= MODE_L6_GEN_4_3)))
vm_conf->tx_pixelrep = 1;
sniprintf(vm_out->name, 11, "%s x%u", vm_in->name, vm_conf->y_rpt+1);
+14 -1
View File
@@ -40,7 +40,7 @@ const mode_data_t video_modes_plm_default[] = {
{ "256x240LB", HDMI_Unknown, { 256, 240, 5000, 341, 0, 312, 39, 41, 25, 3, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_SDTV, GROUP_288P, (MODE_L2_256_COL | MODE_L3_256_COL | MODE_L4_256_COL | MODE_L5_256_COL | MODE_L6_256_COL), },
{ "288p", HDMI_288p50, { 720, 288, 5008, 864, 0, 312, 69, 19, 63, 3, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_SDTV, GROUP_288P, (MODE_PT | MODE_L2), },
/* 360p: GBI */
{ "480x360", HDMI_Unknown, { 480, 360, 6000, 600, 0, 375, 63, 10, 38, 3, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_EDTV, GROUP_384P, (MODE_PT | MODE_L2), },
{ "480x360", HDMI_Unknown, { 480, 360, 6000, 600, 0, 375, 63, 10, 38, 3, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_EDTV, GROUP_384P, (MODE_PT | MODE_L2 | MODE_L3_GEN_4_3), },
{ "240x360", HDMI_Unknown, { 240, 360, 6000, 300, 0, 375, 32, 10, 18, 3, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_EDTV, GROUP_384P, (MODE_L2_240x360 | MODE_L3_240x360), },
/* 384p: Sega Model 2 */
{ "384p", HDMI_Unknown, { 496, 384, 5500, 640, 0, 423, 50, 29, 62, 3, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_EDTV, GROUP_384P, (MODE_PT | MODE_L2), },
@@ -82,4 +82,17 @@ const mode_data_t video_modes_plm_default[] = {
{ "1080p_60", HDMI_1080p60, {1920, 1080, 6000, 2200, 0, 1125, 148, 36, 44, 5, 0}, DEF_PHASE, {{ 0, 0}}, (VIDEO_HDTV | VIDEO_PC), GROUP_1080P, MODE_PT, },
/* VESA UXGA mode */
{ "1600x1200", HDMI_Unknown, {1600, 1200, 6000, 2160, 0, 1250, 304, 46, 192, 3, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_PC, GROUP_NONE, MODE_PT, },
/* Fixed-refresh workstation modes (GROUP_FIXED_VHZ): matched only within FIXED_VHZ_TOL_X100 of their refresh. */
/* NeXTstation Color (ADB configuration) 1120x832@72: 62.50kHz, 868 lines, 90MHz; measured and tuned on hardware */
{ "1120x832", HDMI_Unknown, {1120, 832, 7200, 1440, 0, 868, 185, 30, 110, 3, 0}, 4, {{ 0, 0}}, VIDEO_PC, GROUP_FIXED_VHZ, MODE_PT, },
/* Sun framebuffer modes, timings from the cg6 (GX/TGX) and cg14 (SX) PROMs. 1152x900@66 is the same on cg6, cg14
and ZX and was verified on a SPARCstation 20 with ZX (Leo) and TurboGX boards; the other Sun entries are not
yet verified on hardware. 76 Hz differs by board: cg6 1504x937 @ 76.64 Hz, cg14 1504x943 @ 76.15 Hz ("HS"). */
{ "1152x900", HDMI_Unknown, {1152, 900, 6600, 1528, 0, 937, 208, 31, 128, 4, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_PC, GROUP_FIXED_VHZ, MODE_PT, },
{ "1152x900H", HDMI_Unknown, {1152, 900, 7664, 1504, 0, 937, 192, 31, 128, 4, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_PC, GROUP_FIXED_VHZ, MODE_PT, },
{ "1152x900HS", HDMI_Unknown, {1152, 900, 7615, 1504, 0, 943, 260, 33, 64, 8, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_PC, GROUP_FIXED_VHZ, MODE_PT, },
/* Sun 1280x1024: @67 = 118.125MHz 1648x1075 (66.68 Hz), @76 = 135MHz 1664x1066 (76.11 Hz; same line count as VESA,
told apart by refresh only) */
{ "1280x1024L", HDMI_Unknown, {1280, 1024, 6668, 1648, 0, 1075, 216, 41, 128, 8, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_PC, GROUP_FIXED_VHZ, MODE_PT, },
{ "1280x1024H", HDMI_Unknown, {1280, 1024, 7611, 1664, 0, 1066, 288, 32, 64, 8, 0}, DEF_PHASE, {{ 0, 0}}, VIDEO_PC, GROUP_FIXED_VHZ, MODE_PT, },
};