Is there 16-bit memset?
Just writing a simple rectangle filler, and it''d be faster if I could memset each row instead of incrementing, but I''m using 16-bit color so the 8-bit memset won''t work. Not that I''ll be drawing enough rectangles for it to matter, but it''d help my tri-filler too, so I figured I''d ask.
-Deku-chan
DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)
I mean it sets one byte at a time, so I can''t set a 2-byte value with it. Like, if my color value is 0xE00F, then it sets each pixel to 0xE0E0 (or it might be 0x0F0F, not sure which side it cuts off).
-Deku-chan
DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)
-Deku-chan
DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)
It would probably be faster to set up a 32bit (or 64bit) register with the data, then write directly to memory for the number of words you want to write.
(I got help with this answer from Tybalt who is sitting here hassling me to promote his site)
(I got help with this answer from Tybalt who is sitting here hassling me to promote his site)
search the forum, there was a decent thread not too long ago with a number of memset algo''s
Magmai Kai Holmlor
- The disgruntled & disillusioned
Magmai Kai Holmlor
- The disgruntled & disillusioned
Yep. And if you take a look at the MSVC generated assembler listings, you''ll see that the memset expands into inline assembly that copies data in DWORDS. At least, if the 3rd argument, (i.e. the size of data) is a constant.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement