Skip to content

Commit

Permalink
add Mac tools
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed May 21, 2016
1 parent b040245 commit 05f328f
Show file tree
Hide file tree
Showing 29 changed files with 284 additions and 0 deletions.
Binary file added tools/osx/bim2bin
Binary file not shown.
Binary file added tools/osx/bim2hrb
Binary file not shown.
Binary file added tools/osx/bin2obj
Binary file not shown.
Binary file added tools/osx/edimg
Binary file not shown.
Binary file added tools/osx/fdimg0at.tek
Binary file not shown.
Binary file added tools/osx/gas2nask
Binary file not shown.
Binary file added tools/osx/gocc1
Binary file not shown.
Binary file added tools/osx/gocc1plus
Binary file not shown.
Binary file added tools/osx/gocpp0
Binary file not shown.
Binary file added tools/osx/golib00
Binary file not shown.
20 changes: 20 additions & 0 deletions tools/osx/haribote/errno.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */

#if (!defined(ERRNO_H))

#define ERRNO_H 1

#if (defined(__cplusplus))
extern "C" {
#endif

extern int errno;

#define ENOENT 2 /* No such file or directory */
#define ERANGE 34 /* Result too large (or too small) */

#if (defined(__cplusplus))
}
#endif

#endif
26 changes: 26 additions & 0 deletions tools/osx/haribote/float.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* copyright(C) 2002 H.Kawai (under KL-01). */

#if (!defined(FLOAT_H))

#define FLOAT_H 1

#define FLT_RADIX 2
#define FLT_ROUNDS 1 /* nearest */
#define FLT_DIG 6
#define FLT_EPSILON 1.19209290e-07F
#define FLT_MANT_DIG 24
#define FLT_MAX 3.40282347e+38F
#define FLT_MAX_EXP (+128)
#define FLT_MIN 1.17549435e-38F
#define FLT_MIN_EXP (-125)

#define DBL_DIG 15
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_MANT_DIG 53
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MAX_EXP 1024
#define DBL_MIN 2.2250738585072014e-308
#define DBL_MIN_EXP (-1021)

#endif

Binary file added tools/osx/haribote/golibc.lib
Binary file not shown.
19 changes: 19 additions & 0 deletions tools/osx/haribote/haribote.rul
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
format:
/* ���̃Z�N�V�����Ń����N�̕��j���L�q */
code(align:1, logic:0x24, file:0x24);
data(align:4, logic:stack_end, file:code_end);

file:
/* ���̃Z�N�V�����ŃR�}���h���C���ɏ�������Ȃ�����
.ojb�t�@�C���A.lib�t�@�C�����L�� */
/* �Ȃ��A���̃Z�N�V�����̓t���p�X�ŏ����Ă��悢�B */
/* ��F c:/osask/gg00libc.lib; */
../z_tools/haribote/harilibc.lib;
../z_tools/haribote/golibc.lib;

label:
/* �K�������N���Ȃ���΂����Ȃ����x�����w�� */
/* �G���g���|�C���g���w�肷��΂����Ǝv���Ă������� */
_HariStartup;

/* ��L3�Z�N�V�����̏����͓���ւ��Ă͂����܂���! */
Binary file added tools/osx/haribote/harilibc.lib
Binary file not shown.
23 changes: 23 additions & 0 deletions tools/osx/haribote/limits.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* copyright(C) 2002 H.Kawai (under KL-01). */

#if (!defined(LIMITS_H))

#define LIMITS_H 1

#define CHAR_BIT 8
#define CHAR_MAX (+127)
#define CHAR_MIN 0
#define INT_MAX (+0x7fffffff)
#define INT_MIN (-0x7fffffff)
#define LONG_MAX INT_MAX
#define LONG_MIN INT_MIN
#define SCHAR_MAX (+127)
#define SCHAR_MIN (-127)
#define SHRT_MAX (+0x7fff)
#define SHRT_MIN (-0x7fff)
#define UCHAR_MAX (+0xff)
#define UINT_MAX (+0xffffffff)
#define ULONG_MAX UINT_MAX
#define USHRT_MAX (+0xffff)

#endif
42 changes: 42 additions & 0 deletions tools/osx/haribote/math.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */

#if (!defined(MATH_H))

#define MATH_H 1

#if (defined(__cplusplus))
extern "C" {
#endif

double sin(double);
double cos(double);
double sqrt(double);
double ldexp(double x, int n);
double frexp(double x, int *exp);

extern __inline__ double sin(double x)
{
double res;
__asm__ ("fsin" : "=t" (res) : "0" (x));
return res;
}

extern __inline__ double cos(double x)
{
double res;
__asm__ ("fcos" : "=t" (res) : "0" (x));
return res;
}

extern __inline__ double sqrt(double x)
{
double res;
__asm__ ("fsqrt" : "=t" (res) : "0" (x));
return res;
}

#if (defined(__cplusplus))
}
#endif

#endif
20 changes: 20 additions & 0 deletions tools/osx/haribote/setjmp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */

#if (!defined(SETJMP_H))

#define SETJMP_H 1

#if (defined(__cplusplus))
extern "C" {
#endif

typedef int jmp_buf[3]; /* EBP, EIP, ESP */

#define setjmp(env) __builtin_setjmp(env)
#define longjmp(env, val) __builtin_longjmp(env, val)

#if (defined(__cplusplus))
}
#endif

#endif
21 changes: 21 additions & 0 deletions tools/osx/haribote/stdarg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */

#if (!defined(STDARG_H))

#define STDARG_H 1

#if (defined(__cplusplus))
extern "C" {
#endif

#define va_start(v,l) __builtin_stdarg_start((v),l)
#define va_end __builtin_va_end
#define va_arg __builtin_va_arg
#define va_copy(d,s) __builtin_va_copy((d),(s))
#define va_list __builtin_va_list

#if (defined(__cplusplus))
}
#endif

#endif
17 changes: 17 additions & 0 deletions tools/osx/haribote/stddef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */

#if (!defined(STDDEF_H))

#define STDDEF_H 1

#if (defined(__cplusplus))
extern "C" {
#endif

typedef unsigned int size_t;

#if (defined(__cplusplus))
}
#endif

#endif
24 changes: 24 additions & 0 deletions tools/osx/haribote/stdio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */

#if (!defined(STDIO_H))

#define STDIO_H 1

#if (defined(__cplusplus))
extern "C" {
#endif

#if (!defined(NULL))
#define NULL ((void *) 0)
#endif

#include <stdarg.h>

int sprintf(char *s, const char *format, ...);
int vsprintf(char *s, const char *format, va_list arg);

#if (defined(__cplusplus))
}
#endif

#endif
34 changes: 34 additions & 0 deletions tools/osx/haribote/stdlib.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */

#if (!defined(STDLIB_H))

#define STDLIB_H 1

#if (defined(__cplusplus))
extern "C" {
#endif

#include <stddef.h> /* size_t */

#define RAND_MAX 0x7fff
#define srand(seed) (void) (rand_seed = (seed))

int abs(int n);
double atof(const char *s);
int atoi(const char *s);
void qsort(void *base, size_t n, size_t size,
int (*cmp)(const void *, const void *));
int rand(void);
extern unsigned int rand_seed;
double strtod(const char *s, const char **endp);
long strtol(const char *s, const char **endp, int base);
unsigned long strtoul(const char *s, const char **endp, int base);

void *malloc(unsigned int nbytes);
void free(void *ap);

#if (defined(__cplusplus))
}
#endif

#endif
38 changes: 38 additions & 0 deletions tools/osx/haribote/string.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */

#if (!defined(STRING_H))

#define STRING_H 1

#if (defined(__cplusplus))
extern "C" {
#endif

#include <stddef.h> /* size_t */

char *strcpy(char *s, const char *ct);
char *strncpy(char *s, const char *ct, size_t n);
char *strcat(char *s, const char *ct);
char *strncat(char *s, const char *ct, size_t n);
int strcmp(const char *cs, const char *ct);
int strncmp(const char *cs, const char *ct, size_t n);
char *strchr(const char *cs, int c);
char *strrchr(const char *cs, int c);
size_t strspn(const char *s, const char *accept);
size_t strcspn(const char *s, const char *reject);
char *strpbrk(const char *s, const char *accept);
char *strstr(const char *cs, const char *ct);
size_t strlen(const char *cs);

void *memcpy(void *s, const void *ct, size_t n);
void *memmove(void *s, const void *ct, size_t n);
int memcmp(const void *cs, const void *ct, size_t n);
void *memchr(const void *cs, int c, size_t n);
void *memset(void *s, int c, size_t n);
char *strdup(const char *s);

#if (defined(__cplusplus))
}
#endif

#endif
Binary file added tools/osx/makefont
Binary file not shown.
Binary file added tools/osx/nask
Binary file not shown.
Binary file added tools/osx/naskcnv0
Binary file not shown.
Binary file added tools/osx/obj2bim
Binary file not shown.
Binary file added tools/osx/sjisconv
Binary file not shown.
Binary file added tools/osx/t5lzma
Binary file not shown.

0 comments on commit 05f328f

Please sign in to comment.