4 |
|
* |
5 |
|
* $Id$ |
6 |
|
* |
7 |
< |
* Basilisk II (C) 1997-2001 Christian Bauer |
7 |
> |
* Basilisk II (C) 1997-2008 Christian Bauer |
8 |
|
* |
9 |
|
* This program is free software; you can redistribute it and/or modify |
10 |
|
* it under the terms of the GNU General Public License as published by |
46 |
|
#include <stdlib.h> |
47 |
|
#include <string.h> |
48 |
|
|
49 |
+ |
#ifdef HAVE_PTHREADS |
50 |
+ |
# include <pthread.h> |
51 |
+ |
#endif |
52 |
+ |
|
53 |
|
#ifdef HAVE_FCNTL_H |
54 |
|
# include <fcntl.h> |
55 |
|
#endif |
65 |
|
# endif |
66 |
|
#endif |
67 |
|
|
68 |
+ |
#if defined(__MACH__) |
69 |
+ |
#include <mach/clock.h> |
70 |
+ |
#endif |
71 |
+ |
|
72 |
+ |
/* Symbol to distinguish Nigel's Aqua port from a normal Darwin X11 build */ |
73 |
+ |
/* (this sysdeps.h file is currently specific to the Mac OS X Aqua port) */ |
74 |
+ |
#define AQUA 1 |
75 |
|
|
76 |
+ |
/* Header which defines OS X version for selecting APIs */ |
77 |
|
#ifdef AVAILABILITYMACROS |
78 |
|
# include <AvailabilityMacros.h> |
79 |
|
#endif |
80 |
|
|
69 |
– |
/* Emulator and host address space are distinct */ |
70 |
– |
#ifndef REAL_ADDRESSING |
71 |
– |
# define REAL_ADDRESSING 0 |
72 |
– |
#endif |
81 |
|
|
82 |
< |
/* Linear address translation (i.e. just an offset between Emulator & host) */ |
83 |
< |
#ifndef DIRECT_ADDRESSING |
84 |
< |
# ifdef MAC_OS_X_VERSION_10_2 |
85 |
< |
/* For some reason, compiling on 10.2 with DIRECT_ADDRESSING enabled gives an */ |
86 |
< |
/* app that never writes to its screen! (i.e. it never calls most of video.cpp) */ |
87 |
< |
# define DIRECT_ADDRESSING 0 |
88 |
< |
# else |
89 |
< |
# define DIRECT_ADDRESSING 1 |
90 |
< |
# endif |
82 |
> |
#ifdef ENABLE_NATIVE_M68K |
83 |
> |
|
84 |
> |
/* Mac and host address space are the same */ |
85 |
> |
#define REAL_ADDRESSING 1 |
86 |
> |
|
87 |
> |
/* Using 68k natively */ |
88 |
> |
#define EMULATED_68K 0 |
89 |
> |
|
90 |
> |
/* Mac ROM is not write protected */ |
91 |
> |
#define ROM_IS_WRITE_PROTECTED 0 |
92 |
> |
#define USE_SCRATCHMEM_SUBTERFUGE 1 |
93 |
> |
|
94 |
> |
#else |
95 |
> |
|
96 |
> |
/* Mac and host address space are distinct */ |
97 |
> |
#ifndef REAL_ADDRESSING |
98 |
> |
#define REAL_ADDRESSING 0 |
99 |
|
#endif |
100 |
|
|
101 |
|
/* Using 68k emulator */ |
112 |
|
# define ROM_IS_WRITE_PROTECTED 1 |
113 |
|
#endif |
114 |
|
|
115 |
+ |
#endif |
116 |
+ |
|
117 |
+ |
/* Direct Addressing requires Video on SEGV signals */ |
118 |
+ |
#if DIRECT_ADDRESSING && !ENABLE_VOSF |
119 |
+ |
# undef ENABLE_VOSF |
120 |
+ |
# define ENABLE_VOSF 1 |
121 |
+ |
#endif |
122 |
|
|
123 |
|
/* ExtFS is supported */ |
124 |
|
#define SUPPORTS_EXTFS 1 |
125 |
|
|
126 |
+ |
/* BSD socket API supported */ |
127 |
+ |
#define SUPPORTS_UDP_TUNNEL 1 |
128 |
+ |
|
129 |
|
|
130 |
|
/* Data types */ |
131 |
|
typedef unsigned char uint8; |
172 |
|
#endif |
173 |
|
|
174 |
|
#ifndef HAVE_LOFF_T |
175 |
< |
typedef off_t loff_t; |
175 |
> |
typedef off_t loff_t; |
176 |
> |
#endif |
177 |
> |
#ifndef HAVE_CADDR_T |
178 |
> |
typedef char * caddr_t; |
179 |
|
#endif |
180 |
|
|
181 |
|
/* Time data type for Time Manager emulation */ |
182 |
|
#ifdef HAVE_CLOCK_GETTIME |
183 |
|
typedef struct timespec tm_time_t; |
184 |
+ |
#elif defined(__MACH__) |
185 |
+ |
typedef mach_timespec_t tm_time_t; |
186 |
|
#else |
187 |
|
typedef struct timeval tm_time_t; |
188 |
|
#endif |
189 |
|
|
190 |
< |
/* Offset Mac->Unix time in seconds */ |
191 |
< |
#define TIME_OFFSET 0x7c25b080 |
190 |
> |
/* Define codes for all the float formats that we know of. |
191 |
> |
* Though we only handle IEEE format. */ |
192 |
> |
#define UNKNOWN_FLOAT_FORMAT 0 |
193 |
> |
#define IEEE_FLOAT_FORMAT 1 |
194 |
> |
#define VAX_FLOAT_FORMAT 2 |
195 |
> |
#define IBM_FLOAT_FORMAT 3 |
196 |
> |
#define C4X_FLOAT_FORMAT 4 |
197 |
|
|
198 |
|
/* UAE CPU data types */ |
199 |
|
#define uae_s8 int8 |
215 |
|
extern uint64 GetTicks_usec(void); |
216 |
|
extern void Delay_usec(uint32 usec); |
217 |
|
|
218 |
+ |
#ifdef HAVE_PTHREADS |
219 |
+ |
/* Centralized pthread attribute setup */ |
220 |
+ |
void Set_pthread_attr(pthread_attr_t *attr, int priority); |
221 |
+ |
#endif |
222 |
+ |
|
223 |
|
/* UAE CPU defines */ |
224 |
|
#ifdef WORDS_BIGENDIAN |
225 |
|
|
330 |
|
#define ENUMDECL typedef enum |
331 |
|
#define ENUMNAME(name) name |
332 |
|
#define write_log printf |
292 |
– |
#undef USE_MAPPED_MEMORY |
293 |
– |
#undef CAN_MAP_MEMORY |
333 |
|
|
334 |
|
#if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY) |
335 |
|
#define ASM_SYM_FOR_FUNC(a) __asm__(a) |