From 80df37627ed958f665183f591bfc3d4ad3d8111e Mon Sep 17 00:00:00 2001 From: stephena Date: Fri, 6 Aug 2004 01:53:06 +0000 Subject: [PATCH] Removed requirement for ROM files to be named *.bin. The specified ROM directory is now searched for *all* files, no matter what they're called. Bumped the version number to 1.4.1 in the main dialog. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@335 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/win32/StellaX/MainDlg.cxx | 42 ++++++++++++++------------- stella/src/win32/StellaX/StellaX.aps | Bin 41076 -> 41080 bytes stella/src/win32/StellaX/StellaX.rc | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/stella/src/win32/StellaX/MainDlg.cxx b/stella/src/win32/StellaX/MainDlg.cxx index 8d84b11a6..026b6f531 100644 --- a/stella/src/win32/StellaX/MainDlg.cxx +++ b/stella/src/win32/StellaX/MainDlg.cxx @@ -14,7 +14,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: MainDlg.cxx,v 1.8 2004-07-17 19:34:01 stephena Exp $ +// $Id: MainDlg.cxx,v 1.9 2004-08-06 01:53:05 stephena Exp $ //============================================================================ #include "pch.hxx" @@ -571,7 +571,7 @@ bool MainDlg::LoadRomListFromDisk() // Get the location of the romfiles (*.bin) string romdir = myGlobalData.settings().getString("romdir"); romdir += "\\"; - string romfiles = romdir + "*.bin"; + string romfiles = romdir + "*"; WIN32_FIND_DATA ffd; HANDLE hFind = FindFirstFile( romfiles.c_str(), &ffd ); @@ -582,26 +582,28 @@ bool MainDlg::LoadRomListFromDisk() bool done = (hFind == INVALID_HANDLE_VALUE); while(!done) { - Game* g = new Game(); - if( g == NULL ) - return false; + // Make sure we're only looking at files + if( !(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) + { + Game* g = new Game(); + if( g == NULL ) + return false; - LV_ITEM lvi; - lvi.mask = LVIF_TEXT | LVIF_PARAM; - lvi.iItem = iItem++; - lvi.iSubItem = 0; - lvi.pszText = ""; - lvi.lParam = (LPARAM) g; - int nItem = ListView_InsertItem( myHwndList, &lvi ); + LV_ITEM lvi; + lvi.mask = LVIF_TEXT | LVIF_PARAM; + lvi.iItem = iItem++; + lvi.iSubItem = 0; + lvi.pszText = ""; + lvi.lParam = (LPARAM) g; + int nItem = ListView_InsertItem( myHwndList, &lvi ); - ASSERT( nItem != -1 ); + g->setAvailable( true ); + g->setRom( ffd.cFileName ); - g->setAvailable( true ); - g->setRom( ffd.cFileName ); - - // Set the name (shown onscreen) to be the rom - // It will be overwritten later if a name is found in the properties set - g->setName( ffd.cFileName ); + // Set the name (shown onscreen) to be the rom + // It will be overwritten later if a name is found in the properties set + g->setName( ffd.cFileName ); + } // go to the next rom file done = !FindNextFile(hFind, &ffd); @@ -638,7 +640,7 @@ bool MainDlg::LoadRomListFromDisk() string rom = romdir + g->rom(); ifstream in(rom.c_str(), ios_base::binary); if(!in) - return false; + continue; uInt8* image = new uInt8[512 * 1024]; in.read((char*)image, 512 * 1024); uInt32 size = in.gcount(); diff --git a/stella/src/win32/StellaX/StellaX.aps b/stella/src/win32/StellaX/StellaX.aps index 63ed383de3dbea0f003afc70f7f26ce86d516315..70569f2354a85a940e23344b08dd49debdefdd66 100644 GIT binary patch delta 213 zcmexzfa%8prU@=gKjuvK^3D13Og=Lw>&=v64FkF^WwPV~d8RwFC-0jr#kK$_5HV-6)f_1RPsu;K delta 190 zcmexyfa%KtrU@=gU*=5q",IDC_ROMCOUNT,322,45,80,8,SS_NOPREFIX CONTROL "",-1,"Static",SS_ETCHEDHORZ,0,39,411,1 CONTROL "",-1,"Static",SS_ETCHEDHORZ,0,218,411,1 - CONTROL "StellaX v1.4",IDC_TITLE,"Button",BS_OWNERDRAW | + CONTROL "StellaX v1.4.1",IDC_TITLE,"Button",BS_OWNERDRAW | BS_CENTER | BS_TOP | WS_DISABLED | WS_TABSTOP,7,7,145,22 CONTROL "Static",IDC_ROMPATH,"Static",SS_LEFTNOWORDWRAP | SS_NOPREFIX | WS_GROUP,57,45,254,8