Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scroll.bas
#1
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?
Reply
#2
*bump*

Are these okay? Do we need replacements?
Reply
#3
I have never used scroll, so dunno how they act under gaming conditions
Reply
#4
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.
Reply
#5
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.
Reply
#6
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.
Reply
#7
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!
Reply
#8
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.
Reply
#9
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
Reply
#10
The numbers dont seem to behave as I would expect, can someone take a look?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)