From 6fa78df786b77ec685106f963c53ff07bc424fcf Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 18 May 2008 21:32:55 +0000 Subject: [PATCH] remember more window positions --- src/drivers/win/config.cpp | 9 +++++++++ src/drivers/win/ntview.cpp | 7 ++++--- src/drivers/win/window.cpp | 14 +++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index aa5a1860..9fd3ecac 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -46,6 +46,9 @@ extern int ChtPosX,ChtPosY; extern int DbgPosX,DbgPosY; extern int MemView_wndx, MemView_wndy; extern int MemFind_wndx, MemFind_wndy; +extern int NTViewPosX,NTViewPosY; +extern int PPUViewPosX,PPUViewPosY; +extern int MainWindow_wndx, MainWindow_wndy; /** * Structure that contains configuration information @@ -159,6 +162,12 @@ static CFGSTRUCT fceuconfig[] = { AC(MemView_wndy), AC(MemFind_wndx), AC(MemFind_wndy), + AC(NTViewPosX), + AC(NTViewPosY), + AC(PPUViewPosX), + AC(PPUViewPosY), + AC(MainWindow_wndx), + AC(MainWindow_wndy), //ACS(memwLastfile[2048]), ENDCFGSTRUCT diff --git a/src/drivers/win/ntview.cpp b/src/drivers/win/ntview.cpp index 59779745..faa8a04f 100644 --- a/src/drivers/win/ntview.cpp +++ b/src/drivers/win/ntview.cpp @@ -32,6 +32,7 @@ HWND hNTView; int NTViewPosX,NTViewPosY; + static uint8 palcache[32]; //palette cache //mbg merge 7/19/06 needed to be static //uint8 ntcache0[0x400],ntcache1[0x400],ntcache2[0x400],ntcache3[0x400]; //cache CHR, fixes a refresh problem when right-clicking uint8 *ntable0, *ntable1, *ntable2, *ntable3; //name table bitmap array @@ -410,7 +411,7 @@ BOOL CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) switch(uMsg) { case WM_INITDIALOG: - //SetWindowPos(hwndDlg,0,PPUViewPosX,PPUViewPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER); + SetWindowPos(hwndDlg,0,NTViewPosX,NTViewPosY,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER); //prepare the bitmap attributes //pattern tables @@ -472,8 +473,8 @@ BOOL CALLBACK NTViewCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) break; case WM_MOVE: GetWindowRect(hwndDlg,&wrect); - //NTViewPosX = wrect.left; //todo: is this needed? - //NTViewPosY = wrect.top; + NTViewPosX = wrect.left; + NTViewPosY = wrect.top; break; case WM_RBUTTONDBLCLK: case WM_RBUTTONDOWN: diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index e4b17d7b..6d27a7de 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -98,6 +98,7 @@ static int CheckedAutoFireOffset = MENU_AUTOFIRE_OFFSET_1; static HMENU recentmenu, recentdmenu; static LONG WindowXC=1<<30,WindowYC; +int MainWindow_wndx, MainWindow_wndy; static uint32 mousex,mousey,mouseb; @@ -602,6 +603,13 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) mouseb=wParam; goto proco; + case WM_MOVE: { + RECT wrect; + GetWindowRect(hWnd,&wrect); + MainWindow_wndx = wrect.left; + MainWindow_wndy = wrect.top; + } + case WM_MOUSEMOVE: { mousex=LOWORD(lParam); @@ -1329,8 +1337,8 @@ int CreateMainWindow() "FCEULTRA", "FCE Ultra", WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS, /* Style */ - CW_USEDEFAULT, - CW_USEDEFAULT, + MainWindow_wndx, + MainWindow_wndy, 256, 240, /* X,Y ; Width, Height */ NULL, @@ -1338,7 +1346,7 @@ int CreateMainWindow() fceu_hInstance, NULL ); - CenterWindowOnScreen(hAppWnd); + //CenterWindowOnScreen(hAppWnd); DragAcceptFiles(hAppWnd, 1);