Core: Fix codacy errors and warnings

This commit is contained in:
refractionpcsx2 2022-08-26 22:57:55 +01:00
parent 4d4825de75
commit f841a8ba58
1 changed files with 4 additions and 6 deletions

View File

@ -521,7 +521,6 @@ void fillFifoOnDrain()
void drainPgpuDmaLl() void drainPgpuDmaLl()
{ {
u32 data = 0;
if (!dma.state.ll_active) if (!dma.state.ll_active)
return; return;
@ -550,7 +549,7 @@ void drainPgpuDmaLl()
else else
{ {
//Or the beginning of a new one //Or the beginning of a new one
data = iopMemRead32(dma.ll_dma.next_address); u32 data = iopMemRead32(dma.ll_dma.next_address);
PGPU_DMA_LOG( "Next PGPU LL DMA header= %08X ", data); PGPU_DMA_LOG( "Next PGPU LL DMA header= %08X ", data);
dmaRegs.madr.address = data & 0x00FFFFFF; //Copy the address in MADR. dmaRegs.madr.address = data & 0x00FFFFFF; //Copy the address in MADR.
dma.ll_dma.data_read_address = dma.ll_dma.next_address + 4; //start of data section of packet dma.ll_dma.data_read_address = dma.ll_dma.next_address + 4; //start of data section of packet
@ -562,7 +561,7 @@ void drainPgpuDmaLl()
else else
{ {
//We are in the middle of linked list transfer //We are in the middle of linked list transfer
data = iopMemRead32(dma.ll_dma.data_read_address); u32 data = iopMemRead32(dma.ll_dma.data_read_address);
PGPU_DMA_LOG( "PGPU LL DMA data= %08X addr %08X ", data, dma.ll_dma.data_read_address); PGPU_DMA_LOG( "PGPU LL DMA data= %08X addr %08X ", data, dma.ll_dma.data_read_address);
ringBufPut(&rb_gp0, &data); ringBufPut(&rb_gp0, &data);
dma.ll_dma.data_read_address += 4; dma.ll_dma.data_read_address += 4;
@ -572,7 +571,6 @@ void drainPgpuDmaLl()
void drainPgpuDmaNrToGpu() void drainPgpuDmaNrToGpu()
{ {
u32 data = 0;
if (!dma.state.to_gpu_active) if (!dma.state.to_gpu_active)
return; return;
@ -582,7 +580,7 @@ void drainPgpuDmaNrToGpu()
if (dma.normal.current_word < dma.normal.total_words) if (dma.normal.current_word < dma.normal.total_words)
{ {
data = iopMemRead32(dma.normal.address); u32 data = iopMemRead32(dma.normal.address);
PGPU_DMA_LOG( "To GPU Normal DMA data= %08X addr %08X ", data, dma.ll_dma.data_read_address); PGPU_DMA_LOG( "To GPU Normal DMA data= %08X addr %08X ", data, dma.ll_dma.data_read_address);
ringBufPut(&rb_gp0, &data); ringBufPut(&rb_gp0, &data);
@ -610,12 +608,12 @@ void drainPgpuDmaNrToGpu()
void drainPgpuDmaNrToIop() void drainPgpuDmaNrToIop()
{ {
u32 data = 0;
if (!dma.state.to_iop_active || rb_gp0.count <= 0) if (!dma.state.to_iop_active || rb_gp0.count <= 0)
return; return;
if (dma.normal.current_word < dma.normal.total_words) if (dma.normal.current_word < dma.normal.total_words)
{ {
u32 data = 0;
//This is not the best way, but... is there another? //This is not the best way, but... is there another?
ringBufGet(&rb_gp0, &data); ringBufGet(&rb_gp0, &data);
iopMemWrite32(dma.normal.address, data); iopMemWrite32(dma.normal.address, data);