[ORBIS] Initial audio driver

This commit is contained in:
Francisco José García García 2018-12-31 00:37:08 +01:00
parent ea2ed2fb07
commit a1e455d197
5 changed files with 28 additions and 11 deletions

View File

@ -60,7 +60,7 @@ else
OBJ += input/drivers/ps4_input.o
OBJ += input/drivers_joypad/ps4_joypad.o
#OBJ += audio/drivers/psp_audio.o
OBJ += audio/drivers/psp_audio.o
#OBJ += frontend/drivers/platform_orbis.o
endif

View File

@ -119,7 +119,7 @@ static const audio_driver_t *audio_drivers[] = {
#ifdef EMSCRIPTEN
&audio_rwebaudio,
#endif
#if defined(PSP) || defined(VITA)
#if defined(PSP) || defined(VITA) || defined(ORBIS)
&audio_psp,
#endif
#ifdef _3DS

View File

@ -16,21 +16,28 @@
*/
#include <stdint.h>
#if defined(VITA) || defined(PSP)
#include <malloc.h>
#endif
#include <stdio.h>
#include <string.h>
#include <rthreads/rthreads.h>
#include <queues/fifo_queue.h>
#ifdef VITA
#if defined(VITA)
#include <psp2/kernel/processmgr.h>
#include <psp2/kernel/threadmgr.h>
#include <psp2/kernel/sysmem.h>
#include <psp2/audioout.h>
#else
#elif defined(PSP)
#include <pspkernel.h>
#include <pspaudio.h>
#elif defined(ORBIS)
#include <audioout.h>
#define SCE_AUDIO_OUT_PORT_TYPE_MAIN 0
#define SCE_AUDIO_OUT_MODE_STEREO 1
#define SceUID uint32_t
#endif
#include "../audio_driver.h"
@ -64,10 +71,14 @@ static void audioMainLoop(void *data)
{
psp_audio_t* psp = (psp_audio_t*)data;
#ifdef VITA
#if defined(VITA)
int port = sceAudioOutOpenPort(
SCE_AUDIO_OUT_PORT_TYPE_MAIN, AUDIO_OUT_COUNT,
psp->rate, SCE_AUDIO_OUT_MODE_STEREO);
#elif defined(ORBIS)
int port = sceAudioOutOpen(0xff,
SCE_AUDIO_OUT_PORT_TYPE_MAIN, 0, AUDIO_OUT_COUNT,
psp->rate, SCE_AUDIO_OUT_MODE_STEREO);
#else
sceAudioSRCChReserve(AUDIO_OUT_COUNT, psp->rate, 2);
#endif
@ -95,7 +106,7 @@ static void audioMainLoop(void *data)
scond_signal(psp->cond);
slock_unlock(psp->cond_lock);
#ifdef VITA
#if defined(VITA) || defined(ORBIS)
sceAudioOutOutput(port,
cond ? (psp->zeroBuffer)
: (psp->buffer + read_pos_2));
@ -105,8 +116,10 @@ static void audioMainLoop(void *data)
#endif
}
#ifdef VITA
#if defined(VITA)
sceAudioOutReleasePort(port);
#elif defined(ORBIS)
sceAudioOutClose(port);
#else
sceAudioSRCChRelease();
#endif
@ -304,8 +317,10 @@ audio_driver_t audio_psp = {
psp_audio_set_nonblock_state,
psp_audio_free,
psp_audio_use_float,
#ifdef VITA
#if defined(VITA)
"vita",
#elif defined(ORBIS)
"orbis",
#else
"psp",
#endif

View File

@ -361,7 +361,7 @@ static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_XENON360;
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WII;
#elif defined(WIIU)
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_WIIU;
#elif defined(PSP) || defined(VITA)
#elif defined(PSP) || defined(VITA) || defined(ORBIS)
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PSP;
#elif defined(PS2)
static enum audio_driver_enum AUDIO_DEFAULT_DRIVER = AUDIO_PS2;
@ -679,8 +679,10 @@ const char *config_get_default_audio(void)
case AUDIO_WIIU:
return "AX";
case AUDIO_PSP:
#ifdef VITA
#if defined(VITA)
return "vita";
#elif defined(ORBIS)
return "orbis";
#else
return "psp";
#endif

View File

@ -770,7 +770,7 @@ AUDIO
#include "../audio/drivers/wiiu_audio.c"
#elif defined(EMSCRIPTEN)
#include "../audio/drivers/rwebaudio.c"
#elif defined(PSP) || defined(VITA)
#elif defined(PSP) || defined(VITA) || defined(ORBIS)
#include "../audio/drivers/psp_audio.c"
#elif defined(PS2)
// #include "../audio/drivers/ps2_audio.c"