Author Topic: SVC Chaos driver infos.  (Read 47019 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
SVC Chaos driver infos.
« on: November 08, 2004, 06:35:31 AM »
Here's source code to descramble the bootleg svc C roms:

Code: [Select]
// Original MAME code by HalRIN - http://www52.tok2.com/home/foge/
static void svcboot_cx_decrypt()
{
const unsigned char sec[ 0x10 ] = {
0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5,
};

const unsigned char swap[ 6 ][ 4 ] = {
{ 3, 0, 1, 2 },
{ 2, 3, 0, 1 },
{ 1, 2, 3, 0 },
{ 0, 1, 2, 3 },
{ 3, 2, 1, 0 },
{ 3, 0, 2, 1 },
};

int i;
int fsize = 0x4000000;
UINT8 *src = NeoSpriteROM;
UINT8 *dst = (UINT8*)malloc( fsize );
int ofst;

memcpy( dst, src, fsize );

for( i = 0; i < fsize / 0x80; i++ ){
int tbl = sec[ (i & 0xf00) >> 8 ];

int bit0 = swap[ tbl ][ 0 ];
int bit1 = swap[ tbl ][ 1 ];
int bit2 = swap[ tbl ][ 2 ];
int bit3 = swap[ tbl ][ 3 ];

ofst = BITSWAP08( (i & 0x0000ff), 7, 6, 5, 4, bit3, bit2, bit1, bit0 );
ofst += (i & 0xfffff00);

memcpy( &src[ i * 0x80 ], &dst[ ofst * 0x80 ], 0x80 );
}

free( dst );
}

I've attached the old (lib) that was used to descramble the bootleg svc C roms.
« Last Edit: October 29, 2006, 02:03:39 AM by iq_132 »


Offline NJ7

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-6
  • Member
Drivers....
« Reply #1 on: November 08, 2004, 07:36:35 PM »
And here are my drivers for anyone who cares.....LOL :D

Don't PM me about these not being 100% correct, I know they aren't, but it's the best I got right now.....the others are hard to find or not emulated correctly....... ;)

Code: [Select]

// SVC Chaos: SNK Vs. Capcom (bootleg, set 1)


static struct BurnRomInfo svcbootRomDesc[] = {
{"svc-p1.bin", 0x600000, 0x1cc8fb7a, 0x10}, //  0 68K code

{"svc-s1.bin", 0x020000, 0x70b44df1,    1}, //  1 Text data

        {"svc-c1.bin", 0x800000, 0xa7826b89,    1}, //  2 Sprite data
{"svc-c2.bin", 0x800000, 0xed3c2089,    1}, //  3
{"svc-c3.bin", 0x800000, 0x71ed8063,    1}, //  5
{"svc-c4.bin", 0x800000, 0x250bde2d,    1}, //  6
{"svc-c5.bin", 0x800000, 0x9817c082,    1}, //  7
{"svc-c6.bin", 0x800000, 0x2bc0307f,    1}, //  8
{"svc-c7.bin", 0x800000, 0x4358d7b9,    1}, //  9
{"svc-c8.bin", 0x800000, 0x366deee5,    1}, //  10

{"svc-m1.bin", 0x020000, 0x804328c3, 0x10}, // 11 Z80 code

{"svc-v1.bin", 0x400000, 0xbd3a391f, 2}, // 12 Sound data
        {"svc-v2.bin", 0x400000, 0xb5097287, 2}, // 13
        {"svc-v3.bin", 0x400000, 0xaa9849a0, 2}, // 14
        {"svc-v4.bin", 0x400000, 0x33fc0b37, 2}, // 15

};

STDROMPICKEXT(svcboot, svcboot, neogeo);
STD_ROM_FN(svcboot);

static void svcboot_m1Decrypt()
{
        UINT8 *mrom = (UINT8 *)(NeoZ80ROM);
        UINT8 *dst = (UINT8*)malloc(0x20000);
        memcpy( dst+0x00000, mrom+0x10000, 0x10000 );
        memcpy( dst+0x10000, mrom+0x00000, 0x10000 );
        memcpy( mrom, dst, 0x20000 );
        free(dst);
        svcboot_c(); // svcboot C fix
}

static int svcbootInit()
{
        pNeoInitCallback=svcboot_m1Decrypt;
        nTextBankswitch=2;
        nADPCMByteswap = 2;
        return NeoInit();
}

struct BurnDriver BurnDrvsvcboot = {

{"svcboot", "SVC Chaos: SNK Vs. Capcom (bootleg, set 1)", NULL, "Playmore / Capcom", "Neo Geo", "2003", NULL, "neogeo"},
BDF_GAME_WORKING | BDF_LOCKED | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO,
NULL, svcbootRomInfo, svcbootRomName, neogeoInputInfo, neogeoDIPInfo,
svcbootInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};

// SVC Chaos: SNK vs Capcom (bootleg, set 2)

/* ==================================================  =============================== */
/* This version has the blending effect as svcchaos, the text rom is scrambled
   and needs extra handling...     */
/* ==================================================  =============================== */

static struct BurnRomInfo svcbootaRomDesc[] = {
{"svc-p1.bin", 0x600000, 0x1cc8fb7a, 0x10}, //  0 68K code

{"svc-s1a.bin ", 0x080000, 0xad184232,    1}, //  1 Text data

{"svc-c1.bin", 0x800000, 0xa7826b89,    1}, //  2 Sprite data
{"svc-c2.bin", 0x800000, 0xed3c2089,    1}, //  3
{"svc-c3.bin", 0x800000, 0x71ed8063,    1}, //  5
{"svc-c4.bin", 0x800000, 0x250bde2d,    1}, //  6
{"svc-c5.bin", 0x800000, 0x9817c082,    1}, //  7
{"svc-c6.bin", 0x800000, 0x2bc0307f,    1}, //  8
{"svc-c7.bin", 0x800000, 0x4358d7b9,    1}, //  9
{"svc-c8.bin", 0x800000, 0x366deee5,    1}, //  10

{"svc-m1.bin",  0x020000, 0x804328c3, 0x10}, // 11 Z80 code

{"svc-v1.bin", 0x400000, 0xbd3a391f, 2}, // 12 Sound data
        {"svc-v2.bin", 0x400000, 0xb5097287, 2}, // 13
        {"svc-v3.bin", 0x400000, 0xaa9849a0, 2}, // 14
        {"svc-v4.bin", 0x400000, 0x33fc0b37, 2}, // 15
};

STDROMPICKEXT(svcboota, svcboota, neogeo);
STD_ROM_FN(svcboota);

static int svcbootaInit()
{
/* This uses the same function for the m1 as svcboot */
pNeoInitCallback=svcboot_m1Decrypt;
nTextBankswitch=4;
        nADPCMByteswap = 2;
return NeoInit();
}

struct BurnDriver BurnDrvsvcboota = {
{"svcboota", "SVC Chaos: SNK Vs. Capcom (bootleg, set 2)", NULL, "Playmore / Capcom", "Neo Geo", "2003", "svcboot", "neogeo"},
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_LOCKED, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ALTERNATE_TEXT,
NULL, svcbootaRomInfo, svcbootaRomName, neogeoInputInfo, neogeoDIPInfo,
svcbootaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};

// SVC Chaos: SNK Vs. Capcom Plus! (bootleg, set 1)


static struct BurnRomInfo svcplusRomDesc[] = {
{"svc-p1p.bin", 0x600000, 0x7bdc4420, 0x10}, //  0 68K code

{"svc-s1p.bin", 0x020000, 0xaaef740c,    1}, //  1 Text data

        {"svc-c1.bin", 0x800000, 0xa7826b89,    1}, //  2 Sprite data
{"svc-c2.bin", 0x800000, 0xed3c2089,    1}, //  3
{"svc-c3.bin", 0x800000, 0x71ed8063,    1}, //  5
{"svc-c4.bin", 0x800000, 0x250bde2d,    1}, //  6
{"svc-c5.bin", 0x800000, 0x9817c082,    1}, //  7
{"svc-c6.bin", 0x800000, 0x2bc0307f,    1}, //  8
{"svc-c7.bin", 0x800000, 0x4358d7b9,    1}, //  9
{"svc-c8.bin", 0x800000, 0x366deee5,    1}, //  10

{"svc-m1.bin", 0x020000, 0x804328c3, 0x10}, // 11 Z80 code

{"svc-v1.bin", 0x400000, 0xbd3a391f, 2}, // 12 Sound data
        {"svc-v2.bin", 0x400000, 0xb5097287, 2}, // 13
        {"svc-v3.bin", 0x400000, 0xaa9849a0, 2}, // 14
        {"svc-v4.bin", 0x400000, 0x33fc0b37, 2}, // 15

};

STDROMPICKEXT(svcplus, svcplus, neogeo);
STD_ROM_FN(svcplus);

static int svcplusInit()
{
        pNeoInitCallback=svcboot_m1Decrypt;
        nADPCMByteswap = 2;
        return NeoInit();
}

struct BurnDriver BurnDrvsvcplus = {

{"svcplus", "SVC Chaos: SNK Vs. Capcom Plus! (bootleg, set 1)", NULL, "Playmore / Capcom", "Neo Geo", "2003", "svcboot", "neogeo"},
BDF_GAME_WORKING | BDF_LOCKED | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO,
NULL, svcplusRomInfo, svcplusRomName, neogeoInputInfo, neogeoDIPInfo,
svcplusInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};

// SvC Chaos: SNK vs Capcom Plus! (bootleg, set 2)

static struct BurnRomInfo svcplusaRomDesc[] = {
{"svc-p1pl.bin",0x200000, 0x16b44144, 0x10}, //  0 68K code /* alternate code... scrambled and protected */
{"svc-p2pl.bin",0x400000, 0x7231ace2, 0x10}, //  1

{"svc-s1pl.bin",0x020000, 0xca3c735e,    1}, //  2 Text data /* scrambled */

{"svc-c1.bin",  0x800000, 0xa7826b89,    1}, //  3 Sprite data /* bit-swaped */
{"svc-c2.bin",  0x800000, 0xed3c2089,    1}, //  4
{"svc-c3.bin",  0x800000, 0x71ed8063,    1}, //  5
{"svc-c4.bin",  0x800000, 0x250bde2d,    1}, //  6
{"svc-c5.bin",  0x800000, 0x9817c082,    1}, //  7
{"svc-c6.bin",  0x800000, 0x2bc0307f,    1}, //  8
{"svc-c7.bin",  0x800000, 0x4358d7b9,    1}, //  9
{"svc-c8.bin",  0x800000, 0x366deee5,    1}, //  10

{"svc-m1.bin",  0x020000, 0x804328c3, 0x10}, //  11 Z80 code /* scrambled */

/* scrambled, bit-swaped */
{"svc-v1.bin",  0x400000, 0xbd3a391f,    2}, // 12 Sound data
{"svc-v2.bin",  0x400000, 0xb5097287,    2}, // 13
{"svc-v3.bin",  0x400000, 0xaa9849a0,    2}, // 14
{"svc-v4.bin",  0x400000, 0x33fc0b37,    2}, // 15
};

STDROMPICKEXT(svcplusa, svcplusa, neogeo);
STD_ROM_FN(svcplusa);

static void svcplusaDecrypt()
{
/* Descrambling Px by FerchogtX */
unsigned char* prom = Neo68KROM01;
unsigned char* dst = (unsigned char*)malloc(0x600000);

unsigned int sec[]={0x100000,0x200000,0x300000,0x400000,0x500000,0x000000};
if (dst)
{
memcpy( dst, prom, 0x600000 );
for( int i=0; i<6; ++i )
{
memcpy( prom+i*0x100000, dst+sec[i], 0x100000 );
}
free(dst);
}
svcboot_m1Decrypt();// Using the same function as svcboota
/*  Patch out protection (info by robber804)  */
/*
F8010: 40 C6  F8011: 04 33
F8012: 00 2F  F8013: 10 00
F8014: 40 F2  F8015: 46 FF
F8016: C1 C2  some kind of protection?
F802C: 16 C0  don't know what this does

F80C0: FF 42  F80C1: FF 06
F80C2: FF 02  F80C3: FF 00
F80C4: FF F9  F80C5: FF 4E
F80C6: FF 0F  F80C7: FF 00
F80C8: FF 16  F80C9: FF 80
*/
// 33c2 for "good" crc
*((unsigned short*)(Neo68KROM01 + 0xf8016)) = 0x33c1; /* 0F8028  33C2 002F FFF0            MOVE.W   D2,0x2FFFF0 */

/* The below probably does not need to be patched in memory needed just to patch diffs from 1cc8fb7a */
// *((unsigned short*)(Neo68KROM01 + 0xf8010)) = 0x4004; /* 0F8010  33C6 002F FFF2            MOVE.W   D6,0x2FFFF2 */
// *((unsigned short*)(Neo68KROM01 + 0xf8012)) = 0x0010;
// *((unsigned short*)(Neo68KROM01 + 0xf8014)) = 0x4046;

// *((unsigned short*)(Neo68KROM01 + 0xf802c)) = 0x1680; /* 0F8028  4EF9 000F 80C0            JMP      0xF80C0 */

// *((unsigned short*)(Neo68KROM01 + 0xf80c0)) = 0xffff; /* 0F8028  4EF9 000F 80C0            JMP      0xF80C0 */
// *((unsigned short*)(Neo68KROM01 + 0xf80c2)) = 0xffff; /* 0F8028  4EF9 000F 80C0            JMP      0xF80C0 */
// *((unsigned short*)(Neo68KROM01 + 0xf80c4)) = 0xffff; /* 0F8028  4EF9 000F 80C0            JMP      0xF80C0 */
// *((unsigned short*)(Neo68KROM01 + 0xf80c6)) = 0xffff; /* 0F8028  4EF9 000F 80C0            JMP      0xF80C0 */
// *((unsigned short*)(Neo68KROM01 + 0xf80c8)) = 0xffff; /* 0F8028  4EF9 000F 80C0            JMP      0xF80C0 */
}

static int svcplusaInit()
{
pNeoInitCallback = svcplusaDecrypt;
nTextBankswitch=2;
nADPCMByteswap = 3;
return NeoInit();
}

struct BurnDriver BurnDrvsvcplusa = {
{"svcplusa", "SVC Chaos: SNK Vs. Capcom Plus! (bootleg, set 2)", NULL, "Playmore / Capcom", "Neo Geo", "2003", "svcboot", "neogeo"},
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG | BDF_LOCKED, 2, HARDWARE_SNK_NEOGEO,
NULL, svcplusaRomInfo, svcplusaRomName, neogeoInputInfo, neogeoDIPInfo,
svcplusaInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
SVC Chaos driver infos.
« Reply #2 on: November 21, 2004, 06:21:27 PM »
Here is the code for these roms (svcsplus) :D

Code: [Select]
{"svc-p1p.bin", 0x400000, 0x2601902F, 0x10}, // 0 68K code
{"svc-p2p.bin", 0x400000, 0x0ca13305, 0x10}, // 1

{"svc-s1p.bin", 0x020000, 0x233D6439,    1}, // 2 Text data

Here's the S decryption code (It's best to use ferchogtx's "NeoTextromfix" code and add this to that):

Code: [Select]
// Converted by Jimmy_Page (www.neofighters.com)
srom = NeoTextROM+0x20000;
for (int i=0;i<0x20000;i++)
srom[i]=BITSWAP08(srom[i],7,6,0,4,3,2,1,5);

Here's the P decryption code.

Code: [Select]
// Analyzed by HalRIN - http://www52.tok2.com/home/foge/
static void svcsplus_px_decrypt()
{
int sec[] = {0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x07};
int sed[] = {0x000000,0x700000,0x100000,0x200000,0x300000,0x400000,0x500000};

unsigned char *src = Neo68KROM01;
int i,ofst,size = 0x800000;
unsigned char *dst = (unsigned char*)malloc(size);

memcpy( dst, src, size );

for( i = 0; i < size / 2; i++ )
{
ofst = BITSWAP16( (i & 0x007fff), 0x0f, 0x00, 0x08, 0x09, 0x0b, 0x0a, 0x0c, 0x0d,
  0x04, 0x03, 0x01, 0x07, 0x06, 0x02, 0x05, 0x0e );

        ofst += (i & 0x078000);
        ofst += sec[ (i & 0xf80000) >> 19 ] << 19;

        memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 );
}

memcpy(dst,src,0x800000);
for(i = 0; i < 7; ++i)
{
memcpy(src+i*0x100000,dst+sed[i],0x100000);
}
free(dst);

*((unsigned short*)(Neo68KROM01 + 0x9E90)) = 0x000F; // Enable S. Plus
*((unsigned short*)(Neo68KROM01 + 0x9E92)) = 0xc9c0;
*((unsigned short*)(Neo68KROM01 + 0xA10C)) = 0x4EB9; // Enable boss icons
*((unsigned short*)(Neo68KROM01 + 0xA10E)) = 0x000E;
*((unsigned short*)(Neo68KROM01 + 0xA110)) = 0x9750;
}
« Last Edit: October 29, 2006, 02:04:23 AM by iq_132 »


Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
SVC Chaos driver infos.
« Reply #3 on: November 21, 2004, 06:23:16 PM »
And here's the P rom decryption code for these P roms (svcplus):

Code: [Select]
{"svc-p1p.bin", 0x200000, 0xA194D842, 0x10}, //  0 68K code
{"svc-p2p.bin", 0x200000, 0x50C0E2B7, 0x10}, //  1
{"svc-p3p.bin", 0x200000, 0x58CDC293, 0x10}, //  2

Code: [Select]
// Analyzed by HalRIN - http://www52.tok2.com/home/foge/
static void svcplus_px_decrypt()
{
int sec[] = {0x00, 0x03, 0x02, 0x05, 0x04, 0x01};

unsigned char *src = Neo68KROM01;
int i,ofst,rom_size = 0x600000;
unsigned char *dst = (unsigned char*)malloc( rom_size );

memcpy( dst, src, rom_size );
for( i = 0; i < rom_size / 2; i++ ){
ofst = BITSWAP24( (i & 0xfffff), 0x17, 0x16, 0x15, 0x14, 0x13, 0x00, 0x01, 0x02,
0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
0x07, 0x06, 0x05, 0x04, 0x03, 0x10, 0x11, 0x12 );
ofst ^= 0x0f0007;
ofst += (i & 0xff00000);
memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 );
}
memcpy( dst, src, rom_size );
for( i = 0; i < 6; i++ ){
memcpy( &src[ i << 20 ], &dst[ sec[ i ] << 20 ], (1 << 20) );
}
free( dst );

*((unsigned short*)(Neo68KROM01 + 0xF8016)) = 0x33c1; // Patch protected address
}
« Last Edit: October 29, 2006, 02:04:40 AM by iq_132 »


