Author Topic: Samurai Shodown 5 driver  (Read 22021 times)

Offline JiMMy_PaGe

  • Expert
  • *****
  • Posts: 60
  • Karma: +2/-0
    • SNK-NeoFighters
Samurai Shodown 5 driver
« Reply #30 on: November 26, 2004, 04:17:29 PM »
Here is the descramble px code of samsh5bl made by Halrin for mame, i converted it to fba but the p roms stil need to be interleaved, and iq knows very much about it  :D
Code: [Select]

//FBA Conversion by JiMMy_PaGe (www.neofighters.com.br) original code by Harin
static void samsh5bl_px_decrypt()
{    
unsigned char *src = Neo68KROM01;
int i,ofst,rom_size = 0x800000;
unsigned char *dst = (unsigned char*)malloc(rom_size);


for( i = 0; i < rom_size / 2; i++ ){
ofst = BITSWAP08( (i & 0x000ff), 7, 6, 5, 4, 3, 0, 1, 2 );
ofst += (i & 0xfffff00);

ofst ^= 0x060005;

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

memcpy( dst, src, rom_size );

memcpy( &src[ 0x000000 ], &dst[ 0x700000 ], 0x100000 );
memcpy( &src[ 0x100000 ], &dst[ 0x000000 ], 0x700000 );

free(dst);
}

Offline iq_132

  • Administrator
  • *****
  • Posts: 3760
  • Karma: +409/-0
  • Definitely not Dink!
    • NeoSource
Samurai Shodown 5 driver
« Reply #31 on: November 26, 2004, 08:48:03 PM »
Code: [Select]
// FBA Conversion by JiMMy_PaGe (www.neofighters.com.br) original code by Harin
static void samsh5bl_px_decrypt( )
{
int rom_size = 0x800000;
UINT8 *src = Neo68KROM01;
UINT8 *dst = (UINT8*)malloc( rom_size );
int i;
int ofst;

memcpy( dst, src, rom_size );

for( i = 0; i < rom_size / 2; i++ ){
ofst = BITSWAP08( (i & 0x000ff), 7, 6, 5, 4, 3, 0, 1, 2 );
ofst += (i & 0xfffff00);

ofst ^= 0x060005;

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

memcpy(dst, src, 0x300000);
memcpy(src, src+0x300000, 0x500000);
memcpy(src+0x500000, dst, 0x300000);

free( dst );
}
« Last Edit: February 14, 2006, 11:34:41 PM by iq_132 »


Offline Vorador

  • Newbies
  • *
  • Posts: 18
  • Karma: +0/-0
  • Junior Member
Samurai Shodown 5 driver
« Reply #32 on: November 27, 2004, 09:34:47 AM »
Well, here the conversion for HalRin┬┤s ssvbl C-ROMs

Code: [Select]
//Original code by HalRin-http://www52.tok2.com/home/foge/
static void samsh5bl_cx_decrypt( void )
{
int cx_size =nSpriteSize;
unsigned char *rom = NeoSpriteROM;
unsigned char *buf = (unsigned char*)malloc( cx_size );

memcpy( buf, rom, cx_size );

for( int i = 0; i < cx_size / 0x40; i++ ){
memcpy( &rom[ i * 0x40 ], &buf[ (i ^ 1) * 0x40 ], 0x40 );
}

free( buf );
}

Offline fataku

  • Newbies
  • *
  • Posts: 22
  • Karma: +0/-0
  • Junior Member
Samurai Shodown 5 driver
« Reply #33 on: November 27, 2004, 10:03:34 AM »
A little help to HalRIN:

src/burn/neogeo/neo_run.cpp

Find this:
Code: [Select]
if (BurnDrvGetHardwareCode() & HARDWARE_SNK_SWAPV) {
for (int i = 0; i < 0x00200000; i++) {
unsigned char n = YM2610ADPCMAROM[i];
YM2610ADPCMAROM[i] = YM2610ADPCMAROM[0x00200000 + i];
YM2610ADPCMAROM[0x00200000 + i] = n;
}
}

Add this after
Code: [Select]
// Descramble samsho5b's V roms (data lines are bitswaped)
if (!strcmp(BurnDrvText(0), "ssvbl"))
{
for(int i=0; i<0x1000000; i++)
YM2610ADPCMAROM[i] = BITSWAP08(YM2610ADPCMAROM[i],0,1,5,4,3,2,6,7);
}

and why not a mame code for this:

Code: [Select]
static void neogeo_V_fix(void)
{
UINT8 *rom = (memory_region(REGION_SOUND1));
int i;
if( rom != NULL )
{
/* bit swap data lines on the whole V ROMs, thanks to arnoldso */
for(i=0;i<0x1000000;i++)
rom[i] = BITSWAP8(rom[i],0,1,5,4,3,2,6,7);
}
}
« Last Edit: May 10, 2005, 02:50:18 AM by iq_132 »

Offline James33

  • Expert
  • *****
  • Posts: 532
  • Karma: +3/-0
  • The Mame Man
    • Emulation Zone
Samurai Shodown 5 driver
« Reply #34 on: November 27, 2004, 10:11:09 AM »
Thanks fataku :)
IQ Forum Member

Offline FerchogtX

  • FBNeo Dev
  • ******
  • Posts: 375
  • Karma: +7/-0
  • FB Alpha Team ;)
    • FB Alpha Plus! Web Site
Samurai Shodown 5 driver
« Reply #35 on: November 27, 2004, 08:30:59 PM »
Thanks a lot for this man!!!
See ya!!!! :D

Good and evil co-exist because of the balance, lies are not part of it...

FB Alpha Plus! site infos updated, see the latest info clicking on my profile link...

Offline iq_132

  • Administrator
  • *****
  • Posts: 3760
  • Karma: +409/-0
  • Definitely not Dink!
    • NeoSource
Samurai Shodown 5 driver
« Reply #36 on: November 27, 2004, 10:04:43 PM »
Thanks fataku :)  (It's always great when you share code with us :))