Merge pull request #103 from igor725/release-notifier

Discord release notifier
This commit is contained in:
SysRay 2024-04-16 22:01:30 +02:00 committed by GitHub
commit b4ac39caee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 484 additions and 101 deletions

View File

@ -109,7 +109,7 @@ jobs:
- name: Run some tests
shell: bash
run: echo "`node testRunner`" >> $GITHUB_STEP_SUMMARY
run: echo "`node misc/testRunner`" >> $GITHUB_STEP_SUMMARY
- name: Upload artifacts
uses: actions/upload-artifact@v4

20
.github/workflows/release_notify.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Discord release notify
on:
release:
types: [published]
jobs:
notifier:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Run things
working-directory: misc/discordNotify
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
npm i
node .

2
misc/discordNotify/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
package-lock.json
node_modules

136
misc/discordNotify/main.js Normal file
View File

@ -0,0 +1,136 @@
import { Octokit } from '@octokit/rest';
import fetch from 'node-fetch';
const octokit = new Octokit();
const hookURL = process.env.DISCORD_WEBHOOK;
const maxMessageSize = 1800;
const sendDiscordMessage = async (msg = null) => {
if (msg !== null && msg.length > maxMessageSize) {
let cpos = 0;
let strlen = 0;
let lastNL = 0;
while (true) {
strlen = 0;
lastNL = -1;
while ((cpos + strlen) < maxMessageSize) {
if (msg.charAt(cpos + strlen) === '\n')
lastNL = strlen;
if (++strlen === maxMessageSize) {
strlen = lastNL;
break;
}
}
if (lastNL !== -1) {
await sendDiscordMessage(msg.substr(cpos, strlen));
cpos += strlen + 1;
}
if (lastNL === -1 && strlen > 0)
return sendDiscordMessage(msg.substr(cpos, strlen));
else if (strlen == 0)
return null;
}
}
if (hookURL === undefined) {
console.error('No Discord WebHook URL found!');
console.log(msg);
return;
}
return fetch(hookURL, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
username: 'psOff updates',
content: msg ?? 'Oopsie'
})
});
};
const r_owner = 'SysRay';
const r_name = 'psOff_public';
const categoryOrder = ['general', 'ench', 'impls', 'bugfixes', 'stubs'];
const guessCategory = (labels) => {
const cats = [];
for (const label of labels) {
switch (label.name) {
case 'bugfix': cats.push('bugfixes'); break;
case 'stub': cats.push('stubs'); break;
case 'implementation': cats.push('impls'); break;
case 'enhancement': cats.push('ench'); break;
case 'general': cats.push('general'); break;
default: break;
}
}
if (cats.length === 0) cats.push('general');
return cats;
};
const getCategoryName = (cat) => {
switch (cat) {
case 'bugfixes': return 'Bugfixes 🪳';
case 'stubs': return 'Stubbed functions 🆒';
case 'impls': return 'Implementations 🥳';
case 'general': return 'General ✅';
case 'ench': return 'Enhancements 🧙';
}
throw new Error('Unknown category name: ' + String.toString(cat));
};
octokit.repos.listReleases({repo: r_name, owner: r_owner, per_page: 2, page: 1}).then(({data}) => {
const lastRelease = data[0], prevRelease = data[1];
return new Promise((resolve, reject) => {
const readPRs = async (pagenum, list = null, retries = 0) => {
const out = list ?? {general: [], bugfixes: [], stubs: [], impls: [], ench: []};
const query = [];
query.push(`repo:${r_owner}/${r_name}`);
query.push('is:pr is:closed base:features sort:author-date-asc');
query.push(`merged:${prevRelease.created_at}..${lastRelease.created_at}`);
return octokit.search.issuesAndPullRequests({q: query.join(' '), per_page: 100, page: pagenum}).then(({data}) => {
data.items.forEach((pr) => {
const msg = `* PR #${pr.number}: ${pr.title}`;
guessCategory(pr.labels).forEach((cat) => out[cat].push(msg));
});
if (data.total_count > (out.length - 1)) {
readPRs(pagenum + 1, out, retries = 0);
} else {
const final = [`# Changelog ${prevRelease.tag_name} => ${lastRelease.tag_name}`];
categoryOrder.forEach((cat) => {
if (out[cat].length > 0)
final.push(`\n## ${getCategoryName(cat)}\n${out[cat].join('\n')}`);
});
resolve(final.join('\n'));
}
}).catch((err) => {
if (retries == 10) return reject(err);
try {
console.error(`HTTP code #${err.status}: ${err.response.data.message}`);
} catch (e) {
console.error(err);
}
console.error(`Retrying in 1 min (${++retries}/10)...`);
setTimeout(() => readPRs(pagenum, out), 60000);
});
};
return readPRs(1);
});
}).then((markdown) => sendDiscordMessage(markdown)).catch((err) => {
console.error(err);
});

