many warning fixes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@422 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2008-09-01 12:11:08 +00:00
parent cad45aea72
commit 4bbfff3cac
29 changed files with 100 additions and 112 deletions

View File

@ -13,6 +13,7 @@ warnings = [
'pointer-arith',
'packed',
'no-conversion',
# 'error',
#'unreachable-code',
]
compileFlags = [

View File

@ -80,5 +80,6 @@ bool File::CreateDir(const std::string &path)
return false;
#else
// TODO: Insert POSIX code here.
return true;
#endif
}

View File

@ -158,7 +158,7 @@ void CMappedFile::Close()
}
u8* CMappedFile::Lock(u64 offset, u64 size)
u8* CMappedFile::Lock(u64 offset, u64 _size)
{
#ifdef _WIN32
if (hFile != INVALID_HANDLE_VALUE)
@ -168,9 +168,9 @@ u8* CMappedFile::Lock(u64 offset, u64 size)
{
u64 realOffset = offset & ~(granularity - 1);
s64 difference = offset - realOffset;
u64 fake_size = (difference + size + granularity - 1) & ~(granularity - 1);
u64 fake_size = (difference + _size + granularity - 1) & ~(granularity - 1);
#ifdef _WIN32
u8* realPtr = (u8*)MapViewOfFile(hFileMapping, FILE_MAP_READ, (DWORD)(realOffset >> 32), (DWORD)realOffset, (SIZE_T)(size));
u8* realPtr = (u8*)MapViewOfFile(hFileMapping, FILE_MAP_READ, (DWORD)(realOffset >> 32), (DWORD)realOffset, (SIZE_T)(_size));
if (realPtr == NULL)
{
@ -192,7 +192,7 @@ u8* CMappedFile::Lock(u64 offset, u64 size)
//add to map
lockMap[fakePtr] = realPtr;
#ifndef _WIN32
sizeMap[fakePtr] = size + difference;
sizeMap[fakePtr] = _size + difference;
#endif
return(fakePtr);
}

View File

@ -309,7 +309,7 @@ THREAD_RETURN EmuThread(void *pArg)
g_pUpdateFPSDisplay("Loading...");
// setup our core, but can't use dynarec if we are compare server
if (_CoreParameter.bUseJIT && !_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient)
if (_CoreParameter.bUseJIT && (!_CoreParameter.bRunCompareServer || _CoreParameter.bRunCompareClient))
PowerPC::SetMode(PowerPC::MODE_JIT);
else
PowerPC::SetMode(PowerPC::MODE_INTERPRETER);

View File

@ -367,7 +367,7 @@ std::string GetScheduledEventsSummary()
text.reserve(1000);
while (ptr)
{
int t = ptr->type;
unsigned int t = ptr->type;
if (t < 0 || t >= event_types.size())
PanicAlert("Invalid event type %i", t);
const char *name = event_types[ptr->type].name;

View File

@ -39,11 +39,11 @@ void CEXIMemoryCard::FlushCallback(u64 userdata, int cyclesLate)
ptr->Flush();
}
CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rFilename, int card_index) :
CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rFilename, int _card_index) :
m_strFilename(_rFilename)
{
this->card_index = card_index;
cards[card_index] = this;
this->card_index = _card_index;
cards[_card_index] = this;
et_this_card = CoreTiming::RegisterEvent(_rName.c_str(), FlushCallback);
nintendo_card_id = 0x00000010; // 16MBit nintendo card

View File

@ -209,7 +209,7 @@ void ExecuteCommand(u32 _Address)
// HLE - Create a new HLE device
std::string DeviceName;
Memory::GetString(DeviceName, Memory::Read_U32(_Address + 0xC));
u32 Mode = Memory::Read_U32(_Address+0x10);
// u32 Mode = Memory::Read_U32(_Address+0x10);
u32 DeviceID = GetDeviceIDByName(DeviceName);
if (DeviceID == 0)
@ -227,7 +227,7 @@ void ExecuteCommand(u32 _Address)
}
else
{
IWII_IPC_HLE_Device* pDevice = AccessDeviceByID(DeviceID);
// IWII_IPC_HLE_Device* pDevice = AccessDeviceByID(DeviceID);
// we have already opened this device
Memory::Write_U32(-6, _Address + 4);

View File

@ -129,8 +129,8 @@ protected:
for (u32 i=0; i<NumberOutBuffer; i++)
{
u32 OutBuffer = Memory::Read_U32(BufferOffset); BufferOffset += 4;
u32 OutBufferSize = Memory::Read_U32(BufferOffset); BufferOffset += 4;
// u32 OutBuffer = Memory::Read_U32(BufferOffset); BufferOffset += 4;
// u32 OutBufferSize = Memory::Read_U32(BufferOffset); BufferOffset += 4;
Memory::Write_U32(1, _CommandAddress + 0x4);

View File

@ -135,15 +135,16 @@ CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress)
u32 Parameter = Memory::Read_U32(_CommandAddress + 0xC);
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
// u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
// u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
// u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
// u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
switch(Parameter)
{
case ISFS_IOCTL_GETFILESTATS:
{
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
LOG(WII_IPC_HLE, "FileIO: ISFS_IOCTL_GETFILESTATS");
LOG(WII_IPC_HLE, "Length: %i Seek: %i", m_FileLength, m_Seek);

View File

@ -57,11 +57,11 @@ public:
virtual bool IOCtl(u32 _CommandAddress)
{
u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C);
u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10);
u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14);
u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C);
// u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10);
// u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14);
// u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
// u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// write return value
Memory::Write_U32(0, _CommandAddress + 0x4);

