mirror of
https://github.com/zeldaret/tp
synced 2026-07-09 14:55:32 -04:00
MSL_C cleanup (#238)
* clean up MSL_C files according to prime decomp * remove asm
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
#ifndef MSL_COMMON_SRC_FILE_POS_H
|
||||
#define MSL_COMMON_SRC_FILE_POS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int fseek(FILE* file, long offset, int mode);
|
||||
int _fseek(FILE* file, fpos_t offset, int mode);
|
||||
long ftell(FILE* file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_FILE_POS_H */
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
#ifndef MSL_COMMON_SRC_ABORT_EXIT_H
|
||||
#define MSL_COMMON_SRC_ABORT_EXIT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void exit(int status);
|
||||
void abort(void);
|
||||
|
||||
extern void (*__stdio_exit)(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ABORT_EXIT_H */
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
#ifndef MSL_COMMON_SRC_ALLOC_H
|
||||
#define MSL_COMMON_SRC_ALLOC_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void free(FILE* file);
|
||||
void __pool_free();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ALLOC_H */
|
||||
|
||||
@@ -1,11 +1,33 @@
|
||||
#ifndef MSL_COMMON_SRC_ANSI_FILES_H
|
||||
#define MSL_COMMON_SRC_ANSI_FILES_H
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
|
||||
typedef unsigned long __file_handle;
|
||||
typedef unsigned long fpos_t;
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
|
||||
#define set_error(file) \
|
||||
do { \
|
||||
(file)->file_state.error = 1; \
|
||||
(file)->buffer_length = 0; \
|
||||
} while (0)
|
||||
|
||||
enum __file_kinds {
|
||||
/* 0x0 */ CLOSED_FILE,
|
||||
/* 0x1 */ DISK_FILE,
|
||||
/* 0x2 */ CONSOLE_FILE,
|
||||
/* 0x3 */ UNAVAILABLE_FILE,
|
||||
__closed_file,
|
||||
__disk_file,
|
||||
__console_file,
|
||||
__unavailable_file,
|
||||
};
|
||||
|
||||
enum __file_orientation {
|
||||
@@ -23,6 +45,26 @@ typedef struct _file_modes {
|
||||
unsigned int binary_io : 1;
|
||||
} file_modes;
|
||||
|
||||
enum __io_modes {
|
||||
__read = 1,
|
||||
__write = 2,
|
||||
__read_write = 3,
|
||||
__append = 4,
|
||||
};
|
||||
|
||||
enum __io_states {
|
||||
__neutral,
|
||||
__writing,
|
||||
__reading,
|
||||
__rereading,
|
||||
};
|
||||
|
||||
enum __io_results {
|
||||
__no_io_error,
|
||||
__io_error,
|
||||
__io_EOF,
|
||||
};
|
||||
|
||||
typedef struct _file_states {
|
||||
unsigned int io_state : 3;
|
||||
unsigned int free_buffer : 1;
|
||||
@@ -30,28 +72,34 @@ typedef struct _file_states {
|
||||
unsigned char error;
|
||||
} file_states;
|
||||
|
||||
typedef void (*__idle_proc)(void);
|
||||
typedef int (*__pos_proc)(__file_handle file, fpos_t* position, int mode, __idle_proc idle_proc);
|
||||
typedef int (*__io_proc)(__file_handle file, unsigned char* buff, size_t* count,
|
||||
__idle_proc idle_proc);
|
||||
typedef int (*__close_proc)(__file_handle file);
|
||||
|
||||
typedef struct _FILE {
|
||||
/* 0x00 */ unsigned int handle;
|
||||
/* 0x00 */ __file_handle handle;
|
||||
/* 0x04 */ file_modes file_mode;
|
||||
/* 0x08 */ file_states file_state;
|
||||
/* 0x0C */ unsigned char flag;
|
||||
/* 0x0C */ unsigned char is_dynamically_allocated;
|
||||
/* 0x0D */ char char_buffer;
|
||||
/* 0x0E */ char char_buffer_2;
|
||||
/* 0x0E */ char char_buffer_overflow;
|
||||
/* 0x0F */ char ungetc_buffer[2];
|
||||
/* 0x12 */ unsigned short ungetc_wide_buffer[2];
|
||||
/* 0x18 */ unsigned int position;
|
||||
/* 0x12 */ wchar_t ungetc_wide_buffer[2];
|
||||
/* 0x18 */ unsigned long position;
|
||||
/* 0x1C */ unsigned char* buffer;
|
||||
/* 0x20 */ unsigned int buffer_size;
|
||||
/* 0x20 */ unsigned long buffer_size;
|
||||
/* 0x24 */ unsigned char* buffer_ptr;
|
||||
/* 0x28 */ unsigned int buffer_length;
|
||||
/* 0x2C */ unsigned int buffer_alignment;
|
||||
/* 0x30 */ unsigned int buffer_length2;
|
||||
/* 0x34 */ unsigned int buffer_position;
|
||||
/* 0x38 */ void* position_fn;
|
||||
/* 0x3C */ void* read_fn;
|
||||
/* 0x40 */ void* write_fn;
|
||||
/* 0x44 */ void* close_fn;
|
||||
/* 0x48 */ void* unknown;
|
||||
/* 0x28 */ unsigned long buffer_length;
|
||||
/* 0x2C */ unsigned long buffer_alignment;
|
||||
/* 0x30 */ unsigned long save_buffer_length;
|
||||
/* 0x34 */ unsigned long buffer_position;
|
||||
/* 0x38 */ __pos_proc position_fn;
|
||||
/* 0x3C */ __io_proc read_fn;
|
||||
/* 0x40 */ __io_proc write_fn;
|
||||
/* 0x44 */ __close_proc close_fn;
|
||||
/* 0x48 */ __idle_proc idle_fn;
|
||||
/* 0x4C */ struct _FILE* next_file;
|
||||
} FILE;
|
||||
|
||||
@@ -62,6 +110,20 @@ typedef struct _files {
|
||||
FILE empty;
|
||||
} files;
|
||||
|
||||
#define _IONBF 0
|
||||
#define _IOLBF 1
|
||||
#define _IOFBF 2
|
||||
|
||||
extern files __files;
|
||||
extern int __close_console(__file_handle file);
|
||||
extern int __write_console(__file_handle file, unsigned char* buf, size_t* count, __idle_proc idle_fn);
|
||||
extern int __read_console(__file_handle file, unsigned char* buf, size_t* count, __idle_proc idle_fn);
|
||||
|
||||
unsigned int __flush_all(void);
|
||||
void __close_all(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ANSI_FILES_H */
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#ifndef MSL_COMMON_SRC_ARITH_H
|
||||
#define MSL_COMMON_SRC_ARITH_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int quot; /* quotient */
|
||||
int rem; /* remainder */
|
||||
} div_t;
|
||||
|
||||
div_t div(int numerator, int denominator);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ARITH_H */
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
#ifndef MSL_COMMON_SRC_BUFFER_IO_H
|
||||
#define MSL_COMMON_SRC_BUFFER_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
enum { __align_buffer, __dont_align_buffer };
|
||||
|
||||
void __prep_buffer(FILE* file);
|
||||
int __flush_buffer(FILE* file, size_t* bytes_flushed);
|
||||
|
||||
#endif /* MSL_COMMON_SRC_BUFFER_IO_H */
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#define MSL_COMMON_SRC_CHAR_IO_H
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int fputs(const char*, FILE*);
|
||||
int fputs(const char* str, FILE* stream);
|
||||
int __put_char(int c, FILE* stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,12 +1,33 @@
|
||||
#ifndef MSL_COMMON_SRC_CTYPE_H
|
||||
#define MSL_COMMON_SRC_CTYPE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define EOF -1L
|
||||
|
||||
extern unsigned char __ctype_map[];
|
||||
extern unsigned char __lower_map[];
|
||||
extern unsigned char __upper_map[];
|
||||
|
||||
#define __control_char 0x01
|
||||
#define __motion_char 0x02
|
||||
#define __space_char 0x04
|
||||
#define __punctuation 0x08
|
||||
#define __digit 0x10
|
||||
#define __hex_digit 0x20
|
||||
#define __lower_case 0x40
|
||||
#define __upper_case 0x80
|
||||
|
||||
#define __letter (__lower_case | __upper_case)
|
||||
#define __alphanumeric (__letter | __digit)
|
||||
#define __graphic (__alphanumeric | __punctuation)
|
||||
#define __printable (__graphic | __space_char)
|
||||
#define __whitespace (__motion_char | __space_char)
|
||||
#define __control (__motion_char | __control_char)
|
||||
#define __zero_fill(c) ((int)(unsigned char)(c))
|
||||
|
||||
int tolower(int);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
#ifndef MSL_COMMON_SRC_DIRECT_IO_H
|
||||
#define MSL_COMMON_SRC_DIRECT_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t __fwrite(const void* buffer, size_t size, size_t count, FILE* stream);
|
||||
size_t fwrite(const void* buffer, size_t size, size_t count, FILE* stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_DIRECT_IO_H */
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
#ifndef MSL_COMMON_SRC_EXTRAS_H
|
||||
#define MSL_COMMON_SRC_EXTRAS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int strnicmp(const char* str1, const char* str2, int n);
|
||||
int stricmp(const char* str1, const char* str2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_EXTRAS_H */
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
#ifndef MSL_COMMON_SRC_FILE_IO_H
|
||||
#define MSL_COMMON_SRC_FILE_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int __msl_strnicmp(const char* str1, const char* str2, size_t n);
|
||||
int fflush(FILE* file);
|
||||
int fclose(FILE* file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_FILE_IO_H */
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef MSL_COMMON_SRC_FLOAT_H
|
||||
#define MSL_COMMON_SRC_FLOAT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "fdlibm.h"
|
||||
|
||||
#define FP_SNAN 0
|
||||
@@ -17,13 +16,13 @@
|
||||
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x))
|
||||
#define isfinite(x) ((fpclassify(x) > 2))
|
||||
|
||||
#define __signbitf(x) ((*(u8*)&(x)) & 0x80)
|
||||
#define __signbitf(x) ((*(unsigned char*)&(x)) & 0x80)
|
||||
|
||||
// TODO: OK?
|
||||
#define __signbitd(x) ((*(u8*)&(x)) & 0x80)
|
||||
#define __signbitd(x) ((*(unsigned char*)&(x)) & 0x80)
|
||||
|
||||
inline int __fpclassifyf(float __value) {
|
||||
u32 integer = *(u32*)&__value;
|
||||
unsigned long integer = *(unsigned long*)&__value;
|
||||
|
||||
switch (integer & 0x7f800000) {
|
||||
case 0x7f800000:
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
#ifndef MSL_COMMON_SRC_MBSTRING_H
|
||||
#define MSL_COMMON_SRC_MBSTRING_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/wchar_io.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t wcstombs(char* dst, const wchar_t* src, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_MBSTRING_H */
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
#ifndef MSL_COMMON_SRC_MEM_H
|
||||
#define MSL_COMMON_SRC_MEM_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int memcmp(const void*, const void*, size_t);
|
||||
int memcmp(const void* lhs, const void* rhs, size_t count);
|
||||
void* __memrchr(const void* ptr, int ch, size_t count);
|
||||
void* memchr(const void* ptr, int ch, size_t count);
|
||||
void* memmove(void* dst, const void* src, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#ifndef MSL_COMMON_SRC_MEM_FUNCS_H
|
||||
#define MSL_COMMON_SRC_MEM_FUNCS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __copy_longs_rev_unaligned(void* dst, const void* src, size_t n);
|
||||
void __copy_longs_unaligned(void* dst, const void* src, size_t n);
|
||||
void __copy_longs_rev_aligned(void* dst, const void* src, size_t n);
|
||||
void __copy_longs_aligned(void* dst, const void* src, size_t n);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_MEM_FUNCS_H */
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
#ifndef MSL_COMMON_SRC_MISC_IO_H
|
||||
#define MSL_COMMON_SRC_MISC_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void __stdio_atexit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_MISC_IO_H */
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
#ifndef MSL_COMMON_SRC_PRINTF_H
|
||||
#define MSL_COMMON_SRC_PRINTF_H
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t sprintf(const char*, const char*, ...);
|
||||
size_t snprintf(const char*, size_t, const char*, ...);
|
||||
size_t vsnprintf(char*, size_t, const char*, va_list);
|
||||
size_t vprintf(const char*, va_list);
|
||||
size_t printf(const char*, ...);
|
||||
int fprintf(FILE* stream, const char* format, ...);
|
||||
int printf(const char* format, ...);
|
||||
int sprintf(const char* str, const char* format, ...);
|
||||
int snprintf(const char* str, size_t n, const char* format, ...);
|
||||
int vsnprintf(char* str, size_t n, const char* format, va_list arg);
|
||||
int vprintf(const char* format, va_list arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
#ifndef MSL_COMMON_SRC_SCANF_H
|
||||
#define MSL_COMMON_SRC_SCANF_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int __StringRead(char* str, int ch, int behavior);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_SCANF_H */
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
#ifndef MSL_COMMON_SRC_SIGNAL_H
|
||||
#define MSL_COMMON_SRC_SIGNAL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int raise(int sig);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_SIGNAL_H */
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef _STDDEF_H_
|
||||
#define _STDDEF_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef unsigned long size_t;
|
||||
typedef long ptrdiff_t;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,24 +1,23 @@
|
||||
#ifndef MSL_COMMON_SRC_STRING_H
|
||||
#define MSL_COMMON_SRC_STRING_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void* memcpy(void*, const void*, size_t);
|
||||
void* memset(void*, int, u32);
|
||||
char* strrchr(const char*, int);
|
||||
char* strchr(const char*, int);
|
||||
int strncmp(const char*, const char*, u32);
|
||||
int strcmp(const char*, const char*);
|
||||
char* strcat(char*, const char*);
|
||||
char* strncpy(char*, const char*, u32);
|
||||
char* strcpy(char*, const char*);
|
||||
u32 strlen(const char*);
|
||||
void* memcpy(void* dst, const void* src, size_t n);
|
||||
void* memset(void* dst, int val, size_t n);
|
||||
|
||||
int stricmp(const char*, const char*);
|
||||
char* strrchr(const char* str, int c);
|
||||
char* strchr(const char* str, int c);
|
||||
int strncmp(const char* str1, const char* str2, size_t n);
|
||||
int strcmp(const char* str1, const char* str2);
|
||||
char* strcat(char* dst, const char* src);
|
||||
char* strncpy(char* dst, const char* src, size_t n);
|
||||
char* strcpy(char* dst, const char* src);
|
||||
size_t strlen(const char* str);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
#ifndef MSL_COMMON_SRC_STRTOUL_H
|
||||
#define MSL_COMMON_SRC_STRTOUL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
long strtol(const char* str, char** endptr, int base);
|
||||
unsigned long strtoul(const char* str, char** endptr, int base);
|
||||
unsigned long __strtoul(const char* str, char** endptr, int base);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_STRTOUL_H */
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#ifndef MSL_COMMON_SRC_WCHAR_IO_H
|
||||
#define MSL_COMMON_SRC_WCHAR_IO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
typedef unsigned short wchar_t;
|
||||
|
||||
int fwide(FILE* file, int mode);
|
||||
|
||||
#endif /* MSL_COMMON_SRC_WCHAR_IO_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MSL_COMMON_EMBEDDED_SRC_ANSI_FP_H
|
||||
#define MSL_COMMON_EMBEDDED_SRC_ANSI_FP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MSL_COMMON_EMBEDDED_SRC_ANSI_FP_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_E_ACOS_H
|
||||
#define MATH_DOUBLE_PRECISION_E_ACOS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_ACOS_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_E_ASIN_H
|
||||
#define MATH_DOUBLE_PRECISION_E_ASIN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_ASIN_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_E_ATAN2_H
|
||||
#define MATH_DOUBLE_PRECISION_E_ATAN2_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_ATAN2_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_E_EXP_H
|
||||
#define MATH_DOUBLE_PRECISION_E_EXP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_EXP_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_E_FMOD_H
|
||||
#define MATH_DOUBLE_PRECISION_E_FMOD_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_FMOD_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_E_POW_H
|
||||
#define MATH_DOUBLE_PRECISION_E_POW_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_POW_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_E_REM_PIO2_H
|
||||
#define MATH_DOUBLE_PRECISION_E_REM_PIO2_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_REM_PIO2_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_E_SQRT_H
|
||||
#define MATH_DOUBLE_PRECISION_E_SQRT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_E_SQRT_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_K_COS_H
|
||||
#define MATH_DOUBLE_PRECISION_K_COS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_K_COS_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_K_REM_PIO2_H
|
||||
#define MATH_DOUBLE_PRECISION_K_REM_PIO2_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_K_REM_PIO2_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_K_SIN_H
|
||||
#define MATH_DOUBLE_PRECISION_K_SIN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_K_SIN_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_K_TAN_H
|
||||
#define MATH_DOUBLE_PRECISION_K_TAN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_K_TAN_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_ATAN_H
|
||||
#define MATH_DOUBLE_PRECISION_S_ATAN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_ATAN_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_CEIL_H
|
||||
#define MATH_DOUBLE_PRECISION_S_CEIL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_CEIL_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_COPYSIGN_H
|
||||
#define MATH_DOUBLE_PRECISION_S_COPYSIGN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_COPYSIGN_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_COS_H
|
||||
#define MATH_DOUBLE_PRECISION_S_COS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_COS_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_FLOOR_H
|
||||
#define MATH_DOUBLE_PRECISION_S_FLOOR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_FLOOR_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_FREXP_H
|
||||
#define MATH_DOUBLE_PRECISION_S_FREXP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_FREXP_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_LDEXP_H
|
||||
#define MATH_DOUBLE_PRECISION_S_LDEXP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_LDEXP_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_MODF_H
|
||||
#define MATH_DOUBLE_PRECISION_S_MODF_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_MODF_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_SIN_H
|
||||
#define MATH_DOUBLE_PRECISION_S_SIN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_SIN_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_S_TAN_H
|
||||
#define MATH_DOUBLE_PRECISION_S_TAN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_S_TAN_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_W_ACOS_H
|
||||
#define MATH_DOUBLE_PRECISION_W_ACOS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_ACOS_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_W_ASIN_H
|
||||
#define MATH_DOUBLE_PRECISION_W_ASIN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_ASIN_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_W_ATAN2_H
|
||||
#define MATH_DOUBLE_PRECISION_W_ATAN2_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_ATAN2_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_W_EXP_H
|
||||
#define MATH_DOUBLE_PRECISION_W_EXP_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_EXP_H */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_W_FMOD_H
|
||||
#define MATH_DOUBLE_PRECISION_W_FMOD_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
double fmod(double, double);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_W_POW_H
|
||||
#define MATH_DOUBLE_PRECISION_W_POW_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_POW_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef MATH_DOUBLE_PRECISION_W_SQRT_H
|
||||
#define MATH_DOUBLE_PRECISION_W_SQRT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* MATH_DOUBLE_PRECISION_W_SQRT_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef PPC_EABI_SRC_CRITICAL_REGIONSGAMECUBE_H
|
||||
#define PPC_EABI_SRC_CRITICAL_REGIONSGAMECUBE_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* PPC_EABI_SRC_CRITICAL_REGIONSGAMECUBE_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef PPC_EABI_SRC_MATH_PPC_H
|
||||
#define PPC_EABI_SRC_MATH_PPC_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
#endif /* PPC_EABI_SRC_MATH_PPC_H */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef PPC_EABI_SRC_UART_CONSOLE_IO_GCN_H
|
||||
#define PPC_EABI_SRC_UART_CONSOLE_IO_GCN_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/MSL_Common/Src/ansi_files.h"
|
||||
|
||||
#endif /* PPC_EABI_SRC_UART_CONSOLE_IO_GCN_H */
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define MSL_MATH_H_
|
||||
|
||||
#include "MSL_C/MSL_Common/Src/float.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#define M_PI 3.14159265358979323846f
|
||||
|
||||
@@ -76,7 +75,7 @@ inline float sqrtf(float mag) {
|
||||
}
|
||||
|
||||
inline float atan2f(float y, float x) {
|
||||
return (f32)atan2(y, x);
|
||||
return (float)atan2(y, x);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define MSL_STRING_H_
|
||||
|
||||
#include "Runtime.PPCEABI.H/__va_arg.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
|
||||
// TODO: move to MSL_C/
|
||||
extern "C" {
|
||||
|
||||
@@ -26,12 +26,10 @@ typedef volatile f64 vf64;
|
||||
|
||||
typedef int BOOL;
|
||||
|
||||
typedef unsigned long size_t;
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define NULL (0)
|
||||
#include "MSL_C/MSL_Common/Src/stddef.h"
|
||||
|
||||
#define INT32_MAX (0x7fffffff)
|
||||
#define UINT32_MAX (0xffffffff)
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
#ifndef MSL_COMMON_SRC_ERRNO_H
|
||||
#define MSL_COMMON_SRC_ERRNO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ENOERR 0
|
||||
#define EDOM 33
|
||||
#define ERANGE 34
|
||||
#define EFPOS 40
|
||||
#define ESIGPARM 36
|
||||
|
||||
extern int errno;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MSL_COMMON_SRC_ERRNO_H */
|
||||
|
||||
Reference in New Issue
Block a user