Author Topic: Samurai Shodown 5 Special driver  (Read 9986 times)

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Samurai Shodown 5 Special driver
« on: November 08, 2004, 12:52:25 AM »
Here's my driver for samsh5sp - thanks to wesker, BisonSAS, and Vorador.
You may need to change the Vs as I'm using 2 decrypted Vs as opposed to the usual 1.

Code: [Select]
// Samurai Shodown V Special / Samurai Spirits Zero Special

static struct BurnRomInfo samsh5spRomDesc[] = {
{"272-p1.bin", 0x400000, 0x9291794D, 0x10}, // 0 68K code
{"272-p2.bin", 0x400000, 0xFA1A7DD8, 0x10}, // 1

{"272-c1.bin", 0x800000, 0x4F97661A, 1}, // 2 Sprite data
{"272-c2.bin", 0x800000, 0xA3AFDA4F, 1}, // 3
{"272-c3.bin", 0x800000, 0x8C3C7502, 1}, // 4
{"272-c4.bin", 0x800000, 0x32D5E2E2, 1}, // 5
{"272-c5.bin", 0x800000, 0x6CE085BC, 1}, // 6
{"272-c6.bin", 0x800000, 0x05C8DC8E, 1}, // 7
{"272-c7.bin", 0x800000, 0x1417B742, 1}, // 8
{"272-c8.bin", 0x800000, 0xD49773CD, 1}, // 9


{"272-m1d.bin" , 0x080000, 0x0, 0x10}, // 9 Z80 code
// {"272-m1.bin" ,  0x080000, 0xADEEBF40, 0x10}, // 9

// This uses the Neo-PCM2 2002 (Playmore) chip
// {"272-v1.bin" ,  0x800000, 0x76a94127,    2}, // 10
// {"272-v2.bin" ,  0x800000, 0x4ba507f1,    2}, // 11
{"272-v1d.bin", 0x800000, 0x0,      2}, // 10
{"272-v2d.bin", 0x800000, 0x0,      2}, // 11
};

STDROMPICKEXT(samsh5sp, samsh5sp, neogeo);
STD_ROM_FN(samsh5sp);

static void samsh5sp_unlock()
{
// Unlock fatalities from AES original cart.
// Code by wesker, converted to FBA code by BisonSAS
*((unsigned short*)(Neo68KROM01 + 0x00990)) = 0x33FC;
*((unsigned short*)(Neo68KROM01 + 0x00992)) = 0x0002;
*((unsigned short*)(Neo68KROM01 + 0x00994)) = 0x0010;
*((unsigned short*)(Neo68KROM01 + 0x00996)) = 0xE010;
*((unsigned short*)(Neo68KROM01 + 0x00998)) = 0x4EF9;
*((unsigned short*)(Neo68KROM01 + 0x0099A)) = 0x0004;
*((unsigned short*)(Neo68KROM01 + 0x0099C)) = 0x61BA;
*((unsigned short*)(Neo68KROM01 + 0x461B4)) = 0x4EF9;
*((unsigned short*)(Neo68KROM01 + 0x461B6)) = 0x0000;
*((unsigned short*)(Neo68KROM01 + 0x461B8)) = 0x0990;
}

static void samsh5sp_Decrypt()
{
// Descrambling Px by Vorador from speksnk
unsigned char* src = Neo68KROM01+0x100000;
unsigned char* dst = (unsigned char*)malloc(0x700000);
unsigned int sec[] = {0x8,0x7,0xA,0x9,0xC,0x3,0x0,0xB,0x6, 0xD,0x2,0x5, 0x4,0x1};

if (dst)
{
memcpy( dst, src, 0x700000 );
for(int i=0;i<14;i++)
{
memcpy(src+i*0x80000,dst+sec[i]*0x80000,0x80000);
}
free(dst);
}
samsh5sp_unlock();
}

static int samsh5spInit()
{
nNeoProtectionXor = 0xd;
pNeoInitCallback = samsh5sp_Decrypt;
return NeoInit();
}


struct BurnDriver BurnDrvsamsh5sp = {
{"samsh5sp", "Samurai Shodown V Special", "Japanese title is Samurai Spirits Zero Special", "Yuki Enterprise / SNK Playmore Corporation", "Neo Geo", "2004", NULL, "neogeo"},
BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B | HARDWARE_SNK_SRAM,
NULL, samsh5spRomInfo, samsh5spRomName, neogeoInputInfo, neogeoDIPInfo,
samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};


Offline NJ7

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-6
  • Member
Samurai Shodown 5 Special driver
« Reply #1 on: November 08, 2004, 07:04:03 AM »
Here's the driver with working sound, the m1d is the correct m1d, you can get the patch at Romshare which changes the encrypted to the correct decrypted dump....as for the v's, they derive from the original two encrypted v's and using the vcon.exe tool on them to decrypt them....I'm sure this is incorrect dump wise, I'm guessing it's spose to be 2 v's instead of the 4, but it works for now, and that's what matters right now.....working sound....yes...... :p

Code: [Select]
// Samurai Shodown V Special / Samurai Spirits Zero Special

static struct BurnRomInfo samsh5spRomDesc[] = {

        {"272-p1.bin", 0x400000, 0x9291794d, 0x10}, // 0 68K code
        {"272-p2.bin", 0x400000, 0xfa1a7dd8, 0x10}, // 1

        {"272-c1.bin", 0x800000, 0x4F97661A, 1}, // 2 Sprite data
        {"272-c2.bin", 0x800000, 0xA3AFDA4F, 1}, // 3
        {"272-c3.bin", 0x800000, 0x8C3C7502, 1}, // 4
        {"272-c4.bin", 0x800000, 0x32D5E2E2, 1}, // 5
        {"272-c5.bin", 0x800000, 0x6CE085BC, 1}, // 6
        {"272-c6.bin", 0x800000, 0x05C8DC8E, 1}, // 7
        {"272-c7.bin", 0x800000, 0x1417B742, 1}, // 8
        {"272-c8.bin", 0x800000, 0xD49773CD, 1}, // 9

        {"272-m1d.bin" , 0x080000, 0x3CA75C37, 0x10}, // 9 Z80 code

        {"272-v1d.bin" , 0x400000, 0x32156CFE, 2}, // 10 Sound data
        {"272-v2d.bin" , 0x400000, 0x0E46D2F8, 2}, // 11
        {"272-v3d.bin" , 0x400000, 0x9AA45090, 2}, // 12
        {"272-v4d.bin" , 0x400000, 0xAD8FABB4, 2}, // 11

};

STDROMPICKEXT(samsh5sp, samsh5sp, neogeo);
STD_ROM_FN(samsh5sp);

static void samsh5sp_unlock()
{
// Unlock fatalities from AES original cart.
// Code by wesker, converted to FBA code by BisonSAS
*((unsigned short*)(Neo68KROM01 + 0x00990)) = 0x33FC;
*((unsigned short*)(Neo68KROM01 + 0x00992)) = 0x0002;
*((unsigned short*)(Neo68KROM01 + 0x00994)) = 0x0010;
*((unsigned short*)(Neo68KROM01 + 0x00996)) = 0xE010;
*((unsigned short*)(Neo68KROM01 + 0x00998)) = 0x4EF9;
*((unsigned short*)(Neo68KROM01 + 0x0099A)) = 0x0004;
*((unsigned short*)(Neo68KROM01 + 0x0099C)) = 0x61BA;
*((unsigned short*)(Neo68KROM01 + 0x461B4)) = 0x4EF9;
*((unsigned short*)(Neo68KROM01 + 0x461B6)) = 0x0000;
*((unsigned short*)(Neo68KROM01 + 0x461B8)) = 0x0990;

}

