Re: [AD] small bug in 15 and 16 bit asm color converters |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] small bug in 15 and 16 bit asm color converters
- From: Elias Pschernig <allefant@xxxxxxxxxx>
- Date: Sat, 23 Oct 2004 16:31:53 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=f4EVpdlwUy4aXRG0zxVtlH6gpkdY7p6B879l/b8fTySFAZtK8fzPArwUwXtFkoXxIRwDBOq9s1VzPciUrQTZ7bFuxp7qL3/LLI9QsiwqRW0TkhtrOM2spIdjapXviVqUDt2Cs1AD5uP/n2ExKQMeo7KsTrMc9hYbw1xdV8DOlh4=
> 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);