2012-11-01 15:19:01 +00:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
2012-11-04 22:01:49 +00:00
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
// SAS is a software mixing engine that runs on the Media Engine CPU. We just HLE it.
|
|
|
|
// This is a very rough implementation that needs lots of work.
|
|
|
|
//
|
2012-12-17 17:05:10 +00:00
|
|
|
// This file just contains the API, the real stuff is in HW/SasAudio.cpp/h.
|
|
|
|
//
|
2012-11-01 15:19:01 +00:00
|
|
|
// JPCSP is, as it often is, a pretty good reference although I didn't actually use it much yet:
|
|
|
|
// http://code.google.com/p/jpcsp/source/browse/trunk/src/jpcsp/HLE/modules150/sceSasCore.java
|
2013-11-09 01:05:28 +00:00
|
|
|
//
|
|
|
|
// This should be multithreaded and improved at some point. Some discussion here:
|
|
|
|
// https://github.com/hrydgard/ppsspp/issues/1078
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2013-05-28 00:05:13 +00:00
|
|
|
#include <cstdlib>
|
2016-10-12 09:32:24 +00:00
|
|
|
#include <functional>
|
2017-02-27 19:51:36 +00:00
|
|
|
#include <thread>
|
2017-02-27 20:57:46 +00:00
|
|
|
#include <mutex>
|
2017-12-20 09:22:15 +00:00
|
|
|
#include <condition_variable>
|
2016-10-12 09:32:24 +00:00
|
|
|
|
2020-10-04 08:04:01 +00:00
|
|
|
#include "Common/Profiler/Profiler.h"
|
2020-10-01 07:27:25 +00:00
|
|
|
#include "Common/Thread/ThreadUtil.h"
|
2020-08-10 07:12:51 +00:00
|
|
|
#include "Common/Serialize/SerializeFuncs.h"
|
2014-02-19 07:12:26 +00:00
|
|
|
#include "Common/Log.h"
|
2015-11-15 19:03:16 +00:00
|
|
|
#include "Core/Config.h"
|
2015-11-26 02:43:35 +00:00
|
|
|
#include "Core/CoreTiming.h"
|
2014-02-19 07:12:26 +00:00
|
|
|
#include "Core/HLE/HLE.h"
|
2014-03-15 18:22:19 +00:00
|
|
|
#include "Core/HLE/FunctionWrappers.h"
|
2014-02-19 07:12:26 +00:00
|
|
|
#include "Core/MIPS/MIPS.h"
|
|
|
|
#include "Core/HW/SasAudio.h"
|
2014-03-15 18:22:19 +00:00
|
|
|
#include "Core/MemMap.h"
|
2013-03-02 07:14:00 +00:00
|
|
|
#include "Core/Reporting.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2014-02-19 07:12:26 +00:00
|
|
|
#include "Core/HLE/sceSas.h"
|
|
|
|
#include "Core/HLE/sceKernel.h"
|
2015-11-26 02:38:10 +00:00
|
|
|
#include "Core/HLE/sceKernelThread.h"
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2012-12-17 17:05:10 +00:00
|
|
|
enum {
|
2014-03-03 16:16:53 +00:00
|
|
|
ERROR_SAS_INVALID_GRAIN = 0x80420001,
|
|
|
|
ERROR_SAS_INVALID_MAX_VOICES = 0x80420002,
|
|
|
|
ERROR_SAS_INVALID_OUTPUT_MODE = 0x80420003,
|
|
|
|
ERROR_SAS_INVALID_SAMPLE_RATE = 0x80420004,
|
|
|
|
ERROR_SAS_BAD_ADDRESS = 0x80420005,
|
|
|
|
ERROR_SAS_INVALID_VOICE = 0x80420010,
|
|
|
|
ERROR_SAS_INVALID_NOISE_FREQ = 0x80420011,
|
|
|
|
ERROR_SAS_INVALID_PITCH = 0x80420012,
|
2012-12-17 17:05:10 +00:00
|
|
|
ERROR_SAS_INVALID_ADSR_CURVE_MODE = 0x80420013,
|
2014-03-03 16:16:53 +00:00
|
|
|
ERROR_SAS_INVALID_PARAMETER = 0x80420014,
|
|
|
|
ERROR_SAS_INVALID_LOOP_POS = 0x80420015,
|
|
|
|
ERROR_SAS_VOICE_PAUSED = 0x80420016,
|
|
|
|
ERROR_SAS_INVALID_VOLUME = 0x80420018,
|
|
|
|
ERROR_SAS_INVALID_ADSR_RATE = 0x80420019,
|
|
|
|
ERROR_SAS_INVALID_PCM_SIZE = 0x8042001A,
|
2015-10-31 16:20:14 +00:00
|
|
|
ERROR_SAS_REV_INVALID_TYPE = 0x80420020,
|
|
|
|
ERROR_SAS_REV_INVALID_FEEDBACK = 0x80420021,
|
|
|
|
ERROR_SAS_REV_INVALID_DELAY = 0x80420022,
|
2014-03-03 16:16:53 +00:00
|
|
|
ERROR_SAS_REV_INVALID_VOLUME = 0x80420023,
|
|
|
|
ERROR_SAS_BUSY = 0x80420030,
|
2015-11-09 16:24:46 +00:00
|
|
|
ERROR_SAS_ATRAC3_ALREADY_SET = 0x80420040,
|
|
|
|
ERROR_SAS_ATRAC3_NOT_SET = 0x80420041,
|
2014-03-03 16:16:53 +00:00
|
|
|
ERROR_SAS_NOT_INIT = 0x80420100,
|
2012-12-17 17:05:10 +00:00
|
|
|
};
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
// TODO - allow more than one, associating each with one Core pointer (passed in to all the functions)
|
|
|
|
// No known games use more than one instance of Sas though.
|
2013-02-04 16:24:32 +00:00
|
|
|
static SasInstance *sas = NULL;
|
2012-12-17 20:43:31 +00:00
|
|
|
|
2013-07-10 05:13:40 +00:00
|
|
|
enum SasThreadState {
|
|
|
|
DISABLED,
|
|
|
|
READY,
|
|
|
|
QUEUED,
|
|
|
|
};
|
|
|
|
struct SasThreadParams {
|
|
|
|
u32 outAddr;
|
|
|
|
u32 inAddr;
|
|
|
|
int leftVol;
|
|
|
|
int rightVol;
|
|
|
|
};
|
|
|
|
|
|
|
|
static std::thread *sasThread;
|
2017-02-27 20:57:46 +00:00
|
|
|
static std::mutex sasWakeMutex;
|
|
|
|
static std::mutex sasDoneMutex;
|
|
|
|
static std::condition_variable sasWake;
|
|
|
|
static std::condition_variable sasDone;
|
2013-07-10 05:13:40 +00:00
|
|
|
static volatile int sasThreadState = SasThreadState::DISABLED;
|
|
|
|
static SasThreadParams sasThreadParams;
|
2015-11-26 02:43:35 +00:00
|
|
|
static int sasMixEvent = -1;
|
2013-07-10 05:13:40 +00:00
|
|
|
|
|
|
|
int __SasThread() {
|
2020-11-30 23:46:26 +00:00
|
|
|
SetCurrentThreadName("SAS");
|
2013-07-10 05:13:40 +00:00
|
|
|
|
2017-02-27 20:57:46 +00:00
|
|
|
std::unique_lock<std::mutex> guard(sasWakeMutex);
|
2013-07-10 05:13:40 +00:00
|
|
|
while (sasThreadState != SasThreadState::DISABLED) {
|
2017-02-27 20:57:46 +00:00
|
|
|
sasWake.wait(guard);
|
2013-07-10 05:13:40 +00:00
|
|
|
if (sasThreadState == SasThreadState::QUEUED) {
|
|
|
|
sas->Mix(sasThreadParams.outAddr, sasThreadParams.inAddr, sasThreadParams.leftVol, sasThreadParams.rightVol);
|
|
|
|
|
2021-02-07 02:37:05 +00:00
|
|
|
std::lock_guard<std::mutex> doneGuard(sasDoneMutex);
|
2013-07-10 05:13:40 +00:00
|
|
|
sasThreadState = SasThreadState::READY;
|
|
|
|
sasDone.notify_one();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
static void __SasDrain() {
|
2017-02-27 20:57:46 +00:00
|
|
|
std::unique_lock<std::mutex> guard(sasDoneMutex);
|
2015-11-15 19:24:09 +00:00
|
|
|
while (sasThreadState == SasThreadState::QUEUED)
|
2017-02-27 20:57:46 +00:00
|
|
|
sasDone.wait(guard);
|
2015-11-15 19:24:09 +00:00
|
|
|
}
|
|
|
|
|
2013-07-10 05:13:40 +00:00
|
|
|
static void __SasEnqueueMix(u32 outAddr, u32 inAddr = 0, int leftVol = 0, int rightVol = 0) {
|
|
|
|
if (sasThreadState == SasThreadState::DISABLED) {
|
|
|
|
// No thread, call it immediately.
|
|
|
|
sas->Mix(outAddr, inAddr, leftVol, rightVol);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sasThreadState == SasThreadState::QUEUED) {
|
|
|
|
// Wait for the queue to drain.
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2013-07-10 05:13:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// We're safe to write, since it can't be processing now anymore.
|
|
|
|
// No other thread enqueues.
|
|
|
|
sasThreadParams.outAddr = outAddr;
|
|
|
|
sasThreadParams.inAddr = inAddr;
|
|
|
|
sasThreadParams.leftVol = leftVol;
|
|
|
|
sasThreadParams.rightVol = rightVol;
|
|
|
|
|
|
|
|
// And now, notify.
|
|
|
|
sasWakeMutex.lock();
|
|
|
|
sasThreadState = SasThreadState::QUEUED;
|
|
|
|
sasWake.notify_one();
|
|
|
|
sasWakeMutex.unlock();
|
|
|
|
}
|
|
|
|
|
2015-11-26 02:43:35 +00:00
|
|
|
static void __SasDisableThread() {
|
|
|
|
if (sasThreadState != SasThreadState::DISABLED) {
|
|
|
|
sasWakeMutex.lock();
|
|
|
|
sasThreadState = SasThreadState::DISABLED;
|
|
|
|
sasWake.notify_one();
|
|
|
|
sasWakeMutex.unlock();
|
|
|
|
sasThread->join();
|
|
|
|
delete sasThread;
|
|
|
|
sasThread = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sasMixFinish(u64 userdata, int cycleslate) {
|
|
|
|
PROFILE_THIS_SCOPE("mixer");
|
|
|
|
|
|
|
|
u32 error;
|
|
|
|
SceUID threadID = (SceUID)userdata;
|
|
|
|
SceUID verify = __KernelGetWaitID(threadID, WAITTYPE_HLEDELAY, error);
|
|
|
|
u64 result = __KernelGetWaitValue(threadID, error);
|
|
|
|
|
|
|
|
if (error == 0 && verify == 1) {
|
|
|
|
// Wait until it's actually complete before waking the thread.
|
|
|
|
__SasDrain();
|
|
|
|
|
|
|
|
__KernelResumeThreadFromWait(threadID, result);
|
|
|
|
__KernelReSchedule("woke from sas mix");
|
|
|
|
} else {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::HLE, "Someone else woke up SAS-blocked thread?");
|
2015-11-26 02:43:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-17 20:43:31 +00:00
|
|
|
void __SasInit() {
|
|
|
|
sas = new SasInstance();
|
2013-07-10 05:13:40 +00:00
|
|
|
|
2015-11-26 02:43:35 +00:00
|
|
|
sasMixEvent = CoreTiming::RegisterEvent("SasMix", sasMixFinish);
|
|
|
|
|
2015-11-15 19:03:16 +00:00
|
|
|
if (g_Config.bSeparateSASThread) {
|
|
|
|
sasThreadState = SasThreadState::READY;
|
|
|
|
sasThread = new std::thread(__SasThread);
|
|
|
|
} else {
|
|
|
|
sasThreadState = SasThreadState::DISABLED;
|
|
|
|
}
|
2012-12-17 20:43:31 +00:00
|
|
|
}
|
|
|
|
|
2012-12-28 08:05:54 +00:00
|
|
|
void __SasDoState(PointerWrap &p) {
|
2015-11-26 02:43:35 +00:00
|
|
|
auto s = p.Section("sceSas", 1, 2);
|
2013-09-15 03:23:03 +00:00
|
|
|
if (!s)
|
|
|
|
return;
|
|
|
|
|
2015-11-15 19:02:57 +00:00
|
|
|
if (sasThreadState == SasThreadState::QUEUED) {
|
|
|
|
// Wait for the queue to drain. Don't want to save the wrong stuff.
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2015-11-15 19:02:57 +00:00
|
|
|
}
|
|
|
|
|
2020-08-10 04:20:42 +00:00
|
|
|
DoClass(p, sas);
|
2015-11-26 02:43:35 +00:00
|
|
|
|
|
|
|
if (s >= 2) {
|
2020-08-10 04:20:42 +00:00
|
|
|
Do(p, sasMixEvent);
|
2015-11-26 02:43:35 +00:00
|
|
|
} else {
|
|
|
|
sasMixEvent = -1;
|
|
|
|
__SasDisableThread();
|
|
|
|
}
|
2016-01-31 05:38:38 +00:00
|
|
|
|
2020-12-28 21:29:19 +00:00
|
|
|
CoreTiming::RestoreRegisterEvent(sasMixEvent, "SasMix", sasMixFinish);
|
2012-12-28 08:05:54 +00:00
|
|
|
}
|
|
|
|
|
2012-12-17 20:43:31 +00:00
|
|
|
void __SasShutdown() {
|
2015-11-26 02:43:35 +00:00
|
|
|
__SasDisableThread();
|
2013-07-10 05:13:40 +00:00
|
|
|
|
2012-12-17 20:43:31 +00:00
|
|
|
delete sas;
|
|
|
|
sas = 0;
|
|
|
|
}
|
2012-11-01 15:19:01 +00:00
|
|
|
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasInit(u32 core, u32 grainSize, u32 maxVoices, u32 outputMode, u32 sampleRate) {
|
2013-06-10 03:32:01 +00:00
|
|
|
if (!Memory::IsValidAddress(core) || (core & 0x3F) != 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "sceSasInit(%08x, %i, %i, %i, %i): bad core address", core, grainSize, maxVoices, outputMode, sampleRate);
|
2013-06-10 03:32:01 +00:00
|
|
|
return ERROR_SAS_BAD_ADDRESS;
|
|
|
|
}
|
2013-06-11 07:31:29 +00:00
|
|
|
if (maxVoices == 0 || maxVoices > PSP_SAS_VOICES_MAX) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "sceSasInit(%08x, %i, %i, %i, %i): bad max voices", core, grainSize, maxVoices, outputMode, sampleRate);
|
2013-06-10 03:32:01 +00:00
|
|
|
return ERROR_SAS_INVALID_MAX_VOICES;
|
|
|
|
}
|
|
|
|
if (grainSize < 0x40 || grainSize > 0x800 || (grainSize & 0x1F) != 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "sceSasInit(%08x, %i, %i, %i, %i): bad grain size", core, grainSize, maxVoices, outputMode, sampleRate);
|
2013-06-10 03:32:01 +00:00
|
|
|
return ERROR_SAS_INVALID_GRAIN;
|
|
|
|
}
|
|
|
|
if (outputMode != 0 && outputMode != 1) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "sceSasInit(%08x, %i, %i, %i, %i): bad output mode", core, grainSize, maxVoices, outputMode, sampleRate);
|
2013-06-10 03:32:01 +00:00
|
|
|
return ERROR_SAS_INVALID_OUTPUT_MODE;
|
|
|
|
}
|
2013-09-01 23:59:37 +00:00
|
|
|
if (sampleRate != 44100) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "sceSasInit(%08x, %i, %i, %i, %i): bad sample rate", core, grainSize, maxVoices, outputMode, sampleRate);
|
2013-09-01 23:59:37 +00:00
|
|
|
return ERROR_SAS_INVALID_SAMPLE_RATE;
|
|
|
|
}
|
2024-07-14 12:42:59 +00:00
|
|
|
INFO_LOG(Log::sceSas, "sceSasInit(%08x, %i, %i, %i, %i)", core, grainSize, maxVoices, outputMode, sampleRate);
|
2013-02-17 01:45:20 +00:00
|
|
|
|
2012-12-17 20:43:31 +00:00
|
|
|
sas->SetGrainSize(grainSize);
|
2014-02-03 07:39:55 +00:00
|
|
|
// Seems like maxVoices is actually ignored for all intents and purposes.
|
2013-06-11 07:31:29 +00:00
|
|
|
sas->maxVoices = PSP_SAS_VOICES_MAX;
|
2012-12-17 20:43:31 +00:00
|
|
|
sas->outputMode = outputMode;
|
2013-01-31 06:51:57 +00:00
|
|
|
for (int i = 0; i < sas->maxVoices; i++) {
|
|
|
|
sas->voices[i].sampleRate = sampleRate;
|
2012-12-17 20:43:31 +00:00
|
|
|
sas->voices[i].playing = false;
|
2013-05-27 23:41:17 +00:00
|
|
|
sas->voices[i].loop = false;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasGetEndFlag(u32 core) {
|
2012-11-01 15:19:01 +00:00
|
|
|
u32 endFlag = 0;
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
for (int i = 0; i < sas->maxVoices; i++) {
|
|
|
|
if (!sas->voices[i].playing)
|
2013-01-23 06:50:36 +00:00
|
|
|
endFlag |= (1 << i);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
2013-02-17 01:45:20 +00:00
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
VERBOSE_LOG(Log::sceSas, "%08x=sceSasGetEndFlag(%08x)", endFlag, core);
|
2012-11-01 15:19:01 +00:00
|
|
|
return endFlag;
|
|
|
|
}
|
|
|
|
|
2015-11-26 02:38:10 +00:00
|
|
|
static int delaySasResult(int result) {
|
|
|
|
const int usec = sas->EstimateMixUs();
|
2015-11-26 02:43:35 +00:00
|
|
|
|
|
|
|
// No event, fall back.
|
|
|
|
if (sasMixEvent == -1) {
|
|
|
|
return hleDelayResult(result, "sas core", usec);
|
|
|
|
}
|
|
|
|
|
|
|
|
CoreTiming::ScheduleEvent(usToCycles(usec), sasMixEvent, __KernelGetCurThread());
|
|
|
|
__KernelWaitCurThread(WAITTYPE_HLEDELAY, 1, result, 0, false, "sas core");
|
|
|
|
return result;
|
2015-11-26 02:38:10 +00:00
|
|
|
}
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
// Runs the mixer
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 _sceSasCore(u32 core, u32 outAddr) {
|
2013-07-10 05:13:40 +00:00
|
|
|
PROFILE_THIS_SCOPE("mixer");
|
|
|
|
|
2012-12-17 17:05:10 +00:00
|
|
|
if (!Memory::IsValidAddress(outAddr)) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleReportError(Log::sceSas, ERROR_SAS_INVALID_PARAMETER, "invalid address");
|
2012-12-17 17:05:10 +00:00
|
|
|
}
|
2015-11-26 02:38:10 +00:00
|
|
|
if (!__KernelIsDispatchEnabled()) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, SCE_KERNEL_ERROR_CAN_NOT_WAIT, "dispatch disabled");
|
2015-11-26 02:38:10 +00:00
|
|
|
}
|
2013-02-17 01:45:20 +00:00
|
|
|
|
2013-07-10 05:13:40 +00:00
|
|
|
__SasEnqueueMix(outAddr);
|
2014-02-22 16:48:21 +00:00
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogSuccessVerboseI(Log::sceSas, delaySasResult(0));
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2013-04-23 14:00:14 +00:00
|
|
|
// Another way of running the mixer, the inoutAddr should be both input and output
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 _sceSasCoreWithMix(u32 core, u32 inoutAddr, int leftVolume, int rightVolume) {
|
2013-07-10 05:13:40 +00:00
|
|
|
PROFILE_THIS_SCOPE("mixer");
|
|
|
|
|
2013-04-23 14:00:14 +00:00
|
|
|
if (!Memory::IsValidAddress(inoutAddr)) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleReportError(Log::sceSas, ERROR_SAS_INVALID_PARAMETER, "invalid address");
|
2012-12-17 17:05:10 +00:00
|
|
|
}
|
2014-02-22 16:48:21 +00:00
|
|
|
if (sas->outputMode == PSP_SAS_OUTPUTMODE_RAW) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleReportError(Log::sceSas, 0x80000004, "unsupported outputMode");
|
2014-02-22 16:48:21 +00:00
|
|
|
}
|
2015-11-26 02:38:10 +00:00
|
|
|
if (!__KernelIsDispatchEnabled()) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, SCE_KERNEL_ERROR_CAN_NOT_WAIT, "dispatch disabled");
|
2015-11-26 02:38:10 +00:00
|
|
|
}
|
2013-07-10 05:13:40 +00:00
|
|
|
|
|
|
|
__SasEnqueueMix(inoutAddr, inoutAddr, leftVolume, rightVolume);
|
2014-02-22 16:48:21 +00:00
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogSuccessVerboseI(Log::sceSas, delaySasResult(0));
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetVoice(u32 core, int voiceNum, u32 vagAddr, int size, int loop) {
|
2013-01-23 06:50:36 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogVerbose(Log::sceSas, ERROR_SAS_INVALID_VOICE, "invalid voicenum");
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
|
|
|
|
2014-02-19 07:12:26 +00:00
|
|
|
if (size == 0 || ((u32)size & 0xF) != 0) {
|
2013-06-16 22:24:39 +00:00
|
|
|
if (size == 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "%s: invalid size %d", __FUNCTION__, size);
|
2013-06-16 22:24:39 +00:00
|
|
|
} else {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid size %d", __FUNCTION__, size);
|
2013-06-16 22:24:39 +00:00
|
|
|
}
|
2014-02-19 07:12:26 +00:00
|
|
|
return ERROR_SAS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
if (loop != 0 && loop != 1) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG_REPORT(Log::sceSas, "%s: invalid loop mode %d", __FUNCTION__, loop);
|
2014-02-19 07:12:26 +00:00
|
|
|
return ERROR_SAS_INVALID_LOOP_POS;
|
2013-01-23 06:50:36 +00:00
|
|
|
}
|
|
|
|
|
2013-05-27 19:19:19 +00:00
|
|
|
if (!Memory::IsValidAddress(vagAddr)) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG(Log::sceSas, "%s: Ignoring invalid VAG audio address %08x", __FUNCTION__, vagAddr);
|
2013-05-27 19:19:19 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2015-11-09 16:24:46 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
|
|
|
if (v.type == VOICETYPE_ATRAC3) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, ERROR_SAS_ATRAC3_ALREADY_SET, "voice is already ATRAC3");
|
2015-11-09 16:24:46 +00:00
|
|
|
}
|
|
|
|
|
2014-03-19 10:15:01 +00:00
|
|
|
if (size < 0) {
|
|
|
|
// POSSIBLE HACK
|
|
|
|
// SetVoice with negative sizes returns OK (0) unlike SetVoicePCM, but should not
|
|
|
|
// play any audio, it seems. So let's bail and not do anything.
|
|
|
|
// Needs more rigorous testing perhaps, but this fixes issue https://github.com/hrydgard/ppsspp/issues/5652
|
|
|
|
// while being fairly low risk to other games.
|
|
|
|
size = 0;
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetVoice(%08x, %i, %08x, %i, %i) : HACK: Negative size changed to 0", core, voiceNum, vagAddr, size, loop);
|
2014-03-19 14:34:38 +00:00
|
|
|
} else {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetVoice(%08x, %i, %08x, %i, %i)", core, voiceNum, vagAddr, size, loop);
|
2014-03-19 10:15:01 +00:00
|
|
|
}
|
2014-02-19 07:12:26 +00:00
|
|
|
|
2013-01-25 18:08:28 +00:00
|
|
|
u32 prevVagAddr = v.vagAddr;
|
2012-12-16 19:40:49 +00:00
|
|
|
v.type = VOICETYPE_VAG;
|
2014-03-19 10:15:01 +00:00
|
|
|
v.vagAddr = vagAddr; // Real VAG header is 0x30 bytes behind the vagAddr
|
2012-12-16 19:40:49 +00:00
|
|
|
v.vagSize = size;
|
2023-09-06 08:31:13 +00:00
|
|
|
v.loop = loop != 0;
|
2023-09-06 13:45:52 +00:00
|
|
|
if (v.on) {
|
|
|
|
v.playing = true;
|
|
|
|
}
|
2023-09-06 08:31:13 +00:00
|
|
|
v.vag.Start(vagAddr, size, loop != 0);
|
2012-12-17 20:43:31 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-11-09 16:24:46 +00:00
|
|
|
static u32 sceSasSetVoicePCM(u32 core, int voiceNum, u32 pcmAddr, int size, int loopPos) {
|
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogWarning(Log::sceSas, ERROR_SAS_INVALID_VOICE, "invalid voicenum");
|
2013-01-23 06:50:36 +00:00
|
|
|
}
|
2014-02-17 01:21:28 +00:00
|
|
|
if (size <= 0 || size > 0x10000) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid size %d", __FUNCTION__, size);
|
2014-02-19 07:12:26 +00:00
|
|
|
return ERROR_SAS_INVALID_PCM_SIZE;
|
2014-02-17 01:21:28 +00:00
|
|
|
}
|
|
|
|
if (loopPos >= size) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "sceSasSetVoicePCM(%08x, %i, %08x, %i, %i): bad loop pos", core, voiceNum, pcmAddr, size, loopPos);
|
2014-02-17 01:21:28 +00:00
|
|
|
return ERROR_SAS_INVALID_LOOP_POS;
|
|
|
|
}
|
2013-01-23 06:50:36 +00:00
|
|
|
if (!Memory::IsValidAddress(pcmAddr)) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG(Log::sceSas, "Ignoring invalid PCM audio address %08x", pcmAddr);
|
2013-01-23 06:50:36 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2015-11-09 16:24:46 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
|
|
|
if (v.type == VOICETYPE_ATRAC3) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, ERROR_SAS_ATRAC3_ALREADY_SET, "voice is already ATRAC3");
|
2015-11-09 16:24:46 +00:00
|
|
|
}
|
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetVoicePCM(%08x, %i, %08x, %i, %i)", core, voiceNum, pcmAddr, size, loopPos);
|
2013-01-23 06:50:36 +00:00
|
|
|
|
2013-03-12 04:17:19 +00:00
|
|
|
u32 prevPcmAddr = v.pcmAddr;
|
2012-12-17 20:43:31 +00:00
|
|
|
v.type = VOICETYPE_PCM;
|
|
|
|
v.pcmAddr = pcmAddr;
|
|
|
|
v.pcmSize = size;
|
2013-05-23 16:42:15 +00:00
|
|
|
v.pcmIndex = 0;
|
2014-02-17 01:21:28 +00:00
|
|
|
v.pcmLoopPos = loopPos >= 0 ? loopPos : 0;
|
|
|
|
v.loop = loopPos >= 0 ? true : false;
|
2012-12-17 20:43:31 +00:00
|
|
|
v.playing = true;
|
2012-12-16 19:40:49 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasGetPauseFlag(u32 core) {
|
2012-12-17 17:05:10 +00:00
|
|
|
u32 pauseFlag = 0;
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
for (int i = 0; i < sas->maxVoices; i++) {
|
|
|
|
if (sas->voices[i].paused)
|
2013-01-23 06:50:36 +00:00
|
|
|
pauseFlag |= (1 << i);
|
2012-12-17 17:05:10 +00:00
|
|
|
}
|
2013-01-23 06:50:36 +00:00
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasGetPauseFlag(%08x)", pauseFlag);
|
2012-12-17 17:05:10 +00:00
|
|
|
return pauseFlag;
|
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetPause(u32 core, u32 voicebit, int pause) {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetPause(%08x, %08x, %i)", core, voicebit, pause);
|
2013-02-17 01:45:20 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2013-06-12 14:56:53 +00:00
|
|
|
for (int i = 0; voicebit != 0; i++, voicebit >>= 1) {
|
2013-01-23 06:50:36 +00:00
|
|
|
if (i < PSP_SAS_VOICES_MAX && i >= 0) {
|
2012-12-10 08:09:56 +00:00
|
|
|
if ((voicebit & 1) != 0)
|
2023-09-06 08:31:13 +00:00
|
|
|
sas->voices[i].paused = pause != 0;
|
2013-06-12 14:56:53 +00:00
|
|
|
}
|
2012-12-07 04:45:16 +00:00
|
|
|
}
|
2012-12-10 08:09:56 +00:00
|
|
|
|
2012-12-07 04:45:16 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetVolume(u32 core, int voiceNum, int leftVol, int rightVol, int effectLeftVol, int effectRightVol) {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetVolume(%08x, %i, %i, %i, %i, %i)", core, voiceNum, leftVol, rightVol, effectLeftVol, effectRightVol);
|
2012-12-15 23:04:46 +00:00
|
|
|
|
2013-01-23 06:50:36 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
2013-05-28 00:05:13 +00:00
|
|
|
bool overVolume = abs(leftVol) > PSP_SAS_VOL_MAX || abs(rightVol) > PSP_SAS_VOL_MAX;
|
|
|
|
overVolume = overVolume || abs(effectLeftVol) > PSP_SAS_VOL_MAX || abs(effectRightVol) > PSP_SAS_VOL_MAX;
|
2013-04-22 04:30:30 +00:00
|
|
|
if (overVolume)
|
|
|
|
return ERROR_SAS_INVALID_VOLUME;
|
2012-12-15 23:04:46 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2013-03-12 13:19:48 +00:00
|
|
|
v.volumeLeft = leftVol;
|
|
|
|
v.volumeRight = rightVol;
|
2013-01-27 14:15:23 +00:00
|
|
|
v.effectLeft = effectLeftVol;
|
|
|
|
v.effectRight = effectRightVol;
|
2012-12-16 19:40:49 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetPitch(u32 core, int voiceNum, int pitch) {
|
2013-01-23 06:50:36 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
2014-02-17 22:12:33 +00:00
|
|
|
if (pitch < PSP_SAS_PITCH_MIN || pitch > PSP_SAS_PITCH_MAX) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "sceSasSetPitch(%08x, %i, %i): bad pitch", core, voiceNum, pitch);
|
2014-02-17 22:12:33 +00:00
|
|
|
return ERROR_SAS_INVALID_PITCH;
|
2013-08-27 20:47:45 +00:00
|
|
|
}
|
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetPitch(%08x, %i, %i)", core, voiceNum, pitch);
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2014-02-17 22:12:33 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2012-11-01 15:19:01 +00:00
|
|
|
v.pitch = pitch;
|
2012-12-16 19:40:49 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetKeyOn(u32 core, int voiceNum) {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetKeyOn(%08x, %i)", core, voiceNum);
|
2012-12-15 23:04:46 +00:00
|
|
|
|
2013-01-23 06:50:36 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2013-06-10 03:38:54 +00:00
|
|
|
if (sas->voices[voiceNum].paused || sas->voices[voiceNum].on) {
|
2013-01-23 06:50:36 +00:00
|
|
|
return ERROR_SAS_VOICE_PAUSED;
|
|
|
|
}
|
|
|
|
|
2013-02-17 01:45:20 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2012-12-17 17:05:10 +00:00
|
|
|
v.KeyOn();
|
2012-12-16 19:40:49 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// sceSasSetKeyOff can be used to start sounds, that just sound during the Release phase!
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetKeyOff(u32 core, int voiceNum) {
|
2014-02-16 18:50:25 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
2013-01-03 23:16:34 +00:00
|
|
|
} else {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetKeyOff(%08x, %i)", core, voiceNum);
|
2013-02-17 01:45:20 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2013-06-10 03:38:54 +00:00
|
|
|
if (sas->voices[voiceNum].paused || !sas->voices[voiceNum].on) {
|
2013-01-23 06:50:36 +00:00
|
|
|
return ERROR_SAS_VOICE_PAUSED;
|
|
|
|
}
|
|
|
|
|
2013-02-17 01:45:20 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2013-01-03 23:16:34 +00:00
|
|
|
v.KeyOff();
|
|
|
|
return 0;
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetNoise(u32 core, int voiceNum, int freq) {
|
2013-01-23 06:50:36 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
2014-02-16 19:36:30 +00:00
|
|
|
if (freq < 0 || freq >= 64) {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetNoise(%08x, %i, %i)", core, voiceNum, freq);
|
2014-02-16 19:36:30 +00:00
|
|
|
return ERROR_SAS_INVALID_NOISE_FREQ;
|
|
|
|
}
|
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetNoise(%08x, %i, %i)", core, voiceNum, freq);
|
2012-12-15 23:04:46 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2012-12-16 19:40:49 +00:00
|
|
|
v.type = VOICETYPE_NOISE;
|
|
|
|
v.noiseFreq = freq;
|
2012-12-07 04:45:16 +00:00
|
|
|
return 0;
|
2012-12-06 15:05:55 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetSL(u32 core, int voiceNum, int level) {
|
2013-01-23 06:50:36 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetSL(%08x, %i, %08x)", core, voiceNum, level);
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2023-01-15 00:55:40 +00:00
|
|
|
v.envelope.SetSustainLevel(level);
|
2012-12-07 04:45:16 +00:00
|
|
|
return 0;
|
2012-12-06 15:05:55 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetADSR(u32 core, int voiceNum, int flag, int a, int d, int s, int r) {
|
2013-01-23 06:50:36 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
2014-02-08 06:44:11 +00:00
|
|
|
// Create a mask like flag for the invalid values.
|
2014-02-08 15:29:02 +00:00
|
|
|
int invalid = (a < 0 ? 0x1 : 0) | (d < 0 ? 0x2 : 0) | (s < 0 ? 0x4 : 0) | (r < 0 ? 0x8 : 0);
|
2014-02-08 06:44:11 +00:00
|
|
|
if (invalid & flag) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG_REPORT(Log::sceSas, "sceSasSetADSR(%08x, %i, %i, %08x, %08x, %08x, %08x): invalid value", core, voiceNum, flag, a, d, s, r);
|
2014-02-08 06:44:11 +00:00
|
|
|
return ERROR_SAS_INVALID_ADSR_RATE;
|
|
|
|
}
|
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "0=sceSasSetADSR(%08x, %i, %i, %08x, %08x, %08x, %08x)", core, voiceNum, flag, a, d, s, r);
|
2012-12-15 23:04:46 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2023-01-15 00:55:40 +00:00
|
|
|
v.envelope.SetRate(flag, a, d, s, r);
|
2012-12-05 15:51:10 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetADSRMode(u32 core, int voiceNum, int flag, int a, int d, int s, int r) {
|
2013-01-23 06:50:36 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
2012-12-15 23:04:46 +00:00
|
|
|
}
|
|
|
|
|
2014-02-08 07:48:58 +00:00
|
|
|
// Probably by accident (?), the PSP ignores the top bit of these values.
|
|
|
|
a = a & ~0x80000000;
|
|
|
|
d = d & ~0x80000000;
|
|
|
|
s = s & ~0x80000000;
|
|
|
|
r = r & ~0x80000000;
|
|
|
|
|
|
|
|
// This will look like the update flag for the invalid modes.
|
|
|
|
int invalid = 0;
|
|
|
|
if (a > 5 || (a & 1) != 0) {
|
|
|
|
invalid |= 0x1;
|
|
|
|
}
|
|
|
|
if (d > 5 || (d & 1) != 1) {
|
|
|
|
invalid |= 0x2;
|
|
|
|
}
|
|
|
|
if (s > 5) {
|
|
|
|
invalid |= 0x4;
|
|
|
|
}
|
|
|
|
if (r > 5 || (r & 1) != 1) {
|
|
|
|
invalid |= 0x8;
|
|
|
|
}
|
|
|
|
if (invalid & flag) {
|
2014-02-22 16:39:15 +00:00
|
|
|
if (a == 5 && d == 5 && s == 5 && r == 5) {
|
|
|
|
// Some games do this right at init. It seems to fail even on a PSP, but let's not report it.
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetADSRMode(%08x, %i, %i, %08x, %08x, %08x, %08x): invalid modes", core, voiceNum, flag, a, d, s, r);
|
2014-02-22 16:39:15 +00:00
|
|
|
} else {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG_REPORT(Log::sceSas, "sceSasSetADSRMode(%08x, %i, %i, %08x, %08x, %08x, %08x): invalid modes", core, voiceNum, flag, a, d, s, r);
|
2014-02-22 16:39:15 +00:00
|
|
|
}
|
2014-02-08 07:48:58 +00:00
|
|
|
return ERROR_SAS_INVALID_ADSR_CURVE_MODE;
|
|
|
|
}
|
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetADSRMode(%08x, %i, %i, %08x, %08x, %08x, %08x)", core, voiceNum, flag, a, d, s, r);
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2023-01-15 00:55:40 +00:00
|
|
|
v.envelope.SetEnvelope(flag, a, d, s, r);
|
2014-02-22 16:39:15 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2012-12-06 14:37:41 +00:00
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetSimpleADSR(u32 core, int voiceNum, u32 ADSREnv1, u32 ADSREnv2) {
|
2013-02-17 01:45:20 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2013-02-17 01:45:20 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
|
|
|
}
|
2014-02-08 06:29:54 +00:00
|
|
|
// This bit could be related to decay type or systain type, but gives an error if you try to set it.
|
|
|
|
if ((ADSREnv2 >> 13) & 1) {
|
2024-07-14 12:42:59 +00:00
|
|
|
WARN_LOG_REPORT(Log::sceSas, "sceSasSetSimpleADSR(%08x, %d, %04x, %04x): Invalid ADSREnv2", core, voiceNum, ADSREnv1, ADSREnv2);
|
2014-02-08 06:29:54 +00:00
|
|
|
return ERROR_SAS_INVALID_ADSR_CURVE_MODE;
|
|
|
|
}
|
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sasSetSimpleADSR(%08x, %i, %08x, %08x)", core, voiceNum, ADSREnv1, ADSREnv2);
|
2013-02-17 01:45:20 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2012-12-16 19:40:49 +00:00
|
|
|
v.envelope.SetSimpleEnvelope(ADSREnv1 & 0xFFFF, ADSREnv2 & 0xFFFF);
|
2012-11-01 15:19:01 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasGetEnvelopeHeight(u32 core, int voiceNum) {
|
2013-02-17 01:45:20 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG(Log::sceSas, "%s: invalid voicenum %d", __FUNCTION__, voiceNum);
|
2012-12-17 17:05:10 +00:00
|
|
|
return ERROR_SAS_INVALID_VOICE;
|
|
|
|
}
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2014-01-04 00:57:22 +00:00
|
|
|
int height = v.envelope.GetHeight();
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "%i = sceSasGetEnvelopeHeight(%08x, %i)", height, core, voiceNum);
|
2014-01-04 00:57:22 +00:00
|
|
|
return height;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasRevType(u32 core, int type) {
|
2015-10-31 16:20:14 +00:00
|
|
|
if (type < PSP_SAS_EFFECT_TYPE_OFF || type > PSP_SAS_EFFECT_TYPE_MAX) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, ERROR_SAS_REV_INVALID_TYPE, "invalid type");
|
2015-10-24 20:53:57 +00:00
|
|
|
}
|
2015-10-31 16:20:14 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2015-10-31 16:20:14 +00:00
|
|
|
sas->SetWaveformEffectType(type);
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogSuccessI(Log::sceSas, 0);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasRevParam(u32 core, int delay, int feedback) {
|
2015-10-31 16:20:14 +00:00
|
|
|
if (delay < 0 || delay >= 128) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, ERROR_SAS_REV_INVALID_DELAY, "invalid delay value");
|
2015-10-31 16:20:14 +00:00
|
|
|
}
|
|
|
|
if (feedback < 0 || feedback >= 128) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, ERROR_SAS_REV_INVALID_FEEDBACK, "invalid feedback value");
|
2015-10-31 16:20:14 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
sas->waveformEffect.delay = delay;
|
|
|
|
sas->waveformEffect.feedback = feedback;
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogSuccessI(Log::sceSas, 0);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasRevEVOL(u32 core, u32 lv, u32 rv) {
|
2014-02-16 17:55:29 +00:00
|
|
|
if (lv > 0x1000 || rv > 0x1000) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleReportDebug(Log::sceSas, ERROR_SAS_REV_INVALID_VOLUME, "invalid volume");
|
2014-02-16 17:55:29 +00:00
|
|
|
}
|
2015-10-31 16:20:14 +00:00
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
sas->waveformEffect.leftVol = lv;
|
|
|
|
sas->waveformEffect.rightVol = rv;
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogSuccessI(Log::sceSas, 0);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
2012-12-05 11:50:25 +00:00
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasRevVON(u32 core, int dry, int wet) {
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2014-02-21 06:53:41 +00:00
|
|
|
sas->waveformEffect.isDryOn = dry != 0;
|
|
|
|
sas->waveformEffect.isWetOn = wet != 0;
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogSuccessI(Log::sceSas, 0);
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasGetGrain(u32 core) {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasGetGrain(%08x)", core);
|
2012-12-17 20:43:31 +00:00
|
|
|
return sas->GetGrainSize();
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetGrain(u32 core, int grain) {
|
2024-07-14 12:42:59 +00:00
|
|
|
INFO_LOG(Log::sceSas, "sceSasSetGrain(%08x, %i)", core, grain);
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
sas->SetGrainSize(grain);
|
2012-12-08 06:13:41 +00:00
|
|
|
return 0;
|
2012-12-07 04:45:16 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasGetOutputMode(u32 core) {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasGetOutputMode(%08x)", core);
|
2012-12-17 20:43:31 +00:00
|
|
|
return sas->outputMode;
|
2012-12-08 23:56:21 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetOutputMode(u32 core, u32 outputMode) {
|
2014-02-21 06:53:41 +00:00
|
|
|
if (outputMode != 0 && outputMode != 1) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "sceSasSetOutputMode(%08x, %i): bad output mode", core, outputMode);
|
2014-02-21 06:53:41 +00:00
|
|
|
return ERROR_SAS_INVALID_OUTPUT_MODE;
|
|
|
|
}
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasSetOutputMode(%08x, %i)", core, outputMode);
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2012-12-17 20:43:31 +00:00
|
|
|
sas->outputMode = outputMode;
|
2014-02-21 06:53:41 +00:00
|
|
|
|
2012-12-08 23:56:21 +00:00
|
|
|
return 0;
|
2012-11-01 15:19:01 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasGetAllEnvelopeHeights(u32 core, u32 heightsAddr) {
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG(Log::sceSas, "sceSasGetAllEnvelopeHeights(%08x, %i)", core, heightsAddr);
|
2013-02-17 01:45:20 +00:00
|
|
|
|
|
|
|
if (!Memory::IsValidAddress(heightsAddr)) {
|
|
|
|
return ERROR_SAS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2013-02-17 01:45:20 +00:00
|
|
|
for (int i = 0; i < PSP_SAS_VOICES_MAX; i++) {
|
2013-10-23 20:59:42 +00:00
|
|
|
int voiceHeight = sas->voices[i].envelope.GetHeight();
|
|
|
|
Memory::Write_U32(voiceHeight, heightsAddr + i * 4);
|
2012-12-07 04:45:16 +00:00
|
|
|
}
|
2013-02-17 01:45:20 +00:00
|
|
|
|
2012-12-09 08:27:21 +00:00
|
|
|
return 0;
|
2012-12-07 04:45:16 +00:00
|
|
|
}
|
2012-11-01 15:19:01 +00:00
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetTriangularWave(u32 sasCore, int voice, int unknown) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "UNIMPL sceSasSetTriangularWave(%08x, %i, %i)", sasCore, voice, unknown);
|
2012-12-17 17:05:10 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 sceSasSetSteepWave(u32 sasCore, int voice, int unknown) {
|
2024-07-14 12:42:59 +00:00
|
|
|
ERROR_LOG_REPORT(Log::sceSas, "UNIMPL sceSasSetSteepWave(%08x, %i, %i)", sasCore, voice, unknown);
|
2012-12-17 17:05:10 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 __sceSasSetVoiceATRAC3(u32 core, int voiceNum, u32 atrac3Context) {
|
2015-11-09 16:24:46 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogWarning(Log::sceSas, ERROR_SAS_INVALID_VOICE, "invalid voicenum");
|
2015-11-09 16:24:46 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2013-06-08 17:34:38 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
2015-11-09 16:24:46 +00:00
|
|
|
if (v.type == VOICETYPE_ATRAC3) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, ERROR_SAS_ATRAC3_ALREADY_SET, "voice is already ATRAC3");
|
2015-11-09 16:24:46 +00:00
|
|
|
}
|
2013-06-08 17:34:38 +00:00
|
|
|
v.type = VOICETYPE_ATRAC3;
|
|
|
|
v.loop = false;
|
|
|
|
v.playing = true;
|
|
|
|
v.atrac3.setContext(atrac3Context);
|
2013-06-09 11:07:02 +00:00
|
|
|
Memory::Write_U32(atrac3Context, core + 56 * voiceNum + 20);
|
2015-11-09 16:24:46 +00:00
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogSuccessI(Log::sceSas, 0);
|
2013-02-03 00:07:43 +00:00
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 __sceSasConcatenateATRAC3(u32 core, int voiceNum, u32 atrac3DataAddr, int atrac3DataLength) {
|
2015-11-09 16:24:46 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogWarning(Log::sceSas, ERROR_SAS_INVALID_VOICE, "invalid voicenum");
|
2015-11-09 16:24:46 +00:00
|
|
|
}
|
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
DEBUG_LOG_REPORT(Log::sceSas, "__sceSasConcatenateATRAC3(%08x, %i, %08x, %i)", core, voiceNum, atrac3DataAddr, atrac3DataLength);
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2013-06-09 11:07:02 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
|
|
|
if (Memory::IsValidAddress(atrac3DataAddr))
|
2014-09-23 05:30:30 +00:00
|
|
|
v.atrac3.addStreamData(atrac3DataAddr, atrac3DataLength);
|
2013-02-03 00:07:43 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-12-08 09:40:08 +00:00
|
|
|
static u32 __sceSasUnsetATRAC3(u32 core, int voiceNum) {
|
2015-11-09 16:24:46 +00:00
|
|
|
if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogWarning(Log::sceSas, ERROR_SAS_INVALID_VOICE, "invalid voicenum");
|
2015-11-09 16:24:46 +00:00
|
|
|
}
|
|
|
|
|
2015-11-15 19:24:09 +00:00
|
|
|
__SasDrain();
|
2015-11-09 16:24:46 +00:00
|
|
|
SasVoice &v = sas->voices[voiceNum];
|
|
|
|
if (v.type != VOICETYPE_ATRAC3) {
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogError(Log::sceSas, ERROR_SAS_ATRAC3_NOT_SET, "voice is not ATRAC3");
|
2015-11-09 16:24:46 +00:00
|
|
|
}
|
|
|
|
v.type = VOICETYPE_OFF;
|
|
|
|
v.playing = false;
|
|
|
|
v.on = false;
|
2015-11-09 16:25:35 +00:00
|
|
|
// This unpauses. Some games, like Sol Trigger, depend on this.
|
|
|
|
v.paused = false;
|
2013-06-09 11:07:02 +00:00
|
|
|
Memory::Write_U32(0, core + 56 * voiceNum + 20);
|
2015-11-09 16:24:46 +00:00
|
|
|
|
2024-07-14 12:42:59 +00:00
|
|
|
return hleLogSuccessI(Log::sceSas, 0);
|
2013-02-03 00:07:43 +00:00
|
|
|
}
|
2013-02-17 01:45:20 +00:00
|
|
|
|
2015-10-28 20:20:20 +00:00
|
|
|
void __SasGetDebugStats(char *stats, size_t bufsize) {
|
|
|
|
if (sas) {
|
|
|
|
sas->GetDebugText(stats, bufsize);
|
|
|
|
} else {
|
|
|
|
snprintf(stats, bufsize, "Sas not initialized");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-01 15:19:01 +00:00
|
|
|
const HLEFunction sceSasCore[] =
|
|
|
|
{
|
2015-03-22 23:57:56 +00:00
|
|
|
{0X42778A9F, &WrapU_UUUUU<sceSasInit>, "__sceSasInit", 'x', "xxxxx" },
|
|
|
|
{0XA3589D81, &WrapU_UU<_sceSasCore>, "__sceSasCore", 'x', "xx" },
|
|
|
|
{0X50A14DFC, &WrapU_UUII<_sceSasCoreWithMix>, "__sceSasCoreWithMix", 'x', "xxii" },
|
|
|
|
{0X68A46B95, &WrapU_U<sceSasGetEndFlag>, "__sceSasGetEndFlag", 'x', "x" },
|
|
|
|
{0X440CA7D8, &WrapU_UIIIII<sceSasSetVolume>, "__sceSasSetVolume", 'x', "xiiiii" },
|
|
|
|
{0XAD84D37F, &WrapU_UII<sceSasSetPitch>, "__sceSasSetPitch", 'x', "xii" },
|
|
|
|
{0X99944089, &WrapU_UIUII<sceSasSetVoice>, "__sceSasSetVoice", 'x', "xixii" },
|
|
|
|
{0XB7660A23, &WrapU_UII<sceSasSetNoise>, "__sceSasSetNoise", 'x', "xii" },
|
|
|
|
{0X019B25EB, &WrapU_UIIIIII<sceSasSetADSR>, "__sceSasSetADSR", 'x', "xiiiiii"},
|
|
|
|
{0X9EC3676A, &WrapU_UIIIIII<sceSasSetADSRMode>, "__sceSasSetADSRmode", 'x', "xiiiiii"},
|
|
|
|
{0X5F9529F6, &WrapU_UII<sceSasSetSL>, "__sceSasSetSL", 'x', "xii" },
|
|
|
|
{0X74AE582A, &WrapU_UI<sceSasGetEnvelopeHeight>, "__sceSasGetEnvelopeHeight", 'x', "xi" },
|
|
|
|
{0XCBCD4F79, &WrapU_UIUU<sceSasSetSimpleADSR>, "__sceSasSetSimpleADSR", 'x', "xixx" },
|
|
|
|
{0XA0CF2FA4, &WrapU_UI<sceSasSetKeyOff>, "__sceSasSetKeyOff", 'x', "xi" },
|
|
|
|
{0X76F01ACA, &WrapU_UI<sceSasSetKeyOn>, "__sceSasSetKeyOn", 'x', "xi" },
|
|
|
|
{0XF983B186, &WrapU_UII<sceSasRevVON>, "__sceSasRevVON", 'x', "xii" },
|
|
|
|
{0XD5A229C9, &WrapU_UUU<sceSasRevEVOL>, "__sceSasRevEVOL", 'x', "xxx" },
|
|
|
|
{0X33D4AB37, &WrapU_UI<sceSasRevType>, "__sceSasRevType", 'x', "xi" },
|
|
|
|
{0X267A6DD2, &WrapU_UII<sceSasRevParam>, "__sceSasRevParam", 'x', "xii" },
|
|
|
|
{0X2C8E6AB3, &WrapU_U<sceSasGetPauseFlag>, "__sceSasGetPauseFlag", 'x', "x" },
|
|
|
|
{0X787D04D5, &WrapU_UUI<sceSasSetPause>, "__sceSasSetPause", 'x', "xxi" },
|
|
|
|
{0XA232CBE6, &WrapU_UII<sceSasSetTriangularWave>, "__sceSasSetTrianglarWave", 'x', "xii" }, // Typo.
|
|
|
|
{0XD5EBBBCD, &WrapU_UII<sceSasSetSteepWave>, "__sceSasSetSteepWave", 'x', "xii" },
|
|
|
|
{0XBD11B7C2, &WrapU_U<sceSasGetGrain>, "__sceSasGetGrain", 'x', "x" },
|
|
|
|
{0XD1E0A01E, &WrapU_UI<sceSasSetGrain>, "__sceSasSetGrain", 'x', "xi" },
|
|
|
|
{0XE175EF66, &WrapU_U<sceSasGetOutputMode>, "__sceSasGetOutputmode", 'x', "x" },
|
|
|
|
{0XE855BF76, &WrapU_UU<sceSasSetOutputMode>, "__sceSasSetOutputmode", 'x', "xx" },
|
|
|
|
{0X07F58C24, &WrapU_UU<sceSasGetAllEnvelopeHeights>, "__sceSasGetAllEnvelopeHeights", 'x', "xx" },
|
|
|
|
{0XE1CD9561, &WrapU_UIUII<sceSasSetVoicePCM>, "__sceSasSetVoicePCM", 'x', "xixii" },
|
|
|
|
{0X4AA9EAD6, &WrapU_UIU<__sceSasSetVoiceATRAC3>, "__sceSasSetVoiceATRAC3", 'x', "xix" },
|
|
|
|
{0X7497EA85, &WrapU_UIUI<__sceSasConcatenateATRAC3>, "__sceSasConcatenateATRAC3", 'x', "xixi" },
|
|
|
|
{0XF6107F00, &WrapU_UI<__sceSasUnsetATRAC3>, "__sceSasUnsetATRAC3", 'x', "xi" },
|
2012-11-01 15:19:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void Register_sceSasCore()
|
|
|
|
{
|
|
|
|
RegisterModule("sceSasCore", ARRAY_SIZE(sceSasCore), sceSasCore);
|
|
|
|
}
|
|
|
|
|