VOGONS

Common searches


VIDEO - Overscan border (SDL1)

Topic actions

First post, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Post comments here.

Water flows down the stream
How to ask questions the smart way!

Reply 3 of 100, by avatar_58

User metadata
Rank Oldbie
Rank
Oldbie
HunterZ wrote:

I wish I could remember some games besides Crystal Caves and Secret Agent that use this. Will this work with text-mode applications as well?

I think Crystal Caves is the only game that truly *needs* it while other games just use it for effect.

Reply 5 of 100, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

I have a comment (not a complaint by any means!) based on that screenshot - it seems to be doing weird things with the color blending:
- blending of white and red makes green (look at the $ on the lower-left and the stone along the left and right edges of the screen)
- blending of brown (red+green) and red makes purple/magenta (look at the wood platforms on the right side)
- blending of hi-intensity red with red makes a weird pastel yellow (look at the heart highlights at the bottom middle)

I'm guessing it's doing some quick-'n-dirty math on the color values or something.

Reply 7 of 100, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

Looks like its overflowing istead of saturating when adding the colours. Vasyl's earlier screenshots didn't show this bug. Could be related to desktop bitdepth (perhaps it's a bug only in 16bit mode, not in 32bit mode).

My site: Ramblings on mostly tech stuff.

Reply 8 of 100, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

I'm usually using 32bit depth colors.
I set overscanstrength=30, then the border seems to be correct.
(default value was 2)
Please see this screenshot.

Attachments

  • 30.PNG
    Filename
    30.PNG
    File size
    30.98 KiB
    Views
    1016 views
    File license
    Fair use/fair dealing exception

Reply 9 of 100, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

That cannot possibly be right. Looking at Vasyl's patch, he uses interp_w2 to blend the two pixels. There, a blend weight of 30 means that the border should have an opacity of 30 parts in 31 (just under 97%). It would look nearly solid red, which it doesn't in your screenshot.

According to Vasyl's patch, the accepted values are 1..10 anyway. Setting it to 30 will actually be the same as setting it to 1 (resulting in 50% blending -- which is what it looks like in the screenshot).

Without seeing the code, I can't really tell what's going on, but there has to be a bug somewhere. The problem HunterZ first mentioned is definitely an error in blending, as there is no way in which proper blending could make dark red (at 67%) and white (at 33%) result in light green.

Reply 10 of 100, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

I couldn't apply overscan patch immediately because optimization patch modified lots of line in render_templates.h. (I applied vesa 16bit + overscan + the latest svga + other experimental patches.)
I changed all the 'pmake(src[x])' to 'xmake(src,x)' in render_template.h
manually and added Scaler_Line++; in every scaler.
I will check what I did wrong.

Last edited by ykhwong on 2005-08-24, 02:42. Edited 1 time in total.

Reply 13 of 100, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

Weird. It looks fine, but the value is strange. At overscanstrength=3, the white of the dollarsign should have its blue/green levels reduced by a factor of 4. Since the white isn't pure (0xFF in each channel), but slightly darker (0xFC), I'd expect 0x3F for blue/green. Instead, they're 0x38 (reduction by 4.5).

Not really a problem and perhaps caused by something else (maybe something as simple as gamma correction in your PNG), but it bugs me that I can't explain it.

Still, this version does show a proper red everywhere. If it works at factor 2 as well, I think the bug is probably just in my mind. Just ignore me 😢

Reply 15 of 100, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

I did not measure exact color values, relied on interp_w2 implementation itself. The first (broken) screenshot is really odd. It seems that blending almost worked but there was color overflow from one component to another, almost like blending was used on some packed color format without unpacking first. That suggests bug in interp_w2 but the CVS version looks rock solid to me. Bug like that would also cause color artefacts in complex scalers.

Reply 16 of 100, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

From this thread: Re: Crystal Caves Hud Shaking

avatar_58 wrote:

Alrighty the new border patch applied to ykhwong's works like a charm. For some reason though it does not work with "surface" when in fullscreen. Instead I set it to "overlay" and it works great. Changing it to a 1 pixel wide border is good enough for me and doesn't get in the way of the HUD.

Good work all. 😁

His statement about it not working with surface mode bothers me, although I haven't tried to replicate it.

Reply 19 of 100, by vasyl

User metadata
Rank Oldbie
Rank
Oldbie

Odd, I thought that all rendering goes through scalers in render_templates.h. In fact, I am positive that it does. ykhwong: Can you tell which scaler is in use in full screen mode in your case? If it is "normal", double-check that it is patched correctly -- it is the only scaler that has implementation without PMAKE/XMAKE, and that implementation must be disabled and replaced in order for overscan to work.