Opened 12 years ago

Closed 12 years ago

Last modified 6 months ago

#8688 closed patch

DS: ARM Optimised blitters/scalers

Reported by: SF/robinwatts Owned by: agent-q
Priority: normal Component: Port: NDS
Keywords: Cc:
Game:

Description

The attached file contains ARM versions of the following routines from platform/ds/arm9/source/blitters.cpp

asmDrawStripToScreen
asmCopy8Col
Rescale_320x256x1555_To_256x256x1555
Rescale_320x256xPAL8_To_256x256x1555

I should say up front that I don't personally have a DS, so I can't compile and test these - they have therefore been written blind.

All the files with the exception of the last one (which requires it's parameters reordering) should pretty much drop in as replacements for the ones that are there.

asmDrawStripToScreen: I believe this should be slightly faster - 2 cycles faster in the short loop case, 6 cycles faster in the long loop case. (Assuming that GCC is doing a perfect job - in the case where the compiler was fumbling stuff before we'll be doing better now).

asmCopy8Col: Should be at least 8 cycles a loop faster.

The rescale functions should be significantly faster too; the core calculations live entirely in registers, and I use a trick to calculate R G and B all at the same time.

If you have questions, or comments on this code, or I need to change (fix!) it please don't hesitate to contact me.

Robin

Ticket imported from: #1729975. Ticket imported from: patches/793.

Attachments (1)

blitters.s (9.0 KB) - added by SF/robinwatts 12 years ago.
First attempt at optimised blitter/scaler

Download all attachments as: .zip

Change History (10)

Changed 12 years ago by SF/robinwatts

Attachment: blitters.s added

First attempt at optimised blitter/scaler

comment:1 Changed 12 years ago by fingolfin

Owner: set to agent-q

comment:2 Changed 12 years ago by agent-q

Thanks for your changes. I will let you know when I integrate this if I have any problems.

comment:3 Changed 12 years ago by agent-q

I have integrated this into my local copy and it seem to work perfectly. I have not tried the two Rescale functions because they are not used in the version I'm about to release, as I've disabled the CPU scaler for now.

comment:4 Changed 12 years ago by fingolfin

Great. Is this already in SVN? Please make sure to close this item once you have added all parts of the patch you'd like to accept.

comment:5 Changed 12 years ago by SF/robinwatts

I'm glad they were of some use to you.

Does this mean that you're never going to enable CPU scaling again? If you do reenable it, might the Rescale bits of the patch be useful then? They were the bits of the patch that I thought would give the greatest improvement :-/

comment:6 Changed 12 years ago by fingolfin

AFAIK, this code is already in the repository by now, so I am closing this now.

BTW, I also sent Robin and Neil a mail regarding the odd (bogus) "& ~4".

comment:7 Changed 12 years ago by sev-

Err... Actually closing the item.

comment:8 Changed 12 years ago by sev-

Status: newclosed

comment:9 Changed 6 months ago by digitall

Component: Port: NDS
Note: See TracTickets for help on using tickets.