Made the OpenGL iLog setting changeable from the debugging window
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1232 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f5a92e2e9e
commit
8a77ca8189
|
@ -309,9 +309,6 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
|
||||||
|
|
||||||
if(bVideoWindow)
|
if(bVideoWindow)
|
||||||
{
|
{
|
||||||
wxMessageBox(_T("Warning, automatically opening this window before a game is started \n\
|
|
||||||
may cause a crash. Todo: figure out why and fix it."), wxT("OpenGL Debugging Window"));
|
|
||||||
|
|
||||||
// possible todo: add some kind of if here to? can it fail?
|
// possible todo: add some kind of if here to? can it fail?
|
||||||
CPluginManager::GetInstance().OpenDebug(
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
GetHandle(),
|
GetHandle(),
|
||||||
|
@ -333,11 +330,12 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
|
||||||
{
|
{
|
||||||
wxMenu* pCoreMenu = new wxMenu;
|
wxMenu* pCoreMenu = new wxMenu;
|
||||||
|
|
||||||
wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _T("&Interpreter"), wxEmptyString, wxITEM_CHECK);
|
wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _T("&Interpreter core"), wxEmptyString, wxITEM_CHECK);
|
||||||
interpreter->Check(!_LocalCoreStartupParameter.bUseJIT);
|
interpreter->Check(!_LocalCoreStartupParameter.bUseJIT);
|
||||||
|
pCoreMenu->AppendSeparator();
|
||||||
|
|
||||||
#ifdef JIT_OFF_OPTIONS
|
#ifdef JIT_OFF_OPTIONS
|
||||||
jitoff = pCoreMenu->Append(IDM_JITOFF, _T("&JIT off"), wxEmptyString, wxITEM_CHECK);
|
jitoff = pCoreMenu->Append(IDM_JITOFF, _T("&JIT off (JIT core)"), wxEmptyString, wxITEM_CHECK);
|
||||||
jitoff->Check(_LocalCoreStartupParameter.bJITOff);
|
jitoff->Check(_LocalCoreStartupParameter.bJITOff);
|
||||||
|
|
||||||
jitlsoff = pCoreMenu->Append(IDM_JITLSOFF, _T("&JIT LoadStore off"), wxEmptyString, wxITEM_CHECK);
|
jitlsoff = pCoreMenu->Append(IDM_JITLSOFF, _T("&JIT LoadStore off"), wxEmptyString, wxITEM_CHECK);
|
||||||
|
@ -366,6 +364,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
|
||||||
// dualcore->Check(_LocalCoreStartupParameter.bUseDualCore);
|
// dualcore->Check(_LocalCoreStartupParameter.bUseDualCore);
|
||||||
|
|
||||||
pMenuBar->Append(pCoreMenu, _T("&CPU Mode"));
|
pMenuBar->Append(pCoreMenu, _T("&CPU Mode"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -970,6 +969,7 @@ void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event)
|
||||||
void CCodeWindow::OnToggleVideoWindow(wxCommandEvent& event)
|
void CCodeWindow::OnToggleVideoWindow(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
bool show = GetMenuBar()->IsChecked(event.GetId());
|
bool show = GetMenuBar()->IsChecked(event.GetId());
|
||||||
|
//GetMenuBar()->Check(event.GetId(), false); // Turn off
|
||||||
|
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.Load(DEBUGGER_CONFIG_FILE);
|
ini.Load(DEBUGGER_CONFIG_FILE);
|
||||||
|
@ -978,6 +978,13 @@ void CCodeWindow::OnToggleVideoWindow(wxCommandEvent& event)
|
||||||
|
|
||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
|
// It works now, but I'll keep this message in case the problem reappears
|
||||||
|
/*if(Core::GetState() == Core::CORE_UNINITIALIZED)
|
||||||
|
{
|
||||||
|
wxMessageBox(_T("Warning, opening this window before a game is started \n\
|
||||||
|
may cause a crash when a game is later started. Todo: figure out why and fix it."), wxT("OpenGL Debugging Window"));
|
||||||
|
}*/
|
||||||
|
|
||||||
// TODO: add some kind of if() check here to?
|
// TODO: add some kind of if() check here to?
|
||||||
CPluginManager::GetInstance().OpenDebug(
|
CPluginManager::GetInstance().OpenDebug(
|
||||||
GetHandle(),
|
GetHandle(),
|
||||||
|
|
|
@ -731,6 +731,10 @@
|
||||||
<Filter
|
<Filter
|
||||||
Name="Debugger"
|
Name="Debugger"
|
||||||
>
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Src\Debugger\Blocks.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Src\Debugger\Debugger.cpp"
|
RelativePath=".\Src\Debugger\Debugger.cpp"
|
||||||
>
|
>
|
||||||
|
@ -739,6 +743,10 @@
|
||||||
RelativePath=".\Src\Debugger\Debugger.h"
|
RelativePath=".\Src\Debugger\Debugger.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Src\Debugger\Mails.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Src\Debugger\PBView.cpp"
|
RelativePath=".\Src\Debugger\PBView.cpp"
|
||||||
>
|
>
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Licensetype: GNU General Public License (GPL)
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, version 2.0.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License 2.0 for more details.
|
||||||
|
//
|
||||||
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
//
|
||||||
|
// Official SVN repository and contact information can be found at
|
||||||
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// includes
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "Debugger.h"
|
||||||
|
#include "PBView.h"
|
||||||
|
#include "IniFile.h"
|
||||||
|
#include "FileUtil.h"
|
||||||
|
#include "StringUtil.h"
|
||||||
|
#include "FileSearch.h"
|
||||||
|
#include "../Logging/Console.h" // open and close console
|
||||||
|
|
||||||
|
|
||||||
|
// Make the wxTextCtrls scroll with each other
|
||||||
|
void CDebugger::DoScrollBlocks()
|
||||||
|
{
|
||||||
|
// ShowPosition = in letters
|
||||||
|
// GetScrollPos = number of lines from the top
|
||||||
|
// GetLineLength = letters in one line
|
||||||
|
// SetScrollPos = only set the scrollbar, doesn't update the text,
|
||||||
|
// Update() or Refresh() doesn't help
|
||||||
|
|
||||||
|
double pos = m_bl95->GetScrollPos(wxVERTICAL)*(m_bl95->GetLineLength(0)+12.95); // annoying :(
|
||||||
|
m_bl0->ShowPosition((int)pos);
|
||||||
|
|
||||||
|
/*
|
||||||
|
if(GetAsyncKeyState(VK_NUMPAD1))
|
||||||
|
A -= 0.1;
|
||||||
|
else if(GetAsyncKeyState(VK_NUMPAD2))
|
||||||
|
A += 0.11;
|
||||||
|
|
||||||
|
wprintf("GetScrollPos:%i GetScrollRange:%i GetPosition:%i GetLastPosition:%i GetMaxWidth:%i \
|
||||||
|
GetLineLength:%i XYToPosition:%i\n \
|
||||||
|
GetScrollPos * GetLineLength + GetScrollRange:%i A:%f\n",
|
||||||
|
m_bl95->GetScrollPos(wxVERTICAL), m_bl95->GetScrollRange(wxVERTICAL),
|
||||||
|
m_bl95->GetPosition().y, m_bl95->GetLastPosition(), m_bl95->GetMaxWidth(),
|
||||||
|
m_bl95->GetLineLength(0), m_bl95->XYToPosition(0,25),
|
||||||
|
pos, A
|
||||||
|
);
|
||||||
|
|
||||||
|
for (int i = 0; i < 127; ++i)
|
||||||
|
{
|
||||||
|
m_bl0->AppendText(wxString::Format("%02i|68 : 01a70144\n", i));
|
||||||
|
m_bl95->AppendText(wxString::Format("%i Mouse\n", i));
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDebugger::ScrollBlocksMouse(wxMouseEvent& event)
|
||||||
|
{
|
||||||
|
DoScrollBlocks();
|
||||||
|
event.Skip(); // otherwise we remove the regular behavior, for example scrolling
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDebugger::ScrollBlocksCursor(wxScrollWinEvent& event)
|
||||||
|
{
|
||||||
|
DoScrollBlocks();
|
||||||
|
event.Skip(); // otherwise we remove the regular behavior, for example scrolling
|
||||||
|
}
|
||||||
|
// ==============
|
|
@ -44,7 +44,6 @@ bool gSSBMremedy2 = true;
|
||||||
bool gSequenced = true;
|
bool gSequenced = true;
|
||||||
bool gVolume = true;
|
bool gVolume = true;
|
||||||
bool gReset = false;
|
bool gReset = false;
|
||||||
extern std::vector<std::string> sMailLog, sMailTime;
|
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
// =======================================================================================
|
||||||
|
@ -527,6 +526,9 @@ SetTitle(wxT("Sound Debugging"));
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========================================================================
|
||||||
|
// System functions
|
||||||
|
// --------------
|
||||||
void CDebugger::OnClose(wxCloseEvent& /*event*/)
|
void CDebugger::OnClose(wxCloseEvent& /*event*/)
|
||||||
{
|
{
|
||||||
// save the window position when we hide the window to
|
// save the window position when we hide the window to
|
||||||
|
@ -536,16 +538,26 @@ void CDebugger::OnClose(wxCloseEvent& /*event*/)
|
||||||
file.Save(DEBUGGER_CONFIG_FILE);
|
file.Save(DEBUGGER_CONFIG_FILE);
|
||||||
|
|
||||||
EndModal(0);
|
EndModal(0);
|
||||||
|
CloseConsole(); // Take the console window with it
|
||||||
|
}
|
||||||
|
|
||||||
// I turned this off for now because of the ShowModal() problem and because I wanted
|
void CDebugger::DoHide()
|
||||||
// to look at the logs at the same time as the console window.
|
{
|
||||||
//CloseConsole();
|
Hide();
|
||||||
|
CloseConsole(); // The console goes with the wx window
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDebugger::DoShow()
|
||||||
|
{
|
||||||
|
Show();
|
||||||
|
DoShowHideConsole(); // The console goes with the wx window
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDebugger::OnUpdate(wxCommandEvent& /*event*/)
|
void CDebugger::OnUpdate(wxCommandEvent& /*event*/)
|
||||||
{
|
{
|
||||||
this->NotifyUpdate();
|
this->NotifyUpdate();
|
||||||
}
|
}
|
||||||
|
// ===============
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
// =======================================================================================
|
||||||
|
@ -661,14 +673,10 @@ void CDebugger::ShowHideConsole(wxCommandEvent& event)
|
||||||
void CDebugger::DoShowHideConsole()
|
void CDebugger::DoShowHideConsole()
|
||||||
{
|
{
|
||||||
if(m_options->IsChecked(3))
|
if(m_options->IsChecked(3))
|
||||||
{
|
|
||||||
OpenConsole();
|
OpenConsole();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
CloseConsole();
|
CloseConsole();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// ==============
|
// ==============
|
||||||
|
|
||||||
|
|
||||||
|
@ -680,298 +688,3 @@ void CDebugger::NotifyUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
|
||||||
// Update mail window
|
|
||||||
// --------------
|
|
||||||
void CDebugger::DoUpdateMail()
|
|
||||||
{
|
|
||||||
//wprintf("i %i %i\n", sFullMail.size(), sMailLog.size());
|
|
||||||
|
|
||||||
if(sFullMail.size() > 0 && sMailLog.size() > 0)
|
|
||||||
{
|
|
||||||
m_log->SetValue(wxString::FromAscii(sFullMail.at(m_RadioBox[3]->GetSelection()).c_str()));
|
|
||||||
m_log->SetDefaultStyle(wxTextAttr(*wxBLUE)); // doesn't work because of the current wx
|
|
||||||
|
|
||||||
m_log1->SetValue(wxString::FromAscii(sMailLog.at(m_RadioBox[3]->GetSelection()).c_str()));
|
|
||||||
m_log1->AppendText(wxT("\n\n"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CDebugger::UpdateMail(wxNotebookEvent& event)
|
|
||||||
{
|
|
||||||
DoUpdateMail();
|
|
||||||
if(StoreMails) ReadDir();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change mail from radio button change
|
|
||||||
void CDebugger::ChangeMail(wxCommandEvent& event)
|
|
||||||
{
|
|
||||||
//wprintf("abc");
|
|
||||||
DoUpdateMail();
|
|
||||||
//if(StoreMails) ReadDir();
|
|
||||||
}
|
|
||||||
// ==============
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
|
||||||
// Read out mails from dir
|
|
||||||
// --------------
|
|
||||||
void CDebugger::ReadDir()
|
|
||||||
{
|
|
||||||
CFileSearch::XStringVector Directories;
|
|
||||||
//Directories.push_back("Logs/Mail");
|
|
||||||
Directories.push_back(FULL_MAIL_LOGS_DIR);
|
|
||||||
|
|
||||||
CFileSearch::XStringVector Extensions;
|
|
||||||
Extensions.push_back("*.log");
|
|
||||||
|
|
||||||
CFileSearch FileSearch(Extensions, Directories);
|
|
||||||
const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames();
|
|
||||||
|
|
||||||
//m_gc->Show(false);
|
|
||||||
//m_gc->Append(wxT("SSBM ffffix"));
|
|
||||||
//m_gc->Show(true);
|
|
||||||
|
|
||||||
// Clear in case we already did this earlier
|
|
||||||
all_all_files.clear();
|
|
||||||
|
|
||||||
if (rFilenames.size() > 0 && m_gc && m_wii)
|
|
||||||
{
|
|
||||||
for (u32 i = 0; i < rFilenames.size(); i++)
|
|
||||||
{
|
|
||||||
std::string FileName;
|
|
||||||
SplitPath(rFilenames[i], NULL, &FileName, NULL); // place the filename in FileName
|
|
||||||
|
|
||||||
//std::string FileName = StripSpaces(*FileName);
|
|
||||||
std::vector<std::string> pieces;
|
|
||||||
SplitString(FileName, "_sep", pieces); // split string
|
|
||||||
|
|
||||||
// Save all filenames heres
|
|
||||||
if(pieces[2] == "0") all_all_files.push_back(pieces[0]);
|
|
||||||
|
|
||||||
// Cut to size
|
|
||||||
std::string cut;
|
|
||||||
if(pieces[0].length() > 18)
|
|
||||||
cut = pieces[0].substr(0, 18) + "...";
|
|
||||||
else
|
|
||||||
cut = pieces[0];
|
|
||||||
|
|
||||||
//wprintf("%s %s %s\n", pieces[0].c_str(), pieces[1].c_str(),
|
|
||||||
// pieces[2].c_str(), pieces[3].c_str());
|
|
||||||
|
|
||||||
if (NoDuplicate(pieces[0]) && pieces.size() >= 3)
|
|
||||||
{
|
|
||||||
all_files.push_back(pieces[0]);
|
|
||||||
if (pieces[3] == "GC")
|
|
||||||
{
|
|
||||||
gc_files.push_back(pieces[0]);
|
|
||||||
m_gc->Append(wxString::FromAscii(cut.c_str()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wii_files.push_back(pieces[0]);
|
|
||||||
m_wii->Append(wxString::FromAscii(cut.c_str()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
|
||||||
// Check for duplicates and count files from all_all_files
|
|
||||||
// --------------
|
|
||||||
bool CDebugger::NoDuplicate(std::string FileName)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < all_files.size(); i++)
|
|
||||||
{
|
|
||||||
if(all_files.at(i) == FileName)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Count the number of files for each game
|
|
||||||
int CDebugger::CountFiles(std::string FileName)
|
|
||||||
{
|
|
||||||
int match = 0;
|
|
||||||
|
|
||||||
for (u32 i = 0; i < all_all_files.size(); i++)
|
|
||||||
{
|
|
||||||
//wprintf("CountFiles %i %s\n", i, all_all_files[i].c_str());
|
|
||||||
if(all_all_files[i] == FileName)
|
|
||||||
match++;
|
|
||||||
}
|
|
||||||
//wprintf("We found %i files for this game\n", match);
|
|
||||||
return match;
|
|
||||||
}
|
|
||||||
// ==============
|
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
|
||||||
// Read file from harddrive
|
|
||||||
// --------------
|
|
||||||
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
|
|
||||||
else
|
|
||||||
return "";
|
|
||||||
|
|
||||||
if(file == NULL)
|
|
||||||
{
|
|
||||||
// file could not be opened
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
while(1) // looping through file
|
|
||||||
{
|
|
||||||
c = fgetc(file);
|
|
||||||
|
|
||||||
if(c != EOF)
|
|
||||||
sz += c; // print the file one character at a time
|
|
||||||
else
|
|
||||||
break; // break when EOF is reached
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
std::ifstream file;
|
|
||||||
for (int i = 0; i < m_RadioBox[3]->GetCount(); i++)
|
|
||||||
{
|
|
||||||
if(m_RadioBox[3]->IsItemEnabled(i)) curr_n++;
|
|
||||||
m_RadioBox[3]->Enable(i, false); // disable all
|
|
||||||
}
|
|
||||||
//wprintf("Disabled all: n %i\n", n);
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < n; i++)
|
|
||||||
{
|
|
||||||
m_RadioBox[3]->Enable(i, true); // then anble the right ones
|
|
||||||
//wprintf("m_RadioBox[3] enabled: %i\n", i);
|
|
||||||
|
|
||||||
std::string sz = "";
|
|
||||||
std::ostringstream ci;
|
|
||||||
ci << i;
|
|
||||||
std::string f0 = FULL_MAIL_LOGS_DIR + FileName + "_sep" + ci.str() + "_sep" + "0_sep" + (GC ? "GC" : "Wii") + "_sep.log";
|
|
||||||
std::string f1 = FULL_MAIL_LOGS_DIR + FileName + "_sep" + ci.str() + "_sep" + "1_sep" + (GC ? "GC" : "Wii") + "_sep.log";
|
|
||||||
|
|
||||||
//wprintf("ifstream %s %s\n", f0.c_str(), f1.c_str());
|
|
||||||
|
|
||||||
if(sFullMail.size() <= i) sFullMail.resize(sFullMail.size() + 1);
|
|
||||||
if(sMailLog.size() <= i) sMailLog.resize(sMailLog.size() + 1);
|
|
||||||
|
|
||||||
if(Readfile_(f0).length() > 0) sFullMail.at(i) = Readfile_(f0);
|
|
||||||
else sFullMail.at(i) = "";
|
|
||||||
if(Readfile_(f1).length() > 0) sMailLog.at(i) = Readfile_(f1);
|
|
||||||
else sMailLog.at(i) = "";
|
|
||||||
}
|
|
||||||
if(n < curr_n) m_RadioBox[3]->Select(n - 1);
|
|
||||||
//wprintf("Select: %i | n %i curr_n %i\n", n - 1, n, curr_n);
|
|
||||||
DoUpdateMail();
|
|
||||||
}
|
|
||||||
// ==============
|
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
|
||||||
// Read the file to the text window
|
|
||||||
// ---------------
|
|
||||||
void CDebugger::OnGameChange(wxCommandEvent& event)
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Settings
|
|
||||||
void CDebugger::MailSettings(wxCommandEvent& event)
|
|
||||||
{
|
|
||||||
//for (int i = 0; i < all_all_files.size(); ++i)
|
|
||||||
//wprintf("s: %s \n", all_all_files.at(i).c_str());
|
|
||||||
|
|
||||||
ScanMails = m_gcwiiset->IsChecked(0);
|
|
||||||
StoreMails = m_gcwiiset->IsChecked(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//double A;
|
|
||||||
void CDebugger::DoScrollBlocks()
|
|
||||||
{
|
|
||||||
// ShowPosition = in letters
|
|
||||||
// GetScrollPos = number of lines from the top
|
|
||||||
// GetLineLength = letters in one line
|
|
||||||
// SetScrollPos = only set the scrollbar, doesn't update the text,
|
|
||||||
// Update() or Refresh() doesn't help
|
|
||||||
|
|
||||||
double pos = m_bl95->GetScrollPos(wxVERTICAL)*(m_bl95->GetLineLength(0)+12.95); // annoying :(
|
|
||||||
m_bl0->ShowPosition((int)pos);
|
|
||||||
|
|
||||||
/*
|
|
||||||
if(GetAsyncKeyState(VK_NUMPAD1))
|
|
||||||
A -= 0.1;
|
|
||||||
else if(GetAsyncKeyState(VK_NUMPAD2))
|
|
||||||
A += 0.11;
|
|
||||||
|
|
||||||
wprintf("GetScrollPos:%i GetScrollRange:%i GetPosition:%i GetLastPosition:%i GetMaxWidth:%i \
|
|
||||||
GetLineLength:%i XYToPosition:%i\n \
|
|
||||||
GetScrollPos * GetLineLength + GetScrollRange:%i A:%f\n",
|
|
||||||
m_bl95->GetScrollPos(wxVERTICAL), m_bl95->GetScrollRange(wxVERTICAL),
|
|
||||||
m_bl95->GetPosition().y, m_bl95->GetLastPosition(), m_bl95->GetMaxWidth(),
|
|
||||||
m_bl95->GetLineLength(0), m_bl95->XYToPosition(0,25),
|
|
||||||
pos, A
|
|
||||||
);
|
|
||||||
|
|
||||||
for (int i = 0; i < 127; ++i)
|
|
||||||
{
|
|
||||||
m_bl0->AppendText(wxString::Format("%02i|68 : 01a70144\n", i));
|
|
||||||
m_bl95->AppendText(wxString::Format("%i Mouse\n", i));
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugger::ScrollBlocksMouse(wxMouseEvent& event)
|
|
||||||
{
|
|
||||||
DoScrollBlocks();
|
|
||||||
event.Skip(); // otherwise we remove the regular behavior, for example scrolling
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugger::ScrollBlocksCursor(wxScrollWinEvent& event)
|
|
||||||
{
|
|
||||||
DoScrollBlocks();
|
|
||||||
event.Skip(); // otherwise we remove the regular behavior, for example scrolling
|
|
||||||
}
|
|
||||||
// ==============
|
|
||||||
|
|
|
@ -69,6 +69,7 @@ class CDebugger : public wxDialog
|
||||||
|
|
||||||
void Save(IniFile& _IniFile) const;
|
void Save(IniFile& _IniFile) const;
|
||||||
void Load(IniFile& _IniFile);
|
void Load(IniFile& _IniFile);
|
||||||
|
void DoHide(); void DoShow();
|
||||||
|
|
||||||
void NotifyUpdate();
|
void NotifyUpdate();
|
||||||
void OnUpdate(wxCommandEvent& event);
|
void OnUpdate(wxCommandEvent& event);
|
||||||
|
|
|
@ -0,0 +1,288 @@
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Licensetype: GNU General Public License (GPL)
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, version 2.0.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License 2.0 for more details.
|
||||||
|
//
|
||||||
|
// A copy of the GPL 2.0 should have been included with the program.
|
||||||
|
// If not, see http://www.gnu.org/licenses/
|
||||||
|
//
|
||||||
|
// Official SVN repository and contact information can be found at
|
||||||
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// includes
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "Debugger.h"
|
||||||
|
#include "PBView.h"
|
||||||
|
#include "IniFile.h"
|
||||||
|
#include "FileUtil.h"
|
||||||
|
#include "StringUtil.h"
|
||||||
|
#include "FileSearch.h"
|
||||||
|
#include "../Logging/Console.h" // open and close console
|
||||||
|
|
||||||
|
extern std::vector<std::string> sMailLog, sMailTime;
|
||||||
|
|
||||||
|
|
||||||
|
// =======================================================================================
|
||||||
|
// Update mail window
|
||||||
|
// --------------
|
||||||
|
void CDebugger::DoUpdateMail()
|
||||||
|
{
|
||||||
|
//wprintf("i %i %i\n", sFullMail.size(), sMailLog.size());
|
||||||
|
|
||||||
|
if(sFullMail.size() > 0 && sMailLog.size() > 0)
|
||||||
|
{
|
||||||
|
m_log->SetValue(wxString::FromAscii(sFullMail.at(m_RadioBox[3]->GetSelection()).c_str()));
|
||||||
|
m_log->SetDefaultStyle(wxTextAttr(*wxBLUE)); // doesn't work because of the current wx
|
||||||
|
|
||||||
|
m_log1->SetValue(wxString::FromAscii(sMailLog.at(m_RadioBox[3]->GetSelection()).c_str()));
|
||||||
|
m_log1->AppendText(wxT("\n\n"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CDebugger::UpdateMail(wxNotebookEvent& event)
|
||||||
|
{
|
||||||
|
DoUpdateMail();
|
||||||
|
if(StoreMails) ReadDir();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Change mail from radio button change
|
||||||
|
void CDebugger::ChangeMail(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
//wprintf("abc");
|
||||||
|
DoUpdateMail();
|
||||||
|
//if(StoreMails) ReadDir();
|
||||||
|
}
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// =======================================================================================
|
||||||
|
// Read out mails from dir
|
||||||
|
// --------------
|
||||||
|
void CDebugger::ReadDir()
|
||||||
|
{
|
||||||
|
CFileSearch::XStringVector Directories;
|
||||||
|
//Directories.push_back("Logs/Mail");
|
||||||
|
Directories.push_back(FULL_MAIL_LOGS_DIR);
|
||||||
|
|
||||||
|
CFileSearch::XStringVector Extensions;
|
||||||
|
Extensions.push_back("*.log");
|
||||||
|
|
||||||
|
CFileSearch FileSearch(Extensions, Directories);
|
||||||
|
const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames();
|
||||||
|
|
||||||
|
//m_gc->Show(false);
|
||||||
|
//m_gc->Append(wxT("SSBM ffffix"));
|
||||||
|
//m_gc->Show(true);
|
||||||
|
|
||||||
|
// Clear in case we already did this earlier
|
||||||
|
all_all_files.clear();
|
||||||
|
|
||||||
|
if (rFilenames.size() > 0 && m_gc && m_wii)
|
||||||
|
{
|
||||||
|
for (u32 i = 0; i < rFilenames.size(); i++)
|
||||||
|
{
|
||||||
|
std::string FileName;
|
||||||
|
SplitPath(rFilenames[i], NULL, &FileName, NULL); // place the filename in FileName
|
||||||
|
|
||||||
|
//std::string FileName = StripSpaces(*FileName);
|
||||||
|
std::vector<std::string> pieces;
|
||||||
|
SplitString(FileName, "_sep", pieces); // split string
|
||||||
|
|
||||||
|
// Save all filenames heres
|
||||||
|
if(pieces[2] == "0") all_all_files.push_back(pieces[0]);
|
||||||
|
|
||||||
|
// Cut to size
|
||||||
|
std::string cut;
|
||||||
|
if(pieces[0].length() > 18)
|
||||||
|
cut = pieces[0].substr(0, 18) + "...";
|
||||||
|
else
|
||||||
|
cut = pieces[0];
|
||||||
|
|
||||||
|
//wprintf("%s %s %s\n", pieces[0].c_str(), pieces[1].c_str(),
|
||||||
|
// pieces[2].c_str(), pieces[3].c_str());
|
||||||
|
|
||||||
|
if (NoDuplicate(pieces[0]) && pieces.size() >= 3)
|
||||||
|
{
|
||||||
|
all_files.push_back(pieces[0]);
|
||||||
|
if (pieces[3] == "GC")
|
||||||
|
{
|
||||||
|
gc_files.push_back(pieces[0]);
|
||||||
|
m_gc->Append(wxString::FromAscii(cut.c_str()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wii_files.push_back(pieces[0]);
|
||||||
|
m_wii->Append(wxString::FromAscii(cut.c_str()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// =======================================================================================
|
||||||
|
// Check for duplicates and count files from all_all_files
|
||||||
|
// --------------
|
||||||
|
bool CDebugger::NoDuplicate(std::string FileName)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < all_files.size(); i++)
|
||||||
|
{
|
||||||
|
if(all_files.at(i) == FileName)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count the number of files for each game
|
||||||
|
int CDebugger::CountFiles(std::string FileName)
|
||||||
|
{
|
||||||
|
int match = 0;
|
||||||
|
|
||||||
|
for (u32 i = 0; i < all_all_files.size(); i++)
|
||||||
|
{
|
||||||
|
//wprintf("CountFiles %i %s\n", i, all_all_files[i].c_str());
|
||||||
|
if(all_all_files[i] == FileName)
|
||||||
|
match++;
|
||||||
|
}
|
||||||
|
//wprintf("We found %i files for this game\n", match);
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
|
||||||
|
// =======================================================================================
|
||||||
|
// Read file from harddrive
|
||||||
|
// --------------
|
||||||
|
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
|
||||||
|
else
|
||||||
|
return "";
|
||||||
|
|
||||||
|
if(file == NULL)
|
||||||
|
{
|
||||||
|
// file could not be opened
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while(1) // looping through file
|
||||||
|
{
|
||||||
|
c = fgetc(file);
|
||||||
|
|
||||||
|
if(c != EOF)
|
||||||
|
sz += c; // print the file one character at a time
|
||||||
|
else
|
||||||
|
break; // break when EOF is reached
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
std::ifstream file;
|
||||||
|
for (int i = 0; i < m_RadioBox[3]->GetCount(); i++)
|
||||||
|
{
|
||||||
|
if(m_RadioBox[3]->IsItemEnabled(i)) curr_n++;
|
||||||
|
m_RadioBox[3]->Enable(i, false); // disable all
|
||||||
|
}
|
||||||
|
//wprintf("Disabled all: n %i\n", n);
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < n; i++)
|
||||||
|
{
|
||||||
|
m_RadioBox[3]->Enable(i, true); // then anble the right ones
|
||||||
|
//wprintf("m_RadioBox[3] enabled: %i\n", i);
|
||||||
|
|
||||||
|
std::string sz = "";
|
||||||
|
std::ostringstream ci;
|
||||||
|
ci << i;
|
||||||
|
std::string f0 = FULL_MAIL_LOGS_DIR + FileName + "_sep" + ci.str() + "_sep" + "0_sep" + (GC ? "GC" : "Wii") + "_sep.log";
|
||||||
|
std::string f1 = FULL_MAIL_LOGS_DIR + FileName + "_sep" + ci.str() + "_sep" + "1_sep" + (GC ? "GC" : "Wii") + "_sep.log";
|
||||||
|
|
||||||
|
//wprintf("ifstream %s %s\n", f0.c_str(), f1.c_str());
|
||||||
|
|
||||||
|
if(sFullMail.size() <= i) sFullMail.resize(sFullMail.size() + 1);
|
||||||
|
if(sMailLog.size() <= i) sMailLog.resize(sMailLog.size() + 1);
|
||||||
|
|
||||||
|
if(Readfile_(f0).length() > 0) sFullMail.at(i) = Readfile_(f0);
|
||||||
|
else sFullMail.at(i) = "";
|
||||||
|
if(Readfile_(f1).length() > 0) sMailLog.at(i) = Readfile_(f1);
|
||||||
|
else sMailLog.at(i) = "";
|
||||||
|
}
|
||||||
|
if(n < curr_n) m_RadioBox[3]->Select(n - 1);
|
||||||
|
//wprintf("Select: %i | n %i curr_n %i\n", n - 1, n, curr_n);
|
||||||
|
DoUpdateMail();
|
||||||
|
}
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
|
||||||
|
// =======================================================================================
|
||||||
|
// Read the file to the text window
|
||||||
|
// ---------------
|
||||||
|
void CDebugger::OnGameChange(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Settings
|
||||||
|
void CDebugger::MailSettings(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
//for (int i = 0; i < all_all_files.size(); ++i)
|
||||||
|
//wprintf("s: %s \n", all_all_files.at(i).c_str());
|
||||||
|
|
||||||
|
ScanMails = m_gcwiiset->IsChecked(0);
|
||||||
|
StoreMails = m_gcwiiset->IsChecked(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ void DllDebugger(HWND _hParent, bool Show)
|
||||||
{
|
{
|
||||||
if(m_frame && Show) // if we have created it, let us show it again
|
if(m_frame && Show) // if we have created it, let us show it again
|
||||||
{
|
{
|
||||||
m_frame->Show();
|
m_frame->DoShow();
|
||||||
}
|
}
|
||||||
else if(!m_frame && Show)
|
else if(!m_frame && Show)
|
||||||
{
|
{
|
||||||
|
@ -163,7 +163,7 @@ void DllDebugger(HWND _hParent, bool Show)
|
||||||
}
|
}
|
||||||
else if(m_frame && !Show)
|
else if(m_frame && !Show)
|
||||||
{
|
{
|
||||||
m_frame->Hide();
|
m_frame->DoHide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ===================
|
// ===================
|
||||||
|
|
|
@ -369,7 +369,7 @@ void BPWritten(int addr, int changes, int newval)
|
||||||
if (changes) {
|
if (changes) {
|
||||||
VertexManager::Flush();
|
VertexManager::Flush();
|
||||||
((u32*)&bpmem)[addr] = newval;
|
((u32*)&bpmem)[addr] = newval;
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
const char* pzop[] = {"DISABLE", "ADD", "REPLACE", "?"};
|
const char* pzop[] = {"DISABLE", "ADD", "REPLACE", "?"};
|
||||||
const char* pztype[] = {"Z8", "Z16", "Z24", "?"};
|
const char* pztype[] = {"Z8", "Z16", "Z24", "?"};
|
||||||
PRIM_LOG("ztex op=%s, type=%s\n", pzop[bpmem.ztex2.op], pztype[bpmem.ztex2.type]);
|
PRIM_LOG("ztex op=%s, type=%s\n", pzop[bpmem.ztex2.op], pztype[bpmem.ztex2.type]);
|
||||||
|
|
|
@ -54,7 +54,6 @@ void Config::Load()
|
||||||
iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
|
iniFile.Get("Settings", "DLOptimize", &iCompileDLsLevel, 0);
|
||||||
iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
|
iniFile.Get("Settings", "DumpTextures", &bDumpTextures, 0);
|
||||||
iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
|
iniFile.Get("Settings", "ShowShaderErrors", &bShowShaderErrors, 0);
|
||||||
iniFile.Get("Settings", "LogLevel", &iLog, 0);
|
|
||||||
iniFile.Get("Settings", "Multisample", &iMultisampleMode, 0);
|
iniFile.Get("Settings", "Multisample", &iMultisampleMode, 0);
|
||||||
if(iMultisampleMode == 0)
|
if(iMultisampleMode == 0)
|
||||||
iMultisampleMode = 1;
|
iMultisampleMode = 1;
|
||||||
|
@ -100,7 +99,6 @@ void Config::Save()
|
||||||
iniFile.Set("Settings", "DLOptimize", iCompileDLsLevel);
|
iniFile.Set("Settings", "DLOptimize", iCompileDLsLevel);
|
||||||
iniFile.Set("Settings", "DumpTextures", bDumpTextures);
|
iniFile.Set("Settings", "DumpTextures", bDumpTextures);
|
||||||
iniFile.Set("Settings", "ShowShaderErrors", bShowShaderErrors);
|
iniFile.Set("Settings", "ShowShaderErrors", bShowShaderErrors);
|
||||||
iniFile.Set("Settings", "LogLevel", iLog);
|
|
||||||
iniFile.Set("Settings", "Multisample", iMultisampleMode);
|
iniFile.Set("Settings", "Multisample", iMultisampleMode);
|
||||||
iniFile.Set("Settings", "TexDumpPath", texDumpPath);
|
iniFile.Set("Settings", "TexDumpPath", texDumpPath);
|
||||||
iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
|
iniFile.Set("Settings", "TexFmtOverlayEnable", bTexFmtOverlayEnable);
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#ifndef _CONFIG_H
|
#ifndef _CONFIG_H
|
||||||
#define _CONFIG_H
|
#define _CONFIG_H
|
||||||
|
|
||||||
|
// Log in two categories, andsave three other options in the same byte
|
||||||
#define CONF_LOG 1
|
#define CONF_LOG 1
|
||||||
#define CONF_PRIMLOG 2
|
#define CONF_PRIMLOG 2
|
||||||
#define CONF_SAVETEXTURES 4
|
#define CONF_SAVETEXTURES 4
|
||||||
|
|
|
@ -16,14 +16,17 @@
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
#include "../Globals.h"
|
#include "../Globals.h"
|
||||||
|
|
||||||
|
#include "IniFile.h" // Common files
|
||||||
|
|
||||||
|
#include "Config.h" // Config settings
|
||||||
|
|
||||||
|
#include "PBView.h" // Debugger files
|
||||||
#include "Debugger.h"
|
#include "Debugger.h"
|
||||||
#include "PBView.h"
|
|
||||||
#include "IniFile.h"
|
|
||||||
#include "../Logging/Console.h" // open and close console
|
#include "../Logging/Console.h" // open and close console
|
||||||
|
|
||||||
// externals
|
// externals
|
||||||
extern int gSaveFile; // make this an int to allow multiple save file options
|
extern int gSaveFile; // make this an int to allow multiple save file options
|
||||||
extern int gUpdFreq;
|
|
||||||
extern int gPreset;
|
extern int gPreset;
|
||||||
int A, B;
|
int A, B;
|
||||||
|
|
||||||
|
@ -34,10 +37,11 @@ BEGIN_EVENT_TABLE(CDebugger,wxDialog)
|
||||||
EVT_SHOW(CDebugger::OnShow)
|
EVT_SHOW(CDebugger::OnShow)
|
||||||
EVT_CLOSE(CDebugger::OnClose)
|
EVT_CLOSE(CDebugger::OnClose)
|
||||||
EVT_BUTTON(ID_UPD,CDebugger::OnUpdate)
|
EVT_BUTTON(ID_UPD,CDebugger::OnUpdate)
|
||||||
EVT_CHECKBOX(IDC_CHECK0,CDebugger::SaveFile)
|
|
||||||
EVT_CHECKBOX(IDC_CHECK2,CDebugger::ShowHideConsole)
|
EVT_CHECKBOX(ID_SAVETOFILE,CDebugger::GeneralSettings) // General settings
|
||||||
EVT_RADIOBOX(IDC_RADIO1,CDebugger::ChangeFrequency)
|
EVT_CHECKBOX(ID_SHOWCONSOLE,CDebugger::GeneralSettings)
|
||||||
EVT_RADIOBOX(IDC_RADIO2,CDebugger::ChangePreset)
|
EVT_CHECKLISTBOX(ID_CHECKLIST1, CDebugger::LogSettings) // Check list box
|
||||||
|
EVT_RADIOBOX(IDC_RADIO1, CDebugger::ChangeFrequency) // Update freq.
|
||||||
|
|
||||||
EVT_BUTTON(ID_AP,CDebugger::Ap)
|
EVT_BUTTON(ID_AP,CDebugger::Ap)
|
||||||
EVT_BUTTON(ID_AM,CDebugger::Am)
|
EVT_BUTTON(ID_AM,CDebugger::Am)
|
||||||
|
@ -85,6 +89,7 @@ void CDebugger::Save(IniFile& _IniFile) const
|
||||||
}
|
}
|
||||||
_IniFile.Set("VideoWindow", "Console", m_Check[2]->IsChecked()); // save settings
|
_IniFile.Set("VideoWindow", "Console", m_Check[2]->IsChecked()); // save settings
|
||||||
_IniFile.Set("VideoWindow", "UpdateFrequency", m_RadioBox[1]->GetSelection());
|
_IniFile.Set("VideoWindow", "UpdateFrequency", m_RadioBox[1]->GetSelection());
|
||||||
|
_IniFile.Set("VideoWindow", "LogLevel", g_Config.iLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,27 +108,24 @@ void CDebugger::Load(IniFile& _IniFile)
|
||||||
m_Check[2]->SetValue(Console);
|
m_Check[2]->SetValue(Console);
|
||||||
DoShowHideConsole();
|
DoShowHideConsole();
|
||||||
|
|
||||||
int UpdateFrequency;
|
_IniFile.Get("VideoWindow", "UpdateFrequency", &gUpdFreq, m_RadioBox[1]->GetSelection());
|
||||||
_IniFile.Get("VideoWindow", "UpdateFrequency", &UpdateFrequency, m_RadioBox[1]->GetSelection());
|
m_RadioBox[1]->SetSelection(gUpdFreq);
|
||||||
m_RadioBox[1]->SetSelection(UpdateFrequency);
|
|
||||||
DoChangeFrequency();
|
DoChangeFrequency();
|
||||||
|
|
||||||
|
_IniFile.Get("VideoWindow", "LogLevel", &g_Config.iLog, 0);
|
||||||
|
m_settings->Check(g_Config.iLog - 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDebugger::CreateGUIControls()
|
void CDebugger::CreateGUIControls()
|
||||||
{
|
{
|
||||||
|
// Basic settings
|
||||||
SetTitle(wxT("OpenGL Debugging"));
|
SetTitle(wxT("OpenGL Debugging"));
|
||||||
|
|
||||||
// basic settings
|
|
||||||
SetIcon(wxNullIcon);
|
SetIcon(wxNullIcon);
|
||||||
SetSize(8, 8, 200, 100); // these will become the minimin sizes allowed by resizing
|
SetSize(8, 8, 200, 100); // these will become the minimin sizes allowed by resizing
|
||||||
Center();
|
Center();
|
||||||
|
|
||||||
// the big window
|
// Declarations
|
||||||
m_GPRListView = new CPBView(this, ID_GPR, wxDefaultPosition, GetSize(),
|
wxBoxSizer *sMain, *sGeneral;
|
||||||
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING);
|
|
||||||
|
|
||||||
// declarations
|
|
||||||
wxBoxSizer* sMain;
|
|
||||||
wxButton* m_Upd;
|
wxButton* m_Upd;
|
||||||
wxButton* m_Ap; wxButton* m_Am;
|
wxButton* m_Ap; wxButton* m_Am;
|
||||||
wxButton* m_Bp; wxButton* m_Bm;
|
wxButton* m_Bp; wxButton* m_Bm;
|
||||||
|
@ -131,134 +133,173 @@ void CDebugger::CreateGUIControls()
|
||||||
wxStaticBoxSizer* sLeft;
|
wxStaticBoxSizer* sLeft;
|
||||||
|
|
||||||
|
|
||||||
// buttons -----------------------------------------------------
|
// Notebook -----------------------------------------------------
|
||||||
m_Upd = new wxButton(this, ID_UPD, wxT("Update"),
|
m_Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
|
||||||
|
m_PageMain = new wxPanel(m_Notebook, ID_PAGEMAIN, wxDefaultPosition, wxDefaultSize);
|
||||||
|
m_Notebook->AddPage(m_PageMain, wxT("Main"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ===================================================================
|
||||||
|
// Main Page
|
||||||
|
|
||||||
|
|
||||||
|
// Buttons -----------------------------------------------------
|
||||||
|
wxStaticBoxSizer * m_updSizer = new wxStaticBoxSizer (wxVERTICAL, m_PageMain, wxT("Update"));
|
||||||
|
m_Upd = new wxButton(m_PageMain, ID_UPD, wxT("Update"),
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
m_Ap = new wxButton(this, ID_AP, wxT("A +"),
|
m_updSizer->Add(m_Upd, 0, 0, 5);
|
||||||
|
// ------------------------
|
||||||
|
|
||||||
|
|
||||||
|
// Variables -----------------------------------------------------
|
||||||
|
wxStaticBoxSizer * m_buttonSizer = new wxStaticBoxSizer (wxVERTICAL, m_PageMain, wxT("Variables"));
|
||||||
|
m_Ap = new wxButton(m_PageMain, ID_AP, wxT("A +"),
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
//m_SelC->Enable(false);
|
//m_SelC->Enable(false);
|
||||||
m_Am = new wxButton(this, ID_AM, wxT("A -"),
|
m_Am = new wxButton(m_PageMain, ID_AM, wxT("A -"),
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
//m_Presets->Enable(false);
|
//m_Presets->Enable(false);
|
||||||
m_Bp = new wxButton(this, ID_BP, wxT("B +"),
|
m_Bp = new wxButton(m_PageMain, ID_BP, wxT("B +"),
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
m_Bm = new wxButton(this, ID_BM, wxT("B -"),
|
m_Bm = new wxButton(m_PageMain, ID_BM, wxT("B -"),
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
|
||||||
|
m_buttonSizer->Add(m_Ap, 0, 0, 5);
|
||||||
// checkboxes and labels -----------------------------------------------------
|
m_buttonSizer->Add(m_Am, 0, 0, 5);
|
||||||
m_Label[0] = new wxStaticBox(this, IDG_LABEL1, wxT("Options"),
|
m_buttonSizer->Add(m_Bp, 0, 0, 5);
|
||||||
wxDefaultPosition, wxDefaultSize, 0);
|
m_buttonSizer->Add(m_Bm, 0, 0, 5);
|
||||||
wxStaticBoxSizer * m_checkSizer = new wxStaticBoxSizer (m_Label[0], wxVERTICAL);
|
|
||||||
|
|
||||||
// checkboxes
|
|
||||||
m_Check[0] = new wxCheckBox(this, IDC_CHECK0, wxT("Save to file"),
|
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
|
||||||
m_Check[1] = new wxCheckBox(this, IDC_CHECK1, wxT("A +"),
|
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
|
||||||
m_Check[1]->Enable(false);
|
|
||||||
m_Check[7] = new wxCheckBox(this, IDC_CHECK7, wxT("A -"),
|
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
|
||||||
m_Check[7]->Enable(false);
|
|
||||||
m_Check[2] = new wxCheckBox(this, IDC_CHECK2, wxT("Show console"),
|
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
|
||||||
|
|
||||||
m_checkSizer->Add(m_Check[0], 0, 0, 5);
|
|
||||||
m_checkSizer->Add(m_Check[1], 0, 0, 5);
|
|
||||||
m_checkSizer->Add(m_Check[7], 0, 0, 5);
|
|
||||||
m_checkSizer->Add(m_Check[2], 0, 0, 5);
|
|
||||||
// ------------------------
|
|
||||||
|
|
||||||
// settings checkboxes -----------------------------------------------------
|
|
||||||
m_Label[1] = new wxStaticBox(this, IDG_LABEL2, wxT("Settings"),
|
|
||||||
wxDefaultPosition, wxDefaultSize, 0);
|
|
||||||
wxStaticBoxSizer * m_checkSizer2 = new wxStaticBoxSizer (m_Label[1], wxVERTICAL);
|
|
||||||
|
|
||||||
// checkboxes
|
|
||||||
m_Check[3] = new wxCheckBox(this, IDC_CHECK3, wxT("Setting"),
|
|
||||||
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
|
||||||
m_Check[3]->SetValue(false);
|
|
||||||
m_Check[3]->Enable(false);
|
|
||||||
|
|
||||||
m_checkSizer2->Add(m_Check[3], 0, 0, 5);
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
|
|
||||||
// radio boxes -----------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
// m_PageMain: Options
|
||||||
|
// -------------------------
|
||||||
|
wxStaticBoxSizer * m_optionsSizer = new wxStaticBoxSizer(wxVERTICAL, m_PageMain, wxT("Options"));
|
||||||
|
//m_Label[0] = new wxStaticBox(m_PageMain, IDG_LABEL1, wxT("Options"),
|
||||||
|
// wxDefaultPosition, wxDefaultSize, 0);
|
||||||
|
//wxStaticBoxSizer * m_checkSizer3 = new wxStaticBoxSizer (m_Label[0], wxVERTICAL);
|
||||||
|
|
||||||
|
// checkboxes
|
||||||
|
m_Check[0] = new wxCheckBox(m_PageMain, ID_SAVETOFILE, wxT("Save to file"),
|
||||||
|
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
m_Check[2] = new wxCheckBox(m_PageMain, ID_SHOWCONSOLE, wxT("Show console"),
|
||||||
|
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||||
|
|
||||||
|
m_optionsSizer->Add(m_Check[0], 0, 0, 5);
|
||||||
|
m_optionsSizer->Add(m_Check[2], 0, 0, 5);
|
||||||
|
// ------------------------
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
// m_PageMain: Log settings checkboxes
|
||||||
|
// -------------------------
|
||||||
|
wxStaticBoxSizer * m_logSizer = new wxStaticBoxSizer(wxVERTICAL, m_PageMain, wxT("Log setting"));
|
||||||
|
m_settings = new wxCheckListBox(m_PageMain, ID_CHECKLIST1, wxDefaultPosition, wxDefaultSize,
|
||||||
|
0, NULL, wxNO_BORDER);
|
||||||
|
|
||||||
|
m_settings->Append(wxT("Info log"));
|
||||||
|
m_settings->Append(wxT("Primary log"));
|
||||||
|
|
||||||
|
m_settings->Check(0, bInfoLog);
|
||||||
|
m_settings->Check(1, bPrimLog);
|
||||||
|
|
||||||
|
// because the wxCheckListBox is a little underdeveloped we have to help it with this
|
||||||
|
// to bad there's no windows xp styles for the checkboxes
|
||||||
|
m_settings->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
|
||||||
|
m_settings->SetMinSize(wxSize(m_settings->GetSize().GetWidth() - 40,
|
||||||
|
m_settings->GetCount() * 15));
|
||||||
|
|
||||||
|
m_logSizer->Add(m_settings, 0, 0, 0);
|
||||||
|
// ------------------------
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
// m_PageMain: Radio boxes
|
||||||
|
// -------------------------
|
||||||
int m_radioBoxNChoices[3];
|
int m_radioBoxNChoices[3];
|
||||||
|
|
||||||
wxString m_radioBoxChoices0[] = { wxT("Show base 10"), wxT("Show base 16") };
|
wxString m_radioBoxChoices0[] = { wxT("Show base 10"), wxT("Show base 16") };
|
||||||
m_radioBoxNChoices[0] = sizeof( m_radioBoxChoices0 ) / sizeof( wxString );
|
m_radioBoxNChoices[0] = sizeof( m_radioBoxChoices0 ) / sizeof( wxString );
|
||||||
m_RadioBox[0] = new wxRadioBox( this, IDC_RADIO0, wxT("Show base"),
|
m_RadioBox[0] = new wxRadioBox( m_PageMain, IDC_RADIO0, wxT("Show base"),
|
||||||
wxDefaultPosition, wxDefaultSize, m_radioBoxNChoices[0], m_radioBoxChoices0, 1, wxRA_SPECIFY_COLS);
|
wxDefaultPosition, wxDefaultSize, m_radioBoxNChoices[0], m_radioBoxChoices0, 1, wxRA_SPECIFY_COLS);
|
||||||
m_RadioBox[0]->Enable(false);
|
m_RadioBox[0]->Enable(false);
|
||||||
|
|
||||||
wxString m_radioBoxChoices1[] = { wxT("Never"), wxT("5 times/s"), wxT("15 times/s"), wxT("30 times/s") };
|
wxString m_radioBoxChoices1[] = { wxT("Never"), wxT("5 times/s"), wxT("15 times/s"), wxT("30 times/s") };
|
||||||
m_radioBoxNChoices[1] = sizeof( m_radioBoxChoices1 ) / sizeof( wxString );
|
m_radioBoxNChoices[1] = sizeof( m_radioBoxChoices1 ) / sizeof( wxString );
|
||||||
m_RadioBox[1] = new wxRadioBox( this, IDC_RADIO1, wxT("Update freq."),
|
m_RadioBox[1] = new wxRadioBox( m_PageMain, IDC_RADIO1, wxT("Update freq."),
|
||||||
wxDefaultPosition, wxDefaultSize, m_radioBoxNChoices[1], m_radioBoxChoices1, 1, wxRA_SPECIFY_COLS);
|
wxDefaultPosition, wxDefaultSize, m_radioBoxNChoices[1], m_radioBoxChoices1, 1, wxRA_SPECIFY_COLS);
|
||||||
|
|
||||||
wxString m_radioBoxChoices2[] = { wxT("Win stretch") };
|
wxString m_radioBoxChoices2[] = { wxT("Win stretch") };
|
||||||
m_radioBoxNChoices[2] = sizeof( m_radioBoxChoices2 ) / sizeof( wxString );
|
m_radioBoxNChoices[2] = sizeof( m_radioBoxChoices2 ) / sizeof( wxString );
|
||||||
m_RadioBox[2] = new wxRadioBox( this, IDC_RADIO2, wxT("Presets"),
|
m_RadioBox[2] = new wxRadioBox( m_PageMain, IDC_RADIO2, wxT("Presets"),
|
||||||
wxDefaultPosition, wxDefaultSize, m_radioBoxNChoices[2], m_radioBoxChoices2, 1, wxRA_SPECIFY_COLS);
|
wxDefaultPosition, wxDefaultSize, m_radioBoxNChoices[2], m_radioBoxChoices2, 1, wxRA_SPECIFY_COLS);
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
|
|
||||||
// right buttons
|
// --------------------------------------------------------------------
|
||||||
wxBoxSizer* sButtons2;
|
// Main: Left buttons and checkboxes
|
||||||
sButtons2 = new wxBoxSizer(wxVERTICAL);
|
// ------------------------
|
||||||
|
wxBoxSizer* sButtons = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
sButtons2->AddStretchSpacer(1);
|
//sButtons->AddStretchSpacer(1);
|
||||||
sButtons2->Add(m_RadioBox[2], 0, 0, 5);
|
|
||||||
sButtons2->AddStretchSpacer(1);
|
|
||||||
sButtons2->Add(m_checkSizer2, 0, 2, 5);
|
|
||||||
sButtons2->AddStretchSpacer(1);
|
|
||||||
|
|
||||||
// left buttons
|
sButtons->Add(m_updSizer, 0, 0, 5); // update button
|
||||||
wxBoxSizer* sButtons;
|
sButtons->Add(m_buttonSizer, 0, 0, 5); // variables buttons
|
||||||
sButtons = new wxBoxSizer(wxVERTICAL);
|
sButtons->Add(m_logSizer, 0, 0, 5); // log settings
|
||||||
|
|
||||||
sButtons->AddStretchSpacer(1);
|
sButtons->Add(m_optionsSizer, 0, 2, 5); // Log options, show console etc.
|
||||||
|
|
||||||
sButtons->Add(m_Upd, 0, 0, 5);
|
|
||||||
sButtons->Add(m_Ap, 0, 0, 5);
|
|
||||||
sButtons->Add(m_Am, 0, 0, 5);
|
|
||||||
sButtons->Add(m_Bp, 0, 0, 5);
|
|
||||||
sButtons->Add(m_Bm, 0, 0, 5);
|
|
||||||
|
|
||||||
sButtons->AddStretchSpacer(1);
|
// --------------------------------------------------------------------
|
||||||
|
// Main: Right buttons and checkboxes
|
||||||
|
// ------------------------
|
||||||
|
wxBoxSizer* sButtons2 = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
sButtons->Add(m_checkSizer, 0, 2, 5);
|
sButtons2->Add(m_RadioBox[0], 0, 0, 5); // Show base
|
||||||
|
sButtons2->Add(m_RadioBox[1], 0, 0, 5); // Update frequency
|
||||||
|
sButtons2->Add(m_RadioBox[2], 0, 0, 5); // Preset views
|
||||||
|
//sButtons2->AddStretchSpacer(1);
|
||||||
|
//sButtons2->Add(m_checkSizer2, 0, 2, 5);
|
||||||
|
|
||||||
sButtons->AddStretchSpacer(1);
|
|
||||||
|
|
||||||
sButtons->Add(m_RadioBox[0], 0, 0, 5);
|
// --------------------------------------------------------------------
|
||||||
|
// Main: Parameter tables view, the big window
|
||||||
|
sLeft = new wxStaticBoxSizer(wxVERTICAL, m_PageMain, wxT("Current Status"));
|
||||||
|
|
||||||
sButtons->AddStretchSpacer(1);
|
m_GPRListView = new CPBView(m_PageMain, ID_GPR, wxDefaultPosition, GetSize(),
|
||||||
|
wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT | wxLC_SINGLE_SEL | wxLC_SORT_ASCENDING);
|
||||||
|
|
||||||
sButtons->Add(m_RadioBox[1], 0, 0, 5);
|
|
||||||
|
|
||||||
sButtons->AddStretchSpacer(1);
|
|
||||||
|
|
||||||
// blocks view
|
|
||||||
sLeft = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Current Status"));
|
|
||||||
sLeft->Add(m_GPRListView, 1, wxEXPAND|wxALL, 5);
|
sLeft->Add(m_GPRListView, 1, wxEXPAND|wxALL, 5);
|
||||||
|
|
||||||
|
|
||||||
// add all stuff to the main container
|
// --------------------------------------------------------------------
|
||||||
sMain = new wxBoxSizer(wxHORIZONTAL);
|
// General container
|
||||||
sMain->Add(sLeft, 1, wxEXPAND|wxALL, 5);
|
// -----------------------------
|
||||||
sMain->Add(sButtons, 0, wxEXPAND, 0);
|
sGeneral = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sMain->Add(sButtons2, 0, wxEXPAND, 0);
|
sGeneral->Add(sLeft, 1, wxEXPAND | wxALL, 5);
|
||||||
|
sGeneral->Add(sButtons, 0, wxEXPAND | (wxUP | wxDOWN), 5);
|
||||||
|
sGeneral->Add(sButtons2, 0, wxEXPAND | (wxUP | wxDOWN | wxRIGHT | wxLEFT), 5);
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
// Main container
|
||||||
|
// -----------------------------
|
||||||
|
sMain = new wxBoxSizer(wxVERTICAL);
|
||||||
|
sMain->Add(m_Notebook, 1, wxEXPAND | wxALL, 5);
|
||||||
|
|
||||||
|
m_PageMain->SetSizer(sGeneral);
|
||||||
this->SetSizer(sMain);
|
this->SetSizer(sMain);
|
||||||
sMain->SetSizeHints(this);
|
//sGeneral->SetSizeHints(this);
|
||||||
|
|
||||||
//NotifyUpdate();
|
//NotifyUpdate();
|
||||||
Freeze(); // unfreeze this if you want to use it
|
//Freeze(); // unfreeze this if you want to use it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
|
// System functions
|
||||||
|
// --------------
|
||||||
void CDebugger::OnShow(wxShowEvent& /*event*/)
|
void CDebugger::OnShow(wxShowEvent& /*event*/)
|
||||||
{
|
{
|
||||||
// bring the console back to
|
// bring the console back to
|
||||||
|
@ -266,7 +307,7 @@ void CDebugger::OnShow(wxShowEvent& /*event*/)
|
||||||
{
|
{
|
||||||
OpenConsole();
|
OpenConsole();
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
MoveWindow(GetConsoleHwnd(), 0,400, 1280,500, true); // move window, TODO: make this
|
MoveWindow(GetConsoleHwnd(), 0,400, 1280,500, true); // Move window TODO: make this
|
||||||
// adjustable from the debugging window
|
// adjustable from the debugging window
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -281,15 +322,28 @@ void CDebugger::OnClose(wxCloseEvent& /*event*/)
|
||||||
file.Save(DEBUGGER_CONFIG_FILE);
|
file.Save(DEBUGGER_CONFIG_FILE);
|
||||||
|
|
||||||
EndModal(0); // it seems like this works for Show() to, not just ShowModal();
|
EndModal(0); // it seems like this works for Show() to, not just ShowModal();
|
||||||
|
CloseConsole(); // The console goes with the wx window
|
||||||
// The console goes with the wx window
|
|
||||||
CloseConsole();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CDebugger::DoHide()
|
||||||
|
{
|
||||||
|
Hide();
|
||||||
|
CloseConsole(); // The console goes with the wx window
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDebugger::DoShow()
|
||||||
|
{
|
||||||
|
Show();
|
||||||
|
DoShowHideConsole(); // The console goes with the wx window
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CDebugger::OnUpdate(wxCommandEvent& /*event*/)
|
void CDebugger::OnUpdate(wxCommandEvent& /*event*/)
|
||||||
{
|
{
|
||||||
this->NotifyUpdate();
|
this->NotifyUpdate();
|
||||||
}
|
}
|
||||||
|
// ===============
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
// =======================================================================================
|
||||||
|
@ -303,22 +357,14 @@ void CDebugger::ChangePreset(wxCommandEvent& event)
|
||||||
void CDebugger::DoChangePreset()
|
void CDebugger::DoChangePreset()
|
||||||
{
|
{
|
||||||
if(m_RadioBox[2]->GetSelection() == 0)
|
if(m_RadioBox[2]->GetSelection() == 0)
|
||||||
{
|
|
||||||
gPreset = 0;
|
gPreset = 0;
|
||||||
}
|
|
||||||
else if(m_RadioBox[2]->GetSelection() == 1)
|
else if(m_RadioBox[2]->GetSelection() == 1)
|
||||||
{
|
|
||||||
gPreset = 1;
|
gPreset = 1;
|
||||||
}
|
|
||||||
else if(m_RadioBox[2]->GetSelection() == 2)
|
else if(m_RadioBox[2]->GetSelection() == 2)
|
||||||
{
|
|
||||||
gPreset = 2;
|
gPreset = 2;
|
||||||
}
|
|
||||||
else if(m_RadioBox[2]->GetSelection() == 3)
|
else if(m_RadioBox[2]->GetSelection() == 3)
|
||||||
{
|
|
||||||
gPreset = 3;
|
gPreset = 3;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// ==============
|
// ==============
|
||||||
|
|
||||||
|
|
||||||
|
@ -357,39 +403,30 @@ void CDebugger::ChangeFrequency(wxCommandEvent& event)
|
||||||
void CDebugger::DoChangeFrequency()
|
void CDebugger::DoChangeFrequency()
|
||||||
{
|
{
|
||||||
if(m_RadioBox[1]->GetSelection() == 0)
|
if(m_RadioBox[1]->GetSelection() == 0)
|
||||||
{
|
|
||||||
gUpdFreq = 0;
|
gUpdFreq = 0;
|
||||||
}
|
|
||||||
else if(m_RadioBox[1]->GetSelection() == 1)
|
else if(m_RadioBox[1]->GetSelection() == 1)
|
||||||
{
|
|
||||||
gUpdFreq = 5;
|
gUpdFreq = 5;
|
||||||
}
|
|
||||||
else if(m_RadioBox[1]->GetSelection() == 2)
|
else if(m_RadioBox[1]->GetSelection() == 2)
|
||||||
{
|
|
||||||
gUpdFreq = 15;
|
gUpdFreq = 15;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
gUpdFreq = 30;
|
gUpdFreq = 30;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// ==============
|
// ==============
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// =======================================================================================
|
// =======================================================================================
|
||||||
// Save to file
|
// General settings
|
||||||
// --------------
|
// --------------
|
||||||
void CDebugger::SaveFile(wxCommandEvent& event)
|
void CDebugger::GeneralSettings(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if(m_Check[0]->IsChecked())
|
switch (event.GetId())
|
||||||
{
|
{
|
||||||
gSaveFile = 1;
|
case ID_SAVETOFILE: // Save to file
|
||||||
|
gSaveFile = m_Check[0]->IsChecked();
|
||||||
}
|
break;
|
||||||
else
|
case ID_SHOWCONSOLE:
|
||||||
{
|
DoShowHideConsole();
|
||||||
gSaveFile = 0;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ==============
|
// ==============
|
||||||
|
@ -398,14 +435,8 @@ void CDebugger::SaveFile(wxCommandEvent& event)
|
||||||
// =======================================================================================
|
// =======================================================================================
|
||||||
// Show or hide console window
|
// Show or hide console window
|
||||||
// --------------
|
// --------------
|
||||||
void CDebugger::ShowHideConsole(wxCommandEvent& event)
|
|
||||||
{
|
|
||||||
DoShowHideConsole();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDebugger::DoShowHideConsole()
|
void CDebugger::DoShowHideConsole()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(m_Check[2]->IsChecked())
|
if(m_Check[2]->IsChecked())
|
||||||
{
|
{
|
||||||
OpenConsole();
|
OpenConsole();
|
||||||
|
@ -422,6 +453,25 @@ void CDebugger::DoShowHideConsole()
|
||||||
// ==============
|
// ==============
|
||||||
|
|
||||||
|
|
||||||
|
// =======================================================================================
|
||||||
|
// Enable or disable logs
|
||||||
|
// --------------
|
||||||
|
void CDebugger::LogSettings(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
// Only allow one selected log at a time
|
||||||
|
for (int i = 0; i < m_settings->GetCount(); ++i)
|
||||||
|
if(i != event.GetInt()) m_settings->Check(i, false);
|
||||||
|
|
||||||
|
if(m_settings->IsChecked(0)) g_Config.iLog = CONF_LOG;
|
||||||
|
else if(m_settings->IsChecked(1)) g_Config.iLog = CONF_PRIMLOG;
|
||||||
|
else g_Config.iLog = 0;
|
||||||
|
}
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
|
||||||
|
// =======================================================================================
|
||||||
|
// Update the wxListCtrl
|
||||||
|
// --------------
|
||||||
void CDebugger::NotifyUpdate()
|
void CDebugger::NotifyUpdate()
|
||||||
{
|
{
|
||||||
if (m_GPRListView != NULL)
|
if (m_GPRListView != NULL)
|
||||||
|
@ -429,3 +479,4 @@ void CDebugger::NotifyUpdate()
|
||||||
m_GPRListView->Update();
|
m_GPRListView->Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ==============
|
|
@ -36,6 +36,7 @@
|
||||||
#include <wx/filepicker.h>
|
#include <wx/filepicker.h>
|
||||||
#include <wx/listctrl.h>
|
#include <wx/listctrl.h>
|
||||||
#include <wx/imaglist.h>
|
#include <wx/imaglist.h>
|
||||||
|
#include <wx/notebook.h> // notebook
|
||||||
|
|
||||||
#include "../Globals.h"
|
#include "../Globals.h"
|
||||||
|
|
||||||
|
@ -61,12 +62,13 @@ class CDebugger : public wxDialog
|
||||||
|
|
||||||
void Save(IniFile& _IniFile) const;
|
void Save(IniFile& _IniFile) const;
|
||||||
void Load(IniFile& _IniFile);
|
void Load(IniFile& _IniFile);
|
||||||
|
void DoHide(); void DoShow();
|
||||||
|
|
||||||
void NotifyUpdate();
|
void NotifyUpdate();
|
||||||
void OnUpdate(wxCommandEvent& event);
|
void OnUpdate(wxCommandEvent& event);
|
||||||
|
|
||||||
void SaveFile(wxCommandEvent& event);
|
void GeneralSettings(wxCommandEvent& event);
|
||||||
void ShowHideConsole(wxCommandEvent& event);
|
void LogSettings(wxCommandEvent& event);
|
||||||
void DoShowHideConsole();
|
void DoShowHideConsole();
|
||||||
void ChangeFrequency(wxCommandEvent& event);
|
void ChangeFrequency(wxCommandEvent& event);
|
||||||
void DoChangeFrequency();
|
void DoChangeFrequency();
|
||||||
|
@ -80,11 +82,19 @@ class CDebugger : public wxDialog
|
||||||
|
|
||||||
CPBView* m_GPRListView;
|
CPBView* m_GPRListView;
|
||||||
|
|
||||||
|
int gUpdFreq;
|
||||||
|
bool bInfoLog;
|
||||||
|
bool bPrimLog;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// declarations
|
// declarations
|
||||||
|
wxNotebook *m_Notebook; // notebook
|
||||||
|
wxPanel *m_PageMain;
|
||||||
|
|
||||||
wxCheckBox *m_Check[7];
|
wxCheckBox *m_Check[7];
|
||||||
|
wxCheckListBox * m_options, * m_settings;
|
||||||
wxRadioButton *m_Radio[5];
|
wxRadioButton *m_Radio[5];
|
||||||
wxRadioBox *m_RadioBox[3];
|
wxRadioBox *m_RadioBox[3];
|
||||||
wxStaticBox *m_Label[2];
|
wxStaticBox *m_Label[2];
|
||||||
|
@ -93,8 +103,9 @@ class CDebugger : public wxDialog
|
||||||
// WARNING: Make sure these are not also elsewhere, for example in resource.h.
|
// WARNING: Make sure these are not also elsewhere, for example in resource.h.
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
IDC_CHECK0 = 2000,
|
ID_NOTEBOOK = 2000, ID_PAGEMAIN, // notebook
|
||||||
IDC_CHECK1,
|
|
||||||
|
ID_SAVETOFILE, ID_SHOWCONSOLE, // options
|
||||||
IDC_CHECK2,
|
IDC_CHECK2,
|
||||||
IDC_CHECK3,
|
IDC_CHECK3,
|
||||||
IDC_CHECK4,
|
IDC_CHECK4,
|
||||||
|
@ -103,12 +114,17 @@ class CDebugger : public wxDialog
|
||||||
IDC_CHECK7,
|
IDC_CHECK7,
|
||||||
IDC_CHECK8,
|
IDC_CHECK8,
|
||||||
IDC_CHECK9,
|
IDC_CHECK9,
|
||||||
|
|
||||||
|
ID_CHECKLIST1,
|
||||||
|
|
||||||
IDC_RADIO0,
|
IDC_RADIO0,
|
||||||
IDC_RADIO1,
|
IDC_RADIO1,
|
||||||
IDC_RADIO2,
|
IDC_RADIO2,
|
||||||
IDC_RADIO3,
|
IDC_RADIO3,
|
||||||
|
|
||||||
IDG_LABEL1,
|
IDG_LABEL1,
|
||||||
IDG_LABEL2,
|
IDG_LABEL2,
|
||||||
|
|
||||||
ID_UPD,
|
ID_UPD,
|
||||||
ID_AP,
|
ID_AP,
|
||||||
ID_AM,
|
ID_AM,
|
||||||
|
|
|
@ -79,7 +79,7 @@ inline unsigned long timeGetTime()
|
||||||
|
|
||||||
#define GL_REPORT_ERROR() { err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
|
#define GL_REPORT_ERROR() { err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
#define GL_REPORT_ERRORD() { GLenum err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
|
#define GL_REPORT_ERRORD() { GLenum err = glGetError(); if( err != GL_NO_ERROR ) { ERROR_LOG("%s:%d: gl error 0x%x\n", __FILE__, (int)__LINE__, err); HandleGLError(); } }
|
||||||
#else
|
#else
|
||||||
#define GL_REPORT_ERRORD()
|
#define GL_REPORT_ERRORD()
|
||||||
|
|
|
@ -49,7 +49,7 @@ void OpenConsole()
|
||||||
|
|
||||||
// set width and height
|
// set width and height
|
||||||
csize.X = 155; // this fits on 1280 pixels TODO: make it adjustable from the wx debugging window
|
csize.X = 155; // this fits on 1280 pixels TODO: make it adjustable from the wx debugging window
|
||||||
csize.Y = 1024;
|
csize.Y = 300; // 300 rows
|
||||||
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), csize);
|
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), csize);
|
||||||
|
|
||||||
// make the internal buffer match the width we set
|
// make the internal buffer match the width we set
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
#define ERROR_LOG __Log
|
#define ERROR_LOG __Log
|
||||||
|
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
#define INFO_LOG if( g_Config.iLog & 1 ) __Log
|
#define INFO_LOG if( g_Config.iLog & CONF_LOG ) __Log
|
||||||
#define PRIM_LOG if( g_Config.iLog & 2 ) __Log
|
#define PRIM_LOG if( g_Config.iLog & CONF_PRIMLOG ) __Log
|
||||||
#define DEBUG_LOG __Log
|
#define DEBUG_LOG __Log
|
||||||
#else
|
#else
|
||||||
#define INFO_LOG(...)
|
#define INFO_LOG(...)
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
// -------------
|
// -------------
|
||||||
extern int nFiles;
|
extern int nFiles;
|
||||||
float ratioFactor; // a global to get the ratio factor from MixAdd
|
float ratioFactor; // a global to get the ratio factor from MixAdd
|
||||||
int gUpdFreq = 5;
|
|
||||||
int gPreset = 0;
|
int gPreset = 0;
|
||||||
u32 gLastBlock;
|
u32 gLastBlock;
|
||||||
extern bool gSSBM;
|
extern bool gSSBM;
|
||||||
|
@ -159,7 +158,7 @@ void Logging(int a)
|
||||||
if(a == 0) j++;
|
if(a == 0) j++;
|
||||||
//if(l == pow((double)2,32)) l=0; // reset l
|
//if(l == pow((double)2,32)) l=0; // reset l
|
||||||
//l++;
|
//l++;
|
||||||
if (gUpdFreq > 0 && j > (30/gUpdFreq))
|
if (m_frame->gUpdFreq > 0 && j > (30 / m_frame->gUpdFreq))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ bool PixelShaderMngr::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrpro
|
||||||
cgDestroyProgram(tempprog);
|
cgDestroyProgram(tempprog);
|
||||||
// printf("Compiled pixel shader %i\n", ps.glprogid);
|
// printf("Compiled pixel shader %i\n", ps.glprogid);
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
ps.strprog = pstrprogram;
|
ps.strprog = pstrprogram;
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
|
@ -394,6 +394,7 @@ void PixelShaderMngr::SetPSTextureDims(int texid)
|
||||||
fdims[3] = 1.0f/(float)((lastTexDims[texid]>>16)&0xfff);
|
fdims[3] = 1.0f/(float)((lastTexDims[texid]>>16)&0xfff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PRIM_LOG("texdims%d: %f %f %f %f\n", texid, fdims[0], fdims[1], fdims[2], fdims[3]);
|
PRIM_LOG("texdims%d: %f %f %f %f\n", texid, fdims[0], fdims[1], fdims[2], fdims[3]);
|
||||||
SetPSConstant4fv(C_TEXDIMS + texid, fdims);
|
SetPSConstant4fv(C_TEXDIMS + texid, fdims);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ struct FRAGMENTSHADER
|
||||||
{
|
{
|
||||||
FRAGMENTSHADER() : glprogid(0) { }
|
FRAGMENTSHADER() : glprogid(0) { }
|
||||||
GLuint glprogid; // opengl program id
|
GLuint glprogid; // opengl program id
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
std::string strprog;
|
std::string strprog;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -110,7 +110,7 @@ void AddVertices(int primitive, int numvertices)
|
||||||
ADDSTAT(stats.thisFrame.numPrims, numvertices);
|
ADDSTAT(stats.thisFrame.numPrims, numvertices);
|
||||||
s_vStoredPrimitives.push_back(std::pair<int, int>(c_primitiveType[primitive], numvertices));
|
s_vStoredPrimitives.push_back(std::pair<int, int>(c_primitiveType[primitive], numvertices));
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
static const char *sprims[8] = {"quads", "nothing", "tris", "tstrip", "tfan", "lines", "lstrip", "points"};
|
static const char *sprims[8] = {"quads", "nothing", "tris", "tstrip", "tfan", "lines", "lstrip", "points"};
|
||||||
PRIM_LOG("prim: %s, c=%d\n", sprims[primitive], numvertices);
|
PRIM_LOG("prim: %s, c=%d\n", sprims[primitive], numvertices);
|
||||||
#endif
|
#endif
|
||||||
|
@ -123,7 +123,7 @@ void Flush()
|
||||||
|
|
||||||
_assert_(s_pCurBufferPointer != s_pBaseBufferPointer);
|
_assert_(s_pCurBufferPointer != s_pBaseBufferPointer);
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
PRIM_LOG("frame%d:\ncomps=0x%x, texgen=%d, numchan=%d, dualtex=%d, ztex=%d, cole=%d, alpe=%d, ze=%d\n", g_Config.iSaveTargetId, s_prevcomponents, xfregs.numTexGens,
|
PRIM_LOG("frame%d:\ncomps=0x%x, texgen=%d, numchan=%d, dualtex=%d, ztex=%d, cole=%d, alpe=%d, ze=%d\n", g_Config.iSaveTargetId, s_prevcomponents, xfregs.numTexGens,
|
||||||
xfregs.nNumChans, (int)xfregs.bEnableDualTexTransform, bpmem.ztex2.op,
|
xfregs.nNumChans, (int)xfregs.bEnableDualTexTransform, bpmem.ztex2.op,
|
||||||
bpmem.blendmode.colorupdate, bpmem.blendmode.alphaupdate, bpmem.zmode.updateenable);
|
bpmem.blendmode.colorupdate, bpmem.blendmode.alphaupdate, bpmem.zmode.updateenable);
|
||||||
|
@ -256,7 +256,7 @@ void Flush()
|
||||||
if (vs) glBindProgramARB(GL_VERTEX_PROGRAM_ARB, vs->glprogid);
|
if (vs) glBindProgramARB(GL_VERTEX_PROGRAM_ARB, vs->glprogid);
|
||||||
if (ps) glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ps->glprogid); // Lego Star Wars crashes here.
|
if (ps) glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ps->glprogid); // Lego Star Wars crashes here.
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
PRIM_LOG("\n");
|
PRIM_LOG("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ void Flush()
|
||||||
offset += it->second;
|
offset += it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
if (g_Config.iLog & CONF_PRIMLOG) {
|
if (g_Config.iLog & CONF_PRIMLOG) {
|
||||||
// save the shaders
|
// save the shaders
|
||||||
char strfile[255];
|
char strfile[255];
|
||||||
|
|
|
@ -206,7 +206,7 @@ bool VertexShaderMngr::CompileVertexShader(VERTEXSHADER& vs, const char* pstrpro
|
||||||
cgDestroyProgram(tempprog);
|
cgDestroyProgram(tempprog);
|
||||||
// printf("Compiled vertex shader %i\n", vs.glprogid);
|
// printf("Compiled vertex shader %i\n", vs.glprogid);
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
vs.strprog = pstrprogram;
|
vs.strprog = pstrprogram;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct VERTEXSHADER
|
||||||
VERTEXSHADER() : glprogid(0) {}
|
VERTEXSHADER() : glprogid(0) {}
|
||||||
GLuint glprogid; // opengl program id
|
GLuint glprogid; // opengl program id
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
std::string strprog;
|
std::string strprog;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,7 +69,7 @@ void DllDebugger(HWND _hParent, bool Show)
|
||||||
{
|
{
|
||||||
if(m_frame && Show) // if we have created it, let us show it again
|
if(m_frame && Show) // if we have created it, let us show it again
|
||||||
{
|
{
|
||||||
m_frame->Show();
|
m_frame->DoShow();
|
||||||
}
|
}
|
||||||
else if(!m_frame && Show)
|
else if(!m_frame && Show)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ void DllDebugger(HWND _hParent, bool Show)
|
||||||
}
|
}
|
||||||
else if(m_frame && !Show)
|
else if(m_frame && !Show)
|
||||||
{
|
{
|
||||||
m_frame->Hide();
|
m_frame->DoHide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue