static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)

{

    uint8_t r, g, b;

    uint16_t color;

    int i;

    int array_offset  = low ? 0 : 8;

    uint32_t *palette = (uint32_t *) cc->frame.data[1];



    for (i = 0; i < 8; i++) {

        color = (data[2 * i] << 6) + (data[2 * i + 1] & 0x3F);

        r = ((color >> 8) & 0x000F) * 17;

        g = ((color >> 4) & 0x000F) * 17;

        b = ((color     ) & 0x000F) * 17;

        palette[i + array_offset] = 0xFF << 24 | r << 16 | g << 8 | b;

    }

    cc->frame.palette_has_changed = 1;

}

static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low)

{

    uint8_t r, g, b;

    uint16_t color;

    int i;

    int array_offset  = low ? 0 : 8;

    uint32_t *palette = (uint32_t *) cc->frame.data[1];



    for (i = 0; i < 8; i++) {

        color = (data[2 * i] << 6) + (data[2 * i + 1] & 0x3F);

        r = ((color >> 8) & 0x000F) * 17;

        g = ((color >> 4) & 0x000F) * 17;

        b = ((color     ) & 0x000F) * 17;

        palette[i + array_offset] = 0xFF << 24 | r << 16 | g << 8 | b;

    }

    cc->frame.palette_has_changed = 1;

}

        palette[i + array_offset] = 0xFF << 24 | r << 16 | g << 8 | b;
static void FUNC_0(CDGraphicsContext *VAR_0, uint8_t *VAR_1, int VAR_2)

{

    uint8_t r, g, b;

    uint16_t color;

    int VAR_3;

    int VAR_4  = VAR_2 ? 0 : 8;

    uint32_t *palette = (uint32_t *) VAR_0->frame.VAR_1[1];



    for (VAR_3 = 0; VAR_3 < 8; VAR_3++) {

        color = (VAR_1[2 * VAR_3] << 6) + (VAR_1[2 * VAR_3 + 1] & 0x3F);

        r = ((color >> 8) & 0x000F) * 17;

        g = ((color >> 4) & 0x000F) * 17;

        b = ((color     ) & 0x000F) * 17;

        palette[VAR_3 + VAR_4] = 0xFF << 24 | r << 16 | g << 8 | b;

    }

    VAR_0->frame.palette_has_changed = 1;

}

static void FUNC_0(CDGraphicsContext *VAR_0, uint8_t *VAR_1, int VAR_2)
{ uint8_t r, g, b; uint16_t color; int VAR_3; int VAR_4  = VAR_2 ? 0 : 8; uint32_t *palette = (uint32_t *) VAR_0->frame.VAR_1[1]; for (VAR_3 = 0; VAR_3 < 8; VAR_3++) { color = (VAR_1[2 * VAR_3] << 6) + (VAR_1[2 * VAR_3 + 1] & 0x3F); r = ((color >> 8) & 0x000F) * 17; g = ((color >> 4) & 0x000F) * 17; b = ((color     ) & 0x000F) * 17; palette[VAR_3 + VAR_4] = 0xFF << 24 | r << 16 | g << 8 | b; } VAR_0->frame.palette_has_changed = 1; }