remove WTL from dsp-lle testing and getting ready for wxw version of the debugger (anyone can do this :) )

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2789 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2009-03-29 21:00:26 +00:00
parent e2a9f8c3bb
commit 819b1e065d
28 changed files with 121 additions and 1708 deletions
+3
View File
@@ -154,7 +154,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AudioCommon", "Core\AudioCo
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Plugin_DSP_LLE_Test", "Plugins\Plugin_DSP_LLE-testing\Plugin_DSP_LLE_Test.vcproj", "{3D8156A9-64D1-4C8E-ADBE-1B319030E4A4}"
ProjectSection(ProjectDependencies) = postProject
{11F55366-12EC-4C44-A8CB-1D4E315D61ED} = {11F55366-12EC-4C44-A8CB-1D4E315D61ED}
{FBAFB369-07EB-4460-9CAD-08BE5789DAB6} = {FBAFB369-07EB-4460-9CAD-08BE5789DAB6}
{0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E} = {0E231FB1-F3C9-4724-ACCB-DE8BCB3C089E}
{1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE} = {1C8436C9-DBAF-42BE-83BC-CF3EC9175ABE}
{C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9}
EndProjectSection
EndProject
@@ -45,8 +45,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../Core/Common/Src;../../../Externals/WTL80;../../PluginSpecs;../../Core/AudioCommon/Src"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DSP_HLE_EXPORTS;_SECURE_SCL=0"
AdditionalIncludeDirectories="../../Core/Common/Src;../../PluginSpecs;../../Core/AudioCommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DSP_LLE_TEST_EXPORTS;_SECURE_SCL=0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -68,7 +68,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dxguid.lib dsound.lib winmm.lib"
AdditionalDependencies="dxguid.lib dsound.lib dxerr.lib rpcrt4.lib comctl32.lib winmm.lib"
OutputFile="../../../Binary/Win32/Plugins/$(ProjectName)D.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\AudioCommon\$(PlatformName)\$(ConfigurationName)"
@@ -131,8 +131,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../Core/Common/Src;../../../Externals/WTL80;../../PluginSpecs;../../Core/AudioCommon/Src"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DSP_HLE_EXPORTS;_SECURE_SCL=0"
AdditionalIncludeDirectories="../../Core/Common/Src;../../PluginSpecs;../../Core/AudioCommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DSP_LLE_TEST_EXPORTS;_SECURE_SCL=0"
MinimalRebuild="false"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
@@ -154,7 +154,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dxguid.lib dsound.lib winmm.lib"
AdditionalDependencies="dxguid.lib dsound.lib dxerr.lib rpcrt4.lib comctl32.lib winmm.lib"
OutputFile="../../../Binary/x64/Plugins/$(ProjectName)D.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\AudioCommon\$(PlatformName)\$(ConfigurationName)"
@@ -220,8 +220,8 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../../Core/Common/Src;../../../Externals/WTL80;../../PluginSpecs;../../Core/AudioCommon/Src"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSP_HLE_EXPORTS;_SECURE_SCL=0"
AdditionalIncludeDirectories="../../Core/Common/Src;../../PluginSpecs;../../Core/AudioCommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSP_LLE_TEST_EXPORTS;_SECURE_SCL=0"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="2"
@@ -242,7 +242,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dxguid.lib dsound.lib winmm.lib"
AdditionalDependencies="dxguid.lib dsound.lib dxerr.lib comctl32.lib winmm.lib"
OutputFile="../../../Binary/Win32/Plugins/$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\AudioCommon\$(PlatformName)\$(ConfigurationName)"
@@ -311,8 +311,8 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../../Core/Common/Src;../../../Externals/WTL80;../../PluginSpecs;../../Core/AudioCommon/Src"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSP_HLE_EXPORTS;_SECURE_SCL=0"
AdditionalIncludeDirectories="../../Core/Common/Src;../../PluginSpecs;../../Core/AudioCommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSP_LLE_TEST_EXPORTS;_SECURE_SCL=0"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
AssemblerListingLocation="$(IntDir)\"
@@ -332,7 +332,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dxguid.lib dsound.lib winmm.lib"
AdditionalDependencies="dxguid.lib dsound.lib dxerr.lib comctl32.lib winmm.lib"
OutputFile="../../../Binary/x64/Plugins/$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\AudioCommon\$(PlatformName)\$(ConfigurationName)"
@@ -399,8 +399,8 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../../Core/Common/Src;../../../Externals/WTL80;../../PluginSpecs;../../Core/AudioCommon/Src"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSP_HLE_EXPORTS;DEBUGFAST;_SECURE_SCL=0"
AdditionalIncludeDirectories="../../Core/Common/Src;../../PluginSpecs;../../Core/AudioCommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSP_LLE_TEST_EXPORTS;DEBUGFAST;_SECURE_SCL=0"
RuntimeLibrary="0"
EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="2"
@@ -421,7 +421,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dxguid.lib dsound.lib winmm.lib"
AdditionalDependencies="dxguid.lib dsound.lib dxerr.lib comctl32.lib winmm.lib"
OutputFile="../../../Binary/Win32/Plugins/$(ProjectName)DF.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\AudioCommon\$(PlatformName)\$(ConfigurationName)"
@@ -490,8 +490,8 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../../Core/Common/Src;../../../Externals/WTL80;../../PluginSpecs;../../Core/AudioCommon/Src"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSP_HLE_EXPORTS;DEBUGFAST;_SECURE_SCL=0"
AdditionalIncludeDirectories="../../Core/Common/Src;../../PluginSpecs;../../Core/AudioCommon/Src;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DSP_LLE_TEST_EXPORTS;DEBUGFAST;_SECURE_SCL=0"
RuntimeLibrary="0"
UsePrecompiledHeader="2"
AssemblerListingLocation="$(IntDir)\"
@@ -511,7 +511,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dxguid.lib dsound.lib winmm.lib"
AdditionalDependencies="dxguid.lib dsound.lib dxerr.lib comctl32.lib winmm.lib"
OutputFile="../../../Binary/x64/Plugins/$(ProjectName)DF.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\AudioCommon\$(PlatformName)\$(ConfigurationName)"
@@ -597,50 +597,6 @@
>
</File>
</Filter>
<Filter
Name="Debugger"
>
<File
RelativePath=".\Src\DisAsmDlg.cpp"
>
</File>
<File
RelativePath=".\Src\DisAsmDlg.h"
>
</File>
<File
RelativePath=".\Src\DisAsmListView.h"
>
</File>
<File
RelativePath=".\Src\RegisterDlg.cpp"
>
</File>
<File
RelativePath=".\Src\RegisterDlg.h"
>
</File>
<File
RelativePath=".\Src\RegSettings.cpp"
>
</File>
<File
RelativePath=".\Src\RegSettings.h"
>
</File>
</Filter>
<Filter
Name="Resources"
>
<File
RelativePath=".\Res\resource.h"
>
</File>
<File
RelativePath=".\Res\resources.rc"
>
</File>
</Filter>
<Filter
Name="DSP"
>
@@ -766,17 +722,25 @@
</File>
</Filter>
<Filter
Name="PCHW"
Name="ConfigDialog"
>
<File
RelativePath=".\Src\Mixer.cpp"
RelativePath=".\Src\DSPConfigDlgLLE.cpp"
>
</File>
<File
RelativePath=".\Src\Mixer.h"
RelativePath=".\Src\DSPConfigDlgLLE.h"
>
</File>
</Filter>
<File
RelativePath=".\Src\Config.cpp"
>
</File>
<File
RelativePath=".\Src\Config.h"
>
</File>
<File
RelativePath=".\Src\Globals.cpp"
>
@@ -17,16 +17,16 @@
#include "Config.h"
#include "ConfigDlg.h"
#include "DSPConfigDlgLLE.h"
BEGIN_EVENT_TABLE(ConfigDialog, wxDialog)
EVT_BUTTON(wxID_OK, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_HLE_AUDIO, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_THROTTLE, ConfigDialog::SettingsChanged)
BEGIN_EVENT_TABLE(DSPConfigDialogLLE, wxDialog)
EVT_BUTTON(wxID_OK, DSPConfigDialogLLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_HLE_AUDIO, DSPConfigDialogLLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, DSPConfigDialogLLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_THROTTLE, DSPConfigDialogLLE::SettingsChanged)
END_EVENT_TABLE()
ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
// Load config settings
@@ -73,18 +73,18 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl
}
// Add audio output options
void ConfigDialog::AddBackend(const char* backend)
void DSPConfigDialogLLE::AddBackend(const char* backend)
{
m_BackendSelection->Append(wxString::FromAscii(backend));
// Update value
m_BackendSelection->SetValue(wxString::FromAscii(g_Config.sBackend.c_str()));
}
ConfigDialog::~ConfigDialog()
DSPConfigDialogLLE::~DSPConfigDialogLLE()
{
}
void ConfigDialog::SettingsChanged(wxCommandEvent& event)
void DSPConfigDialogLLE::SettingsChanged(wxCommandEvent& event)
{
g_Config.m_EnableHLEAudio = m_buttonEnableHLEAudio->GetValue();
g_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue();
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -15,26 +15,26 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __DSP_HLE_CONFIGDIALOG_h__
#define __DSP_HLE_CONFIGDIALOG_h__
#ifndef __DSP_LLE_CONFIGDIALOG_h__
#define __DSP_LLE_CONFIGDIALOG_h__
#include <wx/wx.h>
#include <wx/dialog.h>
#include <wx/button.h>
#include <wx/statbox.h>
class ConfigDialog : public wxDialog
class DSPConfigDialogLLE : public wxDialog
{
public:
ConfigDialog(wxWindow *parent,
DSPConfigDialogLLE(wxWindow *parent,
wxWindowID id = 1,
const wxString &title = wxT("Dolphin DSP-HLE Plugin Settings"),
const wxString &title = wxT("Dolphin DSP-LLE Plugin Settings"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE);
virtual ~ConfigDialog();
virtual ~DSPConfigDialogLLE();
void AddBackend(const char *backend);
private:
DECLARE_EVENT_TABLE();
@@ -58,4 +58,4 @@ private:
void SettingsChanged(wxCommandEvent& event);
};
#endif //__DSP_HLE_CONFIGDIALOG_h__
#endif //__DSP_LLE_CONFIGDIALOG_h__
File diff suppressed because it is too large Load Diff
@@ -1,163 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#include "Globals.h"
#include <list>
#include <algorithm>
#include "../res/resource.h"
#include "DisAsmListView.h"
#include "RegisterDlg.h"
class CDisAsmDlg
: public CDialogImpl<CDisAsmDlg>, public CUpdateUI<CDisAsmDlg>, public CDialogResize<CDisAsmDlg>
{
public:
CDisAsmDlg();
enum { IDD = IDD_DISASMDLG };
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual BOOL OnIdle();
BEGIN_UPDATE_UI_MAP(CDisAsmDlg)
END_UPDATE_UI_MAP()
BEGIN_DLGRESIZE_MAP(CDisAsmDlg)
DLGRESIZE_CONTROL(IDR_MAINFRAME, DLSZ_SIZE_X | DLSZ_SIZE_Y)
END_DLGRESIZE_MAP()
BEGIN_MSG_MAP(CDisAsmDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
COMMAND_ID_HANDLER(ID_STEP, OnStep)
COMMAND_ID_HANDLER(ID_GO, OnGo)
COMMAND_ID_HANDLER(ID_SHOW_REGISTER, OnShowRegisters)
NOTIFY_CODE_HANDLER(NM_CLICK, OnDblClick)
NOTIFY_CODE_HANDLER(NM_RETURN, OnDblClick)
NOTIFY_CODE_HANDLER(NM_RCLICK, OnRClick)
NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)
NOTIFY_HANDLER(IDC_DISASM_LIST, LVN_ITEMCHANGED, OnLvnItemchangedDisasmList)
MESSAGE_HANDLER(WM_SIZE, OnSize)
CHAIN_MSG_MAP(CDialogResize<CDisAsmDlg>)
END_MSG_MAP()
// Handler prototypes (uncomment arguments if needed):
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
LRESULT OnStep(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
LRESULT OnGo(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
LRESULT OnShowRegisters(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
LRESULT OnCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& _bHandled);
LRESULT OnDblClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/);
LRESULT OnRClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/);
void CloseDialog(int nVal);
bool CanDoStep();
void DebugBreak();
private:
enum EColumns
{
ColumnBP = 0,
ColumnFunction = 1,
ColumnAddress = 2,
ColumnMenmomic = 3,
ColumnOpcode = 4,
ColumnExt = 5,
ColumnParameter = 6
};
enum EState
{
PAUSE,
STEP,
RUN,
RUN_START // ignores breakpoints and switches after one step to RUN
};
EState m_State;
CListViewCtrl m_DisAsmListViewCtrl;
CRegisterDlg m_RegisterDlg;
//CWindow GroupLeft
CStatic GroupLeft;
uint64 m_CachedStepCounter;
uint16 m_CachedCR;
uint32 m_CachedUCodeCRC;
typedef std::list<uint16>CBreakPointList;
CBreakPointList m_BreakPoints;
// break point handling
bool IsBreakPoint(uint16 _Address);
void ToggleBreakPoint(uint16 _Address);
void RemoveBreakPoint(uint16 _Address);
void AddBreakPoint(uint16 _Address);
void ClearBreakPoints();
// update dialog
void UpdateDisAsmListView();
void UpdateRegisterFlags();
void UpdateSymbolMap();
void UpdateButtonTexts();
void RedrawDisAsmListView();
void RebuildDisAsmListView();
struct SSymbol
{
uint32 AddressStart;
uint32 AddressEnd;
std::string Name;
SSymbol(uint32 _AddressStart = 0, uint32 _AddressEnd = 0, char* _Name = NULL)
: AddressStart(_AddressStart)
, AddressEnd(_AddressEnd)
, Name(_Name)
{}
};
typedef std::map<uint16, SSymbol>CSymbolMap;
CSymbolMap m_SymbolMap;
void AddSymbol(uint16 _AddressStart, uint16 _AddressEnd, char* _Name);
bool LoadSymbolMap(const char* _pFileName);
DWORD FindColor(uint16 _Address);
void UpdateDialog();
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
public:
LRESULT OnLvnItemchangedDisasmList(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/);
LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
};
@@ -1,64 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#ifndef _MYLISTVIEW_H
#define _MYLISTVIEW_H
class CDisAsmListView
: public CWindowImpl<CDisAsmListView, CListViewCtrl>,
public CCustomDraw<CDisAsmListView>
{
public:
BEGIN_MSG_MAP(CDisAsmListView)
CHAIN_MSG_MAP(CCustomDraw<CDisAsmListView>)
END_MSG_MAP()
DWORD OnPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)
{
return(CDRF_NOTIFYITEMDRAW);
}
DWORD OnItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW lpNMCustomDraw)
{
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(lpNMCustomDraw);
// This is the prepaint stage for an item. Here's where we set the
// item's text color. Our return value will tell Windows to draw the
// item itself, but it will use the new color we set here for the background
COLORREF crText;
if ((pLVCD->nmcd.dwItemSpec % 2) == 0)
{
crText = RGB(200, 200, 255);
}
else
{
crText = RGB(255, 255, 255);
}
// Store the color back in the NMLVCUSTOMDRAW struct.
pLVCD->clrTextBk = crText;
// Tell Windows to paint the control itself.
return(CDRF_DODEFAULT);
}
};
#endif _MYLISTVIEW_H
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,4 +1,4 @@
// Copyright (C) 2003-2008 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// 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
@@ -1,274 +0,0 @@
// RegSettings.cpp
//
// Copyright (c) 2001 Magomed Abdurakhmanov
// maq@hotbox.ru, http://mickels.iwt.ru/en
//
//
//
// No warranties are given. Use at your own risk.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "RegSettings.h"
//////////////////////////////////////////////////////////////////////
// CWindowSettings
#define S_WINDOW_PLACEMENT_VAL _T("WindowPlacement")
CWindowSettings::CWindowSettings()
{
m_WindowPlacement.length = sizeof(m_WindowPlacement);
m_WindowPlacement.flags = 0;
m_WindowPlacement.ptMinPosition.x = 0;
m_WindowPlacement.ptMinPosition.y = 0;
m_WindowPlacement.ptMaxPosition.x = 0;
m_WindowPlacement.ptMaxPosition.y = 0;
CRect rc;
SystemParametersInfo(SPI_GETWORKAREA, 0, rc, 0);
rc.DeflateRect(100, 100);
m_WindowPlacement.rcNormalPosition = rc;
m_WindowPlacement.showCmd = SW_SHOWNORMAL;
}
bool CWindowSettings::Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey /* = HKEY_CURRENT_USER*/)
{
CRegKey reg;
DWORD err = reg.Open(hkRootKey, szRegKey, KEY_READ);
if (err == ERROR_SUCCESS)
{
DWORD dwType = NULL;
DWORD dwSize = sizeof(m_WindowPlacement);
err = RegQueryValueEx(reg.m_hKey, CString(szPrefix) + S_WINDOW_PLACEMENT_VAL, NULL, &dwType,
(LPBYTE)&m_WindowPlacement, &dwSize);
}
return(err == ERROR_SUCCESS);
}
bool CWindowSettings::Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey /* = HKEY_CURRENT_USER*/) const
{
CRegKey reg;
DWORD err = reg.Create(hkRootKey, szRegKey);
if (err == ERROR_SUCCESS)
{
err = RegSetValueEx(reg.m_hKey, CString(szPrefix) + S_WINDOW_PLACEMENT_VAL, NULL, REG_BINARY,
(LPBYTE)&m_WindowPlacement, sizeof(m_WindowPlacement));
}
return(err == ERROR_SUCCESS);
}
void CWindowSettings::GetFrom(CWindow& Wnd)
{
ATLASSERT(Wnd.IsWindow());
Wnd.GetWindowPlacement(&m_WindowPlacement);
}
void CWindowSettings::ApplyTo(CWindow& Wnd, int nCmdShow /* = SW_SHOWNORMAL*/) const
{
ATLASSERT(Wnd.IsWindow());
Wnd.SetWindowPlacement(&m_WindowPlacement);
if (SW_SHOWNORMAL != nCmdShow)
{
Wnd.ShowWindow(nCmdShow);
}
else
if (m_WindowPlacement.showCmd == SW_MINIMIZE || m_WindowPlacement.showCmd == SW_SHOWMINIMIZED)
{
Wnd.ShowWindow(SW_SHOWNORMAL);
}
}
//////////////////////////////////////////////////////////////////////
// CReBarSettings
#define S_BAR_BANDCOUNT _T("BandCount")
#define S_BAR_ID_VAL _T("ID")
#define S_BAR_CX_VAL _T("CX")
#define S_BAR_BREAKLINE_VAL _T("BreakLine")
CReBarSettings::CReBarSettings()
{
m_pBands = NULL;
m_cbBandCount = 0;
}
CReBarSettings::~CReBarSettings()
{
if (m_pBands != NULL)
{
delete[] m_pBands;
m_pBands = NULL;
}
}
bool CReBarSettings::Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey /* = HKEY_CURRENT_USER*/)
{
if (m_pBands != NULL)
{
delete[] m_pBands;
m_pBands = NULL;
}
m_pBands = NULL;
m_cbBandCount = 0;
CRegKey reg;
DWORD err = reg.Open(hkRootKey, szRegKey, KEY_READ);
if (err == ERROR_SUCCESS)
{
reg.QueryDWORDValue(CString(szPrefix) + S_BAR_BANDCOUNT, m_cbBandCount);
if (m_cbBandCount > 0)
{
m_pBands = new BandInfo[m_cbBandCount];
}
for (DWORD i = 0; i < m_cbBandCount; i++)
{
CString s;
s.Format(_T("%s%i_"), szPrefix, i);
reg.QueryDWORDValue(s + S_BAR_ID_VAL, m_pBands[i].ID);
reg.QueryDWORDValue(s + S_BAR_CX_VAL, m_pBands[i].cx);
DWORD dw;
reg.QueryDWORDValue(s + S_BAR_BREAKLINE_VAL, dw);
m_pBands[i].BreakLine = dw != 0;
}
}
return(err == ERROR_SUCCESS);
}
bool CReBarSettings::Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey /* = HKEY_CURRENT_USER*/) const
{
CRegKey reg;
DWORD err = reg.Create(hkRootKey, szRegKey);
if (err == ERROR_SUCCESS)
{
reg.SetDWORDValue(CString(szPrefix) + S_BAR_BANDCOUNT, m_cbBandCount);
for (DWORD i = 0; i < m_cbBandCount; i++)
{
CString s;
s.Format(_T("%s%i_"), szPrefix, i);
reg.SetDWORDValue(s + S_BAR_ID_VAL, m_pBands[i].ID);
reg.SetDWORDValue(s + S_BAR_CX_VAL, m_pBands[i].cx);
DWORD dw = m_pBands[i].BreakLine;
reg.SetDWORDValue(s + S_BAR_BREAKLINE_VAL, dw);
}
}
return(err == ERROR_SUCCESS);
}
void CReBarSettings::GetFrom(CReBarCtrl& ReBar)
{
ATLASSERT(ReBar.IsWindow());
if (m_pBands != NULL)
{
delete[] m_pBands;
}
m_pBands = NULL;
m_cbBandCount = ReBar.GetBandCount();
if (m_cbBandCount > 0)
{
m_pBands = new BandInfo[m_cbBandCount];
}
for (UINT i = 0; i < m_cbBandCount; i++)
{
REBARBANDINFO rbi;
rbi.cbSize = sizeof(rbi);
rbi.fMask = RBBIM_ID | RBBIM_SIZE | RBBIM_STYLE;
ReBar.GetBandInfo(i, &rbi);
m_pBands[i].ID = rbi.wID;
m_pBands[i].cx = rbi.cx;
m_pBands[i].BreakLine = (rbi.fStyle & RBBS_BREAK) != 0;
}
}
void CReBarSettings::ApplyTo(CReBarCtrl& ReBar) const
{
ATLASSERT(ReBar.IsWindow());
for (UINT i = 0; i < m_cbBandCount; i++)
{
ReBar.MoveBand(ReBar.IdToIndex(m_pBands[i].ID), i);
REBARBANDINFO rbi;
rbi.cbSize = sizeof(rbi);
rbi.fMask = RBBIM_ID | RBBIM_SIZE | RBBIM_STYLE;
ReBar.GetBandInfo(i, &rbi);
rbi.cx = m_pBands[i].cx;
if (m_pBands[i].BreakLine)
{
rbi.fStyle |= RBBS_BREAK;
}
else
{
rbi.fStyle &= (~RBBS_BREAK);
}
ReBar.SetBandInfo(i, &rbi);
}
}
//////////////////////////////////////////////////////////////////////
// CSplitterSettings
#define S_SPLITTER_POS _T("SplitterPos")
bool CSplitterSettings::Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey /* = HKEY_CURRENT_USER*/)
{
CRegKey reg;
DWORD err = reg.Open(hkRootKey, szRegKey, KEY_READ);
if (err == ERROR_SUCCESS)
{
reg.QueryDWORDValue(CString(szPrefix) + S_SPLITTER_POS, m_dwPos);
}
return(err == ERROR_SUCCESS);
}
bool CSplitterSettings::Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey /* = HKEY_CURRENT_USER*/) const
{
CRegKey reg;
DWORD err = reg.Create(hkRootKey, szRegKey);
if (err == ERROR_SUCCESS)
{
reg.SetDWORDValue(CString(szPrefix) + S_SPLITTER_POS, m_dwPos);
}
return(err == ERROR_SUCCESS);
}
@@ -1,81 +0,0 @@
// RegSettings.h
//
// Copyright (c) 2001 Magomed Abdurakhmanov
// maq@hotbox.ru, http://mickels.iwt.ru/en
//
//
//
// No warranties are given. Use at your own risk.
//
//////////////////////////////////////////////////////////////////////
#if !defined (AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_)
#define AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <AtlMisc.h>
#include <AtlCtrls.h>
class CWindowSettings
{
public:
WINDOWPLACEMENT m_WindowPlacement;
CWindowSettings();
void GetFrom(CWindow& Wnd);
void ApplyTo(CWindow& Wnd, int nCmdShow = SW_SHOWNORMAL) const;
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
};
class CReBarSettings
{
public:
struct BandInfo
{
DWORD ID;
DWORD cx;
bool BreakLine;
}* m_pBands;
DWORD m_cbBandCount;
CReBarSettings();
~CReBarSettings();
void GetFrom(CReBarCtrl& ReBar);
void ApplyTo(CReBarCtrl& ReBar) const;
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
};
class CSplitterSettings
{
public:
DWORD m_dwPos;
template<class T>void GetFrom(const T& Splitter)
{
m_dwPos = Splitter.GetSplitterPos();
}
template<class T>void ApplyTo(T& Splitter) const
{
Splitter.SetSplitterPos(m_dwPos);
}
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
};
#endif // !defined(AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_)
@@ -1,207 +0,0 @@
// Copyright (C) 2003-2008 Dolphin Project.
// 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/
#include "../res/resource.h"
#include "RegisterDlg.h"
#include "disassemble.h"
#include "gdsp_interpreter.h"
#include "RegSettings.h"
CRegisterDlg::CRegisterDlg()
: m_CachedCounter(-1)
{}
BOOL CRegisterDlg::PreTranslateMessage(MSG* pMsg)
{
return(IsDialogMessage(pMsg));
}
BOOL CRegisterDlg::OnIdle()
{
return(FALSE);
}
LRESULT CRegisterDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CWindowSettings ws;
if (ws.Load("Software\\Dolphin\\DSP", "Register"))
{
ws.ApplyTo(CWindow(m_hWnd), SW_SHOW);
}
m_RegisterListViewCtrl.m_hWnd = GetDlgItem(IDC_DISASM_LIST);
UIAddChildWindowContainer(m_hWnd);
m_RegisterListViewCtrl.AddColumn(_T("General"), 0);
m_RegisterListViewCtrl.AddColumn(_T(" "), 1);
m_RegisterListViewCtrl.AddColumn(_T("Special"), 2);
m_RegisterListViewCtrl.AddColumn(_T("0"), 3);
m_RegisterListViewCtrl.SetColumnWidth(0, 50);
m_RegisterListViewCtrl.SetColumnWidth(1, 100);
m_RegisterListViewCtrl.SetColumnWidth(2, 60);
m_RegisterListViewCtrl.SetColumnWidth(3, 100);
m_RegisterListViewCtrl.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
m_RegisterListViewCtrl.SetTextBkColor(GetSysColor(COLOR_3DLIGHT));
for (uint16 i = 0; i < 16; i++)
{
// 0-15
int Item = m_RegisterListViewCtrl.AddItem(0, 0, gd_dis_get_reg_name(i));
// 16-31
m_RegisterListViewCtrl.AddItem(Item, 2, gd_dis_get_reg_name(16 + i));
// just for easy sort
m_RegisterListViewCtrl.SetItemData(Item, i);
}
m_RegisterListViewCtrl.SortItems(CompareFunc, (LPARAM) this);
UpdateRegisterListView();
return(TRUE);
}
LRESULT CRegisterDlg::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CWindowSettings ws;
ws.GetFrom(CWindow(m_hWnd));
ws.Save("Software\\Dolphin\\DSP", "Register");
return(0);
}
void CRegisterDlg::UpdateRegisterListView()
{
if (m_CachedCounter == g_dsp.step_counter)
{
return;
}
m_CachedCounter = g_dsp.step_counter;
char Temp[256];
for (uint16 i = 0; i < 16; i++)
{
// 0-15
if (m_CachedRegs[i] != g_dsp.r[i])
{
m_CachedRegHasChanged[i] = true;
}
else
{
m_CachedRegHasChanged[i] = false;
}
m_CachedRegs[i] = g_dsp.r[i];
sprintf_s(Temp, 256, "0x%04x", g_dsp.r[i]);
m_RegisterListViewCtrl.SetItemText(i, 1, Temp);
// 16-31
if (m_CachedRegs[16 + i] != g_dsp.r[16 + i])
{
m_CachedRegHasChanged[16 + i] = true;
}
else
{
m_CachedRegHasChanged[16 + i] = false;
}
m_CachedRegs[16 + i] = g_dsp.r[16 + i];
sprintf_s(Temp, 256, "0x%04x", g_dsp.r[16 + i]);
m_RegisterListViewCtrl.SetItemText(i, 3, Temp);
}
}
int CALLBACK CRegisterDlg::CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
return(lParam1 > lParam2);
}
LRESULT CRegisterDlg::OnCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& _bHandled)
{
int result = CDRF_DODEFAULT;
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(pnmh);
switch (pLVCD->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
result = CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT:
result = CDRF_NOTIFYSUBITEMDRAW;
break;
case (CDDS_ITEMPREPAINT | CDDS_SUBITEM):
{
pLVCD->nmcd.uItemState &= ~(CDIS_SELECTED | CDIS_FOCUS);
int Offset = static_cast<int>(m_RegisterListViewCtrl.GetItemData((int)pLVCD->nmcd.dwItemSpec));
size_t Register = -1;
if (pLVCD->iSubItem == 1)
{
Register = Offset;
}
else if (pLVCD->iSubItem == 3)
{
Register = Offset + 16;
}
if (Register != -1)
{
if (m_CachedRegHasChanged[Register])
{
pLVCD->clrTextBk = RGB(0xFF, 192, 192);
}
else
{
pLVCD->clrTextBk = RGB(0xF0, 0xF0, 0xF0);
}
}
else
{
pLVCD->clrTextBk = RGB(192, 224, 192);
}
// uint16 CurrentAddress = static_cast<uint16>(m_DisAsmListViewCtrl.GetItemData((int)pLVCD->nmcd.dwItemSpec));
}
break;
}
return(result);
}

Some files were not shown because too many files have changed in this diff Show More