Offline KaNyErO

  • Member
  • ***
  • Posts: 142
  • Karma: +4/-0
SVC Chaos driver infos.
« Reply #4 on: November 21, 2004, 07:00:51 PM »
well it seems that the protection algorithm for new bootleg hacks is very similar to the protection used in the pcb games:

for svcsplus (it MUST work for kof2k3up too)
srom=BITSWAP08(srom,7,6,0,4,3,2,1,5);

for kof2k1pla
srom=BITSWAP08(srom,3,2,4,5,1,6,0,7);

for svcnd and kof2k3 PCB (svcchaos pcb too)
srom=BITSWAP08(srom,4,0,7,2,5,1,6,3);

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
SVC Chaos driver infos.
« Reply #5 on: November 21, 2004, 07:18:20 PM »
Here's my attempt to convert that code to FBA.

*edit*
You need | HARDWARE_SNK_ALTERNATE_TEXT for kof2003 :)

Replace the NeoExtractSData function in neo_decrypt.cpp
Code: [Select]
// Analyzed by HalRIN - http://www52.tok2.com/home/foge/
void NeoExtractSData(unsigned char* rom, unsigned char* sdata, int rom_size, int sdata_size)
{
if (sdata_size != 0x100000)
{
/* the S data comes from the end fo the C data */
rom += rom_size - sdata_size;

for (int i = 0; i < sdata_size; i++) {
sdata[i] = rom[(i & ~0x1F) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)];
}
} else {
int i;
unsigned char *src;
unsigned char *dst;

src = rom + rom_size - 0x1000000 - 0x80000;
dst = sdata;

// This extracts the first 512k of S data
for( i = 0; i < sdata_size / 2; i++ ){
dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
}

src = rom + rom_size - 0x80000;
dst = sdata + 0x80000;

// This extracts the second 512k of S data
for( i = 0; i < sdata_size / 2; i++ ){
dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
}

// This descrambles the S data (kof2003)
dst = sdata;
for( i = 0; i < sdata_size; i++ ){
dst[ i ] = BITSWAP08( dst[ i ] ^ 0xd2, 4, 0, 7, 2, 5, 1, 6, 3 );
}
}
}
« Last Edit: October 29, 2006, 02:04:58 AM by iq_132 »


Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
SVC Chaos driver infos.
« Reply #6 on: November 21, 2004, 08:35:13 PM »
Quote from: iq_132
Here is the code for these roms (svcsplus) :D

