[AD] Two patches for test.c

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


Attached are two patches for the test programme. The first for reporting 
the new CPU capabilities added by AJ, the second for reporting if the 
system has a hardware mouse cursor.

There's a problem with the CPU capabilities though. The detection for AMD64 
and IA64 depends on the CPUID instruction. However, on AMD64 Allegro is 
compiled without inline assembler code (at least in Linux), so the CPUID 
instruction is never used and the processor type is in fact unknown. I 
don't see an easy way around this at the moment. Any suggestions?
With hindsight, I also think the cpu_capabilities flag is probably 
inappropriate for this task and it would have been better to somehow use 
the cpu_family and cpu_model variables. Thoughts?

Evert
Index: tests/test.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tests/test.c,v
retrieving revision 1.32
diff -u -r1.32 test.c
--- tests/test.c	24 Oct 2004 11:49:10 -0000	1.32
+++ tests/test.c	6 Mar 2005 19:06:02 -0000
@@ -4461,6 +4461,9 @@
       if (cpu_capabilities & CPU_SSE2)
 	 strcat(cpu_specs, " / SSE2");
 	 
+      if (cpu_capabilities & CPU_SSE3)
+	 strcat(cpu_specs, " / SSE3");
+	 
       if (cpu_capabilities & CPU_MMX)
 	 strcat(cpu_specs, " / MMX");
 
@@ -4477,6 +4480,12 @@
 
       strcpy(cpu_specs, "Non-x86 CPU (very cool)");
 
+      if (cpu_capabilities & CPU_AMD64)
+	 strcat(cpu_specs, " / AMD64");
+
+      if (cpu_capabilities & CPU_IA64)
+	 strcat(cpu_specs, " / IA64");
+
    #endif
 
    cpu_has_capabilities = cpu_capabilities;
Index: tests/test.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tests/test.c,v
retrieving revision 1.32
diff -u -r1.32 test.c
--- tests/test.c	24 Oct 2004 11:49:10 -0000	1.32
+++ tests/test.c	6 Mar 2005 17:50:56 -0000
@@ -4440,6 +4440,7 @@
    mypal[255].r = mypal[255].g = mypal[255].b = 0;
 
    buttons = install_mouse();
+   enable_hardware_cursor();
    sprintf(mouse_specs, "Mouse has %d buttons", buttons);
 
    #ifdef ALLEGRO_I386


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