diff options
-rw-r--r-- | include/user/paf.h | 117 | ||||
-rw-r--r-- | include/user/paf/common.h | 274 | ||||
-rw-r--r-- | include/user/paf/graphics.h | 32 | ||||
-rw-r--r-- | include/user/paf/misc.h | 45 | ||||
-rw-r--r-- | include/user/paf/resource.h | 44 | ||||
-rw-r--r-- | include/user/paf/stdc.h | 76 | ||||
-rw-r--r-- | include/user/paf/thread.h | 15 | ||||
-rw-r--r-- | include/user/paf/toplevel.h | 169 | ||||
-rw-r--r-- | include/user/paf/widget.h | 267 | ||||
-rw-r--r-- | nids/360/ScePaf.yml | 75 |
10 files changed, 988 insertions, 126 deletions
diff --git a/include/user/paf.h b/include/user/paf.h index 92e6212..1a6a114 100644 --- a/include/user/paf.h +++ b/include/user/paf.h @@ -5,115 +5,14 @@ #ifndef _VDSUITE_USER_PAF_H #define _VDSUITE_USER_PAF_H -#include <stdarg.h> -#include <wchar.h> -#include <scetypes.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ScePafString { - char *data; - SceSize length; -} ScePafString; - -typedef struct ScePafWString { - SceWChar16 *data; - SceSize length; -} ScePafWString; - -/** - * std C functions - */ - -void *sce_paf_bzero(void *ptr, SceSize num); -void *sce_paf_memchr(const void *ptr, int value, SceSize num); -int sce_paf_memcmp(const void *ptr1, const void *ptr2, SceSize num); -int sce_paf_bcmp(const void *ptr1, const void *ptr2, SceSize num); -void *sce_paf_memcpy(void *destination, const void *source, SceSize num); -void *sce_paf_memmove(void *destination, const void *source, SceSize num); -void *sce_paf_bcopy(void *destination, const void *source, SceSize num); -void *sce_paf_memset(void *ptr, int value, SceSize num); -int sce_paf_snprintf(char *s, SceSize n, const char *format, ...); -int sce_paf_strcasecmp(const char *str1, const char *str2); -char *sce_paf_strchr(const char *str, int character); -int sce_paf_strcmp(const char *str1, const char *str2); -size_t sce_paf_strlen(const char *str); -int sce_paf_strncasecmp(const char *str1, const char *str2, SceSize num); -int sce_paf_strncmp(const char *str1, const char *str2, SceSize num); -char *sce_paf_strncpy(char *destination, const char *source, SceSize num); -char *sce_paf_strrchr(const char *str, int character); - -/** - * wchar functions - */ - -/* __attribute__((__format__(__wprintf__, 3, 4))) */ -int sce_paf_swprintf(wchar_t *buffer, size_t bufsz, const wchar_t *format, ...); - -int sce_paf_vswprintf(wchar_t *buffer, size_t bufsz, const wchar_t *format, va_list vlist); - -wint_t sce_paf_towlower(wint_t wc); - -wchar_t *sce_paf_wcscat(wchar_t *dest, const wchar_t *src); -wchar_t *sce_paf_wcsncat(wchar_t *dest, const wchar_t *src, size_t count); -wchar_t *sce_paf_wcscpy(wchar_t *dest, const wchar_t *src); -wchar_t *sce_paf_wcsncpy(wchar_t *dest, const wchar_t *src, size_t count); - -int sce_paf_wcscasecmp(const wchar_t *s1, const wchar_t *s2); -wchar_t *sce_paf_wcschr(const wchar_t *str, wchar_t ch); -int sce_paf_wcscmp(const wchar_t *lhs, const wchar_t *rhs); -size_t sce_paf_wcscspn(const wchar_t *dest, const wchar_t *src); -size_t sce_paf_wcslen(const wchar_t *str); -int sce_paf_wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n); -int sce_paf_wcsncmp(const wchar_t *lhs, const wchar_t *rhs, size_t count); -size_t sce_paf_wcsnlen(const wchar_t *s, size_t maxlen); -wchar_t *sce_paf_wcspbrk(const wchar_t *dest, const wchar_t *str); -wchar_t *sce_paf_wcsrchr(const wchar_t *str, wchar_t ch); -size_t sce_paf_wcsspn(const wchar_t *dest, const wchar_t *src); - -wchar_t *sce_paf_wmemchr(const wchar_t *ptr, wchar_t ch, size_t count); -int sce_paf_wmemcmp(const wchar_t *lhs, const wchar_t *rhs, size_t count); -wchar_t *sce_paf_wmemcpy(wchar_t *dest, const wchar_t *src, size_t count); -wchar_t *sce_paf_wmemmove(wchar_t *dest, const wchar_t *src, size_t count); - -/** - * CES functions - */ - -#define SCE_PAF_CES_ALLOW_ILLEGAL_CODE 0x2 -#define SCE_PAF_CES_ALLOW_OUT_OF_CODE_RANGE 0x4 -#define SCE_PAF_CES_ALLOW_INVALID_ENCODE 0x8 -#define SCE_PAF_CES_ALLOW_SRC_BUFFER_END 0x10 - -/* UTF8 to UTF16 */ - -SceSSize scePafCesUtf8ToUtf16(const ScePafString *utf8, ScePafWString *utf16); - -SceSSize scePafCesUtf8ToUtf16WithFlag(const ScePafString *utf8, ScePafWString *utf16, SceUInt32 flags); - -SceSSize scePafCesUtf8CharToUtf16(const char *utf8, ScePafWString *utf16); - -SceSSize scePafCesUtf8CharToUtf16WithFlag(const char *utf8, ScePafWString *utf16, SceUInt32 flags); - -ScePafWString *scePafCesUtf8CharToUtf16WithAlloc(const char *utf8, ScePafWString *utf16); - -/* UTF16 to UTF8 */ - -SceSSize scePafCesUtf16ToUtf8(const ScePafWString *utf16, ScePafString *utf8); - -SceSSize scePafCesUtf16ToUtf8WithFlag(const ScePafWString *utf16, ScePafString *utf8, SceUInt32 flags); - -SceSSize scePafCesUtf16CharToUtf8(const SceWChar16 *utf16, ScePafString *utf8); - -SceSSize scePafCesUtf16CharToUtf8WithFlag(const SceWChar16 *utf16, ScePafString *utf8, SceUInt32 flags); - -ScePafString *scePafCesUtf16CharToUtf8WithAlloc(const SceWChar16 *utf16, ScePafString *utf8); - -#ifdef __cplusplus -} -#endif +#include <paf/stdc.h> +#include <paf/common.h> +#include <paf/graphics.h> +#include <paf/misc.h> +#include <paf/resource.h> +#include <paf/thread.h> +#include <paf/toplevel.h> +#include <paf/widget.h> #endif /* _VDSUITE_USER_PAF_H */ diff --git a/include/user/paf/common.h b/include/user/paf/common.h new file mode 100644 index 0000000..81851cf --- /dev/null +++ b/include/user/paf/common.h @@ -0,0 +1,274 @@ +/* + Vita Development Suite Libraries +*/ + +#ifndef _VDSUITE_USER_PAF_COMMON_H +#define _VDSUITE_USER_PAF_COMMON_H + +#include <scetypes.h> +#include <paf/stdc.h> + +namespace paf { + + class String; + class WString; + + namespace common { + + enum CesFlags + { + AllowIllegalCode = 0x2, + AllowOutOfCodeRange = 0x4, + AllowInvalidEncode = 0x8, + AllowSrcBufferEnd = 0x10 + }; + + } + + + class String + { + public: + + String() : data(SCE_NULL), length(0) + { + + } + + ~String() + { + if (data != SCE_NULL) + delete data; + } + + static SceSSize ToWString(const char *src, paf::WString *dst); + + static SceSSize ToWString(const char *src, paf::WString *dst, SceUInt32 flags); + + static String *WCharToNewString(const SceWChar16 *src, String *dst); + + SceSSize ToWString(paf::WString *dst); + + SceSSize ToWString(paf::WString *dst, SceUInt32 flags); + + String *Set(const char *s, SceSize srcLength) + { + if (data == s) + return this; + + if (data != SCE_NULL) + delete data; + + if (srcLength == 0 || s == SCE_NULL || s[0] == 0) { + data = SCE_NULL; + length = 0; + return this; + } + + data = new char[srcLength + 1]; + length = srcLength; + sce_paf_memcpy(data, s, length); + data[length] = 0; + + return this; + } + + String *Set(const char *s) + { + return Set(s, sce_paf_strlen(s)); + } + + String *operator=(const String *s) + { + if (data == s->data) + return this; + + if (s->length == 0) { + data = SCE_NULL; + length = 0; + return this; + } + + data = new char[s->length + 1]; + length = s->length; + sce_paf_memcpy(data, s->data, s->length + 1); + + return this; + } + + String *operator+(const String *s) const + { + String *newStr = new String; + + if (!length && !s->length) + { + return newStr; + } + + newStr->data = new char[s->length + length + 1]; + newStr->length = s->length + length; + sce_paf_memcpy(newStr->data, data, length); + sce_paf_memcpy(&newStr->data[length], s->data, s->length + 1); + newStr->data[newStr->length] = 0; + return newStr; + } + + SceBool operator==(const String *s) const + { + if (s->length != length) + return SCE_FALSE; + + if (!sce_paf_strncmp(s->data, data, length)) + return SCE_TRUE; + else + return SCE_FALSE; + } + + SceVoid Clear() + { + if (data != SCE_NULL) { + delete data; + data = SCE_NULL; + } + } + + char *data; + SceSize length; + + private: + + SceUInt32 m_work; + + }; + + class WString + { + public: + + WString() : data(SCE_NULL), length(0) + { + + } + + ~WString() + { + if (data != SCE_NULL) + delete data; + } + + static SceSSize ToString(const SceWChar16 *src, String *dst); + + static SceSSize ToString(const SceWChar16 *src, String *dst, SceUInt32 flags); + + static WString *CharToNewWString(const char *src, WString *dst); + + SceSSize ToString(String *dst); + + SceSSize ToString(String *dst, SceUInt32 flags); + + WString *Set(const SceWChar16 *s, SceSize srcLength) + { + if (data == s) + return this; + + if (data != SCE_NULL) + delete data; + + if (srcLength == 0 || s == SCE_NULL || s[0] == 0) { + data = SCE_NULL; + length = 0; + return this; + } + + data = new SceWChar16[srcLength + 1]; + length = srcLength; + sce_paf_wmemcpy((wchar_t*)data, (wchar_t*)s, length); + data[length] = 0; + + return this; + } + + WString *Set(const SceWChar16 *s) + { + return Set(s, sce_paf_wcslen((wchar_t*)s)); + } + + WString *operator=(const WString *s) + { + if (data == s->data) + return this; + + if (s->length == 0) { + data = SCE_NULL; + length = 0; + return this; + } + + data = new SceWChar16[s->length + 1]; + length = s->length; + sce_paf_wmemcpy((wchar_t*)data, (wchar_t*)s->data, s->length + 1); + + return this; + } + + WString *operator+(const String *s) const + { + WString *newStr = new WString; + + if (!length && !s->length) + { + return newStr; + } + + newStr->data = new SceWChar16[s->length + length + 1]; + newStr->length = s->length + length; + sce_paf_wmemcpy((wchar_t*)newStr->data, (wchar_t*)data, length); + sce_paf_wmemcpy((wchar_t*)&newStr->data[length], (wchar_t*)s->data, s->length + 1); + newStr->data[newStr->length] = 0; + return newStr; + } + + SceBool operator==(const WString *s) const + { + if (s->length != length) + return SCE_FALSE; + + if (!sce_paf_wcsncmp((wchar_t*)s->data, (wchar_t*)data, length)) + return SCE_TRUE; + else + return SCE_FALSE; + } + + SceVoid Clear() + { + if (data != SCE_NULL) + delete data; + } + + SceWChar16 *data; + SceSize length; + + private: + + SceUInt32 m_work; + }; + + namespace common { + + class Utils + { + public: + + typedef void(*MainThreadTaskEntryFunction)(void *pArgBlock); + + Utils(); + + ~Utils(); + + static SceVoid AddMainThreadTask(MainThreadTaskEntryFunction entry, ScePVoid pArgBlock); + }; + + } +} + +#endif /* _VDSUITE_USER_PAF_COMMON_H */ diff --git a/include/user/paf/graphics.h b/include/user/paf/graphics.h new file mode 100644 index 0000000..33889ee --- /dev/null +++ b/include/user/paf/graphics.h @@ -0,0 +1,32 @@ +/* + Vita Development Suite Libraries +*/ + +#ifndef _VDSUITE_USER_PAF_GRAPHICS_H +#define _VDSUITE_USER_PAF_GRAPHICS_H + +#include <scetypes.h> + +namespace paf { + namespace graphics { + + class Texture + { + public: + + Texture() { }; + + ~Texture() { }; + + + + private: + + SceUChar8 unk[0x4]; + + }; + + } +} + +#endif /* _VDSUITE_USER_PAF_GRAPHICS_H */ diff --git a/include/user/paf/misc.h b/include/user/paf/misc.h new file mode 100644 index 0000000..8b0d8db --- /dev/null +++ b/include/user/paf/misc.h @@ -0,0 +1,45 @@ +/* + Vita Development Suite Libraries +*/ + +#ifndef _VDSUITE_USER_PAF_MISC_H +#define _VDSUITE_USER_PAF_MISC_H + +#include <libsha1.h> + +namespace paf { + + namespace misc { + + class Misc + { + public: + + Misc(); + + ~Misc(); + + static SceBool IsDolce(); + }; + + class Sha1 + { + public: + + Sha1(); + + ~Sha1() { }; + + SceInt32 BlockUpdate(const ScePVoid plain, SceUInt32 len); + + SceInt32 BlockResult(SceUChar8 *digest); + + private: + + SceSha1Context m_sha; + + }; + } +} + +#endif /* _VDSUITE_USER_PAF_MISC_H */ diff --git a/include/user/paf/resource.h b/include/user/paf/resource.h new file mode 100644 index 0000000..156320f --- /dev/null +++ b/include/user/paf/resource.h @@ -0,0 +1,44 @@ +/* + Vita Development Suite Libraries +*/ + +#ifndef _VDSUITE_USER_PAF_RESOURCE_H +#define _VDSUITE_USER_PAF_RESOURCE_H + +#include <kernel.h> +#include <paf/common.h> + +namespace paf { + + class Resource + { + public: + + Resource(); + + ~Resource(); + + class Element + { + public: + + Element() : hash(0) + { + + } + + ~Element() + { + + } + + SceUInt32 GetHashByName(Element *src); + + paf::String name; + SceUInt32 hash; + }; + }; + +} + +#endif /* _VDSUITE_USER_PAF_RESOURCE_H */ diff --git a/include/user/paf/stdc.h b/include/user/paf/stdc.h new file mode 100644 index 0000000..1f72ced --- /dev/null +++ b/include/user/paf/stdc.h @@ -0,0 +1,76 @@ +/* + Vita Development Suite Libraries +*/ + +#ifndef _VDSUITE_USER_PAF_STDC_H +#define _VDSUITE_USER_PAF_STDC_H + +#include <stdarg.h> +#include <wchar.h> +#include <scetypes.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * std C functions + */ + +void *sce_paf_bzero(void *ptr, SceSize num); +void *sce_paf_memchr(const void *ptr, int value, SceSize num); +int sce_paf_memcmp(const void *ptr1, const void *ptr2, SceSize num); +int sce_paf_bcmp(const void *ptr1, const void *ptr2, SceSize num); +void *sce_paf_memcpy(void *destination, const void *source, SceSize num); +void *sce_paf_memmove(void *destination, const void *source, SceSize num); +void *sce_paf_bcopy(void *destination, const void *source, SceSize num); +void *sce_paf_memset(void *ptr, int value, SceSize num); +int sce_paf_snprintf(char *s, SceSize n, const char *format, ...); +int sce_paf_strcasecmp(const char *str1, const char *str2); +char *sce_paf_strchr(const char *str, int character); +int sce_paf_strcmp(const char *str1, const char *str2); +size_t sce_paf_strlen(const char *str); +int sce_paf_strncasecmp(const char *str1, const char *str2, SceSize num); +int sce_paf_strncmp(const char *str1, const char *str2, SceSize num); +char *sce_paf_strncpy(char *destination, const char *source, SceSize num); +char *sce_paf_strrchr(const char *str, int character); + +/** + * wchar functions + */ + +/* __attribute__((__format__(__wprintf__, 3, 4))) */ +int sce_paf_swprintf(wchar_t *buffer, size_t bufsz, const wchar_t *format, ...); + +int sce_paf_vswprintf(wchar_t *buffer, size_t bufsz, const wchar_t *format, va_list vlist); + +wint_t sce_paf_towlower(wint_t wc); + +wchar_t *sce_paf_wcscat(wchar_t *dest, const wchar_t *src); +wchar_t *sce_paf_wcsncat(wchar_t *dest, const wchar_t *src, size_t count); +wchar_t *sce_paf_wcscpy(wchar_t *dest, const wchar_t *src); +wchar_t *sce_paf_wcsncpy(wchar_t *dest, const wchar_t *src, size_t count); + +int sce_paf_wcscasecmp(const wchar_t *s1, const wchar_t *s2); +wchar_t *sce_paf_wcschr(const wchar_t *str, wchar_t ch); +int sce_paf_wcscmp(const wchar_t *lhs, const wchar_t *rhs); +size_t sce_paf_wcscspn(const wchar_t *dest, const wchar_t *src); +size_t sce_paf_wcslen(const wchar_t *str); +int sce_paf_wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n); +int sce_paf_wcsncmp(const wchar_t *lhs, const wchar_t *rhs, size_t count); +size_t sce_paf_wcsnlen(const wchar_t *s, size_t maxlen); +wchar_t *sce_paf_wcspbrk(const wchar_t *dest, const wchar_t *str); +wchar_t *sce_paf_wcsrchr(const wchar_t *str, wchar_t ch); +size_t sce_paf_wcsspn(const wchar_t *dest, const wchar_t *src); + +wchar_t *sce_paf_wmemchr(const wchar_t *ptr, wchar_t ch, size_t count); +int sce_paf_wmemcmp(const wchar_t *lhs, const wchar_t *rhs, size_t count); +wchar_t *sce_paf_wmemcpy(wchar_t *dest, const wchar_t *src, size_t count); +wchar_t *sce_paf_wmemmove(wchar_t *dest, const wchar_t *src, size_t count); + +#ifdef __cplusplus +} +#endif + +#endif /* _VDSUITE_USER_PAF_STDC_H */ + diff --git a/include/user/paf/thread.h b/include/user/paf/thread.h index 481db69..3470f40 100644 --- a/include/user/paf/thread.h +++ b/include/user/paf/thread.h @@ -42,8 +42,9 @@ namespace paf { { public: - enum Error { - SCE_PAF_ERROR_THREADING_THREAD_ALREADY_STARTED = 0x80AF0702 + enum Error + { + SCE_PAF_ERROR_THREAD_THREAD_ALREADY_STARTED = 0x80AF0702 }; @@ -53,7 +54,7 @@ namespace paf { virtual SceVoid EntryFunction() = 0; - static SceInt32 InternalThreadEntry(SceSize argSize, void *pArgBlock); + static SceInt32 InternalThreadEntry(SceSize argSize, ScePVoid pArgBlock); static SceVoid SetMainThreadUID(SceInt32 threadNum = 0); @@ -193,9 +194,11 @@ namespace paf { ~Queue(); + static Queue *s_mainThreadQueue; + SceVoid WaitDone(); - SceVoid Push(const char *pName, QueueEntryFunction entry, void *pArgBlock); + SceVoid Push(const char *pName, QueueEntryFunction entry, ScePVoid pArgBlock); SceVoid Execute(); @@ -217,7 +220,9 @@ namespace paf { ~SyncCall(); - SceVoid Push(SyncCallEntryFunction entry, void *pArgBlock); + static SyncCall *s_mainThreadSyncCall; + + SceVoid Push(SyncCallEntryFunction entry, ScePVoid pArgBlock); SceVoid Execute(); diff --git a/include/user/paf/toplevel.h b/include/user/paf/toplevel.h new file mode 100644 index 0000000..51c13ab --- /dev/null +++ b/include/user/paf/toplevel.h @@ -0,0 +1,169 @@ +/* + Vita Development Suite Libraries +*/ + +#ifndef _VDSUITE_USER_PAF_TOPLEVEL_H +#define _VDSUITE_USER_PAF_TOPLEVEL_H + +#include <kernel.h> +#include <paf/common.h> +#include <paf/resource.h> +#include <paf/widget.h> + +namespace paf { + + class Plugin + { + public: + + typedef void(*PluginCB)(Plugin *plugin); + + Plugin() {}; + + ~Plugin() {}; + + class RootWidgetInitParam + { + public: + + RootWidgetInitParam(); + + ~RootWidgetInitParam() { } ; + + SceInt32 unk_00; + SceInt32 unk_04; + SceInt32 unk_08; + SceUChar8 unk_0C[0x20]; + }; + + static Plugin *GetByName(const char *pluginName); + + ui::Widget *SetRootWidget(paf::Resource::Element *widgetInfo, RootWidgetInitParam *initParam); + + private: + + SceUChar8 m_unk[0x4]; //size is unknown + + }; + + class Framework + { + public: + + enum ApplicationMode + { + Mode_ApplicationDefault, + Mode_Application, + Mode_ApplicationA, + Mode_ApplicationB, + Mode_ApplicationC, + Mode_ApplicationD + }; + + static Framework *s_frameworkInstance; + + class InitParam + { + public: + + InitParam(); + + ~InitParam() { }; + + InitParam *LoadDefaultParams(); + + SceUInt32 unk_00; + SceUInt32 gxmParameterBufferSize; + + SceUChar8 unk0[0x10]; + + SceUInt32 textSurfaceCacheSize; + + SceUChar8 unk1[0x40]; + + SceUInt32 decodeHeapSize; + SceUInt32 defaultPluginHeapSize; + SceInt32 unused_68; + SceInt32 unused_6C; + ApplicationMode applicationMode; + SceInt32 optionalFeatureFlags; + SceInt32 language; + SceInt32 enterButtonAssign; + SceBool useAdditionalWidgetInit; + ScePVoid unk_84; + SceInt32 unused_88; + SceInt32 graphicsFlags; + + SceUChar8 unk2[0x134]; + }; + + class CommonResourceInitParam + { + public: + + CommonResourceInitParam(); + + ~CommonResourceInitParam() { }; + + paf::String resourcePath; + SceUChar8 unk_08[0x1C]; + }; + + class PluginInitParam //0x94 + { + public: + + PluginInitParam(); + + ~PluginInitParam() { }; + + paf::String pluginName; + paf::String scopeName; + paf::Plugin::PluginCB loadCB1; + paf::Plugin::PluginCB loadCB2; + paf::Plugin::PluginCB loadCB3; + paf::Plugin::PluginCB unloadCB1; + paf::Plugin::PluginCB unloadCB2; + paf::String resourcePath; + + SceUChar8 unk_38[0x5C]; + }; + + typedef void(*LoadCRFinishCallback)(); + typedef void(*LoadPluginFinishCallback)(Plugin *plugin); + typedef void(*UnloadPluginFinishCallback)(Plugin *plugin); + + Framework(InitParam *fwInitParam); + + ~Framework(); + + static SceUInt32 GetFwLangBySystemLang(SceUInt32 systemLanguage); + + static SceVoid LoadPluginAsync(PluginInitParam *initParam, LoadPluginFinishCallback finishCallback = SCE_NULL, UnloadPluginFinishCallback unloadFinishCallback = SCE_NULL); + + static SceVoid LoadPlugin(PluginInitParam *initParam, LoadPluginFinishCallback finishCallback = SCE_NULL, UnloadPluginFinishCallback unloadFinishCallback = SCE_NULL); + + SceVoid _LoadPluginAsync(PluginInitParam *initParam, LoadPluginFinishCallback finishCallback = SCE_NULL, UnloadPluginFinishCallback unloadFinishCallback = SCE_NULL); + + SceInt32 EnterRenderingLoop(); + + SceVoid ExitRenderingLoop(); + + SceVoid LoadCommonResourceAsync(LoadCRFinishCallback finishCallback = SCE_NULL); + + SceVoid LoadCommonResourceAsync(CommonResourceInitParam *initParam, LoadCRFinishCallback finishCallback = SCE_NULL); + + SceVoid LoadCommonResource(LoadCRFinishCallback finishCallback = SCE_NULL); + + SceVoid LoadCommonResource(CommonResourceInitParam *initParam, LoadCRFinishCallback finishCallback = SCE_NULL); + + Plugin *FindPluginByName(const char *pluginName, SceBool enableSomeCheck = SCE_FALSE); + + private: + + SceUChar8 m_work[0x7C]; + + }; +} + +#endif /* _VDSUITE_USER_PAF_TOPLEVEL_H */ diff --git a/include/user/paf/widget.h b/include/user/paf/widget.h new file mode 100644 index 0000000..1fe0900 --- /dev/null +++ b/include/user/paf/widget.h @@ -0,0 +1,267 @@ +/* + Vita Development Suite Libraries +*/ + +#ifndef _VDSUITE_USER_PAF_WIDGET_H +#define _VDSUITE_USER_PAF_WIDGET_H + +#include <scetypes.h> +#include <paf/resource.h> + +namespace paf { + namespace ui { + + class Widget + { + public: + + enum Error //placeholder names + { + SCE_PAF_ERROR_UI_WIDGET_COLOR_ERROR = 0x80AF0022 + }; + + class EventCallback + { + public: + + enum Error + { + SCE_PAF_ERROR_UI_WIDGET_EVENT_CALLBACK_UNHANDLED = 0x80AF4101 + }; + + typedef void(*EventHandler)(SceInt32 eventId, Widget *self, SceInt32, ScePVoid pUserData); + + EventCallback() : state(2), pUserData(SCE_NULL) + { + + }; + + virtual ~EventCallback() + { + + }; + + virtual SceInt32 HandleEvent(SceInt32 eventId, Widget *self, SceInt32 a3) + { + SceInt32 ret; + + if ((this->state & 1) == 0) { + if (this->eventHandler != 0) { + this->eventHandler(eventId, self, a3, this->pUserData); + } + ret = 0; + } + else { + ret = SCE_PAF_ERROR_UI_WIDGET_EVENT_CALLBACK_UNHANDLED; + } + + return ret; + }; + + virtual EventHandler f2() + { + return this->eventHandler; + }; + + SceInt32 state; + ScePVoid pUserData; + EventHandler eventHandler; + + }; + + class Color + { + public: + + enum Type + { + Unk0, + Unk1, + Text, + TextShadow, + Background, + Unk5 + }; + + Color() : r(0.0), g(0.0), b(0.0), a(0.0) + { + + }; + + ~Color() + { + + }; + + SceFloat32 r; + SceFloat32 g; + SceFloat32 b; + SceFloat32 a; + }; + + Widget() {}; + + ~Widget() {}; + + SceInt32 SetColor(Color::Type type, SceInt32 a2, SceInt32 a3, const Color *pColor); + + enum Option + { + TextBold = 0x7, + TextShadow = 0xC, + TextExternalLine = 0xD + }; + + SceInt32 SetOption(Option option, SceInt32 a2, SceInt32 a3, SceBool enable); + + SceInt32 SetFontSize(SceFloat32 size, SceInt32 a2, SceSize pos, SceSize len); + + Widget *FindByHash(paf::Resource::Element *widgetInfo, SceUInt32 param); //param can be 0,1,2 + + SceInt32 SetPosition(SceFVector4 *position, SceFloat32 a2, SceInt32 a3, SceInt32 a4, SceInt32 a5, SceInt32 a6, SceInt32 a7); + + SceInt32 SetSize(SceFVector4 *size, SceFloat32 a2, SceInt32 a3, SceInt32 a4, SceInt32 a5, SceInt32 a6, SceInt32 a7); + + SceInt32 RegisterEventCallback(SceInt32 eventId, EventCallback *cb, SceBool a3); + + SceInt32 UnregisterEventCallback(SceInt32 eventId, SceInt32 a2, SceInt32 a3); + + SceInt32 RegisterLoopEventCallback(SceInt32 eventId, EventCallback *cb); + + SceInt32 AddEffect(SceInt32 effId, SceInt32 a2); + + //ScePafWidget_44B22ACA static + //ScePafWidget_F1176ACC + /*SceInt32 Test1(SceInt32, SceInt32, SceInt32); + static SceInt32 Test2(SceInt32, Widget*, SceInt32, SceInt32, SceInt32); + + SceInt32 Test3(SceInt32); + + SceInt32 Test4(SceFVector4 *size, SceInt32 a2, SceInt32 a3);*/ + + private: + + SceUChar8 unk[0x2D4]; + + }; + + class Label : public Widget + { + public: + + Label(Widget *parentWidget, SceInt32 flags); //flags: 0,2 or 4 + + virtual ~Label(); + + //109 virtual functions here + virtual int unkFun_008(); + virtual int unkFun_00C(); + virtual int unkFun_010(); + virtual int unkFun_014(); + virtual int unkFun_018(); + virtual int unkFun_01C(); + virtual int unkFun_020(); + virtual int unkFun_024(); + virtual int unkFun_028(); + virtual int unkFun_02C(); + virtual int unkFun_030(); + virtual int unkFun_034(); + virtual int unkFun_038(); + virtual int unkFun_03C(); + virtual int unkFun_040(); + virtual int unkFun_044(); + virtual int unkFun_048(); + virtual int unkFun_04C(); + virtual int unkFun_050(); + virtual int unkFun_054(); + virtual int unkFun_058(); + virtual int unkFun_05C(); + virtual int unkFun_060(); + virtual int unkFun_064(); + virtual int unkFun_068(); + virtual int unkFun_06C(); + virtual int unkFun_070(); + virtual int unkFun_074(); + virtual int unkFun_078(); + virtual int unkFun_07C(); + virtual int unkFun_080(); + virtual int unkFun_084(); + virtual int unkFun_088(); + virtual int unkFun_08C(); + virtual int unkFun_090(); + virtual int unkFun_094(); + virtual int unkFun_098(); + virtual int unkFun_09C(); + virtual int unkFun_0A0(); + virtual int unkFun_0A4(); + virtual int unkFun_0A8(); + virtual int unkFun_0AC(); + virtual int unkFun_0B0(); + virtual int unkFun_0B4(); + virtual int unkFun_0B8(); + virtual int unkFun_0BC(); + virtual int unkFun_0C0(); + virtual int unkFun_0C4(); + virtual int unkFun_0C8(); + virtual int unkFun_0CC(); + virtual int unkFun_0D0(); + virtual int unkFun_0D4(); + virtual int unkFun_0D8(); + virtual int unkFun_0DC(); + virtual int unkFun_0E0(); + virtual int unkFun_0E4(); + virtual int unkFun_0E8(); + virtual int unkFun_0EC(); + virtual int unkFun_0F0(); + virtual int unkFun_0F4(); + virtual int unkFun_0F8(); + virtual int unkFun_0FC(); + virtual int unkFun_100(); + virtual int unkFun_104(); + virtual int unkFun_108(); + virtual int unkFun_10C(); + virtual int unkFun_110(); + virtual int unkFun_114(); + virtual int unkFun_118(); + virtual SceInt32 SetText(paf::WString *text); //ScePafWidget_922FF349 + virtual int unkFun_120(); + virtual int unkFun_124(); + virtual int unkFun_128(); + virtual int unkFun_12C(); + virtual int unkFun_130(); + virtual int unkFun_134(); + virtual int unkFun_138(); + virtual int unkFun_13C(); + virtual int unkFun_140(); + virtual int unkFun_144(); + virtual int unkFun_148(); + virtual int unkFun_14C(); + virtual int unkFun_150(); + virtual int unkFun_154(); + virtual int unkFun_158(); + virtual int unkFun_15C(); + virtual int unkFun_160(); + virtual int unkFun_164(); + virtual int unkFun_168(); + virtual int unkFun_16C(); + virtual int unkFun_170(); + virtual int unkFun_174(); + virtual int unkFun_178(); + virtual int unkFun_17C(); + virtual int unkFun_180(); + virtual int unkFun_184(); + virtual int unkFun_188(); + virtual int unkFun_18C(); + virtual int unkFun_190(); + virtual int unkFun_194(); + virtual int unkFun_198(); + virtual int unkFun_19C(); + virtual int unkFun_1A0(); + virtual int unkFun_1A4(); + virtual int unkFun_1A8(); + + }; + } +} + +#endif /* _VDSUITE_USER_PAF_WIDGET_H */ diff --git a/nids/360/ScePaf.yml b/nids/360/ScePaf.yml index 03a09e1..3369aae 100644 --- a/nids/360/ScePaf.yml +++ b/nids/360/ScePaf.yml @@ -5,24 +5,30 @@ modules: ScePafCommon: nid: 0x3C1965CD functions: - scePafCesUtf16CharToUtf8: 0x8E009780 - scePafCesUtf16CharToUtf8WithFlag: 0x5FAAAE1C - scePafCesUtf16ToUtf8: 0x06C015C6 - scePafCesUtf16ToUtf8WithFlag: 0x683BC8E8 - scePafCesUtf8CharToUtf16: 0x950C3AA0 - scePafCesUtf8CharToUtf16WithFlag: 0xA9ED25D9 - scePafCesUtf8ToUtf16: 0x3CFEB1EB - scePafCesUtf8ToUtf16WithFlag: 0x23A39B05 + _ZN3paf6String9ToWStringEPKcPNS_7WStringE: 0x950C3AA0 + _ZN3paf6String9ToWStringEPKcPNS_7WStringEj: 0xA9ED25D9 + _ZN3paf6String9ToWStringEPNS_7WStringE: 0x3CFEB1EB + _ZN3paf6String9ToWStringEPNS_7WStringEj: 0x23A39B05 + _ZN3paf6common5Utils17AddMainThreadTaskEPFvPvES2_: 0x6735B503 + _ZN3paf7WString8ToStringEPKtPNS_6StringE: 0x8E009780 + _ZN3paf7WString8ToStringEPKtPNS_6StringEj: 0x5FAAAE1C + _ZN3paf7WString8ToStringEPNS_6StringE: 0x06C015C6 + _ZN3paf7WString8ToStringEPNS_6StringEj: 0x683BC8E8 ScePafMisc: nid: 0x3D643CE8 functions: - scePafCesUtf16CharToUtf8WithAlloc: 0xE690F751 - scePafCesUtf8CharToUtf16WithAlloc: 0xA6ABC0B2 + _ZN3paf4misc4Misc7IsDolceEv: 0xAF4FC3F4 + _ZN3paf4misc4Sha111BlockResultEPh: 0xB3BF59FC + _ZN3paf4misc4Sha111BlockUpdateEPvj: 0xE6BB459E + _ZN3paf4misc4Sha1C1Ev: 0xB38C53C0 + _ZN3paf6String16WCharToNewStringEPKtPS0_: 0xE690F751 + _ZN3paf7WString16CharToNewWStringEPKcPS0_: 0xA6ABC0B2 scePafMiscInitializeInputMethodExt: 0xAC108E50 sce_paf_misc_does_file_exist: 0x95F14046 ScePafResource: nid: 0x2836DC9B functions: + _ZN3paf8Resource7Element13GetHashByNameEPS1_: 0x5F05DE68 scePafResourceGetAttribute: 0xAD8678FB scePafResourceGetAttributeChar: 0x1546336D scePafResourceGetAttributeData: 0x37720983 @@ -56,6 +62,7 @@ modules: _Znaj: 0xD8CC1AFE _Znwj: 0xFC5CD359 __aeabi_atexit: 0xC95732BB + __at_quick_exit: 0x9A1D1ED1 __cxa_atexit: 0xAD9500EF __cxa_deleted_virtual: 0x25A6D9BB __cxa_finalize: 0xF36BABE3 @@ -68,7 +75,6 @@ modules: memcpy: 0x5883A6E3 memset: 0x75ECC54E sce_paf_abs: 0x0F297A5E - sce_paf_atexit: 0x9A1D1ED1 sce_paf_atof: 0x9C251354 sce_paf_atoi: 0x5930D99A sce_paf_atol: 0x086AD1FA @@ -224,7 +230,52 @@ modules: _ZN3paf6thread8SyncCallD2Ev: 0xA8DB7042 _ZN3paf6thread9ThreadOptC1Ev: 0x5712350E _ZN3paf6thread9ThreadOptC2Ev: 0xCC65DF88 + variables: + _ZN3paf6thread5Queue17s_mainThreadQueueE: 0x83CE85DD + _ZN3paf6thread8SyncCall20s_mainThreadSyncCallE: 0x11807592 + ScePafToplevel: + nid: 0x4D9A9DD0 + functions: + _ZN3paf6Plugin10FindByNameEPKc: 0x004D98CC + _ZN3paf6Plugin13SetRootWidgetEPNS_8Resource7ElementEPNS0_19RootWidgetInitParamE: 0x30B442D9 + _ZN3paf6Plugin19RootWidgetInitParamC1Ev: 0x34FE1331 + _ZN3paf9Framework10LoadPluginEPNS0_15PluginInitParamEPFvPNS_6PluginEES6_: 0xBE479650 + _ZN3paf9Framework15LoadPluginAsyncEPNS0_15PluginInitParamEPFvPNS_6PluginEES6_: 0xF702E40A + _ZN3paf9Framework15PluginInitParamC1Ev: 0x400F84CE + _ZN3paf9Framework15PluginInitParamC2Ev: 0x58C1A580 + _ZN3paf9Framework16FindPluginByNameEPKci: 0xE595423D + _ZN3paf9Framework16_LoadPluginAsyncEPNS0_15PluginInitParamEPFvPNS_6PluginEES6_: 0xF975994E + _ZN3paf9Framework17ExitRenderingLoopEv: 0x9A4B0DC4 + _ZN3paf9Framework18EnterRenderingLoopEv: 0x12E33958 + _ZN3paf9Framework18LoadCommonResourceEPFvvE: 0x947332B7 + _ZN3paf9Framework18LoadCommonResourceEPNS0_23CommonResourceInitParamEPFvvE: 0x56182FBF + _ZN3paf9Framework21GetFwLangBySystemLangEj: 0x1AEDE4E0 + _ZN3paf9Framework23CommonResourceInitParamC1Ev: 0x7C8CF5E8 + _ZN3paf9Framework23CommonResourceInitParamC2Ev: 0x99DD7850 + _ZN3paf9Framework23LoadCommonResourceAsyncEPFvvE: 0x3F0DB1BF + _ZN3paf9Framework23LoadCommonResourceAsyncEPNS0_23CommonResourceInitParamEPFvvE: 0x9E5E0C9C + _ZN3paf9Framework9InitParam17LoadDefaultParamsEv: 0x907BA948 + _ZN3paf9Framework9InitParamC1Ev: 0xA5560E60 + _ZN3paf9FrameworkC1EPNS0_9InitParamE: 0xE2860A99 + _ZN3paf9FrameworkD1Ev: 0x32CE0577 + _ZN3paf9FrameworkD2Ev: 0x144905EE + variables: + _ZN3paf9Framework19s_frameworkInstanceE: 0xCB81F1F1 ScePafWidget: nid: 0x073F8C68 functions: - scePafWidgetSetFontSize: 0x39B15B98 + _ZN3paf2ui5Label7SetTextEPNS_7WStringE: 0x922FF349 + _ZN3paf2ui5LabelC1EPNS0_6WidgetEi: 0x5C2962E1 + _ZN3paf2ui5LabelC2EPNS0_6WidgetEi: 0x0FF7D929 + _ZN3paf2ui5LabelD1Ev: 0xD9231C26 + _ZN3paf2ui5LabelD2Ev: 0x8722C2F6 + _ZN3paf2ui6Widget10FindByHashEPNS_8Resource7ElementEj: 0x9D304F4A + _ZN3paf2ui6Widget11SetFontSizeEfijj: 0x39B15B98 + _ZN3paf2ui6Widget11SetPositionEP11SceFVector4fiiiii: 0xE29AB31F + _ZN3paf2ui6Widget21RegisterEventCallbackEiPNS1_13EventCallbackEi: 0xFB7FE189 + _ZN3paf2ui6Widget23UnregisterEventCallbackEiii: 0xB98D49AD + _ZN3paf2ui6Widget25RegisterLoopEventCallbackEiPNS1_13EventCallbackE: 0x6E3EEF4E + _ZN3paf2ui6Widget7SetSizeEP11SceFVector4fiiiii: 0x046AA07D + _ZN3paf2ui6Widget8SetColorENS1_5Color4TypeEiiPKS2_: 0xCD20EF38 + _ZN3paf2ui6Widget9AddEffectEii: 0x7602488B + _ZN3paf2ui6Widget9SetOptionENS1_6OptionEiii: 0xF2A2E2E6 |