Fix dat file writing from command-line and added command line options for PC-Engine datfiles
This commit is contained in:
parent
b25a838ccc
commit
c33c571bf1
|
@ -65,6 +65,24 @@ INT32 write_datfile(INT32 bType, FILE* fDat)
|
|||
UINT32 nOldSelect=0;
|
||||
UINT32 nGameSelect=0;
|
||||
UINT32 nParentSelect,nBoardROMSelect;
|
||||
|
||||
fprintf(fDat, "<?xml version=\"1.0\"?>\n");
|
||||
fprintf(fDat, "<!DOCTYPE datafile PUBLIC \"-//FB Alpha//DTD ROM Management Datafile//EN\" \"http://www.logiqx.com/Dats/datafile.dtd\">\n\n");
|
||||
fprintf(fDat, "<datafile>\n");
|
||||
fprintf(fDat, "\t<header>\n");
|
||||
fprintf(fDat, "\t\t<name>" APP_TITLE "</name>\n");
|
||||
if (bType == DAT_ARCADE_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" Arcade Games</description>\n"), szAppBurnVer);
|
||||
if (bType == DAT_MEGADRIVE_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" Megadrive Games</description>\n"), szAppBurnVer);
|
||||
if (bType == DAT_PCENGINE_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" PC-Engine Games</description>\n"), szAppBurnVer);
|
||||
if (bType == DAT_TG16_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" TurboGrafx 16 Games</description>\n"), szAppBurnVer);
|
||||
if (bType == DAT_SGX_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" SuprGrafx Games</description>\n"), szAppBurnVer);
|
||||
fprintf(fDat, "\t\t<category>Standard DatFile</category>\n");
|
||||
_ftprintf(fDat, _T("\t\t<version>%s</version>\n"), szAppBurnVer);
|
||||
fprintf(fDat, "\t\t<author>" APP_TITLE "</author>\n");
|
||||
fprintf(fDat, "\t\t<homepage>http://www.barryharris.me.uk/</homepage>\n");
|
||||
fprintf(fDat, "\t\t<url>http://www.barryharris.me.uk/</url>\n");
|
||||
fprintf(fDat, "\t\t<clrmamepro forcenodump=\"ignore\"/>\n");
|
||||
fprintf(fDat, "\t</header>\n");
|
||||
|
||||
nOldSelect=nBurnDrvActive; // preserve the currently selected driver
|
||||
|
||||
|
@ -526,24 +544,6 @@ INT32 create_datfile(TCHAR* szFilename, INT32 bType)
|
|||
if ((fDat = _tfopen(szFilename, _T("wt")))==0)
|
||||
return -1;
|
||||
|
||||
fprintf(fDat, "<?xml version=\"1.0\"?>\n");
|
||||
fprintf(fDat, "<!DOCTYPE datafile PUBLIC \"-//FB Alpha//DTD ROM Management Datafile//EN\" \"http://www.logiqx.com/Dats/datafile.dtd\">\n\n");
|
||||
fprintf(fDat, "<datafile>\n");
|
||||
fprintf(fDat, "\t<header>\n");
|
||||
fprintf(fDat, "\t\t<name>" APP_TITLE "</name>\n");
|
||||
if (bType == DAT_ARCADE_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" Arcade Games</description>\n"), szAppBurnVer);
|
||||
if (bType == DAT_MEGADRIVE_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" Megadrive Games</description>\n"), szAppBurnVer);
|
||||
if (bType == DAT_PCENGINE_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" PC-Engine Games</description>\n"), szAppBurnVer);
|
||||
if (bType == DAT_TG16_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" TurboGrafx 16 Games</description>\n"), szAppBurnVer);
|
||||
if (bType == DAT_SGX_ONLY) _ftprintf(fDat, _T("\t\t<description>") _T(APP_TITLE) _T(" v%s") _T(" SuprGrafx Games</description>\n"), szAppBurnVer);
|
||||
fprintf(fDat, "\t\t<category>Standard DatFile</category>\n");
|
||||
_ftprintf(fDat, _T("\t\t<version>%s</version>\n"), szAppBurnVer);
|
||||
fprintf(fDat, "\t\t<author>" APP_TITLE "</author>\n");
|
||||
fprintf(fDat, "\t\t<homepage>http://www.barryharris.me.uk/</homepage>\n");
|
||||
fprintf(fDat, "\t\t<url>http://www.barryharris.me.uk/</url>\n");
|
||||
fprintf(fDat, "\t\t<clrmamepro forcenodump=\"ignore\"/>\n");
|
||||
fprintf(fDat, "\t</header>\n");
|
||||
|
||||
nRet = write_datfile(bType, fDat);
|
||||
|
||||
fclose(fDat);
|
||||
|
|
|
@ -656,17 +656,27 @@ int ProcessCmdLine()
|
|||
|
||||
if (_tcslen(szName)) {
|
||||
if (_tcscmp(szName, _T("-listinfo")) == 0) {
|
||||
write_datfile(0, stdout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (_tcscmp(szName, _T("-listinfowithmd")) == 0) {
|
||||
write_datfile(1, stdout);
|
||||
write_datfile(DAT_ARCADE_ONLY, stdout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (_tcscmp(szName, _T("-listinfomdonly")) == 0) {
|
||||
write_datfile(2, stdout);
|
||||
write_datfile(DAT_MEGADRIVE_ONLY, stdout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (_tcscmp(szName, _T("-listinfopceonly")) == 0) {
|
||||
write_datfile(DAT_PCENGINE_ONLY, stdout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (_tcscmp(szName, _T("-listinfotg16only")) == 0) {
|
||||
write_datfile(DAT_TG16_ONLY, stdout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (_tcscmp(szName, _T("-listinfosgxonly")) == 0) {
|
||||
write_datfile(DAT_SGX_ONLY, stdout);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue