Core/DSPCore: Make Jit read from coefficient ROM when told to do so,
change the unit test to catch this bug if it turns up again and two more zeroWriteBackLog() calls. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6356 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
e96943c121
commit
874dab37f8
|
@ -166,6 +166,7 @@ void DSPEmitter::sbclr(const UDSPInstruction opc)
|
|||
{
|
||||
u8 bit = (opc & 0x7) + 6;
|
||||
|
||||
zeroWriteBackLog(opc);
|
||||
clrCompileSR(1 << bit);
|
||||
}
|
||||
|
||||
|
@ -177,6 +178,7 @@ void DSPEmitter::sbset(const UDSPInstruction opc)
|
|||
{
|
||||
u8 bit = (opc & 0x7) + 6;
|
||||
|
||||
zeroWriteBackLog(opc);
|
||||
setCompileSR(1 << bit);
|
||||
}
|
||||
|
||||
|
|
|
@ -386,9 +386,9 @@ void DSPEmitter::ext_dmem_read(u16 addr)
|
|||
// return g_dsp.coef[addr & DSP_COEF_MASK];
|
||||
AND(16, R(ECX), Imm16(DSP_COEF_MASK));
|
||||
#ifdef _M_X64
|
||||
MOV(64, R(ESI), ImmPtr(g_dsp.dram));
|
||||
MOV(64, R(ESI), ImmPtr(g_dsp.coef));
|
||||
#else
|
||||
MOV(32, R(ESI), ImmPtr(g_dsp.dram));
|
||||
MOV(32, R(ESI), ImmPtr(g_dsp.coef));
|
||||
#endif
|
||||
MOV(16, R(EAX), MComplex(ESI,ECX,2,0));
|
||||
|
||||
|
|
|
@ -286,6 +286,27 @@ void nx_slnm()
|
|||
tester2.Report();
|
||||
}
|
||||
|
||||
void nx_ld()
|
||||
{
|
||||
DSPJitTester tester1(0x8000, 0x00c0);
|
||||
tester1.AddTestData(DSP_REG_AXL0,0xdead);
|
||||
tester1.AddTestData(DSP_REG_AXL1,0xbeef);
|
||||
tester1.AddTestData(DSP_REG_AR0);
|
||||
tester1.AddTestData(DSP_REG_WR0);
|
||||
tester1.AddTestData(DSP_REG_IX0);
|
||||
tester1.TestAll(true);
|
||||
tester1.Report();
|
||||
|
||||
DSPJitTester tester2(0x8000, 0x00c0);
|
||||
tester2.AddTestData(DSP_REG_AXL0,0xdead);
|
||||
tester2.AddTestData(DSP_REG_AXL1,0xbeef);
|
||||
tester2.AddTestData(DSP_REG_AR3);
|
||||
tester2.AddTestData(DSP_REG_WR3);
|
||||
tester2.AddTestData(DSP_REG_IX3);
|
||||
tester2.TestAll(true);
|
||||
tester2.Report();
|
||||
}
|
||||
|
||||
void AudioJitTests()
|
||||
{
|
||||
DSPJitTester::Initialize();
|
||||
|
@ -315,6 +336,7 @@ void AudioJitTests()
|
|||
nx_sln();
|
||||
nx_slm();
|
||||
nx_slnm();
|
||||
nx_ld();
|
||||
}
|
||||
|
||||
//required to be able to link against DSPCore
|
||||
|
|
|
@ -168,10 +168,13 @@ int DSPJitTester::TestAll(bool verbose_fail)
|
|||
dsp.dram = (u16*)AllocateMemoryPages(DSP_DRAM_BYTE_SIZE);
|
||||
dsp.coef = (u16*)AllocateMemoryPages(DSP_COEF_BYTE_SIZE);
|
||||
|
||||
// Fill roms with zeros.
|
||||
memset(dsp.irom, 0, DSP_IROM_BYTE_SIZE);
|
||||
memset(dsp.coef, 0, DSP_COEF_BYTE_SIZE);
|
||||
memset(dsp.dram, 0, DSP_DRAM_BYTE_SIZE);
|
||||
// Fill roms with distinct patterns.
|
||||
for (int i = 0; i < DSP_IROM_SIZE; i++)
|
||||
dsp.irom[i] = (i & 0x3fff) | 0x4000;
|
||||
for (int i = 0; i < DSP_COEF_SIZE; i++)
|
||||
dsp.coef[i] = (i & 0x3fff) | 0x8000;
|
||||
for (int i = 0; i < DSP_DRAM_SIZE; i++)
|
||||
dsp.dram[i] = (i & 0x3fff) | 0xc000;
|
||||
// Fill IRAM with HALT opcodes.
|
||||
for (int i = 0; i < DSP_IRAM_SIZE; i++)
|
||||
dsp.iram[i] = 0x0021; // HALT opcode
|
||||
|
|
Loading…
Reference in New Issue