DOS VGA Tricks
Re: DOS VGA Tricks
I wouldn't have expected 3d4/C and D to have worked - after all, there'd be less point in 3d4/18h if so. But it does sound like, based on what you're saying, that 3c0/13h is working... if not particularly interesting.
Re: DOS VGA Tricks
So, I got this in dosbox:
This program displaces some lines at the top part of the image.
Real VGA and PCem show black lines interlaced with displaced ones. 3c0 register works very strange, I think I understand it, but I can't move the lines the amount I want, only 0 or 4 pixels.
I just found more info:
Port-Index: 08h Port: 03d4h, 03b4h
bits 6 5 = Byte panning control
is used to control byte panning. This register together with attribute controller register 13h, allows for up to 31 pixels of panning in double word modes
Re: DOS VGA Tricks
According to VGA.TXT, you should be able to get fine X scrolls from 0 to 3 by writing 0/2/4/6 to 3c0h/13h, not 4...
Re: DOS VGA Tricks
I know, I wrote it wrong.
So I understand 3c0 register works like this, I used assembly for the tests, but it will look better in C here:
Code: Select all
//this resets a flip flop in VGA card, and sets 3C0 to write index mode
inp(0x03DA);
//write index 13 to 3c0 port, also activate bit 5 to keep screen on. Port flips to write data mode
outportb(0x03C0,0x13 + 0x20);
//write panning (6 = 3 pixel displacement), also activate bit 3 (+0x08), I noticed it was there, it looks like it does not matter.
outportb(0x03C0,0x02 + 0x08);
I read about other registers modifying panning behaviour, but none of them worked in the middle of a frame.
Re: DOS VGA Tricks
I never knew you were on NESDev forums. Probably because you're using a different name from what you use in YouTube.
Hardware to check against meaning you don't have an MS-DOS computer with VGA, or meaning you don't have a VGA CRT?
Because I happen to have an MS-DOS laptop, and though its screen is a terrible STN LCD with ghosting, it supports SVGA and has a VGA port, though I sadly don't have a CRT that supports VGA, only LCDs that support VGA. I'm still willing to test it, though.
So most of these cool VGA tricks only work on CRTs and not on LCDs? I'm sure it's always a YMMV thing, but still.
As in a real VGA MS-DOS computer, or a real VGA CRT, or a real VGA monitor in general?
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.
Re: DOS VGA Tricks
3d4h index 4 only works on CRT, 3d4h index 13 works on all monitors, it is an internal VGA VRAM thing, not related to hsync or anything.Nikku4211 wrote:So most of these cool VGA tricks only work on CRTs and not on LCDs? I'm sure it's always a YMMV thing, but still.
A real 286 with VGA (not SVGA) card, and I have no CRT, only LCD. Anyway, PCem is so precise, you can test weird things there and they will be the same on real machines most of the time.Nikku4211 wrote: As in a real VGA MS-DOS computer, or a real VGA CRT, or a real VGA monitor in general?
Re: DOS VGA Tricks
Alright then, guess I'll try to find a small VGA CRT that I can more easily carry around my apartment for a good price.Mills wrote: ↑Sat Jan 15, 2022 3:18 am3d4h index 4 only works on CRT, 3d4h index 13 works on all monitors, it is an internal VGA VRAM thing, not related to hsync or anything.Nikku4211 wrote:So most of these cool VGA tricks only work on CRTs and not on LCDs? I'm sure it's always a YMMV thing, but still.
Oh cool, I'm thinking of trying PCem then.Mills wrote: ↑Sat Jan 15, 2022 3:18 amA real 286 with VGA (not SVGA) card, and I have no CRT, only LCD. Anyway, PCem is so precise, you can test weird things there and they will be the same on real machines most of the time.Nikku4211 wrote: As in a real VGA MS-DOS computer, or a real VGA CRT, or a real VGA monitor in general?
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.
Re: DOS VGA Tricks
Hi guys,
Appologies for reviving an older thread but I tumbled across this and have been reading with great interest.
A question for you guys...
For many years I have been trying to figure out how the sine wave scroller in No Lamers Allowed by Paranoids works. The demo looks unsophisticed at first but when you start digging, trying to figure out how it was done, it actually turns out to be a pretty nifty technical challange. The demo runs very well on my 8Mhz 286 which indicates to me that the sine wave effect is a hardware effect of some sort since there simply isn't enough bandwidth the push that many pixels at that speed. My thinking is that the effect it based around the split screen, triggered within a single scan line (even mutiple times).
What do you guys think?
Not the best capture: https://www.youtube.com/watch?v=iqnATx8oqKw
The real thing in DOSBox: https://archive.org/details/demoscene_N ... -Paranoids
Pouët: https://www.pouet.net/prod.php?which=4124
Appologies for reviving an older thread but I tumbled across this and have been reading with great interest.
A question for you guys...
For many years I have been trying to figure out how the sine wave scroller in No Lamers Allowed by Paranoids works. The demo looks unsophisticed at first but when you start digging, trying to figure out how it was done, it actually turns out to be a pretty nifty technical challange. The demo runs very well on my 8Mhz 286 which indicates to me that the sine wave effect is a hardware effect of some sort since there simply isn't enough bandwidth the push that many pixels at that speed. My thinking is that the effect it based around the split screen, triggered within a single scan line (even mutiple times).
What do you guys think?
Not the best capture: https://www.youtube.com/watch?v=iqnATx8oqKw
The real thing in DOSBox: https://archive.org/details/demoscene_N ... -Paranoids
Pouët: https://www.pouet.net/prod.php?which=4124
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: DOS VGA Tricks
I'm not sure it really needs to do that.pan069 wrote: ↑Mon Jun 27, 2022 3:33 amThe demo runs very well on my 8Mhz 286 which indicates to me that the sine wave effect is a hardware effect of some sort since there simply isn't enough bandwidth the push that many pixels at that speed. My thinking is that the effect it based around the split screen, triggered within a single scan line (even mutiple times).
To update the sine wave, it only needs to replace the background at its leading/trailing edge on each frame.
The actual coverage of the sine wave text is a relatively small portion of the screen, and similarly the pixel flag is so sparse it also doesn't have much real coverage.
So between all that, I suspect the bandwidth is actually low enough to get by with updating only what you need to?
Also, probably all source graphics for this demo screen can fit within VGA RAM, so using the hardware latch for "fast" VGA to VGA copy could have been on the table too.
Re: DOS VGA Tricks
My extra-verbose-logging DOSBOX doesn't show any VGA register writes during that effect.
Re: DOS VGA Tricks
Thanks for the response. Would you be able to elborate on that?rainwarrior wrote: ↑Mon Jun 27, 2022 10:17 amI'm not sure it really needs to do that.pan069 wrote: ↑Mon Jun 27, 2022 3:33 amThe demo runs very well on my 8Mhz 286 which indicates to me that the sine wave effect is a hardware effect of some sort since there simply isn't enough bandwidth the push that many pixels at that speed. My thinking is that the effect it based around the split screen, triggered within a single scan line (even mutiple times).
To update the sine wave, it only needs to replace the background at its leading/trailing edge on each frame.
With a "simple" scroller (e.g. one with a static background color) you can just block copy columns 1 to 319 over to columns 0 to 318 and update column 319 with new data, rinse and repeat. But this scroller cleary doesn't do that otherwise the background would move along with the scroller. This to me it seems to indicate that the entire area in which the scoller occurs is updated.
From what I can tell by looking at it, the sine wave moves from left to right and the text moves from right to left. However, this could be a optical illusion, one where my brain simply isn't locking into the correct flow...
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: DOS VGA Tricks
The "sine" thing is 24 pixels high. On any given frame let's say it might move up or down ~6 pixels since the last frame. That means that each vertical span you have to redraw the 24 pixels of the sine text + 6 pixels of background restore. So, about 9600 pixels.
On top of this there is the waving pixel flag with seems to be 20x20 points. So, that's another 400 pixels + 400 more to restore the background for the previous points.
So, in total we're asking to update about 10,000 pixels out of 64,000. On top of that, running in DOSBox, it seems to animate at 45hz (every second frame).
5000 pixels a frame is something I think a 286 is probably capable of without needing special tricks, just reasonably efficient code.