diff --git a/Data/Sys/GC/dsp_coef.bin b/Data/Sys/GC/dsp_coef.bin index a276f2cede..1137fd741e 100644 Binary files a/Data/Sys/GC/dsp_coef.bin and b/Data/Sys/GC/dsp_coef.bin differ diff --git a/Source/Core/Core/DSP/DSPCore.cpp b/Source/Core/Core/DSP/DSPCore.cpp index 54262ede66..bfe7c64b6c 100644 --- a/Source/Core/Core/DSP/DSPCore.cpp +++ b/Source/Core/Core/DSP/DSPCore.cpp @@ -42,7 +42,10 @@ static bool VerifyRoms() // delroth's improvement on LM1234 replacement ROM (Zelda and AX only, // IPL/Card/GBA still broken) - { 0xd9907f71, 0xb019c2fb } + { 0xd9907f71, 0xb019c2fb }, + + // above with improved resampling coefficients + { 0xd9907f71, 0xdb6880c1 } }; u32 hash_irom = HashAdler32((u8*)g_dsp.irom, DSP_IROM_BYTE_SIZE); @@ -69,7 +72,7 @@ static bool VerifyRoms() DSPHost::OSD_AddMessage("You are using an old free DSP ROM made by the Dolphin Team.", 6000); DSPHost::OSD_AddMessage("Only games using the Zelda UCode will work correctly.", 6000); } - else if (rom_idx == 2) + else if (rom_idx == 2 || rom_idx == 3) { DSPHost::OSD_AddMessage("You are using a free DSP ROM made by the Dolphin Team.", 8000); DSPHost::OSD_AddMessage("All Wii games will work correctly, and most GC games should ", 8000); diff --git a/docs/DSP/free_dsp_rom/dsp_rom_readme.txt b/docs/DSP/free_dsp_rom/dsp_rom_readme.txt index bcaa2eee43..7dc073a80b 100644 --- a/docs/DSP/free_dsp_rom/dsp_rom_readme.txt +++ b/docs/DSP/free_dsp_rom/dsp_rom_readme.txt @@ -1,3 +1,16 @@ +Legal GC/WII DSP IROM replacement (v0.2.1) +------------------------------------------------------- + +- coef: 4-tap polyphase FIR filters +- irom: unchanged + +Coefficients are roughly equivalent to those in the official DROM. +Improves resampling quality greatly over linear interpolation. +See generate_coefs.py for details. + +stgn +29/june/2015 + Legal GC/WII DSP IROM replacement (v0.2) ------------------------------------------------------- diff --git a/docs/DSP/free_dsp_rom/generate_coefs.py b/docs/DSP/free_dsp_rom/generate_coefs.py new file mode 100644 index 0000000000..5b1771429d --- /dev/null +++ b/docs/DSP/free_dsp_rom/generate_coefs.py @@ -0,0 +1,25 @@ +from numpy import * +from struct import pack + +def pack_coefs(c): + cw = list(zip(c[ :128][::-1], + c[128:256][::-1], + c[256:384][::-1], + c[384: ][::-1])) + m = max(sum(x) for x in cw) + return b''.join(pack('>4h', *(int(round(n / m * 32767)) for n in x)) for x in cw) + +x = linspace(-2, 2, 512, endpoint=False) + +w1 = hamming(512) +w2 = kaiser(512, pi * 9/4) + +coef_1 = [sinc(n * 0.5) for n in x] * w1 +coef_2 = [sinc(n * 0.75) for n in x] * w2 +coef_3 = [sinc(n) for n in x] * w1 + +with open('dsp_coef.bin', 'wb') as f: + f.write(pack_coefs(coef_1)) + f.write(pack_coefs(coef_2)) + f.write(pack_coefs(coef_3)) + f.write(b'\0' * 1024)