English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 13 May 2011, 23:34   #1
oRBIT
Zone Friend
 
Join Date: Apr 2006
Location: Gothenburg/Sweden
Age: 42
Posts: 223
Can it be faster?

I've been browsing to my old emulator code for optimization-possibilites. I'm moving alot of data back and forth and found this code below as an example. It's purpose is to move one character tile (8x8 chunky pixels) to it's destination screen (256x240), both located in FastRAM.
Is there a more clever way of doing this?

move.l (a5)+,(a0)
move.l (a5)+,256*0+4(a0)
move.l (a5)+,256*1+0(a0)
move.l (a5)+,256*1+4(a0)
move.l (a5)+,256*2+0(a0)
move.l (a5)+,256*2+4(a0)
move.l (a5)+,256*3+0(a0)
move.l (a5)+,256*3+4(a0)
move.l (a5)+,256*4+0(a0)
move.l (a5)+,256*4+4(a0)
move.l (a5)+,256*5+0(a0)
move.l (a5)+,256*5+4(a0)
move.l (a5)+,256*6+0(a0)
move.l (a5)+,256*6+4(a0)
move.l (a5)+,256*7+0(a0)
move.l (a5)+,256*7+4(a0)
oRBIT is offline  
AdSense AdSense  
Old 16 May 2011, 03:55   #2
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 163
The copying operation itself is probably fairly fast the way that you've written it. Depending on the platform it might be slightly quicker to read 2-4 longwords into registers and then write them out, instead of doing read+write moves each time.

However, consider asking yourself some architectural questions.

1) could you change the code such that it writes directly to the chunkybuffer instead? (so you don't need the copying step at all)
or
2) can you have the chunkybuffer scrambled such that each 8x8 tile is stored sequentially in memory, and use a custom c2p routine which does de-scrambling inline? (If you are intending to do any further processing of the chunkybuffer - like drawing software sprites into it - then this option is probably a no-go)
Kalms is offline  
Old 16 May 2011, 21:38   #3
dalton
tulou
dalton's Avatar
 
Join Date: Jun 2006
Location: Gothenburg / Sweden
Posts: 64
I'm probably stretching it a bit far, but maybe if the char you are copying is planar, you could do without chunky conversion altogether. You'd probably need an equal amount of writes (only .b), but the amount of data could me smaller so you get better cache hit ratios.
dalton is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
mpega.library faster than itself meynaf Coders. General 91 27 March 2014 16:01
How to run Another world faster :) Vollldo support.Games 9 02 November 2012 17:15
Getting WinFellow to run faster Narf the Mouse support.WinFellow 0 11 August 2010 08:04
Chipram 3x faster? oRBIT Coders. General 10 20 July 2010 03:13
Faster Emu Radgam support.WinUAE 3 27 February 2003 18:16

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:01.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.17041 seconds with 12 queries