first commit

This commit is contained in:
murdle
2026-03-01 02:38:58 +02:00
commit 19250b9db4
19111 changed files with 4358159 additions and 0 deletions

View File

@@ -0,0 +1,177 @@
#pragma once
#include <ctrl.h>
#include <touch.h>
#define MAP_STYLE_0 0
#define MAP_STYLE_1 1
#define MAP_STYLE_2 2
#define _360_JOY_BUTTON_A 0x00000001
#define _360_JOY_BUTTON_B 0x00000002
#define _360_JOY_BUTTON_X 0x00000004
#define _360_JOY_BUTTON_Y 0x00000008
#define _360_JOY_BUTTON_START 0x00000010
#define _360_JOY_BUTTON_BACK 0x00000020
#define _360_JOY_BUTTON_RB 0x00000040
#define _360_JOY_BUTTON_LB 0x00000080
#define _360_JOY_BUTTON_RTHUMB 0x00000100
#define _360_JOY_BUTTON_LTHUMB 0x00000200
#define _360_JOY_BUTTON_DPAD_UP 0x00000400
#define _360_JOY_BUTTON_DPAD_DOWN 0x00000800
#define _360_JOY_BUTTON_DPAD_LEFT 0x00001000
#define _360_JOY_BUTTON_DPAD_RIGHT 0x00002000
// fake digital versions of analog values
#define _360_JOY_BUTTON_LSTICK_RIGHT 0x00004000
#define _360_JOY_BUTTON_LSTICK_LEFT 0x00008000
#define _360_JOY_BUTTON_RSTICK_DOWN 0x00010000
#define _360_JOY_BUTTON_RSTICK_UP 0x00020000
#define _360_JOY_BUTTON_RSTICK_RIGHT 0x00040000
#define _360_JOY_BUTTON_RSTICK_LEFT 0x00080000
#define _360_JOY_BUTTON_LSTICK_DOWN 0x00100000
#define _360_JOY_BUTTON_LSTICK_UP 0x00200000
#define _360_JOY_BUTTON_RT 0x00400000
#define _360_JOY_BUTTON_LT 0x00800000
// PSVita equivalents
#define _PSV_JOY_BUTTON_X _360_JOY_BUTTON_A
#define _PSV_JOY_BUTTON_O _360_JOY_BUTTON_B
#define _PSV_JOY_BUTTON_SQUARE _360_JOY_BUTTON_X
#define _PSV_JOY_BUTTON_TRIANGLE _360_JOY_BUTTON_Y
#define _PSV_JOY_BUTTON_START _360_JOY_BUTTON_START
#define _PSV_JOY_BUTTON_SELECT _360_JOY_BUTTON_BACK
#define _PSV_JOY_BUTTON_R1 _360_JOY_BUTTON_RB
#define _PSV_JOY_BUTTON_L1 _360_JOY_BUTTON_LB
#define _PSV_JOY_BUTTON_R3 _360_JOY_BUTTON_RTHUMB
#define _PSV_JOY_BUTTON_L3 _360_JOY_BUTTON_LTHUMB
#define _PSV_JOY_BUTTON_DPAD_UP _360_JOY_BUTTON_DPAD_UP
#define _PSV_JOY_BUTTON_DPAD_DOWN _360_JOY_BUTTON_DPAD_DOWN
#define _PSV_JOY_BUTTON_DPAD_LEFT _360_JOY_BUTTON_DPAD_LEFT
#define _PSV_JOY_BUTTON_DPAD_RIGHT _360_JOY_BUTTON_DPAD_RIGHT
#define _PSV_JOY_BUTTON_LSTICK_RIGHT _360_JOY_BUTTON_LSTICK_RIGHT
#define _PSV_JOY_BUTTON_LSTICK_LEFT _360_JOY_BUTTON_LSTICK_LEFT
#define _PSV_JOY_BUTTON_RSTICK_DOWN _360_JOY_BUTTON_RSTICK_DOWN
#define _PSV_JOY_BUTTON_RSTICK_UP _360_JOY_BUTTON_RSTICK_UP
#define _PSV_JOY_BUTTON_RSTICK_RIGHT _360_JOY_BUTTON_RSTICK_RIGHT
#define _PSV_JOY_BUTTON_RSTICK_LEFT _360_JOY_BUTTON_RSTICK_LEFT
#define _PSV_JOY_BUTTON_LSTICK_DOWN _360_JOY_BUTTON_LSTICK_DOWN
#define _PSV_JOY_BUTTON_LSTICK_UP _360_JOY_BUTTON_LSTICK_UP
#define _PSV_JOY_BUTTON_R2 _360_JOY_BUTTON_RT
#define _PSV_JOY_BUTTON_L2 _360_JOY_BUTTON_LT
// Stick axis maps - to allow changes for SouthPaw in-game axis mapping
#define AXIS_MAP_LX 0
#define AXIS_MAP_LY 1
#define AXIS_MAP_RX 2
#define AXIS_MAP_RY 3
// Trigger map - to allow for swap triggers in-game
#define TRIGGER_MAP_0 0
#define TRIGGER_MAP_1 1
enum EKeyboardResult
{
EKeyboard_Pending,
EKeyboard_Cancelled,
EKeyboard_ResultAccept,
EKeyboard_ResultDecline,
};
typedef struct _STRING_VERIFY_RESPONSE
{
WORD wNumStrings;
HRESULT *pStringResult;
}
STRING_VERIFY_RESPONSE;
class C_4JInput
{
public:
enum EKeyboardMode
{
EKeyboardMode_Default,
EKeyboardMode_Numeric,
EKeyboardMode_Password,
EKeyboardMode_Alphabet,
EKeyboardMode_Full,
EKeyboardMode_Alphabet_Extended,
EKeyboardMode_IP_Address,
EKeyboardMode_Phone
};
void Initialise( int iInputStateC, unsigned char ucMapC,unsigned char ucActionC, unsigned char ucMenuActionC );
void Tick(void);
void SetDeadzoneAndMovementRange(unsigned int uiDeadzone, unsigned int uiMovementRangeMax );
void SetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction,unsigned int uiActionVal);
unsigned int GetGameJoypadMaps(unsigned char ucMap,unsigned char ucAction);
void SetJoypadMapVal(int iPad,unsigned char ucMap);
unsigned char GetJoypadMapVal(int iPad);
void SetJoypadSensitivity(int iPad, float fSensitivity);
unsigned int GetValue(int iPad,unsigned char ucAction, bool bRepeat=false);
bool ButtonPressed(int iPad,unsigned char ucAction=255); // toggled
bool ButtonReleased(int iPad,unsigned char ucAction); //toggled
bool ButtonDown(int iPad,unsigned char ucAction=255); // button held down
// Functions to remap the axis and triggers for in-game (not menus) - SouthPaw, etc
void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo);
void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo);
void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs);
void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam );
FLOAT GetIdleSeconds(int iPad);
bool IsPadConnected(int iPad);
void SetCircleCrossSwapped(bool swapped);
bool IsCircleCrossSwapped();
// Map touch input to buttons
void MapTouchInput(int iPad, unsigned int uiActionVal);
// In-Game values which may have been remapped due to Southpaw, swap triggers, etc
float GetJoypadStick_LX(int iPad, bool bCheckMenuDisplay=true);
float GetJoypadStick_LY(int iPad, bool bCheckMenuDisplay=true);
float GetJoypadStick_RX(int iPad, bool bCheckMenuDisplay=true);
float GetJoypadStick_RY(int iPad, bool bCheckMenuDisplay=true);
unsigned char GetJoypadLTrigger(int iPad, bool bCheckMenuDisplay=true);
unsigned char GetJoypadRTrigger(int iPad, bool bCheckMenuDisplay=true);
SceTouchData* GetTouchPadData(int iPad, bool bCheckMenuDisplay);
void SetMenuDisplayed(int iPad, bool bVal);
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode);
void GetText(uint16_t *UTF16String);
// Online check strings against offensive list - TCR 92
// TCR # 092 CMTV Player Text String Verification
// Requirement Any player-entered text visible to another player on Xbox LIVE must be verified using the Xbox LIVE service before being transmitted. Text that is rejected by the Xbox LIVE service must not be displayed.
//
// Remarks
// This requirement applies to any player-entered string that can be exposed to other players on Xbox LIVE. It includes session names, content descriptions, text messages, tags, team names, mottos, comments, and so on.
//
// Games may decide to not send the text, blank it out, or use generic text if the text was rejected by the Xbox LIVE service.
//
// Games verify the text by calling the XStringVerify function.
//
// Exemption It is not required to use the Xbox LIVE service to verify real-time text communication. An example of real-time text communication is in-game text chat.
//
// Intent Protect players from inappropriate language.
bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam);
void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam);
void CancelAllVerifyInProgress(void);
bool IsVitaTV();
//bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput);
};
// Singleton
extern C_4JInput InputManager;

