commit 2d52a6a
Devine Lu Linvega
·
2026-01-10 04:01:40 +0000 UTC
parent ebdbe00
Split loop for flipx again..
1 files changed,
+15,
-9
+15,
-9
1@@ -618,15 +618,21 @@ screen_deo_sprite(void)
2 const Uint8 *src = &ram[rA + qfy];
3 for(j = 0; j < 8; j++, dst += stride, src += src_stride) {
4 const int ch1 = *src, ch2 = is_2bpp ? (src[8] << 1) : 0;
5- Uint8 *d = dst, bit = flipx ? 0x01 : 0x80;
6- for(int px = 0; px < 8; px++, d++) {
7- const int color = ((ch1 & bit) ? 1 : 0) | ((ch2 & (bit << 1)) ? 2 : 0);
8- const Uint8 mask = (color | opaque_mask) ? 0xff : 0x00;
9- const Uint8 next = (*d & layer_mask) | table[color];
10- *d = (*d & ~mask) | (next & mask);
11- if(flipx) bit <<= 1;
12- else bit >>= 1;
13- }
14+ Uint8 *d = dst;
15+ if(flipx)
16+ for(int px = 0, bit = 0x01; px < 8; px++, d++) {
17+ const int color = ((ch1 & bit) ? 1 : 0) | ((ch2 & (bit << 1)) ? 2 : 0);
18+ const Uint8 mask = (color | opaque_mask) ? 0xff : 0x00;
19+ const Uint8 next = (*d & layer_mask) | table[color];
20+ *d = (*d & ~mask) | (next & mask), bit <<= 1;
21+ }
22+ else
23+ for(int px = 0, bit = 0x80; px < 8; px++, d++) {
24+ const int color = ((ch1 & bit) ? 1 : 0) | ((ch2 & (bit << 1)) ? 2 : 0);
25+ const Uint8 mask = (color | opaque_mask) ? 0xff : 0x00;
26+ const Uint8 next = (*d & layer_mask) | table[color];
27+ *d = (*d & ~mask) | (next & mask), bit >>= 1;
28+ }
29 }
30 }
31 if(!screen_reqdraw) {