Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions core/libs/prx/libSceAjm.native/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ const char* APS5_VABI sceAjmStrError(int error) {
return nullptr;
}

int APS5_VABI sceAjmDecWVorbisCreateHeaderPacket(void) {
NotImplemented_nid_no_patch(__func__);
int APS5_VABI sceAjmDecWVorbisCreateHeaderPacket(const void* input, size_t input_size, void* output, size_t* output_size) {
if (!input || !output || !output_size) APS5_INVALID_ARG_EX;
AjmStub(__func__);
return 0;
}

int APS5_VABI sceAjmDecWVorbisCreateSetupPacket(void) {
NotImplemented_nid_no_patch(__func__);
int APS5_VABI sceAjmDecWVorbisCreateSetupPacket(const void* input, size_t input_size, void* output, size_t* output_size) {
if (!input || !output || !output_size) APS5_INVALID_ARG_EX;
AjmStub(__func__);
return 0;
}

Expand Down
12 changes: 10 additions & 2 deletions core/libs/prx/libSceAppContent/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,20 @@ int APS5_VABI sceAppContentTemporaryDataUnmount(const AppContentMountPoint* moun
}


int APS5_VABI sceAppContentAddcontEnqueueDownload(void) {
struct AppContentAddcontDownloadProgress {
uint64_t bytes_downloaded;
uint64_t total_bytes;
uint32_t status;
};

int APS5_VABI sceAppContentAddcontEnqueueDownload(uint32_t service_label, const NpUnifiedEntitlementLabel* entitlement_label) {
if (!entitlement_label) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceAppContentGetAddcontDownloadProgress(void) {
int APS5_VABI sceAppContentGetAddcontDownloadProgress(uint32_t service_label, const NpUnifiedEntitlementLabel* entitlement_label, AppContentAddcontDownloadProgress* progress) {
if (!entitlement_label || !progress) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}
Expand Down
9 changes: 6 additions & 3 deletions core/libs/prx/libSceBluetoothHid/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@ std::int32_t APS5_VABI sceBluetoothHidUnregisterDevice(std::uint16_t vendorId, s
return 0;
}

int APS5_VABI sceBluetoothHidGetDeviceName() {
int APS5_VABI sceBluetoothHidGetDeviceName(std::uint16_t vendor_id, std::uint16_t product_id, char* name, std::size_t size) {
if (!name || size == 0) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceBluetoothHidGetInputReport() {
int APS5_VABI sceBluetoothHidGetInputReport(std::uint16_t vendor_id, std::uint16_t product_id, void* report, std::size_t* size) {
if (!report || !size) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceBluetoothHidSetOutputReport() {
int APS5_VABI sceBluetoothHidSetOutputReport(std::uint16_t vendor_id, std::uint16_t product_id, const void* report, std::size_t size) {
if (!report || size == 0) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions core/libs/prx/libSceContentSearch/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ int APS5_VABI sceContentSearchInit(const ContentSearchInitParam* init_param) {
return 0;
}

<<<<<<< HEAD
int APS5_VABI sceContentSearchCloseMetadata(std::int32_t metadataId) {
if (!g_initialized.load()) return ErrorNotInitialized;
ThrowUnknownMetadataId(__func__, metadataId);
Expand Down
11 changes: 10 additions & 1 deletion core/libs/prx/libSceGameLiveStreaming/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ int APS5_VABI sceGameLiveStreamingGetCurrentStatus2(GameLiveStreamingStatus2* st
return 0;
}

int APS5_VABI sceGameLiveStreamingGetProgramInfo() {
struct GameLiveStreamingProgramInfo {
char title[128];
char detail[512];
char content_id[32];
std::uint32_t program_type;
std::uint32_t reserved[3];
};

int APS5_VABI sceGameLiveStreamingGetProgramInfo(GameLiveStreamingProgramInfo* info) {
if (!info) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}
Expand Down
13 changes: 8 additions & 5 deletions core/libs/prx/libSceHttp2/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,27 +381,30 @@ int APS5_VABI sceHttp2SetResolveRetry(int id, int32_t retry) {
return 0;
}

int APS5_VABI sceHttp2WebSocketCreateRequest() {
int APS5_VABI sceHttp2WebSocketCreateRequest(int id, const char* url, const Http2AsyncOption* async_option, int* req_id) {
if (!url || !req_id) return ERROR_INVALID_ID;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceHttp2WebSocketCloseAsync() {
int APS5_VABI sceHttp2WebSocketCloseAsync(int id, int req_id, const Http2AsyncOption* async_option) {
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceHttp2WebSocketSendTextMessageAsync() {
int APS5_VABI sceHttp2WebSocketSendTextMessageAsync(int id, int req_id, const char* text, const Http2AsyncOption* async_option) {
if (!text) return ERROR_INVALID_ID;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceHttp2WebSocketSendDataMessageAsync() {
int APS5_VABI sceHttp2WebSocketSendDataMessageAsync(int id, int req_id, const void* data, std::size_t size, const Http2AsyncOption* async_option) {
if (!data) return ERROR_INVALID_ID;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceHttp2WebSocketSetPingInterval() {
int APS5_VABI sceHttp2WebSocketSetPingInterval(int id, int req_id, uint32_t interval_ms) {
NotImplemented_nid_no_patch(__func__);
return 0;
}
Expand Down
47 changes: 23 additions & 24 deletions core/libs/prx/libSceJson2/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,62 +866,61 @@ void APS5_VABI _ZN3sce4Json5Value5clearEv(Value* self) {
Clear(NodeOf(*self));
}

int APS5_VABI _ZN3sce4Json12MemAllocator11notifyErrorEimPv(void) {
int APS5_VABI _ZN3sce4Json12MemAllocator11notifyErrorEimPv(int code, int param, void* context) {
(void)code;
(void)param;
(void)context;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json5Value21setNullAccessCallBackEPFRKS1_NS0_9ValueTypeEPS2_PvES6_() {
int APS5_VABI _ZN3sce4Json5Value21setNullAccessCallBackEPFRKS1_NS0_9ValueTypeEPS2_PvES6_(Value* self, void (*callback)(ValueType, const Value*, void*), void* context) {
if (!self) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json5Value30setElementAccessFailureHandlerEPFviPKNS0_6StringEPKmPKS1_S8_PvES9_(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json5Value22setSpecialFloatHandlerEPFKS1_NS0_12FunctionTypeEdPS2_PvPbES5_(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json5Value22setTypeMismatchHandlerEPFRKS1_NS0_9ValueTypeEPS2_S5_PvES6_(void) {
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZNK3sce4Json5ValuecvbEv(void) {
int APS5_VABI _ZN3sce4Json5Value30setElementAccessFailureHandlerEPFviPKNS0_6StringEPKmPKS1_S8_PvES9_(Value* self, void* handler) {
(void)self;
(void)handler;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json6Object4PairC1ERKNS0_6StringERKNS0_5ValueE() {
int APS5_VABI _ZN3sce4Json5Value22setSpecialFloatHandlerEPFKS1_NS0_12FunctionTypeEdPS2_PvPbES5_(Value* self, void* handler) {
(void)self;
(void)handler;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json6Object4PairD1Ev() {
int APS5_VABI _ZN3sce4Json5Value22setTypeMismatchHandlerEPFRKS1_NS0_9ValueTypeEPS2_S5_PvES6_(Value* self, void* handler) {
(void)self;
(void)handler;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json6Object6insertERKNS1_4PairE() {
int APS5_VABI _ZNK3sce4Json5ValuecvbEv(const Value* self) {
if (!self) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json5Array8iteratorppEi() {
int APS5_VABI _ZN3sce4Json6Object6insertERKNS1_4PairE(Object* self, const Pair* pair) {
if (!self || !pair) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json5Array8iteratoraSERKS2_() {
int APS5_VABI _ZN3sce4Json5Array8iteratorppEi(ArrayIterator* self, int n) {
if (!self) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI _ZN3sce4Json5Array8iteratorC1Ev() {
int APS5_VABI _ZN3sce4Json5Array8iteratoraSERKS2_(ArrayIterator* self, const ArrayIterator* other) {
if (!self || !other) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}
Expand Down
4 changes: 3 additions & 1 deletion core/libs/prx/libSceNpPartner001/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ std::atomic<bool> g_initialized{false};

extern "C" {

int APS5_VABI sceNpEAAccessInitialize(void) {
int APS5_VABI sceNpEAAccessInitialize(const void* param) {
(void)param;
bool expected = false;
if (!g_initialized.compare_exchange_strong(expected, true)) throw std::logic_error(std::string(__func__) + ": already initialized");
NotImplemented_nid_no_patch(__func__);
return 0;
}

Expand Down
74 changes: 62 additions & 12 deletions core/libs/prx/libSceOpusCeltDec/Export.cpp
Original file line number Diff line number Diff line change
@@ -1,35 +1,85 @@
#include "prx/libc/include/General.hpp"
#include <cstdint>
#include <cstddef>
#include <cstring>
#include <mutex>
#include <unordered_map>
#include <stdexcept>

namespace {

struct Decoder {
std::uint32_t context = 0;
int channels = 0;
void* state = nullptr;
~Decoder() = default;
};

std::mutex mutex;
std::unordered_map<std::uint32_t, std::uint32_t*> contexts;
std::unordered_map<void*, std::unique_ptr<Decoder>> decoders;
std::uint32_t nextContext = 1;

}

extern "C" {

int APS5_VABI sceOpusCeltDecInitialize(std::uint32_t*) {
NotImplemented_nid_no_patch(__func__);
int APS5_VABI sceOpusCeltDecInitialize(std::uint32_t* context) {
if (!context) throw std::runtime_error("OpusCeltDec: null context output");
std::lock_guard lock(mutex);
for (const auto& [id, owner] : contexts)
if (owner == context) throw std::runtime_error("OpusCeltDec: context already initialized");
if (nextContext == 0) throw std::runtime_error("OpusCeltDec: context identifiers exhausted");
const auto id = nextContext++;
contexts.emplace(id, context);
*context = id;
return 0;
}

int APS5_VABI sceOpusCeltDecTerminate(std::uint32_t*) {
NotImplemented_nid_no_patch(__func__);
int APS5_VABI sceOpusCeltDecTerminate(std::uint32_t* context) {
if (!context) throw std::runtime_error("OpusCeltDec: null context");
std::lock_guard lock(mutex);
if (!contexts.contains(*context)) throw std::runtime_error("OpusCeltDec: unknown context");
for (const auto& [state, decoder] : decoders)
if (decoder->context == *context) throw std::runtime_error("OpusCeltDec: termination with live decoders is not implemented");
contexts.erase(*context);
return 0;
}

int APS5_VABI sceOpusCeltDecGetSize(int) {
NotImplemented_nid_no_patch(__func__);
return 0;
int APS5_VABI sceOpusCeltDecGetSize(int channels) {
if (channels != 1 && channels != 2) throw std::runtime_error("OpusCeltDec: only mono and stereo are supported");
return 640;
}

int APS5_VABI sceOpusCeltDecCreateEx(std::uint32_t*, void*, int, int) {
NotImplemented_nid_no_patch(__func__);
int APS5_VABI sceOpusCeltDecCreateEx(std::uint32_t* context, void* state, int sampleRate, int channels) {
if (!context || !state) throw std::runtime_error("OpusCeltDec: null context or state");
sceOpusCeltDecGetSize(channels);
if (sampleRate != 48000) throw std::runtime_error("OpusCeltDec: sample rates other than 48000 Hz are not implemented");
std::lock_guard lock(mutex);
if (!contexts.contains(*context)) throw std::runtime_error("OpusCeltDec: unknown context");
if (decoders.contains(state)) throw std::runtime_error("OpusCeltDec: state already owns a decoder");
auto decoder = std::make_unique<Decoder>();
decoder->context = *context;
decoder->channels = channels;
decoder->state = state;
decoders.emplace(state, std::move(decoder));
return 0;
}

int APS5_VABI sceOpusCeltDecDecode(void*, const std::uint8_t*, int, std::int16_t*, int) {
int APS5_VABI sceOpusCeltDecDecode(void* state, const std::uint8_t* data, int bytes, std::int16_t* pcm, int capacity) {
if (!data || bytes <= 0 || !pcm || capacity < 0)
throw std::runtime_error("OpusCeltDec: invalid packet or PCM buffer");
std::lock_guard lock(mutex);
const auto found = decoders.find(state);
if (found == decoders.end()) throw std::runtime_error("OpusCeltDec: unknown decoder state");
auto& decoder = *found->second;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceOpusCeltDecDestroy(void*) {
NotImplemented_nid_no_patch(__func__);
int APS5_VABI sceOpusCeltDecDestroy(void* state) {
std::lock_guard lock(mutex);
if (decoders.erase(state) == 0) throw std::runtime_error("OpusCeltDec: unknown decoder state");
return 0;
}

Expand Down
9 changes: 6 additions & 3 deletions core/libs/prx/libSceWebBrowserDialog/Export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,20 @@ int APS5_VABI sceWebBrowserDialogUpdateStatus(void) {
}


int APS5_VABI sceWebBrowserDialogSetCookie(void) {
int APS5_VABI sceWebBrowserDialogSetCookie(const char* name, const char* value, const char* domain, const char* path) {
if (!name || !value) APS5_INVALID_ARG_EX;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceWebBrowserDialogOpenForPredeterminedContent() {
int APS5_VABI sceWebBrowserDialogOpenForPredeterminedContent(const void* param) {
(void)param;
NotImplemented_nid_no_patch(__func__);
return 0;
}

int APS5_VABI sceWebBrowserDialogResetCookie() {
int APS5_VABI sceWebBrowserDialogResetCookie(const char* domain) {
(void)domain;
NotImplemented_nid_no_patch(__func__);
return 0;
}
Expand Down
Loading