More sonarlint work

This commit is contained in:
Jasmine Iwanek
2023-06-09 23:46:54 -04:00
parent 0d1d069af4
commit ee695e71f9
218 changed files with 6282 additions and 3845 deletions

View File

@@ -66,6 +66,7 @@
#include <86box/video.h>
#include <86box/vid_cga.h>
#include <86box/m_at_t3100e.h>
#include <86box/plat_unused.h>
#define T3100E_XSIZE 640
#define T3100E_YSIZE 400
@@ -134,14 +135,14 @@ typedef struct t3100e_t {
static video_timings_t timing_t3100e = { VIDEO_ISA, 8, 16, 32, 8, 16, 32 };
void t3100e_recalctimings(t3100e_t *t3100e);
void t3100e_write(uint32_t addr, uint8_t val, void *p);
uint8_t t3100e_read(uint32_t addr, void *p);
void t3100e_write(uint32_t addr, uint8_t val, void *priv);
uint8_t t3100e_read(uint32_t addr, void *priv);
void t3100e_recalcattrs(t3100e_t *t3100e);
void
t3100e_out(uint16_t addr, uint8_t val, void *p)
t3100e_out(uint16_t addr, uint8_t val, void *priv)
{
t3100e_t *t3100e = (t3100e_t *) p;
t3100e_t *t3100e = (t3100e_t *) priv;
switch (addr) {
/* Emulated CRTC, register select */
case 0x3d0:
@@ -168,21 +169,20 @@ t3100e_out(uint16_t addr, uint8_t val, void *p)
t3100e_recalctimings(t3100e);
return;
/* CGA control register */
case 0x3D8:
cga_out(addr, val, &t3100e->cga);
return;
/* CGA colour register */
case 0x3D9:
case 0x3D8: /* CGA control register */
case 0x3D9: /* CGA colour register */
cga_out(addr, val, &t3100e->cga);
return;
default:
break;
}
}
uint8_t
t3100e_in(uint16_t addr, void *p)
t3100e_in(uint16_t addr, void *priv)
{
t3100e_t *t3100e = (t3100e_t *) p;
t3100e_t *t3100e = (t3100e_t *) priv;
uint8_t val;
switch (addr) {
@@ -196,24 +196,28 @@ t3100e_in(uint16_t addr, void *p)
val |= 0x30; /* Plasma / CRT */
return val;
}
break;
default:
break;
}
return cga_in(addr, &t3100e->cga);
}
void
t3100e_write(uint32_t addr, uint8_t val, void *p)
t3100e_write(uint32_t addr, uint8_t val, void *priv)
{
t3100e_t *t3100e = (t3100e_t *) p;
t3100e_t *t3100e = (t3100e_t *) priv;
t3100e->vram[addr & 0x7fff] = val;
cycles -= 4;
}
uint8_t
t3100e_read(uint32_t addr, void *p)
t3100e_read(uint32_t addr, void *priv)
{
t3100e_t *t3100e = (t3100e_t *) p;
t3100e_t *t3100e = (t3100e_t *) priv;
cycles -= 4;
return t3100e->vram[addr & 0x7fff];
@@ -242,7 +246,6 @@ void
t3100e_text_row80(t3100e_t *t3100e)
{
uint32_t cols[2];
int c;
uint8_t chr;
uint8_t attr;
int drawcursor;
@@ -287,12 +290,12 @@ t3100e_text_row80(t3100e_t *t3100e)
cols[0] = normcols[attr][0];
}
if (drawcursor) {
for (c = 0; c < 8; c++) {
((uint32_t *) buffer32->line[t3100e->displine])[(x << 3) + c] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
for (uint8_t c = 0; c < 8; c++) {
(buffer32->line[t3100e->displine])[(x << 3) + c] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
}
} else {
for (c = 0; c < 8; c++)
((uint32_t *) buffer32->line[t3100e->displine])[(x << 3) + c] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
for (uint8_t c = 0; c < 8; c++)
(buffer32->line[t3100e->displine])[(x << 3) + c] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
}
++ma;
}
@@ -349,11 +352,11 @@ t3100e_text_row40(t3100e_t *t3100e)
}
if (drawcursor) {
for (c = 0; c < 8; c++) {
((uint32_t *) buffer32->line[t3100e->displine])[(x << 4) + c * 2] = ((uint32_t *) buffer32->line[t3100e->displine])[(x << 4) + c * 2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
(buffer32->line[t3100e->displine])[(x << 4) + c * 2] = (buffer32->line[t3100e->displine])[(x << 4) + c * 2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
}
} else {
for (c = 0; c < 8; c++) {
((uint32_t *) buffer32->line[t3100e->displine])[(x << 4) + c * 2] = ((uint32_t *) buffer32->line[t3100e->displine])[(x << 4) + c * 2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
(buffer32->line[t3100e->displine])[(x << 4) + c * 2] = (buffer32->line[t3100e->displine])[(x << 4) + c * 2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
}
}
++ma;
@@ -386,8 +389,8 @@ t3100e_cgaline6(t3100e_t *t3100e)
ink = (dat & 0x80) ? fg : bg;
if (!(t3100e->cga.cgamode & 8))
ink = black;
((uint32_t *) buffer32->line[t3100e->displine])[x * 8 + c] = ink;
dat = dat << 1;
(buffer32->line[t3100e->displine])[x * 8 + c] = ink;
dat = dat << 1;
}
}
}
@@ -445,18 +448,21 @@ t3100e_cgaline4(t3100e_t *t3100e)
case 3:
ink0 = ink1 = amber;
break;
default:
break;
}
((uint32_t *) buffer32->line[t3100e->displine])[x * 8 + 2 * c] = ink0;
((uint32_t *) buffer32->line[t3100e->displine])[x * 8 + 2 * c + 1] = ink1;
dat = dat << 2;
(buffer32->line[t3100e->displine])[x * 8 + 2 * c] = ink0;
(buffer32->line[t3100e->displine])[x * 8 + 2 * c + 1] = ink1;
dat = dat << 2;
}
}
}
void
t3100e_poll(void *p)
t3100e_poll(void *priv)
{
t3100e_t *t3100e = (t3100e_t *) p;
t3100e_t *t3100e = (t3100e_t *) priv;
if (t3100e->video_options != st_video_options) {
t3100e->video_options = st_video_options;
@@ -646,7 +652,7 @@ t3100e_recalcattrs(t3100e_t *t3100e)
}
void *
t3100e_init(const device_t *info)
t3100e_init(UNUSED(const device_t *info))
{
t3100e_t *t3100e = malloc(sizeof(t3100e_t));
memset(t3100e, 0, sizeof(t3100e_t));
@@ -680,18 +686,18 @@ t3100e_init(const device_t *info)
}
void
t3100e_close(void *p)
t3100e_close(void *priv)
{
t3100e_t *t3100e = (t3100e_t *) p;
t3100e_t *t3100e = (t3100e_t *) priv;
free(t3100e->vram);
free(t3100e);
}
void
t3100e_speed_changed(void *p)
t3100e_speed_changed(void *priv)
{
t3100e_t *t3100e = (t3100e_t *) p;
t3100e_t *t3100e = (t3100e_t *) priv;
t3100e_recalctimings(t3100e);
}