mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Save the disasm window's size in config.
And, allow it to be smaller.
This commit is contained in:
parent
bafbfc75a0
commit
3ef95fadb3
4 changed files with 71 additions and 14 deletions
|
@ -154,6 +154,12 @@ void Config::Load(const char *iniFileName)
|
||||||
pspConfig->Get("WlanPowerSave", &bWlanPowerSave, PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF);
|
pspConfig->Get("WlanPowerSave", &bWlanPowerSave, PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF);
|
||||||
pspConfig->Get("EncryptSave", &bEncryptSave, true);
|
pspConfig->Get("EncryptSave", &bEncryptSave, true);
|
||||||
|
|
||||||
|
IniFile::Section *debugConfig = iniFile.GetOrCreateSection("Debugger");
|
||||||
|
debugConfig->Get("DisasmWindowX", &iDisasmWindowX, -1);
|
||||||
|
debugConfig->Get("DisasmWindowY", &iDisasmWindowY, -1);
|
||||||
|
debugConfig->Get("DisasmWindowW", &iDisasmWindowW, -1);
|
||||||
|
debugConfig->Get("DisasmWindowH", &iDisasmWindowH, -1);
|
||||||
|
|
||||||
CleanRecent();
|
CleanRecent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,6 +256,12 @@ void Config::Save()
|
||||||
pspConfig->Set("WlanPowerSave", bWlanPowerSave);
|
pspConfig->Set("WlanPowerSave", bWlanPowerSave);
|
||||||
pspConfig->Set("EncryptSave", bEncryptSave);
|
pspConfig->Set("EncryptSave", bEncryptSave);
|
||||||
|
|
||||||
|
IniFile::Section *debugConfig = iniFile.GetOrCreateSection("Debugger");
|
||||||
|
debugConfig->Set("DisasmWindowX", iDisasmWindowX);
|
||||||
|
debugConfig->Set("DisasmWindowY", iDisasmWindowY);
|
||||||
|
debugConfig->Set("DisasmWindowW", iDisasmWindowW);
|
||||||
|
debugConfig->Set("DisasmWindowH", iDisasmWindowH);
|
||||||
|
|
||||||
if (!iniFile.Save(iniFilename_.c_str())) {
|
if (!iniFile.Save(iniFilename_.c_str())) {
|
||||||
ERROR_LOG(LOADER, "Error saving config - can't write ini %s", iniFilename_.c_str());
|
ERROR_LOG(LOADER, "Error saving config - can't write ini %s", iniFilename_.c_str());
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -127,6 +127,12 @@ public:
|
||||||
int iWlanAdhocChannel;
|
int iWlanAdhocChannel;
|
||||||
bool bWlanPowerSave;
|
bool bWlanPowerSave;
|
||||||
|
|
||||||
|
// Debugger
|
||||||
|
int iDisasmWindowX;
|
||||||
|
int iDisasmWindowY;
|
||||||
|
int iDisasmWindowW;
|
||||||
|
int iDisasmWindowH;
|
||||||
|
|
||||||
std::string currentDirectory;
|
std::string currentDirectory;
|
||||||
std::string externalDirectory;
|
std::string externalDirectory;
|
||||||
std::string memCardDirectory;
|
std::string memCardDirectory;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// NOTE: Apologies for the quality of this code, this is really from pre-opensource Dolphin - that is, 2003.
|
// NOTE: Apologies for the quality of this code, this is really from pre-opensource Dolphin - that is, 2003.
|
||||||
|
|
||||||
#include "../../Core/MemMap.h"
|
#include "Core/Config.h"
|
||||||
|
#include "Core/MemMap.h"
|
||||||
#include "../Resource.h"
|
#include "../Resource.h"
|
||||||
#include "../InputBox.h"
|
#include "../InputBox.h"
|
||||||
|
|
||||||
|
@ -37,17 +38,24 @@ CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Di
|
||||||
//if (WTL::CTheme::IsThemingSupported())
|
//if (WTL::CTheme::IsThemingSupported())
|
||||||
//EnableThemeDialogTexture(m_hDlg ,ETDT_ENABLETAB);
|
//EnableThemeDialogTexture(m_hDlg ,ETDT_ENABLETAB);
|
||||||
#endif
|
#endif
|
||||||
SetWindowPos(m_hDlg,0,500,200,0,0,SWP_NOSIZE);
|
int x = g_Config.iDisasmWindowX == -1 ? 500 : g_Config.iDisasmWindowX;
|
||||||
|
int y = g_Config.iDisasmWindowY == -1 ? 200 : g_Config.iDisasmWindowY;
|
||||||
|
int w = g_Config.iDisasmWindowW;
|
||||||
|
int h = g_Config.iDisasmWindowH;
|
||||||
|
// Start with the initial size so we have the right minimum size from the rc.
|
||||||
|
SetWindowPos(m_hDlg, 0, x, y, 0, 0, SWP_NOSIZE);
|
||||||
|
|
||||||
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
|
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
|
||||||
ptr->setDebugger(cpu);
|
ptr->setDebugger(cpu);
|
||||||
ptr->gotoAddr(0x00000000);
|
ptr->gotoAddr(0x00000000);
|
||||||
|
|
||||||
CtrlRegisterList *rl = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
|
CtrlRegisterList *rl = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
|
||||||
|
|
||||||
rl->setCPU(cpu);
|
rl->setCPU(cpu);
|
||||||
|
|
||||||
GetWindowRect(m_hDlg,&minRect);
|
GetWindowRect(m_hDlg,&minRect);
|
||||||
|
// Reduce the minimum size slightly, so they can size it however they like.
|
||||||
|
minRect.right -= 100;
|
||||||
|
minRect.bottom -= 100;
|
||||||
|
|
||||||
//symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
|
//symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
|
||||||
symbolMap.FillSymbolComboBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
|
symbolMap.FillSymbolComboBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
|
||||||
|
@ -83,6 +91,13 @@ CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Di
|
||||||
// --- activate debug mode ---
|
// --- activate debug mode ---
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// Actually resize the window to the proper size (after the above setup.)
|
||||||
|
if (w != -1 && h != -1)
|
||||||
|
{
|
||||||
|
SetWindowPos(m_hDlg, 0, x, y, w, h, 0);
|
||||||
|
UpdateSize(w, h);
|
||||||
|
}
|
||||||
|
|
||||||
SetDebugMode(true);
|
SetDebugMode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,19 +350,15 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
{
|
{
|
||||||
HWND disasm = GetDlgItem(m_hDlg, IDC_DISASMVIEW);
|
UpdateSize(LOWORD(lParam), HIWORD(lParam));
|
||||||
HWND funclist = GetDlgItem(m_hDlg, IDC_FUNCTIONLIST);
|
SavePosition();
|
||||||
HWND regList = GetDlgItem(m_hDlg, IDC_REGLIST);
|
|
||||||
int wf = regRect.right-regRect.left;
|
|
||||||
int top = 138;
|
|
||||||
MoveWindow(regList,8,top,wf,HIWORD(lParam)-top-8,TRUE);
|
|
||||||
MoveWindow(funclist,8,top,wf,HIWORD(lParam)-top-8,TRUE);
|
|
||||||
int w = LOWORD(lParam)-wf;
|
|
||||||
top = 25;
|
|
||||||
MoveWindow(disasm,wf+15,top, w-20,HIWORD(lParam)-top-8,TRUE);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case WM_MOVE:
|
||||||
|
SavePosition();
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_GETMINMAXINFO:
|
case WM_GETMINMAXINFO:
|
||||||
{
|
{
|
||||||
MINMAXINFO *m = (MINMAXINFO *)lParam;
|
MINMAXINFO *m = (MINMAXINFO *)lParam;
|
||||||
|
@ -363,6 +374,32 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDisasm::UpdateSize(WORD width, WORD height)
|
||||||
|
{
|
||||||
|
HWND disasm = GetDlgItem(m_hDlg, IDC_DISASMVIEW);
|
||||||
|
HWND funclist = GetDlgItem(m_hDlg, IDC_FUNCTIONLIST);
|
||||||
|
HWND regList = GetDlgItem(m_hDlg, IDC_REGLIST);
|
||||||
|
int wf = regRect.right - regRect.left;
|
||||||
|
int top = 138;
|
||||||
|
MoveWindow(regList, 8, top, wf, height - top - 8, TRUE);
|
||||||
|
MoveWindow(funclist, 8, top, wf, height - top - 8, TRUE);
|
||||||
|
int w = width - wf;
|
||||||
|
top = 25;
|
||||||
|
MoveWindow(disasm, wf + 15,top, w - 20, height - top - 8, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDisasm::SavePosition()
|
||||||
|
{
|
||||||
|
RECT rc;
|
||||||
|
if (GetWindowRect(m_hDlg, &rc))
|
||||||
|
{
|
||||||
|
g_Config.iDisasmWindowX = rc.left;
|
||||||
|
g_Config.iDisasmWindowY = rc.top;
|
||||||
|
g_Config.iDisasmWindowW = rc.right - rc.left;
|
||||||
|
g_Config.iDisasmWindowH = rc.bottom - rc.top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CDisasm::SetDebugMode(bool _bDebug)
|
void CDisasm::SetDebugMode(bool _bDebug)
|
||||||
{
|
{
|
||||||
HWND hDlg = m_hDlg;
|
HWND hDlg = m_hDlg;
|
||||||
|
|
|
@ -22,6 +22,8 @@ private:
|
||||||
DebugInterface *cpu;
|
DebugInterface *cpu;
|
||||||
|
|
||||||
BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
void UpdateSize(WORD width, WORD height);
|
||||||
|
void SavePosition();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int index; //helper
|
int index; //helper
|
||||||
|
|
Loading…
Add table
Reference in a new issue