Even more sonarlint work

This commit is contained in:
Jasmine Iwanek
2023-06-01 18:32:25 -04:00
parent ef2b84ed63
commit d1127e68fa
89 changed files with 2509 additions and 1542 deletions

View File

@@ -614,16 +614,16 @@ ht216_recalctimings(svga_t *svga)
case 1:
break;
case 4:
svga->clock = (cpuclock * (double) (1ull << 32)) / 50350000.0;
svga->clock = (cpuclock * (double) (1ULL << 32)) / 50350000.0;
break;
case 5:
svga->clock = (cpuclock * (double) (1ull << 32)) / 65000000.0;
svga->clock = (cpuclock * (double) (1ULL << 32)) / 65000000.0;
break;
case 7:
svga->clock = (cpuclock * (double) (1ull << 32)) / 40000000.0;
svga->clock = (cpuclock * (double) (1ULL << 32)) / 40000000.0;
break;
default:
svga->clock = (cpuclock * (double) (1ull << 32)) / 36000000.0;
svga->clock = (cpuclock * (double) (1ULL << 32)) / 36000000.0;
break;
}
@@ -703,7 +703,7 @@ static void
ht216_hwcursor_draw(svga_t *svga, int displine)
{
ht216_t *ht216 = (ht216_t *) svga->p;
int x, shift = (ht216->adjust_cursor ? 2 : 1);
int shift = (ht216->adjust_cursor ? 2 : 1);
uint32_t dat[2];
int offset = svga->hwcursor_latch.x + svga->hwcursor_latch.xoff;
int width = (ht216->adjust_cursor ? 16 : 32);
@@ -717,7 +717,7 @@ ht216_hwcursor_draw(svga_t *svga, int displine)
dat[0] = (svga->vram[svga->hwcursor_latch.addr] << 24) | (svga->vram[svga->hwcursor_latch.addr + 1] << 16) | (svga->vram[svga->hwcursor_latch.addr + 2] << 8) | svga->vram[svga->hwcursor_latch.addr + 3];
dat[1] = (svga->vram[svga->hwcursor_latch.addr + 128] << 24) | (svga->vram[svga->hwcursor_latch.addr + 128 + 1] << 16) | (svga->vram[svga->hwcursor_latch.addr + 128 + 2] << 8) | svga->vram[svga->hwcursor_latch.addr + 128 + 3];
for (x = 0; x < width; x++) {
for (int x = 0; x < width; x++) {
if (!(dat[0] & 0x80000000))
((uint32_t *) buffer32->line[displine])[svga->x_add + offset + x] = 0;
if (dat[1] & 0x80000000)
@@ -796,10 +796,13 @@ static void
ht216_dm_write(ht216_t *ht216, uint32_t addr, uint8_t cpu_dat, uint8_t cpu_dat_unexpanded)
{
svga_t *svga = &ht216->svga;
int writemask2 = svga->writemask, reset_wm = 0;
int writemask2 = svga->writemask;
int reset_wm = 0;
latch_t vall;
uint8_t i, wm = svga->writemask;
uint8_t count = 4, fg_data[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t i;
uint8_t wm = svga->writemask;
uint8_t count = 4;
uint8_t fg_data[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
if (ht216->ht_regs[0xcd] & HT_REG_CD_P8PCEXP)
writemask2 = svga->seqregs[2];
@@ -984,8 +987,10 @@ ht216_dm_extalu_write(ht216_t *ht216, uint32_t addr, uint8_t cpu_dat, uint8_t bi
01 = Bit mask (3CF:8)
1x = (3C4:F5)*/
svga_t *svga = &ht216->svga;
uint8_t input_a = 0, input_b = 0;
uint8_t fg, bg;
uint8_t input_a = 0;
uint8_t input_b = 0;
uint8_t fg;
uint8_t bg;
uint8_t output;
uint32_t remapped_addr = dword_remap(svga, addr);
@@ -1024,7 +1029,8 @@ ht216_dm_masked_write(ht216_t *ht216, uint32_t addr, uint8_t val, uint8_t bit_ma
{
svga_t *svga = &ht216->svga;
int writemask2 = svga->writemask;
uint8_t count = 4, i;
uint8_t count = 4;
uint8_t i;
uint8_t full_mask = 0x0f;
if (ht216->ht_regs[0xcd] & HT_REG_CD_P8PCEXP)
@@ -1098,7 +1104,8 @@ ht216_write_common(ht216_t *ht216, uint32_t addr, uint8_t val)
*/
svga_t *svga = &ht216->svga;
int i;
uint8_t bit_mask = 0, rop_select = 0;
uint8_t bit_mask = 0;
uint8_t rop_select = 0;
cycles -= video_timing_write_b;
@@ -1287,11 +1294,12 @@ ht216_read_common(ht216_t *ht216, uint32_t addr)
{
svga_t *svga = &ht216->svga;
uint32_t latch_addr = 0;
int offset, readplane = svga->readplane;
uint8_t or, i;
uint8_t count = 2;
uint8_t plane, pixel;
uint8_t temp, ret;
int offset;
int readplane = svga->readplane;
uint8_t or;
uint8_t count = 2;
uint8_t temp;
uint8_t ret;
if (ht216->ht_regs[0xc8] & HT_REG_C8_MOVSB)
addr <<= 3;
@@ -1309,7 +1317,7 @@ ht216_read_common(ht216_t *ht216, uint32_t addr)
latch_addr = (addr & svga->vram_mask) & ~7;
if (ht216->ht_regs[0xcd] & HT_REG_CD_ASTODE)
latch_addr += (svga->gdcreg[3] & 7);
for (i = 0; i < 8; i++)
for (uint8_t i = 0; i < 8; i++)
ht216->bg_latch[i] = svga->vram[dword_remap(svga, latch_addr + i)];
return svga->vram[dword_remap(svga, addr) & svga->vram_mask];
} else if (svga->chain4) {
@@ -1332,22 +1340,22 @@ ht216_read_common(ht216_t *ht216, uint32_t addr)
latch_addr = addr & ~7;
if (ht216->ht_regs[0xcd] & HT_REG_CD_ASTODE) {
offset = addr & 7;
for (i = 0; i < 8; i++)
for (uint8_t i = 0; i < 8; i++)
ht216->bg_latch[i] = svga->vram[latch_addr | ((offset + i) & 7)];
} else {
for (i = 0; i < 8; i++)
for (uint8_t i = 0; i < 8; i++)
ht216->bg_latch[i] = svga->vram[latch_addr | i];
}
or = addr & 4;
for (i = 0; i < 4; i++)
for (uint8_t i = 0; i < 4; i++)
svga->latch.b[i] = ht216->bg_latch[i | or ];
if (svga->readmode) {
temp = 0xff;
for (pixel = 0; pixel < 8; pixel++) {
for (plane = 0; plane < (uint8_t)(1 << count); plane++) {
for (uint8_t pixel = 0; pixel < 8; pixel++) {
for (uint8_t plane = 0; plane < (uint8_t)(1 << count); plane++) {
if (svga->colournocare & (1 << plane)) {
/* If we care about a plane, and the pixel has a mismatch on it, clear its bit. */
if (((svga->latch.b[plane] >> pixel) & 1) != ((svga->colourcompare >> plane) & 1))