Check extended CPUID for MMX extensions on Athlon (pre XP) processors

This commit is contained in:
pagefault
2005-03-05 17:50:20 +00:00
parent 84c21991c0
commit fa4458d505
2 changed files with 16 additions and 5 deletions

View File

@@ -25,10 +25,10 @@ EXTSYM ConvertJoyMap,ConvertJoyMap1,ConvertJoyMap2,printhex
EXTSYM StartUp,PrintStr,WaitForKey,PrintChar,ZFileSystemInit EXTSYM StartUp,PrintStr,WaitForKey,PrintChar,ZFileSystemInit
EXTSYM SystemInit,allocmem EXTSYM SystemInit,allocmem
EXTSYM cfgsoundon EXTSYM cfgsoundon
EXTSYM xa,MMX2Support EXTSYM xa
EXTSYM ram7fa,wramdataa EXTSYM ram7fa,wramdataa
EXTSYM malloc,free EXTSYM malloc,free
EXTSYM MMXSupport,ScreenScale,SoundQuality EXTSYM MMXSupport,MMXextSupport,ScreenScale,SoundQuality
EXTSYM debugger,pl1contrl,pl2contrl,romtype,smallscreence EXTSYM debugger,pl1contrl,pl2contrl,romtype,smallscreence
EXTSYM smallscreenon,spcon EXTSYM smallscreenon,spcon
EXTSYM statefileloc,LatestSave,firstsaveinc EXTSYM statefileloc,LatestSave,firstsaveinc
@@ -1097,16 +1097,27 @@ NEWSYM MMXCheck
; MMX support ; MMX support
mov byte[MMXSupport],0 mov byte[MMXSupport],0
mov byte[MMX2Support],0 mov byte[MMXextSupport],0
mov eax,1 mov eax,1
CPUID CPUID
test edx,1 << 23 test edx,1 << 23
jz .nommx jz .nommx
mov byte[MMXSupport],1 mov byte[MMXSupport],1
; Check if CPU has SSE (also support mmxext)
test edx,1 << 25 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 jz .nommx
mov byte[MMX2Support],1 mov byte[MMXextSupport],1
.noprintstr .noprintstr
.nommx .nommx
ret ret

View File

@@ -139,7 +139,7 @@ unsigned char *spc7110romptr;
unsigned char MusicRelVol = 75; unsigned char MusicRelVol = 75;
unsigned char MusicVol = 0; unsigned char MusicVol = 0;
unsigned char MMX2Support = 0; unsigned char MMXextSupport = 0;
void outofmemory(); void outofmemory();
void init(); void init();