DS GX: Make colors unsigned

This commit is contained in:
Vicki Pfau 2017-03-01 11:01:50 -08:00
parent 619583775d
commit 2609c362db
2 changed files with 11 additions and 11 deletions

View File

@ -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;
};

View File

@ -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;