Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing structure definitions, fix existing. #213

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion include/orbis/GnmDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void sceGnmSetVsShader();
// Empty Comment
void sceGnmSetWaveLimitMultipliers();
// Empty Comment
void sceGnmSubmitAndFlipCommandBuffers();
int32_t sceGnmSubmitAndFlipCommandBuffers(uint32_t count, void *dcbGpuAddrs[], uint32_t *dcbSizesInBytes, void *ccbGpuAddrs[], uint32_t *ccbSizesInBytes, uint32_t videoOutHandle, uint32_t displayBufferIndex, uint32_t flipMode, int64_t flipArg);
// Empty Comment
void sceGnmSubmitAndFlipCommandBuffersForWorkload();
// Empty Comment
Expand Down
63 changes: 18 additions & 45 deletions include/orbis/NpTrophy.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,61 +8,34 @@
extern "C" {
#endif

// Empty Comment
void sceNpTrophyAbortHandle();
// Empty Comment
void sceNpTrophyCaptureScreenshot();
// Empty Comment
int sceNpTrophyCreateContext(int32_t *context, int32_t user, uint32_t unk, uint64_t unk2);
// Empty Comment
int sceNpTrophyCreateHandle(int32_t *handle);
// Empty Comment
int sceNpTrophyDestroyContext(int32_t context);
// Empty Comment
int sceNpTrophyDestroyHandle(int32_t handle);
// Empty Comment
void sceNpTrophyGetGameIcon();
// Empty Comment
void sceNpTrophyGetGameInfo();
// Empty Comment
void sceNpTrophyGetGroupIcon();
// Empty Comment
void sceNpTrophyGetGroupInfo();
// Empty Comment
void sceNpTrophyGetTrophyIcon();
// Empty Comment
int32_t sceNpTrophyGetTrophyInfo(int32_t context, int32_t handle, int32_t TRPID, OrbisNpTrophyDetails* details, OrbisNpTrophyData* data);
// Empty Comment
void sceNpTrophyGetTrophyUnlockState();
// Empty Comment
int32_t sceNpTrophyAbortHandle(int32_t a_handle);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be just handle not a_ prefix

int32_t sceNpTrophyCaptureScreenshot(int32_t a_handle, const OrbisNpTrophyScreenshotTarget* a_target, int32_t a_numTargets);
int32_t sceNpTrophyCreateContext(int32_t* a_context, int32_t a_userID, uint32_t a_serviceLabel, uint64_t a_options);
int32_t sceNpTrophyCreateHandle(int32_t* a_handle);
int32_t sceNpTrophyDestroyContext(int32_t a_context);
int32_t sceNpTrophyDestroyHandle(int32_t a_handle);
int32_t sceNpTrophyGetGameIcon(int32_t a_context, int32_t a_handle, void* a_buffer, size_t* a_size);
int32_t sceNpTrophyGetGameInfo(int32_t a_context, int32_t a_handle, OrbisNpTrophyGameDetails* a_details, OrbisNpTrophyGameData*);
int32_t sceNpTrophyGetGroupIcon(int32_t a_context, int32_t a_handle, int32_t a_groupID, void* a_buffer, size_t* a_size);
int32_t sceNpTrophyGetGroupInfo(int32_t a_context, int32_t a_handle, int32_t a_groupID, OrbisNpTrophyGroupDetails* a_details, OrbisNpTrophyGroupData* a_data);
int32_t sceNpTrophyGetTrophyIcon(int32_t a_context, int32_t a_handle, int32_t a_trophyID, void* a_buffer, size_t* a_size);
int32_t sceNpTrophyGetTrophyInfo(int32_t a_context, int32_t a_handle, int32_t a_trophyID, OrbisNpTrophyDetails* a_details, OrbisNpTrophyData* a_data);
int32_t sceNpTrophyGetTrophyUnlockState(int32_t a_context, int32_t a_handle, OrbisNpTrophyFlagArray* a_flags, uint32_t* a_count);
int32_t sceNpTrophyRegisterContext(int32_t a_context, int32_t a_handle, uint64_t a_options);
int32_t sceNpTrophyShowTrophyList(int32_t a_context, int32_t a_handle);
int32_t sceNpTrophyUnlockTrophy(int32_t a_context, int32_t a_handle, int32_t a_trophyID, int32_t *a_platinumId);

void sceNpTrophySystemIsServerAvailable();
void sceNpTrophyIntAbortHandle();
// Empty Comment
void sceNpTrophyIntCheckNetSyncTitles();
// Empty Comment
void sceNpTrophyIntCreateHandle();
// Empty Comment
void sceNpTrophyIntDestroyHandle();
// Empty Comment
void sceNpTrophyIntGetLocalTrophySummary();
// Empty Comment
void sceNpTrophyIntGetProgress();
// Empty Comment
void sceNpTrophyIntGetRunningTitle();
// Empty Comment
void sceNpTrophyIntGetRunningTitles();
// Empty Comment
void sceNpTrophyIntGetTrpIconByUri();
// Empty Comment
void sceNpTrophyIntNetSyncTitles();
// Empty Comment
int sceNpTrophyRegisterContext(int32_t context, int32_t handle, uint64_t unk);
// Empty Comment
int sceNpTrophyShowTrophyList(int32_t Context, int32_t hadle);
// Empty Comment
void sceNpTrophySystemIsServerAvailable();
// Empty Comment
int sceNpTrophyUnlockTrophy(int32_t context, int32_t handle, int32_t TrophyID, int32_t *PLATID);

#endif

#ifdef __cplusplus
Expand Down
121 changes: 96 additions & 25 deletions include/orbis/_types/Np.h
Original file line number Diff line number Diff line change
@@ -1,34 +1,105 @@
#pragma once

#include <orbis/_types/rtc.h>

typedef struct OrbisNpTrophyDetails {
size_t size; // this needs to be set with sizeof(OrbisNpTrophyDetails) or any function that calls with this data will return a error
int32_t TRPID; // Trophy ID, 0-XXXX
int32_t Unk00; // Unkown data
int32_t Unk01; // Unkown data
bool HiddenFromView; // this determans if you can see the trophy before its unlocked
char Unk02[3]; // Unkown data
char TrophyName[128]; // Trophy Name, EX: "UNLOCK ME"
char TrophyDetails[1024]; // Description, EX: "This is what needs to be unlocked"
/* Np Trophy */

typedef struct OrbisNpTrophyFlagArray
{
uint32_t bits[128 >> 5];
} OrbisNpTrophyFlagArray;

typedef struct OrbisNpTrophyGameDetails
{
size_t size; // This needs to be set with sizeof(OrbisNpTrophyGameDetails) or any function that takes this structure as a parameter will return a error(0x80551604)
uint32_t numGroups;
uint32_t numTrophies;
uint32_t numPlatinum;
uint32_t numGold;
uint32_t numSilver;
uint32_t numBronze;
char title[128];
char description[1024];
} OrbisNpTrophyGameDetails;

typedef struct OrbisNpTrophyGameData
{
size_t size; // This needs to be set with sizeof(OrbisNpTrophyGameData) or any function that takes this structure as a parameter will return a error(0x80551604)
uint32_t unlockedTrophies;
uint32_t unlockedPlatinum;
uint32_t unlockedGold;
uint32_t unlockedSilver;
uint32_t unlockedBronze;
uint32_t progressPercentage;
} OrbisNpTrophyGameData;

typedef struct OrbisNpTrophyGroupDetails
{
size_t size; // This needs to be set with sizeof(OrbisNpTrophyGroupDetails) or any function that takes this structure as a parameter will return a error(0x80551604)
int32_t groupId;
uint32_t numTrophies;
uint32_t numPlatinum;
uint32_t numGold;
uint32_t numSilver;
uint32_t numBronze;
char title[128];
char description[1024];
} OrbisNpTrophyGroupDetails;

typedef struct OrbisNpTrophyGroupData
{
size_t size; // This needs to be set with sizeof(OrbisNpTrophyGroupData) or any function that takes this structure as a parameter will return a error(0x80551604)
int32_t groupId;
uint32_t unlockedTrophies;
uint32_t unlockedPlatinum;
uint32_t unlockedGold;
uint32_t unlockedSilver;
uint32_t unlockedBronze;
uint32_t progressPercentage;
uint8_t UNK00[4];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use lowerCamcelCase here

} OrbisNpTrophyGroupData;

//
typedef struct OrbisNpTrophyDetails
{
size_t size; // This needs to be set with sizeof(OrbisNpTrophyDetails) or any function that takes this structure as a parameter will return a error(0x80551604)
int32_t trophyId; // Trophy ID, 1-XXXX(0 should be the Platinum Trophy)
int32_t trophyGrade; // gold/silver/bronze/Platinum
int32_t groupId; // group where the trophy is located(normally 0 for single group trophy packs, depending on how many trophies exists and are split into groups inside the pack this could rage from 0 - xxxx)
bool hidden; // this determines if you can see the trophy before its unlocked(hidden flagged trophys will not allow you to see the description until you have unlcoked them)
char Unk02[3]; // Unkown data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use lowerCamelCase here

char name[128]; // Trophy Name, EX: "UNLOCK ME"
char description[1024]; // Description, EX: "This is what needs to be unlocked"
} OrbisNpTrophyDetails;

typedef struct OrbisNpTrophyData {
size_t size; // this needs to be set with sizeof(OrbisNpTrophyDetails) or any function that calls with this data will return a error
int32_t TRPID; // Trophy ID, 0-XX for loarge scope trophy sets
bool IsUnlocked; // flag that tells if the trophy is locked or unlocked
char Unk00[3]; // Unkown
OrbisRtcTick Timecode; // time when the Trophy was unlocked
//
typedef struct OrbisNpTrophyData
{
size_t size; // this needs to be set with sizeof(OrbisNpTrophyData) or any function that takes this structure as a parameter will return a error(0x80551604)
int32_t trophyId; // Trophy ID, 1-XXXX(0 should be the Platinum Trophy)
bool unlocked; // flag that tells if the user has unlocked the Trophy)
char Unk00[3]; // likely padding, not sure why they didn't make unlocked a 32-bit value and swap a single bit for it, it would make it automaticlly alligned.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use lowerCamelCase here

OrbisRtcTick timestamp; // RTC time stamp of when the trophy is unlocked(this isn't fully accurate due to the RTC drifting, it can be off anywhere from +1 second to a whole minute+ behind.)
} OrbisNpTrophyData;

typedef struct OrbisNpOnlineId {
char data[16]; // account name, follows PSN schema, min 3/max 16
char term; // terminator, always '\0'?
uint8_t UNK[3]; // Unkown, probably reserved?

typedef struct OrbisNpTrophyScreenshotTarget
{
int32_t context; // same context that comes form sceNpTrophyCreateContext once created.
int32_t trophyId; // Trophy ID, 1-XXXX(0 should be the Platinum Trophy)
} OrbisNpTrophyScreenshotTarget;

/* Np Online*/
//
typedef struct OrbisNpOnlineId
{
char data[16]; // account name, follows PSN schema, min 3/max 16
char term; // terminator, always '\0'?
uint8_t UNK[3]; // Unkown, probably reserved/padding?
} OrbisNpOnlineId;

typedef struct OrbisNpId {
OrbisNpOnlineId handle; // online info
uint8_t Unk20[8]; // could be uint64_t?
uint8_t Unk28[8]; // could be uint64_t?
//
typedef struct OrbisNpId
{
OrbisNpOnlineId handle;
uint8_t Unk20[8];
uint8_t Unk28[8];
} OrbisNpId;
22 changes: 13 additions & 9 deletions include/orbis/_types/audio_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,31 @@
#define ORBIS_AUDIO_OUT_PARAM_FORMAT_FLOAT_MONO 3
#define ORBIS_AUDIO_OUT_PARAM_FORMAT_FLOAT_STEREO 4

typedef struct OrbisAudioOutPostState {
typedef struct OrbisAudioOutPostState
{
uint16_t output;
uint8_t channel;
uint8_t unk3[1];
uint8_t reserved[1];
int16_t volume;
uint16_t unk5;
uint16_t rerouteCounter;
uint64_t flag;
uint64_t unk7[2];
uint64_t reserved2[2];
} OrbisAudioOutPostState;

typedef struct OrbisAudioOutSystemState {
typedef struct OrbisAudioOutSystemState
{
float loudness;
uint8_t unk2[4];
uint64_t unk3[3];
uint8_t reserved[4];
uint64_t reserved2[3];
} OrbisAudioOutSystemState;

typedef struct OrbisAudioOutMasteringStatesHeader {
typedef struct OrbisAudioOutMasteringStatesHeader
{
uint32_t id;
} OrbisAudioOutMasteringStatesHeader;

typedef struct OrbisAudioOutOutputParam {
typedef struct OrbisAudioOutOutputParam
{
int32_t handle;
const void *pointer;
} OrbisAudioOutOutputParam;
28 changes: 14 additions & 14 deletions include/orbis/_types/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@

struct kevent {
uintptr_t ident; /* identifier for this event */
short filter; /* filter for event */
u_short flags;
short filter; /* filter for event */
u_short flags;
u_int fflags;
intptr_t data;
void *udata; /* opaque user data identifier */
void* udata; /* opaque user data identifier */
};

typedef struct OrbisKernelModuleSegmentInfo
Expand Down Expand Up @@ -100,13 +100,13 @@ typedef struct _OrbisKernelSemaOptParam {

typedef struct _OrbisKernelSema* OrbisKernelSema;

typedef struct {
uint32_t unk01;
uint16_t unk02;
uint16_t unk03;
uint8_t unk04;
uint8_t unk05;
uint8_t unk06[6];
typedef struct OrbisKernelUuid {
uint32_t timeLow;
uint16_t timeMid;
uint16_t timeHiAndVersion;
uint8_t clockSeqHiAndReserved;
uint8_t clockSeqLow;
uint8_t node[6];
} OrbisKernelUuid;

typedef mode_t OrbisKernelMode;
Expand All @@ -120,11 +120,11 @@ typedef struct OrbisKernelIovec {
} OrbisKernelIovec;

typedef struct {
void* unk01;
void* unk02;
void* start;
void* end;
off_t offset;
int unk04;
int unk05;
int protection;
int memoryType;
unsigned isFlexibleMemory : 1;
unsigned isDirectMemory : 1;
unsigned isStack : 1;
Expand Down
16 changes: 15 additions & 1 deletion include/orbis/_types/rtc.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
typedef struct OrbisRtcTick {
#include <stdint.h>

typedef struct OrbisRtcTick
{
uint64_t Ticks;
} OrbisRtcTick;

typedef struct OrbisRtcDateTime
{
uint16_t year;
uint16_t month;
uint16_t day;
uint16_t hour;
uint16_t minute;
uint16_t second;
uint32_t microsecond;
} OrbisRtcDateTime;
Loading