View File

@@ -0,0 +1,194 @@
#pragma once
#include <np/np_common.h>
#include <np_toolkit.h>
#include <np.h>
#include <message_dialog.h>
using namespace sce::Toolkit::NP;
using namespace sce::Toolkit::NP::Utilities;
enum eAwardType
{
eAwardType_Achievement = 0,
eAwardType_GamerPic,
eAwardType_Theme,
eAwardType_AvatarItem,
};
enum eUpsellType
{
eUpsellType_Custom = 0, // This is the default, and means that the upsell dialog was initiated in the app code
eUpsellType_Achievement,
eUpsellType_GamerPic,
eUpsellType_Theme,
eUpsellType_AvatarItem,
};
enum eUpsellResponse
{
eUpsellResponse_Declined,
eUpsellResponse_Accepted_NoPurchase,
eUpsellResponse_Accepted_Purchase,
eUpsellResponse_UserNotSignedInPSN
};
class C_4JProfile
{
public:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// INIT
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 4 players have game defined data, puiGameDefinedDataChangedBitmask needs to be checked by the game side to see if there's an update needed - it'll have the bits set for players to be updated
void Initialise( const SceNpCommunicationConfig _commsId,
const std::string _serviceID,
unsigned short usProfileVersion,
UINT uiProfileValuesC,
UINT uiProfileSettingsC,
DWORD *pdwProfileSettingsA,
int iGameDefinedDataSizeX4,
unsigned int *puiGameDefinedDataChangedBitmask);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SIGN-IN/USERS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool IsSignedIn(int iQuadrant);
bool IsSignedInLive(int iProf);
bool IsSignedInPSN(int iProf);
bool IsGuest(int iQuadrant);
UINT RequestSignInUI(bool bFromInvite,bool bLocalGame,bool bNoGuestsAllowed,bool bMultiplayerSignIn,bool bAddUser, int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY);
void SetPrimaryPlayerChanged(bool bVal);
bool QuerySigninStatus(void);
void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid);
BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2);
void GetSceNpId(int iPad, SceNpId *npId);
DWORD GetSignedInUsersMask();
void SetNetworkStatus(bool bOnlinePSN, bool bSignedInPSN);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MISC
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int GetLockedProfile();
void SetLockedProfile(int iProf);
void SetGetStringFunc(LPCWSTR ( *Func)(int));
void SetPlayerListTitleID(int id);
bool AllowedToPlayMultiplayer(int iProf);
bool HasPlayStationPlus(int iProf);
void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame
void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed);
BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount );
void ResetProfileProcessState(); // after a sign out from the primary player, call this
void Tick( void );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AVATAR
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
int iPad;
int ( *m_fnFunc)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes);
LPVOID m_fnFunc_Param;
}
FUNCPARAMS;
bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam);
void CancelProfileAvatarRequest();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SYS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int GetPrimaryPad();
void SetPrimaryPad(int iPad);
char* GetGamertag(int iPad);
wstring GetDisplayName(int iPad);
bool IsFullVersion();
void SetFullVersion(bool bFull);
void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam);
void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam);
bool RegionIsNorthAmerica(void);
bool LocaleIsUSorCanada(void);
HRESULT GetLiveConnectionStatus();
bool IsSystemUIDisplayed();
void SetSysUIShowing( bool bUIDisplayed );
void DisplaySystemMessage( SceMsgDialogSystemMessageType _type, int iQuadrant);
void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam);
void ShowSystemMessage( int _type, int _val );
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ACHIEVEMENTS & AWARDS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void InitialiseTrophies(); //CD - Don't use this, auto setup after login
void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
CXuiStringTable*pStringTable=NULL, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=NULL, unsigned int uiThemeSize=0L);
int GetAwardId(int iAwardNumber);
eAwardType GetAwardType(int iAwardNumber);
bool CanBeAwarded(int iQuadrant, int iAwardNumber);
void Award(int iQuadrant, int iAwardNumber, bool bForce=false);
bool IsAwardsFlagSet(int iQuadrant, int iAward);
void Terminate();
void SetFatalTrophyErrorID(int id); //CD - Deprecated
int WaitTrophyInitComplete(); //CD - Deprecated
int tryWaitTrophyInitComplete(); //CD - Deprecated
void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject);
void SetTrialAwardText(eAwardType AwardType,int iTitle,int iText); // achievement popup in the trial game
void SetHDDFreeKB(int iHDDFreeKB);
void SetMinSaveKB(int iMinSaveKB);
int GetHDDFreeKB(void);
bool AreTrophiesInstalled();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// RICH PRESENCE
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void RichPresenceRegisterPresenceString(int index, const char* str);
void RichPresenceRegisterContext(int ctxID, const char* token);
void RichPresenceRegisterContextString(int ctxID, int strIndex, const char* str);
void RichPresenceInit(int iPresenceCount, int iContextCount);
void SetRichPresenceContextValue(int iPad,int iContextID, int iVal);
void SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle=false);
void SetRichPresenceSettingFn(int ( *SetPresenceInfoFn)(const void *data));
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PURCHASE
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1);
void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Debug
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Chat and content restrictions
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool GetChatAndContentRestrictions(int iPad, bool thisQuadrantOnly,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge);
void SetServiceID(char *pchServiceID); // needed for the ticket request for the chat restrictions of secondary PSN players
void HandleNetworkTicket(int result,void *arg);
void SetMinimumAge(int iAge, int iRegion);// 0 - SCEE, 1- SCEA, 2 - SCEJ
int GetMinimumAge();
void SetGermanyMinimumAge(int iAge);
int GetGermanyMinimumAge();
void SetRussiaMinimumAge(int iAge);
int GetRussiaMinimumAge();
void SetAustraliaMinimumAge(int iAge);
int GetAustraliaMinimumAge();
void SetJapanMinimumAge(int iAge);
int GetJapanMinimumAge();
void SetKoreaMinimumAge(int iAge);
int GetKoreaMinimumAge();
int getUserID(int iQuadrant); // grab the PS4 userID for this quadrant (SCE_USER_SERVICE_USER_ID_INVALID if it's not signed in)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Http calls
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool SonyHttp_init();
void SonyHttp_shutdown();
bool SonyHttp_getDataFromURL(const char* szURL, void** ppOutData, int* pDataSize);
};
// Singleton
extern C_4JProfile ProfileManager;

