Merge pull request #86 from OverkillLabs/feat/misc-prx-additions
feat(prx): ConvertKeycode, VoiceChat stubs, PlayGo chunk-id fix
This commit is contained in:
commit
2e9761753d
|
|
@ -4,7 +4,6 @@
|
|||
#include <atomic>
|
||||
#include <cstdio>
|
||||
|
||||
// Logs the first three calls of the surrounding call site, then stays silent (keeps guest logs usable).
|
||||
#define APS5_HIT(tag, ...) \
|
||||
do { \
|
||||
static std::atomic<int> aps5HitCount{0}; \
|
||||
|
|
@ -15,4 +14,4 @@
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
#endif // CORE_LIBS_HITLOG_HPP
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
#include <cstdint>
|
||||
#include "SceTypes.hpp"
|
||||
#include "HitLog.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
namespace {
|
||||
constexpr int kErrInvalidAddress = static_cast<int>(0x80BC0031u);
|
||||
constexpr int kErrInvalidUserId = static_cast<int>(0x80BC0010u);
|
||||
} // namespace
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceConvertKeycodeGetImeKeyboardType(int32_t userId, uint32_t* type) {
|
||||
if (type == nullptr) return kErrInvalidAddress;
|
||||
if (userId < 0) return kErrInvalidUserId;
|
||||
*type = 0;
|
||||
return 0;
|
||||
}
|
||||
int APS5_VABI sceConvertKeycodeGetVirtualKeycode(std::uint64_t a0, std::uint64_t a1, std::uint64_t a2, std::uint64_t a3) {
|
||||
APS5_HIT("CONVERTKEYCODE", "sceConvertKeycodeGetVirtualKeycode args 0x%llx 0x%llx 0x%llx 0x%llx -> error (signature unknown)",
|
||||
static_cast<unsigned long long>(a0), static_cast<unsigned long long>(a1), static_cast<unsigned long long>(a2), static_cast<unsigned long long>(a3));
|
||||
return kErrInvalidAddress;
|
||||
}
|
||||
}
|
||||
|
|
@ -85,12 +85,7 @@ int APS5_VABI scePlayGoGetEta(int handle, const uint16_t* chunk_ids, uint32_t nu
|
|||
}
|
||||
|
||||
int APS5_VABI scePlayGoGetInstallChunkId(int handle, uint16_t* out_chunk_id_list, uint32_t number_of_entries, uint32_t* out_entries) {
|
||||
(void)handle;
|
||||
(void)out_chunk_id_list;
|
||||
(void)number_of_entries;
|
||||
(void)out_entries;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
return scePlayGoGetChunkId(handle, out_chunk_id_list, number_of_entries, out_entries);
|
||||
}
|
||||
|
||||
int APS5_VABI scePlayGoGetInstallSpeed(int handle, int32_t* out_speed) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
#include <atomic>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include "SceTypes.hpp"
|
||||
#include "prx/libc/include/General.hpp"
|
||||
|
||||
namespace {
|
||||
constexpr int VOICECHAT_ERROR_SIGNED_OUT = static_cast<int>(0x80550006u);
|
||||
} // namespace
|
||||
|
||||
namespace {
|
||||
void logSoft(const char* func, const char* what) {
|
||||
static std::mutex mtx;
|
||||
static std::map<std::string, int> hits;
|
||||
std::lock_guard<std::mutex> lk(mtx);
|
||||
if (++hits[func] > 3) {
|
||||
return;
|
||||
}
|
||||
std::fprintf(stderr, "[SOFT-VOICECHAT] %s -> %s\n", func, what);
|
||||
std::fflush(stderr);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
extern "C" {
|
||||
|
||||
int APS5_VABI sceVoiceChatInitialize(void* param) { (void)param; return 0; }
|
||||
int APS5_VABI sceVoiceChatTerminate(void) { return 0; }
|
||||
int APS5_VABI sceVoiceChatRegisterHandlers(void* a) { (void)a; return 0; }
|
||||
int APS5_VABI sceVoiceChatRegisterMicEventHandler(void* a, void* b) { (void)a; (void)b; return 0; }
|
||||
int APS5_VABI sceVoiceChatProcessEvent(void) { return 0; }
|
||||
int APS5_VABI sceVoiceChatDeleteRequest(int requestId) { (void)requestId; return 0; }
|
||||
|
||||
int APS5_VABI sceVoiceChatCreateRequest(void* a, void* b) {
|
||||
(void)a;
|
||||
(void)b;
|
||||
logSoft(__func__, "SIGNED_OUT (offline)");
|
||||
return VOICECHAT_ERROR_SIGNED_OUT;
|
||||
}
|
||||
|
||||
#define VOICECHAT_OFFLINE_REQUEST(NAME) \
|
||||
int APS5_VABI NAME(int requestId, void* a, void* b) { \
|
||||
(void)requestId; \
|
||||
(void)a; \
|
||||
(void)b; \
|
||||
logSoft(#NAME, "SIGNED_OUT (offline)"); \
|
||||
return VOICECHAT_ERROR_SIGNED_OUT; \
|
||||
}
|
||||
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestRegisterSession)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestUnregisterSession)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestCreateGameSessionVoiceChatChannel)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestDeleteGameSessionVoiceChatChannel)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestJoinGameSessionVoiceChatChannel)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestLeaveGameSessionVoiceChatChannel)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestCreatePlayerSessionVoiceChatChannel)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestDeletePlayerSessionVoiceChatChannel)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestJoinPlayerSessionVoiceChatChannel)
|
||||
VOICECHAT_OFFLINE_REQUEST(sceVoiceChatRequestLeavePlayerSessionVoiceChatChannel)
|
||||
}
|
||||
Loading…
Reference in New Issue