Forum
scroll.bas - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15)
+---- Thread: scroll.bas (/showthread.php?tid=415)



scroll.bas - britlion - 12-07-2011

Was thinking of doing some scroll routines. I see there are some useful ones in scroll.bas in the library.

However, there appears to be a left, right and another left in there - no up and down!

sub fastcall ScrollRight
sub fastcall ScrollLeft
sub fastcall ScrollLeft

two also begin a bit strangely - loading the byte at (screenaddress) twice?


Re: scroll.bas - britlion - 08-03-2012

*bump*

Are these okay? Do we need replacements?


Re: scroll.bas - slenkar - 08-04-2012

I have never used scroll, so dunno how they act under gaming conditions


Re: scroll.bas - boriel - 08-05-2012

Not sure how you got them. They should not be bundled with the compiler.
I stop programming them, to address more important issues.
Horizontal scroll is pixel by pixel.
I can finish scroll (and roll) in the 4 directions (Up, Down, Left, Right). But pixel by pixel scroll is slow.
A better routine would be:
  • Scroll within a given window (e.g. x, y, height, width)
  • Scroll the given amount of pixels. This is more interesting, but I guess it's much harder when done horizontally.
  • Scroll colors (attributes)
I will try to work out pixel by pixel scroll within a given window.


Re: scroll.bas - britlion - 08-05-2012

Window scroll up is already in wiki library. Scroll down would be a trivial alteration from that.

Left and right is a matter of using 9 bit rotates to carry to next byte - for a single pixel. More than one pixel is a bit tougher to do.


Re: scroll.bas - boriel - 08-05-2012

I recall there's already a SC/ROLL (Roll means exiting pixels reenter the opposite side) in a MicroHobby machine listing.
I think I could rip them from there.


Re: scroll.bas - slenkar - 04-25-2016

what do the four numbers represent?

Cant figure it out!!

Whenever I make changes to the numbers the results make no sense

If I change the first 2 numbers to zero the same scroll happens at 40,40
then other numbers when increased make the window smaller!


Re: scroll.bas - britlion - 05-03-2016

You mean <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:WindowScrollUp">http://www.boriel.com/wiki/en/index.php ... owScrollUp</a><!-- m --> ?

Unless it broke somewhere, and I remember correctly (it's been years); X and Y should be the top left corner, and the other two numbers are the width and height of the window.


Re: scroll.bas - slenkar - 05-30-2016

It's in the demo folder of the latest release

The demo prints a bunch of letters to the screen, then they are scrolled in all directions


Re: scroll.bas - slenkar - 01-01-2017

The numbers dont seem to behave as I would expect, can someone take a look?