Re: [AD] [4.9] pitch in memory bitmap

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I like this idea... I usually edit create_bitmap and such anyway for alignment.  What about using a default alignment for the detected CPU or have some function like al_cpu_detect_alignment, or maybe even a CPU driver for memory operations. 

I've been planning a CPU driver for this for a while, but haven't started yet because I'm not sure it would really be useful because of hardware acceleration and all. I know that assembly is being removed, but the default CPU driver could be internal to Allegro and others could be there own separate DLL with dynamic builds. I don't know though, just brainstorming... Here was my brain storming of functions.

---
cpu_driver functions:
bool detect(void); // Is this CPU driver compatible with this CPU?
int alignment(void); // The default alignment (or max register size) for this CPU in bytes
void memcpy(void *buf1, size_t num, void *buf2); // (Check args?) Use this with unaligned data
void memcpy_aX(void *buf1, size_t num, void *buf2); // (Check args?) For X-bit aligned data
void memmove(void *buf1, size_t num, void *buf2); // (Check args?) Use this with unaligned data
void memmove_aX(void *buf1, size_t num, void *buf2); // (Check args?) For X-bit aligned data
void memset(void *buf1, int val, size_t num); // (Check args?) Use with bytes/unaligned data.
void memset_aX(void *buf1, uintX_t val, size_t num); // (Check args?) Use with aligned data of size X where X should be 16, 24, 32, 64, 128 (where 24 is unaligned or a Y aligned hack, where Y is 16, 24, 32, 64, 128)
void cmemmove_X(void *buf1, size_t num, uintX_t x, void *buf2); // (Check args?) For X-bit conditional move aligned by X.

Maybe add some span drawing function or something else that might be usefull?


Peter Hull <peterhull90@xxxxxxxxxx> wrote:
As far as I can see there's no pitch (i.e. bytes per line) field in a
memory bitmap, but it would be a useful addition, first to save some
calculations, and second to allow lines to be aligned say on 32-bit
boundaries.

What do you think?

Pete

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers


Looking for last minute shopping deals? Find them fast with Yahoo! Search.

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/