CopyMemory with modulo

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

dell_jockey wrote:alors, I still don't really get it. Where would this be useful, can somebody please explain?
same here.

what would you need such a function for....?
it's for small data copying but several copy to do :p
I don't see the connection between this sentence and the functionality requested.....
oh... and have a nice day.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

Imagine I want to make an Amiga Emuator on PC ...
If I want to simulate the Amiga Blitter, I need something like this.
(I'm not making an Amiga emulator, that was just to give a sample of use)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

since I dunno the AmigaBlitter, I still don't understand the purpose.

but it's ok, programmers sometimes ask for things, others don't understand instantly...
so, you have a solution now, perhaps we see some illustrative example some day... :wink:
oh... and have a nice day.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

Here is what memory copy is with modulo :

Image

For example, imagine that the left grid is the screen represented by bytes
and the right is an image grabbed from screen (8 bits display)

You copy 3 lines with 5 bytes and a modulo value of 6 ( =6 bytes skipped )
Giving an image of 5x3 pixels.
freddix
Enthusiast
Enthusiast
Posts: 100
Joined: Sun Feb 08, 2004 7:22 pm
Location: South France
Contact:

Post by freddix »

Hi,

@wilbert:
Do you think it's possible to modify your memorycopy function to handle 1 bytes/4 to set transparency and overlap target content ?
In fact, it will copy by 4 bytes minimum (.l) and these bytes contain ARGB values. so, when reading, it read Alpha, R, G, B, Read same for target and calculate final pixel from both pixels. write final one.
Is it possible ?
Post Reply