warning fixes

(may break sound on wii, look in the changelog of 
Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_AXWii.cpp
if you wish to know why)



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1306 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee
2008-11-26 19:42:22 +00:00
parent d2b726da59
commit 8777917177
24 changed files with 95 additions and 94 deletions

View File

@ -86,8 +86,9 @@ CDebugger::CDebugger(wxWindow *parent, wxWindowID id, const wxString &title,
: wxDialog(parent, id, title, position, size, style)
, m_GPRListView(NULL)
//, gUpdFreq(5) // loaded from file
, gPreset(0)
, giShowAll(-1)
, gPreset(0)
, upd95(false) // block view settings
, upd94(false)
@ -217,7 +218,7 @@ SetTitle(wxT("Sound Debugging"));
// Declarations
wxBoxSizer * sMAIN, * sMain, * sMail, * sBlock;
wxBoxSizer * sMAIN, * sMain, *_sMail, * sBlock;
wxButton* m_Upd;
wxButton* m_SelC;
@ -475,10 +476,10 @@ SetTitle(wxT("Sound Debugging"));
wxBoxSizer * sMailRight = new wxBoxSizer(wxVERTICAL);
//wxStaticBoxSizer * sMailRight = new wxStaticBoxSizer(wxVERTICAL, m_PageMail, wxT("Current"));
sMail = new wxBoxSizer(wxHORIZONTAL);
sMail->Add(m_m1Sizer, 0, wxEXPAND | (wxUP | wxDOWN), 5); // margin = 5
sMail->Add(m_m2Sizer, 1, wxEXPAND | (wxUP | wxDOWN | wxLEFT), 5); // margin = 5
sMail->Add(sMailRight, 0, wxEXPAND | wxALL, 0); // margin = 0
_sMail = new wxBoxSizer(wxHORIZONTAL);
_sMail->Add(m_m1Sizer, 0, wxEXPAND | (wxUP | wxDOWN), 5); // margin = 5
_sMail->Add(m_m2Sizer, 1, wxEXPAND | (wxUP | wxDOWN | wxLEFT), 5); // margin = 5
_sMail->Add(sMailRight, 0, wxEXPAND | wxALL, 0); // margin = 0
sMailRight->Add(m_RadioBox[3], 0, wxALL, 5); // margin = 5
sMailRight->Add(m_gameSizer1, 1, wxEXPAND | wxALL, 5); // margin = 5
@ -515,7 +516,7 @@ SetTitle(wxT("Sound Debugging"));
//sMAIN->SetSizeHints(this);
m_PageMain->SetSizer(sMain);
m_PageMail->SetSizer(sMail);
m_PageMail->SetSizer(_sMail);
m_PageBlock->SetSizer(sBlock);
//sMain->Layout();
@ -649,8 +650,8 @@ void CDebugger::OnOptions(wxCommandEvent& event)
void CDebugger::OnShowAll(wxCommandEvent& event)
{
/// Only allow one selection at a time
for (int i = 0; i < m_opt_showall->GetCount(); ++i)
if(i != event.GetInt()) m_opt_showall->Check(i, false);
for (u32 i = 0; i < m_opt_showall->GetCount(); ++i)
if(i != (u32)event.GetInt()) m_opt_showall->Check(i, false);
if(m_opt_showall->IsChecked(0)) giShowAll = 0;
else if(m_opt_showall->IsChecked(1)) giShowAll = 1;

View File

@ -98,7 +98,7 @@ class CDebugger : public wxDialog
void MailSettings(wxCommandEvent& event);
void Readfile(std::string FileName, bool GC);
std::string Readfile_(std::string FileName);
int CountFiles(std::string FileName);
u32 CountFiles(std::string FileName);
// ============== Blocks
void DoScrollBlocks();

View File

@ -145,7 +145,7 @@ void CDebugger::ReadDir()
// --------------
bool CDebugger::NoDuplicate(std::string FileName)
{
for (int i = 0; i < all_files.size(); i++)
for (u32 i = 0; i < all_files.size(); i++)
{
if(all_files.at(i) == FileName)
return false;
@ -154,7 +154,7 @@ bool CDebugger::NoDuplicate(std::string FileName)
}
// Count the number of files for each game
int CDebugger::CountFiles(std::string FileName)
u32 CDebugger::CountFiles(std::string FileName)
{
int match = 0;
@ -178,7 +178,6 @@ std::string CDebugger::Readfile_(std::string FileName)
char c; // declare a char variable
FILE *file; // declare a FILE pointer
std::string sz = "";
char ch[1] = "";
if(File::Exists(FileName.c_str()))
file = fopen(FileName.c_str(), "r"); // open a text file for reading
@ -201,18 +200,18 @@ std::string CDebugger::Readfile_(std::string FileName)
break; // break when EOF is reached
}
fclose(file);
return sz;
fclose(file);
}
return sz;
}
// Read file
void CDebugger::Readfile(std::string FileName, bool GC)
{
int n = CountFiles(FileName); // count how many mails we have
int curr_n = 0;
u32 n = CountFiles(FileName); // count how many mails we have
u32 curr_n = 0;
std::ifstream file;
for (int i = 0; i < m_RadioBox[3]->GetCount(); i++)
for (u32 i = 0; i < m_RadioBox[3]->GetCount(); i++)
{
if(m_RadioBox[3]->IsItemEnabled(i)) curr_n++;
m_RadioBox[3]->Enable(i, false); // disable all
@ -220,7 +219,7 @@ void CDebugger::Readfile(std::string FileName, bool GC)
//wprintf("Disabled all: n %i\n", n);
for (int i = 0; i < n; i++)
for (u32 i = 0; i < n; i++)
{
m_RadioBox[3]->Enable(i, true); // then anble the right ones
//wprintf("m_RadioBox[3] enabled: %i\n", i);
@ -253,25 +252,23 @@ void CDebugger::Readfile(std::string FileName, bool GC)
// ---------------
void CDebugger::OnGameChange(wxCommandEvent& event)
{
if(event.GetId() == 2006)
if(event.GetId() == 2006)
{
// Only allow one selected game at a time
for (int i = 0; i < m_gc->GetCount(); ++i)
if(i != event.GetInt()) m_gc->Check(i, false);
for (int i = 0; i < m_wii->GetCount(); ++i)
m_wii->Check(i, false);
Readfile(gc_files[event.GetInt()], true);
// Only allow one selected game at a time
for (u32 i = 0; i < m_gc->GetCount(); ++i)
if(i != (u32)event.GetInt()) m_gc->Check(i, false);
for (u32 i = 0; i < m_wii->GetCount(); ++i)
m_wii->Check(i, false);
Readfile(gc_files[event.GetInt()], true);
}
else
else
{
for (int i = 0; i < m_gc->GetCount(); ++i)
m_gc->Check(i, false);
for (int i = 0; i < m_wii->GetCount(); ++i)
if(i != event.GetInt()) m_wii->Check(i, false);
Readfile(wii_files[event.GetInt()], false);
for (u32 i = 0; i < m_gc->GetCount(); ++i)
m_gc->Check(i, false);
for (u32 i = 0; i < m_wii->GetCount(); ++i)
if(i != (u32)event.GetInt()) m_wii->Check(i, false);
Readfile(wii_files[event.GetInt()], false);
}
}
// Settings

View File

@ -126,7 +126,7 @@ int aprintf(int a, char *fmt, ...)
// ---------------------------------------------------------------------------------------
// Printf to screen function
int wprintf(char *fmt, ...)
int wprintf(const char *fmt, ...)
{
#if defined(DEBUG_HLE) && defined(_WIN32) && (defined(_DEBUG) || defined(DEBUGFAST))
char s[1024*20]; // Warning, mind this value

View File

@ -17,7 +17,7 @@
void startConsoleWin(int width, int height, char* fname);
int wprintf(char *fmt, ...);
int wprintf(const char *fmt, ...);
int aprintf(int a, char *fmt, ...);
void ClearScreen();
void OpenConsole();
@ -25,4 +25,4 @@ void CloseConsole();
#ifdef _WIN32
HWND GetConsoleHwnd(void);
#endif
#endif

View File

@ -252,7 +252,7 @@ std::string writeMessage(int a, int i, bool Wii)
{
if(Wii) // Wii
{
sprintf(buf,"%c%02i %i %10s/%10s %10s | %06s %06s | %i %i | %03i %05i %05i %03i %05i %05i | %05i %05i[%i %05i]",
sprintf(buf,"%c%02i %i %10s/%10s %10s | %6s %6s | %i %i | %03i %05i %05i %03i %05i %05i | %05i %05i[%i %05i]",
223, i, mem[i], ThS(gsamplePos[i],true).c_str(), ThS(gsampleEnd[i],true).c_str(), ThS(gloopPos[i],true).c_str(),
ThS(gvolume_left[i]).c_str(), ThS(gvolume_right[i]).c_str(),
glooping[i], gis_stream[i],
@ -262,7 +262,7 @@ std::string writeMessage(int a, int i, bool Wii)
}
else // GC
{
sprintf(buf,"%c%02i %10s/%10s %10s | %06s %06s | %i %i | %03i %05i %05i %03i %05i %05i | %05i %05i[%i %05i]",
sprintf(buf,"%c%02i %10s/%10s %10s | %6s %6s | %i %i | %03i %05i %05i %03i %05i %05i | %05i %05i[%i %05i]",
223, i, ThS(gsamplePos[i],true).c_str(), ThS(gsampleEnd[i],true).c_str(), ThS(gloopPos[i],true).c_str(),
ThS(gvolume_left[i]).c_str(), ThS(gvolume_right[i]).c_str(),
glooping[i], gis_stream[i],
@ -286,7 +286,7 @@ std::string writeMessage(int a, int i, bool Wii)
{
if(m_frame->bShowBase) // base 10 (decimal)
{
sprintf(buf,"%c%02i %10s/%10s %10s | %06s %06s | %u %u %u | %u %u %u %u %u %08x %08x",
sprintf(buf,"%c%02i %10s/%10s %10s | %6s %6s | %u %u %u | %u %u %u %u %u %08x %08x %08x %08x %08x %08x %08x",
223, i, ThS(gsamplePos[i]).c_str(), ThS(gsampleEnd[i]).c_str(), ThS(gloopPos[i]).c_str(),
ThS(gvolume_left[i]).c_str(), ThS(gvolume_right[i]).c_str(),
gsrc_type[i], gaudioFormat[i], gcoef[i],
@ -298,7 +298,7 @@ std::string writeMessage(int a, int i, bool Wii)
{
if(Wii) // Wii
{
sprintf(buf,"%c%02i %08x/%08x %08x | %04x %04x | %u %u %u | %u %u %u %08x %08x %08x %08x %08x",
sprintf(buf,"%c%02i %08x/%08x %08x | %04x %04x | %u %u %u | %u %u %u %08x %08x %08x %08x %08x %08x",
223, i, gsamplePos[i], gsampleEnd[i], gloopPos[i],
gvolume_left[i], gvolume_right[i],
gsrc_type[i], gaudioFormat[i], gcoef[i],
@ -308,7 +308,7 @@ std::string writeMessage(int a, int i, bool Wii)
}
else // GC
{
sprintf(buf,"%c%02i %08x/%08x %08x | %04x %04x | %u %u %u | %u %u %u %u %u %08x %08x %08x %08x %08x",
sprintf(buf,"%c%02i %08x/%08x %08x | %04x %04x | %u %u %u | %u %u %u %u %u %08x %08x %08x %08x %08x %08x",
223, i, gsamplePos[i], gsampleEnd[i], gloopPos[i],
gvolume_left[i], gvolume_right[i],
gsrc_type[i], gaudioFormat[i], gcoef[i],
@ -674,7 +674,7 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
/* Have a separate set for which ones to show. Currently show blocks that have been
running at least once the last 100 updates.
// --------------
/*
Move all items back like this:
1 to 0
2 1
@ -855,7 +855,7 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
iupdonce = true;
}
for (int i = 0; i < viupd.size(); i++) // 0, 1,..., 9
for (u32 i = 0; i < viupd.size(); i++) // 0, 1,..., 9
{
if (i < viupd.size()-1)
{
@ -877,7 +877,7 @@ void Logging_(short* _pBuffer, int _iSize, int a, bool Wii, ParamBlockType &PBs,
}
}
for (int i = 0; i < viupd.size(); i++)
for (u32 i = 0; i < viupd.size(); i++)
{
if(viupd.at(i) == 0)
sbuff = sbuff + " ";
@ -934,12 +934,12 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a, bool Wii)
{
if(version == 0)
{
numberOfPBs = ReadOutPBsWii(m_addressPBs, PBw, NUMBER_OF_PBS, true);
numberOfPBs = ReadOutPBsWii(m_addressPBs, PBw, NUMBER_OF_PBS);
Logging_(_pBuffer, _iSize, a, Wii, PBw, numberOfPBs, m_addressPBs);
}
else
{
numberOfPBs = ReadOutPBsWii(m_addressPBs, PBw_, NUMBER_OF_PBS, true);
numberOfPBs = ReadOutPBsWii(m_addressPBs, PBw_, NUMBER_OF_PBS);
Logging_(_pBuffer, _iSize, a, Wii, PBw_, numberOfPBs, m_addressPBs);
}
}
@ -949,4 +949,4 @@ void CUCode_AX::Logging(short* _pBuffer, int _iSize, int a, bool Wii)
Logging_(_pBuffer, _iSize, a, Wii, PBs, numberOfPBs, m_addressPBs);
}
}
}
}

View File

@ -123,7 +123,7 @@ if(m_frame->ScanMails)
if(Wii)
TmpMailLog += "Current CRC: " + StringFromFormat("0x%08x \n\n", _CRC);
for (int i = 0; i < sMailTime.size(); i++)
for (u32 i = 0; i < sMailTime.size(); i++)
{
char tmpbuf[128]; sprintf(tmpbuf, "Mail %i received: %s\n", i, sMailTime.at(i).c_str());
TmpMailLog += tmpbuf;
@ -191,10 +191,10 @@ if(m_frame->ScanMails)
}
// Compare this mail to old mails
int addnew = 0;
for (int i = 0; i < m_frame->sMail.size(); i++)
u32 addnew = 0;
for (u32 j = 0; j < m_frame->sMail.size(); j++)
{
if(m_frame->sMail.at(i).length() != sTemp.length())
if(m_frame->sMail.at(j).length() != sTemp.length())
{
//wxMessageBox( wxString::Format("%s \n\n%s", m_frame->sMail.at(i).c_str(),
// sTemp.c_str()) );
@ -207,7 +207,7 @@ if(m_frame->ScanMails)
if(addnew == m_frame->sMail.size())
{
//wprintf("%i | %i\n", addnew, m_frame->sMail.size());
int resizeTo = m_frame->sMail.size() + 1;
u32 resizeTo = m_frame->sMail.size() + 1;
// ------------------------------------
// get timestamp
@ -453,8 +453,8 @@ bool CUCode_AX::AXTask(u32& _uMail)
u32 Addr__12;
u32 Addr__4_1;
u32 Addr__4_2;
u32 Addr__4_3;
u32 Addr__4_4;
// u32 Addr__4_3;
// u32 Addr__4_4;
u32 Addr__5_1;
u32 Addr__5_2;
u32 Addr__6;

View File

@ -41,10 +41,10 @@ extern CDebugger * m_frame;
// -----------
CUCode_AXWii::CUCode_AXWii(CMailHandler& _rMailHandler, u32 _CRC)
CUCode_AXWii::CUCode_AXWii(CMailHandler& _rMailHandler, u32 l_CRC)
: IUCode(_rMailHandler)
, m_addressPBs(0xFFFFFFFF)
, _CRC(_CRC)
, _CRC(l_CRC)
{
// we got loaded
m_rMailHandler.PushMail(0xDCD10000);
@ -54,7 +54,7 @@ CUCode_AXWii::CUCode_AXWii(CMailHandler& _rMailHandler, u32 _CRC)
temprbuffer = new int[1024 * 1024];
lCUCode_AX = new CUCode_AX(_rMailHandler);
lCUCode_AX->_CRC = _CRC;
lCUCode_AX->_CRC = l_CRC;
}
CUCode_AXWii::~CUCode_AXWii()
@ -98,7 +98,7 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs)
//AXParamBlockWii PBs[NUMBER_OF_PBS];
// read out pbs
int numberOfPBs = ReadOutPBsWii(m_addressPBs, PBs, NUMBER_OF_PBS, false);
int numberOfPBs = ReadOutPBsWii(m_addressPBs, PBs, NUMBER_OF_PBS);
if (_iSize > 1024 * 1024)
_iSize = 1024 * 1024;
@ -122,7 +122,7 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs)
{
const u32 blockAddr = (u32)(PBs[p].this_pb_hi<< 16) | PBs[p].this_pb_lo;
const short *pSrc = (const short *)g_dspInitialize.pGetMemoryPointer(blockAddr);
for (int i = 0; i < sizeof(AXParamBlockWii) / 2; i+=2)
for (u32 i = 0; i < sizeof(AXParamBlockWii) / 2; i+=2)
{
if(i == 10 || i == 34 || i == 41 || i == 46 || i == 46 || i == 58 || i == 60
|| i == 68 || i == 88 || i == 95)
@ -132,7 +132,7 @@ void CUCode_AXWii::MixAdd_(short* _pBuffer, int _iSize, ParamBlockType &PBs)
i/2, i,
m_frame->PBn[i].c_str(), m_frame->PBp[i].c_str()
);
for (int i = 0; i < 50 - line.length(); ++i)
for (u32 j = 0; j < 50 - line.length(); ++j)
line += " ";
m_frame->str0 += line;
@ -248,14 +248,14 @@ bool CUCode_AXWii::AXTask(u32& _uMail)
u32 Addr__AXStudio;
u32 Addr__AXOutSBuffer;
u32 Addr__AXOutSBuffer_1;
u32 Addr__AXOutSBuffer_2;
// u32 Addr__AXOutSBuffer_1;
// u32 Addr__AXOutSBuffer_2;
u32 Addr__A;
u32 Addr__12;
// u32 Addr__12;
u32 Addr__5_1;
u32 Addr__5_2;
u32 Addr__6;
u32 Addr__9;
// u32 Addr__9;
bool bExecuteList = true;

View File

@ -37,7 +37,7 @@ extern float ratioFactor;
template<class ParamBlockType>
inline int ReadOutPBsWii(u32 pbs_address, ParamBlockType& _pPBs, int _num, int _deb)
inline int ReadOutPBsWii(u32 pbs_address, ParamBlockType& _pPBs, int _num)
{
int count = 0;
u32 blockAddr = pbs_address;
@ -52,7 +52,7 @@ inline int ReadOutPBsWii(u32 pbs_address, ParamBlockType& _pPBs, int _num, int _
if (pSrc != NULL)
{
short *pDest = (short *)&_pPBs[i];
for (int p = 0; p < sizeof(AXParamBlockWii) / 2; p++)
for (u32 p = 0; p < sizeof(AXParamBlockWii) / 2; p++)
{
if(p == 6 || p == 7) pDest[p] = pSrc[p]; // control for the u32
else pDest[p] = Common::swap16(pSrc[p]);