Add sf2mdt to d_cps1.cpp, debug only

This commit is contained in:
Barry Harris 2012-04-09 17:55:13 +00:00
parent bfeb93d6f8
commit 56a7d310d0
4 changed files with 138 additions and 2 deletions

View File

@ -325,6 +325,34 @@ static INT32 CpsLoadOneBootlegType2(UINT8* Tile, INT32 nNum, INT32 nWord, INT32
return 0;
}
static INT32 CpsLoadOneBootlegType3(UINT8 *Tile, INT32 nNum, INT32 nWord, INT32 nShift)
{
UINT8 *Rom = NULL; int nRomLen=0;
UINT8 *pt = NULL, *pr = NULL;
INT32 i;
LoadUp(&Rom, &nRomLen, nNum);
if (Rom == NULL) {
return 1;
}
nRomLen &= ~1; // make sure even
for (i = 0, pt = Tile, pr = Rom; i < nRomLen; pt += 4) {
UINT32 Pix; // Eight pixels
UINT8 b;
b = *pr++; i++; Pix = SepTable[b];
if (nWord) {
b = *pr++; i++; Pix |= SepTable[b] << 1;
}
Pix <<= nShift;
*((UINT32 *)pt) |= Pix;
}
BurnFree(Rom);
return 0;
}
static INT32 CpsLoadOneSf2ebbl(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift)
{
UINT8 *Rom = NULL; INT32 nRomLen=0;
@ -553,6 +581,24 @@ INT32 CpsLoadTilesSf2koryu(INT32 nStart)
return 0;
}
INT32 CpsLoadTilesSf2mdt(INT32 nStart)
{
CpsLoadOneBootlegType3(CpsGfx + 0x000000, nStart + 0, 0, 0);
CpsLoadOneBootlegType3(CpsGfx + 0x000000, nStart + 1, 0, 1);
CpsLoadOneBootlegType3(CpsGfx + 0x000000, nStart + 2, 0, 2);
CpsLoadOneBootlegType3(CpsGfx + 0x000000, nStart + 3, 0, 3);
CpsLoadOneBootlegType3(CpsGfx + 0x200000, nStart + 4, 0, 0);
CpsLoadOneBootlegType3(CpsGfx + 0x200000, nStart + 5, 0, 1);
CpsLoadOneBootlegType3(CpsGfx + 0x200000, nStart + 6, 0, 2);
CpsLoadOneBootlegType3(CpsGfx + 0x200000, nStart + 7, 0, 3);
CpsLoadOneBootlegType3(CpsGfx + 0x400000, nStart + 8, 0, 0);
CpsLoadOneBootlegType3(CpsGfx + 0x400000, nStart + 9, 0, 1);
CpsLoadOneBootlegType3(CpsGfx + 0x400000, nStart + 10, 0, 2);
CpsLoadOneBootlegType3(CpsGfx + 0x400000, nStart + 11, 0, 3);
return 0;
}
INT32 CpsLoadStars(UINT8* pStar, INT32 nStart)
{
UINT8* pTemp[2] = { NULL, NULL};

View File

@ -43,6 +43,7 @@ INT32 CpsLoadTilesCaptcomb(UINT8 *Tile, INT32 nStart);
INT32 CpsLoadTilesPunipic2(UINT8 *Tile, INT32 nStart);
INT32 CpsLoadTilesSf2ebbl(UINT8 *Tile, INT32 nStart);
INT32 CpsLoadTilesSf2koryu(INT32 nStart);
INT32 CpsLoadTilesSf2mdt(INT32 nStart);
INT32 CpsLoadStars(UINT8 *pStar, INT32 nStart);
INT32 CpsLoadStarsByte(UINT8 *pStar, INT32 nStart);
INT32 CpsLoadStarsForgottnAlt(UINT8 *pStar, INT32 nStart);

View File

@ -54,8 +54,6 @@ static UINT8 CpsReadPort(const UINT32 ia)
{
UINT8 d = 0xFF;
// bprintf(PRINT_NORMAL, _T("Read Port %x\n"), ia);
if (ia == 0x000) {
d = (UINT8)~Inp000;
if (Pzloop2) {
@ -277,6 +275,8 @@ static UINT8 CpsReadPort(const UINT32 ia)
}
}
}
// bprintf(PRINT_NORMAL, _T("Read Port %x\n"), ia);
return d;
}
@ -360,6 +360,8 @@ static void CpsWritePort(const UINT32 ia, UINT8 d)
return;
}
}
// bprintf(PRINT_NORMAL, _T("Write Port %x, %x\n"), ia, d);
}
UINT8 __fastcall CpsReadByte(UINT32 a)

View File