Code: [Select]
{"svc-p1p.bin", 0x400000, 0x2601902F, 0x10}, // 0 68K code
{"svc-p2p.bin", 0x400000, 0x0ca13305, 0x10}, // 1

{"svc-s1p.bin", 0x020000, 0x233D6439,    1}, // 2 Text data


Here's the P decryption code.

Code: [Select]
// Analyzed by HalRIN - http://www52.tok2.com/home/foge/
// FBA conversion by IQ_132 - http://neosource.1emu.net/
static void svcsplus_px_decrypt()
{
int sec[] = {0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x07};
int sed[] = {0x000000,0x700000,0x100000,0x200000,0x300000,0x400000,0x500000};

unsigned char *src = Neo68KROM01;
int i,ofst,size = 0x800000;
unsigned char *dst = (unsigned char*)malloc(size);

memcpy( dst, src, size );

for( i = 0; i < size / 2; i++ )
{
ofst = BITSWAP16( (i & 0x007fff), 0x0f, 0x00, 0x08, 0x09, 0x0b, 0x0a, 0x0c, 0x0d,
 0x04, 0x03, 0x01, 0x07, 0x06, 0x02, 0x05, 0x0e );

        ofst += (i & 0x078000);
        ofst += sec[ (i & 0xf80000) >> 19 ] << 19;

        memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 );
}

memcpy(dst,src,0x800000);
for(i = 0; i < 7; ++i)
{
memcpy(src+i*0x100000,dst+sed[i],0x100000);
}
free(dst);

*((unsigned short*)(Neo68KROM01 + 0x9E90)) = 0x000F; // Enable S. Plus
*((unsigned short*)(Neo68KROM01 + 0x9E92)) = 0xc9c0;
*((unsigned short*)(Neo68KROM01 + 0xA10C)) = 0x4EB9; // Enable boss icons
*((unsigned short*)(Neo68KROM01 + 0xA10E)) = 0x000E;
*((unsigned short*)(Neo68KROM01 + 0xA110)) = 0x9750;
}


and here's the S decryption code (It's best to use ferchogtx's "NeoTextromfix" code and add this to that):

Code: [Select]
// Converted by Jimmy_Page (www.neofighters.com)
srom = NeoTextROM+0x20000;
for (int i=0;i<0x20000;i++)
srom[i]=BITSWAP08(srom[i],7,6,0,4,3,2,1,5);



EDIT Never Mind I fixed it :)


Code: [Select]

// Snk Vs. Capcom: Chaos Super plus

static struct BurnRomInfo svcsplusRomDesc[] = {
{"svc-p1sp.bin", 0x400000, 0x2601902F, 0x10}, // 0 68K code
{"svc-p2sp.bin", 0x400000, 0x0ca13305, 0x10}, // 1

{"269-s1sp.bin",0x080000, 0xa792fdba,    1}, //  2 Text data

{"269-c1d.bin", 0x800000, 0x465D473B,    1}, //  3 Sprite data
{"269-c2d.bin", 0x800000, 0x3EB28F78,    1}, //  4
{"269-c3d.bin", 0x800000, 0xF4D4AB2B,    1}, //  5
{"269-c4d.bin", 0x800000, 0xA69D523A,    1}, //  6
{"269-c5d.bin", 0x800000, 0xBA2A7892,    1}, //  7
{"269-c6d.bin", 0x800000, 0x37371CA1,    1}, //  8
{"269-c7d.bin", 0x800000, 0x56AC5FB9,    1}, //  9
{"269-c8d.bin", 0x800000, 0xDE99E613,    1}, //  10

{"269-m1d.bin", 0x020000, 0xfd602218, 0x10}, // 11 Z80 code

{"269-v1d.bin", 0x800000, 0xdab37bef,    2}, //  12 Sound data
{"269-v2d.bin", 0x800000, 0x7b3e9487,    2}, //  13
};

STDROMPICKEXT(svcsplus, svcsplus, neogeo);
STD_ROM_FN(svcsplus);

static unsigned short svcsplsa_tbl[0x1000];

unsigned char __fastcall svcsplsaReadByteBankSwitch(unsigned int sekAddress)
{
return *(((unsigned char *)svcsplsa_tbl)+((sekAddress^1)-0x2fe000));
}


unsigned short __fastcall svcsplsaReadWordBankSwitch(unsigned int sekAddress)
{
return svcsplsa_tbl[(sekAddress-0x2fe000)/2];
}

static void svcsplsaWriteBankSwitch(unsigned int sekAddress,unsigned short wordValue,unsigned short valueMask)
{
int address=(sekAddress-0x2fe000)/2,bankaddress;
svcsplsa_tbl[address]=(wordValue&valueMask)|(~valueMask&svcsplsa_tbl[address]);
if(address!=0xff8 && address!=0xff9 ) return;
bankaddress=(svcsplsa_tbl[0xff8]>>8)|(svcsplsa_tbl[0xff9]<<8);
SekMapMemory(Neo68KROM02+bankaddress,0x200000,0x2fdfff,SM_ROM);
}

void __fastcall svcsplsaWriteWordBankSwitch(unsigned int sekAddress, unsigned short wordValue)
{
unsigned short valueMask=0xffff;
svcsplsaWriteBankSwitch(sekAddress,wordValue,valueMask);
}

void __fastcall svcsplsaWriteByteBankSwitch(unsigned int sekAddress, unsigned char byteValue)
{
unsigned short wordValue=0,valueMask=0xff;
if(!(sekAddress&1)) {
wordValue=byteValue<<8;
valueMask<<=8;
}
else{
wordValue=byteValue;
}
svcsplsaWriteBankSwitch(sekAddress,wordValue,valueMask);
}

static void svcsplsaMapHandler()
{
// Install BankSwitch handler
SekMapHandler(5, 0x2fe000, 0x2fffff, SM_READ);
SekSetReadWordHandler(5,  svcsplsaReadWordBankSwitch);
SekSetReadByteHandler(5,  svcsplsaReadByteBankSwitch);

SekMapHandler(5, 0x2fe000, 0x2fffff, SM_WRITE);
SekSetWriteWordHandler(5, svcsplsaWriteWordBankSwitch);
SekSetWriteByteHandler(5, svcsplsaWriteByteBankSwitch);
}

static void svcsplus_px_decrypt()
{
int sec[] = {0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x07};
int sed[] = {0x000000,0x700000,0x100000,0x200000,0x300000,0x400000,0x500000};

unsigned char *src = Neo68KROM01;
int i,ofst,size = 0x800000;
unsigned char *dst = (unsigned char*)malloc(size);

memcpy( dst, src, size );

for( i = 0; i < size / 2; i++ )
{
ofst = BITSWAP16( (i & 0x007fff), 0x0f, 0x00, 0x08, 0x09, 0x0b, 0x0a, 0x0c, 0x0d,
 0x04, 0x03, 0x01, 0x07, 0x06, 0x02, 0x05, 0x0e );

        ofst += (i & 0x078000);
        ofst += sec[ (i & 0xf80000) >> 19 ] << 19;

        memcpy( &src[ i * 2 ], &dst[ ofst * 2 ], 0x02 );
}

memcpy(dst,src,0x800000);
for(i = 0; i < 7; ++i)
{
memcpy(src+i*0x100000,dst+sed[i],0x100000);
}
free(dst);

*((unsigned short*)(Neo68KROM01 + 0x9E90)) = 0x000F; // Enable S. Plus
*((unsigned short*)(Neo68KROM01 + 0x9E92)) = 0xc9c0;
*((unsigned short*)(Neo68KROM01 + 0xA10C)) = 0x4EB9; // Enable boss icons
*((unsigned short*)(Neo68KROM01 + 0xA10E)) = 0x000E;
*((unsigned short*)(Neo68KROM01 + 0xA110)) = 0x9750;
}

