mirror of https://github.com/stella-emu/stella.git
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:
parent
b99c0af7e1
commit
80df37627e
|
@ -14,7 +14,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// 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"
|
#include "pch.hxx"
|
||||||
|
@ -571,7 +571,7 @@ bool MainDlg::LoadRomListFromDisk()
|
||||||
// Get the location of the romfiles (*.bin)
|
// Get the location of the romfiles (*.bin)
|
||||||
string romdir = myGlobalData.settings().getString("romdir");
|
string romdir = myGlobalData.settings().getString("romdir");
|
||||||
romdir += "\\";
|
romdir += "\\";
|
||||||
string romfiles = romdir + "*.bin";
|
string romfiles = romdir + "*";
|
||||||
|
|
||||||
WIN32_FIND_DATA ffd;
|
WIN32_FIND_DATA ffd;
|
||||||
HANDLE hFind = FindFirstFile( romfiles.c_str(), &ffd );
|
HANDLE hFind = FindFirstFile( romfiles.c_str(), &ffd );
|
||||||
|
@ -582,26 +582,28 @@ bool MainDlg::LoadRomListFromDisk()
|
||||||
bool done = (hFind == INVALID_HANDLE_VALUE);
|
bool done = (hFind == INVALID_HANDLE_VALUE);
|
||||||
while(!done)
|
while(!done)
|
||||||
{
|
{
|
||||||
Game* g = new Game();
|
// Make sure we're only looking at files
|
||||||
if( g == NULL )
|
if( !(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
|
||||||
return false;
|
{
|
||||||
|
Game* g = new Game();
|
||||||
|
if( g == NULL )
|
||||||
|
return false;
|
||||||
|
|
||||||
LV_ITEM lvi;
|
LV_ITEM lvi;
|
||||||
lvi.mask = LVIF_TEXT | LVIF_PARAM;
|
lvi.mask = LVIF_TEXT | LVIF_PARAM;
|
||||||
lvi.iItem = iItem++;
|
lvi.iItem = iItem++;
|
||||||
lvi.iSubItem = 0;
|
lvi.iSubItem = 0;
|
||||||
lvi.pszText = "";
|
lvi.pszText = "";
|
||||||
lvi.lParam = (LPARAM) g;
|
lvi.lParam = (LPARAM) g;
|
||||||
int nItem = ListView_InsertItem( myHwndList, &lvi );
|
int nItem = ListView_InsertItem( myHwndList, &lvi );
|
||||||
|
|
||||||
ASSERT( nItem != -1 );
|
g->setAvailable( true );
|
||||||
|
g->setRom( ffd.cFileName );
|
||||||
|
|
||||||
g->setAvailable( true );
|
// Set the name (shown onscreen) to be the rom
|
||||||
g->setRom( ffd.cFileName );
|
// 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
|
// go to the next rom file
|
||||||
done = !FindNextFile(hFind, &ffd);
|
done = !FindNextFile(hFind, &ffd);
|
||||||
|
@ -638,7 +640,7 @@ bool MainDlg::LoadRomListFromDisk()
|
||||||
string rom = romdir + g->rom();
|
string rom = romdir + g->rom();
|
||||||
ifstream in(rom.c_str(), ios_base::binary);
|
ifstream in(rom.c_str(), ios_base::binary);
|
||||||
if(!in)
|
if(!in)
|
||||||
return false;
|
continue;
|
||||||
uInt8* image = new uInt8[512 * 1024];
|
uInt8* image = new uInt8[512 * 1024];
|
||||||
in.read((char*)image, 512 * 1024);
|
in.read((char*)image, 512 * 1024);
|
||||||
uInt32 size = in.gcount();
|
uInt32 size = in.gcount();
|
||||||
|
|
Binary file not shown.
|
@ -125,7 +125,7 @@ BEGIN
|
||||||
RTEXT "<status>",IDC_ROMCOUNT,322,45,80,8,SS_NOPREFIX
|
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,39,411,1
|
||||||
CONTROL "",-1,"Static",SS_ETCHEDHORZ,0,218,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
|
BS_CENTER | BS_TOP | WS_DISABLED | WS_TABSTOP,7,7,145,22
|
||||||
CONTROL "Static",IDC_ROMPATH,"Static",SS_LEFTNOWORDWRAP |
|
CONTROL "Static",IDC_ROMPATH,"Static",SS_LEFTNOWORDWRAP |
|
||||||
SS_NOPREFIX | WS_GROUP,57,45,254,8
|
SS_NOPREFIX | WS_GROUP,57,45,254,8
|
||||||
|
|
Loading…
Reference in New Issue