--- uae/include/options.h 2018/04/24 16:37:54 1.1.1.1 +++ uae/include/options.h 2018/04/24 16:38:27 1.1.1.2 @@ -1,103 +1,231 @@ - /* + /* * UAE - The Un*x Amiga Emulator - * - * Run-time configuration options - * - * (c) 1995 Bernd Schmidt, Ed Hanway + * + * cpp magic + * + * Copyright 1995, 1996 Bernd Schmidt, Ed Hanway */ -typedef enum { KBD_LANG_US, KBD_LANG_DE } KbdLang; +typedef enum { KBD_LANG_US, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT } KbdLang; extern int framerate; -extern bool produce_sound; -extern bool dont_want_aspect; -extern bool use_fast_draw; -extern bool use_debugger; -extern bool use_slow_mem; -extern bool automount_uaedev; +extern int produce_sound; +extern int dont_want_aspect; +extern int use_fast_draw; +extern int use_debugger; +extern int use_slow_mem; +extern int use_fast_mem; +extern int use_gfxlib; +extern int use_xhair; +extern int use_lores; +extern int automount_uaedev; +extern int fake_joystick; extern KbdLang keyboard_lang; +extern int color_mode; +extern int screen_res; -#undef DEFAULT_NO_ASPECT -#ifdef DEFAULT_WANT_ASPECT -#define DEFAULT_NO_ASPECT false -#else -#define DEFAULT_NO_ASPECT true -#endif +extern char df0[], df1[], df2[], df3[], romfile[], prtname[]; -#undef DEFAULT_KBD_LANG -#ifdef DEFAULT_KBD_LANG_DE -#define DEFAULT_KBD_LANG KBD_LANG_DE -#else -#define DEFAULT_KBD_LANG KBD_LANG_US +#ifndef __unix +extern void parse_cmdline(int argc, char **argv); #endif -#ifndef DEFAULT_FRAMERATE -#define DEFAULT_FRAMERATE 5 +#ifdef __mac__ +/* Apparently, no memcpy :-/ */ +static __inline__ void *memcpy(void *to, void *from, int size) +{ + BlockMove(from, to, size); +} #endif -#undef HAVE_JOYSTICK -#ifdef LINUX_JOYSTICK -#define HAVE_JOYSTICK -#endif +/* strdup() may be non-portable if you have a weird system */ +static char *my_strdup(const char*s) +{ + /* The casts to char * are there to shut up the compiler on HPUX */ + char *x = (char*)malloc(strlen((char *)s) + 1); + strcpy(x, (char *)s); + return x; +} -#ifdef __mac__ -#define __inline__ inline -#else -#ifndef __GNUC__ -#ifdef __cplusplus -#define __inline__ inline -#else -#define __inline__ -#endif -#endif -#endif +#undef REGPARAM +#define fast_memcmp memcmp +#define memcmpy generic_memcmpy -#ifndef __unix -extern void parse_cmdline(int argc, char **argv); -#endif +static __inline__ int generic_memcmpy(void *foo, const void *bar, int len) +{ + int res = memcmp(foo, bar, len); + if (res) + memcpy(foo, bar, len); + return res; +} -/* Try to figure out whether we can __inline__ DrawPixel() */ +#if defined(__GNUC_MINOR__) -#undef INLINE_DRAWPIXEL8 -#undef INLINE_DRAWPIXEL16 -#undef INLINE_DRAWPIXEL +#ifdef __i386__ -#ifdef LINUX_SVGALIB +#define INTEL_FLAG_OPT -#define INLINE_DRAWPIXEL +#undef fast_memcmp +#undef memcmpy -#ifdef SVGALIB_8BIT_SCREEN -#define INLINE_DRAWPIXEL8 -#else +static __inline__ int fast_memcmp(const void *foo, const void *bar, int len) +{ + int differs, baz; + __asm__ __volatile__ ("subl $4, %2\n" + "jc 2f\n" + "1:\n" + "movl (%0),%%ebx\n" + "cmpl (%1),%%ebx\n" + "jne 5f\n" + "addl $4, %0\n" + "addl $4, %1\n" + "subl $4, %2\n" + "jnc 1b\n" + "2:\n" + "addl $4, %2\n" + "jz 4f\n" + "3:\n" + "movb (%0),%%bl\n" + "cmpb (%1),%%bl\n" + "jne 5f\n" + "incl %0\n" + "incl %1\n" + "decl %2\n" + "jnz 3b\n" + "4:\n" + "movl $0, %3\n" + "jmp 6f\n" + "5:\n" + "movl $1, %3\n" + "6:\n" + : "=&r" (foo), "=&r" (bar), "=&rm" (len), "=rm" (differs), + "=&b" (baz) + : "0" (foo), "1" (bar), "2" (len), "3" (baz) : "cc"); + return differs; +} -#ifdef SVGALIB_16BIT_SCREEN -#define INLINE_DRAWPIXEL16 -#else -#error You need to define either SVGALIB_8BIT_SCREEN or SVGALIB_16BIT_SCREEN. +static __inline__ int memcmpy(void *foo, const void *bar, int len) +{ + int differs, baz = 0, uupzuq = 0; +/* printf("%p %p %d\n", foo, bar, len);*/ + __asm__ __volatile__ ("subl %1, %2\n" + "movl $0, %0\n" + "subl $16, %3\n" + "jc 7f\n" + + "8:\n" + "movl (%1),%%ecx\n" + "movl (%2,%1),%%ebx\n" + "xorl %%ebx, %%ecx\n" + "movl %%ebx, (%1)\n" + "orl %%ecx, %0\n" + + "movl 4(%2,%1),%%ebx\n" + "movl 4(%1),%%ecx\n" + "xorl %%ebx, %%ecx\n" + "movl %%ebx, 4(%1)\n" + "orl %%ecx, %0\n" + + "movl 8(%2,%1),%%ebx\n" + "movl 8(%1),%%ecx\n" + "xorl %%ebx, %%ecx\n" + "movl %%ebx, 8(%1)\n" + "orl %%ecx, %0\n" + + "movl 12(%2,%1),%%ebx\n" + "movl 12(%1),%%ecx\n" + "xorl %%ebx, %%ecx\n" + "movl %%ebx, 12(%1)\n" + "orl %%ecx, %0\n" + + "addl $16, %1\n" + "subl $16, %3\n" + "jnc 8b\n" + + "7:\n" + "addl $16, %3\n" + "subl $4, %3\n" + "jc 2f\n" + + "1:\n" + "movl (%2,%1),%%ebx\n" + "movl (%1),%%ecx\n" + "xorl %%ebx, %%ecx\n" + "movl %%ebx, (%1)\n" + "orl %%ecx, %0\n" + "addl $4, %1\n" + "subl $4, %3\n" + "jnc 1b\n" + + "2:\n" + "addl $4, %3\n" + "jz 6f\n" + "xorl %%ecx, %%ecx\n" + + "3:\n" + "movb (%2,%1),%%bl\n" + "movb (%1),%%cl\n" + "xorl %%bl,%%cl\n" + "movb %%bl,(%1)\n" + "orl %%ecx, %0\n" + "incl %1\n" + "decl %3\n" + "jnz 3b\n" + + "6:\n" + : "=m" (differs) + : "r" (foo), "r" (bar), "r" (len), "b" (baz), "c" (uupzuq) : "cc", "memory"); + /* Now tell the compiler that foo, bar and len have been modified + * If someone finds a way to express all this cleaner in constraints that + * GCC 2.7.2 understands, please FIXME */ + __asm__ __volatile__ ("" : "=rm" (foo), "=rm" (bar), "=rm" (len) : : "ebx", "ecx", "edx", "eax", "esi", "memory"); +/* printf("bar\n");*/ + return differs; +} #endif +#if __GNUC__ > 2 || __GNUC_MINOR__ > 6 + +#if defined(__i386__) && !defined(USE_PROFILING) +#define REGPARAM __attribute__((regparm(3))) +#endif /* __i386__ */ + +#endif /* GCC version 2.7 or higher */ +#endif /* GCC 2 */ + +#ifndef REGPARAM +#define REGPARAM #endif -#else /* not LINUX_SVGALIB */ +/*#define EMULATE_AGA*/ -#ifdef X_8BIT_SCREEN -#define INLINE_DRAWPIXEL8 -#define INLINE_DRAWPIXEL +#ifndef EMULATE_AGA +#define AGA_CHIPSET 0 #else -#ifdef X_16BIT_SCREEN -#define INLINE_DRAWPIXEL16 -#define INLINE_DRAWPIXEL -#endif +#define AGA_CHIPSET 1 #endif -#endif /* not LINUX_SVGALIB */ +#define SMART_UPDATE 1 -#ifdef __mac__ -/* Apparently, no memcpy :-/ */ /* -static __inline__ void *memcpy(void *to, void *from, int size) -{ - BlockMove(from, to, size); -} -*/ -#endif + * Disk accesses can be sped up. This isn't such a big win, though. + * It hasn't been extensively tested and is turned off by default. + * (It's broken currently, even if it appears to work for most programs) + */ +#define NO_FAST_DISK + +/* + * You can specify numbers from 0 to 5 here. It is possible that higher + * numbers will make the CPU emulation slightly faster, but if the setting + * is too high, you will run out of memory while compiling. + * Best to leave this as it is. + */ +#define CPU_EMU_SIZE 0 + +/* + * CPU level: 0 = 68000, 1 = 68010, 2 = sort of a 68020 + * If configured for 68020, the emulator will be a little slower. + * Don't touch this: Only 0 will work for now. + */ +#define CPU_LEVEL 0 +