Skip to content

Commit

Permalink
MGA: Gamma-correct hardware cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Dec 23, 2023
1 parent 70d6d59 commit 0a55e75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/include/86box/vid_svga.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ enum {
RAMDAC_8BIT
};

uint32_t svga_lookup_lut_ram(svga_t* svga, uint32_t val);

/* We need a way to add a device with a pointer to a parent device so it can attach itself to it, and
possibly also a second ATi 68860 RAM DAC type that auto-sets SVGA render on RAM DAC render change. */
extern void ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga);
Expand Down
2 changes: 1 addition & 1 deletion src/video/vid_mga.c
Original file line number Diff line number Diff line change
Expand Up @@ -5404,7 +5404,7 @@ mystique_hwcursor_draw(svga_t *svga, int displine)
case XCURCTRL_CURMODE_XGA:
for (uint8_t x = 0; x < 64; x++) {
if (!(dat[1] & (1ULL << 63)))
svga->monitor->target_buffer->line[displine][offset + svga->x_add] = (dat[0] & (1ULL << 63)) ? mystique->cursor.col[1] : mystique->cursor.col[0];
svga->monitor->target_buffer->line[displine][offset + svga->x_add] = (dat[0] & (1ULL << 63)) ? svga_lookup_lut_ram(svga, mystique->cursor.col[1]) : svga_lookup_lut_ram(svga, mystique->cursor.col[0]);
else if (dat[0] & (1ULL << 63))
svga->monitor->target_buffer->line[displine][offset + svga->x_add] ^= 0xffffff;

Expand Down
6 changes: 3 additions & 3 deletions src/video/vid_svga_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <86box/vid_svga_render.h>
#include <86box/vid_svga_render_remap.h>

static inline uint32_t
lookup_lut_ram(svga_t* svga, uint32_t val)
uint32_t
svga_lookup_lut_ram(svga_t* svga, uint32_t val)
{
if (!svga->lut_map)
return val;
Expand All @@ -42,7 +42,7 @@ lookup_lut_ram(svga_t* svga, uint32_t val)
return makecol32(r, g, b) | (val & 0xFF000000);
}

#define lookup_lut(val) lookup_lut_ram(svga, val)
#define lookup_lut(val) svga_lookup_lut_ram(svga, val)

void
svga_render_null(svga_t *svga)
Expand Down

0 comments on commit 0a55e75

Please sign in to comment.