win32: cleanup gbaslot configuration dialog

This commit is contained in:
zeromus 2009-11-30 01:58:05 +00:00
parent 78d9f41bee
commit 9b5bac0646
2 changed files with 21 additions and 24 deletions

View File

@ -1,4 +1,4 @@
0.9.5 -> 0.9.6 (r3075-r3???) 0.9.5 -> 0.9.6 (r3075-r3107-r3xxx)
General/Core: General/Core:
bug: emulate keypad interrupt bug: emulate keypad interrupt
@ -8,10 +8,15 @@ General/Core:
Graphics: Graphics:
bug: fix a mistakenly rendered OBJ window bug: fix a mistakenly rendered OBJ window
Windows:
bug: fix 16bpp display
enh: add EPX and EPX1.5X resize filters
0.9.4 -> 0.9.5 (r2437-r3075) 0.9.4 -> 0.9.5 (r2437-r3075)
0.9.5 introduces an entirely rewritten main emulation loop 0.9.5 introduces an entirely rewritten main emulation loop
This totally changes the timing, and totally breaks old savestates. This totally changes the timing, and totally breaks old savestates.
The OSX build is now based on the GTK port which is more up-to-date.
Assorted Highlights: Assorted Highlights:
* synchronous SPU mode to fix streaming sounds * synchronous SPU mode to fix streaming sounds

View File

