Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
RiscOS
S
Sources
V
Video
UserI
ScrModes
Commits
b93814e8
Commit
b93814e8
authored
Nov 06, 1996
by
Neil Turton
Browse files
Import from cleaned 370 CD
parent
1aa6d45b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
9 deletions
+86
-9
c/ScrModes
c/ScrModes
+69
-7
cmhg/ScrModesv
cmhg/ScrModesv
+1
-1
h/modex
h/modex
+16
-1
No files found.
c/ScrModes
View file @
b93814e8
...
...
@@ -61,6 +61,7 @@
"file_format\0 " \
"monitor_title\0" \
"dpms_state\0 " \
"lcd_support\0 " \
"startmode\0 " \
"endmode"
#define MAXKEYWORDLEN 13
...
...
@@ -93,6 +94,7 @@ enum keycode
k_file_format
,
k_monitor_title
,
k_dpms_state
,
k_lcd_support
,
k_startmode
,
k_endmode
,
...
...
@@ -102,7 +104,7 @@ enum keycode
};
#if DODEBUG
static
int
dodebug
=
0
;
static
int
dodebug
=
1
;
#define debug if (!dodebug) {} else
#else
#define debug if (1) {} else
...
...
@@ -819,8 +821,29 @@ static _kernel_oserror *parse_modefile (MonitorDescriptionRef *description)
}
}
/*
* Now check for optional LCD_support keyword
*/
if
(
res
==
NULL
)
{
md
->
lcd_support
=
0
;
/* Indicates CRT as default */
if
(
kc
==
k_lcd_support
)
{
debug
printf
(
"Got the lcdsupport keyword
\n
"
);
res
=
skip_char
(
':'
);
if
(
res
==
NULL
)
{
res
=
read_one_u32
(
&
md
->
lcd_support
,
0
);
/* read LCD_support value */
if
(
md
->
lcd_support
!=
0
)
md
->
dpms_state
=
-
1
;
/* LCD and DPMS are mutually exclusive */
debug
printf
(
"Read the value as %d
\n
"
,
md
->
lcd_support
);
}
if
(
res
==
NULL
)
kc
=
read_keyword
();
/* then read next keyword */
}
}
if
(
res
==
NULL
)
{
debug
printf
(
"Going to read the modes now...
\n
"
);
res
=
parse_modelist
(
md
,
kc
);
/* pass in read keyword token */
}
if
(
res
)
{
...
...
@@ -1083,6 +1106,9 @@ static int mode_valid (ModeDescriptionRef mp, int depth,
uns32
pixels
=
mx
*
my
;
uns32
datarate
,
datasize
;
/* Convert from pixels to bytes: method varies according to depth */
if
((
depth
>
2
)
&&
(
current_monitor
->
lcd_support
==
1
))
return
0
;
/** Eek! 4bpp is max for b/w panels! **/
if
(
depth
<
3
)
{
uns
shift
=
3
-
depth
;
...
...
@@ -1160,10 +1186,15 @@ static int restrict_bandwidth (int os_limit)
* (but zero means no limit)
*/
if
(
bandwidth_limit
==
0
||
os_limit
<
bandwidth_limit
)
/*
if (bandwidth_limit == 0 || os_limit < bandwidth_limit)
return os_limit;
else
return
bandwidth_limit
;
--Commented out by WT 1-8-95 so that 'Turbo' Krytens can be tried (they have
a higher bandwidth & it is inconvenient to reblow ROMs every time. Whether this
becomes a permanent change or not remains to be seen.
*/
if
(
bandwidth_limit
==
0
)
return
os_limit
;
else
return
bandwidth_limit
;
}
static
void
service_modeextension
(
_kernel_swi_regs
*
regs
)
...
...
@@ -1190,6 +1221,11 @@ static void service_modeextension (_kernel_swi_regs *regs)
* If no list is necessary, the 1st word holds -1.
* If a list is necessary, the 1st word holds DPMS_INDEX, the 2nd
* holds the dpms value, and the 3rd word holds -1.
*
* WT 19-Jan-95 - The parameters list is extended to cater for LCD
* panels, both single and dual panel, as defined in the LCD_support
* field of the mode definition file. So, now 6 words are statically
* allocated.
*/
static
VIDCList
thevidclist
;
...
...
@@ -1197,6 +1233,7 @@ static void service_modeextension (_kernel_swi_regs *regs)
ModeDescriptionRef
mp
;
uns32
dataratelimit
,
datasizelimit
;
int
nmodes
;
int
ctrllistpos
=
0
;
/*
* Check for being passed a mode selector as opposed to a mode
...
...
@@ -1265,15 +1302,40 @@ static void service_modeextension (_kernel_swi_regs *regs)
}
vp
->
pixelrate
=
mp
->
definition
.
pixel_khz
;
vp
->
syncpol
=
mp
->
definition
.
syncpol
;
if
(
current_monitor
->
dpms_state
==
-
1
)
if
(
(
current_monitor
->
dpms_state
==
-
1
)
&&
(
current_monitor
->
lcd_support
==
0
))
{
vp
->
vcparam
[
0
].
index
=
-
1
;
/* terminator - no extra video control parameters */
}
else
{
vp
->
vcparam
[
0
].
index
=
DPMS_INDEX
;
vp
->
vcparam
[
0
].
value
=
current_monitor
->
dpms_state
;
vp
->
vcparam
[
1
].
index
=
-
1
;
/* terminator */
if
(
current_monitor
->
dpms_state
!=
-
1
)
{
vp
->
vcparam
[
ctrllistpos
].
index
=
DPMS_INDEX
;
vp
->
vcparam
[
ctrllistpos
].
value
=
current_monitor
->
dpms_state
;
ctrllistpos
++
;
}
if
(
current_monitor
->
lcd_support
!=
0
)
{
debug
printf
(
"I'm an LCD panel & I'm going to tell the Kernel!
\n
"
);
vp
->
vcparam
[
ctrllistpos
].
index
=
LCDMODE_INDEX
;
vp
->
vcparam
[
ctrllistpos
].
value
=
LCDMODE_VALUE
;
ctrllistpos
++
;
if
(
current_monitor
->
lcd_support
!=
3
)
{
vp
->
vcparam
[
ctrllistpos
].
index
=
LCDDUAL_INDEX
;
vp
->
vcparam
[
ctrllistpos
].
value
=
LCDDUAL_VALUE
;
ctrllistpos
++
;
}
vp
->
vcparam
[
ctrllistpos
].
index
=
LCDOFF0_INDEX
;
vp
->
vcparam
[
ctrllistpos
].
value
=
LCDOFF0_VALUE
;
ctrllistpos
++
;
vp
->
vcparam
[
ctrllistpos
].
index
=
LCDOFF1_INDEX
;
vp
->
vcparam
[
ctrllistpos
].
value
=
LCDOFF1_VALUE
;
ctrllistpos
++
;
vp
->
vcparam
[
ctrllistpos
].
index
=
DACCTRL_INDEX
;
vp
->
vcparam
[
ctrllistpos
].
value
=
DACCTRL_VALUE
;
ctrllistpos
++
;
}
vp
->
vcparam
[
ctrllistpos
].
index
=
-
1
;
/* List terminator */
}
/* Now modify the register set to reflect servicing the call */
regs
->
r
[
1
]
=
0
;
/* Service_Serviced */
...
...
cmhg/ScrModesv
View file @
b93814e8
...
...
@@ -16,7 +16,7 @@
; Screen Modes module
;
help-string:
Screen_Modes
0
.
1
3
help-string:
Screen_Modes
0
.
1
8
title-string:
ScreenModes
...
...
h/modex
View file @
b93814e8
...
...
@@ -18,6 +18,7 @@
* Internal definitions used by ScreenModes module.
*/
/*
* The 6 field framing parameters for each direction, horizontal and
* vertical. In horizontal case, the parameters are measured in VIDC
...
...
@@ -35,6 +36,19 @@
* The video control list parameter index for indicating DPMS state
*/
/**Added by WT 13-1-95 for Stork **/
#define LCDMODE_INDEX 01
#define LCDMODE_VALUE 1
/*Enable*/
#define LCDDUAL_INDEX 02
#define LCDDUAL_VALUE 1
/*Enable*/
#define LCDOFF0_INDEX 03
#define LCDOFF0_VALUE 6
/*Defining a 640x480 dual-panel LCD as used in Stork*/
#define LCDOFF1_INDEX 04
#define LCDOFF1_VALUE 129
/*Defining a 640x480 dual-panel LCD as used in Stork*/
#define DACCTRL_INDEX 06
#define DACCTRL_VALUE 1
/*Enable - testing only*/
/**End of additions**/
#define DPMS_INDEX 11
...
...
@@ -64,7 +78,7 @@ typedef struct
uns32
vpar
[
FR__COUNT
];
/* vertical parameters */
uns32
pixelrate
;
/* pixel rate measured in kHz */
uns32
syncpol
:
2
,
:
0
;
/* sync polarity code, 0..3 */
ModeParam
vcparam
[
2
];
/*
h
olds
either just -1 terminator,
or
(
DPMS
_index, DPMS_value), -1
*/
ModeParam
vcparam
[
6
];
/*
H
olds
VCparameters: LCD mode, LCD dual-panel, LCD offsets(2), DAC control, -1
or DPMS
, -1 (WT)
*/
}
VIDCList
,
*
VIDCListRef
;
/* Mode information block as filled in when handling Service_EnumerateScreenModes */
...
...
@@ -119,6 +133,7 @@ typedef struct
char
name
[
MAXMONITORNAME
];
ModeDescriptionRef
modelist
;
uns32
dpms_state
;
/* value specified by DPMS_state keyword, or 0 if none */
uns32
lcd_support
;
/* 0=>modefile is CRT, 1=>LCD single-panel, 2=>LCD dual panel [WT13-01-95] */
}
MonitorDescription
,
*
MonitorDescriptionRef
;
/* EOF modex.h */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment