Remove the old cpuid gcc hack. Work on IsoFileFormats a bit more.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2231 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-11-21 16:44:46 +00:00
parent 0433a3872e
commit 27c493ec9d
2 changed files with 13 additions and 21 deletions

View File

@ -73,8 +73,6 @@ void cpudetectInit()
//AMD 64 STUFF
u32 x86_64_8BITBRANDID;
u32 x86_64_12BITBRANDID;
int num;
char str[50];
memzero( x86caps.VendorName );
x86caps.FamilyID = 0;
@ -91,11 +89,6 @@ void cpudetectInit()
((u32*)x86caps.VendorName)[ 1 ] = regs[ 3 ];
((u32*)x86caps.VendorName)[ 2 ] = regs[ 2 ];
// Hack - prevents reg[2] & reg[3] from being optimized out of existence! (GCC only)
// FIXME: We use a better __cpuid now with proper inline asm constraints. This hack is
// probably obsolete. Linux devs please re-confirm. --air
num = sprintf(str, "\tx86Flags = %8.8x %8.8x\n", regs[3], regs[2]);
u32 LogicalCoresPerPhysicalCPU = 0;
u32 PhysicalCoresPerPhysicalCPU = 1;

View File

@ -23,26 +23,26 @@
#include "IsoFileFormats.h"
static int detect(isoFile *iso)
static bool detect(isoFile *iso)
{
u8 buf[2448];
u8* pbuf;
if (!isoReadBlock(iso, buf, 16)) return -1;
if (!isoReadBlock(iso, buf, 16)) return false; // Not readable
pbuf = (( iso->flags & ISOFLAGS_BLOCKDUMP_V3 ) ? buf : (buf + 24));
if (strncmp((char*)(pbuf+1), "CD001", 5)) return 0;
if (strncmp((char*)(pbuf+1), "CD001", 5)) return false; // Not ISO 9660 compliant
if (*(u16*)(pbuf+166) == 2048)
iso->type = ISOTYPE_CD;
else
iso->type = ISOTYPE_DVD;
return 1;
return true; // We can deal with this.
}
static int _isoReadDtable(isoFile *iso)
static bool _isoReadDtable(isoFile *iso)
{
uint ret;
@ -54,10 +54,10 @@ static int _isoReadDtable(isoFile *iso)
{
_seekfile(iso->handle, 16 + (iso->blocksize + 4) * i, SEEK_SET);
ret = _readfile(iso->handle, &iso->dtable[i], 4);
if (ret < 4) return -1;
if (ret < 4) return false;
}
return 0;
return true;
}
static bool tryIsoType(isoFile *iso, u32 size, u32 offset, u32 blockofs)
@ -65,9 +65,8 @@ static bool tryIsoType(isoFile *iso, u32 size, u32 offset, u32 blockofs)
iso->blocksize = size;
iso->offset = offset;
iso->blockofs = blockofs;
if (detect(iso) == 1) return true;
return false;
return detect(iso);
}
// based on florin's CDVDbin detection code :)
@ -91,7 +90,7 @@ bool isoDetect(isoFile *iso)
_readfile(iso->handle, &iso->blocks, 4);
_readfile(iso->handle, &iso->blockofs, 4);
_isoReadDtable(iso);
return (detect(iso) == 1);
return (detect(iso));
}
else if (strncmp(buf, "BDV3", 4) == 0)
{
@ -100,7 +99,7 @@ bool isoDetect(isoFile *iso)
_readfile(iso->handle, &iso->blocks, 4);
_readfile(iso->handle, &iso->blockofs, 4);
_isoReadDtable(iso);
return (detect(iso) == 1);
return (detect(iso));
}
else
{
@ -257,7 +256,7 @@ bool isoSetFormat(isoFile *iso, uint blockofs, uint blocksize, uint blocks)
return true;
}
s32 MSFtoLSN(u8 *Time)
static s32 MSFtoLSN(u8 *Time)
{
u32 lsn;
@ -267,7 +266,7 @@ s32 MSFtoLSN(u8 *Time)
return lsn;
}
void LSNtoMSF(u8 *Time, s32 lsn)
static void LSNtoMSF(u8 *Time, s32 lsn)
{
u8 m, s, f;