Re: [AD] small bug in 15 and 16 bit asm color converters

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


> MMX is disabled in interrupt handlers because the FPU state is not saved
> across interrupts.  Of course this probably only makes sense for DOS.
> 
>       else {
>          /* bodge to avoid using non legacy 386 asm code inside a timer handler */
>          int old_capabilities = cpu_capabilities;
>          cpu_capabilities = 0;
> 
>          draw_mouse(TRUE, TRUE);
> 
>          cpu_capabilities = old_capabilities;
>       }
> 

Ah. Attached another patch, which fixes this problem. This one should
be applied in any case. About the asm color converters, I really can't
decide. On my monitor, the difference between 255/255/255 and
248/251/248 is a very big one, while 0/0/0 and 7/3/7 are the same
color. But is it enough to justify adding 0.5 instructions / pixel?
I'd tend to say yes.. does someone knows how long a POR instruction
takes? Maybe writing to [edi] in the next instructions takes so long
that you can neglect it anyway?
Index: src/mouse.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/mouse.c,v
retrieving revision 1.26
diff -u -p -r1.26 mouse.c
--- src/mouse.c	1 Oct 2004 14:07:56 -0000	1.26
+++ src/mouse.c	23 Oct 2004 14:24:28 -0000
@@ -329,13 +329,15 @@ static void mouse_move(void)
 	 }
       }
       else {
+#ifdef ALLEGRO_DOS
 	 /* bodge to avoid using non legacy 386 asm code inside a timer handler */
 	 int old_capabilities = cpu_capabilities;
 	 cpu_capabilities = 0;
-
+#endif
 	 draw_mouse(TRUE, TRUE);
-
+#ifdef ALLEGRO_DOS
 	 cpu_capabilities = old_capabilities;
+#endif
       }
 
       release_bitmap(_mouse_screen);


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