update msvc project & romdata & hack games (#1616)
update msvc project romdata.cpp: Accurately differentiate between ASCII/UTF8/UTF8BOM in UTF8 & to LF. stdfunc.h: fix for STD_ROM_PICK macro not booting from romdata. d_cps1: GameConfig is correctly indexed when entering the game from romdata. d_neogeo.cpp: update hack games.
This commit is contained in:
parent
7e6e8e3673
commit
f239ce79bb
|
@ -118,6 +118,7 @@
|
|||
<ClCompile Include="..\..\src\burn\devices\intelfsh.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\joyprocess.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\k1ge.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_hit.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_tmap.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\mathbox.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\mb87078.cpp" />
|
||||
|
@ -238,6 +239,7 @@
|
|||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_discoboy.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_eolith.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_eolith16.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_expro02.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_f-32.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_galpani3.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_goori.cpp" />
|
||||
|
|
|
@ -3529,6 +3529,12 @@
|
|||
<ClCompile Include="..\..\src\dep\libs\libspng\spng.c">
|
||||
<Filter>libs\libspng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_expro02.cpp">
|
||||
<Filter>burn\drv\pst90s</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_hit.cpp">
|
||||
<Filter>burn\devices</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Burn">
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
<ClCompile Include="..\..\src\burn\devices\intelfsh.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\joyprocess.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\k1ge.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_hit.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_tmap.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\mathbox.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\mb87078.cpp" />
|
||||
|
@ -238,6 +239,7 @@
|
|||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_discoboy.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_eolith.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_eolith16.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_expro02.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_f-32.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_galpani3.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_goori.cpp" />
|
||||
|
|
|
@ -3529,6 +3529,12 @@
|
|||
<ClCompile Include="..\..\src\dep\libs\libspng\spng.c">
|
||||
<Filter>libs\libspng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_expro02.cpp">
|
||||
<Filter>burn\drv\pst90s</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_hit.cpp">
|
||||
<Filter>burn\devices</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Burn">
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
<ClCompile Include="..\..\src\burn\devices\intelfsh.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\joyprocess.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\k1ge.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_hit.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_tmap.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\mathbox.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\devices\mb87078.cpp" />
|
||||
|
@ -238,6 +239,7 @@
|
|||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_discoboy.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_eolith.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_eolith16.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_expro02.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_f-32.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_galpani3.cpp" />
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_goori.cpp" />
|
||||
|
|
|
@ -3529,6 +3529,12 @@
|
|||
<ClCompile Include="..\..\src\dep\libs\libspng\spng.c">
|
||||
<Filter>libs\libspng</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\burn\drv\pst90s\d_expro02.cpp">
|
||||
<Filter>burn\drv\pst90s</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\burn\devices\kaneko_hit.cpp">
|
||||
<Filter>burn\devices</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="cpus">
|
||||
|
|
|
@ -16545,7 +16545,7 @@ static char* szGameName = NULL;
|
|||
|
||||
static void SetGameConfig()
|
||||
{
|
||||
const char* GameName = (NULL != szGameName) ? szGameName : BurnDrvGetTextA(DRV_NAME);
|
||||
const char* GameName = (NULL != szGameName) ? szGameName : (((NULL != pDataRomDesc) && (-1 != pRDI->nDescCount)) ? pRDI->szDrvName : BurnDrvGetTextA(DRV_NAME));
|
||||
const struct GameConfig *k = &ConfigTable[0];
|
||||
|
||||
while (k->DriverName) {
|
||||
|
|
|
@ -17781,22 +17781,22 @@ struct BurnDriver BurnDrvmslug1v2 = {
|
|||
// Modified by 合金弹头爱克斯
|
||||
// GOTVG 20231028
|
||||
|
||||
static struct BurnRomInfo mslugyqRomDesc[] = {
|
||||
static struct BurnRomInfo mslugqyRomDesc[] = {
|
||||
{ "201-p1qy.p1", 0x100000, 0x750c90c8, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "201-p2dg.sp2", 0x100000, 0xc3cb544c, 1 | BRF_ESS | BRF_PRG },
|
||||
|
||||
MSLUG_COMPONENT
|
||||
};
|
||||
|
||||
STDROMPICKEXT(mslugyq, mslugyq, neogeo)
|
||||
STD_ROM_FN(mslugyq)
|
||||
STDROMPICKEXT(mslugqy, mslugqy, neogeo)
|
||||
STD_ROM_FN(mslugqy)
|
||||
|
||||
struct BurnDriver BurnDrvmslugyq = {
|
||||
"mslugyq", "mslug", "neogeo", NULL, "2023",
|
||||
struct BurnDriver BurnDrvmslugqy = {
|
||||
"mslugqy", "mslug", "neogeo", NULL, "2023",
|
||||
"Metal Slug - Super Vehicle-001 (Origins, Hack)\0", NULL, "hack", "Neo Geo MVS",
|
||||
NULL, NULL, NULL, NULL,
|
||||
BDF_GAME_WORKING | BDF_CLONE | BDF_HACK, 2, HARDWARE_PREFIX_CARTRIDGE | HARDWARE_SNK_NEOGEO, GBF_RUNGUN, FBF_MSLUG,
|
||||
NULL, mslugyqRomInfo, mslugyqRomName, NULL, NULL, NULL, NULL, neogeoInputInfo, neogeoDIPInfo,
|
||||
NULL, mslugqyRomInfo, mslugqyRomName, NULL, NULL, NULL, NULL, neogeoInputInfo, neogeoDIPInfo,
|
||||
NeoInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
|
||||
0x1000, 304, 224, 4, 3
|
||||
};
|
||||
|
@ -17804,11 +17804,11 @@ struct BurnDriver BurnDrvmslugyq = {
|
|||
|
||||
// Metal Slug - Super Vehicle-001 (Item Random FC2, Hack)
|
||||
// Modified by Alice
|
||||
// 20231204
|
||||
// 20231215
|
||||
|
||||
static struct BurnRomInfo mslugfc1RomDesc[] = {
|
||||
{ "201-p1fc1.p1", 0x100000, 0xaa915a0e, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "201-p2fc1.sp2", 0x100000, 0x6de5637a, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "201-p1fc1.p1", 0x100000, 0xdb8f7d81, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "201-p2fc1.sp2", 0x100000, 0xad244b93, 1 | BRF_ESS | BRF_PRG },
|
||||
|
||||
MSLUG_COMPONENT
|
||||
};
|
||||
|
@ -17829,11 +17829,11 @@ struct BurnDriver BurnDrvmslugfc1 = {
|
|||
|
||||
// Metal Slug - Super Vehicle-001 (Item Random & Powerful Enemy Defense FC2, Hack)
|
||||
// Modified by Alice
|
||||
// 20231204
|
||||
// 20231215
|
||||
|
||||
static struct BurnRomInfo mslugfc2RomDesc[] = {
|
||||
{ "201-p1fc2.p1", 0x100000, 0xc167facf, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "201-p2fc2.sp2", 0x100000, 0x1c278a37, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "201-p1fc2.p1", 0x100000, 0xb079dd40, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "201-p2fc2.sp2", 0x100000, 0xdce6a2de, 1 | BRF_ESS | BRF_PRG },
|
||||
|
||||
MSLUG_COMPONENT
|
||||
};
|
||||
|
@ -22285,11 +22285,11 @@ struct BurnDriver BurnDrvkof97t = {
|
|||
|
||||
|
||||
// The King of Fighters '97 (Strengthen Innovation, Hack)
|
||||
// GOTVG 20230129
|
||||
// GOTVG 20231218
|
||||
|
||||
static struct BurnRomInfo kof97stRomDesc[] = {
|
||||
{ "232-p1st.p1", 0x100000, 0x32b4ce56, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "232-p2st.sp2", 0x400000, 0xb0aee031, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "232-p1st.p1", 0x100000, 0x4d4dfd30, 1 | BRF_ESS | BRF_PRG },
|
||||
{ "232-p2st.sp2", 0x400000, 0xf144c697, 1 | BRF_ESS | BRF_PRG },
|
||||
|
||||
KOF97_TEXT
|
||||
|
||||
|
@ -22297,7 +22297,8 @@ static struct BurnRomInfo kof97stRomDesc[] = {
|
|||
{ "232-c2st.c2", 0x800000, 0x831ec266, 3 | BRF_GRA },
|
||||
{ "232-c3st.c3", 0x800000, 0xb092e64f, 3 | BRF_GRA },
|
||||
{ "232-c4st.c4", 0x800000, 0xd25e8a04, 3 | BRF_GRA },
|
||||
KOF97_SPR3
|
||||
{ "232-c5st.c5", 0x400000, 0x91771218, 3 | BRF_GRA },
|
||||
{ "232-c6st.c6", 0x400000, 0x55a1bf39, 3 | BRF_GRA },
|
||||
|
||||
KOF97_Z80
|
||||
|
||||
|
|
|
@ -4,10 +4,19 @@
|
|||
#define STD_ROM_PICK(Name) \
|
||||
static struct BurnRomInfo* Name##PickRom(UINT32 i) \
|
||||
{ \
|
||||
if (i >= sizeof(Name##RomDesc) / sizeof(Name##RomDesc[0])) { \
|
||||
return NULL; \
|
||||
if ((NULL != pDataRomDesc) && (-1 != pRDI->nDescCount)) { \
|
||||
/* Replace with the contents of Romdata */ \
|
||||
/* Differences in array pointers */ \
|
||||
if (i > pRDI->nDescCount) { \
|
||||
return NULL; \
|
||||
} \
|
||||
return pDataRomDesc + i; \
|
||||
} else { \
|
||||
if (i >= sizeof(Name##RomDesc) / sizeof(Name##RomDesc[0])) { \
|
||||
return NULL; \
|
||||
} \
|
||||
return Name##RomDesc + i; \
|
||||
} \
|
||||
return Name##RomDesc + i; \
|
||||
}
|
||||
|
||||
#define STDROMPICKEXT(Name, Info1, Info2) \
|
||||
|
|
|
@ -57,7 +57,38 @@ static TCHAR* _strqtoken(TCHAR* s, const TCHAR* delims)
|
|||
return token;
|
||||
}
|
||||
|
||||
#define UTF8_SIGNATURE "\xef\xbb\xbf"
|
||||
static INT32 IsUTF8Text(const void* pBuffer, long size)
|
||||
{
|
||||
INT32 nCode = 0;
|
||||
unsigned char* start = (unsigned char*)pBuffer;
|
||||
unsigned char* end = (unsigned char*)pBuffer + size;
|
||||
|
||||
while (start < end) {
|
||||
if (*start < 0x80) { // (10000000) ASCII
|
||||
if (0 == nCode) nCode = 1;
|
||||
|
||||
start++;
|
||||
} else if (*start < 0xc0) { // (11000000) Invalid UTF-8
|
||||
return 0;
|
||||
} else if (*start < 0xe0) { // (11100000) 2-byte UTF-8
|
||||
if (nCode < 2) nCode = 2;
|
||||
if (start >= end - 1) break;
|
||||
if (0x80 != (start[1] & 0xc0)) return 0;
|
||||
|
||||
start += 2;
|
||||
} else if (*start < 0xf0) { // (11110000) 3-byte UTF-8
|
||||
if (nCode < 3) nCode = 3;
|
||||
if (start >= end - 2) break;
|
||||
if ((0x80 != (start[1] & 0xc0)) || (0x80 != (start[2] & 0xc0))) return 0;
|
||||
|
||||
start += 3;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return nCode;
|
||||
}
|
||||
|
||||
static INT32 IsDatUTF8BOM()
|
||||
{
|
||||
|
@ -71,25 +102,21 @@ static INT32 IsDatUTF8BOM()
|
|||
|
||||
INT32 nRet = 0;
|
||||
|
||||
if (nDatSize > strlen(UTF8_SIGNATURE)) {
|
||||
char* pszTest = (char*)malloc(nDatSize);
|
||||
char* pszTest = (char*)malloc(nDatSize + 1);
|
||||
|
||||
if (NULL != pszTest) {
|
||||
fread(pszTest, nDatSize, 1, fp);
|
||||
if (0 == strncmp(pszTest, UTF8_SIGNATURE, strlen(UTF8_SIGNATURE))) {
|
||||
nRet = 1;
|
||||
}
|
||||
free(pszTest);
|
||||
pszTest = NULL;
|
||||
}
|
||||
if (NULL != pszTest) {
|
||||
memset(pszTest, 0, nDatSize + 1);
|
||||
fread(pszTest, nDatSize, 1, fp);
|
||||
nRet = IsUTF8Text(pszTest, nDatSize);
|
||||
free(pszTest);
|
||||
pszTest = NULL;
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return nRet;
|
||||
}
|
||||
|
||||
#undef UTF8_SIGNATURE
|
||||
|
||||
#define DELIM_TOKENS_NAME _T(" \t\r\n,%:|{}")
|
||||
|
||||
static INT32 LoadRomdata()
|
||||
|
@ -99,7 +126,7 @@ static INT32 LoadRomdata()
|
|||
|
||||
RDI.nDescCount = -1; // Failed
|
||||
|
||||
const TCHAR* szReadMode = (0 == nType) ? _T("rt") : _T("rt, ccs=UTF-8");
|
||||
const TCHAR* szReadMode = (3 == nType) ? _T("rt, ccs=UTF-8") : _T("rt");
|
||||
|
||||
FILE* fp = _tfopen(szRomdataName, szReadMode);
|
||||
if (NULL == fp) return RDI.nDescCount;
|
||||
|
@ -305,7 +332,7 @@ char* RomdataGetDrvName()
|
|||
INT32 nType = IsDatUTF8BOM();
|
||||
if (-1 == nType) return NULL;
|
||||
|
||||
const TCHAR* szReadMode = (0 == nType) ? _T("rt") : _T("rt, ccs=UTF-8");
|
||||
const TCHAR* szReadMode = (3 == nType) ? _T("rt, ccs=UTF-8") : _T("rt");
|
||||
|
||||
FILE* fp = _tfopen(szRomdataName, szReadMode);
|
||||
if (NULL == fp) return NULL;
|
||||
|
|
Loading…
Reference in New Issue