static int svcsplusInit()
{
int nRet;

memset(svcsplsa_tbl,0,0x2000);

// sTextBankswitch=2;
pNeoInitCallback = svcsplus_px_decrypt;
       
nRet=NeoInit();
if(!nRet)
svcsplsaMapHandler();
nNeoTextROMSize = 0x080000;
return nRet;
}

struct BurnDriver BurnDrvsvcsplus = {

{"svcsplus", "Snk Vs. Capcom: Chaos Super plus", "Hack", "SNK Playmore Corporation", "Neo Geo", "2003", "svc", "neogeo"},
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ALTERNATE_TEXT | HARDWARE_SNK_NEWBANKSYSTEM,
NULL, svcsplusRomInfo, svcsplusRomName, neogeoInputInfo, neogeoDIPInfo,
svcsplusInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
IQ Forum Member

Offline JiMMy_PaGe

  • Expert
  • *****
  • Posts: 60
  • Karma: +2/-0
    • SNK-NeoFighters
SVC Chaos driver infos.
« Reply #7 on: November 21, 2004, 08:50:23 PM »
Quote from: James33
When I tried this code the neogeo logo keep repeating over and over .

I am  useing a decrypted S rom So thats why theres no S decryption .


Hehe u forgot about kof2003b map handler + banskwitch + HARDWARE_SNK_NEWBANKSYSTEM, if u put it the game will run well  :D
See ya

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
SVC Chaos driver infos.
« Reply #8 on: November 21, 2004, 08:55:11 PM »
Yes I just found that out :)  I have allready edited my post above .

