#: 19623 S12/OS9/68000 (OSK)
18-Jan-94 19:57:36
Sb: #19621-CDI Computer News
Fm: Bob van der Poel 76510,2203
To: Eric Crichlow 71051,3516 (X)
Sure...there is always a way to speed something up . What I would look at in
your loop is to change from an indexed array to a pointer. For example, in your
loop you have:
&sy[yoff[y]]
it is necessary to do a bunch of math to calcuate the correct offset into 'sy'
each time though the loop. If, instead, you can use a pointer you can save a
bit of time. Maybe you can only get rid of one level of the array--since y is
being incremented by one you could convert y into a pointer pointing to the
yoff array. Course, then you have another chore of determining when to exit.
The same applies to the brdmem[][] thing.
I don't know how much of the overhead is taken up with the math and how much is
actually in the moves...Guess you could do some timing with and without the
call to memcpy() to see if fooling around with this idea is worthwhile.
Also, don't forget that setting up function calls is expensive...so if you can
set up larger blocks for memcpy() to move, you'll get a saving too.
Have you tried using get/put calls instead? I suspect that since they work in
pixels they might be slower than memcpy()....I don't believe that Kevin used
the pixacc in the 68070 for that (or anything else).
Too bad you can't set up the entire board in memory and hardware scroll though
the entire thing. But I don't think the processor supports that.
If you really need speed it is sometimes worthwhile to use the -a switch in the
compiler to generate assm. code. You can then examine that to see what
variables are being used in registers, etc. Not a bad way to learn some
assembler either....
I have a half-assed disassembly of memcpy() I did awhile ago. If you want, I
can send to your mailbox. You ask if it does a 'move.l (a0)+,(a1)+'. Yup, sure
does. It also does byte and word moves to get into alignment and to transfer
odd byte counts. As I said, the code appears to be very efficient...I wouldn't
spend a lot of time looking there to find any speedups.
Hope some of this helps more than it confuses.
|