sonarlint vid_ati_mach64.c
This commit is contained in:
@@ -91,7 +91,8 @@ typedef struct mach64_t {
|
||||
uint8_t regs[256];
|
||||
int index;
|
||||
|
||||
int type, pci;
|
||||
int type;
|
||||
int pci;
|
||||
|
||||
uint8_t pci_regs[256];
|
||||
uint8_t int_line;
|
||||
@@ -503,7 +504,7 @@ mach64_in(uint16_t addr, void *priv)
|
||||
void
|
||||
mach64_recalctimings(svga_t *svga)
|
||||
{
|
||||
mach64_t *mach64 = (mach64_t *) svga->priv;
|
||||
const mach64_t *mach64 = (mach64_t *) svga->priv;
|
||||
|
||||
if (((mach64->crtc_gen_cntl >> 24) & 3) == 3) {
|
||||
svga->vtotal = (mach64->crtc_v_total_disp & 2047) + 1;
|
||||
@@ -678,7 +679,7 @@ mach64_wait_fifo_idle(mach64_t *mach64)
|
||||
}
|
||||
|
||||
#define READ8(addr, var) \
|
||||
switch ((addr) & 3) { \
|
||||
switch ((addr) &3) { \
|
||||
case 0: \
|
||||
ret = (var) &0xff; \
|
||||
break; \
|
||||
@@ -694,7 +695,7 @@ mach64_wait_fifo_idle(mach64_t *mach64)
|
||||
}
|
||||
|
||||
#define WRITE8(addr, var, val) \
|
||||
switch ((addr) & 3) { \
|
||||
switch ((addr) &3) { \
|
||||
case 0: \
|
||||
var = (var & 0xffffff00) | (val); \
|
||||
break; \
|
||||
@@ -1710,7 +1711,7 @@ mach64_blit(uint32_t cpu_dat, int count, mach64_t *mach64)
|
||||
}
|
||||
|
||||
if (!(mach64->dst_cntl & DST_POLYGON_EN) || mach64->accel.poly_draw) {
|
||||
READ(mach64->accel.dst_offset + ((dst_y) * mach64->accel.dst_pitch) + (dst_x), dest_dat, mach64->accel.dst_size);
|
||||
READ(mach64->accel.dst_offset + ((dst_y) *mach64->accel.dst_pitch) + (dst_x), dest_dat, mach64->accel.dst_size);
|
||||
|
||||
switch (mach64->accel.clr_cmp_fn) {
|
||||
case 1: /*TRUE*/
|
||||
@@ -2879,8 +2880,9 @@ mach64_ext_readb(uint32_t addr, void *priv)
|
||||
uint16_t
|
||||
mach64_ext_readw(uint32_t addr, void *priv)
|
||||
{
|
||||
mach64_t *mach64 = (mach64_t *) priv;
|
||||
const mach64_t *mach64 = (mach64_t *) priv;
|
||||
uint16_t ret;
|
||||
|
||||
if (!(addr & 0x400)) {
|
||||
mach64_log("nmach64_ext_readw: addr=%04x\n", addr);
|
||||
ret = 0xffff;
|
||||
@@ -2907,8 +2909,9 @@ mach64_ext_readw(uint32_t addr, void *priv)
|
||||
uint32_t
|
||||
mach64_ext_readl(uint32_t addr, void *priv)
|
||||
{
|
||||
mach64_t *mach64 = (mach64_t *) priv;
|
||||
const mach64_t *mach64 = (mach64_t *) priv;
|
||||
uint32_t ret;
|
||||
|
||||
if (!(addr & 0x400)) {
|
||||
mach64_log("nmach64_ext_readl: addr=%04x\n", addr);
|
||||
ret = 0xffffffff;
|
||||
@@ -4216,7 +4219,7 @@ mach64_io_set(mach64_t *mach64)
|
||||
uint8_t
|
||||
mach64_pci_read(UNUSED(int func), int addr, void *priv)
|
||||
{
|
||||
mach64_t *mach64 = (mach64_t *) priv;
|
||||
const mach64_t *mach64 = (mach64_t *) priv;
|
||||
|
||||
switch (addr) {
|
||||
case 0x00:
|
||||
@@ -4448,7 +4451,7 @@ mach64gx_init(const device_t *info)
|
||||
|
||||
mach64->type = MACH64_GX;
|
||||
mach64->pci = !!(info->flags & DEVICE_PCI);
|
||||
mach64->pci_id = (int) 'X' | ((int) 'G' << 8);
|
||||
mach64->pci_id = 'X' | ('G' << 8);
|
||||
mach64->config_chip_id = 0x000000d7;
|
||||
mach64->dac_cntl = 5 << 16; /*ATI 68860 RAMDAC*/
|
||||
mach64->config_stat0 = (5 << 9) | (3 << 3); /*ATI-68860, 256Kx16 DRAM*/
|
||||
|
||||
Reference in New Issue
Block a user