| |
nikoniko Account closed
Registered: Dec 2006 Posts: 1 |
New video modes? 320x400 and 160x400
Hi all,
Hydrophilic/Hydradix over at the Commodore 128 Alive! forums has been working on a technique to achieve 320x400 and 160x400 interlaced modes on a C128, taking advantage of the VIC IIe's undocumented test bit to allow fine control of raster output. He's succeeded in getting it to work for NTSC (at least on his own TV), and has now put up a simple demonstration and instructions on fiddling with the settings. Anyway, with some experimentation it sounds like it could turn into something pretty cool, especially if some bright minds here could combine it with other techniques.
I know this place is mainly about 64 coding, but since the approach should also work on 128s in 64 mode, I thought you might like to know about it.
Here's his announcement: http://landover.no-ip.com/128/viewtopic.php?pid=2637
And here's his webpage, which goes into some detail about the technique: http://www.geocities.com/hydradix/C128/Interlace.htm
And finally, here's the original forum discussion while he was working on it: http://landover.no-ip.com/128/viewtopic.php?id=807
I believe he's tried to make it easy to tweak, so PAL support could probably be achieved by someone who wants to play with it.
I'd recommend that if you want to ask him questions, the forums I linked to are probably the best place since he's a frequent poster over there.
Cheers,
nikoniko |
|
| |
A Life in Hell Account closed
Registered: May 2002 Posts: 204 |
hrm, interesting.... actually really cool. A shame that no-one has worked out a way to do this on a stock c64 tho. But still really cool :).
As we all upgrade to more digital stuff, i wonder if this is going to become less relevant, as most LCD tv's (YC == svideo :-p) and such like seem to turn the c64's input into a "real" interlaced mode anyhow (not supporting half lines to begin with, after all :))
EDIT: doesn't the c128 have interlaced modes on the VDC anyhow, btw? Tho the VDC lacks multicolour, so maybe that's a stupid point :) |
| |
PopMilo
Registered: Mar 2004 Posts: 146 |
Great trick!
I remember me and my bro did some experiments with $d030 and managed to stretch display verticaly so that 200 lines would cover entire screen :)
I know we did some "dec inc d030" at the bottom of the screen... time between dec and inc determined how big the stretch was.
it was something like "vertical overscan mode"... We even modified "wizard of wor" and played it like that...
Unfortunatelly, our c128 now boots only in 64 mode... will have to try to repair it... |
| |
WVL
Registered: Mar 2002 Posts: 902 |
gonna try this @ home.. the hidden powers of $d030 :P |
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
This can be done on a stock C64 by scrolling the picture up or down one pixel every 2nd frame. That way the eye will be moving half a pixel each frame. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
@Cruzer: We all know that the secret powers of castle Camelot can do lots of stuff, but WHAT are you talking about? :D |
| |
yago
Registered: May 2002 Posts: 333 |
JackAsser: Thats actually true. By scrolling up with halfspeed, you essentially get interlace. Also works with emus.
And, as Cruzed said, its nothing todo with the hardware, but with the human eye+brain.
|
| |
Steppe
Registered: Jan 2002 Posts: 1510 |
Teh brain is teh stupid!!!11
By the way, isn't that similar to what Crest did in Krestage 2? Or did they mean 640x400 DIAGONAL? |
| |
Style
Registered: Jun 2004 Posts: 498 |
Quetzal/Chrome had some success with this a while back. I think he's still planning to do something with it.
works well on a 1084S which seems to cope pretty well. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Quetzal/Chrome had some success with this a while back. I think he's still planning to do something with it.
works well on a 1084S which seems to cope pretty well.
Doing true half-pixel interlace on a stock C64 is not the same as "essentially" doing it imo.
@Yago, Cruzer: The method you describes will only give the feeling of higher resolution when scrolling. For still images this method will simply only reduce to 25hz color-interlace. I.e. not actually yield any higher resolution. Or did I misunderstood what you meant? |
| |
yago
Registered: May 2002 Posts: 333 |
afaik, only works with (up) scrolling, otherwise you only get "more" colors, but not better resolution.
This trick with upscrolling is indeed used in many demos (for the endpart), shamefully i cant name a single one atm
|
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: afaik, only works with (up) scrolling, otherwise you only get "more" colors, but not better resolution.
This trick with upscrolling is indeed used in many demos (for the endpart), shamefully i cant name a single one atm
@Yago: AFAIK my bro did it first in the end scroller of The Last Tracktor III.
|
| |
Cruzer
Registered: Dec 2001 Posts: 1048 |
Steppe is right, this is what was done in Krestage 2, and other did it even before this, e.g. Camelot :) |
| |
AmiDog
Registered: Mar 2003 Posts: 97 |
There's now a PAL compatible demo released.
Have a look here and check the forum here.
I've only tried it with my PAL C128 and 1084 monitor, but I have found some settings which produce an interlaced image. |
| |
Fungus
Registered: Sep 2002 Posts: 686 |
I saw a c64 demo with this technique done, I think it was released by Onslaught??? Scrolling some anime girl around.
As for the test bit things, Crossbow and Graham released Risen From Oblivion , which of course is exploiting this same test bit thing :)
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
there is a demo called "400" which does a vertical interlace,... I dont really beleive to these theories that every 2nd frame moved and laced blah, aint the VIC hardwired to display its gfx on always the same lines on the tv? |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
Quote: there is a demo called "400" which does a vertical interlace,... I dont really beleive to these theories that every 2nd frame moved and laced blah, aint the VIC hardwired to display its gfx on always the same lines on the tv?
Yes, the trick is that when you're scrolling 0.5 pixels per frame. If you scroll a non-interlaced image 0.5 pixels per frame, you get line numbers like:
frame 0: 200
frame 1: 199.5
frame 2: 199
frame 3: 198.5
Which the VIC can't display, as it can't move half lines. But if you scroll an interlaced image 0.5 pixels per frame, you get:
frame 0 odd field: 200
frame 0 even field: 199.5 + 0.5 = 200
frame 1 odd field: 199
frame 1 even field: 198.5 + 0.5 = 199
With scrolling plus interlace, the even fields end up on integer line numbers, which the VIC can display. As soon as the image stops moving, the effect stops working. It also works with 1.5 pixels per frame, etc.
Try it on a real C64 and you'll see that it looks great.
|
| |
Style
Registered: Jun 2004 Posts: 498 |
actually, depending on the monitor you might be able to shift the screen vertically in a subtle way simple from what youre displaying.
We've all seen it - you have some text on a black screen, then you change the background to white and the text shifts......
Monitors are teh crap :) |
| |
ptoing
Registered: Sep 2005 Posts: 271 |
So this only works with constantly scrolling stuff?
Would it be possible to scroll up and then flick down again and scroll back up or something to get "still" images to work. THAT would be neat. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: Yes, the trick is that when you're scrolling 0.5 pixels per frame. If you scroll a non-interlaced image 0.5 pixels per frame, you get line numbers like:
frame 0: 200
frame 1: 199.5
frame 2: 199
frame 3: 198.5
Which the VIC can't display, as it can't move half lines. But if you scroll an interlaced image 0.5 pixels per frame, you get:
frame 0 odd field: 200
frame 0 even field: 199.5 + 0.5 = 200
frame 1 odd field: 199
frame 1 even field: 198.5 + 0.5 = 199
With scrolling plus interlace, the even fields end up on integer line numbers, which the VIC can display. As soon as the image stops moving, the effect stops working. It also works with 1.5 pixels per frame, etc.
Try it on a real C64 and you'll see that it looks great.
I dont understand it. but anyhow this is vodoo in my eyes. the vic always uses the odd (or even?) lines, and that is that. check the "400" demo in vice, how come it works even on a lcd screen (I have that)? you say IF the vic scrolls at 0.5 pixelfs / frame, yeah sure, but how? it cant. |
| |
ptoing
Registered: Sep 2005 Posts: 271 |
I think that technically it's 2 pictures and the picture is 400 pixels tall, but only the odd or even lines are shown, that's what they mean with 0.5 pixels i think. Not too sure tho. |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
No, the VIC never scrolls 0.5 pixels per frame, the image does.
OK, imagine that the C64 had a graphics chip that actually could display interlaced graphics, say gfx bank 0 on odd fields and gfx bank 1 on even fields. You'd draw your 400 line graphics and then split it into two koalas, even lines in image A in bank 0 for display in odd fields (remember odd comes first), and odd lines in image B in bank 1 for display in even fields (with 0.5 line offset). Everything clear so far?
Now, to display this 400 line image without scrolling, the two images would be displayed like this:
frame 0 odd field: image A, 0 pixel offset
frame 0 even field: image B, 0.5 pixel offset
frame 1 odd field: image A, 0 pixel offset
frame 1 even field: image B, 0.5 pixel offset
and so on. Easy so far, and we need an interlaced display to view it. Now, if we scroll this image down at 1 pixel per frame, we get a display like this:
frame 0 odd field: image A, 0 + 0 = 0 pixel offset
frame 0 even field: image B, 1 + 0.5 = 1.5 pixel offset
frame 1 odd field: image A, 2 + 0 = 2 pixel offset
frame 1 even field: image B, 3 + 0.5 = 3.5 pixel offset
No funny stuff, and we still need interlace to display it. Now, if we scroll the image 0.5 pixels per frame, magic happens:
frame 0 odd field: image A, 0 + 0 = 0 pixel offset
frame 0 even field: image B, 0.5 + 0.5 = 1 pixel offset
frame 1 odd field: image A, 1 + 0 = 1 pixel offset
frame 1 even field: image B, 1.5 + 0.5 = 2 pixel offset
The half pixel offset from the interlace, and the half pixel scroll cancel eachother out, and give an integer result. The VIC, and LCD screens, have no problem displaying it.
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
I dont quite understand your explanation, but found one which works for me :)
ie. displaying alternatively the odd and even lines is kinda like scrolling the picture up/down, then the rest to do is add a real scroll every 2nd frame.
however the vic still doesnt displays odd/even lines, thus the resolution does not increase, its rather like a scrolling image at 25 hz, and we only see either the odd or even field. |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
Or to summarize MagerValp's rather lengthy post: In scrolling an interlaced screen, when displaying the second frame you always need to add the interlacing shift value to the scroll position. This fact can be taken advantage of: if you want to interlace a screen by 0.5 pixels, you simply set the scroll speed to -0.5 pixels, and thus, you get sub pixel positioning without ever having to display graphics on anything but the integer pixels.
Example, assuming starting scroll position of 20:
20.0
19.5 + 0.5 pixels interlacing = 20
19.0
18.5 + 0.5 pixels interlacing = 19
18.0
17.5 + 0.5 pixels interlacing = 18
etc. |
| |
Mace
Registered: May 2002 Posts: 1799 |
Quoting Oswaldits rather like a scrolling image at 25 hz, and we only see either the odd or even field.
True, in theory.
But our braines complete the picture.
It's like a moving object behind a fence: you can't see the entire object at any one time, as part of it will be obscured by the fence.
However, because it's moving and we alternately see different parts, our brain can add up these parts.
It's kind of like a virtual resolution.
Although almost 50% is behind the fence, we still see this as a sheep... |
| |
Copyfault
Registered: Dec 2001 Posts: 478 |
I do have the same problems as Oswald with these explanations...
If I got it right, a true (PAL) interlace works like this: first the rasterbeam creates one type of lines of the given image (let's say ODD lines, maybe it's the other way around). Doing this the EVEN lines are ommitted. After this first halfpicture has been drawn, the next halfpicture, consisting of the EVEN lines, will be put into the even lines of the whole display, this time ommitting the ODD lines.
The C64 can only display ONE type of lines (let's say ODD ones). AFAIK there is no possibility to 'scroll' a picture into the other type of lines.
The only explanation for the 'higher resolution' which is achieved by the techniques described in this thread seems to be the working of the human brain. Scrolling the picture up by 1 pixel only every 2nd frame kinda forces our brain to 'insert' the EVEN lines of the picture (which by the hardware of the C64 definitively sit on ODD lines!) between the real ODD lines.
Now I wonder if there is a difference between true (PAL) interlace and this Pseudo-PAL-interlace-achieved-by-scrolling... maybe anyone already compared these two displaying techniques??? My guess is that our brain renders exactly the same image.
CF |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
copyfault: The point is the "half" lines are never used, because of the movement speed. The principle is exactly the same regardless of whatever interlacing method is deployed. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
still a real interlaced display uses the half lines, independant of the scrolling speed. |
| |
Copyfault
Registered: Dec 2001 Posts: 478 |
Now I at least think I got the point Mager Valp&radiantx tried to make clear: the image we get when scrolling up by 1 pixel every 2nd frame is exactly the same as if it would be scrolled by 0.5 pixel every frame in real interlace. Hmm, but then, this is more like a resolution reduction for the true interlace (the halfpixel-scrolling makes one type of lines, e.g. EVEN ones, obsolete). So this seems more like a transformation true (PAL)-interlace -> Only-ODD-lines-interlace.
Still... the brain must play a central role here! Nobody here who had the chance to do a direct comparison?
CF |
| |
ptoing
Registered: Sep 2005 Posts: 271 |
This effect has nothing to do with scanlines at all as far as I understand. It is purely optical (an illustion if you will).
I made some pictures of how I think it works.
I took my picture Yus Chunk and seperated it into it's odd and even lines (yes I know it is only 200 pixels high to begin with, but the effect still applys)
Now when condense them by taking out the blanks and animate them one after another, odd first you get this. You can see that the even frame seems to scroll even tho technically it DOES NOT. This is because due to being condensed the lines got shifted up by one, hence the fake scrolling. And this is also the reason you only need to shift the whole deal up every 2nd frame.
And because this has fuck all to do with scanlines you can also do this horizontally as well. |
| |
algorithm
Registered: May 2002 Posts: 705 |
When applying this to still images, you can still get some type of percievement of resolution increase (although it would be classed as color interlace only)
Try the same for a two white line circles at 400 pixels.
remove odd lines from first pic. even lines from second
then remove the gaps and flick them every frame.
What do you see. Percieved resolution increase, even though it is only color interlace. |
| |
Spinball
Registered: Sep 2002 Posts: 88 |
Quote: This effect has nothing to do with scanlines at all as far as I understand. It is purely optical (an illustion if you will).
I made some pictures of how I think it works.
I took my picture Yus Chunk and seperated it into it's odd and even lines (yes I know it is only 200 pixels high to begin with, but the effect still applys)
Now when condense them by taking out the blanks and animate them one after another, odd first you get this. You can see that the even frame seems to scroll even tho technically it DOES NOT. This is because due to being condensed the lines got shifted up by one, hence the fake scrolling. And this is also the reason you only need to shift the whole deal up every 2nd frame.
And because this has fuck all to do with scanlines you can also do this horizontally as well.
or vertical+horizontal(=diagonal) and you get crossbows 640x400 from krestage2 |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
Half pixel scroll on the C64 gives just as real a resolution increase as interlaced video modes on the Amiga. Interlace works because our brain merges the two fields, but it's wrong to call it an illusion. |
| |
ptoing
Registered: Sep 2005 Posts: 271 |
Well, it kinda is an illusion tho, just as animation is an illusion. Those things do not "move" either, it's just still images played after another and that makes them LOOK as if they move = illusion. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Doesn't Amiga's interlace also scroll the whole other picture by half a pixel in y-direction? |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
mager, to my knowledge the c64 only uses the odd or even frames, there are no halfpictures whatsoever. while the amiga does really use odd/even fields. |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
Krill: Halfpixel scrolling is possible on the C64 as well, on a moving image. Kinda the point of the whole thread. :-) |
| |
enthusi
Registered: May 2004 Posts: 677 |
movement in simplified, cartesian space = dR/dt = change of position in specific amount of time :o)
No need for illusion here.
|
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
Quote: mager, to my knowledge the c64 only uses the odd or even frames, there are no halfpictures whatsoever. while the amiga does really use odd/even fields.
It's like I'm talking to a brick wall here...
|
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Original progressive gfx (2x4 pixels):
**
##
..
__
Progressive PAL display using fake interlace, scrolling up 25 pixels per second:
E1 O1 E2 O2
** ##
** ##
** ## .. __
** ## .. __
.. __
.. __
Interlaced PAL display using real interlace, scrolling up 25 pixels per second:
E1 O1 E2 O2
##
** ##
## ** __
** ## .. __
** __ ..
.. __
..
So, to my conclusion fake interlace on the c64 is just color blending anyways, scrolling or no scrolling, but scrolling gives seemingly a better result, where as a true interlaced display give a true 50hz motion in half
pixels.
@MagerValp, exactly what did I misunderstood?
|
| |
Radiant
Registered: Sep 2004 Posts: 639 |
JackAsser: Compare the half pixel scrolling interlaced screen of a C64 with a static "true" interlaced PAL screen and you will see that there is no difference in how the actual interlacing is performed (i.e. half pixel offsets). A scrolling "true" interlaced screen looks different of course. The scrolling is only there to make it possible to fake the sub pixel screen positioning, thus achieving the same resolution you can get with true sub pixel positioning and a static screen.
In practice it's colour blending, but you have to look at the math behind it as well. Counting the interlacing offset per frame gives us a variance of 0.5 pixels - which is why it doubles the percieved resolution, just like "proper" interlacing. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: JackAsser: Compare the half pixel scrolling interlaced screen of a C64 with a static "true" interlaced PAL screen and you will see that there is no difference in how the actual interlacing is performed (i.e. half pixel offsets). A scrolling "true" interlaced screen looks different of course. The scrolling is only there to make it possible to fake the sub pixel screen positioning, thus achieving the same resolution you can get with true sub pixel positioning and a static screen.
In practice it's colour blending, but you have to look at the math behind it as well. Counting the interlacing offset per frame gives us a variance of 0.5 pixels - which is why it doubles the percieved resolution, just like "proper" interlacing.
Hmm I c. And sorry for my post being messed up...
|
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
OK, let's try a diagram, and I'll slow things down by a factor of 25 so you can see what's going on.
Here's what hydrophilic's technique looks like:
Here's what the half pixel scroll technique (as used in LT3 etc) looks like:
Note that in both cases, every second frame you see all the odd lines of the original double height image, and every other frame you see all the even lines. Also, in both cases, if your eye is following any movement of the letter (none in the first case, a continuous motion in the second), the missing lines appear between the lines you just saw.
I don't see how either case can be claimed to be higher resolution or more 'real' than the other. The sole advantage of the new technique is that you can display the image without having to scroll it. |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
That is not how the scroll technique in i.e. LT3 looks like. There is no space between the lines. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
That depends on how your monitor's dot pitch compares to the line spacing.
I zoomed both images by a factor of two so that two rows of pixels in your web browser is equivalent to one row on the c64 - no other way to display the interlaced version correctly.
Here are some greater zooms, with blurring to simulate raster beam spread:
(lt3)
(hydrophilic)
Does that make it any clearer? |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
on the above the hydrophilic looks like true "half" line lace. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Do you at least concur that each technique shows the same number of pixels each refresh?
When you look at one of hydrophilic's images, the eye constantly looks at the same point of the screen, so the odd lines project on to your retina between where the even lines appeared on the previous frame.
When you look at a letter in the scroller on LT3, the eye pans up the screen at a continuous speed, so again the odd lines project on to your retina between where the even lines appeared on the previous field. (not something that happens when you watch the slowed down version, as each field is being displayed dozens of times instead of just flashing up once, so the impression of continuous motion is lost).
I could add a red cross over the the LT3 image showing where your eye looks if anyone wants it...
|
| |
Radiant
Registered: Sep 2004 Posts: 639 |
I don't see the difference between that and i.e. interlacing on the Amiga. Looks normal to me. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
well all I can do is disagee. true interlace is true interlace and c64 400 is just not the same. |
| |
algorithm
Registered: May 2002 Posts: 705 |
As long as there is an illusion of a higher resolution, thats all that matters really.
Only trueish way of getting pixels in next field inbetween the line is via strobe methods (eg flashing a line/box of a specific color) but the effect varies from TV to TV. Maybe there can be sometype of calibration mode at the beginning.. Obviously this would not work on emulators.
|
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
@algo: would it work to flash an area in the non-visible part of the border? Stupid question probably, but I gotta ask just to be sure. ;) |
| |
WVL
Registered: Mar 2002 Posts: 902 |
Quote: @algo: would it work to flash an area in the non-visible part of the border? Stupid question probably, but I gotta ask just to be sure. ;)
it would, as long as the pixel-mask of the screen gets hit by the electron beam.
The reason the screen distorts when the brightness changes is that the pixel-mask changes temperature (because of more electrons hitting the mask if brightness increases, and thus getting hotter) and deforms. This is why CRT-screens with pixel-masks made from invar (a special steel-alloy with the property of very low deformation around room-temperature) are the ones to be preferred :)
Then again, you can never be sure if you are hitting the mask or not, because monitors and tv's are so different, and then you can change the settings also!! OMG!
But probably it's possible to shift the screen vertically 0.5 pixel by changing a few rasters in the upper border from black->white (in that case the screen will move down) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
wvl, thats quite hard to believe , as on some old and/or bad TVs the screen can distort a whole lot when white color is shown. I dont believe that an iron mask can jump up and down and sideways at 50fps according to the number of electrons. when I think about I'd rather say that the aiming of the beam goes off due to higher electron rates. |
| |
WVL
Registered: Mar 2002 Posts: 902 |
Quote: wvl, thats quite hard to believe , as on some old and/or bad TVs the screen can distort a whole lot when white color is shown. I dont believe that an iron mask can jump up and down and sideways at 50fps according to the number of electrons. when I think about I'd rather say that the aiming of the beam goes off due to higher electron rates.
It's really thermal expansion, and prolly you will not get 50fps from it, but maybe for a .5 pixel shift you can.. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
then we are not talking of the same thing, I have wittnessed distortions like 1cm or 'tech-tech' on sluggish TVs when background went to white :) |
| |
WVL
Registered: Mar 2002 Posts: 902 |
Quote: then we are not talking of the same thing, I have wittnessed distortions like 1cm or 'tech-tech' on sluggish TVs when background went to white :)
Probably that's also thermal, but it takes a while until things stabilize completely. However I think some shadow-masks can wiggle around at 25fps for 0.5 pixel.
edit :
to stop the discussion I just simply tried it on my old trusty c64 and 1901 monitor ;) The screen jumps a little bit, but i can't make it jump 0.5 pixel, more say 0.2 pixels... :P |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
wvl, can you visualize an iron net making 1cm distortions coz of thermal stuff inside a tv at 50fps?:D |