1 --- GlideV2/glide2x/cvg/init/sst1init.h.orig 2013-09-21 07:41:42.484397830 +0200
2 +++ GlideV2/glide2x/cvg/init/sst1init.h 2013-09-21 07:46:29.837739823 +0200
4 #elif defined (__GNUC__) && defined(__i386__)
5 # define P6FENCE asm("xchg %%eax,%0" : /*outputs*/ : "m" (p6FenceVar) : \
7 +#elif defined(__ia64__)
8 +#define P6FENCE asm volatile ("mf.a" ::: "memory");
9 +#elif defined(__alpha__)
10 +# define P6FENCE asm volatile("mb" ::: "memory");
11 +#elif defined(__powerpc__)
12 +# define P6FENCE asm volatile ("sync" ::: "memory");
13 +#elif defined (__x86_64__)
14 +# define P6FENCE asm volatile("mfence" ::: "memory");
15 +#elif defined(__sparc64__)
16 +# define P6FENCE asm volatile("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" ::: "memory");
17 +#elif defined(__sparc__)
18 +# define P6FENCE asm volatile("" ::: "memory");
20 --- GlideV2/glide2x/cvg/glide/src/cpudetect.c.orig 2000-04-20 23:26:36.000000000 +0200
21 +++ GlideV2/glide2x/cvg/glide/src/cpudetect.c 2013-09-21 08:28:32.804847399 +0200
25 void single_precision_asm() {
26 +#if defined(__x86_64__)
27 + asm("push %rax \n fnclex \n fstcw (%rsp) \n movl (%rsp), %eax \n "
28 + "and $0x0000fcff, %eax \n movl %eax, (%rsp) \n fldcw (%rsp) \n pop %rax");
29 +#elif defined(__i386__)
30 asm("push %eax \n fnclex \n fstcw (%esp) \n movl (%esp), %eax \n "
31 "and $0x0000fcff, %eax \n movl %eax, (%esp) \n fldcw (%esp) \n pop %eax");
36 void double_precision_asm() {
37 - asm("push %eax \n fnclex \n fstcw (%esp) \n movw (%esp), %eax \n "
38 +#if defined(__x86_64__)
39 + asm("push %rax \n fnclex \n fstcw (%rsp) \n movl (%rsp), %eax \n "
40 + "and $0x0000fcff, %eax \n or $0x000002ff, %eax \n mov %eax, (%rsp) \n "
41 + "fldcw (%rsp) \n pop %rax");
42 +#elif defined(__i386__)
43 + asm("push %eax \n fnclex \n fstcw (%esp) \n movl (%esp), %eax \n "
44 "and $0x0000fcff, %eax \n or $0x000002ff, %eax \n mov %eax, (%esp) \n "
45 "fldcw (%esp) \n pop %eax");
49 --- GlideV2/glide2x/cvg/init/makefile.linux.orig 2000-04-20 23:26:36.000000000 +0200
50 +++ GlideV2/glide2x/cvg/init/makefile.linux 2013-09-21 10:33:25.196185785 +0200
52 # for some strange reason
55 -CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS)
56 +CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) -fPIC
58 --- GlideV2/glide3x/cvg/init/sst1init.h.orig 2013-09-21 07:41:42.484397830 +0200
59 +++ GlideV2/glide3x/cvg/init/sst1init.h 2013-09-21 07:46:29.837739823 +0200
61 #elif defined (__GNUC__) && defined(__i386__)
62 # define P6FENCE asm("xchg %%eax,%0" : /*outputs*/ : "m" (p6FenceVar) : \
64 +#elif defined(__ia64__)
65 +#define P6FENCE asm volatile ("mf.a" ::: "memory");
66 +#elif defined(__alpha__)
67 +# define P6FENCE asm volatile("mb" ::: "memory");
68 +#elif defined(__powerpc__)
69 +# define P6FENCE asm volatile ("sync" ::: "memory");
70 +#elif defined (__x86_64__)
71 +# define P6FENCE asm volatile("mfence" ::: "memory");
72 +#elif defined(__sparc64__)
73 +# define P6FENCE asm volatile("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" ::: "memory");
74 +#elif defined(__sparc__)
75 +# define P6FENCE asm volatile("" ::: "memory");
77 --- GlideV2/glide3x/cvg/glide3/src/makefile.linux.orig 2000-04-20 23:26:39.000000000 +0200
78 +++ GlideV2/glide3x/cvg/glide3/src/makefile.linux 2013-09-21 14:30:15.403246286 +0200
83 -ASMTRISETUP = xdraw2.S xdraw3.S
84 +ASMTRISETUP = xdraw2.S xdraw3.S cpudtect.S
85 DSPOPTS += -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1
89 LAINCS = -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
90 LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
92 -AFILES = $(ASMTRISETUP) cpudtect.S
93 +AFILES = $(ASMTRISETUP)
96 HEADERS = glide.h glidesys.h glideutl.h
97 --- GlideV2/glide3x/cvg/init/makefile.linux.orig 2000-04-20 23:26:36.000000000 +0200
98 +++ GlideV2/glide3x/cvg/init/makefile.linux 2013-09-21 10:33:25.196185785 +0200
100 # for some strange reason
103 -CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS)
104 +CFLAGS = -g $(GCFLAGS) $(LCFLAGS) $(VCFLAGS) -fPIC
106 --- GlideV2/glide3x/cvg/glide3/src/gdraw.c.orig 2013-09-22 19:48:44.822836076 +0200
107 +++ GlideV2/glide3x/cvg/glide3/src/gdraw.c 2013-09-23 19:53:38.014765302 +0200
109 vlist[0] = (float *)a;
110 vlist[1] = (float *)b;
111 vlist[2] = (float *)c;
112 - _grDrawTriangles(GR_VTX_PTR_ARRAY, 3, vlist);
113 + _grDrawTriangles_Default(GR_VTX_PTR_ARRAY, 3, vlist);
116 ** draw a simple triangle
117 --- GlideV2/glide3x/cvg/glide3/src/gpci.c.orig 2000-04-20 23:26:39.000000000 +0200
118 +++ GlideV2/glide3x/cvg/glide3/src/gpci.c 2013-09-23 20:33:53.300359679 +0200
120 /* Collection of all of the known procs for a given system */
121 static GrTriSetupProc _triSetupProcs[][2][2] =
123 +#ifdef GLIDE_USE_C_TRISETUP
126 + { NULL, _vptrisetup_cull }
130 + { NULL, _vptrisetup_cull }
135 { _trisetup_Default_Default, _trisetup_Default_cull }, /* GR_WINDOW_COORDS */
136 @@ -233,10 +243,20 @@
137 { _trisetup_clip_coor_thunk, _trisetup_clip_coor_thunk }, /* GR_CLIP_COORDS */
139 #endif /* GL_AMD3D */
143 +#ifdef GLIDE_USE_C_TRISETUP
145 +_grDrawVertexList(FxU32 pktype, FxU32 type, FxI32 mode, FxI32 count, void *pointers);
148 static GrVertexListProc _vertexListProcs[][2] = {
149 +#ifdef GLIDE_USE_C_TRISETUP
150 + { _grDrawVertexList, _grDrawVertexList },
152 { _drawvertexlist, _vpdrawvertexlist },
155 { _grDrawVertexList_3DNow_Window, _grDrawVertexList_3DNow_Clip }
156 #endif /* GL_AMD3D */
159 /* Setup the basic proc tables based on the cpu type. */
161 - _GlideRoot.CPUType = _cpu_detect_asm();
162 + _GlideRoot.CPUType =
168 if (GETENV("FX_CPU")) _GlideRoot.CPUType = atoi(GETENV("FX_CPU"));