DSP: Remove all mentions of the mysterious DROM. Write protect the ROMs and IRAM as much as possible while loaded (to make sure they don't get corrupted by some memory overwrite or whatever). Make instruction reads stricter - iram and irom don't wrap anymore (not 100% sure about this one). Misc cleanup + changes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2904 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
1 parent
13ac45db1a
commit
0fd2edbf98
12 files changed
+147
-116
No files matched your search
@@ -37,15 +37,22 @@ u16 dsp_swap16(u16 x)
|
||||
|
||||
u16 dsp_imem_read(u16 addr)
|
||||
{
|
||||
if (g_dsp.pc & 0x8000)
|
||||
return dsp_swap16(g_dsp.irom[addr & DSP_IROM_MASK]);
|
||||
else
|
||||
switch (addr >> 12)
|
||||
{
|
||||
case 0:
|
||||
return dsp_swap16(g_dsp.iram[addr & DSP_IRAM_MASK]);
|
||||
case 8:
|
||||
return dsp_swap16(g_dsp.irom[addr & DSP_IROM_MASK]);
|
||||
default:
|
||||
ERROR_LOG(DSPLLE, "%04x DSP ERROR: Executing from invalid (%04x) memory", g_dsp.pc, addr);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
u16 dsp_dmem_read(u16 addr)
|
||||
{
|
||||
switch (addr >> 12) {
|
||||
switch (addr >> 12)
|
||||
{
|
||||
case 0x0: // 0xxx DRAM
|
||||
return dsp_swap16(g_dsp.dram[addr & DSP_DRAM_MASK]);
|
||||
|
||||
@@ -58,10 +65,6 @@ u16 dsp_dmem_read(u16 addr)
|
||||
case 0x4:
|
||||
break;*/
|
||||
|
||||
case 0x8: // 8xxx DROM
|
||||
ERROR_LOG(DSPLLE, "someone reads from ROM");
|
||||
return dsp_swap16(g_dsp.drom[addr & DSP_DROM_MASK]);
|
||||
|
||||
case 0xf: // Fxxx HW regs
|
||||
return gdsp_ifx_read(addr);
|
||||
|
||||
@@ -84,12 +87,6 @@ void dsp_dmem_write(u16 addr, u16 val)
|
||||
ERROR_LOG(DSPLLE, "someone writes to COEF");
|
||||
break;
|
||||
|
||||
case 0x8: // 8xxx DROM
|
||||
ERROR_LOG(DSPLLE, "someone writes to DROM");
|
||||
/* val = dsp_swap16(val);
|
||||
g_dsp.drom[addr & DSP_DROM_MASK] = val;*/
|
||||
break;
|
||||
|
||||
case 0xf: // Fxxx HW regs
|
||||
gdsp_ifx_write(addr, val);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user