|
|
1.1 root 1: /*
2: * UAE - The Un*x Amiga Emulator
3: *
1.1.1.2 ! root 4: * Stuff
1.1 root 5: *
6: * Copyright 1995, 1996 Bernd Schmidt, Ed Hanway
7: */
8:
9: #define UAEMAJOR 0
10: #define UAEMINOR 6
1.1.1.2 ! root 11: #define UAEURSAMINOR 8
1.1 root 12:
1.1.1.2 ! root 13: typedef enum { KBD_LANG_US, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang;
1.1 root 14:
15: extern int version;
16: extern int framerate;
17: extern int produce_sound;
18: extern int correct_aspect;
19: extern int use_fast_draw;
20: extern int use_debugger;
21: extern int use_serial;
22: extern int illegal_mem;
23: extern int use_fast_mem;
24: extern int use_gfxlib;
25: extern int no_xhair;
26: extern int automount_uaedev;
27: extern int fake_joystick;
28: extern KbdLang keyboard_lang;
29: extern int color_mode;
30: extern int sound_desired_bits;
31: extern int sound_desired_freq;
32: extern int sound_desired_bsiz;
33: extern int allow_save;
34: extern int no_gui;
1.1.1.2 ! root 35: extern int test_drawing_speed;
! 36: extern int emul_accuracy;
1.1 root 37: extern long hardfile_size;
1.1.1.2 ! root 38: extern int gfx_requested_width, gfx_requested_height, gfx_requested_lores;
! 39: extern int gfx_requested_linedbl, gfx_requested_correct_aspect;
! 40: extern int gfx_requested_xcenter, gfx_requested_ycenter;
! 41: extern int blits_32bit_enabled, immediate_blits;
1.1 root 42:
43: /* AIX doesn't think it is Unix. Neither do I. */
44: #if defined(_ALL_SOURCE) || defined(_AIX)
45: #undef __unix
46: #define __unix
47: #endif
48:
49: extern char df0[], df1[], df2[], df3[], romfile[], prtname[], sername[];
50:
1.1.1.2 ! root 51: #define MAX_COLOR_MODES 5
1.1 root 52:
1.1.1.2 ! root 53: extern int fast_memcmp(const void *foo, const void *bar, int len);
! 54: extern int memcmpy(void *foo, const void *bar, int len);
1.1 root 55:
56: /* strdup() may be non-portable if you have a weird system */
57: static char *my_strdup(const char*s)
58: {
59: /* The casts to char * are there to shut up the compiler on HPUX */
60: char *x = (char*)malloc(strlen((char *)s) + 1);
61: strcpy(x, (char *)s);
62: return x;
63: }
64:
65: /*
66: * You can specify numbers from 0 to 5 here. It is possible that higher
67: * numbers will make the CPU emulation slightly faster, but if the setting
68: * is too high, you will run out of memory while compiling.
69: * Best to leave this as it is.
70: */
71: #define CPU_EMU_SIZE 0
72:
73: #ifdef DONT_WANT_SOUND
74: #undef LINUX_SOUND
75: #undef AF_SOUND
76: #undef SOLARIS_SOUND
77: #undef SGI_SOUND
78: #endif
79:
80: /* #define NEED_TO_DEBUG_BADLY */
81:
1.1.1.2 ! root 82: #undef USE_EXECLIB
! 83:
! 84: #if !defined(USER_PROGRAMS_BEHAVE)
! 85: #define USER_PROGRAMS_BEHAVE 0
! 86: #endif
! 87:
! 88: #define QUADRUPLIFY(c) (((c) | ((c) << 8)) | (((c) | ((c) << 8)) << 16))
! 89:
! 90: /* When you call this routine, bear in mind that it rounds the bounds and
! 91: * may need some padding for the array. */
! 92:
! 93: #define fuzzy_memset(p, c, o, l) fuzzy_memset_1 ((p), QUADRUPLIFY (c), (o) & ~3, ((l) + 4) >> 2)
! 94: static __inline__ void fuzzy_memset_1 (void *p, ULONG c, int offset, int len)
! 95: {
! 96: ULONG *p2 = (ULONG *)((char *)p + offset);
! 97: int a = len & 7;
! 98: len >>= 3;
! 99: switch (a) {
! 100: case 7: p2--; goto l1;
! 101: case 6: p2-=2; goto l2;
! 102: case 5: p2-=3; goto l3;
! 103: case 4: p2-=4; goto l4;
! 104: case 3: p2-=5; goto l5;
! 105: case 2: p2-=6; goto l6;
! 106: case 1: p2-=7; goto l7;
! 107: case 0: goto l8;
! 108: }
! 109:
! 110: for (;;) {
! 111: p2[0] = c;
! 112: l1:
! 113: p2[1] = c;
! 114: l2:
! 115: p2[2] = c;
! 116: l3:
! 117: p2[3] = c;
! 118: l4:
! 119: p2[4] = c;
! 120: l5:
! 121: p2[5] = c;
! 122: l6:
! 123: p2[6] = c;
! 124: l7:
! 125: p2[7] = c;
! 126: l8:
! 127: if (!len)
! 128: break;
! 129: len--;
! 130: p2 += 8;
! 131: }
! 132: }
! 133:
! 134: #define fuzzy_memset_le32(p, c, o, l) fuzzy_memset_le32_1 ((p), QUADRUPLIFY (c), (o) & ~3, ((l) + 4) >> 2)
! 135: static __inline__ void fuzzy_memset_le32_1 (void *p, ULONG c, int offset, int len)
! 136: {
! 137: ULONG *p2 = (ULONG *)((char *)p + offset);
! 138:
! 139: switch (len) {
! 140: case 9: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; p2[5] = c; p2[6] = c; p2[7] = c; p2[8] = c; break;
! 141: case 8: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; p2[5] = c; p2[6] = c; p2[7] = c; break;
! 142: case 7: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; p2[5] = c; p2[6] = c; break;
! 143: case 6: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; p2[5] = c; break;
! 144: case 5: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; p2[4] = c; break;
! 145: case 4: p2[0] = c; p2[1] = c; p2[2] = c; p2[3] = c; break;
! 146: case 3: p2[0] = c; p2[1] = c; p2[2] = c; break;
! 147: case 2: p2[0] = c; p2[1] = c; break;
! 148: case 1: p2[0] = c; break;
! 149: case 0: break;
! 150: default: printf("Hit the programmer.\n"); break;
! 151: }
! 152: }
! 153:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.