I am a complete newby concerning graphics, so please don't shoot me!
I have been coding some scroll routines to move one pixel up and down an image in PMODE3, and others moving two pixels right and left ...
Once done, I have tried to get them a bit faster, so I have used LWASM to make it cycle-counting.
These are some results:
Code: Select all
DRAGON a 0,89MHz x 50 frames/sec -> 17.800 cycles x frame
ScrollType 1st FS NumFrm 1st Opt NumFrm Perfor. Reduc
HSCROLL 118.638 6,66 97.470 5,48 82,15 % 17,85 %
HSCROLR 119.790 6,73 96.892 5,44 80,88 % 19,12 %
HSCROLLC 130.542 7,33 104.574 5,88 80,11 % 19,89 %
HSCROLRC 130.926 7,36 103.228 5,80 78,84 % 21,16 %
VSCROLD 50.922 2,86 41.680 2,34 81,85 % 18,15 %
VSCROLU 50.933 2,86 41.680 2,34 81,83 % 18,17 %
VSCROLDC 51.057 2,87 41.781 2,35 81,83 % 18,17 %
VSCROLUC 51.056 2,87 41.780 2,35 81,83 % 18,17 %
specially for the horizontal ones as you can see in the third column.
After aplying some optimizations, the second wave of routines performed better and the figures on the 4th and 5th column relate to the modified ones.
I am preparing the screen at one page and once ended I switch the SAM bits that contain the beginning of the image.
Before doing so I do poll for the FS interrupt to arrive, so I assume that the decimal numbers should have to be rounded
up to know the number of frames that the process needs.
As an example, VSCROLD lasts 2,87 so 3 FS, and the modified (better) version uses 2,35 so 3 FS too
According to this, there should be no difference between them, but for sure the second is really 18% faster than the other.
What am I missing?
Is there any way (formula or whatever) to calculate how many frames must pass before the screen gets updated?
It seems that VSCROLD should move at 50/3 = 16 frames per second
Sorry for so many questions ...
I would really appreciate any info / pointer on this subject
Thanks beforehand
regards
pere