Prepare Regist for PS5

This commit is contained in:
Florian Märkl 2020-12-11 16:47:39 +01:00
commit 21ef8fa018
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
7 changed files with 86 additions and 32 deletions

View file

@ -11,6 +11,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
@ -61,11 +62,21 @@ typedef enum
{
// values must not change
CHIAKI_TARGET_PS4_UNKNOWN = 0,
CHIAKI_TARGET_PS4_8 = 800,
CHIAKI_TARGET_PS4_9 = 900,
CHIAKI_TARGET_PS4_10 = 1000
CHIAKI_TARGET_PS4_8 = 800,
CHIAKI_TARGET_PS4_9 = 900,
CHIAKI_TARGET_PS4_10 = 1000,
CHIAKI_TARGET_PS5_UNKNOWN = 1000000,
CHIAKI_TARGET_PS5_1 = 1000100
} ChiakiTarget;
static inline bool chiaki_target_is_unknown(ChiakiTarget target)
{
return target == CHIAKI_TARGET_PS5_UNKNOWN
|| target == CHIAKI_TARGET_PS4_UNKNOWN;
}
static inline bool chiaki_target_is_ps5(ChiakiTarget target) { return target >= CHIAKI_TARGET_PS5_UNKNOWN; }
/**
* Perform initialization of global state needed for using the Chiaki lib
*/

View file

@ -35,7 +35,7 @@ CHIAKI_EXPORT const char *chiaki_rp_application_reason_string(uint32_t reason);
*/
CHIAKI_EXPORT const char *chiaki_rp_version_string(ChiakiTarget target);
CHIAKI_EXPORT ChiakiTarget chiaki_rp_version_parse(const char *rp_version_str);
CHIAKI_EXPORT ChiakiTarget chiaki_rp_version_parse(const char *rp_version_str, bool is_ps5);
#define CHIAKI_RP_DID_SIZE 32
@ -70,6 +70,7 @@ CHIAKI_EXPORT void chiaki_connect_video_profile_preset(ChiakiConnectVideoProfile
typedef struct chiaki_connect_info_t
{
bool ps5;
const char *host; // null terminated
char regist_key[CHIAKI_SESSION_AUTH_SIZE]; // must be completely filled (pad with \0)
uint8_t morning[0x10];
@ -149,6 +150,7 @@ typedef struct chiaki_session_t
{
struct
{
bool ps5;
struct addrinfo *host_addrinfos;
struct addrinfo *host_addrinfo_selected;
char hostname[128];