1 |
|
/* |
2 |
|
* sysdeps.h - System dependent definitions for Unix |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2000 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2001 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
69 |
|
|
70 |
|
/* Mac ROM is not write protected */ |
71 |
|
#define ROM_IS_WRITE_PROTECTED 0 |
72 |
+ |
#define USE_SCRATCHMEM_SUBTERFUGE 1 |
73 |
|
|
74 |
|
#else |
75 |
|
|
76 |
|
/* Mac and host address space are distinct */ |
77 |
+ |
#ifndef REAL_ADDRESSING |
78 |
|
#define REAL_ADDRESSING 0 |
79 |
+ |
#endif |
80 |
|
|
81 |
|
/* Using 68k emulator */ |
82 |
|
#define EMULATED_68K 1 |
83 |
|
|
84 |
< |
/* Mac ROM is write protected */ |
85 |
< |
#define ROM_IS_WRITE_PROTECTED 1 |
84 |
> |
/* The m68k emulator uses a prefetch buffer ? */ |
85 |
> |
#define USE_PREFETCH_BUFFER 0 |
86 |
> |
|
87 |
> |
/* Mac ROM is write protected when banked memory is used */ |
88 |
> |
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
89 |
> |
# define ROM_IS_WRITE_PROTECTED 0 |
90 |
> |
# define USE_SCRATCHMEM_SUBTERFUGE 1 |
91 |
> |
#else |
92 |
> |
# define ROM_IS_WRITE_PROTECTED 1 |
93 |
> |
#endif |
94 |
> |
|
95 |
> |
#endif |
96 |
|
|
97 |
+ |
/* Direct Addressing requires Video on SEGV signals */ |
98 |
+ |
#if DIRECT_ADDRESSING && !ENABLE_VOSF |
99 |
+ |
# undef ENABLE_VOSF |
100 |
+ |
# define ENABLE_VOSF 1 |
101 |
|
#endif |
102 |
|
|
103 |
|
/* ExtFS is supported */ |
138 |
|
#else |
139 |
|
#error "No 8 byte type, you lose." |
140 |
|
#endif |
141 |
+ |
#if SIZEOF_VOID_P == 4 |
142 |
+ |
typedef uint32 uintptr; |
143 |
+ |
typedef int32 intptr; |
144 |
+ |
#elif SIZEOF_VOID_P == 8 |
145 |
+ |
typedef uint64 uintptr; |
146 |
+ |
typedef int64 intptr; |
147 |
+ |
#else |
148 |
+ |
#error "Unsupported size of pointer" |
149 |
+ |
#endif |
150 |
|
|
151 |
|
/* Time data type for Time Manager emulation */ |
152 |
|
#ifdef HAVE_CLOCK_GETTIME |
155 |
|
typedef struct timeval tm_time_t; |
156 |
|
#endif |
157 |
|
|
132 |
– |
/* Offset Mac->Unix time in seconds */ |
133 |
– |
#define TIME_OFFSET 0x7c25b080 |
134 |
– |
|
158 |
|
/* UAE CPU data types */ |
159 |
|
#define uae_s8 int8 |
160 |
|
#define uae_u8 uint8 |
171 |
|
# define CPU_CAN_ACCESS_UNALIGNED |
172 |
|
#endif |
173 |
|
|
174 |
+ |
/* Timing functions */ |
175 |
+ |
extern uint64 GetTicks_usec(void); |
176 |
+ |
extern void Delay_usec(uint32 usec); |
177 |
+ |
|
178 |
|
/* UAE CPU defines */ |
179 |
|
#ifdef WORDS_BIGENDIAN |
180 |
|
|
233 |
|
#else |
234 |
|
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;} |
235 |
|
#endif |
236 |
+ |
#define HAVE_OPTIMIZED_BYTESWAP_32 |
237 |
+ |
/* bswap doesn't affect condition codes */ |
238 |
+ |
static inline uae_u32 do_byteswap_32(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;} |
239 |
+ |
#define HAVE_OPTIMIZED_BYTESWAP_16 |
240 |
+ |
#ifdef X86_PPRO_OPT |
241 |
+ |
static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;} |
242 |
+ |
#else |
243 |
+ |
static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;} |
244 |
+ |
#endif |
245 |
|
|
246 |
|
#elif defined(CPU_CAN_ACCESS_UNALIGNED) |
247 |
|
|
263 |
|
|
264 |
|
#endif /* WORDS_BIGENDIAN */ |
265 |
|
|
266 |
+ |
#ifndef HAVE_OPTIMIZED_BYTESWAP_32 |
267 |
+ |
static inline uae_u32 do_byteswap_32(uae_u32 v) |
268 |
+ |
{ return (((v >> 24) & 0xff) | ((v >> 8) & 0xff00) | ((v & 0xff) << 24) | ((v & 0xff00) << 8)); } |
269 |
+ |
#endif |
270 |
+ |
|
271 |
+ |
#ifndef HAVE_OPTIMIZED_BYTESWAP_16 |
272 |
+ |
static inline uae_u32 do_byteswap_16(uae_u32 v) |
273 |
+ |
{ return (((v >> 8) & 0xff) | ((v & 0xff) << 8)); } |
274 |
+ |
#endif |
275 |
+ |
|
276 |
|
#define do_get_mem_byte(a) ((uae_u32)*((uae_u8 *)(a))) |
277 |
|
#define do_put_mem_byte(a, v) (*(uae_u8 *)(a) = (v)) |
278 |
|
|
286 |
|
#define ENUMNAME(name) name |
287 |
|
#define write_log printf |
288 |
|
|
243 |
– |
#ifdef USE_COMPILER |
244 |
– |
#define USE_MAPPED_MEMORY |
245 |
– |
#define CAN_MAP_MEMORY |
246 |
– |
#define NO_EXCEPTION_3 |
247 |
– |
#define NO_PREFETCH_BUFFER |
248 |
– |
#else |
249 |
– |
#undef USE_MAPPED_MEMORY |
250 |
– |
#undef CAN_MAP_MEMORY |
251 |
– |
#endif |
252 |
– |
|
289 |
|
#ifdef X86_ASSEMBLY |
290 |
|
#define ASM_SYM_FOR_FUNC(a) __asm__(a) |
291 |
|
#else |