Commit 97cb9b7c authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix bogus vertical bounds reported in MDF comments

Detail:
  c/ScrModes - Make sure compute_modedescription is used to initialise frame_mhz (and line_hz). Fixes bogus vertical bounds in MDF comments, and will fix order of modes as defined by sorting function modes_inorder.
  Also change horizontal bounds comment to use stored line_hz value instead of computing it on the fly
Admin:
  Tested on Pandaboard


Version 0.44. Tagged as 'ScrModes-0_44'
parent d29ddabe
/* (0.43)
/* (0.44)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.43
#define Module_MajorVersion_CMHG 0.44
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Feb 2015
#define Module_MajorVersion "0.43"
#define Module_Version 43
#define Module_MajorVersion "0.44"
#define Module_Version 44
#define Module_MinorVersion ""
#define Module_Date "14 Feb 2015"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "ScrModes"
#define Module_ComponentPath "castle/RiscOS/Sources/Video/UserI/ScrModes"
#define Module_FullVersion "0.43"
#define Module_HelpVersion "0.43 (14 Feb 2015)"
#define Module_LibraryVersionInfo "0:43"
#define Module_FullVersion "0.44"
#define Module_HelpVersion "0.44 (14 Feb 2015)"
#define Module_LibraryVersionInfo "0:44"
......@@ -1822,7 +1822,6 @@ static void generate_mode_using_gtf(double h_pixels, double v_lines, double ip_f
mode_desc->definition.xres = (int)h_pixels;
mode_desc->definition.yres = (int)v_lines;
mode_desc->frame_hz = (int)ip_freq_rqd;
mode_desc->definition.hpar[FR_SYNC] = (int) h_sync_pixels;
mode_desc->definition.hpar[FR_BPCH] = (int) h_back_porch;
mode_desc->definition.hpar[FR_BDR1] = (int) left_margin;
......@@ -1849,6 +1848,7 @@ static void generate_mode_using_gtf(double h_pixels, double v_lines, double ip_f
mode_desc->definition.interlaced = int_rqd;
sprintf(mode_desc->definition.name, "%d x %d", (int)h_pixels, (int)v_lines);
compute_modedescription(mode_desc);
mode_desc->next = monitor->modelist;
monitor->modelist = mode_desc;
......@@ -2097,7 +2097,6 @@ static void generate_mode_using_cvt_rb(double h_pixels, double v_lines, double i
/* Now populate the mode definition block */
mode_desc->definition.xres = (int)h_pixels;
mode_desc->definition.yres = (int)v_lines;
mode_desc->frame_hz = (int)ip_freq_rqd;
mode_desc->definition.hpar[FR_SYNC] = h_sync;
mode_desc->definition.hpar[FR_BPCH] = h_back_porch;
mode_desc->definition.hpar[FR_BDR1] = (int) left_margin;
......@@ -2122,6 +2121,7 @@ static void generate_mode_using_cvt_rb(double h_pixels, double v_lines, double i
mode_desc->definition.interlaced = int_rqd;
sprintf(mode_desc->definition.name, "%d x %d", (int)h_pixels, (int)v_lines);
compute_modedescription(mode_desc);
mode_desc->next = monitor->modelist;
monitor->modelist = mode_desc;
......@@ -2254,28 +2254,8 @@ static void dtd_block_to_modedesc(char* dtd_data, ModeDescriptionRef mode_desc)
}
/* Calculate the frequency for the mode description */
int HTotal = mode_desc->definition.hpar[FR_SYNC] +
mode_desc->definition.hpar[FR_BPCH] +
mode_desc->definition.hpar[FR_BDR1] +
mode_desc->definition.hpar[FR_DISP] +
mode_desc->definition.hpar[FR_BDR2] +
mode_desc->definition.hpar[FR_FPCH];
int VTotal = mode_desc->definition.vpar[FR_SYNC] +
mode_desc->definition.vpar[FR_BPCH] +
mode_desc->definition.vpar[FR_BDR1] +
mode_desc->definition.vpar[FR_DISP] +
mode_desc->definition.vpar[FR_BDR2] +
mode_desc->definition.vpar[FR_FPCH];
mode_desc->line_hz = mode_desc->definition.pixel_khz * 1000 / HTotal; /* compute line frequency in Hz */
mode_desc->frame_mhz = mode_desc->line_hz * 1000 / VTotal; /* frame frequency in milliHz, high-prec */
if (mode_desc->definition.interlaced) {
mode_desc->frame_mhz /= 2; /* if interlaced, one frame is 2 fields */
}
mode_desc->frame_hz = (mode_desc->frame_mhz + 500) / 1000; /* & low-prec for user integer Hz matching */
sprintf(mode_desc->definition.name, "%d x %d", mode_desc->definition.xres, mode_desc->definition.yres);
compute_modedescription(mode_desc);
#if DODEBUG
display_mode_parameters(mode_desc);
......@@ -2590,8 +2570,7 @@ static _kernel_oserror *parseedid(char *ediddata, FILE *f)
ModeDescriptionRef this = new_monitor->modelist;
do {
fprintf(f,"\n# Mode: %d x %d @ %dHz",this->definition.xres,this->definition.yres,this->frame_hz);
float tmp =(float)(this->definition.hpar[0]+this->definition.hpar[1]+this->definition.hpar[2]+this->definition.hpar[3]+this->definition.hpar[4]+this->definition.hpar[5]);
fprintf(f,"\n# Bounds: H %3.2fkHz, V %3.2f, DClock %3.2fMHz",((float)(this->definition.pixel_khz))/tmp,((float)(this->frame_mhz))/1000.0f,((float)(this->definition.pixel_khz))/1000.0f);
fprintf(f,"\n# Bounds: H %3.2fkHz, V %3.2f, DClock %3.2fMHz",((float)(this->line_hz))/1000.0f,((float)(this->frame_mhz))/1000.0f,((float)(this->definition.pixel_khz))/1000.0f);
fprintf(f,"\nstartmode");
fprintf(f,"\n mode_name:%d x %d",this->definition.xres,this->definition.yres);
fprintf(f,"\n x_res:%d",this->definition.xres);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment