diff --git a/include/mgba/internal/ds/gx/software.h b/include/mgba/internal/ds/gx/software.h index b76864a04..141b2a279 100644 --- a/include/mgba/internal/ds/gx/software.h +++ b/include/mgba/internal/ds/gx/software.h @@ -27,18 +27,18 @@ struct DSGXSoftwareEdge { int32_t y0; // 20.12 int32_t x0; // 20.12 int32_t w0; // 20.12 - int8_t cr0; - int8_t cg0; - int8_t cb0; + uint8_t cr0; + uint8_t cg0; + uint8_t cb0; int16_t s0; int16_t t0; int32_t y1; // 20.12 int32_t x1; // 20.12 int32_t w1; // 20.12 - int8_t cr1; - int8_t cg1; - int8_t cb1; + uint8_t cr1; + uint8_t cg1; + uint8_t cb1; int16_t s1; int16_t t1; }; @@ -46,9 +46,9 @@ struct DSGXSoftwareEdge { struct DSGXSoftwareEndpoint { int32_t x; // 20.12 int32_t w; // 20.12 - int8_t cr; - int8_t cg; - int8_t cb; + uint8_t cr; + uint8_t cg; + uint8_t cb; int16_t s; int16_t t; }; diff --git a/src/ds/gx/software.c b/src/ds/gx/software.c index 3b79fe7c2..ad10d0a03 100644 --- a/src/ds/gx/software.c +++ b/src/ds/gx/software.c @@ -21,13 +21,13 @@ static void DSGXSoftwareRendererSetRAM(struct DSGXRenderer* renderer, struct DSG static void DSGXSoftwareRendererDrawScanline(struct DSGXRenderer* renderer, int y); static void DSGXSoftwareRendererGetScanline(struct DSGXRenderer* renderer, int y, color_t** output); -static void _expandColor(uint16_t c15, int8_t* r, int8_t* g, int8_t* b) { +static void _expandColor(uint16_t c15, uint8_t* r, uint8_t* g, uint8_t* b) { *r = ((c15 << 1) & 0x3E) | 1; *g = ((c15 >> 4) & 0x3E) | 1; *b = ((c15 >> 9) & 0x3E) | 1; } -static color_t _finishColor(int8_t r, int8_t g, int8_t b) { +static color_t _finishColor(uint8_t r, uint8_t g, uint8_t b) { #ifndef COLOR_16_BIT color_t rgb = (r << 2) & 0xF8; rgb |= (g << 10) & 0xF800;