diff --git a/Source/Core/DSPCore/Src/DSPHWInterface.cpp b/Source/Core/DSPCore/Src/DSPHWInterface.cpp index 315209ec20..13cf6edeb5 100644 --- a/Source/Core/DSPCore/Src/DSPHWInterface.cpp +++ b/Source/Core/DSPCore/Src/DSPHWInterface.cpp @@ -125,7 +125,7 @@ u16 gdsp_mbox_read_l(u8 mbx) } -void gdsp_ifx_write(u16 addr, u16 val) +void gdsp_ifx_write(u32 addr, u32 val) { switch (addr & 0xff) { diff --git a/Source/Core/DSPCore/Src/DSPHWInterface.h b/Source/Core/DSPCore/Src/DSPHWInterface.h index b848d467de..df83f61e4b 100644 --- a/Source/Core/DSPCore/Src/DSPHWInterface.h +++ b/Source/Core/DSPCore/Src/DSPHWInterface.h @@ -39,7 +39,7 @@ u16 gdsp_mbox_read_l(u8 mbx); void gdsp_ifx_init(); -void gdsp_ifx_write(u16 addr, u16 val); +void gdsp_ifx_write(u32 addr, u32 val); u16 gdsp_ifx_read(u16 addr); void gdsp_idma_in(u16 dsp_addr, u32 addr, u32 size); diff --git a/Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp b/Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp index 97ff4f19ed..8afabf507e 100644 --- a/Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp +++ b/Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp @@ -256,15 +256,16 @@ void DSPEmitter::ext_dmem_write(u32 dest, u32 src) MOVZX(32, 16, ECX, M(&g_dsp.r[src])); // u16 saddr = addr >> 12; - MOVZX(32, 16, ESI, R(EAX)); + MOV(32, R(ESI), R(EAX)); SHR(16, R(ESI), Imm8(12)); // if (saddr == 0) - CMP(16, R(ESI), Imm16(0)); + TEST(16, R(ESI), R(ESI)); FixupBranch ifx = J_CC(CC_NZ); // g_dsp.dram[addr & DSP_DRAM_MASK] = val; AND(16, R(EAX), Imm16(DSP_DRAM_MASK)); + SHL(16, R(EAX), Imm16(1)); // * sizeof(u16) #ifdef _M_X64 MOV(64, R(R11), Imm64((u64)g_dsp.dram)); ADD(64, R(EAX), R(R11)); @@ -287,14 +288,15 @@ void DSPEmitter::ext_dmem_read(u16 addr) MOVZX(32, 16, ECX, M(&addr)); // u16 saddr = addr >> 12; - MOVZX(32, 16, ESI, R(ECX)); + MOV(32, R(ESI), R(ECX)); SHR(16, R(ESI), Imm8(12)); // if (saddr == 0) - CMP(16, R(ESI), Imm16(0)); + TEST(16, R(ESI), R(ESI)); FixupBranch dram = J_CC(CC_NZ); // return g_dsp.dram[addr & DSP_DRAM_MASK]; AND(16, R(ECX), Imm16(DSP_DRAM_MASK)); + SHL(16, R(ECX), Imm16(1)); // * sizeof(u16) #ifdef _M_X64 MOV(64, R(R11), Imm64((u64)g_dsp.dram)); ADD(64, R(ECX), R(R11)); diff --git a/Source/UnitTests/AudioJitTests.cpp b/Source/UnitTests/AudioJitTests.cpp index d192bd82cd..cfabaeeb6c 100644 --- a/Source/UnitTests/AudioJitTests.cpp +++ b/Source/UnitTests/AudioJitTests.cpp @@ -77,6 +77,14 @@ void sbset() tester.Report(); } +void nx_s() +{ + DSPJitTester tester(0x8000, 0x0020); + tester.AddTestData(DSP_REG_AR0); + tester.AddTestData(DSP_REG_ACL0); + tester.TestAll(true); + tester.Report(); +} void AudioJitTests() { DSPJitTester::Initialize(); @@ -91,6 +99,7 @@ void AudioJitTests() nx_ir(); nx_dr(); nx_nr(); + nx_s(); } //required to be able to link against DSPCore