![]() |
|
|||||||
| Register | >> Amiga FAQ/Wiki << | Rules & Help | Members List / Moderators List | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Not dead yet!!! :D
Join Date: Feb 2008
Location: Aveiro / Portugal
Age: 31
Posts: 690
|
DMA memory to memory copy
How do I copy x bytes from address A to address B using DMA transfers or something similar (custom chips)?
|
|
|
|
|
|
#2 |
|
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 10,514
|
Remember that with a DMA copy you'll be limited to CHIP RAM and that a DMA copy will be slower than a CPU fast RAM copy on accelerated Amiga's.
Google for BLITTER http://pub.elowar.com/AmigaDev/Hardw.../node0121.html
__________________
Thalion Webshrine |
|
|
|
|
|
#3 |
|
Not dead yet!!! :D
Join Date: Feb 2008
Location: Aveiro / Portugal
Age: 31
Posts: 690
|
Only chip memory... I remembered that right after I wrote the post.
And that's a problem... |
|
|
|
|
|
#4 |
|
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 31
Posts: 2,245
|
I guess it'll be a tight movem loop for you then
![]() |
|
|
|
|
|
#5 |
|
Oldskool Demo Coder
|
Remember to check for non-longword aligned start/end addresses for source and destination, and to copy from end to start instead of from start to end, depending on how the areas overlap. If they don't overlap all is fine, and if source and destination start address is the same, you just skip the copy.
__________________
Henrik. Programs Amiga demos, iPhone apps, websites, etc. A1000/512k - A500 2.0/040@28/4M/.5M slowmem/8M/SCSI/CF - A600 portable II 3.1/ACA630/WiFi/CF - 'A1700' 3.1/68060@80/64M/IDE-Fix Express/CF - etc."The difference between PC and Amiga is that 10yo PCs are worth $0. 20yo Amigas are worth a lot, and Amigas that are only 15yo cost a fortune!" If you like Portal 2, try my >> single player and cooperation maps << |
|
|
|
|
|
#6 | |
|
Not dead yet!!! :D
Join Date: Feb 2008
Location: Aveiro / Portugal
Age: 31
Posts: 690
|
Quote:
![]() |
|
|
|
|
|
|
#7 |
|
Oldskool Demo Coder
|
I has nothing to do with DMA and everything to do with copying areas without overwriting the original.
![]()
__________________
Henrik. Programs Amiga demos, iPhone apps, websites, etc. A1000/512k - A500 2.0/040@28/4M/.5M slowmem/8M/SCSI/CF - A600 portable II 3.1/ACA630/WiFi/CF - 'A1700' 3.1/68060@80/64M/IDE-Fix Express/CF - etc."The difference between PC and Amiga is that 10yo PCs are worth $0. 20yo Amigas are worth a lot, and Amigas that are only 15yo cost a fortune!" If you like Portal 2, try my >> single player and cooperation maps << |
|
|
|
|
|
#8 |
|
Registered User
|
I remember using the blitter to copy bits of a soundtracker module around for the mix-e-loader on Sonic Attack. If you can't find the source in PD, or want to see, let me know.
|
|
|
|
|
|
#9 |
|
Not dead yet!!! :D
Join Date: Feb 2008
Location: Aveiro / Portugal
Age: 31
Posts: 690
|
|
|
|
|
|
|
#10 |
|
Registered User
|
This was a rather unusual way to use the blitter. Usually, it would be used to copy screen memory around.
Fortunately, I noted that the ST note track is 256 bytes (or something) and was blitter freindly. A simple blitter routine can used to copy memory from a to b for any number of purposes, but restricted to certain block sizes (binary restrictions) |
|
|
|
|
|
#11 | |
|
Not dead yet!!! :D
Join Date: Feb 2008
Location: Aveiro / Portugal
Age: 31
Posts: 690
|
Quote:
|
|
|
|
|
|
|
#12 |
|
Registered User
|
of course. Remember that the blitter worked on odd cycles, so it could double throughput. It was a powerful chip in its own right
|
|
|
|
|
|
#13 |
|
Not dead yet!!! :D
Join Date: Feb 2008
Location: Aveiro / Portugal
Age: 31
Posts: 690
|
|
|
|
|
|
|
#14 |
|
Registered User
|
I posted the code a long time ago. No probs to post it again if you don't have.
Check out the demo first ![]() |
|
|
|
|
|
#15 | |
|
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 121
|
Quote:
Code:
char rawSectorData[512*2];
char decodedSectorData[512];
// fill rawSectorData with contents first
for (int i = 0; i < 512; i++)
decodedSectorData[i] = ((rawSectorData[i] & 0x55) << 1)
| (rawSectorData[i + 512] & 0x55);
- rewrite it using word operations - the blitter can only shift left when in descending mode, so make loop go backwards - the blitter shifts before masking together channels, so move shift before masking Code:
short rawSectorData[256*2];
short decodedSectorData[256];
// fill rawSectorData with contents first
for (int i = 0; i < 256; i++)
decodedSectorData[255 - i] = ((rawSectorData[255 - i] << 1) & ~0x5555)
| (rawSectorData[511 - i] & 0x5555);
BLTAPT = rawSectorData + 255 words; BLTBPT = rawSectorData + 511 words; BLTDPT = decodedSectorData + 255 words; BPLAMOD..BPLDMOD = 0 BLTCDAT = $5555 minterm = Ac + BC = ABc + Abc + ABC + aBC = $40 + $10 + $80 + $08 = $D8 Channel A-shift = 1 Channel B-shift = 0 Enabled DMA channels = ABD Descending = 1 => BLTCON0 = $1DD8 => BLTCON1 = $0002 BLTAFWM,BLTALWM = $FFFF BLTSIZE = 256 * 64 + 1 |
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Old cache memory as a "base" for GVP memory | rkauer | Hardware pics | 4 | 22 November 2008 06:23 |
| Not enough memory | Petesamus | support.Games | 26 | 30 June 2007 22:47 |
| Memory | numb | New to Emulation or Amiga scene | 5 | 15 March 2005 16:08 |
| Memory | THX1138 | support.Hardware | 3 | 04 May 2003 19:45 |
| Memory | Tazz | support.Hardware | 5 | 04 June 2001 17:51 |