mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Merge pull request #2298 from aliaspider/master
(3DS) dsp audio driver update.
This commit is contained in:
commit
5b8ee67af5
@ -42,6 +42,8 @@ ifeq ($(GRIFFIN_BUILD), 1)
|
|||||||
else
|
else
|
||||||
OBJS += libretro-common/file/file_extract.o
|
OBJS += libretro-common/file/file_extract.o
|
||||||
OBJS += performance.o
|
OBJS += performance.o
|
||||||
|
OBJS += libretro-common/compat/compat_getopt.o
|
||||||
|
OBJS += libretro-common/compat/compat_strcasestr.o
|
||||||
OBJS += libretro-common/compat/compat_strl.o
|
OBJS += libretro-common/compat/compat_strl.o
|
||||||
OBJS += libretro-common/compat/compat_fnmatch.o
|
OBJS += libretro-common/compat/compat_fnmatch.o
|
||||||
OBJS += libretro-common/memmap/memalign.o
|
OBJS += libretro-common/memmap/memalign.o
|
||||||
@ -88,7 +90,7 @@ else
|
|||||||
OBJS += camera/drivers/nullcamera.o
|
OBJS += camera/drivers/nullcamera.o
|
||||||
OBJS += location/drivers/nulllocation.o
|
OBJS += location/drivers/nulllocation.o
|
||||||
OBJS += audio/drivers/ctr_csnd_audio.o
|
OBJS += audio/drivers/ctr_csnd_audio.o
|
||||||
OBJS += audio/drivers/ctr_dsp_audio.o
|
OBJS += audio/drivers/ctr_dsp_audio.o
|
||||||
OBJS += audio/drivers/nullaudio.o
|
OBJS += audio/drivers/nullaudio.o
|
||||||
OBJS += gfx/video_driver.o
|
OBJS += gfx/video_driver.o
|
||||||
OBJS += gfx/video_common.o
|
OBJS += gfx/video_common.o
|
||||||
@ -135,6 +137,7 @@ else
|
|||||||
OBJS += libretro-common/file/retro_file.o
|
OBJS += libretro-common/file/retro_file.o
|
||||||
OBJS += libretro-common/file/retro_stat.o
|
OBJS += libretro-common/file/retro_stat.o
|
||||||
OBJS += dir_list_special.o
|
OBJS += dir_list_special.o
|
||||||
|
OBJS += string_list_special.o
|
||||||
OBJS += libretro-common/string/string_list.o
|
OBJS += libretro-common/string/string_list.o
|
||||||
OBJS += libretro-common/string/stdstring.o
|
OBJS += libretro-common/string/stdstring.o
|
||||||
OBJS += file_ops.o
|
OBJS += file_ops.o
|
||||||
|
@ -46,6 +46,8 @@ void dump_result_value(Result val);
|
|||||||
#define DEBUG_VAR(X) printf( "%-20s: 0x%08X\n", #X, (u32)(X))
|
#define DEBUG_VAR(X) printf( "%-20s: 0x%08X\n", #X, (u32)(X))
|
||||||
#define DEBUG_VAR64(X) printf( #X"\r\t\t\t\t : 0x%016llX\n", (u64)(X))
|
#define DEBUG_VAR64(X) printf( #X"\r\t\t\t\t : 0x%016llX\n", (u64)(X))
|
||||||
#define DEBUG_ERROR(X) do{if(X)dump_result_value(X)}while(0)
|
#define DEBUG_ERROR(X) do{if(X)dump_result_value(X)}while(0)
|
||||||
|
#define PRINTFPOS(X,Y) "\x1b["#X";"#Y"H"
|
||||||
|
#define PRINTFPOS_STR(X,Y) "\x1b["X";"Y"H"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CTR_APPMEMALLOC_PTR ((u32*)0x1FF80040)
|
#define CTR_APPMEMALLOC_PTR ((u32*)0x1FF80040)
|
||||||
@ -238,8 +240,55 @@ static void frontend_ctr_shutdown(bool unused)
|
|||||||
(void)unused;
|
(void)unused;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PRINTFPOS(X,Y) "\x1b["#X";"#Y"H"
|
static void ctr_check_dspfirm(void)
|
||||||
#define PRINTFPOS_STR(X,Y) "\x1b["X";"Y"H"
|
{
|
||||||
|
FILE* dsp_fp = fopen("sdmc:/3ds/dspfirm.cdc", "rb");
|
||||||
|
|
||||||
|
if(dsp_fp)
|
||||||
|
fclose(dsp_fp);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
uint32_t* code_buffer;
|
||||||
|
uint32_t* ptr;
|
||||||
|
FILE* code_fp;
|
||||||
|
size_t code_size;
|
||||||
|
const uint32_t dsp1_magic = 0x31505344; /* "DSP1" */
|
||||||
|
|
||||||
|
code_fp =fopen("sdmc:/3ds/code.bin", "rb");
|
||||||
|
if(code_fp)
|
||||||
|
{
|
||||||
|
fseek(code_fp, 0, SEEK_END);
|
||||||
|
code_size = ftell(code_fp);
|
||||||
|
fseek(code_fp, 0, SEEK_SET);
|
||||||
|
|
||||||
|
code_buffer = (uint32_t*) malloc(code_size);
|
||||||
|
if(code_buffer)
|
||||||
|
{
|
||||||
|
fread(code_buffer, 1, code_size, code_fp);
|
||||||
|
|
||||||
|
for (ptr = code_buffer + 0x40; ptr < (code_buffer + (code_size >> 2)); ptr++)
|
||||||
|
{
|
||||||
|
if (*ptr == dsp1_magic)
|
||||||
|
{
|
||||||
|
size_t dspfirm_size = ptr[1];
|
||||||
|
ptr -= 0x40;
|
||||||
|
if ((ptr + (dspfirm_size >> 2)) > (code_buffer + (code_size >> 2)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
dsp_fp = fopen("sdmc:/3ds/dspfirm.cdc", "wb");
|
||||||
|
if(!dsp_fp)
|
||||||
|
break;
|
||||||
|
fwrite(ptr, 1, dspfirm_size, dsp_fp);
|
||||||
|
fclose(dsp_fp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(code_buffer);
|
||||||
|
}
|
||||||
|
fclose(code_fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void frontend_ctr_init(void *data)
|
static void frontend_ctr_init(void *data)
|
||||||
{
|
{
|
||||||
@ -262,6 +311,7 @@ static void frontend_ctr_init(void *data)
|
|||||||
audio_ctr_csnd = audio_ctr_dsp;
|
audio_ctr_csnd = audio_ctr_dsp;
|
||||||
audio_ctr_dsp = audio_null;
|
audio_ctr_dsp = audio_null;
|
||||||
}
|
}
|
||||||
|
ctr_check_dspfirm();
|
||||||
if(ndspInit() != 0)
|
if(ndspInit() != 0)
|
||||||
*dsp_audio_driver = audio_null;
|
*dsp_audio_driver = audio_null;
|
||||||
initCfgu();
|
initCfgu();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user