-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3440fe3
commit 4919e2f
Showing
773 changed files
with
270,624 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install bash make | ||
|
||
RUN echo "## Exporting ps3dev environment" >> /root/.bashrc | ||
RUN echo "export PSNOOB=/usr/local/psnoob" >> /root/.bashrc | ||
RUN echo "export PATH=\$PATH:\$PSNOOB/bin" >> /root/.bashrc | ||
RUN echo "export PSN00BSDK_LIBS=$PSNOOB/lib/libpsn00b" >> /root/.bashrc | ||
|
||
COPY . /usr/local/psnoob |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* PSn00bSDK assert macro and internal logging | ||
* (C) 2022-2023 spicyjpeg - MPL licensed | ||
* | ||
* The _sdk_*() macros are used internally by PSn00bSDK to output messages when | ||
* building in debug mode. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdio.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void _assert_abort(const char *file, int line, const char *expr); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#ifdef NDEBUG | ||
|
||
#define assert(expr) | ||
#define _sdk_log(fmt, ...) | ||
#define _sdk_assert(expr, fmt, ...) | ||
#define _sdk_validate_args_void(expr) | ||
#define _sdk_validate_args(expr, ret) | ||
|
||
#else | ||
|
||
#define assert(expr) \ | ||
((expr) ? ((void) 0) : _assert_abort(__FILE__, __LINE__, #expr)) | ||
|
||
#ifdef SDK_LIBRARY_NAME | ||
#define _sdk_log(fmt, ...) \ | ||
printf(SDK_LIBRARY_NAME ": " fmt __VA_OPT__(,) __VA_ARGS__) | ||
#else | ||
#define _sdk_log(fmt, ...) \ | ||
printf(fmt __VA_OPT__(,) __VA_ARGS__) | ||
#endif | ||
|
||
#define _sdk_assert(expr, ret, fmt, ...) \ | ||
if (!(expr)) { \ | ||
_sdk_log(fmt, __VA_ARGS__); \ | ||
return ret; \ | ||
} | ||
#define _sdk_validate_args_void(expr) \ | ||
if (!(expr)) { \ | ||
_sdk_log("invalid args to %s() (%s)\n", __func__, #expr); \ | ||
return; \ | ||
} | ||
#define _sdk_validate_args(expr, ret) \ | ||
if (!(expr)) { \ | ||
_sdk_log("invalid args to %s() (%s)\n", __func__, #expr); \ | ||
return ret; \ | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* PSn00bSDK assert macro and internal logging | ||
* (C) 2022-2023 spicyjpeg - MPL licensed | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <assert.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* PSn00bSDK standard library | ||
* (C) 2019-2023 PSXSDK authors, Lameguy64, spicyjpeg - MPL licensed | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace std { | ||
extern "C" { | ||
|
||
int isprint(int ch); | ||
int isgraph(int ch); | ||
int isspace(int ch); | ||
int isblank(int ch); | ||
int isalpha(int ch); | ||
int isdigit(int ch); | ||
|
||
int tolower(int ch); | ||
int toupper(int ch); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* PSn00bSDK standard library | ||
* (C) 2019-2023 Lameguy64, spicyjpeg - MPL licensed | ||
* | ||
* This is a replacement for the <cstdint> header included with GCC, which seems | ||
* to be broken (at least in GCC 12.2.0) as it requires some macros to be set. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
namespace std { | ||
|
||
#define _DEF_TYPE(bits, prefix) \ | ||
using ::prefix##bits##_t; \ | ||
using ::prefix##_fast##bits##_t; \ | ||
using ::prefix##_least##bits##_t; | ||
|
||
_DEF_TYPE( 8, int) | ||
_DEF_TYPE( 8, uint) | ||
_DEF_TYPE(16, int) | ||
_DEF_TYPE(16, uint) | ||
_DEF_TYPE(32, int) | ||
_DEF_TYPE(32, uint) | ||
|
||
#undef _DEF_TYPE | ||
|
||
using ::intmax_t; | ||
using ::uintmax_t; | ||
using ::intptr_t; | ||
using ::uintptr_t; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* PSn00bSDK standard library | ||
* (C) 2019-2023 Lameguy64, spicyjpeg - MPL licensed | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cstdarg> | ||
|
||
namespace std { | ||
extern "C" { | ||
|
||
/* String I/O API (provided by BIOS) */ | ||
|
||
int printf(const char *fmt, ...); | ||
char *gets(char *str); | ||
void puts(const char *str); | ||
int getchar(void); | ||
void putchar(int ch); | ||
|
||
/* String formatting API (built-in) */ | ||
|
||
int vsnprintf(char *string, unsigned int size, const char *fmt, va_list ap); | ||
int vsprintf(char *string, const char *fmt, va_list ap); | ||
int sprintf(char *string, const char *fmt, ...); | ||
int snprintf(char *string, unsigned int size, const char *fmt, ...); | ||
|
||
int vsscanf(const char *str, const char *format, va_list ap); | ||
int sscanf(const char *str, const char *fmt, ...); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* PSn00bSDK standard library | ||
* (C) 2019-2023 PSXSDK authors, Lameguy64, spicyjpeg - MPL licensed | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cstddef> | ||
|
||
namespace std { | ||
|
||
/* Definitions */ | ||
|
||
static constexpr int RAND_MAX = 0x7fff; | ||
|
||
/* Structure definitions */ | ||
|
||
struct HeapUsage { | ||
size_t total; // Total size of heap + stack | ||
size_t heap; // Amount of memory currently reserved for heap | ||
size_t stack; // Amount of memory currently reserved for stack | ||
size_t alloc; // Amount of memory currently allocated | ||
size_t alloc_max; // Maximum amount of memory ever allocated | ||
}; | ||
|
||
/* API */ | ||
|
||
extern "C" { | ||
|
||
extern int __argc; | ||
extern const char **__argv; | ||
|
||
void abort(void); | ||
|
||
int rand(void); | ||
void srand(int seed); | ||
|
||
int abs(int j); | ||
long labs(long i); | ||
|
||
long strtol(const char *str, char **str_end, int base); | ||
long long strtoll(const char *str, char **str_end, int base); | ||
//float strtof(const char *str, char **str_end); | ||
//double strtod(const char *str, char **str_end); | ||
//long double strtold(const char *str, char **str_end); | ||
|
||
void InitHeap(void *addr, size_t size); | ||
void *sbrk(ptrdiff_t incr); | ||
|
||
void TrackHeapUsage(ptrdiff_t alloc_incr); | ||
void GetHeapUsage(HeapUsage *usage); | ||
|
||
void *malloc(size_t size); | ||
void *calloc(size_t num, size_t size); | ||
void *realloc(void *ptr, size_t size); | ||
void free(void *ptr); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* PSn00bSDK standard library | ||
* (C) 2019-2023 PSXSDK authors, Lameguy64, spicyjpeg - MPL licensed | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cstddef> | ||
|
||
namespace std { | ||
extern "C" { | ||
|
||
void *memset(void *dest, int ch, size_t count); | ||
void *memcpy(void *dest, const void *src, size_t count); | ||
void *memccpy(void *dest, const void *src, int ch, size_t count); | ||
void *memmove(void *dest, const void *src, size_t count); | ||
int memcmp(const void *lhs, const void *rhs, size_t count); | ||
void *memchr(const void *ptr, int ch, size_t count); | ||
|
||
char *strcpy(char *dest, const char *src); | ||
char *strncpy(char *dest, const char *src, size_t count); | ||
int strcmp(const char *lhs, const char *rhs); | ||
int strncmp(const char *lhs, const char *rhs, size_t count); | ||
char *strchr(const char *str, int ch); | ||
char *strrchr(const char *str, int ch); | ||
char *strpbrk(const char *str, const char *breakset); | ||
char *strstr(const char *str, const char *substr); | ||
|
||
size_t strlen(const char *str); | ||
char *strcat(char *dest, const char *src); | ||
char *strncat(char *dest, const char *src, size_t count); | ||
char *strdup(const char *str); | ||
char *strndup(const char *str, size_t count); | ||
|
||
char *strtok(char *str, const char *delim); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* PSn00bSDK standard library | ||
* (C) 2019-2023 PSXSDK authors, Lameguy64, spicyjpeg - MPL licensed | ||
*/ | ||
|
||
#pragma once | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
int isprint(int ch); | ||
int isgraph(int ch); | ||
int isspace(int ch); | ||
int isblank(int ch); | ||
int isalpha(int ch); | ||
int isdigit(int ch); | ||
|
||
int tolower(int ch); | ||
int toupper(int ch); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.