From fa4458d5050ab5b13ab30c9893fc3d5631340c34 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Sat, 5 Mar 2005 17:50:20 +0000 Subject: [PATCH] Check extended CPUID for MMX extensions on Athlon (pre XP) processors --- zsnes/src/ui.asm | 19 +++++++++++++++---- zsnes/src/uic.c | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/zsnes/src/ui.asm b/zsnes/src/ui.asm index 64c085ed..62b16d6e 100644 --- a/zsnes/src/ui.asm +++ b/zsnes/src/ui.asm @@ -25,10 +25,10 @@ EXTSYM ConvertJoyMap,ConvertJoyMap1,ConvertJoyMap2,printhex EXTSYM StartUp,PrintStr,WaitForKey,PrintChar,ZFileSystemInit EXTSYM SystemInit,allocmem EXTSYM cfgsoundon -EXTSYM xa,MMX2Support +EXTSYM xa EXTSYM ram7fa,wramdataa EXTSYM malloc,free -EXTSYM MMXSupport,ScreenScale,SoundQuality +EXTSYM MMXSupport,MMXextSupport,ScreenScale,SoundQuality EXTSYM debugger,pl1contrl,pl2contrl,romtype,smallscreence EXTSYM smallscreenon,spcon EXTSYM statefileloc,LatestSave,firstsaveinc @@ -1097,16 +1097,27 @@ NEWSYM MMXCheck ; MMX support mov byte[MMXSupport],0 - mov byte[MMX2Support],0 + mov byte[MMXextSupport],0 mov eax,1 CPUID test edx,1 << 23 jz .nommx mov byte[MMXSupport],1 + + ; Check if CPU has SSE (also support mmxext) test edx,1 << 25 + jz .tryextmmx + mov byte[MMXextSupport],1 + jmp .nommx + +.tryextmmx + ; Test extended CPU flag + mov eax,80000001h + CPUID + test edx,1 << 22 jz .nommx - mov byte[MMX2Support],1 + mov byte[MMXextSupport],1 .noprintstr .nommx ret diff --git a/zsnes/src/uic.c b/zsnes/src/uic.c index 90bbf626..a6c6af7f 100644 --- a/zsnes/src/uic.c +++ b/zsnes/src/uic.c @@ -139,7 +139,7 @@ unsigned char *spc7110romptr; unsigned char MusicRelVol = 75; unsigned char MusicVol = 0; -unsigned char MMX2Support = 0; +unsigned char MMXextSupport = 0; void outofmemory(); void init();