hedrick@athos.rutgers.edu (Charles Hedrick) (09/29/88)
>I hope somebody can attack that problem directly. I would very much like to >have 2 scrolling algorithms included, toggled by F3: 6845 hardware, and >software. As the author of the EGA stuff, I now agree that it should go away. The version that is going out with these diffs (assuming ast took my latest changes) should in fact be fairly good about supporting a variety of hardware, but it does so by getting various information about the display adapter, including peeking inside the BIOS to see how many scan lines are needed per character. The problem is that this takes us deeper and deeper into code that is intertwined with the hardware and BIOS. I think there was a time warp, or possibly a lost mail message, because I've already suggested a way to simplify things. However I think it's right not to hold up the release of 1.3c for this. I have promised ast that I'll code up a replacement for the EGA hacks as soon as possible. (I'd also like him to evaluate hannam's proposed code. I can't because testing it requires me to recompile too much code. I don't even have source to elle.) The idea is to avoid depending upon the hardware's ability to wrap at all. Software scrolling of course does this, but at the expense of having to copy the whole screen for every line scrolled. As far as I can tell, all known tty adapters implement the video origin correctly. So there's no problem scrolling for the first few lines using the hardware. It's just what happens when you get to the end of memory that causes trouble. So the obvious fix is to copy the screen just once: when scrolling has gotten to the end of available memory. I conjecture that the overhead of doing this would not be noticable. Software scrolling is unacceptable because when you display a page of output, you have to wait for a big copy operation for every line. If you do the same operation, but only once every 25 or 50 lines, I doubt that anyone would notice. At any rate, even if we had to support both this and the original 1.1 hardware scrolling, the differences could be hidden in a very small section of code, and most of the current cruft would go away. I'm still not entirely sure that I understand the code that hannam posted a week or so ago (attempts to get mail to him seem to have failed). However if it works at all for non-wrapping EGA clones, it works by a slight variant of the same mechanism, where the copying is done a line at a time for the last 25 scroll operations rather than for the whole screen when the end of memory is reach. The amount of data moved would be the same. You should expect to hear more from me in a week or two, after I have a chance to try out these ideas.