createtest fixes and compile fixes for linux

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3482 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-06-17 21:44:03 +00:00
parent ff83f9eb71
commit 697ce7b1ab
11 changed files with 59 additions and 58 deletions

View File

@ -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
}

View File

@ -24,6 +24,9 @@
#define SLEEP(x) usleep(x*1000)
#endif
template <bool> struct CompileTimeAssert;
template<> struct CompileTimeAssert<true> {};
#ifndef _WIN32
#if defined __APPLE__

View File

@ -20,8 +20,9 @@
#include "Common.h"
#include <string>
#ifdef _WIN32
#include <mmsystem.h>
#endif
namespace Common
{
class Timer

View File

@ -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"

View File

@ -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");

View File

@ -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.

View File

@ -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
}
// =============

View File

@ -20,6 +20,7 @@ files = [
'VolumeWad.cpp',
'VolumeWiiCrypted.cpp',
'NANDContentLoader.cpp',
'WiiWad.cpp',
'AES/aes_cbc.c',
'AES/aes_core.c',
]

View File

@ -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";
}
}

View File

@ -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;

View File

@ -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