Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scroll x 2 pixels, 4 pixels and 8 pixels (char level)
#1
I am still learning and reading about most stuff, and I run across the scroll.bas library from Boriel that comes with ZXBasic. It was kinda impressive to see that kind of smooth scroll on a spectrum, and even if it is "attribute free", you can get nice results with clever programming of the colors.

As I am trying to scroll a big screen, even if the function is fast, I would like to do it by 2 pixels instead of one. Of course I can execute the function 2 times, but it shows the scroll when it moves every pixel so the result is the same. Is the code modificable in any way so the scroll is done by 2, 4 or even 8 pixels? That last option would be a great way to scroll screens, though I will have to deal with attributes of course.

If it is not possible, is there any "print" alternative fast enough to be able to simulate a scroll by char?

Thanks Smile
Reply
#2
It very much depends on what you want to scroll (whole screen? Part?) and in which direction. Up and down are probably faster than left and right - to move up and down you copy screen data from one row into another. Sideways, unless it's 8 pixels, you have to rotate bits around, which is a bit more fiddly.

For alogorithms and code, you might want to ask the wider audience on world of spectrum. Here we can help on getting it to work with the compiler, but fewer heads for writing snippets of code.

That said, there's a lot of good stuff in the library wiki on this site. I put a chunk in there Big Grin
Reply
#3
Yes, in fact I am using the scroll function of the library. But as you suggested I will try worldofspectrum forums. Any subforum in particular recommended?

Sorry for answering so late, I just didn't had the time, but I will have more soon Smile
Reply
#4
A general purpose scroll routine has been planned for ages, but I also lack time Sad
In general, one like the current already provided, but allowing to specify the number of pixels to scroll in a single call.
However, this will require time to be tested, and I still need to work on other areas of the compiler (currently arrays, but later support for 128K models, etc).
Reply
#5
No problem, I already built my function for 8p scroll screen (not difficult, just copying memory areas) and if I need to scroll 2 pixels instead of 1 I just apply the function 2 times and then I swap the screen (I am using virtual screen).

But yes, it would be nice!

I am also very interested in the loading stuff into different banks for 128K Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)