View File

@ -0,0 +1,8 @@
{
"type": "module",
"main": "main.js",
"dependencies": {
"@octokit/rest": "^20.1.0",
"node-fetch": "^3.3.2"
}
}

View File

@ -9,7 +9,7 @@ const runTest = (binary) => {
return new Promise((resolve) => {
const noExt = path.parse(binary).name;
const binPath = path.join(testsDir, binary);
const testPath = `testRunner\\summary\\${noExt}.json`;
const testPath = `misc\\testRunner\\summary\\${noExt}.json`;
let testTimer = null;
const proc = spawn(binPath, [`--gtest_output=json:${testPath}`]).on('exit', (code) => {

View File

@ -6,9 +6,9 @@ project(${libName})
add_library(${libName} SHARED entry.cpp)
add_dependencies(${libName} third_party config_emu)
add_dependencies(${libName} third_party config_emu core)
target_link_libraries(${libName} PRIVATE config_emu.lib SDL2 libboost_thread)
target_link_libraries(${libName} PRIVATE core.lib config_emu.lib SDL2 libboost_thread)
target_compile_definitions(${libName} PRIVATE BOOST_ALL_NO_LIB WIN32_LEAN_AND_MEAN)

View File

@ -2,7 +2,6 @@
#include <stdint.h>
namespace Err {
constexpr int32_t NOT_OPENED = -2144993279;
constexpr int32_t BUSY = -2144993278;
constexpr int32_t INVALID_PORT = -2144993277;
@ -26,77 +25,6 @@ constexpr int32_t INVALID_ARG = -2144993259;
constexpr int32_t INVALID_PARAM = -2144993258;
} // namespace Err
constexpr int PORT_OUT_MAX = 6;
static constexpr int PORT_IN_MAX = 8;
#define SCE_AUDIO_MIN_LEN 256u
#define SCE_AUDIO_MAX_LEN (256u * 8)
#define SCE_AUDIO_OUT_PARAM_FORMAT_MASK (0x000000FF)
#define SCE_AUDIO_OUT_PARAM_FORMAT_SHIFT (0)
// sceAudioOutOpen()の引数 paramのattributeの値とマスク値
#define SCE_AUDIO_OUT_PARAM_ATTR_RESTRICTED (0x00010000)
#define SCE_AUDIO_OUT_PARAM_ATTR_MIX_TO_MAIN (0x00020000)
#define SCE_AUDIO_OUT_PARAM_ATTR_MASK (0x000F0000)
#define SCE_AUDIO_OUT_PARAM_ATTR_SHIFT (16)
#define SCE_AUDIO_VOLUME_SHIFT 15
#define SCE_AUDIO_OUT_VOLUME_SHIFT SCE_AUDIO_VOLUME_SHIFT
#define SCE_AUDIO_VOLUME_0DB (1 << SCE_AUDIO_VOLUME_SHIFT)
#define SCE_AUDIO_VOLUME_0dB SCE_AUDIO_VOLUME_0DB
#define SCE_AUDIO_OUT_VOLUME_0DB SCE_AUDIO_VOLUME_0DB
#define SCE_AUDIO_OUT_VOLUME_0dB SCE_AUDIO_VOLUME_0dB
/*J 引数 'flag' に設定する値 */
/*E Value set for the argument 'flag' */
#define SCE_AUDIO_VOLUME_FLAG_L_CH (1 << 0)
#define SCE_AUDIO_VOLUME_FLAG_FL_CH SCE_AUDIO_VOLUME_FLAG_L_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_L_CH SCE_AUDIO_VOLUME_FLAG_L_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_FL_CH SCE_AUDIO_VOLUME_FLAG_L_CH
#define SCE_AUDIO_VOLUME_FLAG_R_CH (1 << 1)
#define SCE_AUDIO_VOLUME_FLAG_FR_CH SCE_AUDIO_VOLUME_FLAG_R_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_R_CH SCE_AUDIO_VOLUME_FLAG_R_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_FR_CH SCE_AUDIO_VOLUME_FLAG_R_CH
#define SCE_AUDIO_VOLUME_FLAG_C_CH (1 << 2)
#define SCE_AUDIO_VOLUME_FLAG_FC_CH SCE_AUDIO_VOLUME_FLAG_C_CH
#define SCE_AUDIO_VOLUME_FLAG_CNT_CH SCE_AUDIO_VOLUME_FLAG_C_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_C_CH SCE_AUDIO_VOLUME_FLAG_C_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_FC_CH SCE_AUDIO_VOLUME_FLAG_C_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_CNT_CH SCE_AUDIO_VOLUME_FLAG_C_CH
#define SCE_AUDIO_VOLUME_FLAG_LFE_CH (1 << 3)
#define SCE_AUDIO_OUT_VOLUME_FLAG_LFE_CH SCE_AUDIO_VOLUME_FLAG_LFE_CH
#define SCE_AUDIO_VOLUME_FLAG_LS_CH (1 << 4)
#define SCE_AUDIO_VOLUME_FLAG_RL_CH SCE_AUDIO_VOLUME_FLAG_LS_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_LS_CH SCE_AUDIO_VOLUME_FLAG_LS_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_RL_CH SCE_AUDIO_VOLUME_FLAG_LS_CH
#define SCE_AUDIO_VOLUME_FLAG_RS_CH (1 << 5)
#define SCE_AUDIO_VOLUME_FLAG_RR_CH SCE_AUDIO_VOLUME_FLAG_RS_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_RS_CH SCE_AUDIO_VOLUME_FLAG_RS_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_RR_CH SCE_AUDIO_VOLUME_FLAG_RS_CH
#define SCE_AUDIO_VOLUME_FLAG_LE_CH (1 << 6)
#define SCE_AUDIO_VOLUME_FLAG_BL_CH SCE_AUDIO_VOLUME_FLAG_LE_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_LE_CH SCE_AUDIO_VOLUME_FLAG_LE_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_BL_CH SCE_AUDIO_VOLUME_FLAG_LE_CH
#define SCE_AUDIO_VOLUME_FLAG_RE_CH (1 << 7)
#define SCE_AUDIO_VOLUME_FLAG_BR_CH SCE_AUDIO_VOLUME_FLAG_RE_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_RE_CH SCE_AUDIO_VOLUME_FLAG_RE_CH
#define SCE_AUDIO_OUT_VOLUME_FLAG_BR_CH SCE_AUDIO_VOLUME_FLAG_RE_CH
#define SCE_AUDIO_MIXLEVEL_PADSPK_SHIFT 15
#define SCE_AUDIO_OUT_MIXLEVEL_PADSPK_SHIFT SCE_AUDIO_MIXLEVEL_PADSPK_SHIFT
#define SCE_AUDIO_MIXLEVEL_PADSPK_0DB (1 << SCE_AUDIO_MIXLEVEL_PADSPK_SHIFT)
#define SCE_AUDIO_MIXLEVEL_PADSPK_0dB SCE_AUDIO_MIXLEVEL_PADSPK_0DB
#define SCE_AUDIO_OUT_MIXLEVEL_PADSPK_0DB SCE_AUDIO_MIXLEVEL_PADSPK_0DB
#define SCE_AUDIO_OUT_MIXLEVEL_PADSPK_0dB SCE_AUDIO_MIXLEVEL_PADSPK_0dB
/*J 引数 'mixLevel' に設定する値の初期値 -9dB */
/*E Defult value set for the argument 'mixLevel' -9dB */
#define SCE_AUDIO_OUT_MIXLEVEL_PADSPK_DEFAULT (11626)
constexpr int PORT_OUT_MAX = 6;
constexpr int PORT_IN_MAX = 8;
constexpr int SCE_AUDIO_VOLUME_0DB = (1 << 15);

View File

@ -1,5 +1,6 @@
#include "common.h"
#include "config_emu.h"
#include "core/videoout/videoout.h"
#include "logging.h"
#include "types.h"
@ -11,6 +12,8 @@
LOG_DEFINE_MODULE(libSceAudioOut);
namespace {
static bool audioInited = false;
struct PortOut {
bool open = false;
int userId = 0;
@ -70,8 +73,15 @@ extern "C" {
EXPORT const char* MODULE_NAME = "libSceAudioOut";
EXPORT SYSV_ABI int32_t sceAudioOutInit(void) {
(void)getData();
return SDL_InitSubSystem(SDL_INIT_AUDIO) == 0 ? Ok : Err::NOT_INIT;
if (audioInited) return Err::ALREADY_INIT;
if (accessVideoOut().SDLInit(SDL_INIT_AUDIO) == 0) {
audioInited = true;
(void)getData();
return Ok;
}
return Err::OUT_OF_MEMORY;
}
EXPORT SYSV_ABI int32_t sceAudioOutOpen(int32_t userId, SceAudioOutPortType type, int32_t index, uint32_t len, uint32_t freq, SceAudioOutParamFormat format) {
@ -179,6 +189,7 @@ EXPORT SYSV_ABI int32_t sceAudioOutOpen(int32_t userId, SceAudioOutPortType type
return id + 1;
}
return Err::PORT_FULL;
}
@ -198,6 +209,7 @@ EXPORT SYSV_ABI int32_t sceAudioOutClose(int32_t handle) {
SDL_CloseAudioDevice(port.device);
}
}
return Ok;
}
@ -272,11 +284,13 @@ EXPORT SYSV_ABI int32_t sceAudioOutGetPortState(int32_t handle, SceAudioOutPortS
state->channel = port.channelsNum;
state->volume = 127;
state->output = (uint16_t)SceAudioOutStateOutput::CONNECTED_PRIMARY;
return Ok;
}
EXPORT SYSV_ABI int32_t sceAudioOutGetSystemState(SceAudioOutSystemState* state) {
state->loudness = -70.0f;
return Ok;
}

View File

@ -1,20 +1,20 @@
#pragma once
namespace Err {
#define ERROR_NOT_SYSTEM_INITIALIZED -2135425023 /* 0x80B80001 */
#define ERROR_ALREADY_SYSTEM_INITIALIZED -2135425022 /* 0x80B80002 */
#define ERROR_NOT_INITIALIZED -2135425021 /* 0x80B80003 */
#define ERROR_ALREADY_INITIALIZED -2135425020 /* 0x80B80004 */
#define ERROR_NOT_FINISHED -2135425019 /* 0x80B80005 */
#define ERROR_INVALID_STATE -2135425018 /* 0x80B80006 */
#define ERROR_RESULT_NONE -2135425017 /* 0x80B80007 */
#define ERROR_BUSY -2135425016 /* 0x80B80008 */
#define ERROR_OUT_OF_MEMORY -2135425015 /* 0x80B80009 */
#define ERROR_PARAM_INVALID -2135425014 /* 0x80B8000A */
#define ERROR_NOT_RUNNING -2135425013 /* 0x80B8000B */
#define ERROR_ALREADY_CLOSE -2135425012 /* 0x80B8000C */
#define ERROR_ARG_NULL -2135425011 /* 0x80B8000D */
#define ERROR_UNEXPECTED_FATAL -2135425010 /* 0x80B8000E */
#define ERROR_NOT_SUPPORTED -2135425009 /* 0x80B8000F */
#define ERROR_INHIBIT_SHAREPLAY_CLIENT -2135425008 /* 0x80B80010 */
} // namespace Err
constexpr int32_t ERROR_NOT_SYSTEM_INITIALIZED = -2135425023; /* 0x80B80001 */
constexpr int32_t ERROR_ALREADY_SYSTEM_INITIALIZED = -2135425022; /* 0x80B80002 */
constexpr int32_t ERROR_NOT_INITIALIZED = -2135425021; /* 0x80B80003 */
constexpr int32_t ERROR_ALREADY_INITIALIZED = -2135425020; /* 0x80B80004 */
constexpr int32_t ERROR_NOT_FINISHED = -2135425019; /* 0x80B80005 */
constexpr int32_t ERROR_INVALID_STATE = -2135425018; /* 0x80B80006 */
constexpr int32_t ERROR_RESULT_NONE = -2135425017; /* 0x80B80007 */
constexpr int32_t ERROR_BUSY = -2135425016; /* 0x80B80008 */
constexpr int32_t ERROR_OUT_OF_MEMORY = -2135425015; /* 0x80B80009 */
constexpr int32_t ERROR_PARAM_INVALID = -2135425014; /* 0x80B8000A */
constexpr int32_t ERROR_NOT_RUNNING = -2135425013; /* 0x80B8000B */
constexpr int32_t ERROR_ALREADY_CLOSE = -2135425012; /* 0x80B8000C */
constexpr int32_t ERROR_ARG_NULL = -2135425011; /* 0x80B8000D */
constexpr int32_t ERROR_UNEXPECTED_FATAL = -2135425010; /* 0x80B8000E */
constexpr int32_t ERROR_NOT_SUPPORTED = -2135425009; /* 0x80B8000F */
constexpr int32_t ERROR_INHIBIT_SHAREPLAY_CLIENT = -2135425008; /* 0x80B80010 */
} // namespace Err

View File

@ -5,7 +5,7 @@ set(libName libSceLibcInternal)
project(${libName})
add_library(${libName} SHARED entry.cpp mspace.cpp)
target_compile_definitions(${libName} PRIVATE BOOST_ALL_NO_LIB)
target_compile_definitions(${libName} PRIVATE BOOST_ALL_NO_LIB _CRT_SECURE_NO_WARNINGS)
add_dependencies(${libName} core third_party)
target_link_libraries(${libName} PRIVATE core.lib libboost_thread)

View File

@ -1,4 +1,3 @@
#define _CRT_SECURE_NO_WARNINGS
#include "common.h"
#include "core/imports/imports_runtime.h"
#include "core/unwinding/unwind.h"

View File

@ -16,6 +16,9 @@ constexpr int32_t INVALID_MAX_GRAIN_SAMPLES = -2142633904;
constexpr int32_t FAIL = -2142633983;
} // namespace Err
constexpr int32_t SCE_NGS2_RACK_NAME_LENGTH = 16;
constexpr int32_t SCE_NGS2_MAX_VOICE_CHANNELS = 8;
constexpr int32_t SCE_NGS2_MAX_MATRIX_LEVELS = 64;
constexpr int32_t SCE_NGS2_RACK_NAME_LENGTH = 16;
constexpr int32_t SCE_NGS2_SYSTEM_NAME_LENGTH = 16;
constexpr int32_t SCE_NGS2_SAMPLER_VOICE_ADD_WAVEFORM_BLOCKS = 0x10000001;

View File

@ -172,12 +172,30 @@ extern "C" {
EXPORT const char* MODULE_NAME = "libSceNgs2";
EXPORT SYSV_ABI int32_t sceNgs2ReportRegisterHandler(uint32_t type, SceNgs2ReportHandler func, uintptr_t userData, SceNgs2Handle** outh) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2ReportUnregisterHandler(SceNgs2Handle* repHan) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2CalcWaveformBlock(SceNgs2WaveformFormat* wf, uint32_t samPos, uint32_t samCount, void* out) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2CustomRackGetModuleInfo(SceNgs2Handle* rh, uint32_t modIdx, SceNgs2CustomModuleInfo* outi, size_t infosz) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2ParseWaveformData(const void* ptr, size_t size, SceNgs2WaveformFormat* wf) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
@ -195,6 +213,30 @@ EXPORT SYSV_ABI int32_t sceNgs2ParseWaveformData(const void* ptr, size_t size, S
return ProcessWaveData(&wi, wf);
}
EXPORT SYSV_ABI int32_t sceNgs2GetWaveformFrameInfo(const SceNgs2WaveformInfo* fmt, uint32_t* outFrameSize, uint32_t* outNumFrameSamples,
uint32_t* outUnitsPerFrame, uint32_t* outNumDelaySamples) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
if (outFrameSize) *outFrameSize = 1; // Some games crashes with divide by zero exception if we set 0 here
if (outNumFrameSamples) *outNumFrameSamples = 0;
if (outUnitsPerFrame) *outUnitsPerFrame = 0;
if (outNumDelaySamples) *outNumDelaySamples = 0;
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2PanGetVolumeMatrix(SceNgs2PanWork* pw, const SceNgs2PanParam* aParam, uint32_t numParams, uint32_t matrixFormat,
float* outVolumeMatrix) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2PanInit() {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2ParseWaveformFile(const char* path, long offset, SceNgs2WaveformFormat* wf) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
@ -252,6 +294,25 @@ EXPORT SYSV_ABI int32_t sceNgs2RackDestroy(SceNgs2Handle* rh, void*) {
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2RackGetInfo(SceNgs2Handle* rh, SceNgs2RackInfo* outi, size_t infosz) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2RackSetUserData(SceNgs2Handle* rh, uintptr_t userData) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2RackGetUserData(SceNgs2Handle* rh, uintptr_t* userData) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
*userData = 0;
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2RackGetVoiceHandle(SceNgs2Handle* rh, uint32_t voiceId, SceNgs2Handle** outh) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
@ -290,6 +351,51 @@ EXPORT SYSV_ABI int32_t sceNgs2SystemDestroy(SceNgs2Handle* sysh, SceNgs2Context
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemEnumHandles(SceNgs2Handle** outh, uint32_t maxnum) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
*outh = nullptr;
return 0;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemEnumRackHandles(SceNgs2Handle* sysh, SceNgs2Handle** outh, uint32_t maxnum) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
*outh = nullptr;
return 0;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemGetInfo(SceNgs2Handle* sysh, SceNgs2SystemInfo* outi, size_t infosz) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemSetUserData(SceNgs2Handle* sysh, uintptr_t userData) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemGetUserData(SceNgs2Handle* sysh, uintptr_t* userData) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
*userData = 0;
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemLock(SceNgs2Handle* sysh) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemUnlock(SceNgs2Handle* sysh) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemRender(SceNgs2Handle* sysh, SceNgs2RenderBufferInfo* rbi, int32_t count) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
@ -316,6 +422,30 @@ EXPORT SYSV_ABI int32_t sceNgs2SystemSetGrainSamples(SceNgs2Handle* sysh, uint32
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2SystemSetSampleRate(SceNgs2Handle* sysh, uint32_t rate) {
LOG_USE_MODULE(libSceNgs2);
LOG_ERR(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2VoiceGetMatrixInfo(SceNgs2Handle* vh, uint32_t matrixId, SceNgs2VoiceMatrixInfo* outi, size_t infosz) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2VoiceGetOwner(SceNgs2Handle* vh, SceNgs2Handle** outh, uint32_t* outvid) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2VoiceGetPortInfo(SceNgs2Handle** vh, uint32_t port, SceNgs2VoicePortInfo* outi, size_t infosz) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNgs2VoiceControl(SceNgs2Handle* voh, const SceNgs2VoiceParamHead* phead) {
LOG_USE_MODULE(libSceNgs2);
LOG_TRACE(L"todo %S", __FUNCTION__);

View File

@ -127,6 +127,7 @@ struct SceNgs2GeomListenerWork;
struct SceNgs2GeomListenerParam;
typedef int (*SceWaveformUserFunc)(uintptr_t ud, uint32_t off, void* data, size_t size);
typedef void (*SceNgs2ReportHandler)(const void* data, uintptr_t userData);
struct SceNgs2GeomVector {
float x, y, z;
@ -233,3 +234,79 @@ struct SceNgs2RackOption {
uint32_t maxPorts;
uint32_t aReserved[20];
};
struct SceNgs2CustomModuleInfo {
uint32_t moduleId;
uint32_t sourceBufferId;
uint32_t extraBufferId;
uint32_t destBufferId;
uint32_t stateOffset;
uint32_t stateSize;
uint32_t reserved;
uint32_t reserved2;
};
struct SceNgs2RackInfo {
char name[SCE_NGS2_RACK_NAME_LENGTH];
SceNgs2Handle rackHandle;
SceNgs2ContextBufferInfo bufferInfo;
SceNgs2Handle ownerSystemHandle;
uint32_t type;
uint32_t rackId;
uint32_t uid;
uint32_t minGrainSamples;
uint32_t maxGrainSamples;
uint32_t maxVoices;
uint32_t maxChannelWorks;
uint32_t maxInputs;
uint32_t maxPorts;
uint32_t maxMatrices;
uint32_t stateFlags;
float lastProcessRatio;
uint64_t lastProcessTick;
uint64_t renderCount;
uint32_t activeVoiceCount;
uint32_t activeChannelWorkCount;
};
struct SceNgs2SystemInfo {
char name[SCE_NGS2_SYSTEM_NAME_LENGTH];
SceNgs2Handle systemHandle;
SceNgs2ContextBufferInfo bufferInfo;
uint32_t uid;
uint32_t minGrainSamples;
uint32_t maxGrainSamples;
uint32_t stateFlags;
uint32_t rackCount;
float lastRenderRatio;
uint64_t lastRenderTick;
uint64_t renderCount;
uint32_t sampleRate;
uint32_t numGrainSamples;
};
struct SceNgs2VoiceMatrixInfo {
uint32_t numLevels;
float aLevel[SCE_NGS2_MAX_MATRIX_LEVELS];
};
struct SceNgs2VoicePortInfo {
int32_t matrixId;
float volume;
uint32_t numDelaySamples;
uint32_t destInputId;
SceNgs2Handle destHandle;
};
struct SceNgs2PanWork {
float aSpeakerAngle[SCE_NGS2_MAX_VOICE_CHANNELS];
float unitAngle;
uint32_t numSpeakers;
};
struct SceNgs2PanParam {
float angle;
float distance;
float fbwLevel;
float lfeLevel;
};

View File

@ -20,4 +20,70 @@ EXPORT SYSV_ABI int32_t sceNpPartyCheckCallback() {
LOG_ERR(L"todo %S", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyCreate() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyGetId() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyGetMemberInfo() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyGetMemberVoiceInfo() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyGetMembers() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyGetState() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyGetStateAsUser() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyRegisterHandler() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartySendBinaryMessage() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyShowInvitationList() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
EXPORT SYSV_ABI int32_t sceNpPartyTerminate() {
LOG_USE_MODULE(libSceNpParty);
LOG_ERR(L"todo %s", __FUNCTION__);
return Ok;
}
}