static void samsh5sp_Decrypt()
{
// Descrambling Px by Vorador from speksnk
unsigned char* src = Neo68KROM01;
unsigned char* dst = (unsigned char*)malloc(0x800000);

unsigned int sec[] =

{0x0,0x1,0xA,0x9,0xC,0xB,0xE,0x5,0x2,0xD,0x8,0xF,0x4,0x7,0x6,0x3};
if (dst)
{
memcpy( dst, src, 0x800000 );
for(int i=0;i<0x10;i++)
memcpy(src+i*0x80000,dst+sec[i]*0x80000,0x80000);

free(dst);
}
samsh5sp_unlock();
}

static int samsh5spInit()
{
nNeoProtectionXor = 0x0d;
pNeoInitCallback = samsh5sp_Decrypt;
return NeoInit();
}

struct BurnDriver BurnDrvsamsh5sp = {
        {"samsh5sp", "Samurai Shodown V Special", "Japanese title is Samurai Spirits Zero Special", "Yuki Enterprise / SNK Playmore", "Neo Geo", "2004", NULL, "neogeo"},
        BDF_GAME_WORKING | BDF_CLONE | BDF_LOCKED, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B | HARDWARE_SNK_SRAM,
        NULL, samsh5spRomInfo, samsh5spRomName, neogeoInputInfo, neogeoDIPInfo,
        samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
        nNeoScreenWidth, 224, 4, 3
};

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Samurai Shodown 5 Special driver
« Reply #2 on: November 08, 2004, 07:17:34 AM »
I'm sure everyone knows that samsh5sp's m1d is out (I released the one with the particular CRC you're using).  
Also, my driver works fine.  Having a 0 in the crc area just tells fba to load the rom by name. This is really the best idea until the m1d and decrypted Vs are confirmed.


Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Samurai Shodown 5 Special driver
« Reply #3 on: November 08, 2004, 07:42:44 AM »
NJ7 I am pretty sure it is meant to have one 16mb V rom.

Oh yeah HARDWARE_SNK_SRAM is not needed

Since this code does that part allready Which I use . So it will decrypt the P rom and uses the patch So it can be used in NRX , Nebula, Kawaks in MVS mode. If you are not going to do that sort of thing then you can use the HARDWARE_SNK_SRAM and remove this part of the code.
Quote

*((unsigned short*)(Neo68KROM01 + 0xEBE4)) = 0x4E71;
*((unsigned short*)(Neo68KROM01 + 0xEBE6)) = 0x4E71;



Yeah I know the driver has been posted allready .

Code: [Select]

// Samurai Shodown V Special

static struct BurnRomInfo samsh5spRomDesc[] = {
{"272-p1.bin", 0x400000, 0x9291794d, 0x10}, //  0 68K code
{"272-p2.bin", 0x400000, 0xfa1a7dd8, 0x10}, //  1

{"272-c1.bin", 0x800000, 0x4F97661A, 1}, // 2 Sprite data
{"272-c2.bin", 0x800000, 0xA3AFDA4F, 1}, // 3
{"272-c3.bin", 0x800000, 0x8C3C7502, 1}, // 4
{"272-c4.bin", 0x800000, 0x32D5E2E2, 1}, // 5
{"272-c5.bin", 0x800000, 0x6CE085BC, 1}, // 6
{"272-c6.bin", 0x800000, 0x05C8DC8E, 1}, // 7
{"272-c7.bin", 0x800000, 0x1417B742, 1}, // 8
{"272-c8.bin", 0x800000, 0xD49773CD, 1}, // 9

{"272-m1d.bin",0x080000, 0x3CA75C37, 0x10}, // 10 Z80 code

{"272-v1d.bin", 0x1000000, 0x3654e81f,    2}, //  11 Sound data
};

STDROMPICKEXT(samsh5sp, samsh5sp, neogeo);
STD_ROM_FN(samsh5sp);

static void samsh5sp_Decrypt()
{
/* Patch for MVS Mode */
*((unsigned short*)(Neo68KROM01 + 0xEBE4)) = 0x4E71;
*((unsigned short*)(Neo68KROM01 + 0xEBE6)) = 0x4E71;

/* Descrambling Px by Vorador from speksnk */
unsigned char* src = Neo68KROM01;
unsigned char* dst = (unsigned char*)malloc(0x800000);

unsigned int sec[] = {0x0,0x1,0xA,0x9,0xC,0xB,0xE,0x5,0x2,0xD,0x8,0xF,0x4,0x7,0x6,0x3};
if (dst)
{
memcpy( dst, src, 0x800000 );
for(int i=0;i<0x10;i++)
memcpy(src+i*0x80000,dst+sec[i]*0x80000,0x80000);

free(dst);
}

}


static int samsh5spInit()
{
nNeoProtectionXor = 0x0d;
pNeoInitCallback = samsh5sp_Decrypt;
return NeoInit();
}


struct BurnDriver BurnDrvsamsh5sp = {
{"samsh5sp", "Samurai Shodown V Special", "Japanese title is Samurai Spirits Zero Special", "Yuki Enterprise / SNK Playmore Corporation", "Neo Geo", "2004", NULL, "neogeo"},
BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B,
NULL, samsh5spRomInfo, samsh5spRomName, neogeoInputInfo, neogeoDIPInfo,
samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};
IQ Forum Member

Offline NJ7

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-6
  • Member
Samurai Shodown 5 Special driver
« Reply #4 on: November 08, 2004, 07:12:12 PM »
James, I found this thread on RomShare.....I got the correct splitted 4 vd', so that's all ok, but I think it's saying that those four joined creates the CRC of the one vd that you have in your driver....my question is, what do you use to join these files to get that CRC, what program?......thanks.... :p

http://bbs.*.net/showthread.php?p=150670&highlight=3654e81f#post150670

Nevermind....found a program.... :D
« Last Edit: May 10, 2005, 03:05:27 AM by iq_132 »

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Samurai Shodown 5 Special driver
« Reply #5 on: November 08, 2004, 08:55:57 PM »
Just in case its not the same one.
 I use hjsplit.
IQ Forum Member

Offline KingHanco

  • Sr. Member
  • ****
  • Posts: 401
  • Karma: +0/-4
  • "Special " Member
Uh...
« Reply #6 on: December 07, 2004, 11:44:08 PM »
Where does that go into the FBA files and what folder?

Offline iq_132

  • Administrator
  • *****
  • Posts: 3728
  • Karma: +411/-0
  • Definitely not Dink!
    • NeoSource
Samurai Shodown 5 Special driver
« Reply #7 on: December 07, 2004, 11:51:00 PM »
All drivers for neogeo games will go into src/burn/neogeo/d_neogeo.cpp
You may also have to modify neo_run.cpp, neogeo.cpp, neodecrypt.cpp, neogeo.h, etc.


Offline KingHanco

  • Sr. Member
  • ****
  • Posts: 401
  • Karma: +0/-4
  • "Special " Member
Re:
« Reply #8 on: December 14, 2004, 06:35:50 AM »
Quote from: James33
NJ7 I am pretty sure it is meant to have one 16mb V rom.

Oh yeah HARDWARE_SNK_SRAM is not needed

Since this code does that part allready Which I use . So it will decrypt the P rom and uses the patch So it can be used in NRX , Nebula, Kawaks in MVS mode. If you are not going to do that sort of thing then you can use the HARDWARE_SNK_SRAM and remove this part of the code.



Yeah I know the driver has been posted allready .

Code: [Select]

// Samurai Shodown V Special

static struct BurnRomInfo samsh5spRomDesc[] = {
{"272-p1.bin", 0x400000, 0x9291794d, 0x10}, //  0 68K code
{"272-p2.bin", 0x400000, 0xfa1a7dd8, 0x10}, //  1

{"272-c1.bin", 0x800000, 0x4F97661A, 1}, // 2 Sprite data
{"272-c2.bin", 0x800000, 0xA3AFDA4F, 1}, // 3
{"272-c3.bin", 0x800000, 0x8C3C7502, 1}, // 4
{"272-c4.bin", 0x800000, 0x32D5E2E2, 1}, // 5
{"272-c5.bin", 0x800000, 0x6CE085BC, 1}, // 6
{"272-c6.bin", 0x800000, 0x05C8DC8E, 1}, // 7
{"272-c7.bin", 0x800000, 0x1417B742, 1}, // 8
{"272-c8.bin", 0x800000, 0xD49773CD, 1}, // 9

{"272-m1d.bin",0x080000, 0x3CA75C37, 0x10}, // 10 Z80 code

{"272-v1d.bin", 0x1000000, 0x3654e81f,    2}, //  11 Sound data
};

STDROMPICKEXT(samsh5sp, samsh5sp, neogeo);
STD_ROM_FN(samsh5sp);

static void samsh5sp_Decrypt()
{
/* Patch for MVS Mode */
*((unsigned short*)(Neo68KROM01 + 0xEBE4)) = 0x4E71;
*((unsigned short*)(Neo68KROM01 + 0xEBE6)) = 0x4E71;

/* Descrambling Px by Vorador from speksnk */
unsigned char* src = Neo68KROM01;
unsigned char* dst = (unsigned char*)malloc(0x800000);

unsigned int sec[] = {0x0,0x1,0xA,0x9,0xC,0xB,0xE,0x5,0x2,0xD,0x8,0xF,0x4,0x7,0x6,0x3};
if (dst)
{
memcpy( dst, src, 0x800000 );
for(int i=0;i<0x10;i++)
memcpy(src+i*0x80000,dst+sec[i]*0x80000,0x80000);

free(dst);
}

}


static int samsh5spInit()
{
nNeoProtectionXor = 0x0d;
pNeoInitCallback = samsh5sp_Decrypt;
return NeoInit();
}


struct BurnDriver BurnDrvsamsh5sp = {
{"samsh5sp", "Samurai Shodown V Special", "Japanese title is Samurai Spirits Zero Special", "Yuki Enterprise / SNK Playmore Corporation", "Neo Geo", "2004", NULL, "neogeo"},
BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B,
NULL, samsh5spRomInfo, samsh5spRomName, neogeoInputInfo, neogeoDIPInfo,
samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};


I can't get this to work.

But iq_132 does work.

The Decrypt won't pick up on compile FBA. There is an error when compile FBA.

Offline bms888

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
  • Member
Samurai Shodown 5 Special driver
« Reply #9 on: December 14, 2004, 07:48:07 AM »
Quote from: KingHanco
I can't get this to work.

But iq_132 does work.

The Decrypt won't pick up on compile FBA. There is an error when compile FBA.


unsigned int sec[] = {0x0,0x1,0xA,0x9,0xC,0xB,0xE,0x5,0x2,0xD,0x8,0xF,0  x4,0x7,0x6,0x3};

compile error,^_^

you just change 0  x4 to 0x4,OK.

Offline Accosta_m

  • Newbies
  • *
  • Posts: 15
  • Karma: +0/-0
  • The Ghost Gundam
Samurai Shodown 5 Special driver
« Reply #10 on: December 15, 2004, 01:29:33 AM »
Code: [Select]
// Samurai Shodown V Special / Samurai Spirits Zero Special

static struct BurnRomInfo samsh5spRomDesc[] = {
{"272-p1.bin", 0x400000, 0x9291794D, 0x10}, // 0 68K code
{"272-p2.bin", 0x400000, 0xFA1A7DD8, 0x10}, // 1

{"272-c1.bin", 0x800000, 0x4F97661A, 1}, // 2 Sprite data
{"272-c2.bin", 0x800000, 0xA3AFDA4F, 1}, // 3
{"272-c3.bin", 0x800000, 0x8C3C7502, 1}, // 4
{"272-c4.bin", 0x800000, 0x32D5E2E2, 1}, // 5
{"272-c5.bin", 0x800000, 0x6CE085BC, 1}, // 6
{"272-c6.bin", 0x800000, 0x05C8DC8E, 1}, // 7
{"272-c7.bin", 0x800000, 0x1417B742, 1}, // 8
{"272-c8.bin", 0x800000, 0xD49773CD, 1}, // 9

// {"271-m1.bin" , 0x080000, 0xADEEBF40, 0x10}, // 9 Z80 code
{"270-m1d.bin" , 0x080000, 0xE5EADC1E, 0x10}, // Samsho5 M1d

{"272-v1.bin" , 0x800000, 0x76A94127, 2}, // 10 Sound data
{"272-v2.bin" , 0x800000, 0x4BA507F1, 2}, //
//          {"272-v1d.bin" , 0x400000, 0x32156cfe, 2}, // Samsho5 Vs
// {"272-v2d.bin" , 0x400000, 0x0e46d2f8, 2}, //
// {"272-v3d.bin" , 0x400000, 0x3F0F7554, 2}, //
// {"272-v4d.bin" , 0x400000, 0xad8fabb4, 2}, //
};

STDROMPICKEXT(samsh5sp, samsh5sp, neogeo);
STD_ROM_FN(samsh5sp);

static void samsh5sp_Decrypt()
{
// Descrambling Px by Vorador from speksnk
unsigned char* src = Neo68KROM01;
unsigned char* dst = (unsigned char*)malloc(0x800000);

unsigned int sec[] = {0x0,0x1,0xA,0x9,0xC,0xB,0xE,0x5,0x2,0xD,0x8,0xF,0x4,0x7,0x6,0x3};
if (dst)
{
memcpy( dst, src, 0x800000 );
for(int i=0;i<0x10;i++)
memcpy(src+i*0x80000,dst+sec[i]*0x80000,0x80000);
}
free(dst);

// Unlock fatalities from AES original cart.
// Code by wesker, converted to FBA code by BisonSAS
*((unsigned short*)(Neo68KROM01 + 0x00990)) = 0x33FC;
*((unsigned short*)(Neo68KROM01 + 0x00992)) = 0x0002;
*((unsigned short*)(Neo68KROM01 + 0x00994)) = 0x0010;
*((unsigned short*)(Neo68KROM01 + 0x00996)) = 0xE010;
*((unsigned short*)(Neo68KROM01 + 0x00998)) = 0x4EF9;
*((unsigned short*)(Neo68KROM01 + 0x0099A)) = 0x0004;
*((unsigned short*)(Neo68KROM01 + 0x0099C)) = 0x61BA;
*((unsigned short*)(Neo68KROM01 + 0x461B4)) = 0x4EF9;
*((unsigned short*)(Neo68KROM01 + 0x461B6)) = 0x0000;
*((unsigned short*)(Neo68KROM01 + 0x461B8)) = 0x0990;
}

static int samsh5spInit()
{
nNeoProtectionXor = 0x0d;
pNeoInitCallback = samsh5sp_Decrypt;
[B]nNeoPCM2PLAYMOREByteswap = 6;[/B]
return NeoInit();
}

struct BurnDriver BurnDrvsamsh5sp = {
{"samsh5sp", "Samurai Shodown V Special", "Japanese title is Samurai Spirits Zero Special", "Yuki Enterprise / SNK Playmore Corporation", "Neo Geo", "2004", NULL, "neogeo"},
BDF_GAME_WORKING, 2, HARDWARE_SNK_NEOGEO | HARDWARE_SNK_ENCRYPTED_B | HARDWARE_SNK_SRAM,
NULL, samsh5spRomInfo, samsh5spRomName, neogeoInputInfo, neogeoDIPInfo,
samsh5spInit, NeoExit, NeoFrame, NeoRender, NeoScan, &NeoRecalcPalette,
nNeoScreenWidth, 224, 4, 3
};


i use the V roms encrypted for this set
:D     :cool:     :eek:     ;)     :p