View File

@ -57,10 +57,10 @@ public:
virtual bool IOCtl(u32 _CommandAddress)
{
u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C);
u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10);
u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14);
u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10);
// u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14);
// u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
// u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// write return value
Memory::Write_U32(1, _CommandAddress + 0x4);
@ -121,8 +121,8 @@ public:
u32 Parameter = Memory::Read_U32(_CommandAddress +0x0C);
u32 Buffer1 = Memory::Read_U32(_CommandAddress +0x10);
u32 BufferSize1 = Memory::Read_U32(_CommandAddress +0x14);
u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// u32 Buffer2 = Memory::Read_U32(_CommandAddress +0x18);
// u32 BufferSize2 = Memory::Read_U32(_CommandAddress +0x1C);
// write return value
switch (Parameter)

View File

@ -76,7 +76,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::IOCtlV(u32 _CommandAddress)
CtrlSetup.wValue = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[2].m_Address);
CtrlSetup.wIndex = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[3].m_Address);
CtrlSetup.wLength = *(u16*)Memory::GetPointer(CommandBuffer.InBuffer[4].m_Address);
u8 Termination =*(u8*)Memory::GetPointer(CommandBuffer.InBuffer[5].m_Address);
// u8 Termination =*(u8*)Memory::GetPointer(CommandBuffer.InBuffer[5].m_Address);
CtrlSetup.m_PayLoadAddr = CommandBuffer.PayloadBuffer[0].m_Address;
CtrlSetup.m_PayLoadSize = CommandBuffer.PayloadBuffer[0].m_Size;
@ -714,8 +714,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::ExecuteHCICommandMessage(const SHCICom
//
default:
{
u16 ocf = HCI_OCF(pMsg->Opcode);
u16 ogf = HCI_OGF(pMsg->Opcode);
// u16 ocf = HCI_OCF(pMsg->Opcode);
// u16 ogf = HCI_OGF(pMsg->Opcode);
_dbg_assert_msg_(USB_HLE_LOG, 0, "Unknown USB_IOCTL_CTRLMSG: 0x%04X (ocf: 0x%x ogf 0x%x)", pMsg->Opcode, ocf, ogf);
@ -821,9 +821,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadLocalFeatures(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadStoredLinkKey(u8* _Input)
{
// command parameters
hci_read_stored_link_key_cp* ReadStoredLinkKey = (hci_read_stored_link_key_cp*)_Input;
// reply
hci_read_stored_link_key_rp Reply;
Reply.status = 0x00;
@ -920,9 +917,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandHostBufferSize(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageTimeOut(u8* _Input)
{
// command parameters
hci_write_page_timeout_cp* pWritePageTimeOut = (hci_write_page_timeout_cp*)_Input;
// reply
hci_host_buffer_size_rp Reply;
Reply.status = 0x00;
@ -946,6 +940,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input)
SendEventCommandComplete(HCI_CMD_WRITE_SCAN_ENABLE, &Reply, sizeof(hci_write_scan_enable_rp));
/*
static char Scanning[][128] =
{
{ "HCI_NO_SCAN_ENABLE"},
@ -953,7 +948,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input)
{ "HCI_PAGE_SCAN_ENABLE"},
{ "HCI_INQUIRY_AND_PAGE_SCAN_ENABLE"},
};
*/
LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_SCAN_ENABLE:");
LOG(USB_HLE_LOG, "write:");
LOG(USB_HLE_LOG, " scan_enable: %s", Scanning[pWriteScanEnable->scan_enable]);
@ -961,22 +956,20 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input)
{
// command parameters
hci_write_inquiry_mode_cp* pInquiryMode = (hci_write_inquiry_mode_cp*)_Input;
// reply
hci_write_inquiry_mode_rp Reply;
Reply.status = 0x00;
SendEventCommandComplete(HCI_CMD_WRITE_INQUIRY_MODE, &Reply, sizeof(hci_write_inquiry_mode_rp));
/*
static char InquiryMode[][128] =
{
{ "Standard Inquiry Result event format (default)" },
{ "Inquiry Result format with RSSI" },
{ "Inquiry Result with RSSI format or Extended Inquiry Result format" }
};
*/
LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_INQUIRY_MODE:");
LOG(USB_HLE_LOG, "write:");
LOG(USB_HLE_LOG, " mode: %s", InquiryMode[pInquiryMode->mode]);
@ -984,20 +977,19 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageScanType(u8* _Input)
{
// command parameters
hci_write_page_scan_type_cp* pWritePageScanType = (hci_write_page_scan_type_cp*)_Input;
// reply
hci_write_page_scan_type_rp Reply;
Reply.status = 0x00;
SendEventCommandComplete(HCI_CMD_WRITE_PAGE_SCAN_TYPE, &Reply, sizeof(hci_write_page_scan_type_rp));
/*
static char PageScanType[][128] =
{
{ "Mandatory: Standard Scan (default)" },
{ "Optional: Interlaced Scan" }
};
*/
LOG(USB_HLE_LOG, "Command: HCI_CMD_WRITE_PAGE_SCAN_TYPE:");
LOG(USB_HLE_LOG, "write:");
@ -1030,8 +1022,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input)
u8 lap[HCI_LAP_SIZE];
memcpy(lap, pInquiry->lap, HCI_LAP_SIZE);
u8 inquiry_length = pInquiry->inquiry_length;
u8 num_responses = pInquiry->num_responses;
_dbg_assert_msg_(USB_HLE_LOG, m_State == STATE_NONE, "m_State != NONE");
m_State = STATE_INQUIRY_RESPONSE;
@ -1048,9 +1038,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryScanType(u8* _Input)
{
// command parameters
hci_write_inquiry_scan_type_cp* pSetEventFilter = (hci_write_inquiry_scan_type_cp*)_Input;
// reply
hci_write_inquiry_scan_type_rp Reply;
Reply.status = 0x00;
@ -1157,9 +1144,6 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandCreateCon(u8* _Input)
void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandAcceptCon(u8* _Input)
{
// command parameters
hci_accept_con_cp* pAcceptCon = (hci_accept_con_cp*)_Input;
LOG(USB_HLE_LOG, "Command: HCI_CMD_ACCEPT_CON");
LOG(USB_HLE_LOG, "Input:");
LOG(USB_HLE_LOG, " bd: %02x:%02x:%02x:%02x:%02x:%02x",

View File

@ -96,7 +96,7 @@ void UpdateFPRF(double value)
return;
}
u64 mantissa = ivalue & 0x000FFFFFFFFFFFFFULL;
int mantissa_top = (int)(mantissa >> 51);
// int mantissa_top = (int)(mantissa >> 51);
if (exp == 0 && mantissa) {
// Denormalized number.
if (sign) {
@ -192,8 +192,8 @@ void fctiwx(UGeckoInstruction _inst)
else
{
value = (u32)(s32)_mm_cvtsd_si32(_mm_set_sd(b)); // obey current rounding mode
double d_value = (double)value;
bool inexact = (d_value != b);
// double d_value = (double)value;
// bool inexact = (d_value != b);
// FPSCR.FI = inexact ? 1 : 0;
// FPSCR.XX |= FPSCR.FI;
// FPSCR.FR = fabs(d_value) > fabs(b);
@ -231,8 +231,8 @@ void fctiwzx(UGeckoInstruction _inst)
else
{
value = (u32)(s32)_mm_cvttsd_si32(_mm_set_sd(b)); // truncate
double d_value = (double)value;
bool inexact = (d_value != b);
// double d_value = (double)value;
// bool inexact = (d_value != b);
// FPSCR.FI = inexact ? 1 : 0;
// FPSCR.XX |= FPSCR.FI;
// FPSCR.FR = 1; //fabs(d_value) > fabs(b);

View File

@ -234,9 +234,10 @@ void cmp(UGeckoInstruction _inst)
{
s32 a = (s32)m_GPR[_inst.RA];
s32 b = (s32)m_GPR[_inst.RB];
int fTemp;
if (a < b) fTemp = 0x8;
else if (a > b) fTemp = 0x4;
int fTemp = 0x8; // a < b
// if (a < b) fTemp = 0x8; else
if (a > b) fTemp = 0x4;
else if (a == b) fTemp = 0x2;
if (XER.SO) PanicAlert("cmp getting overflow flag"); // fTemp |= 0x1
SetCRField(_inst.CRFD, fTemp);
@ -246,9 +247,10 @@ void cmpl(UGeckoInstruction _inst)
{
u32 a = m_GPR[_inst.RA];
u32 b = m_GPR[_inst.RB];
u32 fTemp;
if (a < b) fTemp = 0x8;
else if (a > b) fTemp = 0x4;
u32 fTemp = 0x8; // a < b
// if (a < b) fTemp = 0x8;else
if (a > b) fTemp = 0x4;
else if (a == b) fTemp = 0x2;
if (XER.SO) PanicAlert("cmpl getting overflow flag"); // fTemp |= 0x1;
SetCRField(_inst.CRFD, fTemp);

View File

@ -631,7 +631,7 @@ void tlbia(UGeckoInstruction _inst)
void tlbie(UGeckoInstruction _inst)
{
// invalid entry
int entry = _inst.RB;
// int entry = _inst.RB;
//MessageBox(0,"TLBIE","TLBIE",0);
}

View File

@ -354,11 +354,11 @@ void mtspr(UGeckoInstruction _inst)
if (HID2.PSE == 0)
PanicAlert("WARNING: PSE in HID2 isnt set");
bool WriteGatherPipeEnable = (bool)HID2.WPE; //TODO?
bool LockedCacheEnable = (bool)HID2.LCE;
int DMAQueueLength = HID2.DMAQL; // Ignore - our DMA:s are instantaneous
bool PairedSingleEnable = HID2.PSE;
bool QuantizeEnable = HID2.LSQE;
// bool WriteGatherPipeEnable = (bool)HID2.WPE; //TODO?
// bool LockedCacheEnable = (bool)HID2.LCE;
// int DMAQueueLength = HID2.DMAQL; // Ignore - our DMA:s are instantaneous
// bool PairedSingleEnable = HID2.PSE;
// bool QuantizeEnable = HID2.LSQE;
//TODO(ector): Protect LC memory if LCE is false.
//TODO(ector): Honor PSE.

View File

@ -49,8 +49,8 @@
namespace Jit64
{
namespace {
u64 GC_ALIGNED16(temp64);
u32 GC_ALIGNED16(temp32);
// u64 GC_ALIGNED16(temp64);
// u32 GC_ALIGNED16(temp32);
}
void lbzx(UGeckoInstruction inst)
{

View File

@ -85,10 +85,10 @@ namespace PowerPC
#ifdef _WIN32
_control87(_PC_53, MCW_PC);
#else
unsigned short mode;
asm ("fstcw %0" : : "m" (mode));
mode = (mode & ~FPU_PREC_MASK) | FPU_PREC_53;
asm ("fldcw %0" : : "m" (mode));
unsigned short _mode;
asm ("fstcw %0" : : "m" (_mode));
_mode = (_mode & ~FPU_PREC_MASK) | FPU_PREC_53;
asm ("fldcw %0" : : "m" (_mode));
#endif
#else
//x64 doesn't need this - fpu is done with SSE
@ -102,7 +102,7 @@ namespace PowerPC
Interpreter::Init();
Jit64::Core::Init();
// ... but start as interpreter by default.
mode = MODE_INTERPRETER;
_mode = MODE_INTERPRETER;
state = CPU_STEPPING;
}

View File

@ -60,7 +60,7 @@ void WriteProfileResults(const char *filename) {
return;
}
fprintf(f, "Profile\n");
for (int i = 0; i < stats.size(); i++)
for (unsigned int i = 0; i < stats.size(); i++)
{
const Jit64::JitBlock *block = Jit64::GetBlock(stats[i].blockNum);
if (block) {

View File

@ -47,10 +47,10 @@ bool SignatureDB::Load(const char *filename)
memset(&temp, 0, sizeof(temp));
fread(&temp, sizeof(temp), 1, f);
DBFunc f;
f.name = temp.name;
f.size = temp.size;
database[temp.checkSum] = f;
DBFunc dbf;
dbf.name = temp.name;
dbf.size = temp.size;
database[temp.checkSum] = dbf;
}
fclose(f);
return true;

View File

@ -104,9 +104,9 @@ void SymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const char *name, int typ
Symbol *SymbolDB::GetSymbolFromAddr(u32 addr)
{
XFuncMap::iterator iter = functions.find(addr);
if (iter != functions.end())
return &iter->second;
XFuncMap::iterator it = functions.find(addr);
if (it != functions.end())
return &it->second;
else
{
for (XFuncMap::iterator iter = functions.begin(); iter != functions.end(); iter++)

View File

@ -191,7 +191,7 @@ void LoadStateCallback(u64 userdata, int cyclesLate)
buffer = new u8[sz];
int x;
if (x=fread(buffer, 1, sz, f) != sz)
if ((x = fread(buffer, 1, sz, f)) != sz)
PanicAlert("wtf? %d %d", x, sz);
}

View File

@ -395,13 +395,13 @@ void CCodeView::OnPaint(wxPaintEvent& event)
if (mojs)
{
for (int i = 0; i < 8; i++)
for (int k = 0; k < 8; k++)
{
bool found = false;
for (int j = 0; j < 22; j++)
{
if (mojs[i + 2] == "0123456789ABCDEFabcdef"[j])
if (mojs[k + 2] == "0123456789ABCDEFabcdef"[j])
{
found = true;
}

View File

@ -645,7 +645,6 @@ void CCodeWindow::OnSymbolListChange(wxCommandEvent& event)
void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
{
int index = symbols->GetSelection();
}

View File

@ -311,13 +311,13 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
if (mojs)
{
for (int i = 0; i < 8; i++)
for (int k = 0; k < 8; k++)
{
bool found = false;
for (int j = 0; j < 22; j++)
{
if (mojs[i + 2] == "0123456789ABCDEFabcdef"[j])
if (mojs[k + 2] == "0123456789ABCDEFabcdef"[j])
{
found = true;
}

View File

@ -126,47 +126,47 @@ void Video_SendFifoData(u8* _uData)
// See Core.cpp for threading idea
void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
{
SCPFifoStruct &fifo = *video_initialize.pCPFifo;
SCPFifoStruct &_fifo = *video_initialize.pCPFifo;
// TODO(ector): Don't peek so often!
while (video_initialize.pPeekMessages())
{
if (fifo.CPReadWriteDistance < 1) //fifo.CPLoWatermark)
if (_fifo.CPReadWriteDistance < 1) //fifo.CPLoWatermark)
Common::SleepCurrentThread(1);
//etc...
// check if we are able to run this buffer
if ((fifo.bFF_GPReadEnable) && !(fifo.bFF_BPEnable && fifo.bFF_Breakpoint))
if ((_fifo.bFF_GPReadEnable) && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint))
{
int count = 200;
while(fifo.CPReadWriteDistance > 0 && count)
while(_fifo.CPReadWriteDistance > 0 && count)
{
// check if we are on a breakpoint
if (fifo.bFF_BPEnable)
if (_fifo.bFF_BPEnable)
{
if (fifo.CPReadPointer == fifo.CPBreakpoint)
if (_fifo.CPReadPointer == _fifo.CPBreakpoint)
{
fifo.bFF_Breakpoint = 1;
_fifo.bFF_Breakpoint = 1;
video_initialize.pUpdateInterrupts();
break;
}
}
// read the data and send it to the VideoPlugin
u8 *uData = video_initialize.pGetMemoryPointer(fifo.CPReadPointer);
u8 *uData = video_initialize.pGetMemoryPointer(_fifo.CPReadPointer);
#ifdef _WIN32
EnterCriticalSection(&fifo.sync);
#endif
fifo.CPReadPointer += 32;
_fifo.CPReadPointer += 32;
Video_SendFifoData(uData);
#ifdef _WIN32
InterlockedExchangeAdd((LONG*)&fifo.CPReadWriteDistance, -32);
InterlockedExchangeAdd((LONG*)&_fifo.CPReadWriteDistance, -32);
LeaveCriticalSection(&fifo.sync);
#endif
// increase the ReadPtr
if (fifo.CPReadPointer >= fifo.CPEnd)
if (_fifo.CPReadPointer >= _fifo.CPEnd)
{
fifo.CPReadPointer = fifo.CPBase;
_fifo.CPReadPointer = _fifo.CPBase;
//LOG(COMMANDPROCESSOR, "BUFFER LOOP");
}
count--;

View File

@ -247,15 +247,15 @@ void DVProfWrite(const char* pfilename, u32 frames)
}
{
map<string, DVTIMEINFO>::iterator it;
map<string, DVTIMEINFO>::iterator iter;
fprintf(f, "\n\n-------------------------------------------------------------------\n\n");
u64 uTotal[2] = {0};
double fiTotalTime[2];
for(it = mapAggregateTimes.begin(); it != mapAggregateTimes.end(); ++it) {
uTotal[0] += it->second.uExclusive;
uTotal[1] += it->second.uInclusive;
for(iter = mapAggregateTimes.begin(); iter != mapAggregateTimes.end(); ++iter) {
uTotal[0] += iter->second.uExclusive;
uTotal[1] += iter->second.uInclusive;
}
fprintf(f, "total times (%d): ex: %Lu ", frames, 1000000*uTotal[0]/(luPerfFreq*(u64)frames));
@ -265,9 +265,9 @@ void DVProfWrite(const char* pfilename, u32 frames)
fiTotalTime[1] = 1.0 / (double)uTotal[1];
// output the combined times
for(it = mapAggregateTimes.begin(); it != mapAggregateTimes.end(); ++it) {
fprintf(f, "%s - ex: %f inc: %f\n", it->first.c_str(), (float)((double)it->second.uExclusive * fiTotalTime[0]),
(float)((double)it->second.uInclusive * fiTotalTime[1]));
for(iter = mapAggregateTimes.begin(); iter != mapAggregateTimes.end(); ++iter) {
fprintf(f, "%s - ex: %f inc: %f\n", iter->first.c_str(), (float)((double)iter->second.uExclusive * fiTotalTime[0]),
(float)((double)iter->second.uInclusive * fiTotalTime[1]));
}
}

View File

@ -61,7 +61,7 @@ class DVProfileFunc
public:
u32 dwUserData;
__forceinline DVProfileFunc(const char* pname) {}
__forceinline DVProfileFunc(const char* pname, u32 dwUserData) { }
__forceinline DVProfileFunc(const char* pname, u32 _dwUserData) { }
~DVProfileFunc() {}
};

View File

@ -480,7 +480,7 @@ PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, in
while(*fmt)
{
int xcnt = 0;
int nchar = sfont_map[*fmt];
int nchar = sfont_map[(int)*fmt];
const unsigned char *ptr = sfont_raw[nchar]; // each char is up to 9x10