summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornakeee <nakeee@gmail.com>2009-06-17 21:44:03 +0000
committernakeee <nakeee@gmail.com>2009-06-17 21:44:03 +0000
commit697ce7b1ab2ffc5f1bf18bf9bfc37462fcb38183 (patch)
tree3e97c6b6c348b24749575bf7888d692814f5a12c
parentff83f9eb714268d3b6437005a46d598bbd95c9bd (diff)
createtest fixes and compile fixes for linux
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3482 8ced0084-cf51-0410-be5f-012b33b47a6e
-rw-r--r--Source/Core/Common/Src/Common.h2
-rw-r--r--Source/Core/Common/Src/CommonFuncs.h3
-rw-r--r--Source/Core/Common/Src/Timer.h3
-rw-r--r--Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp2
-rw-r--r--Source/Core/DSPCore/Src/DSPCodeUtil.cpp11
-rw-r--r--Source/Core/DSPCore/Src/DSPCodeUtil.h2
-rw-r--r--Source/Core/DebuggerWX/Src/CodeWindow.cpp79
-rw-r--r--Source/Core/DiscIO/Src/SConscript1
-rwxr-xr-xSource/DSPSpy/util/createtest.pl10
-rw-r--r--Source/DSPTool/Src/main.cpp2
-rw-r--r--Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h2
11 files changed, 59 insertions, 58 deletions
diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h
index 8be00df4ae..fe792ee81d 100644
--- a/Source/Core/Common/Src/Common.h
+++ b/Source/Core/Common/Src/Common.h
@@ -92,8 +92,6 @@ namespace
#ifndef _SECURE_SCL
#error Please define _SECURE_SCL=0 in the project settings
#else
- template <bool> struct CompileTimeAssert;
- template<> struct CompileTimeAssert<true> {};
CompileTimeAssert<_SECURE_SCL==0> x;
#endif
}
diff --git a/Source/Core/Common/Src/CommonFuncs.h b/Source/Core/Common/Src/CommonFuncs.h
index 4f128c4726..453e23b866 100644
--- a/Source/Core/Common/Src/CommonFuncs.h
+++ b/Source/Core/Common/Src/CommonFuncs.h
@@ -24,6 +24,9 @@
#define SLEEP(x) usleep(x*1000)
#endif
+template <bool> struct CompileTimeAssert;
+template<> struct CompileTimeAssert<true> {};
+
#ifndef _WIN32
#if defined __APPLE__
diff --git a/Source/Core/Common/Src/Timer.h b/Source/Core/Common/Src/Timer.h
index e905d962e4..292829f122 100644
--- a/Source/Core/Common/Src/Timer.h
+++ b/Source/Core/Common/Src/Timer.h
@@ -20,8 +20,9 @@
#include "Common.h"
#include <string>
+#ifdef _WIN32
#include <mmsystem.h>
-
+#endif
namespace Common
{
class Timer
diff --git a/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp b/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp
index ab53e00aa4..de9572f414 100644
--- a/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp
+++ b/Source/Core/Core/Src/Boot/Boot_WiiWAD.cpp
@@ -23,7 +23,7 @@
#include "../PatchEngine.h"
#include "../IPC_HLE/WII_IPC_HLE.h"
-#include "WiiWAD.h"
+#include "WiiWad.h"
#include "NANDContentLoader.h"
#include "FileUtil.h"
#include "Boot_DOL.h"
diff --git a/Source/Core/DSPCore/Src/DSPCodeUtil.cpp b/Source/Core/DSPCore/Src/DSPCodeUtil.cpp
index fda14e29f8..e41866e414 100644
--- a/Source/Core/DSPCore/Src/DSPCodeUtil.cpp
+++ b/Source/Core/DSPCore/Src/DSPCodeUtil.cpp
@@ -68,7 +68,7 @@ bool Compare(const std::vector<u16> &code1, const std::vector<u16> &code2)
{
if (code1.size() != code2.size())
printf("Size difference! 1=%i 2=%i\n", (int)code1.size(), (int)code2.size());
- int count_equal = 0;
+ u32 count_equal = 0;
const int min_size = (int)std::min(code1.size(), code2.size());
AssemblerSettings settings;
@@ -135,7 +135,7 @@ void CodeToHeader(const std::vector<u16> &code, std::string _filename,
header.append("#endif\n\n");
header.append("\t{\n\t\t");
- for (int j = 0; j < code.size(); j++)
+ for (u32 j = 0; j < code.size(); j++)
{
if (j && ((j & 15) == 0))
header.append("\n\t\t");
@@ -147,7 +147,7 @@ void CodeToHeader(const std::vector<u16> &code, std::string _filename,
header.append("};\n");
}
-void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string> filenames,
+void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string>* filenames,
int numCodes, const char *name, std::string &header)
{
char buffer[1024];
@@ -164,7 +164,8 @@ void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string>
for (int i = 0; i < numCodes; i++)
{
std::string filename;
- SplitPath(filenames.at(i), NULL, &filename, NULL);
+ SplitPath(filenames->at(i), NULL, &filename, NULL);
+ // printf("files %s\n", (filenames->at(i).c_str()));
sprintf(buffer, "%s\t\"%s\",\n", buffer, filename.c_str());
}
sprintf(buffer, "%s};\n\n", buffer);
@@ -187,7 +188,7 @@ void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string>
code_copy.push_back(0);
header.append("\t{\n\t\t");
- for (int j = 0; j < codes[i].size(); j++)
+ for (u32 j = 0; j < codes[i].size(); j++)
{
if (j && ((j & 15) == 0))
header.append("\n\t\t");
diff --git a/Source/Core/DSPCore/Src/DSPCodeUtil.h b/Source/Core/DSPCore/Src/DSPCodeUtil.h
index 9652a93b28..3d204e359e 100644
--- a/Source/Core/DSPCore/Src/DSPCodeUtil.h
+++ b/Source/Core/DSPCore/Src/DSPCodeUtil.h
@@ -29,7 +29,7 @@ bool Compare(const std::vector<u16> &code1, const std::vector<u16> &code2);
void GenRandomCode(int size, std::vector<u16> &code);
void CodeToHeader(const std::vector<u16> &code, std::string _filename,
const char *name, std::string &header);
-void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string> filenames,
+void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string> *filenames,
int numCodes, const char *name, std::string &header);
// Big-endian, for writing straight to file using File::WriteStringToFile.
diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp
index aef91973d4..145b1d0253 100644
--- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp
@@ -16,9 +16,7 @@
// http://code.google.com/p/dolphin-emu/
-//////////////////////////////////////////////////////////////////////////////////////////
// Include
-// ŻŻŻŻŻŻŻŻŻŻ
#include "Common.h"
#include <wx/button.h>
@@ -75,7 +73,7 @@ extern "C" // Bitmaps
#include "../resources/toolbar_add_breakpoint.c"
}
-//////////////////////////////////////////////////////////////////////////
+
class CPluginInfo;
class CPluginManager;
@@ -92,7 +90,7 @@ inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
}
-//////////////////////////////////////////////////////////////////////////
+
BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
EVT_LISTBOX(ID_SYMBOLLIST, CCodeWindow::OnSymbolListChange)
EVT_LISTBOX(ID_CALLSTACKLIST, CCodeWindow::OnCallstackListChange)
@@ -159,7 +157,7 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
END_EVENT_TABLE()
-//////////////////////////////////////////////////////////////////////////
+
// Class, input event handler and host message handler
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, wxWindow* parent, wxWindowID id,
const wxString& title, const wxPoint& pos, const wxSize& size, long style)
@@ -277,13 +275,13 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event)
}
}
-////////////////////////////////////////////////
-// =======================================================================================
+
+
// Load these settings before CreateGUIControls()
-// --------------
+
void CCodeWindow::Load_( IniFile &ini )
{
// The font to override DebuggerFont with
@@ -299,7 +297,7 @@ void CCodeWindow::Load_( IniFile &ini )
ini.Get("ShowOnStart", "JitWindow", &bJitWindow, true);
ini.Get("ShowOnStart", "SoundWindow", &bSoundWindow, false);
ini.Get("ShowOnStart", "VideoWindow", &bVideoWindow, false);
- // ===============
+
// Boot to pause or not
ini.Get("ShowOnStart", "AutomaticStart", &bAutomaticStart, false);
@@ -353,7 +351,7 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
{
CreateMenu(_LocalCoreStartupParameter);
- // =======================================================================================
+
// Configure the code window
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
@@ -377,7 +375,7 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
sizerBig->Fit(this);
sync_event.Init();
- // =================
+
if (bRegisterWindow)
@@ -425,17 +423,17 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
} // don't have any else, just ignore it
}
-// ===================================================================
+
// Create CPU Mode and Views menus
-// ---------------
+
void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter)
{
// Create menu
pMenuBar = new wxMenuBar(wxMB_DOCKABLE);
- // --------------------------------
+
// CPU Mode
- // -------------
+
wxMenu* pCoreMenu = new wxMenu;
wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _T("&Interpreter core")
@@ -493,11 +491,11 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
// dualcore->Check(_LocalCoreStartupParameter.bUseDualCore);
pMenuBar->Append(pCoreMenu, _T("&CPU Mode"));
- // -----------------
+
- // --------------------------------
+
// Views
- // ---------------
+
wxMenu* pDebugDialogs = new wxMenu;
wxMenuItem* pRegister = pDebugDialogs->Append(IDM_REGISTERWINDOW, _T("&Registers"), wxEmptyString, wxITEM_CHECK);
@@ -522,7 +520,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
wxMenuItem* pFontPicker = pDebugDialogs->Append(IDM_FONTPICKER, _T("&Font..."), wxEmptyString, wxITEM_NORMAL);
pMenuBar->Append(pDebugDialogs, _T("&Views"));
- // -----------------
+
CreateSymbolsMenu();
@@ -530,9 +528,9 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
}
-// =======================================================================================
+
// Toolbar and bitmaps for the toolbar
-// --------------
+
void CCodeWindow::InitBitmaps()
{
// load original size 48x48
@@ -573,12 +571,12 @@ void CCodeWindow::PopulateToolbar(wxToolBar* toolBar)
// the changes
toolBar->Realize();
}
-// ===================================
-// =======================================================================================
+
+
// Shortcuts
-// --------------
+
bool CCodeWindow::UseInterpreter()
{
return GetMenuBar()->IsChecked(IDM_INTERPRETER);
@@ -603,12 +601,12 @@ bool CCodeWindow::JITBlockLinking()
{
return GetMenuBar()->IsChecked(IDM_JITBLOCKLINKING);
}
-// =========================
-// =======================================================================================
+
+
// CPU Mode and JIT Menu
-// --------------
+
void CCodeWindow::OnCPUMode(wxCommandEvent& event)
{
switch (event.GetId())
@@ -662,27 +660,26 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event)
case IDM_SEARCHINSTRUCTION:
{
wxString str;
- str = wxGetTextFromUser("", "Op?", wxEmptyString, this);
+ str = wxGetTextFromUser(_(""), wxT("Op?"), wxEmptyString, this);
for (u32 addr = 0x80000000; addr < 0x80100000; addr += 4) {
const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr));
- if (name && !strcmp(str.c_str(), name))
+ if (name && !strcmp((const char *)str.mb_str(), name))
NOTICE_LOG(POWERPC, "Found %s at %08x", str.c_str(), addr);
}
break;
}
}
}
-// =====================================
-//////////////////////////////////////////////////////////////////////////////////////////
+
+
// Events
-// ŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
-// =======================================================================================
+
// The Play, Stop, Step, Skip, Go to PC and Show PC buttons all go here
-// --------------
+
void CCodeWindow::OnCodeStep(wxCommandEvent& event)
{
switch (event.GetId())
@@ -865,13 +862,13 @@ void CCodeWindow::Update()
when we pause SINCE THIS CAN BE CALLED AT OTHER TIMES TOO */
// codeview->Center(PC);
}
-/////////////////////////////////////////////////
-// =======================================================================================
+
+
// Update GUI
-// --------------
+
void CCodeWindow::UpdateButtonStates()
{
bool Initialized = (Core::GetState() != Core::CORE_UNINITIALIZED);
@@ -947,12 +944,12 @@ void CCodeWindow::RecreateToolbar()
PopulateToolbar(theToolBar);
SetToolBar(theToolBar);
}
-// =============
-// =======================================================================================
+
+
// Show Tool Tip for menu items
-// --------------
+
void CCodeWindow::DoTip(wxString text)
{
// Create a blank tooltip to clear the eventual old one
@@ -998,4 +995,4 @@ void CCodeWindow::OnStatusBar_(wxUpdateUIEvent& event)
//if(event.GetId() != IDM_ADDRBOX) DoTip(wxEmptyString);
#endif
}
-// =============
+
diff --git a/Source/Core/DiscIO/Src/SConscript b/Source/Core/DiscIO/Src/SConscript
index 32c1d7ad87..66279989e0 100644
--- a/Source/Core/DiscIO/Src/SConscript
+++ b/Source/Core/DiscIO/Src/SConscript
@@ -20,6 +20,7 @@ files = [
'VolumeWad.cpp',
'VolumeWiiCrypted.cpp',
'NANDContentLoader.cpp',
+ 'WiiWad.cpp',
'AES/aes_cbc.c',
'AES/aes_core.c',
]
diff --git a/Source/DSPSpy/util/createtest.pl b/Source/DSPSpy/util/createtest.pl
index 2fc5cbd312..e4fe919c57 100755
--- a/Source/DSPSpy/util/createtest.pl
+++ b/Source/DSPSpy/util/createtest.pl
@@ -57,7 +57,10 @@ usage() if (! defined $input);
my $xtest = XMLin($input);
my $type = $xtest->{'type'};
-foreach my $cmd (split(/,/, $cmds)) {
+my @cmdList = split(/,/, $cmds);
+
+for(my $i = 0;$i < scalar(@cmdList);$i++) {
+ my $cmd = $cmdList[$i];
my $name = parseString($xtest->{'name'}, $cmd);
$name =~ s/ /_/g;
my $desc = parseString($xtest->{'description'}, $cmd);
@@ -86,9 +89,6 @@ foreach my $cmd (split(/,/, $cmds)) {
open(NAMES, ">$name.lst");
}
-# print NAMES "; $name\n";
-# print NAMES "; $desc\n";
-
my $numLines = POSIX::ceil(0xFFFF / $ucodes);
for(my $j = 0; $j < $numLines; $j++) {
open(OUTPUT, ">$name$j.tst");
@@ -98,7 +98,7 @@ foreach my $cmd (split(/,/, $cmds)) {
print NAMES "$name$j.tst";
# Don't end with a newline
- if ($j < $numLines - 1) {
+ if ($j < $numLines - 1 || ($merge && $i != scalar(@cmdList)-1)) {
print NAMES "\n";
}
}
diff --git a/Source/DSPTool/Src/main.cpp b/Source/DSPTool/Src/main.cpp
index 17f2c04d41..b1ab0e827c 100644
--- a/Source/DSPTool/Src/main.cpp
+++ b/Source/DSPTool/Src/main.cpp
@@ -361,7 +361,7 @@ int main(int argc, const char *argv[])
}
- CodesToHeader(codes, files, lines, output_header_name.c_str(), header);
+ CodesToHeader(codes, &files, lines, output_header_name.c_str(), header);
File::WriteStringToFile(true, header, (output_header_name + ".h").c_str());
delete[] codes;
diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h
index 2b8fc97340..a9462942bf 100644
--- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h
+++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda.h
@@ -46,7 +46,7 @@ struct ZPB
namespace {
// If this miscompiles, adjust the size of ZPB to 0x180 bytes (0xc0 shorts).
-CompileTimeAssert<sizeof(ZPB) == 0x180> ensure_zpb_size_correct;
+ CompileTimeAssert<sizeof(ZPB) == 0x180> ensure_zpb_size_correct;
} // namespace