scanlines and resolution

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
User avatar
theelf
Posts: 26
Joined: Sun Feb 19, 2006 2:10 pm
Contact:

scanlines and resolution

Post by theelf »

Hi!

two questions

first, is possible to use scanlines with OpenGL?¿ i will love to have real scanlines for EGA games, but my CRT is 31khz, then i need to emulate them


Second not too important, is possible to use non 4:3 resolutions?
for example, i use 1600x1200 right now in my CRT, but i will preffer 1280x1200 or 1280x100 for example, because i already use 1600x1200 for some emulators at 60hz

Or a way to select 70hz for a resolution


Thanks a lot
Last edited by theelf on Wed Apr 13, 2016 2:44 am, edited 1 time in total.
User avatar
theelf
Posts: 26
Joined: Sun Feb 19, 2006 2:10 pm
Contact:

Post by theelf »

Any ideas? still stuck in this problems with scummvm

Thanks
User avatar
eriktorbjorn
ScummVM Developer
Posts: 3560
Joined: Mon Oct 31, 2005 7:39 am

Re: scanlines in OpenGL and resolution

Post by eriktorbjorn »

theelf wrote: first, is possible to use scanlines with OpenGL?¿ i will love to have real scanlines for EGA games, but my CRT is 31khz, then i need to emulate them
I don't use the OpenGL modes myself, and know very little about it, so I could easily be wrong. But from what I understand, there isn't any such feature. (There is a "TV2x" graphics mode, but then it's no longer OpenGL.)
theelf wrote: Second not too important, is possible to use non 4:3 resolutions?
for example, i use 1600x1200 right now in my CRT, but i will preffer 1280x1200 or 1280x100 for example, because i already use 1600x1200 for some emulators at 60hz

Or a way to select 70hz for a resolution
It looks like it does check available fullscreen resolutions, and picks the one it thinks will be the most suitable... but I don't know if there's any way to force it to use a particular one.

It does save the previously used mode in the ScummVM settings file as "last_fullscreen_mode_width" and "last_fullscreen_mode_height", but I can't tell if editing that by hand makes any difference.
Last edited by eriktorbjorn on Tue Mar 29, 2016 9:59 am, edited 1 time in total.
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Post by criezy »

In OpenGL fullscreen mode you can toggle between available resolutions using Crtl+Alt and either + or -
User avatar
theelf
Posts: 26
Joined: Sun Feb 19, 2006 2:10 pm
Contact:

Post by theelf »

Thanks for reply, finally i decided to moddify the sourcecode and add a 6x scale with variable scanlines

Now the EGA games look amazing in my CRT, very similar to my old EGA screen


In 640x480 the doublescan of normal 31khz break all the magic for scanlines, but in higher resolutions, the magic is back again!


Monkey Island in 1920x1440 using a 6x scaler, and no need for OpenGL



Image

Image




I have a problem, when i press F5, the cursor have scanlines too :lol:

Just when is the scummvm menu, in normal ingame no... any ideas?

Image
User avatar
theelf
Posts: 26
Joined: Sun Feb 19, 2006 2:10 pm
Contact:

Post by theelf »

Hi guys, sorry double post, but i need some advice


Finally i did a nice normal6x, bit now i want to do a scanlines6x


Can I have some advice how to do? im stuck in this one


First i edit surfacesdl-graphics.cpp in "backends\graphics\surfacesdl"

and changed
case GFX_TV2X:
newScaleFactor = 2;

to
case GFX_TV2X:
newScaleFactor = 6;


But im stuck in this code.. any advice how to convert to scale6x? now is scaling to 2x

Code: Select all

template<typename ColorMask>
void TV2xTemplate&#40;const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
					int width, int height&#41; &#123;
	const uint32 nextlineSrc = srcPitch / sizeof&#40;uint16&#41;;
	const uint16 *p = &#40;const uint16 *&#41;srcPtr;

	const uint32 nextlineDst = dstPitch / sizeof&#40;uint16&#41;;
	uint16 *q = &#40;uint16 *&#41;dstPtr;

	while &#40;height--&#41; &#123;
		for &#40;int i = 0, j = 0; i < width; ++i, j += 2&#41; &#123;
			uint16 p1 = *&#40;p + i&#41;;
			uint32 pi;

			pi = &#40;&#40;&#40;p1 & ColorMask&#58;&#58;kRedBlueMask&#41; * 7&#41; >> 3&#41; & ColorMask&#58;&#58;kRedBlueMask;
			pi |= &#40;&#40;&#40;p1 & ColorMask&#58;&#58;kGreenMask&#41; * 7&#41; >> 3&#41; & ColorMask&#58;&#58;kGreenMask;

			*&#40;q + j&#41; = p1;
			*&#40;q + j + 1&#41; = p1;
			*&#40;q + j + nextlineDst&#41; = &#40;uint16&#41;pi;
			*&#40;q + j + nextlineDst + 1&#41; = &#40;uint16&#41;pi;
		&#125;
		p += nextlineSrc;
		q += nextlineDst << 1;
	&#125;
&#125;
User avatar
rootfather
ScummVM Lead
Posts: 182
Joined: Tue Mar 31, 2015 11:59 am
Location: Germany
Contact:

Post by rootfather »

Hi theelf, your 6x scaler looks really nice.

Do you have any plans to continue work on this and maybe try to submit a patch to get it included in the main ScummVM branch?
dr.zeissler
Posts: 28
Joined: Mon Jan 01, 2007 5:53 pm

Post by dr.zeissler »

theelf wrote:Thanks for reply, finally i decided to moddify the sourcecode and add a 6x scale with variable scanlines
Now the EGA games look amazing in my CRT, very similar to my old EGA screen
In 640x480 the doublescan of normal 31khz break all the magic for scanlines, but in higher resolutions, the magic is back again!
Monkey Island in 1920x1440 using a 6x scaler, and no need for OpenGL
Image
Image
I have a problem, when i press F5, the cursor have scanlines too :lol:
Just when is the scummvm menu, in normal ingame no... any ideas?
Image
Can't see the sample pictures :(
My G4-Mini (OSX10.3.9) does not show a regular raster either in fullscreen or window mode when choosing tv2x. Is it broken or is it due to my screen (15" TFT 1024x768 native). It does not get any better if I choose aspact-correction.

Thx
Doc
Post Reply