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
This commit is contained in:
stephena 2004-08-06 01:53:06 +00:00
parent b99c0af7e1
commit 80df37627e
3 changed files with 23 additions and 21 deletions

View File

@ -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 );
@ -581,6 +581,9 @@ bool MainDlg::LoadRomListFromDisk()
int iItem = 0;
bool done = (hFind == INVALID_HANDLE_VALUE);
while(!done)
{
// Make sure we're only looking at files
if( !(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
{
Game* g = new Game();
if( g == NULL )
@ -594,14 +597,13 @@ bool MainDlg::LoadRomListFromDisk()
lvi.lParam = (LPARAM) g;
int nItem = ListView_InsertItem( myHwndList, &lvi );
ASSERT( nItem != -1 );
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 );
}
// 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();

Binary file not shown.

View File

@ -125,7 +125,7 @@ BEGIN
RTEXT "<status>",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