Scrolling Graphics Questions

Hardware Hacking, Programming and Game Solutions/Cheats
pser1
Posts: 1665
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: Scrolling Graphics Questions

Post 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 295 times
sorchard
Posts: 530
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: Scrolling Graphics Questions

Post 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

Stew
pser1
Posts: 1665
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: Scrolling Graphics Questions

Post 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
Post Reply