Page 3 of 3

Re: Scrolling Graphics Questions

Posted: Tue Nov 01, 2016 12:28 pm
by pser1
sorchard wrote: I think you can get most of the 7% improvement without having a huge program, if you copied for example 128 or 256 bytes per loop.
Hi Stew,
I have tested with 4x32 = 128 and the speed gain is not visible on screen.
The 'con' of this method is that as I need to scroll the whole screen except for a line
this means 191 files being moved (32 bytes x row)
Going up to 128 needs 191/4 = 47 times and then I have to add the three last ones
because 4 * 47 = 188
Trying to go further to 256 would imply: 8 * 23 times = 184, so I would have to add SEVEN more!
If I try to reuse the ones coded into the block, then I have to introduce test and branch, so
losing the gains ...
I think that the full unrolled version was not visibly faster, but of course it used less cycles
to be dedicated to other actions of course, but the size was a high cost!

cheers
pere
VSDSTK3.zip
Source file
(1.6 KiB) Downloaded 302 times

Re: Scrolling Graphics Questions

Posted: Tue Nov 01, 2016 2:18 pm
by sorchard
Hi Pere,

One trick you can use to do the extra 3 lines is to jump into the right place in the loop at the beginning. Something like this:

Code: Select all

  lda #48
  sta count
  bra skip

loop
  copy32
skip
  copy32
  copy32
  copy32
  
  dec count
  bne loop


Re: Scrolling Graphics Questions

Posted: Tue Nov 01, 2016 5:01 pm
by pser1
Hi Stew,
great idea, better do it as soon as possible than waiting for the final part, wondeful indeed!
Will give it a try ...
thanks a lot

cheers
pere