2 * Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Copyright 2015, Augustin Cavalier <waddlesplash>. All rights reserved.
4 * Distributed under the terms of the MIT License.
6 * Effect from corTeX / Optimum.
9 #include <SupportDefs.h>
11 #include "DrawStars.h"
14 // Hand-translated from x86 assembly.
15 /* draw a star (5 pixels) */
16 void draw_stars(int star_width
, char* dstParam
, char incParam
)
19 unsigned char inc
, al
, cl
;
20 dst
= (unsigned char*)dstParam
;
21 inc
= (unsigned char)incParam
;
23 dst
[star_width
] += inc
;
24 if (dst
[star_width
] < inc
) {
26 dst
[star_width
] = 255;
30 cl
= dst
[star_width
- 1];
34 dst
[star_width
- 1] = 255;
42 dst
[star_width
- 1] = cl
;
45 al
= dst
[star_width
* 2];
46 cl
= dst
[star_width
+ 1];
51 dst
[star_width
* 2] = 255;
52 dst
[star_width
+ 1] = cl
;
57 dst
[star_width
* 2] = al
;
58 dst
[star_width
+ 1] = cl
;
63 dst
[star_width
* 2] = 255;
64 dst
[star_width
+ 1] = 255;