summaryrefslogtreecommitdiff
path: root/libpsx/include
diff options
context:
space:
mode:
Diffstat (limited to 'libpsx/include')
-rw-r--r--libpsx/include/psxbios.h25
-rw-r--r--libpsx/include/psxgpu.h13
-rw-r--r--libpsx/include/psxspu.h9
-rw-r--r--libpsx/include/stdio.h22
-rw-r--r--libpsx/include/stdlib.h9
-rw-r--r--libpsx/include/string.h8
-rw-r--r--libpsx/include/strings.h11
7 files changed, 79 insertions, 18 deletions
diff --git a/libpsx/include/psxbios.h b/libpsx/include/psxbios.h
index 9275393..1738fa3 100644
--- a/libpsx/include/psxbios.h
+++ b/libpsx/include/psxbios.h
@@ -5,6 +5,11 @@
#ifndef _PSXBIOS_H
#define _PSXBIOS_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
/* Joypad functions */
extern void PAD_init(unsigned long mode, unsigned long *pad_buf);
@@ -12,11 +17,11 @@ extern int PAD_dr(void);
/* ROM information functions */
-/**
+/**
* Returns PSX kernel date.
* @return Kernel date n 0xYYYYMMDD BCD format.
*/
-
+
unsigned long GetKernelDate(void);
/**
@@ -90,7 +95,7 @@ struct DIRENTRY
* Characters after * are ignored.
* @param name File name string
* @param dirent Pointer to a struct DIRENTRY object.
- * @return dirent on success, NULL on failure.
+ * @return dirent on success, NULL on failure.
*/
struct DIRENTRY *firstfile(const char *name, struct DIRENTRY *dirent);
@@ -106,7 +111,7 @@ struct DIRENTRY *firstfile(const char *name, struct DIRENTRY *dirent);
struct DIRENTRY *nextfile(struct DIRENTRY *dir);
-/**
+/**
* Gets the file size of the file named "name".
* It is actually just a wrapper around firstfile.
* It rounds the file size to the block size (2048).
@@ -122,7 +127,7 @@ int get_file_size(const char *name);
* @param name File name string
* @return File size in bytes, unrounded.
*/
-
+
int get_real_file_size(const char *name);
void InitHeap(void *block , int size);
@@ -182,7 +187,7 @@ int DisableEvent(unsigned int event);
int DeliverEvent(unsigned int ev1, // Cause descriptor
int ev2); // Event class
-
+
/**
* Checks if the event specified by its identifier has occured
* @param event Numerical event identifier
@@ -203,13 +208,17 @@ int WaitEvent(unsigned int event);
* Replaces the executable image in memory with the one
* contained in another executable file in PSX-EXE format.
* WARNING: Does not work right now.
- *
+ *
* Most likely you want PSX_RunExe()
* @param name Path name of PSX-EXE executable
* @param argc Number of arguments
* @param argv Pointer to an array of string pointers for each argument
*/
-
+
void LoadExec(char *name, int argc, char **argv);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/libpsx/include/psxgpu.h b/libpsx/include/psxgpu.h
index 4548d4d..174569c 100644
--- a/libpsx/include/psxgpu.h
+++ b/libpsx/include/psxgpu.h
@@ -1,6 +1,13 @@
#ifndef _PSXGPU_H
#define _PSXGPU_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdarg.h>
+
#define GPU_DATA_PORT_ADDR 0x1f801810
#define GPU_CONTROL_PORT_ADDR 0x1f801814
#define GPU_DATA_PORT *((volatile unsigned int*)GPU_DATA_PORT_ADDR)
@@ -13,8 +20,6 @@
#define get_clutid(cx, cy) (((cx&0x3ff)>>4)|((cy&0x1ff)<<6))
-#include <stdarg.h>
-
/**
* Initializes the GPU. Same as GsInitEx(0)
*
@@ -1139,6 +1144,10 @@ void GsSortPolyLine(GsPolyLine *line);
void GsSortGPolyLine(GsGPolyLine *line);
+#ifdef __cplusplus
+}
+#endif
+
//void GsSortSimpleMap(GsMap *map);
#endif
diff --git a/libpsx/include/psxspu.h b/libpsx/include/psxspu.h
index 2268500..9c51781 100644
--- a/libpsx/include/psxspu.h
+++ b/libpsx/include/psxspu.h
@@ -1,6 +1,11 @@
#ifndef _SPU_H
#define _SPU_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define SPU_ADDR *((volatile unsigned short*)0x1f801da6)
#define SPU_DATA *((volatile unsigned short*)0x1f801da8)
#define SPU_CONTROL *((volatile unsigned short*)0x1f801daa)
@@ -222,4 +227,8 @@ void SsEnableExt(void);
void SsCdVol(unsigned short left, unsigned short right);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/libpsx/include/stdio.h b/libpsx/include/stdio.h
index 1bf7a99..88e7afb 100644
--- a/libpsx/include/stdio.h
+++ b/libpsx/include/stdio.h
@@ -8,7 +8,7 @@
#ifdef _PSXSDK_WRAPPER
/*
- * Dirty hack...
+ * Dirty hack...
*/
#include "/usr/include/stdio.h"
@@ -20,6 +20,11 @@
#include <stdarg.h>
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
@@ -58,7 +63,7 @@ typedef struct
/** Current file position */
unsigned int pos;
/** File access mode */
- unsigned int mode;
+ unsigned int mode;
/** Device ID */
unsigned int dev;
/** Size in bytes */
@@ -134,7 +139,7 @@ int remove(const char *filename);
/**
* Redirects STDIO to SIO (serial port)
*/
-
+
void redirect_stdio_to_sio(void);
/**
@@ -144,21 +149,21 @@ void redirect_stdio_to_sio(void);
*
* @param setting New status of the setting (0 = disabled, 1 = enabled)
*/
-
+
void sio_stdio_mapcr(unsigned int setting);
/**
* scanf and friends
*/
-
+
int vsscanf(const char *str, const char *fmt, va_list ap);
int sscanf(const char *str, const char *fmt, ...);
/**
- * STDIO for SIO
+ * STDIO for SIO
*/
-
+
int sio_putchar(int c);
int sio_puts(const char *str);
int sio_printf(const char *fmt, ...);
@@ -166,5 +171,8 @@ int sio_vprintf(const char *fmt, va_list ap);
#endif
+#ifdef __cplusplus
+}
#endif
+#endif
diff --git a/libpsx/include/stdlib.h b/libpsx/include/stdlib.h
index 0242213..099abbd 100644
--- a/libpsx/include/stdlib.h
+++ b/libpsx/include/stdlib.h
@@ -9,6 +9,11 @@
#ifndef _STDLIB_H
#define _STDLIB_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
typedef unsigned int size_t;
typedef signed int ssize_t;
@@ -62,5 +67,9 @@ void call_atexit_callbacks(void);
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/libpsx/include/string.h b/libpsx/include/string.h
index 5956b0d..e50f715 100644
--- a/libpsx/include/string.h
+++ b/libpsx/include/string.h
@@ -12,6 +12,11 @@
#ifndef _STRING_H
#define _STRING_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#include <strings.h> // for backwards compatibility
#include <types.h>
@@ -60,5 +65,8 @@ void *memmem(const void *big, size_t big_len, const void *little, size_t little_
int ffsl(long value);
int ffsll(long long value);
+#ifdef __cplusplus
+}
#endif
+#endif
diff --git a/libpsx/include/strings.h b/libpsx/include/strings.h
index 7e9082f..c654055 100644
--- a/libpsx/include/strings.h
+++ b/libpsx/include/strings.h
@@ -1,4 +1,4 @@
-/*
+/*
* strings.h
*
* PSXSDK
@@ -7,6 +7,11 @@
#ifndef _STRINGS_H
#define _STRINGS_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#include <string.h>
#include <types.h>
@@ -34,4 +39,8 @@ unsigned int popcount64(uint64_t value);
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t len);
+#ifdef __cplusplus
+}
+#endif
+
#endif