aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/include
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2023-05-21 17:22:00 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2023-05-21 17:22:00 +0200
commit1e058d15e29adc482074d7225b4c1ed34e63568d (patch)
tree7167f01bdb3eb0542895ee14e389225dc0eca37b /libpsn00b/include
parent513a6e99dd1f9cf5531d55f544478bec72efb910 (diff)
downloadpsn00bsdk-1e058d15e29adc482074d7225b4c1ed34e63568d.tar.gz
More library cleanups and libc fixes
Diffstat (limited to 'libpsn00b/include')
-rw-r--r--libpsn00b/include/psxapi.h10
-rw-r--r--libpsn00b/include/psxgpu.h4
-rw-r--r--libpsn00b/include/psxpad.h12
-rw-r--r--libpsn00b/include/stdlib.h8
4 files changed, 20 insertions, 14 deletions
diff --git a/libpsn00b/include/psxapi.h b/libpsn00b/include/psxapi.h
index 49d1620..d24976f 100644
--- a/libpsn00b/include/psxapi.h
+++ b/libpsn00b/include/psxapi.h
@@ -221,6 +221,15 @@ typedef struct _INT_RP {
extern "C" {
#endif
+#if 0
+static inline void _InitCd(void) {
+ uint32_t old_dpcr = DMA_DPCR & 0xffff0fff;
+
+ _96_init();
+ DMA_DPCR |= old_dpcr;
+}
+#endif
+
void SysEnqIntRP(int pri, INT_RP *rp);
void SysDeqIntRP(int pri, INT_RP *rp);
@@ -261,7 +270,6 @@ void ExitCriticalSection(void);
int SwEnterCriticalSection(void);
void SwExitCriticalSection(void);
-void _InitCd(void);
void _96_init(void);
void _96_remove(void);
diff --git a/libpsn00b/include/psxgpu.h b/libpsn00b/include/psxgpu.h
index d7f1ad5..f1e5de8 100644
--- a/libpsn00b/include/psxgpu.h
+++ b/libpsn00b/include/psxgpu.h
@@ -626,10 +626,10 @@ DISPENV *SetDefDispEnv(DISPENV *env, int x, int y, int w, int h);
DRAWENV *SetDefDrawEnv(DRAWENV *env, int x, int y, int w, int h);
void FntLoad(int x, int y);
-char *FntSort(uint32_t *ot, char *pri, int x, int y, const char *text);
+void *FntSort(uint32_t *ot, void *pri, int x, int y, const char *text);
int FntOpen(int x, int y, int w, int h, int isbg, int n);
int FntPrint(int id, const char *fmt, ...);
-char *FntFlush(int id);
+void *FntFlush(int id);
#ifdef __cplusplus
}
diff --git a/libpsn00b/include/psxpad.h b/libpsn00b/include/psxpad.h
index 09f28c4..040b890 100644
--- a/libpsn00b/include/psxpad.h
+++ b/libpsn00b/include/psxpad.h
@@ -10,7 +10,7 @@
*
* Reference: https://gist.github.com/scanlime/5042071
*/
-
+
#pragma once
#include <stdint.h>
@@ -37,8 +37,8 @@ typedef enum {
PAD_SQUARE = 1 << 15,
// Mouse
- MOUSE_LEFT = 1 << 10,
- MOUSE_RIGHT = 1 << 11,
+ MOUSE_RIGHT = 1 << 10,
+ MOUSE_LEFT = 1 << 11,
// neGcon
NCON_START = 1 << 3,
@@ -46,9 +46,9 @@ typedef enum {
NCON_RIGHT = 1 << 5,
NCON_DOWN = 1 << 6,
NCON_LEFT = 1 << 7,
- NCON_R = 1 << 8,
- NCON_B = 1 << 9,
- NCON_A = 1 << 10,
+ NCON_R = 1 << 11,
+ NCON_B = 1 << 12,
+ NCON_A = 1 << 13,
// Guncon
GCON_A = 1 << 3,
diff --git a/libpsn00b/include/stdlib.h b/libpsn00b/include/stdlib.h
index 19761df..c754c29 100644
--- a/libpsn00b/include/stdlib.h
+++ b/libpsn00b/include/stdlib.h
@@ -27,17 +27,15 @@ typedef struct _HeapUsage {
extern "C" {
#endif
-extern int __argc;
-extern const char **__argv;
+extern int __argc;
+extern const char **__argv;
void abort(void);
+int abs(int value);
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);