win32: add Quick load game
- Quick load game: RomData / IPS / NeoGeo-CD / Zip & 7z - Quick load game: Accepts external directory paths as input, and will be extended to cmdline in the future - Remove Quick Scan (which does not allow for quick differentiation between arcade and consoles by zip_name) - ips_manager: Allow external ips patches to be mounted - ips_manager: Improve the hierarchy of ips patches in internal directory paths
This commit is contained in:
parent
13fb8e1711
commit
dc61f13375
|
@ -996,11 +996,19 @@ BEGIN
|
|||
POPUP "Game"
|
||||
BEGIN
|
||||
MENUITEM "Load game...\tF6", MENU_LOAD
|
||||
POPUP "RomData function"
|
||||
POPUP "Quick load game"
|
||||
BEGIN
|
||||
MENUITEM "Select RomData ...", MENU_LOAD_ROMDATA, GRAYED
|
||||
MENUITEM "Open RomData Manager\tCtrl+R", MENU_ROMDATA_MANAGER, GRAYED
|
||||
MENUITEM "Select RomData dat...", MENU_LOAD_ROMDATA, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Select IPS patch dat...", MENU_LOAD_IPSPATCH, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Select NeoGeo-CD cue sheet...", MENU_LOAD_NEOGEOCD, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Select Archive file...", MENU_LOAD_ARCHIVE, GRAYED
|
||||
END
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Open RomData manager\tCtrl+R", MENU_ROMDATA_MANAGER, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Play via Kaillera...", MENU_STARTNET
|
||||
POPUP "Most recent games..."
|
||||
BEGIN
|
||||
|
@ -1343,7 +1351,6 @@ BEGIN
|
|||
MENUITEM "Create support folders at runtime", MENU_CREATEDIRS
|
||||
MENUITEM "Show Game List at start-up", MENU_AUTOLOADGAMELIST
|
||||
MENUITEM "Scan ROMs at start-up (if needed)", MENU_AUTOSCANGAMELIST
|
||||
MENUITEM "Quickly scan directories (zip only)", MENU_QUICKSCANGAMELIST
|
||||
MENUITEM SEPARATOR
|
||||
POPUP "Menu options"
|
||||
BEGIN
|
||||
|
|
|
@ -229,6 +229,7 @@ void DisableHighResolutionTiming();
|
|||
// drv.cpp
|
||||
extern int bDrvOkay; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions
|
||||
extern TCHAR szAppRomPaths[DIRS_MAX][MAX_PATH];
|
||||
extern TCHAR szAppQuickPath[MAX_PATH];
|
||||
int DrvInit(int nDrvNum, bool bRestore);
|
||||
int DrvInitCallback(); // Used when Burn library needs to load a game. DrvInit(nBurnSelect, false)
|
||||
int DrvExit();
|
||||
|
@ -263,7 +264,7 @@ extern HWND hRebar; // Handle to the Rebar control containing the menu
|
|||
extern HWND hwndChat;
|
||||
extern bool bRescanRoms;
|
||||
extern bool bMenuEnabled;
|
||||
extern bool bQuicklyCheck;
|
||||
extern INT32 nQuickOpen;
|
||||
|
||||
extern RECT SystemWorkArea; // The full screen area
|
||||
extern int nWindowPosX, nWindowPosY;
|
||||
|
@ -277,7 +278,7 @@ int ScrnTitle();
|
|||
void SetPauseMode(bool bPause);
|
||||
int ActivateChat();
|
||||
void DeActivateChat();
|
||||
int BurnerLoadDriver(TCHAR *szDriverName);
|
||||
int BurnerLoadDriver(TCHAR *pszDriverName);
|
||||
int StartFromReset(TCHAR *szDriverName, bool bLoadSram);
|
||||
void PausedRedraw(void);
|
||||
INT32 is_netgame_or_recording();
|
||||
|
@ -285,11 +286,15 @@ void ScrnInitLua();
|
|||
void ScrnExitLua();
|
||||
char* DecorateKailleraGameName(UINT32 nBurnDrv);
|
||||
INT32 CreateAllDatfilesWindows(bool bSilent = false, const TCHAR* pszSpecDir = NULL);
|
||||
INT32 RomDataLoadDriver(TCHAR* szSelDat);
|
||||
INT32 RomDataLoadDriver(const TCHAR* pszSelDat);
|
||||
INT32 BurnerQuickLoad(const INT32 nMode, const TCHAR* pszSelect);
|
||||
|
||||
// bzip.cpp
|
||||
INT32 ArchiveNameFindDrv(const TCHAR* pszSelArc);
|
||||
|
||||
// menu.cpp
|
||||
#define UM_DISPLAYPOPUP (WM_USER + 0x0100)
|
||||
#define UM_CANCELPOPUP (WM_USER + 0x0101)
|
||||
#define UM_CANCELPOPUP (WM_USER + 0x0101)
|
||||
|
||||
extern HANDLE hMenuThread; // Handle to the thread that executes TrackPopupMenuEx
|
||||
extern DWORD nMenuThreadID; // ID of the thread that executes TrackPopupMenuEx
|
||||
|
@ -381,6 +386,7 @@ TCHAR* RomdataGetDrvName(const TCHAR* pszFileName);
|
|||
TCHAR* RomdataGetFullName(const TCHAR* pszFileName);
|
||||
bool FindZipNameFromDats(const TCHAR* dirPath, const char* pszZipName, TCHAR* pszFindDat);
|
||||
INT32 RomDataManagerInit();
|
||||
bool RomDataSetQuickPath(const TCHAR* pszSelDat);
|
||||
INT32 RomDataCheck(const TCHAR* pszDatFile);
|
||||
void RomDataStateBackup();
|
||||
void RomDataStateRestore();
|
||||
|
@ -474,7 +480,6 @@ extern INT32 nRomsDlgHeight;
|
|||
extern char* gameAv;
|
||||
extern bool avOk;
|
||||
extern bool bSkipStartupCheck;
|
||||
extern bool bQuicklyScan;
|
||||
INT32 RomsDirCreate(HWND hParentWND);
|
||||
INT32 CreateROMInfo(HWND hParentWND);
|
||||
void FreeROMInfo();
|
||||
|
@ -549,6 +554,7 @@ extern INT32 nIpsSelectedLanguage;
|
|||
INT32 GetIpsNumPatches();
|
||||
INT32 LoadIpsActivePatches();
|
||||
INT32 IpsManagerCreate(HWND hParentWND);
|
||||
INT32 IpsGetDrvForQuickOpen(const TCHAR* pszSelDat);
|
||||
|
||||
// localise_download.cpp
|
||||
int LocaliseDownloadCreate(HWND hParentWND);
|
||||
|
|
|
@ -380,6 +380,68 @@ static INT32 __cdecl BzipBurnLoadRom(UINT8* Dest, INT32* pnWrote, INT32 i)
|
|||
return 0;
|
||||
}
|
||||
|
||||
INT32 ArchiveNameFindDrv(const TCHAR* pszSelArc)
|
||||
{
|
||||
const UINT32 nOldDrvSel = nBurnDrvActive, nArcNameLen = _tcslen(szAppQuickPath);
|
||||
const TCHAR* p = pszSelArc + nArcNameLen, * pszExt = _tcsrchr((TCHAR*)pszSelArc, _T('.'));
|
||||
INT32 nDrvIdx = -1;
|
||||
|
||||
TCHAR szArcName[64] = { 0 }, szArcNoExt[MAX_PATH] = { 0 };
|
||||
_tcsncpy(szArcName, p, pszExt - p);
|
||||
_tcsncpy(szArcNoExt, pszSelArc, pszExt - pszSelArc);
|
||||
|
||||
for (UINT32 i = 0; (i < nBurnDrvCount) && (nDrvIdx < 0); i++) {
|
||||
nBurnDrvActive = i;
|
||||
const UINT32 nFlag = BurnDrvGetFlags();
|
||||
|
||||
if (nFlag & BDF_BOARDROM)
|
||||
continue;
|
||||
|
||||
for (int z = 0; z < BZIP_MAX; z++) {
|
||||
char* szName = NULL;
|
||||
if (BurnDrvGetZipName(&szName, z))
|
||||
break;
|
||||
|
||||
const TCHAR* pszName = _AtoT(szName);
|
||||
if (0 != _tcsicmp(szArcName, pszName))
|
||||
continue;
|
||||
|
||||
if (nFlag & BDF_CLONE) {
|
||||
const TCHAR* pszParent = BurnDrvGetText(DRV_PARENT);
|
||||
if ((NULL != pszParent) && (0 == _tcsicmp(szArcName, pszParent)))
|
||||
continue;
|
||||
}
|
||||
|
||||
char* pszArcNoExt = _TtoA(szArcNoExt);
|
||||
if (0 != ZipOpen(pszArcNoExt))
|
||||
continue;
|
||||
|
||||
ZipGetList(&List, &nListCount);
|
||||
for (INT32 y = 0; y < nRomCount; y++) {
|
||||
if (FindRom(y) >= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
BzipListFree();
|
||||
ZipClose();
|
||||
|
||||
nDrvIdx = i;
|
||||
z = BZIP_MAX;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nBurnDrvActive = nOldDrvSel;
|
||||
|
||||
if (nDrvIdx < 0) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("Zip / 7z:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_CONTENT), pszSelArc);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
}
|
||||
|
||||
return nDrvIdx;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
INT32 BzipStatus()
|
||||
|
@ -431,6 +493,7 @@ INT32 BzipOpen(bool bootApp)
|
|||
SubDirsListFree();
|
||||
|
||||
const char* pszDrvName = (NULL != pDataRomDesc) ? pRDI->szDrvName : NULL; // romdata mode, let's pick up the forgotten DrvName ROMs again.
|
||||
const INT32 nAppRomPaths = (nQuickOpen > 0) ? DIRS_MAX + 1 : DIRS_MAX;
|
||||
|
||||
// Locate each zip file
|
||||
for (INT32 y = 0, z = 0; y < BZIP_MAX && z < BZIP_MAX; y++) {
|
||||
|
@ -440,13 +503,10 @@ INT32 BzipOpen(bool bootApp)
|
|||
if (BurnDrvGetZipName(&szName, y)) {
|
||||
break;
|
||||
}
|
||||
if ((BurnDrvGetFlags() & BDF_BOARDROM) && bQuicklyScan)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (INT32 d = 0; d < DIRS_MAX; d++) { // Traverse the user-configured rom paths
|
||||
for (INT32 d = 0; d < nAppRomPaths; d++) { // Traverse the user-configured rom paths
|
||||
TCHAR szFullName[MAX_PATH] = { 0 }, szDrvName[MAX_PATH] = { 0 };
|
||||
const TCHAR* pszAppRomPaths = (d < DIRS_MAX) ? szAppRomPaths[d] : szAppQuickPath;
|
||||
|
||||
if (nLoadMenuShowY & (1 << 26)) {
|
||||
for (UINT32 nCount = 0; nCount < _SubDirInfo[d].nCount; nCount++) {
|
||||
|
@ -461,9 +521,6 @@ INT32 BzipOpen(bool bootApp)
|
|||
if (RomArchiveExists(szFullName)) {
|
||||
bFound = true;
|
||||
|
||||
if (bQuicklyScan) // Enable quickly scan only for overall scanning
|
||||
return 0;
|
||||
|
||||
TCHAR** newArray = (TCHAR**)realloc(_SubDirsZip.pszZipName, (_SubDirsZip.nCount + 1) * sizeof(TCHAR*));
|
||||
_SubDirsZip.pszZipName = newArray;
|
||||
|
||||
|
@ -494,17 +551,14 @@ INT32 BzipOpen(bool bootApp)
|
|||
}
|
||||
}
|
||||
|
||||
_stprintf(szFullName, _T("%s%hs"), szAppRomPaths[d], szName);
|
||||
_stprintf(szFullName, _T("%s%hs"), pszAppRomPaths, szName);
|
||||
if (NULL != pszDrvName) {
|
||||
_stprintf(szDrvName, _T("%s%hs"), szAppRomPaths[d], pszDrvName);
|
||||
_stprintf(szDrvName, _T("%s%hs"), pszAppRomPaths, pszDrvName);
|
||||
}
|
||||
|
||||
if (RomArchiveExists(szFullName)) { // Check existence of the rom zip/7z archive file
|
||||
bFound = true;
|
||||
|
||||
if (bQuicklyScan) // Enable quickly scan only for overall scanning
|
||||
return 0;
|
||||
|
||||
szBzipName[z] = (TCHAR*)malloc(MAX_PATH * sizeof(TCHAR));
|
||||
_tcscpy(szBzipName[z], szFullName);
|
||||
|
||||
|
@ -535,9 +589,6 @@ INT32 BzipOpen(bool bootApp)
|
|||
}
|
||||
}
|
||||
|
||||
if (bQuicklyScan) // Nothing found
|
||||
return 1;
|
||||
|
||||
if (!bootApp) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("\n"));
|
||||
}
|
||||
|
|
|
@ -470,7 +470,6 @@ int ConfigAppLoad()
|
|||
VAR(bBurnGunDrawReticles);
|
||||
VAR(bBurnGunPositionalMode);
|
||||
VAR(bSkipStartupCheck);
|
||||
VAR(bQuicklyCheck);
|
||||
|
||||
VAR(nSlowMo);
|
||||
|
||||
|
@ -964,9 +963,6 @@ int ConfigAppSave()
|
|||
_ftprintf(h, _T("\n// If non-zero, DISABLE start-up rom scan (if needed).\n"));
|
||||
VAR(bSkipStartupCheck);
|
||||
|
||||
_ftprintf(h, _T("\n// If non-zero, enable quickly scan directories (zip only).\n"));
|
||||
VAR(bQuicklyCheck);
|
||||
|
||||
_ftprintf(h, _T("\n// If non-zero, enable SlowMo T.A. [0 - 4]\n"));
|
||||
VAR(nSlowMo);
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ TCHAR szAppRomPaths[DIRS_MAX][MAX_PATH] = {
|
|||
{ _T("") }
|
||||
};
|
||||
|
||||
TCHAR szAppQuickPath[MAX_PATH] = _T("");
|
||||
|
||||
static bool bSaveRAM = false;
|
||||
|
||||
static INT32 nNeoCDZnAudSampleRateSave = 0;
|
||||
|
@ -304,9 +306,7 @@ int DrvExit()
|
|||
{
|
||||
if (bDrvOkay) {
|
||||
NeoCDZRateChangeback();
|
||||
|
||||
StopReplay();
|
||||
|
||||
VidExit();
|
||||
|
||||
InvalidateRect(hScrnWnd, NULL, 1);
|
||||
|
@ -325,18 +325,14 @@ int DrvExit()
|
|||
}
|
||||
|
||||
ConfigGameSave(bSaveInputs);
|
||||
|
||||
GameInpExit(); // Exit game input
|
||||
|
||||
BurnDrvExit(); // Exit the driver
|
||||
}
|
||||
}
|
||||
|
||||
BurnExtLoadRom = NULL;
|
||||
|
||||
bDrvOkay = 0; // Stop using the BurnDrv functions
|
||||
|
||||
bRunPause = 0; // Don't pause when exitted
|
||||
bDrvOkay = 0; // Stop using the BurnDrv functions
|
||||
bRunPause = 0; // Don't pause when exitted
|
||||
|
||||
if (bAudOkay && pBurnSoundOut) {
|
||||
// Write silence into the sound buffer on exit, and for drivers which don't use pBurnSoundOut
|
||||
|
@ -344,12 +340,10 @@ int DrvExit()
|
|||
}
|
||||
|
||||
CDEmuExit();
|
||||
|
||||
BurnExtCartridgeSetupCallback = NULL;
|
||||
|
||||
RomDataExit();
|
||||
|
||||
nBurnDrvActive = ~0U; // no driver selected
|
||||
BurnExtCartridgeSetupCallback = NULL;
|
||||
nBurnDrvActive = ~0U; // no driver selected
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -58,9 +58,11 @@ static IpsExtraPatch _IpsEarly = { 0 }, _IpsLast = { 0 };
|
|||
#define _TreeView_GetCheckState(hwndTV, hti) \
|
||||
((((UINT)(SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), TVIS_STATEIMAGEMASK))) >> 12) -1)
|
||||
|
||||
static INT32 FileExists(const TCHAR* szName)
|
||||
static INT32 FileExists(const TCHAR* pszName)
|
||||
{
|
||||
return GetFileAttributes(szName) != INVALID_FILE_ATTRIBUTES;
|
||||
DWORD dwAttrib = GetFileAttributes(pszName);
|
||||
return (dwAttrib != INVALID_FILE_ATTRIBUTES &&
|
||||
!(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
|
||||
}
|
||||
|
||||
static TCHAR* GameIpsConfigName()
|
||||
|
@ -78,8 +80,7 @@ INT32 GetIpsNumPatches()
|
|||
TCHAR szFilePath[MAX_PATH];
|
||||
INT32 Count = 0;
|
||||
|
||||
_stprintf(szFilePath, _T("%s%s\\"), szAppIpsPath, BurnDrvGetText(DRV_NAME));
|
||||
_tcscat(szFilePath, _T("*.dat"));
|
||||
_stprintf(szFilePath, _T("%s%s\\*.dat"), szAppIpsPath, BurnDrvGetText(DRV_NAME));
|
||||
|
||||
hSearch = FindFirstFile(szFilePath, &wfd);
|
||||
|
||||
|
@ -912,6 +913,9 @@ static void DoPatchGame(const TCHAR* patch_name, const TCHAR* game_name, const U
|
|||
const TCHAR* pszReadMode = AdaptiveEncodingReads(patch_name);
|
||||
if (NULL == pszReadMode) return;
|
||||
|
||||
const TCHAR* pszAppRomPaths = (2 == nQuickOpen) ? szAppQuickPath : szAppIpsPath;
|
||||
const TCHAR* pszDriverName = (2 == nQuickOpen) ? szDriverName : BurnDrvGetText(DRV_NAME);
|
||||
|
||||
if ((fp = _tfopen(patch_name, pszReadMode)) != NULL) {
|
||||
bool bTarget = false;
|
||||
|
||||
|
@ -985,12 +989,25 @@ static void DoPatchGame(const TCHAR* patch_name, const TCHAR* game_name, const U
|
|||
bprintf(0, _T("rom crc :[%x]\n"), nIps_crc);
|
||||
}
|
||||
|
||||
TCHAR ips_path[MAX_PATH];
|
||||
if (_tcschr(ips_name, _T('\\'))) {
|
||||
// ips in parent's folder
|
||||
_stprintf(ips_path, _T("%s\\%s%s"), szAppIpsPath, ips_name, (has_ext) ? _T("") : IPS_EXT);
|
||||
} else {
|
||||
_stprintf(ips_path, _T("%s%s\\%s%s"), szAppIpsPath, BurnDrvGetText(DRV_NAME), ips_name, (has_ext) ? _T("") : IPS_EXT);
|
||||
TCHAR ips_path[MAX_PATH] = { 0 };
|
||||
_stprintf(ips_path, _T("%s%s"), ips_name, (has_ext) ? _T("") : IPS_EXT);
|
||||
|
||||
// Prioritize the use of ips files with custom correct paths
|
||||
if (!FileExists(ips_path)) {
|
||||
_stprintf(ips_path, _T(""));
|
||||
|
||||
// Traditional IPS path
|
||||
if ((_T('\\') == ips_name[0]) || (_T('/') == ips_name[0])) {
|
||||
// ips in parent's folder
|
||||
// app_path: xxxxx/yyy/ or xxxxx\yyy\
|
||||
// ips_name: /aaa/n.ips or \aaa\n.ips, (ips_name + 1) -> aaa/n.ips or aaa\n.ips
|
||||
// app_path + ips_name: xxxxx/yyy/aaa/n.ips or xxxxx\yyy\aaa\n.ips
|
||||
_stprintf(ips_path, _T("%s%s%s"), pszAppRomPaths, ips_name + 1, (has_ext) ? _T("") : IPS_EXT);
|
||||
} else {
|
||||
// ips in drv_name's folder (Same folder as dat)
|
||||
// xxxxx/yyy/drv_name/.../n.ips or xxxxx\yyy\drv_name\...\n.ips
|
||||
_stprintf(ips_path, _T("%s%s\\%s%s"), pszAppRomPaths, pszDriverName, ips_name, (has_ext) ? _T("") : IPS_EXT);
|
||||
}
|
||||
}
|
||||
|
||||
PatchFile(_TtoA(ips_path), base, readonly);
|
||||
|
@ -1005,6 +1022,94 @@ static void DoPatchGame(const TCHAR* patch_name, const TCHAR* game_name, const U
|
|||
}
|
||||
}
|
||||
|
||||
static INT32 IpsVerifyDat(const TCHAR* pszDatFile)
|
||||
{
|
||||
TCHAR s[MAX_PATH] = { 0 }, * p = NULL, * rom_name = NULL, * ips_name = NULL;
|
||||
FILE* fp = NULL;
|
||||
|
||||
const TCHAR* pszReadMode = AdaptiveEncodingReads(pszDatFile);
|
||||
if (NULL == pszReadMode) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS: %s\n\n"), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_ENCODING), pszDatFile);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -1;
|
||||
}
|
||||
if (NULL== (fp = _tfopen(pszDatFile, pszReadMode))) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS: %s\n\n"), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_OPEN), pszDatFile);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -2;
|
||||
}
|
||||
|
||||
const TCHAR* pszAppRomPaths = (2 == nQuickOpen) ? szAppQuickPath : szAppIpsPath;
|
||||
const TCHAR* pszDriverName = (2 == nQuickOpen) ? szDriverName : BurnDrvGetText(DRV_NAME);
|
||||
INT32 nLoop = 0, nError = 0, nFind = 0;
|
||||
|
||||
while (!feof(fp)) {
|
||||
if (_fgetts(s, sizeof(s), fp) != NULL) {
|
||||
p = s;
|
||||
|
||||
if (p[0] == _T('[')) {
|
||||
if (0 == nLoop) {
|
||||
nError++;
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS: %s\n\n"), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_CONTENT), pszDatFile);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#define DELIM_TOKENS_NAME _T(" \t\r\n")
|
||||
#define DELIM_TOKENS _T(" \t\r\n()")
|
||||
|
||||
rom_name = _strqtoken(p, DELIM_TOKENS_NAME);
|
||||
if (!rom_name)
|
||||
continue;
|
||||
if (*rom_name == _T('#'))
|
||||
continue;
|
||||
|
||||
ips_name = _strqtoken(NULL, DELIM_TOKENS_NAME);
|
||||
if (!ips_name)
|
||||
continue;
|
||||
|
||||
#undef DELIM_TOKENS_NAME
|
||||
#undef DELIM_TOKENS
|
||||
|
||||
char* has_ext = stristr_int(_TtoA(ips_name), ".ips");
|
||||
TCHAR ips_path[MAX_PATH] = { 0 };
|
||||
_stprintf(ips_path, _T("%s%s"), ips_name, (has_ext) ? _T("") : IPS_EXT);
|
||||
|
||||
if (!FileExists(ips_path)) {
|
||||
_stprintf(ips_path, _T(""));
|
||||
|
||||
if ((_T('\\') == ips_name[0]) || (_T('/') == ips_name[0])) {
|
||||
_stprintf(ips_path, _T("%s%s%s"), pszAppRomPaths, ips_name + 1, (has_ext) ? _T("") : IPS_EXT);
|
||||
} else {
|
||||
_stprintf(ips_path, _T("%s%s\\%s%s"), pszAppRomPaths, pszDriverName, ips_name, (has_ext) ? _T("") : IPS_EXT);
|
||||
}
|
||||
if (!FileExists(ips_path)) {
|
||||
nError++;
|
||||
if (1 == nError) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS: %s\n\n"), pszDatFile);
|
||||
}
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), ips_path);
|
||||
} else {
|
||||
nFind++;
|
||||
}
|
||||
} else {
|
||||
nFind++;
|
||||
}
|
||||
}
|
||||
nLoop++;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
if (nError > 0) {
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
}
|
||||
|
||||
return (nFind > 0) ? 0 : -3;
|
||||
}
|
||||
|
||||
#undef IPS_EXT
|
||||
#undef IPS_TAG_EOF
|
||||
#undef IPS_SIGNATURE
|
||||
|
@ -1072,10 +1177,153 @@ static void ExtraPatchesExit()
|
|||
_IpsLast.nCount = 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static bool NormalizePath(const TCHAR* pSrcPath, TCHAR* pDestPath, UINT32 nDestSize) {
|
||||
if ((NULL == pSrcPath) || (NULL == pDestPath) || (0 == nDestSize))
|
||||
return false;
|
||||
|
||||
TCHAR szFullPath[MAX_PATH] = { 0 };
|
||||
DWORD dwRet = GetFullPathName(pSrcPath, MAX_PATH, szFullPath, NULL);
|
||||
if ((0 == dwRet) || (dwRet >= MAX_PATH))
|
||||
return false;
|
||||
|
||||
for (UINT32 i = 0; i < dwRet; i++) {
|
||||
if (_T('\\') == szFullPath[i])
|
||||
pDestPath[i] = _T('/');
|
||||
else
|
||||
pDestPath[i] = _tolower(szFullPath[i]);
|
||||
}
|
||||
pDestPath[dwRet] = _T('\0');
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool CompareTwoPaths(const TCHAR* pszPathA, const TCHAR* pszPathB)
|
||||
{
|
||||
TCHAR szPathA[MAX_PATH] = { 0 }, szPathB[MAX_PATH] = { 0 };
|
||||
|
||||
if (!NormalizePath(pszPathA, szPathA, MAX_PATH) ||
|
||||
!NormalizePath(pszPathB, szPathB, MAX_PATH))
|
||||
return false;
|
||||
|
||||
return (0 == _tcsicmp(szPathA, szPathB));
|
||||
}
|
||||
#endif
|
||||
|
||||
static INT32 IpsDatPathGetInfo(const TCHAR* pszSelDat, TCHAR** pszDrvName, TCHAR** pszIpsPath)
|
||||
{
|
||||
*pszDrvName = *pszIpsPath = NULL;
|
||||
|
||||
if ((NULL == pszSelDat) || !FileExists(pszSelDat)) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS %s:\n\n"), pszSelDat);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszSelDat);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -2;
|
||||
}
|
||||
|
||||
const TCHAR* pszExt = _tcsrchr(pszSelDat, _T('.'));
|
||||
if (NULL == pszExt || (0 != _tcsicmp(_T(".dat"), pszExt))) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS %s:\n\n"), pszSelDat);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXTENSION), pszSelDat, _T(".dat"));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -5;
|
||||
}
|
||||
|
||||
const TCHAR* p = pszSelDat + _tcslen(pszSelDat), * drv_start = NULL, * drv_end = NULL, * dir_end = NULL;
|
||||
INT32 nCount = 0;
|
||||
while (p > pszSelDat) {
|
||||
if ((_T('/') == *p) || (_T('\\') == *p)) {
|
||||
TCHAR c = *(p - 1);
|
||||
if ((_T('/') == c) ||
|
||||
(_T('\\') == c)) { // xxxx//ssss\\...
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS %s:\n\n"), pszSelDat);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszSelDat);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -2;
|
||||
}
|
||||
|
||||
nCount++;
|
||||
if (1 == nCount) {
|
||||
drv_end = p; // Intentionally add 1
|
||||
}
|
||||
if (2 == nCount) {
|
||||
dir_end = drv_start = p + 1;
|
||||
}
|
||||
}
|
||||
p--;
|
||||
}
|
||||
|
||||
TCHAR szDrvName[64] = { 0 }, szIpsPath[MAX_PATH] = { 0 };
|
||||
switch (nCount) {
|
||||
case 0: // xxx.dat
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS %s:\n\n"), pszSelDat);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DRIVER_NOT_EXIST), pszSelDat);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -4;
|
||||
case 1: // drv_name/xxx.dat
|
||||
drv_start = dir_end = p;
|
||||
_tcscpy(szIpsPath, _T(""));
|
||||
break;
|
||||
default:
|
||||
_tcsncpy(szIpsPath, pszSelDat, dir_end - pszSelDat);
|
||||
break;
|
||||
}
|
||||
|
||||
const UINT32 nDrvLen = drv_end - drv_start;
|
||||
if (0 == nDrvLen) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS %s:\n\n"), pszSelDat);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DRIVER_NOT_EXIST), pszSelDat);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -4;
|
||||
}
|
||||
|
||||
_tcsncpy(szDrvName, drv_start, nDrvLen);
|
||||
|
||||
const INT32 nDrvIdx = BurnDrvGetIndex(_TtoA(szDrvName));
|
||||
if (nDrvIdx < 0) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("IPS %s:\n\n"), pszSelDat);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DRIVER_NOT_EXIST), pszSelDat);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -4;
|
||||
}
|
||||
|
||||
*pszDrvName = _tcsdup(szDrvName); // The caller needs to free it
|
||||
*pszIpsPath = _tcsdup(szIpsPath); // free(pszIpsPath)
|
||||
|
||||
return nDrvIdx;
|
||||
}
|
||||
|
||||
INT32 IpsGetDrvForQuickOpen(const TCHAR* pszSelDat)
|
||||
{
|
||||
TCHAR* pszDrv, * pszPath;
|
||||
const INT32 nDrvIdx = IpsDatPathGetInfo(pszSelDat, &pszDrv, &pszPath);
|
||||
if (nDrvIdx < 0)
|
||||
return nDrvIdx;
|
||||
|
||||
_tcscpy(szDriverName, pszDrv); free(pszDrv);
|
||||
_tcscpy(szAppQuickPath, pszPath); free(pszPath);
|
||||
|
||||
INT32 nVerify = IpsVerifyDat(pszSelDat);
|
||||
if (0 != nVerify) {
|
||||
memset(szDriverName, 0, sizeof(szDriverName));
|
||||
return nVerify;
|
||||
}
|
||||
|
||||
_tcscpy(szIpsActivePatches[0], pszSelDat);
|
||||
|
||||
for (INT32 i = 1; i < MAX_ACTIVE_PATCHES; i++) {
|
||||
_stprintf(szIpsActivePatches[i], _T(""));
|
||||
}
|
||||
|
||||
return nDrvIdx;
|
||||
}
|
||||
|
||||
static void ExtraPatchesInit(const INT32 nActivePatches)
|
||||
{
|
||||
ExtraPatchesExit();
|
||||
|
||||
const TCHAR* pszAppRomPaths = (2 == nQuickOpen) ? szAppQuickPath : szAppIpsPath;
|
||||
const TCHAR* pszDriverName = (2 == nQuickOpen) ? szDriverName : BurnDrvGetText(DRV_NAME);
|
||||
|
||||
for (INT32 i = 0; i < nActivePatches; i++) {
|
||||
TCHAR str[MAX_PATH] = { 0 }, * ptr = NULL, * tmp = NULL;
|
||||
FILE* fp = NULL;
|
||||
|
@ -1117,8 +1365,7 @@ static void ExtraPatchesInit(const INT32 nActivePatches)
|
|||
// ips_path/drv_name/game.dat
|
||||
TCHAR szInclde[MAX_PATH] = { 0 };
|
||||
const TCHAR* pszFormat = (NULL == _tcsrchr(tmp, _T('.'))) ? _T("%s%s\\%s.dat") : _T("%s%s\\%s");
|
||||
|
||||
_stprintf(szInclde, pszFormat, szAppIpsPath, BurnDrvGetText(DRV_NAME), tmp);
|
||||
_stprintf(szInclde, pszFormat, pszAppRomPaths, pszDriverName, tmp);
|
||||
|
||||
// Check if the file exists
|
||||
if (!FileExists(szInclde))
|
||||
|
|
|
@ -1201,7 +1201,6 @@ void MenuUpdate()
|
|||
CheckMenuItem(hMenu, MENU_CREATEDIRS, bAlwaysCreateSupportFolders ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hMenu, MENU_AUTOLOADGAMELIST, bAutoLoadGameList ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hMenu, MENU_AUTOSCANGAMELIST, !bSkipStartupCheck ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hMenu, MENU_QUICKSCANGAMELIST, bQuicklyCheck ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hMenu, MENU_SAVEHISCORES, EnableHiscores ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hMenu, MENU_USEBLEND, bBurnUseBlend ? MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hMenu, MENU_GEARSHIFT, BurnShiftEnabled ? MF_CHECKED : MF_UNCHECKED);
|
||||
|
@ -1573,6 +1572,9 @@ void MenuEnableItems()
|
|||
if (kNetGame) {
|
||||
EnableMenuItem(hMenu, MENU_LOAD, MF_GRAYED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_ROMDATA, MF_GRAYED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_IPSPATCH, MF_GRAYED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_NEOGEOCD, MF_GRAYED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_ARCHIVE, MF_GRAYED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_ROMDATA_MANAGER, MF_GRAYED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_STARTNET, MF_GRAYED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_EXIT, MF_GRAYED | MF_BYCOMMAND);
|
||||
|
@ -1585,6 +1587,9 @@ void MenuEnableItems()
|
|||
} else {
|
||||
EnableMenuItem(hMenu, MENU_LOAD, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_ROMDATA, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_IPSPATCH, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_NEOGEOCD, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_ARCHIVE, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_ROMDATA_MANAGER, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_STARTNET, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_EXIT, MF_ENABLED | MF_BYCOMMAND);
|
||||
|
@ -1669,6 +1674,9 @@ void MenuEnableItems()
|
|||
|
||||
EnableMenuItem(hMenu, MENU_LOAD, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_ROMDATA, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_IPSPATCH, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_NEOGEOCD, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_LOAD_ARCHIVE, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, MENU_ROMDATA_MANAGER, MF_ENABLED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, ID_SLOMO_0, MF_GRAYED | MF_BYCOMMAND);
|
||||
EnableMenuItem(hMenu, ID_SLOMO_1, MF_GRAYED | MF_BYCOMMAND);
|
||||
|
|
|
@ -553,7 +553,10 @@
|
|||
#define MENU_EXIT 10012
|
||||
#define MENU_RESET 10013
|
||||
#define MENU_LOAD_ROMDATA 10014
|
||||
#define MENU_ROMDATA_MANAGER 10015
|
||||
#define MENU_LOAD_IPSPATCH 10015
|
||||
#define MENU_LOAD_NEOGEOCD 10016
|
||||
#define MENU_LOAD_ARCHIVE 10017
|
||||
#define MENU_ROMDATA_MANAGER 10018
|
||||
#define MENU_MEMCARD_CREATE 10020
|
||||
#define MENU_MEMCARD_SELECT 10021
|
||||
#define MENU_MEMCARD_INSERT 10022
|
||||
|
@ -821,7 +824,6 @@
|
|||
#define MENU_CLRMAME_PRO_XML_SNES_ONLY 10738
|
||||
#define MENU_CLRMAME_PRO_XML_NGP_ONLY 10739
|
||||
#define MENU_CLRMAME_PRO_XML_CHANNELF_ONLY 10740
|
||||
#define MENU_QUICKSCANGAMELIST 10741
|
||||
|
||||
#define MENU_INPUT_P1_DISABLE 10750
|
||||
#define MENU_INPUT_P1_SOCDN 10751
|
||||
|
|
|
@ -88,6 +88,9 @@
|
|||
#define IDS_DISK_TEXT (IDS_STRING + 324)
|
||||
#define IDS_DISK_FILE_PATCH (IDS_STRING + 326)
|
||||
#define IDS_DISK_FILE_ROMDATA (IDS_STRING + 328)
|
||||
#define IDS_DISK_FILE_IPSPATCH (IDS_STRING + 330)
|
||||
#define IDS_DISK_FILE_NEOGEOCD (IDS_STRING + 332)
|
||||
#define IDS_DISK_FILE_ARCHIVE (IDS_STRING + 334)
|
||||
|
||||
#define IDS_DISK_SAVEREPORT (IDS_STRING + 340)
|
||||
|
||||
|
@ -251,6 +254,7 @@
|
|||
|
||||
#define IDS_SUPPORTPATH_TITLE (IDS_STRING + 802)
|
||||
|
||||
|
||||
#define IDS_NGCD_DIAG_TITLE (IDS_STRING + 810)
|
||||
#define IDS_NGCD_TITLE (IDS_STRING + 812)
|
||||
#define IDS_NGCD_NGCDID (IDS_STRING + 814)
|
||||
|
@ -381,6 +385,12 @@
|
|||
#define IDS_ERR_DISK_TOONEW (IDS_ERROR + 96)
|
||||
#define IDS_ERR_DISK_TOOOLD (IDS_ERROR + 98)
|
||||
|
||||
#define IDS_ERR_FILE_ENCODING (IDS_ERROR + 100)
|
||||
#define IDS_ERR_FILE_EXIST (IDS_ERROR + 102)
|
||||
#define IDS_ERR_FILE_OPEN (IDS_ERROR + 104)
|
||||
#define IDS_ERR_FILE_CONTENT (IDS_ERROR + 106)
|
||||
#define IDS_ERR_FILE_EXTENSION (IDS_ERROR + 108)
|
||||
|
||||
#define IDS_ERR_NO_NETPLAYDLL (IDS_ERROR + 110)
|
||||
#define IDS_ERR_NO_DRIVER_SELECTED (IDS_ERROR + 112)
|
||||
#define IDS_ERR_NO_DRIVER_SEL_SLOT1 (IDS_ERROR + 114)
|
||||
|
|
|
@ -853,9 +853,11 @@ TCHAR* _strqtoken(TCHAR* s, const TCHAR* delims)
|
|||
return token;
|
||||
}
|
||||
|
||||
static INT32 FileExists(const TCHAR* szName)
|
||||
static INT32 FileExists(const TCHAR* pszName)
|
||||
{
|
||||
return GetFileAttributes(szName) != INVALID_FILE_ATTRIBUTES;
|
||||
DWORD dwAttrib = GetFileAttributes(pszName);
|
||||
return (dwAttrib != INVALID_FILE_ATTRIBUTES &&
|
||||
!(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
|
||||
}
|
||||
|
||||
static HIMAGELIST HardwareIconListInit()
|
||||
|
@ -1280,6 +1282,48 @@ static INT32 LoadRomdata()
|
|||
return RDI.nDescCount;
|
||||
}
|
||||
|
||||
bool RomDataSetQuickPath(const TCHAR* pszSelDat)
|
||||
{
|
||||
if ((NULL == pszSelDat) || !FileExists(pszSelDat)) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszSelDat);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
const TCHAR* pszExt = _tcsrchr(pszSelDat, _T('.'));
|
||||
if (NULL == pszExt || (0 != _tcsicmp(_T(".dat"), pszExt))) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXTENSION), pszSelDat, _T(".dat"));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
const TCHAR* p = pszSelDat + _tcslen(pszSelDat), * dir_end = NULL;
|
||||
INT32 nCount = 0;
|
||||
while (p > pszSelDat) {
|
||||
if ((_T('/') == *p) || (_T('\\') == *p)) {
|
||||
TCHAR c = *(p - 1);
|
||||
if ((_T('/') == c) ||
|
||||
(_T('\\') == c)) { // xxxx//ssss\\...
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszSelDat);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
if (1 == ++nCount) {
|
||||
dir_end = p + 1; // Intentionally add 1
|
||||
}
|
||||
}
|
||||
p--;
|
||||
}
|
||||
|
||||
memset(szAppQuickPath, 0, sizeof(szAppQuickPath));
|
||||
_tcsncpy(szAppQuickPath, pszSelDat, dir_end - pszSelDat);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char* RomdataGetDrvName()
|
||||
{
|
||||
const TCHAR* pszReadMode = AdaptiveEncodingReads(szRomdataName);
|
||||
|
@ -1431,11 +1475,10 @@ TCHAR* RomdataGetFullName(const TCHAR* pszFileName)
|
|||
|
||||
static INT32 RomsetDuplicateName(const TCHAR* pszFileName)
|
||||
{
|
||||
bool RDMode = (NULL != pDataRomDesc);
|
||||
if (RDMode) return -2;
|
||||
if (NULL != pDataRomDesc) return -2;
|
||||
|
||||
TCHAR* pszZipName = RomdataGetZipName(pszFileName);
|
||||
if (NULL == pszZipName) return -3;
|
||||
if (NULL == pszZipName) return -3;
|
||||
/*
|
||||
return: -1 is success
|
||||
0 ~ N The name is duplicated
|
||||
|
@ -1443,50 +1486,39 @@ static INT32 RomsetDuplicateName(const TCHAR* pszFileName)
|
|||
-2 RomData mode
|
||||
-3 No results were found in the Dat file
|
||||
*/
|
||||
return BurnDrvGetIndex(TCHARToANSI(pszZipName, NULL, 0));
|
||||
return BurnDrvGetIndex(_TtoA(pszZipName));
|
||||
}
|
||||
|
||||
// Checking in RomData mode is strictly prohibited
|
||||
INT32 RomDataCheck(const TCHAR* pszDatFile)
|
||||
{
|
||||
if (NULL == pszDatFile) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_NODATA));
|
||||
if (NULL == pszDatFile || !FileExists(pszDatFile)) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszDatFile);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
TCHAR szDatFile[MAX_PATH] = { 0 };
|
||||
_tcscpy(szDatFile, pszDatFile);
|
||||
|
||||
if (!FileExists(szDatFile)) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s: %s\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_DATPATH, true), szDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_NODATA));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -2;
|
||||
}
|
||||
|
||||
INT32 nRet = 0;
|
||||
const TCHAR* pszDrvName = RomdataGetDrvName(szDatFile);
|
||||
if (NULL == pszDrvName) nRet -3;
|
||||
|
||||
TCHAR szDrvName[100] = { 0 };
|
||||
_tcscpy(szDrvName, pszDrvName);
|
||||
|
||||
const INT32 nDrvIdx = BurnDrvGetIndex(TCHARToANSI(szDrvName, NULL, 0));
|
||||
if (-1 == nDrvIdx) nRet -4;
|
||||
|
||||
|
||||
if (nRet < 0) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s: %s\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_DATPATH, true), szDatFile);
|
||||
UINT32 nStrId = (-3 == nRet) ? IDS_ERR_NO_DRIVER_SELECTED : IDS_ERR_DRIVER_NOT_EXIST;
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(nStrId));
|
||||
const TCHAR* pszDrvName = RomdataGetDrvName(pszDatFile);
|
||||
if (NULL == pszDrvName) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData: %s\n\n"), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DRIVER_NOT_EXIST));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return nRet;
|
||||
return -3;
|
||||
}
|
||||
|
||||
nRet = RomsetDuplicateName(szDatFile);
|
||||
const INT32 nDrvIdx = BurnDrvGetIndex(_TtoA(pszDrvName));
|
||||
if (-1 == nDrvIdx) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData: %s\n\n"), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DRIVER_NOT_EXIST));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -4;
|
||||
}
|
||||
|
||||
nRet = RomsetDuplicateName(pszDatFile);
|
||||
if (nRet >= 0) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s: %s\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_DATPATH, true), szDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData: %s\n\n"), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_ROMSET_DUPLICATE));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return -5;
|
||||
|
@ -1507,15 +1539,17 @@ INT32 RomDataCheck(const TCHAR* pszDatFile)
|
|||
*/
|
||||
TCHAR szBackup[MAX_PATH] = { 0 };
|
||||
_tcscpy(szBackup, szRomdataName); // Backup szRomdataName
|
||||
_tcscpy(szRomdataName, szDatFile);
|
||||
_tcscpy(szRomdataName, pszDatFile);
|
||||
RomDataInit(); // Replace DrvName##RomDesc
|
||||
const UINT32 nOldDrvSel = nBurnDrvActive; // Backup nBurnDrvActive
|
||||
nBurnDrvActive = nDrvIdx; // Required nBurnDrvActive
|
||||
nRet = BzipOpen(1);
|
||||
if (1 == nRet) { // ROMs error report
|
||||
BzipClose();
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData: %s\n\n"), pszDatFile);
|
||||
BzipOpen(0);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
nRet = -1;
|
||||
}
|
||||
BzipClose();
|
||||
nBurnDrvActive = nOldDrvSel; // Restore nBurnDrvActive
|
||||
|
@ -1556,7 +1590,7 @@ static DatListInfo* RomdataGetListInfo(const TCHAR* pszDatFile)
|
|||
if (0 == _tcsicmp(_T("ZipName"), pszLabel) || 0 == _tcsicmp(_T("RomName"), pszLabel)) { // Romset
|
||||
pszInfo = _strqtoken(NULL, DELIM_TOKENS_NAME);
|
||||
if (NULL == pszInfo) { // No romset specified
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s: %s\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_DATPATH, true), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s:?\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_ROMSET, true));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_LOAD_NOTFOUND), _T("ROM"));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
|
@ -1570,7 +1604,7 @@ static DatListInfo* RomdataGetListInfo(const TCHAR* pszDatFile)
|
|||
if (0 == _tcsicmp(_T("DrvName"), pszLabel) || 0 == _tcsicmp(_T("Parent"), pszLabel)) { // Driver
|
||||
pszInfo = _strqtoken(NULL, DELIM_TOKENS_NAME);
|
||||
if (NULL == pszInfo) { // No driver specified
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s: %s\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_DATPATH, true), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s:?\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_DRIVER, true));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_NO_DRIVER_SELECTED));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
|
@ -1585,7 +1619,7 @@ static DatListInfo* RomdataGetListInfo(const TCHAR* pszDatFile)
|
|||
UINT32 nOldDrvSel = nBurnDrvActive; // Backup
|
||||
nBurnDrvActive = BurnDrvGetIndex(TCHARToANSI(pDatListInfo->szDrvName, NULL, 0));
|
||||
if (-1 == nBurnDrvActive) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s: %s\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_DATPATH, true), pszDatFile);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("RomData:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("%s: %s\n\n"), FBALoadStringEx(hAppInst, IDS_ROMDATA_DRIVER, true), pDatListInfo->szDrvName);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_DRIVER_NOT_EXIST));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
|
|
|
@ -11,7 +11,6 @@ char* gameAv = NULL;
|
|||
bool avOk = false;
|
||||
|
||||
bool bSkipStartupCheck = false;
|
||||
bool bQuicklyScan = false;
|
||||
|
||||
static UINT32 ScanThreadId = 0;
|
||||
static HANDLE hScanThread = NULL;
|
||||
|
@ -609,7 +608,6 @@ static int QuitRomsScan()
|
|||
nBurnDrvActive = nOldSelect;
|
||||
nOldSelect = 0;
|
||||
bRescanRoms = false;
|
||||
bQuicklyScan = false; // Restore
|
||||
|
||||
if (avOk) {
|
||||
WriteGameAvb();
|
||||
|
@ -620,8 +618,6 @@ static int QuitRomsScan()
|
|||
|
||||
static unsigned __stdcall AnalyzingRoms(void*)
|
||||
{
|
||||
bQuicklyScan = bQuicklyCheck; // Enable Quickly scan only for overall scanning
|
||||
|
||||
for (unsigned int z = 0; z < nBurnDrvCount; z++) {
|
||||
nBurnDrvActive = z;
|
||||
|
||||
|
@ -645,8 +641,7 @@ static unsigned __stdcall AnalyzingRoms(void*)
|
|||
BzipClose();
|
||||
}
|
||||
|
||||
avOk = true;
|
||||
bQuicklyScan = false; // Restore
|
||||
avOk = true;
|
||||
|
||||
PostMessage(hRomsDlg, WM_CLOSE, 0, 0);
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ int bKailleraServerDialogActive = 0;
|
|||
|
||||
int nSavestateSlot = 1;
|
||||
|
||||
static TCHAR* szClass = _T("FinalBurn Neo"); // Window class name
|
||||
static TCHAR* szClass = _T("FinalBurn Neo"); // Window class name
|
||||
HWND hScrnWnd = NULL; // Handle to the screen window
|
||||
HWND hRebar = NULL; // Handle to the Rebar control containing the menu
|
||||
|
||||
|
@ -70,7 +70,7 @@ HWND hwndChat = NULL;
|
|||
WNDPROC pOldWndProc = NULL;
|
||||
|
||||
bool bRescanRoms = false;
|
||||
bool bQuicklyCheck = false;
|
||||
INT32 nQuickOpen = 0; // 0 Disable, 1 RomData, 2 IPS, 3 NeoGeo-CD, 4 Zip / 7z
|
||||
|
||||
static bool bDrag = false;
|
||||
static int nDragX, nDragY;
|
||||
|
@ -1021,49 +1021,74 @@ static void UpdatePreviousGameList()
|
|||
|
||||
static bool bSramLoad = true; // always true, unless BurnerLoadDriver() is called from StartFromReset()
|
||||
|
||||
// Compact driver loading module
|
||||
int BurnerLoadDriver(TCHAR *szDriverName)
|
||||
{
|
||||
TCHAR szBuf[100] = { 0 };
|
||||
_tcscpy(szBuf, szDriverName);
|
||||
|
||||
INT32 nOldDrvSelect = nBurnDrvActive;
|
||||
|
||||
static void QuitGame() {
|
||||
AudBlankSound();
|
||||
if (nVidFullscreen) {
|
||||
nVidFullscreen = 0;
|
||||
VidExit();
|
||||
}
|
||||
if (bDrvOkay) {
|
||||
StopReplay();
|
||||
#ifdef INCLUDE_AVI_RECORDING
|
||||
AviStop();
|
||||
AviStop();
|
||||
#endif
|
||||
DrvExit();
|
||||
if (kNetGame) {
|
||||
kNetGame = 0;
|
||||
Kaillera_End_Game();
|
||||
DeActivateChat();
|
||||
}
|
||||
bCheatsAllowed = true;
|
||||
|
||||
DrvExit(); // This will exit RomData mode
|
||||
ScrnSize();
|
||||
ScrnTitle();
|
||||
MenuEnableItems();
|
||||
nBurnDrvActive = ~0U;
|
||||
|
||||
POST_INITIALISE_MESSAGE;
|
||||
}
|
||||
}
|
||||
|
||||
// Compact driver loading module
|
||||
int BurnerLoadDriver(TCHAR *pszDriverName)
|
||||
{
|
||||
INT32 nDrvIdx = -1;
|
||||
bool bRDMode = false, bFinder = false;
|
||||
TCHAR szRDDatBackup[MAX_PATH] = { 0 };
|
||||
bool bCurrentRD = (NULL != pDataRomDesc), bRDMode = false, bFinder = false;
|
||||
TCHAR szBackup[MAX_PATH] = { 0 }, szRDDatBackup[MAX_PATH] = { 0 };
|
||||
|
||||
if (bFinder = FindZipNameFromDats(szAppRomdataPath, TCHARToANSI(szBuf, NULL, 0), szRDDatBackup)) {
|
||||
if (bCurrentRD) {
|
||||
_tcscpy(szBackup, szRomdataName);
|
||||
RomDataExit();
|
||||
}
|
||||
if (bFinder = FindZipNameFromDats(szAppRomdataPath, _TtoA(pszDriverName), szRDDatBackup)) {
|
||||
if ((nDrvIdx = RomDataCheck(szRDDatBackup)) >= 0) {
|
||||
bRDMode = true;
|
||||
}
|
||||
}
|
||||
if (!bFinder || !bRDMode) {
|
||||
if (-1 == (nDrvIdx = RomdataGetDrvIndex(szBuf))) {
|
||||
return 1;
|
||||
}
|
||||
nDrvIdx = RomdataGetDrvIndex(pszDriverName);
|
||||
}
|
||||
nDialogSelect = nOldDlgSelected = nDrvIdx;
|
||||
nBurnDrvActive = nOldDrvSelect;
|
||||
if (bCurrentRD) {
|
||||
_tcscpy(szRomdataName, szBackup);
|
||||
RomDataInit();
|
||||
}
|
||||
if (nDrvIdx < 0)
|
||||
return -1;
|
||||
|
||||
bLoading = 1;
|
||||
SplashDestroy(1);
|
||||
StopReplay();
|
||||
QuitGame();
|
||||
|
||||
if (bRDMode) {
|
||||
_tcscpy(szRomdataName, szRDDatBackup);
|
||||
}
|
||||
|
||||
nDialogSelect = nOldDlgSelected = nBurnDrvActive = nDrvIdx;
|
||||
bLoading = 1;
|
||||
SplashDestroy(1);
|
||||
StopReplay();
|
||||
DrvInit(nDrvIdx, bSramLoad); // Init the game driver
|
||||
MenuEnableItems();
|
||||
bAltPause = 0;
|
||||
AudSoundPlay(); // Restart sound
|
||||
AudSoundPlay(); // Restart sound
|
||||
bLoading = 0;
|
||||
UpdatePreviousGameList();
|
||||
if (bVidAutoSwitchFull) {
|
||||
|
@ -1074,32 +1099,33 @@ int BurnerLoadDriver(TCHAR *szDriverName)
|
|||
return 0;
|
||||
}
|
||||
|
||||
INT32 RomDataLoadDriver(TCHAR* szSelDat)
|
||||
INT32 RomDataLoadDriver(const TCHAR* pszSelDat)
|
||||
{
|
||||
INT32 nOldDrvSelect = nBurnDrvActive;
|
||||
bool bRDMode = (NULL != pDataRomDesc);
|
||||
TCHAR szBackup[MAX_PATH] = { 0 };
|
||||
|
||||
#ifdef INCLUDE_AVI_RECORDING
|
||||
AviStop();
|
||||
#endif
|
||||
if (bRDMode) {
|
||||
_tcscpy(szBackup, szRomdataName);
|
||||
RomDataExit(); // Before handling RomDataCheck, exit RDMode
|
||||
}
|
||||
|
||||
DrvExit(); // This will exit RomData mode
|
||||
INT32 nDrvIdx = RomDataCheck(pszSelDat);
|
||||
|
||||
INT32 nDrvIdx = -1;
|
||||
TCHAR szBuf[MAX_PATH] = { 0 };
|
||||
_tcscpy(szBuf, szSelDat);
|
||||
|
||||
if ((nDrvIdx = RomDataCheck(szBuf)) < 0)
|
||||
if (bRDMode) {
|
||||
_tcscpy(szRomdataName, szBackup);
|
||||
RomDataInit(); // Restore state
|
||||
}
|
||||
if (nDrvIdx < 0)
|
||||
return -1;
|
||||
|
||||
nDialogSelect = nOldDlgSelected = nDrvIdx;
|
||||
nBurnDrvActive = nOldDrvSelect;
|
||||
QuitGame(); // Quit the game completely
|
||||
|
||||
_tcscpy(szRomdataName, pszSelDat);
|
||||
|
||||
nDialogSelect = nOldDlgSelected = nBurnDrvActive = nDrvIdx;
|
||||
bLoading = 1;
|
||||
SplashDestroy(1);
|
||||
StopReplay();
|
||||
|
||||
_tcscpy(szRomdataName, szBuf);
|
||||
|
||||
DrvInit(nDrvIdx, bSramLoad); // Init the game driver
|
||||
MenuEnableItems();
|
||||
bAltPause = 0;
|
||||
|
@ -1114,6 +1140,214 @@ INT32 RomDataLoadDriver(TCHAR* szSelDat)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static INT32 FileExists(const TCHAR* pszName)
|
||||
{
|
||||
DWORD dwAttrib = GetFileAttributes(pszName);
|
||||
return (dwAttrib != INVALID_FILE_ATTRIBUTES &&
|
||||
!(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
|
||||
}
|
||||
|
||||
static void QuickOpenExit()
|
||||
{
|
||||
nQuickOpen = 0;
|
||||
memset(szAppQuickPath, 0, sizeof(szAppQuickPath));
|
||||
}
|
||||
|
||||
static bool NgcdVerifyPath(const TCHAR* pszSelCue)
|
||||
{
|
||||
if ((NULL == pszSelCue) || !FileExists(pszSelCue)) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("NeoGeo CD:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszSelCue);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
const TCHAR* pszExt = _tcsrchr(pszSelCue, _T('.'));
|
||||
if (NULL == pszExt || (0 != _tcsicmp(_T(".cue"), pszExt))) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("NeoGeo CD: %s\n\n"), pszSelCue);
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXTENSION), pszExt, _T(".cue"));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
const TCHAR* p = pszSelCue + _tcslen(pszSelCue);
|
||||
while (p > pszSelCue) {
|
||||
if ((_T('/') == *p) || (_T('\\') == *p)) {
|
||||
TCHAR c = *(p - 1);
|
||||
if ((_T('/') == c) ||
|
||||
(_T('\\') == c)) { // xxxx//ssss\\...
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("NeoGeo CD:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszSelCue);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
p--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ArchiveSetQuickPath(const TCHAR* pszSelArc)
|
||||
{
|
||||
if ((NULL == pszSelArc) || !FileExists(pszSelArc)) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("Zip / 7z:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszSelArc);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
const TCHAR* pszExt = _tcsrchr(pszSelArc, _T('.'));
|
||||
if (NULL == pszExt || ((0 != _tcsicmp(_T(".zip"), pszExt)) && (0 != _tcsicmp(_T(".7z"), pszExt)))) {
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("Zip / 7z:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXTENSION), pszExt, _T(".zip / .7z"));
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
const TCHAR* p = pszSelArc + _tcslen(pszSelArc), * dir_end = NULL;
|
||||
INT32 nCount = 0;
|
||||
while (p > pszSelArc) {
|
||||
if ((_T('/') == *p) || (_T('\\') == *p)) {
|
||||
TCHAR c = *(p - 1);
|
||||
if ((_T('/') == c) ||
|
||||
(_T('\\') == c)) { // xxxx//ssss\\...
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, _T("Zip / 7z:\n\n"));
|
||||
FBAPopupAddText(PUF_TEXT_DEFAULT, MAKEINTRESOURCE(IDS_ERR_FILE_EXIST), pszSelArc);
|
||||
FBAPopupDisplay(PUF_TYPE_ERROR);
|
||||
return false;
|
||||
}
|
||||
if (1 == ++nCount) {
|
||||
dir_end = p + 1; // Intentionally add 1
|
||||
}
|
||||
}
|
||||
p--;
|
||||
}
|
||||
|
||||
memset(szAppQuickPath, 0, sizeof(szAppQuickPath));
|
||||
_tcsncpy(szAppQuickPath, pszSelArc, dir_end - pszSelArc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
INT32 BurnerQuickLoad(const INT32 nMode, const TCHAR* pszSelect)
|
||||
{
|
||||
nQuickOpen = nMode;
|
||||
|
||||
bool bRDMode = (NULL != pDataRomDesc);
|
||||
|
||||
switch (nMode) {
|
||||
case 1:
|
||||
if (!RomDataSetQuickPath(pszSelect)) {
|
||||
QuickOpenExit();
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (!NgcdVerifyPath(pszSelect)) {
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (!ArchiveSetQuickPath(pszSelect)) {
|
||||
QuickOpenExit();
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
TCHAR szBackup[MAX_PATH] = { 0 };
|
||||
|
||||
if (bRDMode) {
|
||||
_tcscpy(szBackup, szRomdataName);
|
||||
RomDataExit(); // Before handling RomDataCheck, exit RDMode
|
||||
}
|
||||
|
||||
INT32 nDrvIdx = -1;
|
||||
|
||||
switch (nMode) {
|
||||
case 1:
|
||||
nDrvIdx = RomDataCheck(pszSelect);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
nDrvIdx = IpsGetDrvForQuickOpen(pszSelect);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
nDrvIdx = RomdataGetDrvIndex(_T("neocdz"));
|
||||
break;
|
||||
|
||||
case 4:
|
||||
nDrvIdx = ArchiveNameFindDrv(pszSelect);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (bRDMode) {
|
||||
_tcscpy(szRomdataName, szBackup);
|
||||
RomDataInit(); // Restore state
|
||||
}
|
||||
if (nDrvIdx < 0) {
|
||||
QuickOpenExit();
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
This process may occur during gameplay.
|
||||
All of the above checks must be completed before resetting the game:
|
||||
[1] If the check fails, the current game will continue;
|
||||
[2] If the check passes, the game will quit completely (Enter a new game).
|
||||
*/
|
||||
|
||||
QuitGame(); // Quit the game completely
|
||||
|
||||
switch (nMode) {
|
||||
case 1:
|
||||
_tcscpy(szRomdataName, pszSelect);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
bDoIpsPatch = true;
|
||||
IpsPatchInit();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
memset(CDEmuImage, 0, sizeof(CDEmuImage));
|
||||
_tcscpy(CDEmuImage, pszSelect);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
nDialogSelect = nBurnDrvActive = nDrvIdx;
|
||||
bLoading = 1;
|
||||
SplashDestroy(1);
|
||||
StopReplay();
|
||||
DrvInit(nDrvIdx, bSramLoad); // Init the game driver
|
||||
MenuEnableItems();
|
||||
bAltPause = 0;
|
||||
AudSoundPlay(); // Restart sound
|
||||
QuickOpenExit(); // No need to save variables anymore
|
||||
bLoading = 0;
|
||||
if (bVidAutoSwitchFull) {
|
||||
nVidFullscreen = 1;
|
||||
POST_INITIALISE_MESSAGE;
|
||||
}
|
||||
if (3 == nMode) {
|
||||
memset(CDEmuImage, 0, sizeof(CDEmuImage));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int StartFromReset(TCHAR *szDriverName, bool bLoadSram)
|
||||
{
|
||||
if (!bDrvOkay || (szDriverName && _tcscmp(szDriverName, BurnDrvGetText(DRV_NAME)))) {
|
||||
|
@ -1260,28 +1494,60 @@ static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify)
|
|||
}
|
||||
}
|
||||
|
||||
case MENU_LOAD_ROMDATA: {
|
||||
case MENU_LOAD_ROMDATA:
|
||||
case MENU_LOAD_IPSPATCH:
|
||||
case MENU_LOAD_NEOGEOCD:
|
||||
case MENU_LOAD_ARCHIVE: {
|
||||
nQuickOpen = id - MENU_LOAD_ROMDATA + 1;
|
||||
|
||||
const TCHAR* pszFilter = _T(" (*.dat)\0*.dat\0\0");
|
||||
INT32 nStringID = 0, nStrLen = 16;
|
||||
|
||||
switch (nQuickOpen) {
|
||||
case 1:
|
||||
nStringID = IDS_DISK_FILE_ROMDATA;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
nStringID = IDS_DISK_FILE_IPSPATCH;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
pszFilter = _T(" (*.cue)\0*.cue\0\0");
|
||||
nStringID = IDS_DISK_FILE_NEOGEOCD;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
pszFilter = _T(" (*.zip;*7z)\0*.zip;*7z\0\0");
|
||||
nStringID = IDS_DISK_FILE_ARCHIVE;
|
||||
nStrLen = 24;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
TCHAR szFilter[150] = { 0 };
|
||||
_stprintf(szFilter, FBALoadStringEx(hAppInst, IDS_DISK_FILE_ROMDATA, true), _T(APP_TITLE));
|
||||
memcpy(szFilter + _tcslen(szFilter), _T(" (*.dat)\0*.dat\0\0"), 16 * sizeof(TCHAR));
|
||||
|
||||
_stprintf(szFilter, FBALoadStringEx(hAppInst, nStringID, true), _T("FBNeo"));
|
||||
memcpy(szFilter + _tcslen(szFilter), pszFilter, nStrLen * sizeof(TCHAR));
|
||||
|
||||
// '/' will result in a FNERR_INVALIDFILENAME error
|
||||
TCHAR szInitialDir[MAX_PATH] = { 0 }, szSelDat[MAX_PATH] = { 0 };
|
||||
_tcscpy(szInitialDir, szAppRomdataPath);
|
||||
TCHAR szSelect[MAX_PATH] = { 0 };
|
||||
|
||||
memset(&ofn, 0, sizeof(OPENFILENAME));
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = hScrnWnd;
|
||||
ofn.lpstrFilter = szFilter;
|
||||
ofn.lpstrFile = StrReplace(szSelDat, _T('/'), _T('\\'));
|
||||
ofn.nMaxFile = sizeof(szSelDat) / sizeof(TCHAR);
|
||||
ofn.lpstrInitialDir = StrReplace(szInitialDir, _T('/'), _T('\\'));
|
||||
ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY;
|
||||
ofn.lpstrDefExt = _T("dat");
|
||||
ofn.lpstrFile = StrReplace(szSelect, _T('/'), _T('\\'));
|
||||
ofn.nMaxFile = sizeof(szSelect) / sizeof(TCHAR);
|
||||
ofn.lpstrInitialDir = _T(".");
|
||||
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
BOOL nOpenDlg = GetOpenFileName(&ofn);
|
||||
if (FALSE == nOpenDlg) break;
|
||||
RomDataLoadDriver(szSelDat);
|
||||
if (!GetOpenFileName(&ofn))
|
||||
break;
|
||||
|
||||
BurnerQuickLoad(nQuickOpen, szSelect);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1337,7 +1603,7 @@ static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify)
|
|||
ofn.nMaxFile = MAX_PATH;
|
||||
ofn.lpstrTitle = szTitle;
|
||||
ofn.lpstrFilter = szFilter;
|
||||
ofn.lpstrInitialDir = _T(".");
|
||||
ofn.lpstrInitialDir = szNeoCDGamesDir;
|
||||
ofn.Flags = OFN_NOCHANGEDIR | OFN_HIDEREADONLY;
|
||||
ofn.lpstrDefExt = _T("cue");
|
||||
|
||||
|
@ -1426,32 +1692,7 @@ static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify)
|
|||
#endif
|
||||
|
||||
case MENU_QUIT:
|
||||
AudBlankSound();
|
||||
if (nVidFullscreen) {
|
||||
nVidFullscreen = 0;
|
||||
VidExit();
|
||||
}
|
||||
if (bDrvOkay) {
|
||||
StopReplay();
|
||||
#ifdef INCLUDE_AVI_RECORDING
|
||||
AviStop();
|
||||
#endif
|
||||
DrvExit();
|
||||
if (kNetGame) {
|
||||
kNetGame = 0;
|
||||
Kaillera_End_Game();
|
||||
DeActivateChat();
|
||||
}
|
||||
bCheatsAllowed = true; // reenable cheats netplay has ended
|
||||
|
||||
ScrnSize();
|
||||
ScrnTitle();
|
||||
MenuEnableItems();
|
||||
//nDialogSelect = -1;
|
||||
nBurnDrvActive = ~0U;
|
||||
|
||||
POST_INITIALISE_MESSAGE;
|
||||
}
|
||||
QuitGame();
|
||||
break;
|
||||
|
||||
case MENU_EXIT:
|
||||
|
@ -2359,10 +2600,6 @@ static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify)
|
|||
bSkipStartupCheck = !bSkipStartupCheck;
|
||||
break;
|
||||
|
||||
case MENU_QUICKSCANGAMELIST:
|
||||
bQuicklyCheck = !bQuicklyCheck;
|
||||
break;
|
||||
|
||||
case MENU_SAVEHISCORES:
|
||||
EnableHiscores = !EnableHiscores;
|
||||
break;
|
||||
|
|
|
@ -89,7 +89,10 @@ BEGIN
|
|||
IDS_DISK_ALL_CARD "All Memory Card Files"
|
||||
IDS_DISK_ALL_DAT "All Dat Files"
|
||||
IDS_DISK_TEXT "Text Files"
|
||||
IDS_DISK_FILE_ROMDATA "%s Romdata Files"
|
||||
IDS_DISK_FILE_ROMDATA "%s RomData Type"
|
||||
IDS_DISK_FILE_IPSPATCH "%s IPS Type"
|
||||
IDS_DISK_FILE_NEOGEOCD "%s NeoGeo-CD Type"
|
||||
IDS_DISK_FILE_ARCHIVE "%s Archive Types"
|
||||
|
||||
IDS_DISK_SAVEREPORT "Save system information report"
|
||||
|
||||
|
@ -378,6 +381,12 @@ BEGIN
|
|||
IDS_ERR_DISK_UNAVAIL " is for an unavailable game."
|
||||
IDS_ERR_DISK_TOONEW " does not work with this version of %s."
|
||||
IDS_ERR_DISK_TOOOLD " requires a more recent version of %s, please upgrade."
|
||||
|
||||
IDS_ERR_FILE_ENCODING "Unable to recognize the file encoding of xx.\n\nPlease use the following encodings:\n\nANSI\nUTF-8\nUTF-8 BOM\nUCS-2 Big Endian\nUCS-2 Little Endian\n"
|
||||
IDS_ERR_FILE_EXIST "File does not exist: %s\n"
|
||||
IDS_ERR_FILE_OPEN "An error occurred while opening the %s file."
|
||||
IDS_ERR_FILE_CONTENT "%s has been opened,\n\nbut it does not contain the required content."
|
||||
IDS_ERR_FILE_EXTENSION "Incorrect extension: %s\n\nCorrect extension: %s."
|
||||
|
||||
IDS_ERR_NO_NETPLAYDLL "Error finding 'kailleraclient.dll'."
|
||||
IDS_ERR_NO_DRIVER_SELECTED "No driver has been selected from the list."
|
||||
|
|
Loading…
Reference in New Issue