Fixed a bug with un-inited DMA regs in the SNES driver, fixes at least a long-standing bug with nss_ssoc dimmed team selection screen [Angelo Salese]

This commit is contained in:
Angelo Salese 2010-04-08 17:24:38 +00:00
parent 0f6d1a804d
commit 25b9d810c0

View File

@ -955,7 +955,9 @@ READ8_HANDLER( snes_r_bank1 )
else
value = snes_ram[offset];
cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
return value;
}
@ -1012,7 +1014,8 @@ READ8_HANDLER( snes_r_bank2 )
else
value = snes_ram[0x300000 + offset];
cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
return value;
}
@ -1052,7 +1055,9 @@ READ8_HANDLER( snes_r_bank3 )
else /* Mode 21 & 25 + SuperFX games */
value = snes_ram[0x400000 + offset];
cpu_adjust_icount(space->cpu, -8);
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -8);
return value;
}
@ -1088,7 +1093,9 @@ READ8_HANDLER( snes_r_bank4 )
else if (snes_cart.mode & 0x0a) /* Mode 21 & 25 */
value = snes_ram[0x600000 + offset];
cpu_adjust_icount(space->cpu, -8);
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -8);
return value;
}
@ -1122,7 +1129,9 @@ READ8_HANDLER( snes_r_bank5 )
else
value = snes_ram[0x700000 + offset];
cpu_adjust_icount(space->cpu, -8);
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -8);
return value;
}
@ -1168,7 +1177,9 @@ READ8_HANDLER( snes_r_bank6 )
else
value = snes_ram[0x800000 + offset];
cpu_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset));
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset));
return value;
}
@ -1219,7 +1230,8 @@ READ8_HANDLER( snes_r_bank7 )
else /* Mode 21 & 25 + SuperFX Games */
value = snes_ram[0xc00000 + offset];
cpu_adjust_icount(space->cpu, -((snes_ram[MEMSEL] & 1) ? 6 : 8));
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -((snes_ram[MEMSEL] & 1) ? 6 : 8));
return value;
}
@ -1266,7 +1278,8 @@ WRITE8_HANDLER( snes_w_bank1 )
else
logerror( "(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset );
cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
}
/* 0x300000 - 0x3fffff */
@ -1317,7 +1330,8 @@ WRITE8_HANDLER( snes_w_bank2 )
else
logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0x300000);
cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset));
}
/* 0x600000 - 0x6fffff */
@ -1341,7 +1355,8 @@ WRITE8_HANDLER( snes_w_bank4 )
else if (snes_cart.mode & 0x0a)
logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0x600000);
cpu_adjust_icount(space->cpu, -8);
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -8);
}
/* 0x700000 - 0x7dffff */
@ -1364,7 +1379,8 @@ WRITE8_HANDLER( snes_w_bank5 )
else if (snes_cart.mode & 0x0a)
logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0x700000);
cpu_adjust_icount(space->cpu, -8);
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -8);
}
@ -1411,7 +1427,8 @@ WRITE8_HANDLER( snes_w_bank6 )
else
logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0x800000);
cpu_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset));
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset));
}
@ -1449,7 +1466,8 @@ WRITE8_HANDLER( snes_w_bank7 )
else if (snes_cart.mode & 0x0a)
logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0xc00000);
cpu_adjust_icount(space->cpu, -((snes_ram[MEMSEL] & 1) ? 6 : 8));
if(!space->debugger_access)
cpu_adjust_icount(space->cpu, -((snes_ram[MEMSEL] & 1) ? 6 : 8));
}
@ -1703,6 +1721,24 @@ MACHINE_START( snes )
snes_ram[WRDIVL] = 0xff;
snes_ram[WRDIVH] = 0xff;
/* init DMA regs to be 0xff */
{
int i;
for(i=0;i<8;i++)
{
state->dma_channel[i].dmap = 0xff;
state->dma_channel[i].dest_addr = 0xff;
state->dma_channel[i].src_addr = 0xffff;
state->dma_channel[i].bank = 0xff;
state->dma_channel[i].trans_size = 0xffff;
state->dma_channel[i].ibank = 0xff;
state->dma_channel[i].hdma_addr = 0xffff;
state->dma_channel[i].hdma_line_counter = 0xff;
state->dma_channel[i].unk = 0xff;
}
}
switch (snes_has_addon_chip)
{
case HAS_SDD1:
@ -2035,6 +2071,8 @@ static void snes_hdma( const address_space *space )
bbus = state->dma_channel[i].dest_addr + 0x2100;
switch (state->dma_channel[i].dmap & 0x07)
{
case 0: /* 1 register write once (1 byte: p ) */