On Wed, Jan 08, 2003 at 09:39:49AM -0000, Geoff Winkless wrote: [snip why pixel-by-pixel scrolling is boringly slow]
This is true. > The buffering is worthwhile if you're likely to have anything else going > on in the same screen area which could corrupt the scrolled area (like > starfields etc) but otherwise you might as well just write directly to > the screen and scroll the whole thing with LDIR (or LDI unrolled, if you > prefer... or stack copying, if you're -really- short of t-states!). That was only for the pixel-by-pixel scrolling; using bit-shifts would be really slow, would it not? Although actually, maybe you'd need this for scrolling by any odd number of pixels? I suspect that the answer is again "why would you?" Surely stack copying is the only way? :) I think I might have a stab at writing some games for the SAM. I'm not actually sure how slow scrolling at least 2/3 of the screen in Mode 4 is, since I've never actually seen it. But Mode 2 isn't that bad. (BTW, does anyone know whether the SAM's version of Elite was the Spectrum's version?) > The alternative is to write optimised scrolling code for -each letter-. > That's a bit complex, but basically you keep track of where each letter > is on the screen, and you work out what you need to change to shift that > letter one position. For example, if it's a "!" you only need to move > about 1/5th of the bytes you would in a generalised scrolling routine > (assuming it's a fixed-font, of course). I never even considered that. It's just about insane enough to work! I could even shift the value of the character left a few places, add an offset and then jump there. Some part of me doesn't like the idea that changing the scroller text could slow things down, or even cause a crash! Then again, if you're really desperate for t-states (or if you have a huge font), you'd have little choice. Of course, you can always test the worst case. > > I suppose changing the video page between scanlines would > > work? > > Whatever for?? But yes, it does. Yes, that doesn't buy me anything. Oops. :) -- Stuart Brady