From 45bb6f3d2fc3ff009aa0c80483ae26c1977cd276 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Fri, 1 May 2009 12:44:18 +0000 Subject: [PATCH] Bugfix for recent cleanups: SetResultSize was defined with different behaviors in two separate files, without being static. Depending on the whims of the wind, MSVC would sometimes pick the one from CDROM and link it into CDVD, overriding CDVD's version, and resulting in complete emulation failure. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1103 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/CDVD.cpp | 4 ++-- pcsx2/CdRom.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pcsx2/CDVD.cpp b/pcsx2/CDVD.cpp index 1894559b09..79e6a4b30f 100644 --- a/pcsx2/CDVD.cpp +++ b/pcsx2/CDVD.cpp @@ -26,7 +26,7 @@ static cdvdStruct cdvd; -__forceinline void SetResultSize(u8 size) +static __forceinline void SetResultSize(u8 size) { cdvd.ResultC = size; cdvd.ResultP = 0; @@ -442,7 +442,7 @@ s32 cdvdGetTrayStatus() // cdvdNewDiskCB() can update it's status as well... // Modified by (efp) - 16/01/2006 -__forceinline void cdvdGetDiskType() +static __forceinline void cdvdGetDiskType() { // defs 0.9.0 if (CDVDnewDiskCB || (cdvd.Type != CDVD_TYPE_NODISC)) return; diff --git a/pcsx2/CdRom.cpp b/pcsx2/CdRom.cpp index e9b4e6eb00..bb2f022b7a 100644 --- a/pcsx2/CdRom.cpp +++ b/pcsx2/CdRom.cpp @@ -112,13 +112,13 @@ static __forceinline void StopCdda() { } } -__forceinline void SetResultSize(u8 size) { +static __forceinline void SetResultSize(u8 size) { cdr.ResultP = 0; cdr.ResultC = size; cdr.ResultReady = 1; } -__forceinline s32 MSFtoLSN(u8 *Time) { +static __forceinline s32 MSFtoLSN(u8 *Time) { u32 lsn; lsn = Time[2]; @@ -127,7 +127,7 @@ __forceinline s32 MSFtoLSN(u8 *Time) { return lsn; } -void LSNtoMSF(u8 *Time, s32 lsn) { +static __forceinline void LSNtoMSF(u8 *Time, s32 lsn) { lsn += 150; Time[2] = lsn / 4500; // minuten lsn = lsn - Time[2] * 4500; // minuten rest @@ -135,7 +135,7 @@ void LSNtoMSF(u8 *Time, s32 lsn) { Time[0] = lsn - Time[1] * 75; // sekunden rest } -void ReadTrack() { +static void ReadTrack() { cdr.Prev[0] = itob(cdr.SetSector[0]); cdr.Prev[1] = itob(cdr.SetSector[1]); cdr.Prev[2] = itob(cdr.SetSector[2]); @@ -152,7 +152,7 @@ void ReadTrack() { #define DataEnd 4 #define DiskError 5 -void AddIrqQueue(u8 irq, unsigned long ecycle) { +static void AddIrqQueue(u8 irq, unsigned long ecycle) { cdr.Irq = irq; if (cdr.Stat) { cdr.eCycle = ecycle;