Commit 8a00983b authored by ROOL's avatar ROOL :robot:
Browse files

Split out data tables, stylistic refactoring

Detail:
  Move the 500+ lines of tables into a new source file and remove storage inferred by former CEAModes.h.
  Tame some of the rampant style from various authors, even within 1 function, to something reasonably consistent.
  Uppercase the 'debug' macro to 'IFDEBUG'.
  Relocate ScrModes specific defines out of EDIDModes header, rename to edidmemory.h.
  Add monitor type 6 to monitors.h.
  Fix for unguarded debug printout "Can't allocate space for monitor list" in parseedid.
Admin:
  Tested briefly, functionality unchanged.
  Submission for the EDID bounty.
  Tagged as ScrModes-0_53-tables
......@@ -16,7 +16,7 @@
#
COMPONENT = ScrModes
OBJS = ScrModes
OBJS = ScrModes tables
CMHGFILE = ScrModesv
HDRS =
ASMHDRS = ScrModes
......
......@@ -26,5 +26,5 @@ E23:Number expected
E24:Overlarge value for parameter
E25:EDID checksum is incorrect (block %0 of %1 failed) - cannot read monitor settings
E26:Unable to read EDID - does this hardware support it?
E27:EDID channel communications error.
E27:EDID channel communications error
E28:Bad ScreenModes_EnumerateAudioFormats flags
This diff is collapsed.
This diff is collapsed.
/* CEA 861-D mode timings
Horizontal & vertical parameters are listed as shown in the spec (reading
the timing diagrams from left to right), so the CEA_MODE macro needs to
manipulate them a bit in order to convert them to the form RISC OS uses.
For the vertical timings this means taking the value to the left of the
transition point.
However the macro assumes that the V1 number (at the start of the VSync
period) is the total line count; so for modes where this isn't the case
(e.g. 2) the macro parameters are manually fudged by subtracting the
actual VSync start value from V0 and V2-V4.
Currently, there are some parameters included in the macro which aren't used,
such as the image aspect ratio, and the alternate clock rate. Also where
multiple vsync width values are permissible, only the first set of timings
has been used, and the macro doesn't record the permissible pixel repetition
values for the modes where pixel repetition is expected.
*/
#define CEA_MODE(NUMBER,WIDTH,HEIGHT,INT,HZ,ASPECT,CLOCK59,CLOCK60,SYNCS,H0,H1,H2,H3,V0,V1,V2,V3,V4) \
{\
#WIDTH " x " #HEIGHT, \
WIDTH, \
HEIGHT, \
{ H1, H2, 0, H3, 0, H0 }, \
{ V2, (V3)-(V2), 0, V4, 0, (V1)-(V0) }, \
CLOCK60, \
-1, \
SYNCS, \
INT, \
HZ \
}
static const ModeDefinition cea_modes[] = {
/* NUM WIDTH HEIGHT INT HZ ASPECT CLOCK59 CLOCK60 SYNCS H0 H1 H2 H3 V0 V1 V2 V3 V4 */
CEA_MODE(1, 640, 480, 0, 60, A43, 25175, 25200, NN, 16, 96, 48, 640, 515, 525, 2, 35, 480),
CEA_MODE(2, 720, 480, 0, 60, A43, 27000, 27027, NN, 16, 62, 60, 720, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(3, 720, 480, 0, 60, A169, 27000, 27027, NN, 16, 62, 60, 720, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(4, 1280, 720, 0, 60, A169, 74176, 74250, PP, 110, 40, 220, 1280, 745, 750, 5, 25, 720),
CEA_MODE(5, 1920, 1080, 1, 60, A169, 74176, 74250, PP, 88, 44, 148, 1920, 1123, 1125, 5, 20, 540),
CEA_MODE(6, 720, 480, 1, 60, A43, 27000, 27027, NN, 38, 124, 114, 1440, 524-3, 525, 6-3, 21-3, 240),
CEA_MODE(7, 720, 480, 1, 60, A169, 27000, 27027, NN, 38, 124, 114, 1440, 524-3, 525, 6-3, 21-3, 240),
CEA_MODE(8, 720, 240, 0, 60, A43, 27000, 27027, NN, 38, 124, 114, 1440, 261-3, 262, 6-3, 21-3, 240),
CEA_MODE(9, 720, 240, 0, 60, A169, 27000, 27027, NN, 38, 124, 114, 1440, 261-3, 262, 6-3, 21-3, 240),
CEA_MODE(10, 2880, 480, 1, 60, A43, 54000, 54054, NN, 76, 248, 228, 2880, 524-3, 525, 6-3, 21-3, 240),
CEA_MODE(11, 2880, 480, 1, 60, A169, 54000, 54054, NN, 76, 248, 228, 2880, 524-3, 525, 6-3, 21-3, 240),
CEA_MODE(12, 2880, 240, 0, 60, A43, 54000, 54054, NN, 76, 248, 228, 2880, 261-3, 262, 6-3, 21-3, 240),
CEA_MODE(13, 2880, 240, 0, 60, A169, 54000, 54054, NN, 76, 248, 228, 2880, 261-3, 262, 6-3, 21-3, 240),
CEA_MODE(14, 1440, 480, 0, 60, A43, 54000, 54054, NN, 32, 124, 120, 1440, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(15, 1440, 480, 0, 60, A169, 54000, 54054, NN, 32, 124, 120, 1440, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(16, 1920, 1080, 0, 60, A169, 148352, 148500, PP, 88, 44, 148, 1920, 1121, 1125, 5, 41, 1080),
CEA_MODE(17, 720, 576, 0, 50, A43, 27000, 27000, NN, 12, 64, 68, 720, 620, 625, 5, 44, 576),
CEA_MODE(18, 720, 576, 0, 50, A169, 27000, 27000, NN, 12, 64, 68, 720, 620, 625, 5, 44, 576),
CEA_MODE(19, 1280, 720, 0, 50, A169, 74250, 74250, PP, 440, 40, 220, 1280, 745, 750, 5, 25, 720),
CEA_MODE(20, 1920, 1080, 1, 50, A169, 74250, 74250, PP, 528, 44, 148, 1920, 1123, 1125, 5, 20, 540),
CEA_MODE(21, 720, 576, 1, 50, A43, 27000, 27000, NN, 24, 126, 138, 1440, 623, 625, 3, 22, 288),
CEA_MODE(22, 720, 576, 1, 50, A169, 27000, 27000, NN, 24, 126, 138, 1440, 623, 625, 3, 22, 288),
CEA_MODE(23, 720, 288, 0, 50, A43, 27000, 27000, NN, 24, 126, 138, 1440, 310, 312, 3, 21, 288),
CEA_MODE(24, 720, 288, 0, 50, A169, 27000, 27000, NN, 24, 126, 138, 1440, 310, 312, 3, 21, 288),
CEA_MODE(25, 2880, 576, 1, 50, A43, 54000, 54000, NN, 48, 252, 276, 2880, 623, 625, 3, 22, 288),
CEA_MODE(26, 2880, 576, 1, 50, A169, 54000, 54000, NN, 48, 252, 276, 2880, 623, 625, 3, 22, 288),
CEA_MODE(27, 2880, 288, 0, 50, A43, 54000, 54000, NN, 48, 252, 276, 2880, 310, 312, 3, 22, 288),
CEA_MODE(28, 2880, 288, 0, 50, A169, 54000, 54000, NN, 48, 252, 276, 2880, 310, 312, 3, 22, 288),
CEA_MODE(29, 1440, 576, 0, 50, A43, 54000, 54000, NN, 24, 128, 136, 1440, 620, 625, 5, 44, 576),
CEA_MODE(30, 1440, 576, 0, 50, A169, 54000, 54000, NN, 24, 128, 136, 1440, 620, 625, 5, 44, 576),
CEA_MODE(31, 1920, 1080, 0, 50, A169, 148500, 148500, PP, 528, 44, 148, 1920, 1121, 1125, 5, 41, 1080),
CEA_MODE(32, 1920, 1080, 0, 24, A169, 74176, 74250, PP, 638, 44, 148, 1920, 1121, 1125, 5, 41, 1080),
CEA_MODE(33, 1920, 1080, 0, 25, A169, 74250, 74250, PP, 528, 44, 148, 1920, 1121, 1125, 5, 41, 1080),
CEA_MODE(34, 1920, 1080, 0, 30, A169, 74176, 74250, PP, 88, 44, 148, 1920, 1121, 1125, 5, 41, 1080),
CEA_MODE(35, 2880, 480, 0, 60, A43, 108000, 108108, NN, 64, 248, 240, 2880, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(36, 2880, 480, 0, 60, A169, 108000, 108108, NN, 64, 248, 240, 2880, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(37, 2880, 576, 0, 50, A43, 108000, 108000, NN, 48, 256, 272, 2880, 620, 625, 5, 44, 576),
CEA_MODE(38, 2880, 576, 0, 50, A169, 108000, 108000, NN, 48, 256, 272, 2880, 620, 625, 5, 44, 576),
CEA_MODE(39, 1920, 1080, 1, 50, A169, 72000, 72000, PN, 32, 168, 184, 1920, 1227, 1250, 5, 62, 540),
CEA_MODE(40, 1920, 1080, 1, 100, A169, 148500, 148500, PP, 528, 44, 148, 1920, 1123, 1125, 5, 20, 540),
CEA_MODE(41, 1280, 720, 0, 100, A169, 148500, 148500, PP, 440, 40, 220, 1280, 745, 750, 5, 25, 720),
CEA_MODE(42, 720, 576, 0, 100, A43, 54000, 54000, NN, 12, 64, 68, 720, 620, 625, 5, 44, 576),
CEA_MODE(43, 720, 576, 0, 100, A169, 54000, 54000, NN, 12, 64, 68, 720, 620, 625, 5, 44, 576),
CEA_MODE(44, 720, 576, 1, 100, A43, 54000, 54000, NN, 24, 126, 138, 1440, 623, 625, 3, 22, 288),
CEA_MODE(45, 720, 576, 1, 100, A169, 54000, 54000, NN, 24, 126, 138, 1440, 623, 625, 3, 22, 288),
CEA_MODE(46, 1920, 1080, 1, 120, A169, 148352, 148500, PP, 88, 44, 148, 1920, 1123, 1125, 5, 20, 540),
CEA_MODE(47, 1280, 720, 0, 120, A169, 148352, 148500, PP, 110, 40, 220, 1280, 745, 750, 5, 25, 720),
CEA_MODE(48, 720, 480, 0, 120, A43, 54000, 54054, NN, 16, 62, 60, 720, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(49, 720, 480, 0, 120, A169, 54000, 54054, NN, 16, 62, 60, 720, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(50, 720, 480, 1, 120, A43, 54000, 54054, NN, 38, 124, 114, 1440, 524-3, 525, 6-3, 21-3, 240),
CEA_MODE(51, 720, 480, 1, 120, A169, 54000, 54054, NN, 38, 124, 114, 1440, 524-3, 525, 6-3, 21-3, 240),
CEA_MODE(52, 720, 576, 0, 200, A43, 108000, 108000, NN, 12, 64, 68, 720, 620, 625, 5, 44, 576),
CEA_MODE(53, 720, 576, 0, 200, A169, 108000, 108000, NN, 12, 64, 68, 720, 620, 625, 5, 44, 576),
CEA_MODE(54, 720, 576, 1, 200, A43, 108000, 108000, NN, 24, 126, 138, 1440, 623, 625, 3, 22, 288),
CEA_MODE(55, 720, 576, 1, 200, A169, 108000, 108000, NN, 24, 126, 138, 1440, 623, 625, 3, 22, 288),
CEA_MODE(56, 720, 480, 0, 240, A43, 108000, 108000, NN, 16, 62, 60, 720, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(57, 720, 480, 0, 240, A169, 108000, 108000, NN, 16, 62, 60, 720, 522-6, 525, 12-6, 42-6, 480),
CEA_MODE(58, 720, 480, 1, 240, A43, 108000, 108000, NN, 38, 124, 114, 1440, 524-3, 525, 6-3, 21-3, 240),
CEA_MODE(59, 720, 480, 1, 240, A169, 108000, 108000, NN, 38, 124, 114, 1440, 524-3, 525, 6-3, 21-3, 240),
};
This diff is collapsed.
......@@ -48,7 +48,7 @@
#define ERR_VALUEOVF2 24 /* Overlarge value for parameter */
#define ERR_BADCHECKSUM 25 /* EDID Checksum failed */
#define ERR_CANTREADEDID 26 /* Cannot read EDID */
#define ERR_IICOPFAIL 27 /* IICStatus reported an error reading EDID*/
#define ERR_IICOPFAIL 27 /* IICStatus reported an error reading EDID */
#define ERR_BADENUMAUDIO 28 /* Bad ScreenModes_EnumerateAudioFormats flags */
/* EOF errors.h */
......
This diff is collapsed.
......@@ -16,15 +16,15 @@
/*
* Definitions of standard RISC OS monitor types
*/
#define MONITOR_PALFORMAT 0 /* standard TV-format monitor */
#define MONITOR_MULTISCAN 1 /* multiple-scan-rate monitor */
#define MONITOR_HIRESMONO 2 /* 1152x896 64Hz monochrome */
#define MONITOR_VGA 3 /* standard VGA (640x480) */
#define MONITOR_SVGA 4 /* super VGA (800x600) */
#define MONITOR_LCD 5 /* liquid crystal display on portables */
/* type 6 undefined */
#define MONITOR_FILE 7 /* defined by ScreenModes module, from file */
#define MONITOR_PALFORMAT 0 /* standard TV-format monitor */
#define MONITOR_MULTISCAN 1 /* multiple-scan-rate monitor */
#define MONITOR_HIRESMONO 2 /* 1152x896 64Hz monochrome */
#define MONITOR_VGA 3 /* standard VGA (640x480) */
#define MONITOR_SVGA 4 /* super VGA (800x600) */
#define MONITOR_LCD 5 /* liquid crystal display on portables */
#define MONITOR_3RDPARTY 6 /* reserved for 3rd party use */
#define MONITOR_FILE 7 /* defined by ScreenModes module, from file */
/* types 8-30 undefined */
#define MONITOR_AUTO 31
#define MONITOR_AUTO 31 /* determined from VGA pins ID0-3 */
/* EOF monitors.h */
This diff is collapsed.
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