View File

@@ -0,0 +1,318 @@
#pragma once
#include <gxm.h>
class ImageFileBuffer
{
public:
enum EImageType
{
e_typePNG,
e_typeJPG
};
EImageType m_type;
void* m_pBuffer;
int m_bufferSize;
int GetType() { return m_type; }
void *GetBufferPointer() { return m_pBuffer; }
int GetBufferSize() { return m_bufferSize; }
void Release() { free(m_pBuffer); m_pBuffer = NULL; }
bool Allocated() { return m_pBuffer != NULL; }
};
typedef struct
{
int Width;
int Height;
}D3DXIMAGE_INFO;
typedef struct _XSOCIAL_PREVIEWIMAGE {
BYTE *pBytes;
DWORD Pitch;
DWORD Width;
DWORD Height;
// D3DFORMAT Format;
} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE;
class C4JRender
{
public:
void Tick();
void UpdateGamma(unsigned short usGamma);
// Matrix stack
void MatrixMode(int type);
void MatrixSetIdentity();
void MatrixTranslate(float x,float y,float z);
void MatrixRotate(float angle, float x, float y, float z);
void MatrixScale(float x, float y, float z);
void MatrixPerspective(float fovy, float aspect, float zNear, float zFar);
void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar);
void MatrixPop();
void MatrixPush();
void MatrixMult(float *mat);
const float *MatrixGet(int type);
void Set_matrixDirty();
// Core
void Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain);
void InitialiseContext();
void StartFrame();
void Present();
void Clear(int flags, D3D11_RECT *pRect = NULL);
void SetClearColour(const float colourRGBA[4]);
bool IsWidescreen();
bool IsHiDef();
void CaptureThumbnail(ImageFileBuffer *pngOut);
void CaptureScreen(ImageFileBuffer *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut);
void BeginConditionalSurvey(int identifier);
void EndConditionalSurvey();
void BeginConditionalRendering(int identifier);
void EndConditionalRendering();
// Vertex data handling
typedef enum
{
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD
VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied,
VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen
VERTEX_TYPE_COUNT
} eVertexType;
// Pixel shader
typedef enum
{
PIXEL_SHADER_TYPE_STANDARD,
PIXEL_SHADER_TYPE_PROJECTION,
PIXEL_SHADER_COUNT
} ePixelShaderType;
typedef enum
{
VIEWPORT_TYPE_FULLSCREEN,
VIEWPORT_TYPE_SPLIT_TOP,
VIEWPORT_TYPE_SPLIT_BOTTOM,
VIEWPORT_TYPE_SPLIT_LEFT,
VIEWPORT_TYPE_SPLIT_RIGHT,
VIEWPORT_TYPE_QUADRANT_TOP_LEFT,
VIEWPORT_TYPE_QUADRANT_TOP_RIGHT,
VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT,
VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT,
} eViewportType;
typedef enum
{
PRIMITIVE_TYPE_TRIANGLE_LIST,
PRIMITIVE_TYPE_TRIANGLE_STRIP,
PRIMITIVE_TYPE_TRIANGLE_FAN,
PRIMITIVE_TYPE_QUAD_LIST,
PRIMITIVE_TYPE_LINE_LIST,
PRIMITIVE_TYPE_LINE_STRIP,
PRIMITIVE_TYPE_COUNT
} ePrimitiveType;
void DrawVertices(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType);
#ifdef __PSVITA__
void DrawVerticesCutOut(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType);
#endif
void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType);
// Command buffers
void CBuffLockStaticCreations();
int CBuffCreate(int count);
void CBuffDelete(int first, int count);
void CBuffStart(int index);
void CBuffClear(int index);
int CBuffSize(int index);
void CBuffEnd();
bool CBuffCall(int index, bool full = true);
#ifdef __PSVITA__
bool CBuffCallCutOut(int index, bool full = true);
#endif
void CBuffTick();
void CBuffDeferredModeStart();
void CBuffDeferredModeEnd();
typedef enum
{
TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per component
/* Don't think these are all directly available on D3D 11 - leaving for now
TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to alpha channel, R=G=B=0
TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit component mapped to alpha channel, R=G=B=1
TEXTURE_FORMAT_RxGxBxAx, // One 8-bit component mapped to all channels
*/
MAX_TEXTURE_FORMATS
} eTextureFormat;
// Textures
int TextureCreate();
void TextureFree(int idx);
void TextureBind(int idx);
void TextureBindVertex(int idx);
void TextureSetTextureLevels(int levels);
int TextureGetTextureLevels();
unsigned char * TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw);
void TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level);
void TextureSetParam(int param, int value);
void TextureDynamicUpdateStart();
void TextureDynamicUpdateEnd();
HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut);
HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut);
void TextureGetStats();
SceGxmTexture *TextureGetTexture(int idx);
// State control
void StateSetColour(float r, float g, float b, float a);
void StateSetDepthMask(bool enable);
void StateSetBlendEnable(bool enable);
void StateSetBlendFunc(int src, int dst);
void StateSetBlendFactor(unsigned int colour);
void StateSetAlphaFunc(int func, float param);
void StateSetDepthFunc(int func);
void StateSetFaceCull(bool enable);
void StateSetFaceCullCW(bool enable);
void StateSetLineWidth(float width);
void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha);
void StateSetDepthTestEnable(bool enable);
void StateSetAlphaTestEnable(bool enable);
void StateSetDepthSlopeAndBias(float slope, float bias);
void StateSetFogEnable(bool enable);
void StateSetFogMode(int mode);
void StateSetFogNearDistance(float dist);
void StateSetFogFarDistance(float dist);
void StateSetFogDensity(float density);
void StateSetFogColour(float red, float green, float blue);
void StateSetLightingEnable(bool enable);
void StateSetVertexTextureUV( float u, float v);
void StateSetLightColour(int light, float red, float green, float blue);
void StateSetLightAmbientColour(float red, float green, float blue);
void StateSetLightDirection(int light, float x, float y, float z);
void StateSetLightEnable(int light, bool enable);
void StateSetViewport(eViewportType viewportType);
void StateSetEnableViewportClipPlanes(bool enable);
void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace);
void StateSetStencil(SceGxmStencilFunc Function, uint8_t stencil_func_mask, uint8_t stencil_write_mask);
void StateSetForceLOD(int LOD);
// Event tracking
void BeginEvent(LPCWSTR eventName);
void EndEvent();
void* allocGPURWMem(const size_t size,const size_t alignment = 16);
void freeGPURWMem(void* mem);
void* allocGPUROMem(const size_t size,const size_t alignment = 16);
void freeGPUROMem(void* mem);
void* allocGPUCDMem(const size_t size,const size_t alignment = 16);
void freeGPUCDMem(void* mem);
int getDisplayBufferCount();
volatile uint32_t *getNotificationRegion();
SceGxmContext *getGXMContext();
SceGxmColorSurface *getCurrentDisplaySurface();
SceGxmDepthStencilSurface *getCurrentDepthSurface();
SceGxmShaderPatcher *getGXMShaderPatcher();
void setFragmentNotification(SceGxmNotification notification);
bool GetIsInScene();
void SetCameraPosition(float x, float y, float z);
};
const int GL_MODELVIEW_MATRIX = 0;
const int GL_PROJECTION_MATRIX = 1;
const int GL_MODELVIEW = 0;
const int GL_PROJECTION = 1;
const int GL_TEXTURE = 2;
// These things required for tex gen
const int GL_S = 0;
const int GL_T = 1;
const int GL_R = 2;
const int GL_Q = 3;
const int GL_TEXTURE_GEN_S = 0;
const int GL_TEXTURE_GEN_T = 1;
const int GL_TEXTURE_GEN_Q = 2;
const int GL_TEXTURE_GEN_R = 3;
const int GL_TEXTURE_GEN_MODE = 0;
const int GL_OBJECT_LINEAR = 0;
const int GL_EYE_LINEAR = 1;
const int GL_OBJECT_PLANE = 0;
const int GL_EYE_PLANE = 1;
// These things are used by glEnable/glDisable so must be different and non-zero (zero is used by things we haven't assigned yet)
const int GL_TEXTURE_2D = 1;
const int GL_BLEND = 2;
const int GL_CULL_FACE = 3;
const int GL_ALPHA_TEST = 4;
const int GL_DEPTH_TEST = 5;
const int GL_FOG = 6;
const int GL_LIGHTING = 7;
const int GL_LIGHT0 = 8;
const int GL_LIGHT1 = 9;
const int CLEAR_DEPTH_FLAG = 1;
const int CLEAR_COLOUR_FLAG = 2;
const int GL_DEPTH_BUFFER_BIT = CLEAR_DEPTH_FLAG;
const int GL_COLOR_BUFFER_BIT = CLEAR_COLOUR_FLAG;
const int GL_SRC_ALPHA = D3D11_BLEND_SRC_ALPHA;
const int GL_ONE_MINUS_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA;
const int GL_ONE = D3D11_BLEND_ONE;
const int GL_ZERO = D3D11_BLEND_ZERO;
const int GL_DST_ALPHA = D3D11_BLEND_DEST_ALPHA;
const int GL_SRC_COLOR = D3D11_BLEND_SRC_COLOR;
const int GL_DST_COLOR = D3D11_BLEND_DEST_COLOR;
const int GL_ONE_MINUS_DST_COLOR = D3D11_BLEND_INV_DEST_COLOR;
const int GL_ONE_MINUS_SRC_COLOR = D3D11_BLEND_INV_SRC_COLOR;
const int GL_CONSTANT_ALPHA = D3D11_BLEND_BLEND_FACTOR;
const int GL_ONE_MINUS_CONSTANT_ALPHA = D3D11_BLEND_INV_BLEND_FACTOR;
const int GL_GREATER = D3D11_COMPARISON_GREATER;
const int GL_EQUAL = D3D11_COMPARISON_EQUAL;
const int GL_LEQUAL = D3D11_COMPARISON_LESS_EQUAL;
const int GL_GEQUAL = D3D11_COMPARISON_GREATER_EQUAL;
const int GL_ALWAYS = D3D11_COMPARISON_ALWAYS;
const int GL_TEXTURE_MIN_FILTER = 1;
const int GL_TEXTURE_MAG_FILTER = 2;
const int GL_TEXTURE_WRAP_S = 3;
const int GL_TEXTURE_WRAP_T = 4;
const int GL_NEAREST = 0;
const int GL_LINEAR = 1;
const int GL_EXP = 2;
const int GL_NEAREST_MIPMAP_LINEAR = 0; // TODO - mipmapping bit of this
const int GL_CLAMP = 0;
const int GL_REPEAT = 1;
const int GL_FOG_START = 1;
const int GL_FOG_END = 2;
const int GL_FOG_MODE = 3;
const int GL_FOG_DENSITY = 4;
const int GL_FOG_COLOR = 5;
const int GL_POSITION = 1;
const int GL_AMBIENT = 2;
const int GL_DIFFUSE = 3;
const int GL_SPECULAR = 4;
const int GL_LIGHT_MODEL_AMBIENT = 1;
const int GL_LINES = C4JRender::PRIMITIVE_TYPE_LINE_LIST;
const int GL_LINE_STRIP = C4JRender::PRIMITIVE_TYPE_LINE_STRIP;
const int GL_QUADS = C4JRender::PRIMITIVE_TYPE_QUAD_LIST;
const int GL_TRIANGLE_FAN = C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN;
const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP;
// Singleton
extern C4JRender RenderManager;

