[AD] Re: OSX x86 patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Saturday 08 April 2006 13:05, Miguel A. Gavidia wrote:
Ok after much discussion on #allegro and trying to get allegro to build with 
ASM vice C it looks like it's not going to be possible without extensive 
changes to the makefile.
However I did fix the C only version and attached the patch that does so.
I ran several tests and they seem to work without a hitch. 
:)
> Ugh disregard that patch I just ran into an issue. I guess there still
> needs to be stuff resolved with ALLEGRO_USE_C and ALLEGRO_NO_ASM. :(
> Also I noticed that #define ALLEGRO_I386 was added to alosxcfg.h which
> still makes the lib include the asm routines.
> Even after removing the line the lib still includes the asm routines..
> *sigh
> I'll have to comb through it some more and see if I can trace the issues
> down.
>
> On Saturday 08 April 2006 11:50, Miguel A. Gavidia wrote:
> > I went through and added some changes to get allegro to build on OSX x86,
> > which after the changes compiles and installs soundly.
> > I also reviewed the thread concerning ALLEGRO_USE_C and took into
> > consideration that if ALLEGRO_USE_C is explicitly declared the assumption
> > is that no ASM is desired. With the OSX build of allegro that it is
> > statically set so there should be no qualms regarding usage of ASM.
> > The patch otherwise shouldn't effect the usage of ASM if ALLEGRO_USE_C is
> > never set on other platforms.
> > Look over the patch and see if it is feasible.
> > Thanks. :)

-- 
-juvinious

<a href="http://chasm.hopto.org";>The Chasm</a> - My Site.
Index: src/macosx/qtmidi.m
===================================================================
--- src/macosx/qtmidi.m	(revision 5771)
+++ src/macosx/qtmidi.m	(working copy)
@@ -125,9 +125,14 @@
       voice[i].vol = -1;
       voice[i].pan = -1;
       memset(&note_request, 0, sizeof(note_request));
+	  #ifndef __i386
       note_request.info.polyphony = 8;
       note_request.info.typicalPolyphony = 0x00010000;
-      result = NAStuffToneDescription(note_allocator, 1, &note_request.tone);
+	  #else
+	  note_request.info.polyphony.bigEndianValue = EndianU16_NtoB(8);
+      note_request.info.typicalPolyphony.bigEndianValue = EndianS32_NtoB(X2Fix(1.0));
+	  #endif
+	  result = NAStuffToneDescription(note_allocator, 1, &note_request.tone);
       result |= NANewNoteChannel(note_allocator, &note_request, &voice[i].channel);
       result |= NAResetNoteChannel(note_allocator, voice[i].channel);
       if ((result) || (!voice[i].channel)) {
Index: include/allegro/platform/alosxcfg.h
===================================================================
--- include/allegro/platform/alosxcfg.h	(revision 5771)
+++ include/allegro/platform/alosxcfg.h	(working copy)
@@ -53,10 +53,6 @@
    #define ALLEGRO_BIG_ENDIAN
 #endif
 
-#ifdef __i386__
-   #define ALLEGRO_I386
-#endif
-
 /* Arrange for other headers to be included later on */
 #define ALLEGRO_EXTRA_HEADER     "allegro/platform/alosx.h"
 
Index: include/allegro/internal/alconfig.h
===================================================================
--- include/allegro/internal/alconfig.h	(revision 5771)
+++ include/allegro/internal/alconfig.h	(working copy)
@@ -112,8 +112,10 @@
    #endif
 
    #ifdef __i386__
-      #define ALLEGRO_I386
-      #define _AL_SINCOS(x, s, c)  __asm__ ("fsincos" : "=t" (c), "=u" (s) : "0" (x))
+	  #ifndef ALLEGRO_MACOSX
+		 #define ALLEGRO_I386
+		 #define _AL_SINCOS(x, s, c)  __asm__ ("fsincos" : "=t" (c), "=u" (s) : "0" (x))
+	  #endif
    #endif
 
    #ifdef __amd64__
Index: include/allegro/inline/asm.inl
===================================================================
--- include/allegro/inline/asm.inl	(revision 5771)
+++ include/allegro/inline/asm.inl	(working copy)
@@ -19,7 +19,13 @@
    extern "C" {
 #endif
 
+#ifdef ALLEGRO_USE_C
 
+	/* No asm needed */
+	#define ALLEGRO_NO_ASM
+
+#else
+
 #ifndef ALLEGRO_NO_ASM
 
 #if (defined ALLEGRO_GCC) && (defined ALLEGRO_I386)
@@ -46,8 +52,8 @@
 
 #endif
 
+#endif
 
 #ifdef __cplusplus
    }
 #endif
-


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/