@ -60,11 +60,10 @@ INT_PTR CALLBACK GbaSlotCFlash(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
SetWindowText(GetDlgItem(dialog, IDC_PATHIMG), tmp_cflash_filename);
SetWindowText(GetDlgItem(dialog, IDC_PATH), tmp_cflash_path);
switch (tmp_CFlashMode) switch (tmp_CFlashMode)
{ {
case ADDON_CFLASH_MODE_Path: case ADDON_CFLASH_MODE_Path:
SetFocus(GetDlgItem(dialog,IDC_RFOLDER));
CheckDlgButton(dialog, IDC_RFOLDER, BST_CHECKED); CheckDlgButton(dialog, IDC_RFOLDER, BST_CHECKED);
EnableWindow(GetDlgItem(dialog, IDC_PATH), TRUE); EnableWindow(GetDlgItem(dialog, IDC_PATH), TRUE);
EnableWindow(GetDlgItem(dialog, IDC_BBROWSE2), TRUE); EnableWindow(GetDlgItem(dialog, IDC_BBROWSE2), TRUE);
@ -74,6 +73,7 @@ INT_PTR CALLBACK GbaSlotCFlash(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam
break; break;
case ADDON_CFLASH_MODE_File: case ADDON_CFLASH_MODE_File:
SetFocus(GetDlgItem(dialog,IDC_RFILE));
CheckDlgButton(dialog, IDC_RFILE, BST_CHECKED); CheckDlgButton(dialog, IDC_RFILE, BST_CHECKED);
EnableWindow(GetDlgItem(dialog, IDC_PATHIMG), TRUE); EnableWindow(GetDlgItem(dialog, IDC_PATHIMG), TRUE);
EnableWindow(GetDlgItem(dialog, IDC_BBROWSE), TRUE); EnableWindow(GetDlgItem(dialog, IDC_BBROWSE), TRUE);
@ -83,6 +83,7 @@ INT_PTR CALLBACK GbaSlotCFlash(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam
break; break;
case ADDON_CFLASH_MODE_RomPath: case ADDON_CFLASH_MODE_RomPath:
SetFocus(GetDlgItem(dialog,IDC_PATHDESMUME));
CheckDlgButton(dialog, IDC_PATHDESMUME, BST_CHECKED); CheckDlgButton(dialog, IDC_PATHDESMUME, BST_CHECKED);
EnableWindow(GetDlgItem(dialog, IDC_PATH), FALSE); EnableWindow(GetDlgItem(dialog, IDC_PATH), FALSE);
EnableWindow(GetDlgItem(dialog, IDC_BBROWSE2), FALSE); EnableWindow(GetDlgItem(dialog, IDC_BBROWSE2), FALSE);
@ -90,11 +91,10 @@ INT_PTR CALLBACK GbaSlotCFlash(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam
EnableWindow(GetDlgItem(dialog, IDC_BBROWSE), FALSE); EnableWindow(GetDlgItem(dialog, IDC_BBROWSE), FALSE);
_OKbutton = TRUE; _OKbutton = TRUE;
break; break;
default:
return FALSE;
} }
return TRUE; SetWindowText(GetDlgItem(dialog, IDC_PATHIMG), tmp_cflash_filename);
SetWindowText(GetDlgItem(dialog, IDC_PATH), tmp_cflash_path);
return FALSE;
} }
case WM_COMMAND: case WM_COMMAND:
@ -105,19 +105,15 @@ INT_PTR CALLBACK GbaSlotCFlash(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam
{ {
int filterSize = 0, i = 0; int filterSize = 0, i = 0;
OPENFILENAME ofn; OPENFILENAME ofn;
char filename[MAX_PATH] = "", char filename[MAX_PATH] = "";
fileFilter[512]="";
ZeroMemory(&ofn, sizeof(ofn)); ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn); ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = dialog; ofn.hwndOwner = dialog;
strncpy (fileFilter, "Compact Flash image (*.img)|*.img||",512 - strlen(fileFilter)); const char *fileFilter = "Compact Flash image (*.img)\0*.img\0Any file (*.*)\0*.*\0";
strncat (fileFilter, "Any file (*.*)|*.*||",512 - strlen(fileFilter));
filterSize = strlen(fileFilter);
for (i = 0; i < filterSize; i++)
if (fileFilter[i] == '|') fileFilter[i] = '\0';
ofn.lpstrFilter = fileFilter; ofn.lpstrFilter = fileFilter;
ofn.nFilterIndex = 1; ofn.nFilterIndex = 1;
ofn.lpstrFile = filename; ofn.lpstrFile = filename;
@ -144,7 +140,7 @@ INT_PTR CALLBACK GbaSlotCFlash(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam
bp.pidlRoot=NULL; bp.pidlRoot=NULL;
bp.pszDisplayName=NULL; bp.pszDisplayName=NULL;
bp.lpszTitle="Select directory for Compact Flash"; bp.lpszTitle="Select directory for Compact Flash";
bp.ulFlags=BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE; bp.ulFlags=BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE | BIF_USENEWUI;
bp.lpfn=NULL; bp.lpfn=NULL;
LPITEMIDLIST tmp = SHBrowseForFolder((LPBROWSEINFO)&bp); LPITEMIDLIST tmp = SHBrowseForFolder((LPBROWSEINFO)&bp);
@ -173,7 +169,6 @@ INT_PTR CALLBACK GbaSlotCFlash(HWND dialog, UINT msg,WPARAM wparam,LPARAM lparam
EnableWindow(GetDlgItem(dialog, IDC_BBROWSE2), FALSE); EnableWindow(GetDlgItem(dialog, IDC_BBROWSE2), FALSE);
EnableWindow(GetDlgItem(dialog, IDC_PATH), FALSE); EnableWindow(GetDlgItem(dialog, IDC_PATH), FALSE);
if (!strlen(tmp_cflash_filename)) if (!strlen(tmp_cflash_filename))
EnableWindow(OKbutton, FALSE); EnableWindow(OKbutton, FALSE);
} }
@ -248,20 +243,17 @@ INT_PTR CALLBACK GbaSlotGBAgame(HWND dialog, UINT msg,WPARAM wparam,LPARAM lpara
{ {
int filterSize = 0, i = 0; int filterSize = 0, i = 0;
OPENFILENAME ofn; OPENFILENAME ofn;
char filename[MAX_PATH] = "", char filename[MAX_PATH] = "";
fileFilter[512]="";
ZeroMemory(&ofn, sizeof(ofn)); ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn); ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = dialog; ofn.hwndOwner = dialog;
// TODO: add another gba file formats and archs // TODO: add another gba file formats and archs (??wtf??)
strncpy (fileFilter, "GameBoy Advance ROM (*.gba)|*.gba||",512 - strlen(fileFilter)); const char* fileFilter = "GameBoy Advance ROM (*.gba)\0*.gba\0"
strncat (fileFilter, "Any file (*.*)|*.*||",512 - strlen(fileFilter)); "NDS ROM (for nitroFS roms) (*.nds)\0*.nds\0"
"Any file (*.*)\0*.*\0";
filterSize = strlen(fileFilter);
for (i = 0; i < filterSize; i++)
if (fileFilter[i] == '|') fileFilter[i] = '\0';
ofn.lpstrFilter = fileFilter; ofn.lpstrFilter = fileFilter;
ofn.nFilterIndex = 1; ofn.nFilterIndex = 1;
ofn.lpstrFile = filename; ofn.lpstrFile = filename;