View File

@@ -0,0 +1,389 @@
#pragma once
using namespace std;
#include <fios2.h>
//#define MAX_DISPLAYNAME_LENGTH 128 // SCE_SAVE_DATA_SUBTITLE_MAXSIZE on PS4
#define MAX_DISPLAYNAME_LENGTH 128 // SCE_APPUTIL_SAVEDATA_SLOT_SUBTITLE_MAXSIZE on Vita
//#define MAX_SAVEFILENAME_LENGTH 32 // SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE on PS4
#define MAX_SAVEFILENAME_LENGTH 64//SCE_APPUTIL_SAVEDATA_SLOT_TITLE_MAXSIZE on Vita
#define USER_INDEX_ANY 0x000000FF
#define RESULT LONG
class StringTable;
typedef struct
{
char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH];
char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH];
time_t modifiedTime;
PBYTE thumbnailData;
unsigned int thumbnailSize;
//int sizeKB;
}
SAVE_INFO,*PSAVE_INFO;
typedef struct
{
int iSaveC;
PSAVE_INFO SaveInfoA;
}
SAVE_DETAILS,*PSAVE_DETAILS;
class CONTENT_DATA
{
public:
enum Type
{
e_contentLocked,
e_contentUnlocked
};
int DeviceID;
DWORD dwContentType;
WCHAR wszDisplayName[256];
CHAR szFileName[SCE_FIOS_PATH_MAX];
};
typedef CONTENT_DATA XCONTENT_DATA, *PXCONTENT_DATA; // TODO - put back in when actually interfacing with game
#define MARKETPLACE_CONTENTOFFER_INFO int
// Current version of the dlc data creator
#define CURRENT_DLC_VERSION_NUM 3
// MGH - moved these here from Orbis_App.h
enum e_SONYDLCType
{
eSONYDLCType_SkinPack=0,
eSONYDLCType_TexturePack,
eSONYDLCType_MashUpPack,
eSONYDLCType_All
};
typedef struct
{
char chDLCKeyname[16];
//char chDLCTitle[64];
e_SONYDLCType eDLCType;
int iFirstSkin;
int iConfig; // used for texture pack data files
}
SONYDLC;
class C4JStorage
{
public:
struct PROFILESETTINGS
{
int iYAxisInversion;
int iControllerSensitivity;
int iVibration;
bool bSwapSticks;
};
// Structs defined in the DLC_Creator, but added here to be used in the app
typedef struct
{
unsigned int uiFileSize;
DWORD dwType;
DWORD dwWchCount; // count of WCHAR in next array
WCHAR wchFile[1];
}
DLC_FILE_DETAILS, *PDLC_FILE_DETAILS;
typedef struct
{
DWORD dwType;
DWORD dwWchCount; // count of WCHAR in next array;
WCHAR wchData[1]; // will be an array of size dwBytes
}
DLC_FILE_PARAM, *PDLC_FILE_PARAM;
// End of DLC_Creator structs
typedef struct
{
DWORD dwVersion;
DWORD dwNewOffers;
DWORD dwTotalOffers;
DWORD dwInstalledTotalOffers;
BYTE bPadding[1024-sizeof(DWORD)*4]; // future expansion
}
DLC_TMS_DETAILS;
typedef struct
{
DWORD dwSize;
PBYTE pbData;
}
TMSPP_FILEDATA, *PTMSPP_FILEDATA;
enum eTMS_FILETYPEVAL
{
TMS_FILETYPE_BINARY=0,
TMS_FILETYPE_CONFIG=1,
TMS_FILETYPE_JSON=2,
TMS_FILETYPE_MAX,
};
enum eGlobalStorage
{
//eGlobalStorage_GameClip=0,
eGlobalStorage_Title=0,
eGlobalStorage_TitleUser,
eGlobalStorage_Max
};
enum EMessageResult
{
EMessage_Undefined=0,
EMessage_Busy,
EMessage_Pending,
EMessage_Cancelled,
EMessage_ResultAccept,
EMessage_ResultDecline,
EMessage_ResultThirdOption,
EMessage_ResultFourthOption
};
enum ESaveGameState
{
ESaveGame_Idle=0,
ESaveGame_Save,
ESaveGame_SaveCompleteSuccess,
ESaveGame_SaveCompleteFail,
ESaveGame_SaveIncomplete,
ESaveGame_SaveIncomplete_WaitingOnResponse,
ESaveGame_Load,
ESaveGame_LoadCompleteSuccess,
ESaveGame_LoadCompleteFail,
ESaveGame_Delete,
ESaveGame_DeleteSuccess,
ESaveGame_DeleteFail,
ESaveGame_Rename,
ESaveGame_RenameSuccess,
ESaveGame_RenameFail,
ESaveGame_GetSaveThumbnail, // Not used as an actual state in the PS4, but the game expects this to be returned to indicate success when getting a thumbnail
ESaveGame_GetSaveInfo,
ESaveGame_SaveCache,
ESaveGame_ReconstructCache
};
enum EOptionsState
{
EOptions_Idle=0,
EOptions_Save,
EOptions_Load,
EOptions_Delete,
EOptions_NoSpace,
EOptions_Corrupt,
};
enum ESaveGameStatus
{
EDeleteGame_Idle=0,
EDeleteGame_InProgress,
};
enum EDLCStatus
{
EDLC_Error=0,
EDLC_Idle,
EDLC_NoOffers,
EDLC_AlreadyEnumeratedAllOffers,
EDLC_NoInstalledDLC,
EDLC_Pending,
EDLC_LoadInProgress,
EDLC_Loaded,
EDLC_ChangedDevice
};
enum ESavingMessage
{
ESavingMessage_None=0,
ESavingMessage_Short,
ESavingMessage_Long
};
enum ESaveIncompleteType
{
ESaveIncomplete_None,
ESaveIncomplete_OutOfQuota,
ESaveIncomplete_OutOfLocalStorage,
ESaveIncomplete_Unknown
};
enum ETMSStatus
{
ETMSStatus_Idle=0,
ETMSStatus_Fail,
ETMSStatus_ReadInProgress,
ETMSStatus_ReadFileListInProgress,
ETMSStatus_WriteInProgress,
ETMSStatus_Fail_ReadInProgress,
ETMSStatus_Fail_ReadFileListInProgress,
ETMSStatus_Fail_ReadDetailsNotRetrieved,
ETMSStatus_Fail_WriteInProgress,
ETMSStatus_DeleteInProgress,
ETMSStatus_Pending,
};
enum eTMS_FileType
{
eTMS_FileType_Normal=0,
eTMS_FileType_Graphic,
};
enum ESGIStatus
{
ESGIStatus_Error=0,
ESGIStatus_Idle,
ESGIStatus_ReadInProgress,
ESGIStatus_NoSaves,
};
enum
{
PROFILE_READTYPE_ALL,
PROFILE_READTYPE_XBOXSETTINGS // just read the settings (after a notification of settings change)
};
enum eOptionsCallback
{
eOptions_Callback_Idle,
eOptions_Callback_Write,
eOptions_Callback_Write_Fail_NoSpace,
eOptions_Callback_Write_Fail,
eOptions_Callback_Read,
eOptions_Callback_Read_Fail,
eOptions_Callback_Read_FileNotFound,
eOptions_Callback_Read_Corrupt,
eOptions_Callback_Read_CorruptDeletePending,
eOptions_Callback_Read_CorruptDeleted
};
///////////////////////////////////////////////////////////////////////////// Global storage manager //////////////////////////////////////////////////////////////////////////////
C4JStorage();
void Tick(void); // General storage manager tick to be called from game
///////////////////////////////////////////////////////////////////////////// Savegame data ///////////////////////////////////////////////////////////////////////////////////////
// Initialisation
void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, // General manager initialisation
int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,LPCSTR szGroupID);
void SetGameSaveFolderTitle(WCHAR *wszGameSaveFolderTitle); // Sets the title to be set in the param.sfo of saves (this doesn't vary, the sub-title is used for the user cho
void SetSaveCacheFolderTitle(WCHAR *wszSaveCacheFolderTitle); // Sets the title to be set in the param.sfo of the save cache
void SetOptionsFolderTitle(WCHAR *wszOptionsFolderTitle); // Sets the title to be set in the param.sfo of the options file
void SetGameSaveFolderPrefix(char *szGameSaveFolderPrefix); // Sets the prefix to be added to the unique filename of each save to construct a final folder name
void SetMaxSaves(int iMaxC); // Sets the maximum number of saves to be evaluated by GetSavesInfo etc.
void SetDefaultImages(PBYTE pbOptionsImage,DWORD dwOptionsImageBytes,PBYTE pbSaveImage,DWORD dwSaveImageBytes, // Sets default save image and thumbnail, which can be used when saving a game that hasn't generated any yet
PBYTE pbSaveThumbnail,DWORD dwSaveThumbnailBytes);
void SetIncompleteSaveCallback(void( *Func)(LPVOID, const ESaveIncompleteType, int blocksRequired), LPVOID param); // Sets callback to be used in the event of a save method not being able to complete
// Miscellaneous control
void SetSaveDisabled(bool bDisable); // Sets saving disabled/enabled state
bool GetSaveDisabled(void); // Determines whether saving has been disabled
void ResetSaveData(); // Releases any internal storage being held for previously saved/loaded data
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists); // Determine if current savegame exists on storage device
bool EnoughSpaceForAMinSaveGame();
// Get details of existing savedata
C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName); // Start search
PSAVE_DETAILS ReturnSavesInfo(); // Returns result of search (or NULL if not yet received)
void ClearSavesInfo(); // Clears results
C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); // Get the thumbnail for an individual save referenced by pSaveInfo
// Loading savedata & obtaining information from just-loaded file
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam); // Loads savedata referenced by pSaveInfo, calls callback once complete
unsigned int GetSaveSize(); // Obtains sizse of just-loaded save
void GetSaveData(void *pvData,unsigned int *puiBytes); // Obtains pointer to, and size, of just-loaded save
bool GetSaveUniqueNumber(INT *piVal); // Gets the unique numeric portion of the folder name used for the save (encodes m
bool GetSaveUniqueFilename(char *pszName); // Get the full unique "filename" used as part of the folder name for the save
bool GetSaveUniqueFileDir(char *pszName); // Get the full unique "filename" used as part of the folder name for the save
// Saving savedata
void SetSaveTitle(const wchar_t *UTF16String); // Sets the name which is used as a sub-title in the savedata param.sfo
PVOID AllocateSaveData(unsigned int uiBytes); // Allocate storage manager owned memory to the data which is to be saved to
void SetSaveDataSize(unsigned int uiBytes); // Set the actual size of data to be saved
void GetDefaultSaveImage(PBYTE *ppbSaveImage,DWORD *pdwSaveImageBytes); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t
void GetDefaultSaveThumbnail(PBYTE *ppbSaveThumbnail,DWORD *pdwSaveThumbnailBytes); // Get the default save image (as set by SetDefaultImages) for use on saving games that
void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png
C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam); // Save the actual data, calling callback on completion
// Handling of incomplete saves (either sub-files or save data). To be used after game has had callback for an incomplete save event
void ContinueIncompleteOperation();
void CancelIncompleteOperation();
ESaveIncompleteType GetSaveError(); // Returns the save error [SaveData]
void ClearSaveError(); // Clears any save error
ESaveIncompleteType GetOptionsSaveError(); // Returns the save error [Options]
void ClearOptionsSaveError(); // Clears any save error
// Other file operations
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Deletes savedata referenced by pSaveInfo, calls callback when comple
C4JStorage::ESaveGameState RenameSaveData(int iRenameIndex, uint16_t*pui16NewName, int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Renamed savedata with index from last established ReturnSavesInfo.
// Internal methods
private:
void GetSaveImage(PBYTE *ppbSaveImage, int *puiSaveImageBytes);
void GetSaveThumbnail(PBYTE *ppbSaveThumbnail, int *puiSaveThumbnailBytes);
public:
void SetSaveUniqueFilename(char *szFilename); // MGH - made this public, used for the cross save stuff
void EnableDownloadSave(); // CD - Used for cross/download-save, sets a flag for saving
///////////////////////////////////////////////////////////////////////////// Profile data ////////////////////////////////////////////////////////////////////////////////////////
public:
// Initialisation
void InitialiseProfileData(unsigned short usProfileVersion, UINT uiProfileValuesC, UINT uiProfileSettingsC, DWORD *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask); // General initialisation
int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); // Set a callback that can initialise a profile's storage to its default settings
void SetOptionsDataCallback(int( *Func)(LPVOID, int iPad, unsigned short usVersion, C4JStorage::eOptionsCallback),LPVOID lpParam); // Sets callback that is called when status of any options has changed
int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam);
// Getting and setting of profile data
PROFILESETTINGS * GetDashboardProfileSettings(int iPad); // Get pointer to the standard (originally xbox dashboard) profile data for one user
void *GetGameDefinedProfileData(int iQuadrant); // Get pointer to the game-defined profile data for one user
// Reading and writing profiles
void ReadFromProfile(int iQuadrant, int iReadType=PROFILE_READTYPE_ALL); // Initiate read profile data for one user - read type is ignored on this platform
void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); // Initiate write profile for one user
void DeleteOptionsData(int iPad); // Delete profile data for one user
void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY); // Force any queued profile writes to write now
C4JStorage::ESaveGameState GetSaveState();
///////////////////////////////////////////////////////////////////////////// Unimplemented stubs /////////////////////////////////////////////////////////////////////////////////
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {}
bool GetSaveDeviceSelected(unsigned int iPad) { return true; }
void ClearDLCOffers() {}
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize) { return true; }
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; }
C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; }
// DLC
void SetDLCPackageRoot(char *pszDLCRoot);
EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
CONTENT_DATA& GetDLC(DWORD dw);
DWORD GetAvailableDLCCount( int iPad );
DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive = NULL);
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
std::string GetMountedPath(std::string szMount);
void SetDLCProductCode(const char* szProductCode);
void SetProductUpgradeKey(const char* szKey);
bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam);
void SetDLCInfoMap(unordered_map<wstring, SONYDLC *>* pSONYDLCMap);
void EntitlementsCallback(bool bFoundEntitlements);
};
extern C4JStorage StorageManager;