Now to convert that to Mame code hehe .
IQ Forum Member

Offline JiMMy_PaGe

  • Expert
  • *****
  • Posts: 60
  • Karma: +2/-0
    • SNK-NeoFighters
SVC Chaos driver infos.
« Reply #9 on: November 21, 2004, 08:59:30 PM »
Quote from: James33
Yes I just found that out :)  I have allready edited my post above .

Now to convert that to Mame code hehe .

U dont need to do it, u can get it here  :D :
http://www52.tok2.com/home/foge/
See ya

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
SVC Chaos driver infos.
« Reply #10 on: November 21, 2004, 09:01:07 PM »
Thanks so much for that :D  It save me some time . :)
IQ Forum Member

Offline Xeon

  • Newbies
  • *
  • Posts: 45
  • Karma: +0/-0
  • Member
SVC Chaos driver infos.
« Reply #11 on: November 22, 2004, 09:45:07 AM »
i just tried iq's conversion of S ROMs decryption, i know its an attempt for now but i just want to know if it at least compile (its giving me error on the BITSWAP08 thing)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
SVC Chaos driver infos.
« Reply #12 on: November 22, 2004, 12:31:38 PM »
make sure you put this at the type of neo_run.cpp

#include "byteswap.h"


Offline Xeon

  • Newbies
  • *
  • Posts: 45
  • Karma: +0/-0
  • Member
SVC Chaos driver infos.
« Reply #13 on: November 22, 2004, 12:55:25 PM »
Quote from: iq_132
make sure you put this at the type of neo_run.cpp

#include "byteswap.h"

 what do you mean "at the type of neo_run.cpp"? :confused:

Offline iq_132

  • Administrator
  • *****
  • Posts: 3724
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
SVC Chaos driver infos.
« Reply #14 on: November 22, 2004, 01:20:14 PM »
lol, I meant top ;)
Put it right under:
#include "neogeo.h"