memset --> asm

This commit is contained in:
Frater 2026-05-15 15:28:02 +02:00
commit 80fca8e0fb

View file

@ -41,15 +41,15 @@ void fast_copy_dwords(void *dest, void *src, int count);
void clear_buffers(uint8_t color) { void clear_buffers(uint8_t color) {
// memset(backbuffer, color, SCREEN_PIXELS); // memset(backbuffer, color, SCREEN_PIXELS);
uint32_t c32 = color | (color << 8) | (color << 16) | (color << 24); uint32_t c32 = color | (color << 8) | (color << 16) | (color << 24);
fast_clear_dwords(backbuffer, c32, SCREEN_PIXELS / 4); fast_clear_dwords(backbuffer, c32, SCREEN_PIXELS >> 2);
//memset(zbuffer, 0xFF, SCREEN_PIXELS * sizeof(uint16_t)); //memset(zbuffer, 0xFF, SCREEN_PIXELS * sizeof(uint16_t));
fast_clear_dwords(zbuffer, 0xFFFFFFFFUL, SCREEN_PIXELS / 2); /* 2 pixels (16 bits) par itération 32 bits */ fast_clear_dwords(zbuffer, 0xFFFFFFFFUL, SCREEN_PIXELS >> 1); /* 2 pixels (16 bits) par itération 32 bits */
} }
void clear_zbuffer(void) { void clear_zbuffer(void) {
//memset(zbuffer, 0xFF, SCREEN_PIXELS * sizeof(uint16_t)); //memset(zbuffer, 0xFF, SCREEN_PIXELS * sizeof(uint16_t));
fast_clear_dwords(zbuffer, 0xFFFFFFFFUL, SCREEN_PIXELS / 2); fast_clear_dwords(zbuffer, 0xFFFFFFFFUL, SCREEN_PIXELS >> 1);
} }
void blit_image(Image *img, int x, int y) { void blit_image(Image *img, int x, int y) {