sonarlint the ramdacs

This commit is contained in:
Jasmine Iwanek
2023-07-31 16:50:43 -04:00
parent b52df9e201
commit f023d158b0
5 changed files with 49 additions and 49 deletions

View File

@@ -65,9 +65,9 @@ typedef struct ati68860_ramdac_t {
} ati68860_ramdac_t; } ati68860_ramdac_t;
void void
ati68860_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga) ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga)
{ {
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) p; ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
switch (addr) { switch (addr) {
case 0: case 0:
@@ -168,9 +168,9 @@ ati68860_ramdac_out(uint16_t addr, uint8_t val, void *p, svga_t *svga)
} }
uint8_t uint8_t
ati68860_ramdac_in(uint16_t addr, void *p, svga_t *svga) ati68860_ramdac_in(uint16_t addr, void *priv, svga_t *svga)
{ {
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) p; const ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
uint8_t temp = 0; uint8_t temp = 0;
switch (addr) { switch (addr) {
@@ -207,9 +207,9 @@ ati68860_ramdac_in(uint16_t addr, void *p, svga_t *svga)
} }
void void
ati68860_set_ramdac_type(void *p, int type) ati68860_set_ramdac_type(void *priv, int type)
{ {
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) p; ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
if (ramdac->ramdac_type != type) { if (ramdac->ramdac_type != type) {
ramdac->ramdac_type = type; ramdac->ramdac_type = type;
@@ -237,17 +237,17 @@ ati68860_ramdac_init(UNUSED(const device_t *info))
} }
void void
ati68860_ramdac_set_render(void *p, svga_t *svga) ati68860_ramdac_set_render(void *priv, svga_t *svga)
{ {
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) p; ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
svga->render = ramdac->render; svga->render = ramdac->render;
} }
void void
ati68860_ramdac_set_pallook(void *p, int i, uint32_t col) ati68860_ramdac_set_pallook(void *priv, int i, uint32_t col)
{ {
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) p; ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
ramdac->pallook[i] = col; ramdac->pallook[i] = col;
} }
@@ -255,7 +255,7 @@ ati68860_ramdac_set_pallook(void *p, int i, uint32_t col)
void void
ati68860_hwcursor_draw(svga_t *svga, int displine) ati68860_hwcursor_draw(svga_t *svga, int displine)
{ {
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) svga->ramdac; const ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) svga->ramdac;
int offset; int offset;
uint8_t dat; uint8_t dat;
uint32_t col0 = ramdac->pallook[0]; uint32_t col0 = ramdac->pallook[0];

View File

@@ -28,8 +28,7 @@
#include <86box/video.h> #include <86box/video.h>
#include <86box/vid_svga.h> #include <86box/vid_svga.h>
typedef struct typedef struct att49x_ramdac_t {
{
int type; int type;
int state; int state;
uint8_t ctrl; uint8_t ctrl;
@@ -42,9 +41,9 @@ enum {
}; };
static void static void
att49x_ramdac_control(uint8_t val, void *p, svga_t *svga) att49x_ramdac_control(uint8_t val, void *priv, svga_t *svga)
{ {
att49x_ramdac_t *ramdac = (att49x_ramdac_t *) p; att49x_ramdac_t *ramdac = (att49x_ramdac_t *) priv;
ramdac->ctrl = val; ramdac->ctrl = val;
switch ((ramdac->ctrl >> 5) & 7) { switch ((ramdac->ctrl >> 5) & 7) {
case 0: case 0:
@@ -73,9 +72,9 @@ att49x_ramdac_control(uint8_t val, void *p, svga_t *svga)
} }
void void
att49x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga) att49x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga)
{ {
att49x_ramdac_t *ramdac = (att49x_ramdac_t *) p; att49x_ramdac_t *ramdac = (att49x_ramdac_t *) priv;
uint8_t rs = (addr & 0x03); uint8_t rs = (addr & 0x03);
rs |= ((!!rs2) << 2); rs |= ((!!rs2) << 2);
@@ -110,9 +109,9 @@ att49x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga)
} }
uint8_t uint8_t
att49x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga) att49x_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga)
{ {
att49x_ramdac_t *ramdac = (att49x_ramdac_t *) p; att49x_ramdac_t *ramdac = (att49x_ramdac_t *) priv;
uint8_t temp = 0xff; uint8_t temp = 0xff;
uint8_t rs = (addr & 0x03); uint8_t rs = (addr & 0x03);
rs |= ((!!rs2) << 2); rs |= ((!!rs2) << 2);

View File

@@ -28,8 +28,7 @@
#include <86box/video.h> #include <86box/video.h>
#include <86box/vid_svga.h> #include <86box/vid_svga.h>
typedef struct typedef struct att498_ramdac_t {
{
int type; int type;
int state; int state;
int loop; int loop;
@@ -37,9 +36,9 @@ typedef struct
} att498_ramdac_t; } att498_ramdac_t;
static void static void
att498_ramdac_control(uint8_t val, void *p, svga_t *svga) att498_ramdac_control(uint8_t val, void *priv, svga_t *svga)
{ {
att498_ramdac_t *ramdac = (att498_ramdac_t *) p; att498_ramdac_t *ramdac = (att498_ramdac_t *) priv;
ramdac->ctrl = val; ramdac->ctrl = val;
if (val == 0xff) if (val == 0xff)
@@ -73,9 +72,9 @@ att498_ramdac_control(uint8_t val, void *p, svga_t *svga)
} }
void void
att498_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga) att498_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga)
{ {
att498_ramdac_t *ramdac = (att498_ramdac_t *) p; att498_ramdac_t *ramdac = (att498_ramdac_t *) priv;
uint8_t rs = (addr & 0x03); uint8_t rs = (addr & 0x03);
rs |= ((!!rs2) << 2); rs |= ((!!rs2) << 2);
@@ -109,9 +108,9 @@ att498_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga)
} }
uint8_t uint8_t
att498_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga) att498_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga)
{ {
att498_ramdac_t *ramdac = (att498_ramdac_t *) p; att498_ramdac_t *ramdac = (att498_ramdac_t *) priv;
uint8_t temp = 0xff; uint8_t temp = 0xff;
uint8_t rs = (addr & 0x03); uint8_t rs = (addr & 0x03);
rs |= ((!!rs2) << 2); rs |= ((!!rs2) << 2);

View File

@@ -29,13 +29,13 @@
#include <86box/video.h> #include <86box/video.h>
#include <86box/vid_svga.h> #include <86box/vid_svga.h>
typedef struct typedef struct bt48x_ramdac_t {
{
PALETTE extpal; PALETTE extpal;
uint32_t extpallook[256]; uint32_t extpallook[256];
uint8_t cursor32_data[256]; uint8_t cursor32_data[256];
uint8_t cursor64_data[1024]; uint8_t cursor64_data[1024];
int hwc_y, hwc_x; int hwc_y;
int hwc_x;
uint8_t cmd_r0; uint8_t cmd_r0;
uint8_t cmd_r1; uint8_t cmd_r1;
uint8_t cmd_r2; uint8_t cmd_r2;
@@ -85,9 +85,9 @@ bt48x_set_bpp(bt48x_ramdac_t *ramdac, svga_t *svga)
} }
void void
bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *svga) bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_t *svga)
{ {
bt48x_ramdac_t *ramdac = (bt48x_ramdac_t *) p; bt48x_ramdac_t *ramdac = (bt48x_ramdac_t *) priv;
uint32_t o32; uint32_t o32;
uint8_t *cd; uint8_t *cd;
uint16_t index; uint16_t index;
@@ -233,11 +233,11 @@ bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *p, svga_t *
} }
uint8_t uint8_t
bt48x_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga) bt48x_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga)
{ {
bt48x_ramdac_t *ramdac = (bt48x_ramdac_t *) p; bt48x_ramdac_t *ramdac = (bt48x_ramdac_t *) priv;
uint8_t temp = 0xff; uint8_t temp = 0xff;
uint8_t *cd; const uint8_t *cd;
uint16_t index; uint16_t index;
uint8_t rs = (addr & 0x03); uint8_t rs = (addr & 0x03);
uint16_t da_mask = 0x03ff; uint16_t da_mask = 0x03ff;
@@ -360,9 +360,9 @@ bt48x_ramdac_in(uint16_t addr, int rs2, int rs3, void *p, svga_t *svga)
} }
void void
bt48x_recalctimings(void *p, svga_t *svga) bt48x_recalctimings(void *priv, svga_t *svga)
{ {
bt48x_ramdac_t *ramdac = (bt48x_ramdac_t *) p; const bt48x_ramdac_t *ramdac = (bt48x_ramdac_t *) priv;
svga->interlace = ramdac->cmd_r2 & 0x08; svga->interlace = ramdac->cmd_r2 & 0x08;
if (ramdac->cmd_r3 & 0x08) if (ramdac->cmd_r3 & 0x08)
@@ -386,7 +386,7 @@ bt48x_hwcursor_draw(svga_t *svga, int displine)
uint32_t clr2; uint32_t clr2;
uint32_t clr3; uint32_t clr3;
uint32_t *p; uint32_t *p;
uint8_t *cd; const uint8_t *cd;
bt48x_ramdac_t *ramdac = (bt48x_ramdac_t *) svga->ramdac; bt48x_ramdac_t *ramdac = (bt48x_ramdac_t *) svga->ramdac;
clr1 = ramdac->extpallook[1]; clr1 = ramdac->extpallook[1];

View File

@@ -28,8 +28,7 @@
#include <86box/video.h> #include <86box/video.h>
#include <86box/vid_svga.h> #include <86box/vid_svga.h>
typedef struct typedef struct sc1148x_ramdac_t {
{
int type; int type;
int state; int state;
int rs2; int rs2;
@@ -37,9 +36,9 @@ typedef struct
} sc1148x_ramdac_t; } sc1148x_ramdac_t;
void void
sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga) sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga)
{ {
sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) p; sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) priv;
uint8_t rs = (addr & 0x03) | ((!!rs2) << 2); uint8_t rs = (addr & 0x03) | ((!!rs2) << 2);
int oldbpp = 0; int oldbpp = 0;
@@ -72,6 +71,9 @@ sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga)
} else if (val == 0x00) } else if (val == 0x00)
svga->bpp = 8; svga->bpp = 8;
break; break;
default:
break;
} }
if (oldbpp != svga->bpp) if (oldbpp != svga->bpp)
svga_recalctimings(svga); svga_recalctimings(svga);
@@ -90,9 +92,9 @@ sc1148x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *p, svga_t *svga)
} }
uint8_t uint8_t
sc1148x_ramdac_in(uint16_t addr, int rs2, void *p, svga_t *svga) sc1148x_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga)
{ {
sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) p; sc1148x_ramdac_t *ramdac = (sc1148x_ramdac_t *) priv;
uint8_t ret = 0xff; uint8_t ret = 0xff;
uint8_t rs = (addr & 0x03) | ((!!rs2) << 2); uint8_t rs = (addr & 0x03) | ((!!rs2) << 2);