@ -8190,6 +8190,31 @@ static struct BurnRomInfo Sf2koryu2RomDesc[] = {
STD_ROM_PICK(Sf2koryu2)
STD_ROM_FN(Sf2koryu2)
static struct BurnRomInfo Sf2mdtRomDesc[] = {
{ "3.ic172", 0x0080000, 0x5301b41f, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP },
{ "1.ic171", 0x0080000, 0xc1c803f6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP },
{ "4.ic176", 0x0020000, 0x1073b7b6, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP },
{ "2.ic175", 0x0020000, 0x924c6ce2, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP },
{ "7.ic90", 0x0080000, 0x896eaf48, BRF_GRA | CPS1_TILES },
{ "13.ic89", 0x0080000, 0x305dd72a, BRF_GRA | CPS1_TILES },
{ "10.ic88", 0x0080000, 0xef3f5be8, BRF_GRA | CPS1_TILES },
{ "16.ic87", 0x0080000, 0xe57f6db9, BRF_GRA | CPS1_TILES },
{ "6.ic91", 0x0080000, 0x054cd5c4, BRF_GRA | CPS1_TILES },
{ "12.ic92", 0x0080000, 0x87e069e8, BRF_GRA | CPS1_TILES },
{ "9.ic93", 0x0080000, 0x818ca33d, BRF_GRA | CPS1_TILES },
{ "15.ic94", 0x0080000, 0x5dfb44d1, BRF_GRA | CPS1_TILES },
{ "8.ic86", 0x0080000, 0x34bbb3fa, BRF_GRA | CPS1_TILES },
{ "14.ic85", 0x0080000, 0x7d9f1a67, BRF_GRA | CPS1_TILES },
{ "11.ic84", 0x0080000, 0xcea6d1d6, BRF_GRA | CPS1_TILES },
{ "17.ic83", 0x0080000, 0x91a9a05d, BRF_GRA | CPS1_TILES },
{ "5.ic26", 0x0020000, 0x17d5ba8a, BRF_PRG | CPS1_Z80_PROGRAM },
};
STD_ROM_PICK(Sf2mdt)
STD_ROM_FN(Sf2mdt)
static struct BurnRomInfo Sf2m1RomDesc[] = {
{ "222e", 0x0080000, 0x1e20d0a3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP },
{ "196e", 0x0080000, 0x88cc38a3, BRF_ESS | BRF_PRG | CPS1_68K_PROGRAM_BYTESWAP },
@ -10379,6 +10404,7 @@ static const struct GameConfig ConfigTable[] =
{ "sf2acc2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL },
{ "sf2accp2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL },
{ "sf2dkot2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL },
{ "sf2mdt" , CPS_B_21_DEF, mapper_S9263B, 0, NULL },
{ "sf2m1" , CPS_B_21_DEF, mapper_S9263B, 0, NULL },
{ "sf2m2" , CPS_B_21_DEF, mapper_S9263B, 0, NULL },
{ "sf2m3" , HACK_B_2 , mapper_S9263B, 0, NULL },
@ -11374,6 +11400,57 @@ static INT32 Sf2koryu2Init()
return Sf2ceInit();
}
UINT8 __fastcall Sf2mdtReadByte(UINT32 a)
{
switch (a) {
case 0x70c01a: {
return 0xff;
}
case 0x70c01c: {
return 0xff;
}
case 0x70c01e: {
return 0xff;
}
default: {
bprintf(PRINT_NORMAL, _T("Read Byte %x\n"), a);
}
}
return 0;
}
UINT16 __fastcall Sf2mdtReadWord(UINT32 a)
{
switch (a) {
default: {
bprintf(PRINT_NORMAL, _T("Read Word %x\n"), a);
}
}
return 0;
}
static INT32 Sf2mdtInit()
{
Cps1CallbackFunction = CpsLoadTilesSf2mdt;
Cps1DisablePSnd = 1;
INT32 nRet = Sf2ceInit();
SekOpen(0);
SekMapHandler(1, 0x70c000, 0x70cfff, SM_READ);
SekSetReadByteHandler(1, Sf2mdtReadByte);
SekSetReadWordHandler(1, Sf2mdtReadWord);
SekClose();
return nRet;
}
static void Sf2hfjbCallback()
{
*((UINT16*)(CpsRom + 0x1d22a)) = 0x0120; // Fix scroll
@ -13623,6 +13700,16 @@ struct BurnDriver BurnDrvCpsSf2koryu2 = {
&CpsRecalcPal, 0x1000, 384, 224, 4, 3
};
struct BurnDriverD BurnDrvCpsSf2mdt = {
"sf2mdt", "sf2ce", NULL, NULL, "1992",
"Street Fighter II' - Magic Delta Turbo (bootleg)\0", "No sound, incorrect graphics", "Capcom", "CPS1",
NULL, NULL, NULL, NULL,
BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_CAPCOM_CPS1, GBF_VSFIGHT, FBF_SF,
NULL, Sf2mdtRomInfo, Sf2mdtRomName, NULL, NULL, Sf2InputInfo, Sf2DIPInfo,
Sf2mdtInit, DrvExit, Cps1Frame, CpsRedraw, CpsAreaScan,
&CpsRecalcPal, 0x1000, 384, 224, 4, 3
};
struct BurnDriverD BurnDrvCpsSf2m1 = {
"sf2m1", "sf2ce", NULL, NULL, "1992",
"Street Fighter II' - champion edition (bootleg, M1)\0", NULL, "Capcom", "CPS1",