Jump to content

Mame Neogeo


James

Recommended Posts

Kof2003

 

/******************************************************************************
Analyzed by HalRIN
http://www52.tok2.com/home/foge/
******************************************************************************/

ROM_START( kof2003 )
ROM_REGION( 0x900000, REGION_CPU1, 0 )
ROM_LOAD32_WORD_SWAP( "271-p1.bin", 0x000000, 0x400000, CRC(b9da070c) SHA1(1a26325af142a4dd221c336061761468598c4634) )
ROM_LOAD32_WORD_SWAP( "271-p2.bin", 0x000002, 0x400000, CRC(da3118c4) SHA1(582e4f44f03276adecb7b2848d3b96bf6da57f1e) )
ROM_LOAD16_WORD_SWAP( "271-p3.bin", 0x800000, 0x100000, CRC(5cefd0d2) SHA1(cddc3164629fed4b6f715e12b109ad35d1009355) )
ROM_LOAD16_WORD_SWAP( "271-p3d.bin", 0x800000, 0x100000, CRC(59d376da) SHA1(3c3ad0b79e8b37e838893a8f7b87e11d7eeee8f2) )

ROM_REGION( 0x100000, REGION_GFX1, 0 )
ROM_FILL(                 0x000000, 0x100000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION16_BE( 0x40000, REGION_USER1, 0 )
ROM_LOAD16_WORD_SWAP( "271-bios.bin", 0x00000, 0x040000, CRC(c521b5bc) SHA1(c9a5db63523191dedd1b39baab8772f64f09b77f) )

ROM_REGION( 0x90000, REGION_CPU2, 0 )
ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
ROM_LOAD( "271-m1d.bin",  	0x00000, 0x80000, CRC(0e86af8f) SHA1(769102b67bb1a699cfa5674d66cdb46ae633cb65) )
ROM_RELOAD(             0x10000, 0x80000 )
ROM_REGION( 0x10000, REGION_GFX4, 0 )
ROM_LOAD( "000-lo.lo", 0x00000, 0x10000, CRC(e09e253c) SHA1(2b1c719531dac9bb503f22644e6e4236b91e7cfc) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD( "271-v1d.bin", 0x000000, 0x1000000, CRC(2058ec5e) SHA1(567fdf328f87551a949dc601f4e71c55368debf0) )

NO_DELTAT_REGION

ROM_REGION( 0x6000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "271-c1d.bin", 0x0000000, 0x1000000, CRC(c29acd28) SHA1(8a10409c5a9ad95fa9b56e94c14f1b96101fb179) )
ROM_LOAD16_BYTE( "271-c2d.bin", 0x0000001, 0x1000000, CRC(328e80b1) SHA1(c7f8069488be1a88a2ea03718b6a131f5c96bd3f) )
ROM_LOAD16_BYTE( "271-c3d.bin", 0x2000000, 0x1000000, CRC(020a11f1) SHA1(85cfae76234f72b0039ebc02f931bb2a9c10b1af) )
ROM_LOAD16_BYTE( "271-c4d.bin", 0x2000001, 0x1000000, CRC(991b5ed2) SHA1(99c4c470bc9cb388773e27de6df4a16803fc7b45) )
ROM_LOAD16_BYTE( "271-c5d.bin", 0x4000000, 0x1000000, CRC(c2de8b66) SHA1(40c2ea48fc20d470163a9dbb40c0276fc4cfceb9) )
ROM_LOAD16_BYTE( "271-c6d.bin", 0x4000001, 0x1000000, CRC(3ff750db) SHA1(714f14a2eb2df6f25d10a6b6aff4b3adfbc7a5dc) )
ROM_END

static void kof2003_px_decrypt( void )
{
const unsigned char xor2[ 0x20 ] = {
 0xb4, 0x0f, 0x40, 0x6c, 0x38, 0x07, 0xd0, 0x3f, 0x53, 0x08, 0x80, 0xaa, 0xbe, 0x07, 0xc0, 0xfa,
 0xd0, 0x08, 0x10, 0xd2, 0xf1, 0x03, 0x70, 0x7e, 0x87, 0x0B, 0x40, 0xf6, 0x2a, 0x0a, 0xe0, 0xf9
};

int i;
int ofst;
UINT8 *rom, *buf;

rom = memory_region( REGION_CPU1 );

for( i = 0x100000; i < 0x800000; i++ ){
 rom[ i ] ^= xor2[ (i % 0x20) ];
}

for( i = 0x100000; i < 0x800000; i += 4 ){
 UINT16 *rom16 = (UINT16*)&rom[ i + 1 ];
 *rom16 = BITSWAP16( *rom16, 15, 14, 13, 12, 4, 5, 6, 7, 8, 9, 10, 11, 3, 2, 1, 0 );
}

buf = malloc( 0x800000 );
memcpy( buf, rom, 0x800000 );

for( i = 0; i < 0x0100000 / 0x10000; i++ ){
 ofst = (i & 0xf0) + BITSWAP8( (i & 0x0f), 7, 6, 5, 4, 1, 0, 3, 2 );
 memcpy( &rom[ i * 0x10000 ], &buf[ ofst * 0x10000 ], 0x10000 );
}

for( i = 0x100000; i < 0x800000; i += 0x100 ){
 ofst = (i & 0xf000ff) + 
     ((i & 0x000f00) ^ 0x00300) +
     (BITSWAP8( ((i & 0x0ff000) >> 12), 4, 5, 6, 7, 1, 0, 3, 2 ) << 12);

 memcpy( &rom[ i ], &buf[ ofst ], 0x100 );
}

free( buf );

buf = malloc(0x900000);
memcpy( buf, rom, 0x900000 );

memcpy( &rom[0x100000], &buf[0x800000], 0x100000 );
memcpy( &rom[0x200000], &buf[0x100000], 0x700000 );

free(buf);
}

static void kof2003_sx_decrypt( void )
{
int i;
int tx_size = memory_region_length( REGION_GFX1 );
int rom_size = memory_region_length( REGION_GFX3 );
UINT8 *src;
UINT8 *dst;

src = memory_region( REGION_GFX3 ) + rom_size - 0x1000000 - 0x80000;
dst = memory_region( REGION_GFX1 );

for( i = 0; i < tx_size / 2; i++ ){
 dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
}

src = memory_region( REGION_GFX3 ) + rom_size - 0x80000;
dst = memory_region( REGION_GFX1 ) + 0x80000;

for( i = 0; i < tx_size / 2; i++ ){
 dst[ i ] = src[ (i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4) ];
}

dst = memory_region( REGION_GFX1 );
for( i = 0; i < tx_size; i++ ){
 dst[ i ] = BITSWAP8( dst[ i ] ^ 0xd2, 4, 0, 7, 2, 5, 1, 6, 3 );
}
}

static UINT16 mv0_prot_offset[ 0x08 ];
static UINT16 mv0_bankswitch_offset[ 2 ];
static int mv0_bankswitch_flg;

static READ16_HANDLER( mv0_prot_r )
{
return mv0_prot_offset[ offset ];
}

static WRITE16_HANDLER( mv0_prot_w )
{
mv0_prot_offset[ offset ] = (mv0_prot_offset[ offset ] & mem_mask) | ((~mem_mask) & data);

if( offset == 0 ){
 UINT8 *ofst8 = (UINT8*)mv0_prot_offset;

 ofst8[ 0x02 ] = ((ofst8[ 0x01 ] >> 4) & 0x01) + ((ofst8[ 0x00 ] & 0x0f) << 1);
 ofst8[ 0x03 ] = ((ofst8[ 0x01 ] >> 5) & 0x01) + (((ofst8[ 0x00 ] >> 4) & 0x0f) << 1);
 ofst8[ 0x04 ] = ((ofst8[ 0x01 ] >> 6) & 0x01) + ((ofst8[ 0x01 ] & 0x0f) << 1);
 ofst8[ 0x05 ] = (ofst8[ 0x01 ] >> 7);
}else if( offset == 5 ){
 UINT8 *ofst8 = (UINT8*)mv0_prot_offset;

 ofst8[ 0x0c ] = (ofst8[ 0x08 ] >> 1) | ((ofst8[ 0x09 ] >> 1) << 4);
 ofst8[ 0x0d ] = (ofst8[ 0x0a ] >> 1) |
     ((ofst8[ 0x08 ] & 0x01) << 4) |
     ((ofst8[ 0x09 ] & 0x01) << 5) |
     ((ofst8[ 0x0a ] & 0x01) << 6) |
     (ofst8[ 0x0b ] << 7);
}
}

// imcomplete
static READ16_HANDLER( mv0_bankswitch_r )
{
if( mv0_bankswitch_offset[ 0 ] == 0xffff && mv0_bankswitch_offset[ 1 ] == 0xffff ){

 mv0_bankswitch_flg = 1;
 if( offset == 0 ){
 	return 0xfea0;
 }else if( offset == 1 ){
 	return 0x7fff;
 }else{
 	return mv0_bankswitch_offset[ offset ];
 }
}else if( mv0_bankswitch_offset[ 0 ] == 0x0000 && mv0_bankswitch_offset[ 1 ] == 0x0000 && mv0_bankswitch_flg == 1 ){

 if( offset == 0 ){
 	return 0x00a0;
 }else if( offset == 1 ){
 	mv0_bankswitch_flg = 0;
 	return 0x0000;
 }else{
 	return mv0_bankswitch_offset[ offset ];
 }
}else{
 return mv0_bankswitch_offset[ offset ];
}
}

static WRITE16_HANDLER( mv0_bankswitch_w )
{
UINT32 bank_addr;

mv0_bankswitch_offset[ offset ] = (mv0_bankswitch_offset[ offset ] & mem_mask) | ((~mem_mask) & data);

bank_addr = (mv0_bankswitch_offset[ 0 ] >> 8) +
   (mv0_bankswitch_offset[ 1 ] << 8) +
   0x100000;

neogeo_set_cpu1_second_bank( bank_addr );
}

DRIVER_INIT( kof2003 )
{
kof2003_px_decrypt();
kof2003_sx_decrypt();

neogeo_fix_bank_type = 2;
init_neogeo();

memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MRA16_RAM );
memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MWA16_RAM );

memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fffe0, 0x2fffef, 0, 0, mv0_prot_r );
memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fffe0, 0x2fffef, 0, 0, mv0_prot_w );

memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_r );
memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_w );

memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0xc00000, 0xc3ffff, 0, 0, MRA16_BANK3 );  // 256k bios
}


GAMEB( 2003, kof2003,  neogeo,   neogeo, neogeo, neogeo,  kof2003,  ROT0, "SNK Playmore", "The King of Fighters 2003" )

Link to comment
Share on other sites

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

svcchaos, svchaosa

 

/******************************************************************************
Analyzed by HalRIN
http://www52.tok2.com/home/foge/
******************************************************************************/

// drivers/neogeo.c
ROM_START( svcchaos )
ROM_REGION( 0x2000000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "269-p1.bin", 0x000000, 0x2000000, CRC(432cfdfc) SHA1(19b40d32188a8bace6d2d570c6cf3d2f1e31e379) )

ROM_REGION( 0x80000, REGION_GFX1, 0 )
ROM_FILL(                 0x000000, 0x80000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
NEO_BIOS_SOUND_128K( "269-m1d.bin", CRC(fd4f0ff9) SHA1(e97e864aaa4789d854363512986e80c0606da996) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD( "269-v1.bin", 0x000000, 0x800000, CRC(c659b34c) SHA1(1931e8111ef43946f68699f8707334c96f753a1e) )
ROM_LOAD( "269-v2.bin", 0x800000, 0x800000, CRC(dd903835) SHA1(e58d38950a7a8697bb22a1cc7a371ae6664ae8f9) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD( "269-c1.bin", 0x0000000, 0x2000000, CRC(1b608f9c) SHA1(4e70ad182da2ca18815bd3936efb04a06ebce01e) )
ROM_LOAD( "269-c2.bin", 0x2000000, 0x2000000, CRC(5a95f294) SHA1(6123cc7b20b494076185d27c2ffea910e124b195) )
ROM_END

ROM_START( svchaosa )
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD32_WORD_SWAP( "269-p1.bin", 0x000000, 0x400000, CRC(38e2005e) SHA1(1b902905916a30969282f1399a756e32ff069097) )
ROM_LOAD32_WORD_SWAP( "269-p2.bin", 0x000002, 0x400000, CRC(6d13797c) SHA1(3cb71a95cea6b006b44cac0f547df88aec0007b7) )

ROM_REGION( 0x80000, REGION_GFX1, 0 )
ROM_FILL(                 0x000000, 0x80000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x80000, REGION_USER4, 0 )
ROM_LOAD( "269-m1.bin", 0x00000, 0x80000, CRC(f6819d00) SHA1(d3bbe09df502464f104e53501708ac6e2c1832c6) )
NEO_BIOS_SOUND_128K( "269-m1d.bin", CRC(fd4f0ff9) SHA1(e97e864aaa4789d854363512986e80c0606da996) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD( "269-v1.bin", 0x000000, 0x800000, CRC(c659b34c) SHA1(1931e8111ef43946f68699f8707334c96f753a1e) )
ROM_LOAD( "269-v2.bin", 0x800000, 0x800000, CRC(dd903835) SHA1(e58d38950a7a8697bb22a1cc7a371ae6664ae8f9) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "269-c1r.bin", 0x0000000, 0x800000, CRC(887b4068) SHA1(227cdcf7a10a415f1e3afe7ae97acc9afc2cc8e1) )
ROM_LOAD16_BYTE( "269-c2r.bin", 0x0000001, 0x800000, CRC(4e8903e4) SHA1(31daaa4fd6c23e8f0a8428931c513d97d2eee1bd) )
ROM_LOAD16_BYTE( "269-c3r.bin", 0x1000000, 0x800000, CRC(7d9c55b0) SHA1(1f94a948b3e3c31b3ff05518ef525031a3cb2c62) )
ROM_LOAD16_BYTE( "269-c4r.bin", 0x1000001, 0x800000, CRC(8acb5bb6) SHA1(2c27d6e309646d7b84da85f78c06e4aaa74e844b) )
ROM_LOAD16_BYTE( "269-c5r.bin", 0x2000000, 0x800000, CRC(097a4157) SHA1(54d839f55d27f68c704a94ea3c63c644ffc22ca4) )
ROM_LOAD16_BYTE( "269-c6r.bin", 0x2000001, 0x800000, CRC(e19df344) SHA1(20448add53ab25dd3a8f0b681131ad3b9c68acc9) )
ROM_LOAD16_BYTE( "269-c7r.bin", 0x3000000, 0x800000, CRC(d8f0340b) SHA1(43114af7557361a8903bb8cf8553f602946a9220) )
ROM_LOAD16_BYTE( "269-c8r.bin", 0x3000001, 0x800000, CRC(2570b71b) SHA1(99266e1c2ffcf324793fb5c55325fbc7e6265ac0) )
ROM_END


static UINT16 mv0_prot_offset[ 0x08 ];
static UINT16 mv0_bankswitch_offset[ 2 ];
static int mv0_bankswitch_flg;

static READ16_HANDLER( mv0_prot_r )
{
return mv0_prot_offset[ offset ];
}

static WRITE16_HANDLER( mv0_prot_w )
{
mv0_prot_offset[ offset ] = (mv0_prot_offset[ offset ] & mem_mask) | ((~mem_mask) & data);

if( offset == 0 ){
 UINT8 *ofst8 = (UINT8*)mv0_prot_offset;

 ofst8[ 0x02 ] = ((ofst8[ 0x01 ] >> 4) & 0x01) + ((ofst8[ 0x00 ] & 0x0f) << 1);
 ofst8[ 0x03 ] = ((ofst8[ 0x01 ] >> 5) & 0x01) + (((ofst8[ 0x00 ] >> 4) & 0x0f) << 1);
 ofst8[ 0x04 ] = ((ofst8[ 0x01 ] >> 6) & 0x01) + ((ofst8[ 0x01 ] & 0x0f) << 1);
 ofst8[ 0x05 ] = (ofst8[ 0x01 ] >> 7);
}else if( offset == 5 ){
 UINT8 *ofst8 = (UINT8*)mv0_prot_offset;

 ofst8[ 0x0c ] = (ofst8[ 0x08 ] >> 1) | ((ofst8[ 0x09 ] >> 1) << 4);
 ofst8[ 0x0d ] = (ofst8[ 0x0a ] >> 1) |
     ((ofst8[ 0x08 ] & 0x01) << 4) |
     ((ofst8[ 0x09 ] & 0x01) << 5) |
     ((ofst8[ 0x0a ] & 0x01) << 6) |
     (ofst8[ 0x0b ] << 7);
}
}

static READ16_HANDLER( mv0_bankswitch_r )
{
if( mv0_bankswitch_offset[ 0 ] == 0xffff && mv0_bankswitch_offset[ 1 ] == 0xffff ){

 mv0_bankswitch_flg = 1;
 if( offset == 0 ){
 	return 0xfea0;
 }else if( offset == 1 ){
 	return 0x7fff;
 }else{
 	return mv0_bankswitch_offset[ offset ];
 }
}else if( mv0_bankswitch_offset[ 0 ] == 0x0000 && mv0_bankswitch_offset[ 1 ] == 0x0000 && mv0_bankswitch_flg == 1 ){

 if( offset == 0 ){
 	return 0x00a0;
 }else if( offset == 1 ){
 	mv0_bankswitch_flg = 0;
 	return 0x0000;
 }else{
 	return mv0_bankswitch_offset[ offset ];
 }
}else{
 return mv0_bankswitch_offset[ offset ];
}
}

static WRITE16_HANDLER( mv0_bankswitch_w )
{
UINT32 bank_addr;

mv0_bankswitch_offset[ offset ] = (mv0_bankswitch_offset[ offset ] & mem_mask) | ((~mem_mask) & data);

bank_addr = (mv0_bankswitch_offset[ 0 ] >> 8) +
   (mv0_bankswitch_offset[ 1 ] << 8) +
   0x100000;

neogeo_set_cpu1_second_bank( bank_addr );
}


static void svcchaos_px_decrypt( void )
{
const unsigned char xor1[ 0x20 ] = {
 0x3b, 0x6a, 0xf7, 0xb7, 0xe8, 0xa9, 0x20, 0x99, 0x9f, 0x39, 0x34, 0x0c, 0xc3, 0x9a, 0xa5, 0xc8,
 0xb8, 0x18, 0xce, 0x56, 0x94, 0x44, 0xe3, 0x7a, 0xf7, 0xdd, 0x42, 0xf0, 0x18, 0x60, 0x92, 0x9f,
};

const unsigned char xor2[ 0x20 ] = {
 0x69, 0x0b, 0x60, 0xd6, 0x4f, 0x01, 0x40, 0x1a, 0x9f, 0x0b, 0xf0, 0x75, 0x58, 0x0e, 0x60, 0xb4,
 0x14, 0x04, 0x20, 0xe4, 0xb9, 0x0d, 0x10, 0x89, 0xeb, 0x07, 0x30, 0x90, 0x50, 0x0e, 0x20, 0x26,
};

int i;
int ofst;
UINT8 *rom, *buf;

rom = memory_region( REGION_CPU1 );

for( i = 0; i < 0x100000; i++ ){
 rom[ i ] ^= xor1[ (i % 0x20) ];
}

for( i = 0x100000; i < 0x800000; i++ ){
 rom[ i ] ^= xor2[ (i % 0x20) ];
}

for( i = 0x100000; i < 0x800000; i += 4 ){
 UINT16 *rom16 = (UINT16*)&rom[ i + 1 ];
 *rom16 = BITSWAP16( *rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0 );
}

buf = malloc( 0x800000 );
memcpy( buf, rom, 0x800000 );

for( i = 0; i < 0x0100000 / 0x10000; i++ ){
 ofst = (i & 0xf0) + BITSWAP8( (i & 0x0f), 7, 6, 5, 4, 2, 3, 0, 1 );
 memcpy( &rom[ i * 0x10000 ], &buf[ ofst * 0x10000 ], 0x10000 );
}

for( i = 0x100000; i < 0x800000; i += 0x100 ){
 ofst = (i & 0xf000ff) + 
     ((i & 0x000f00) ^ 0x00a00) +
     (BITSWAP8( ((i & 0x0ff000) >> 12), 4, 5, 6, 7, 1, 0, 3, 2 ) << 12);

 memcpy( &rom[ i ], &buf[ ofst ], 0x100 );
}

free( buf );

buf = malloc( 0x800000 );
memcpy( buf, rom, 0x800000 );
memcpy( &rom[ 0x100000 ], &buf[ 0x700000 ], 0x100000 );
memcpy( &rom[ 0x200000 ], &buf[ 0x100000 ], 0x600000 );
free( buf );
}

static void svcchaos_gfx_decrypt( void )
{
  const unsigned char xor1[ 4 ] = {
     0x34, 0x21, 0xc4, 0xe9,
  };

  int i;
  int ofst;
  UINT8 *src = memory_region( REGION_GFX3 );
  int len = memory_region_length( REGION_GFX3 );
  UINT8 *dst = malloc( len );
  UINT8 *s1 = memory_region( REGION_GFX1 );
  size_t s1_size = memory_region_length( REGION_GFX1 );

  for( i = 0; i < len; i++ ){
     src[ i ] ^= xor1[ (i % 4) ];
  }

  for( i = 0; i < len; i += 4 ){
     UINT32 *src32 = (UINT32*)&src[ i ];
     *src32 = BITSWAP32( *src32, 0x09, 0x0d, 0x13, 0x00, 0x17, 0x0f, 0x03, 0x05,
                          0x04, 0x0c, 0x11, 0x1e, 0x12, 0x15, 0x0b, 0x06,
                          0x1b, 0x0a, 0x1a, 0x1c, 0x14, 0x02, 0x0e, 0x1d,
                          0x18, 0x08, 0x01, 0x10, 0x19, 0x1f, 0x07, 0x16 );
  }

  memcpy( dst, src, len );

  for( i = 0; i < len / 4; i++ ){
     ofst =  BITSWAP24( (i & 0x1fffff), 0x17, 0x16, 0x15, 0x04, 0x0b, 0x0e, 0x08, 0x0c,
                                0x10, 0x00, 0x0a, 0x13, 0x03, 0x06, 0x02, 0x07,
                                0x0d, 0x01, 0x11, 0x09, 0x14, 0x0f, 0x12, 0x05 );
     ofst ^= 0x0c8923;
     ofst += (i & 0xffe00000);

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

  free( dst );

  kof2000_neogeo_gfx_decrypt(0x57);
  
  for( i = 0; i < s1_size; i++ ){
     s1[ i ] = BITSWAP8( s1[ i ] ^ 0xd2, 4, 0, 7, 2, 5, 1, 6, 3 );

  }
}

// Analyzed and original code by vconv (from 2ch)
static void svcchaos_vx_decrypt( void )
{
const unsigned char xor[ 0x08 ] = {
 0xc3, 0xfd, 0x81, 0xac, 0x6d, 0xe7, 0xbf, 0x9e
};

int i;
int vx_size = memory_region_length( REGION_SOUND1 );
UINT8 *rom = memory_region( REGION_SOUND1 );
UINT8 *buf = malloc( vx_size );
int ofst;

memcpy( buf, rom, vx_size );

for( i = 0; i < vx_size; i++ ){
 ofst = (i & 0xfefffe) |
     ((i & 0x010000) >> 16) |
     ((i & 0x000001) << 16);

 ofst ^= 0xc2000;

 rom[ ofst ] = buf[ ((i + 0xffac28) & 0xffffff) ] ^ xor[ (ofst & 0x07) ];
}

free( buf );
}


DRIVER_INIT( svcchaos )
{
svcchaos_px_decrypt();
svcchaos_gfx_decrypt();
svcchaos_vx_decrypt();

neogeo_fix_bank_type = 2;
init_neogeo();

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MRA16_RAM );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MWA16_RAM );

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fffe0, 0x2fffef, 0, 0, mv0_prot_r );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fffe0, 0x2fffef, 0, 0, mv0_prot_w );

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_r );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_w );
}

DRIVER_INIT( svchaosa )
{
svcchaos_px_decrypt();
kof2000_neogeo_gfx_decrypt(0x57);
svcchaos_vx_decrypt();

neogeo_fix_bank_type = 2;
init_neogeo();

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MRA16_RAM );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MWA16_RAM );

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fffe0, 0x2fffef, 0, 0, mv0_prot_r );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fffe0, 0x2fffef, 0, 0, mv0_prot_w );

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_r );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_w );
}


GAMEB( 2003, svcchaos, neogeo,   neogeo, neogeo, neogeo,  svcchaos, ROT0, "SNK Playmore", "SNK Vs. CAPCOM SVC CHAOS (PCB)" )
GAMEB( 2003, svchaosa, svcchaos, neogeo, neogeo, neogeo,  svchaosa, ROT0, "SNK Playmore", "SNK Vs. CAPCOM SVC CHAOS (MVS)" )

Link to comment
Share on other sites

mslug5

 

/******************************************************************************
Analyzed by HalRIN
http://www52.tok2.com/home/foge/
******************************************************************************/

ROM_START( mslug5 )
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD32_WORD_SWAP( "268-p1.bin", 0x000000, 0x400000, CRC(d0466792) SHA1(880819933d997fab398f91061e9dbccb959ae8a1) )
ROM_LOAD32_WORD_SWAP( "268-p2.bin", 0x000002, 0x400000, CRC(fbf6b61e) SHA1(9ec743d5988b5e3183f37f8edf45c72a8c0c893e) )

ROM_REGION( 0x20000, REGION_GFX1, 0 )
ROM_FILL(                 0x000000, 0x20000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION( 0x40000, REGION_USER4, 0 )
ROM_LOAD( "268-m1.bin", 0x00000, 0x40000, CRC(88c11f51) SHA1(5592819be64b69ab361d3b6b139fc68d8cabd29d) )
NEO_BIOS_SOUND_256K( "268-m1d.bin", CRC(6866d696) SHA1(3638b072e44277a6bffea5a78a915a14c6afcba0) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD( "268-v1.bin", 0x000000, 0x800000, CRC(33c6305c) SHA1(67fce35a62941d2dcec75f0e6319677d6df7a4dc) )
ROM_LOAD( "268-v2.bin", 0x800000, 0x800000, CRC(1afb848e) SHA1(368e950043deebc91f7b38be770fa1045a0153af) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "268-c1.bin", 0x0000000, 0x800000, CRC(27d59de8) SHA1(0447a675d885721cedc079788cf41ae3f797834b) )
ROM_LOAD16_BYTE( "268-c2.bin", 0x0000001, 0x800000, CRC(e600dee1) SHA1(e55e5a25616c4daf09692d1b53a92d6f31e842ac) )
ROM_LOAD16_BYTE( "268-c3.bin", 0x1000000, 0x800000, CRC(b650f098) SHA1(4cd729153bd5b2054fbe10c96d2bb370084d1d24) )
ROM_LOAD16_BYTE( "268-c4.bin", 0x1000001, 0x800000, CRC(10499589) SHA1(24542a3b70080e5a61fdab04ab314450a1d821ef) )
ROM_LOAD16_BYTE( "268-c5.bin", 0x2000000, 0x800000, CRC(19352405) SHA1(5ee255403739c11a65608dcff0984480f067d824) )
ROM_LOAD16_BYTE( "268-c6.bin", 0x2000001, 0x800000, CRC(b1531523) SHA1(786f342dbb7fea50139d6421e5b82e551772bf0a) )
ROM_LOAD16_BYTE( "268-c7.bin", 0x3000000, 0x800000, CRC(fe2c1338) SHA1(de9d257574881dd1684956f60011a20c1dd5a0d9) )
ROM_LOAD16_BYTE( "268-c8.bin", 0x3000001, 0x800000, CRC(ecce3141) SHA1(103247b57f8ea5746dd1cf92dda95a6dc9268c78) )
ROM_END

static UINT16 mv0_bankswitch_offset[ 2 ];
static int mv0_bankswitch_flg;

static READ16_HANDLER( mv0_bankswitch_r )
{
if( mv0_bankswitch_offset[ 0 ] == 0xffff && mv0_bankswitch_offset[ 1 ] == 0xffff ){

 mv0_bankswitch_flg = 1;
 if( offset == 0 ){
	 return 0xfea0;
 }else if( offset == 1 ){
	 return 0x7fff;
 }else{
	 return mv0_bankswitch_offset[ offset ];
 }
}else if( mv0_bankswitch_offset[ 0 ] == 0x0000 && mv0_bankswitch_offset[ 1 ] == 0x0000 && mv0_bankswitch_flg == 1 ){

 if( offset == 0 ){
	 return 0x00a0;
 }else if( offset == 1 ){
	 mv0_bankswitch_flg = 0;
	 return 0x0000;
 }else{
	 return mv0_bankswitch_offset[ offset ];
 }
}else{
 return mv0_bankswitch_offset[ offset ];
}
}

static WRITE16_HANDLER( mv0_bankswitch_w )
{
UINT32 bank_addr;

mv0_bankswitch_offset[ offset ] = (mv0_bankswitch_offset[ offset ] & mem_mask) | ((~mem_mask) & data);

bank_addr = (mv0_bankswitch_offset[ 0 ] >> 8) +
   (mv0_bankswitch_offset[ 1 ] << 8) +
   0x100000;

neogeo_set_cpu1_second_bank( bank_addr );
}

static void mslug5_px_decrypt( void )
{
const unsigned char xor1[ 0x20 ] = {
 0xc2, 0x4b, 0x74, 0xfd, 0x0b, 0x34, 0xeb, 0xd7, 0x10, 0x6d, 0xf9, 0xce, 0x5d, 0xd5, 0x61, 0x29,
 0xf5, 0xbe, 0x0d, 0x82, 0x72, 0x45, 0x0f, 0x24, 0xb3, 0x34, 0x1b, 0x99, 0xea, 0x09, 0xf3, 0x03,
};

const unsigned char xor2[ 0x20 ] = {
 0x36, 0x09, 0xb0, 0x64, 0x95, 0x0f, 0x90, 0x42, 0x6e, 0x0f, 0x30, 0xf6, 0xe5, 0x08, 0x30, 0x64,
 0x08, 0x04, 0x00, 0x2f, 0x72, 0x09, 0xa0, 0x13, 0xc9, 0x0b, 0xa0, 0x3e, 0xc2, 0x00, 0x40, 0x2b,
};

int i;
UINT8 *rom, *buf;
int ofst;

rom = memory_region( REGION_CPU1 );

for( i = 0; i < 0x100000; i++ ){
 rom[ i ] ^= xor1[ (i % 0x20) ];
}

for( i = 0x100000; i < 0x800000; i++ ){
 rom[ i ] ^= xor2[ (i % 0x20) ];
}

for( i = 0x100000; i < 0x0800000; i += 4 ){
 UINT16 *rom16 = (UINT16*)&rom[ i + 1 ];
 *rom16 = BITSWAP16( *rom16, 15, 14, 13, 12, 10, 11, 8, 9, 6, 7, 4, 5, 3, 2, 1, 0 );
}

buf = malloc( 0x800000 );
memcpy( buf, rom, 0x800000 );

for( i = 0; i < 0x0100000 / 0x10000; i++ ){
 ofst = (i & 0xf0) + BITSWAP8( (i & 0x0f), 7, 6, 5, 4, 1, 0, 3, 2 );
 memcpy( &rom[ i * 0x10000 ], &buf[ ofst * 0x10000 ], 0x10000 );
}

for( i = 0x100000; i < 0x800000; i += 0x100 ){
 ofst = (i & 0xf000ff) + 
     ((i & 0x000f00) ^ 0x00700) +
     (BITSWAP8( ((i & 0x0ff000) >> 12), 5, 4, 7, 6, 1, 0, 3, 2 ) << 12);

 memcpy( &rom[ i ], &buf[ ofst ], 0x100 );
}

free( buf );

buf = malloc( 0x800000 );
memcpy( buf, rom, 0x800000 );
memcpy( &rom[ 0x100000 ], &buf[ 0x700000 ], 0x100000 );
memcpy( &rom[ 0x200000 ], &buf[ 0x100000 ], 0x600000 );
free( buf );
}

// Analyzed and original code by vconv (from 2ch)
static void mslug5_vx_decrypt( void )
{
const unsigned char xor[ 0x08 ] = {
 0xc3, 0xfd, 0x81, 0xac, 0x6d, 0xe7, 0xbf, 0x9e
};

int vx_size = memory_region_length( REGION_SOUND1 );
UINT8 *rom = memory_region( REGION_SOUND1 );
UINT8 *buf = malloc( vx_size );
int ofst;

memcpy( buf, rom, vx_size );

for( int i = 0; i < vx_size; i++ ){
 ofst = (i & 0xfefffe) |
     ((i & 0x010000) >> 16) |
     ((i & 0x000001) << 16);

 ofst ^= 0x4e001;

 rom[ ofst ] = buf[ ((i + 0xfe2cf6) & 0xffffff) ] ^ xor[ (ofst & 0x07) ];
}

free( buf );
}


DRIVER_INIT( mslug5 )
{
mslug5_px_decrypt();
mslug5_vx_decrypt();

neogeo_fix_bank_type = 1;
kof2000_neogeo_gfx_decrypt(0x19);

memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_w );
memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_r );

init_neogeo();
}

GAMEB( 2003, mslug5,   neogeo,   neogeo, neogeo, neogeo,  mslug5,   ROT0, "SNK Playmore", "Metal Slug 5" )

Link to comment
Share on other sites

svcboot/svcplus/svcplusa/svcsplus

 

 

 

/******************************************************************************
Analyzed by HalRIN
http://www52.tok2.com/home/foge/
******************************************************************************/

ROM_START( svcboot )
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "svc-p1.bin", 0x000000, 0x800000, CRC(0348f162) SHA1(c313351d68effd92aeb80ed320e4f8c26a3bb53e) )

ROM_REGION( 0x20000, REGION_GFX1, 0 )
ROM_LOAD( "svc-s1.bin", 0x10000, 0x10000, CRC(70b44df1) SHA1(52ae3f264d7b33e94e770e6b2d0cf35a64e7dda4) )
ROM_CONTINUE( 	 0x00000, 0x10000 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION16_BE( 0x20000, REGION_USER1, 0 )
NEOGEO_BIOS
ROM_REGION( 0x50000, REGION_CPU2, 0 )
ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
ROM_LOAD( "svc-m1.bin", 0x20000, 0x10000, CRC(804328c3) SHA1(f931636c563b0789d4812033a77b47bf663db43f) )
ROM_CONTINUE(           0x00000, 0x10000 )
ROM_COPY( REGION_CPU2,  0x00000, 0x10000, 0x10000 )
ROM_REGION( 0x10000, REGION_GFX4, 0 )
ROM_LOAD( "000-lo.lo", 0x00000, 0x10000, CRC(e09e253c) SHA1(2b1c719531dac9bb503f22644e6e4236b91e7cfc) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD16_WORD_SWAP( "svc-v2.bin", 0x000000, 0x400000, CRC(b5097287) SHA1(3ba3a9b5624879616382ed40337a3d9c50a0f314) )
ROM_LOAD16_WORD_SWAP( "svc-v1.bin", 0x400000, 0x400000, CRC(bd3a391f) SHA1(972bf09b75e99a683ee965bec93b0da8f15d72d9) )
ROM_LOAD16_WORD_SWAP( "svc-v4.bin", 0x800000, 0x400000, CRC(33fc0b37) SHA1(d61017d829f44c7df8795ba10c55c727d9972662) )
ROM_LOAD16_WORD_SWAP( "svc-v3.bin", 0xc00000, 0x400000, CRC(aa9849a0) SHA1(9539b3356a070a066a89f27c287f316e7367ce2a) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) )
ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) )
ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) )
ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) )
ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) )
ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) )
ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) )
ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) )
ROM_END

ROM_START( svcplus )
ROM_REGION( 0x600000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "svc-p1p.bin", 0x000000, 0x200000, CRC(a194d842) SHA1(72b7bfa34a97632b1aa003488e074d766a6c2f08) )
ROM_LOAD16_WORD_SWAP( "svc-p2p.bin", 0x200000, 0x200000, CRC(50c0e2b7) SHA1(97b396415ab0e692e43ddf371091e5a456712f0a) )
ROM_LOAD16_WORD_SWAP( "svc-p3p.bin", 0x400000, 0x200000, CRC(58cdc293) SHA1(3c4f2418ec513bcc13ed33a727de11dfb98f7525) )

NEO_SFIX_128K( "svc-s1p.bin", CRC(73344711) SHA1(04d84c4fe241b9135cd210f8ed8c725f595d11d2) )

ROM_REGION16_BE( 0x20000, REGION_USER1, 0 )
NEOGEO_BIOS
ROM_REGION( 0x50000, REGION_CPU2, 0 )
ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
ROM_LOAD( "svc-m1.bin", 0x20000, 0x10000, CRC(804328c3) SHA1(f931636c563b0789d4812033a77b47bf663db43f) )
ROM_CONTINUE(           0x00000, 0x10000 )
ROM_COPY( REGION_CPU2,  0x00000, 0x10000, 0x10000 )
ROM_REGION( 0x10000, REGION_GFX4, 0 )
ROM_LOAD( "000-lo.lo", 0x00000, 0x10000, CRC(e09e253c) SHA1(2b1c719531dac9bb503f22644e6e4236b91e7cfc) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD16_WORD_SWAP( "svc-v2.bin", 0x000000, 0x400000, CRC(b5097287) SHA1(3ba3a9b5624879616382ed40337a3d9c50a0f314) )
ROM_LOAD16_WORD_SWAP( "svc-v1.bin", 0x400000, 0x400000, CRC(bd3a391f) SHA1(972bf09b75e99a683ee965bec93b0da8f15d72d9) )
ROM_LOAD16_WORD_SWAP( "svc-v4.bin", 0x800000, 0x400000, CRC(33fc0b37) SHA1(d61017d829f44c7df8795ba10c55c727d9972662) )
ROM_LOAD16_WORD_SWAP( "svc-v3.bin", 0xc00000, 0x400000, CRC(aa9849a0) SHA1(9539b3356a070a066a89f27c287f316e7367ce2a) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) )
ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) )
ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) )
ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) )
ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) )
ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) )
ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) )
ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) )
ROM_END

ROM_START( svcplusa )
ROM_REGION( 0x600000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "svc-p1pl.bin", 0x000000, 0x200000, CRC(16b44144) SHA1(5eab530274b1b6f480a39a86c199da524cddfccc) )
ROM_LOAD16_WORD_SWAP( "svc-p2pl.bin", 0x200000, 0x400000, CRC(7231ace2) SHA1(d2f13ddd5d3ee29b4b9824e8663f7ee0241f30cf) )

ROM_REGION( 0x20000, REGION_GFX1, 0 )
ROM_LOAD( "svc-s1pl.bin", 0x10000, 0x10000, CRC(ca3c735e) SHA1(aebd15253c90432a2e0a4c40f37110c1e2176ee4) )
ROM_CONTINUE( 	 0x00000, 0x10000 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

ROM_REGION16_BE( 0x20000, REGION_USER1, 0 )
NEOGEO_BIOS
ROM_REGION( 0x50000, REGION_CPU2, 0 )
ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
ROM_LOAD( "svc-m1.bin", 0x20000, 0x10000, CRC(804328c3) SHA1(f931636c563b0789d4812033a77b47bf663db43f) )
ROM_CONTINUE(           0x00000, 0x10000 )
ROM_COPY( REGION_CPU2,  0x00000, 0x10000, 0x10000 )
ROM_REGION( 0x10000, REGION_GFX4, 0 )
ROM_LOAD( "000-lo.lo", 0x00000, 0x10000, CRC(e09e253c) SHA1(2b1c719531dac9bb503f22644e6e4236b91e7cfc) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD16_WORD_SWAP( "svc-v2.bin", 0x000000, 0x400000, CRC(b5097287) SHA1(3ba3a9b5624879616382ed40337a3d9c50a0f314) )
ROM_LOAD16_WORD_SWAP( "svc-v1.bin", 0x400000, 0x400000, CRC(bd3a391f) SHA1(972bf09b75e99a683ee965bec93b0da8f15d72d9) )
ROM_LOAD16_WORD_SWAP( "svc-v4.bin", 0x800000, 0x400000, CRC(33fc0b37) SHA1(d61017d829f44c7df8795ba10c55c727d9972662) )
ROM_LOAD16_WORD_SWAP( "svc-v3.bin", 0xc00000, 0x400000, CRC(aa9849a0) SHA1(9539b3356a070a066a89f27c287f316e7367ce2a) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) )
ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) )
ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) )
ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) )
ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) )
ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) )
ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) )
ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) )
ROM_END

ROM_START( svcsplus )
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "svc-p1sp.bin", 0x000000, 0x400000, CRC(2601902f) SHA1(202348a13c6480f7de37a3ee983823838822fc98) )
ROM_LOAD16_WORD_SWAP( "svc-p2sp.bin", 0x400000, 0x400000, CRC(0ca13305) SHA1(ac8fbca71b754acbcdd11802161a62ae1cf32d88) )

NEO_SFIX_128K( "svc-s1sp.bin", CRC(233d6439) SHA1(369024c7a2405c3144c14ac016c07c3dc0f44187) )

ROM_REGION16_BE( 0x20000, REGION_USER1, 0 )
NEOGEO_BIOS
ROM_REGION( 0x50000, REGION_CPU2, 0 )
ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(97cf998b) SHA1(977387a7c76ef9b21d0b01fa69830e949a9a9626) )
ROM_LOAD( "svc-m1.bin", 0x20000, 0x10000, CRC(804328c3) SHA1(f931636c563b0789d4812033a77b47bf663db43f) )
ROM_CONTINUE(           0x00000, 0x10000 )
ROM_COPY( REGION_CPU2,  0x00000, 0x10000, 0x10000 )
ROM_REGION( 0x10000, REGION_GFX4, 0 )
ROM_LOAD( "000-lo.lo", 0x00000, 0x10000, CRC(e09e253c) SHA1(2b1c719531dac9bb503f22644e6e4236b91e7cfc) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD16_WORD_SWAP( "svc-v2.bin", 0x000000, 0x400000, CRC(b5097287) SHA1(3ba3a9b5624879616382ed40337a3d9c50a0f314) )
ROM_LOAD16_WORD_SWAP( "svc-v1.bin", 0x400000, 0x400000, CRC(bd3a391f) SHA1(972bf09b75e99a683ee965bec93b0da8f15d72d9) )
ROM_LOAD16_WORD_SWAP( "svc-v4.bin", 0x800000, 0x400000, CRC(33fc0b37) SHA1(d61017d829f44c7df8795ba10c55c727d9972662) )
ROM_LOAD16_WORD_SWAP( "svc-v3.bin", 0xc00000, 0x400000, CRC(aa9849a0) SHA1(9539b3356a070a066a89f27c287f316e7367ce2a) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "svc-c1.bin", 0x0000000, 0x800000, CRC(a7826b89) SHA1(3bbe348ce54b80b56ef032ea532a18ef3cafeb11) )
ROM_LOAD16_BYTE( "svc-c2.bin", 0x0000001, 0x800000, CRC(ed3c2089) SHA1(b5d17692f15f5a678c273589fab2e3918711135e) )
ROM_LOAD16_BYTE( "svc-c3.bin", 0x1000000, 0x800000, CRC(71ed8063) SHA1(ea1df9e2e382a8560a06d447421844cc588f43dd) )
ROM_LOAD16_BYTE( "svc-c4.bin", 0x1000001, 0x800000, CRC(250bde2d) SHA1(8c72dcfceef6d022ab4b73ab37cf3ac0c3940c17) )
ROM_LOAD16_BYTE( "svc-c5.bin", 0x2000000, 0x800000, CRC(9817c082) SHA1(1bea9c7220c2b1524896c86841d6d8fd55f5d366) )
ROM_LOAD16_BYTE( "svc-c6.bin", 0x2000001, 0x800000, CRC(2bc0307f) SHA1(8090fa82c46eb503832359093c8cc3cee3141c90) )
ROM_LOAD16_BYTE( "svc-c7.bin", 0x3000000, 0x800000, CRC(4358d7b9) SHA1(9270b58c2abc072a046bedda72f1395df26d0714) )
ROM_LOAD16_BYTE( "svc-c8.bin", 0x3000001, 0x800000, CRC(366deee5) SHA1(d477ad7a5987fd6c7ef2c1680fbb7c884654590e) )
ROM_END



static UINT16 mv0_bankswitch_offset[ 2 ];
static int mv0_bankswitch_flg;

static READ16_HANDLER( mv0_bankswitch_r )
{
if( mv0_bankswitch_offset[ 0 ] == 0xffff && mv0_bankswitch_offset[ 1 ] == 0xffff ){

 mv0_bankswitch_flg = 1;
 if( offset == 0 ){
	 return 0xfea0;
 }else if( offset == 1 ){
	 return 0x7fff;
 }else{
	 return mv0_bankswitch_offset[ offset ];
 }
}else if( mv0_bankswitch_offset[ 0 ] == 0x0000 && mv0_bankswitch_offset[ 1 ] == 0x0000 && mv0_bankswitch_flg == 1 ){

 if( offset == 0 ){
	 return 0x00a0;
 }else if( offset == 1 ){
	 mv0_bankswitch_flg = 0;
	 return 0x0000;
 }else{
	 return mv0_bankswitch_offset[ offset ];
 }
}else{
 return mv0_bankswitch_offset[ offset ];
}
}

static WRITE16_HANDLER( mv0_bankswitch_w )
{
UINT32 bank_addr;

mv0_bankswitch_offset[ offset ] = (mv0_bankswitch_offset[ offset ] & mem_mask) | ((~mem_mask) & data);

bank_addr = (mv0_bankswitch_offset[ 0 ] >> 8) +
   (mv0_bankswitch_offset[ 1 ] << 8) +
   0x100000;

neogeo_set_cpu1_second_bank( bank_addr );
}


static void svcboot_px_decrypt( void )
{
const unsigned char sec[] = {
 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};

int i;
int size = memory_region_length( REGION_CPU1 );
UINT8 *src = memory_region( REGION_CPU1 );
UINT8 *dst = malloc( size );
int ofst;

for( i = 0; i < size / 0x100000; i++ ){
 memcpy( &dst[ i * 0x100000 ], &src[ sec[ i ] * 0x100000 ], 0x100000 );
}

for( i = 0; i < size / 2; i++ ){
 ofst = BITSWAP8( (i & 0x0000ff), 7, 6, 1, 0, 3, 2, 5, 4 );
 ofst += (i & 0xffff00);

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

free( dst );
}

static void svcboot_cx_decrypt( void )
{
const unsigned char idx_tbl[ 0x10 ] = {
 0, 1, 0, 1, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5,
};

const unsigned char bitswap4_tbl[ 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 size = memory_region_length( REGION_GFX3 );
UINT8 *src = memory_region( REGION_GFX3 );
UINT8 *dst = malloc( size );
int ofst;

memcpy( dst, src, size );

for( i = 0; i < size / 0x80; i++ ){
 int idx = idx_tbl[ (i & 0xf00) >> 8 ];

 int bit0 = bitswap4_tbl[ idx ][ 0 ];
 int bit1 = bitswap4_tbl[ idx ][ 1 ];
 int bit2 = bitswap4_tbl[ idx ][ 2 ];
 int bit3 = bitswap4_tbl[ idx ][ 3 ];

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

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

free( dst );
}

static void svcplus_px_decrypt( void )
{
int sec[] = {
 0x00, 0x03, 0x02, 0x05, 0x04, 0x01
};

int size = memory_region_length( REGION_CPU1 );
UINT8 *src = memory_region( REGION_CPU1 );
UINT8 *dst = malloc( size );
int i;
int ofst;

memcpy( dst, src, size );

for( i = 0; i < 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 * 0x02 ], &dst[ ofst * 0x02 ], 0x02 );
}

memcpy( dst, src, size );

for( i = 0; i < 6; i++ ){
 memcpy( &src[ i * 0x100000 ], &dst[ sec[ i ] * 0x100000 ], 0x100000 );
}

free( dst );
}

static void svcplus_px_hack( void )
{
UINT8 *src = memory_region( REGION_CPU1 );

src[ 0x0f8010 ] = 0x40;
src[ 0x0f8011 ] = 0x04;
src[ 0x0f8012 ] = 0x00;
src[ 0x0f8013 ] = 0x10;
src[ 0x0f8014 ] = 0x40;
src[ 0x0f8015 ] = 0x46;
src[ 0x0f8016 ] = 0xc1;

src[ 0x0f802c ] = 0x16;
}

static void svcplus_sx_decrypt( void )
{
int size = memory_region_length( REGION_GFX1 );
UINT8 *src = memory_region( REGION_GFX1 );
UINT8 *dst = malloc( size );

memcpy( dst, src, size );

for( int i = 0; i < size; i += 0x10 ){
 memcpy( &src[ i        ], &dst[ i + 0x08 ], 0x08 );
 memcpy( &src[ i + 0x08 ], &dst[ i        ], 0x08 );
}

free(dst);
}

static void svcplusa_px_decrypt( void )
{
int sec[] = {
 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};

int size = memory_region_length( REGION_CPU1 );
UINT8 *src = memory_region( REGION_CPU1 );
UINT8 *dst = malloc( size );

memcpy( dst, src, size );

for( int i = 0; i < 6; i++ ){
 memcpy( &src[ i * 0x100000 ], &dst[ sec[ i ] * 0x100000 ], 0x100000 );
}

free( dst );
}

static void svcsplus_px_decrypt( void )
{
int sec[] = {
 0x06, 0x07, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00
};

int size = memory_region_length( REGION_CPU1 );
UINT8 *src = memory_region( REGION_CPU1 );
UINT8 *dst = malloc( size );
int i;
int ofst;

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 );
}

free( dst );

}

static void svcsplus_px_hack( void )
{
data16_t *mem16 = (data16_t *)memory_region(REGION_CPU1);

mem16[0x9e90/2] = 0x000f;
mem16[0x9e92/2] = 0xc9c0;
mem16[0xa10c/2] = 0x4eb9;
mem16[0xa10e/2] = 0x000e;
mem16[0xa110/2] = 0x9750;
}

static void svcsplus_sx_decrypt( void )
{
UINT8 *rom = memory_region( REGION_GFX1 );
int size = memory_region_length( REGION_GFX1 );

for( int i = 0; i < size; i++ ){
 rom[ i ] = BITSWAP8( rom[ i ], 7, 6, 0, 4, 3, 2, 1, 5 );
}
}


DRIVER_INIT( svcboot )
{
svcboot_px_decrypt();
svcboot_cx_decrypt();

init_neogeo();

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MRA16_RAM );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MWA16_RAM );

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_r );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_w );
}

DRIVER_INIT( svcplus )
{
svcplus_px_decrypt();
svcboot_cx_decrypt();
svcplus_sx_decrypt();

svcplus_px_hack();

init_neogeo();
}

DRIVER_INIT( svcplusa )
{
svcplusa_px_decrypt();
svcboot_cx_decrypt();

svcplus_px_hack();

init_neogeo();
}

DRIVER_INIT( svcsplus )
{
svcsplus_px_decrypt();
svcsplus_sx_decrypt();
svcboot_cx_decrypt();

svcsplus_px_hack();

init_neogeo();

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MRA16_RAM );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2fe000, 0x2fffff, 0, 0, MWA16_RAM );

memory_install_read16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_r );
memory_install_write16_handler( 0, ADDRESS_SPACE_PROGRAM, 0x2ffff0, 0x2ffff3, 0, 0, mv0_bankswitch_w );
}


GAMEB( 2003, svcboot,  neogeo,   neogeo, neogeo, neogeo,  svcboot,  ROT0, "booleg", "SNK Vs. CAPCOM SVC CHAOS (bootleg)" )
GAMEB( 2003, svcplus,  svcboot,  neogeo, neogeo, neogeo,  svcplus,  ROT0, "booleg", "SNK Vs. CAPCOM SVC CHAOS Plus (bootleg)" )
GAMEB( 2003, svcplusa, svcboot,  neogeo, neogeo, neogeo,  svcplusa, ROT0, "booleg", "SNK Vs. CAPCOM SVC CHAOS Plus (bootleg alt)" )
GAMEB( 2003, svcsplus, svcboot,  neogeo, neogeo, neogeo,  svcsplus, ROT0, "booleg", "SNK Vs. CAPCOM SVC CHAOS Super Plus (bootleg)" )

Link to comment
Share on other sites

samsh5bl

 

 

 

/******************************************************************************
Analyzed by HalRIN
http://www52.tok2.com/home/foge/
******************************************************************************/

ROM_START( samsh5bl )
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "ssv-p1.bin", 0x000000, 0x400000, CRC(5023067f) SHA1(b1d682fa7d158f19664356a919da6572e8cfeee0) )
ROM_LOAD16_WORD_SWAP( "ssv-p2.bin", 0x400000, 0x400000, CRC(b6cbe386) SHA1(99c2407361116c2b2c5fe72df53e05c5f99163c1) )

NEO_SFIX_128K( "ssv-s1.bin", CRC(70f667d0) SHA1(6d7ce62bb77eb215cc22d6c3c677accfd740aa83) )

NEO_BIOS_SOUND_128K( "ssv-m1.bin", CRC(18114fb1) SHA1(016dc2f328340f3637a9bff373a20973df29f6b8) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )

ROM_LOAD( "ssv-v1.bin", 0x000000, 0x400000, CRC(a3609761) SHA1(6dce1dbfd228c739b3716ae1cf08fd7f925d8650) )
ROM_LOAD( "ssv-v2.bin", 0x400000, 0x400000, CRC(cbd6ebd5) SHA1(00211be3fa32035b0947ac65920ea8acae7bfae2) )
ROM_LOAD( "ssv-v3.bin", 0x800000, 0x400000, CRC(6f1c2703) SHA1(8015df3d788cb7926ebbcda64a96964fe102ba27) )
ROM_LOAD( "ssv-v4.bin", 0xc00000, 0x400000, CRC(5020c055) SHA1(bd1e68d1b0a47b0e2b365159e210048f8b22823a) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "ssv-c1.bin", 0x0000000, 0x1000000, CRC(9c564a01) SHA1(99dc8900fd8f56ae04fff72b34ddcaa8abe4c1be) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "ssv-c3.bin", 0x0000001, 0x1000000, CRC(4b73b8da) SHA1(a8b626de74cf57bbd8c222e8e24c953c9e8680f4) ) /* Plane 0,1 */
ROM_LOAD16_BYTE( "ssv-c2.bin", 0x2000000, 0x1000000, CRC(029f9bb5) SHA1(6296c879aa0bbd22383ceeeac0326805cbc8b4ec) ) /* Plane 2,3 */
ROM_LOAD16_BYTE( "ssv-c4.bin", 0x2000001, 0x1000000, CRC(75722430) SHA1(30594c30a167e75463670249df7744755e39e75b) ) /* Plane 2,3 */
ROM_END


static void samsh5bl_px_decrypt( void )
{
int px_size = memory_region_length( REGION_CPU1 );
UINT8 *rom = memory_region( REGION_CPU1 );
UINT8 *buf = malloc( px_size );
int ofst;

memcpy( buf, rom, px_size );

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

 ofst ^= 0x060005;

 memcpy( &rom[ i * 2 ], &buf[ ofst * 2 ], 0x02 );
}

memcpy( buf, rom, px_size );

memcpy( &rom[ 0x000000 ], &buf[ 0x700000 ], 0x100000 );
memcpy( &rom[ 0x100000 ], &buf[ 0x000000 ], 0x700000 );

free( buf );
}

static void samsh5bl_cx_decrypt( void )
{
int cx_size = memory_region_length( REGION_GFX3 );
UINT8 *rom = memory_region( REGION_GFX3 );
UINT8 *buf = 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 );
}

static void samsh5bl_sx_decrypt( void )
{
int sx_size = memory_region_length( REGION_GFX1 );
UINT8 *rom = memory_region( REGION_GFX1 );
UINT8 *buf = malloc( sx_size );

memcpy( buf, rom, sx_size );

for( int i = 0; i < sx_size; i += 0x10 ){
 memcpy( &rom[ i        ], &buf[ i + 0x08 ], 0x08 );
 memcpy( &rom[ i + 0x08 ], &buf[ i        ], 0x08 );
}

free( buf );
}

// Original code by fataku
// Analayzed by arnoldso
static void samsh5bl_vx_decrypt( void )
{
int vx_size = memory_region_length( REGION_SOUND1 );
UINT8 *rom = memory_region( REGION_SOUND1 );

for( int i = 0; i < vx_size; i++ ){
 rom[ i ] = BITSWAP8( rom[ i ], 0, 1, 5, 4, 3, 2, 6, 7 );
}
}


DRIVER_INIT( samsh5bl )
{
samsh5bl_px_decrypt();
samsh5bl_cx_decrypt();
samsh5bl_sx_decrypt();
samsh5bl_vx_decrypt();

init_neogeo();
}


//GAMEB( 2003, samsh5bl ,samsho5,  neogeo, neogeo, neogeo,  samsh5bl, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits 0 (bootleg)" )
GAMEB( 2003, samsh5bl ,neogeo,  neogeo, neogeo, neogeo,  samsh5bl, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits 0 (bootleg)" )

Link to comment
Share on other sites

matrimelee

 

 

ROM_START( matrim )
       ROM_REGION( 0x500000, REGION_CPU1, 0 )
       ROM_LOAD16_WORD_SWAP( "266-p1.bin", 0x000000, 0x100000, CRC(5d4c2dc7) SHA1(8d723b0d28ec344eef26009b361a2b97d300dd51) )
       ROM_LOAD16_WORD_SWAP( "266-p2.bin", 0x100000, 0x400000, CRC(a14b1906) SHA1(1daa14d73512f760ef569b06f9facb279437d1db) )
       
       /* The Encrypted Boards do _not_ have an s1 rom, data for it comes from the Cx ROMs */
       ROM_REGION( 0x80000, REGION_GFX1, 0 )
       ROM_FILL(                 0x000000, 0x20000, 0 )
       ROM_REGION( 0x20000, REGION_GFX2, 0 )
       ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )
       
ROM_REGION( 0x20000, REGION_USER4, 0 )
ROM_LOAD( "266-m1.bin", 0x00000, 0x20000, CRC(456c3e6c) SHA1(5a07d0186198a18d2dda1331093cf29b0b9b2984) ) /* encrypted, we load it here for reference and replace with decrypted ROM */
NEO_BIOS_SOUND_128K( "266-m1d.bin", CRC(f692d84b) SHA1(a3737c574e779e0330916a2eea6ad5b3839f9538) )

       ROM_REGION( 0X1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
       /* encrypted */
ROM_LOAD( "266-v1.bin", 0x000000, 0x800000, CRC(a4f83690) SHA1(200d683d8c30ebc6d0ed331aa5bbba39b4e07160) )
ROM_LOAD( "266-v2.bin", 0x800000, 0x800000, CRC(d0f69eda) SHA1(9d7e98976ad433ed8a35d7afffa38130444ba7db) )

NO_DELTAT_REGION

       ROM_REGION( 0x4000000, REGION_GFX3, 0 )
       ROM_LOAD16_BYTE( "266-c1.bin", 0x0000000, 0x800000, CRC(505f4e30) SHA1(f22b6f76fc0cad963555dc89d072967c8dc8b79a) ) /* Plane 0,1 */ 
       ROM_LOAD16_BYTE( "266-c2.bin", 0x0000001, 0x800000, CRC(3cb57482) SHA1(dab15bc24391f9a5173de76af48b612fb9636ccf) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "266-c3.bin", 0x1000000, 0x800000, CRC(f1cc6ad0) SHA1(66c1cccc0332ffd2d3064f06330c41f95ca09ced) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "266-c4.bin", 0x1000001, 0x800000, CRC(45b806b7) SHA1(c2bb866fded53d62fad0fc88d89d5e7d4cb1894f) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "266-c5.bin", 0x2000000, 0x800000, CRC(9a15dd6b) SHA1(194a6973a7a9e3847efe1bdbaeaeb16e74aff2dd) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "266-c6.bin", 0x2000001, 0x800000, CRC(281cb939) SHA1(bdb7766cfde581ccfaee2be7fe48445f360a2301) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "266-c7.bin", 0x3000000, 0x800000, CRC(4b71f780) SHA1(d5611a6f6b730db58613b48f2b0174661ccfb7bb) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "266-c8.bin", 0x3000001, 0x800000, CRC(29873d33) SHA1(dc77f129ed49b8d40d0d4241feef3f6c2f19a987) ) /* Plane 2,3 */
ROM_END



// © PLAYMORE 2002 20-09-2004
static void neo_pcm2_playmore_2002(int value)
{
       //kof2002,matrimelee,mslug5 (pcb and mvs),samsho5,svcchaos (pcb and mvs),kof2003 (pcb and mvs),samsh5sp (mvs and aes)
       //offset,xor address
       unsigned int addrs[7][2]={
                {0x000000,0xA5000}, //kof2002
                {0xFFCE20,0x01000}, //matrimelee
                {0xFE2CF6,0x4E001}, //mslug5
                {0xFEB2C0,0x0A000}, //samsho5
                {0xFFAC28,0xC2000}, //svcchaos
                {0x000000,0x00000}, //kof2003
                {0xFFB440,0x02000}, //samsh5sp
                };
       unsigned int xordata[7][8]={
                {0xF9,0xE0,0x5D,0xF3,0xEA,0x92,0xBE,0xEF}, //kof2002
                {0xC4,0x83,0xA8,0x5F,0x21,0x27,0x64,0xAF}, //matrimelee
                {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //mslug5
                {0xCB,0x29,0x7D,0x43,0xD2,0x3A,0xC2,0xB4}, //samsho5
                {0xC3,0xFD,0x81,0xAC,0x6D,0xE7,0xBF,0x9E}, //svcchaos
                {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, //kof2003
                {0x4B,0xA4,0x63,0x46,0xF0,0x91,0xEA,0x62}, //samsh5sp
                };

UINT8 *src = memory_region(REGION_SOUND1);
UINT8 *buf = malloc(0x1000000);
int i, j, d;

       memcpy(buf,src,0x1000000);
       for (i=0;i<0x1000000;i++){
           j=BITSWAP24(i,23,22,21,20,19,18,17,0,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,16);
           j=j^addrs[value][1];
           d=((i+addrs[value][0])&0xffffff);
           src[j]=buf[d]^xordata[value][j&0x7];
       }
       free(buf);
}



DRIVER_INIT( matrim )
{
UINT8 *src = memory_region(REGION_CPU1)+0x100000;
UINT8 *dst = malloc(0x400000);
int i;
unsigned int sec[]={0x100000,0x280000,0x300000,0x180000,0x000000,0x380000,0x200000,0x080000};

if (dst)
{
 memcpy(dst,src,0x400000);

 for(i=0;i<8;++i)
 {
	 memcpy(src+i*0x80000,dst+sec[i],0x80000);
 }
 free(dst);
}

neogeo_fix_bank_type = 2;
kof2000_neogeo_gfx_decrypt(0x6a);
neo_pcm2_playmore_2002(1); // Matrim
init_neogeo();
}


GAMEB( 2002, matrim,   neogeo,  neogeo, neogeo, neogeo, matrim,   ROT0, "Playmore Corporation / Atlus", "Matrimelee" )

Link to comment
Share on other sites

  • 3 months later...

The King of Fighters 10th Anniversary - All Team Battle (Hack)

 

 

ROM_START( kof10th ) /* this is a hack of kof2002 much like the various korean hacks / bootlegs of games */
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "kf10-p1.bin", 0x100000, 0x600000, CRC(b1fd0c43) SHA1(5f842a8a27be2d957fd4140d6431ae47154997bb) ) 
ROM_CONTINUE(                        0x000000, 0x100000 )
ROM_CONTINUE(                        0x700000, 0x100000 )

ROM_REGION( 0x80000, REGION_GFX1, 0 )
ROM_FILL(      0x000000, 0x80000, 0 )
ROM_REGION( 0x20000, REGION_GFX2, 0 )
ROM_LOAD( "sfix.sfx",  0x000000, 0x20000, CRC(354029fc) SHA1(4ae4bf23b4c2acff875775d4cbff5583893ce2a1) )

NEO_BIOS_SOUND_128K( "kf10-m1.bin", CRC(f6fab859) SHA1(0184aa1394b9f9946d610278b53b846020dd88dc) )

ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
       ROM_LOAD( "kf10-v1.bin", 0x000000, 0x800000, CRC(0fc9a58d) SHA1(9d79ef00e2c2abd9f29af5521c2fbe5798bf336f) )
       ROM_LOAD( "kf10-v2.bin", 0x800000, 0x800000, CRC(b8c475a4) SHA1(10caf9c69927a223445d2c4b147864c02ce520a8) )

NO_DELTAT_REGION

ROM_REGION( 0x4000000, REGION_GFX3, 0 )
       ROM_LOAD16_BYTE( "kf10-c1a.bin", 0x0000000, 0x400000, CRC(3bbc0364) SHA1(e8aa7ff82f151ce1db56f259377b64cceef85af0) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "kf10-c2a.bin", 0x0000001, 0x400000, CRC(91230075) SHA1(d9098e05a7ba6008661147b6bf8bc2f494b8b72b) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "kf10-c1b.bin", 0x0800000, 0x400000, CRC(b5abfc28) SHA1(eabf60992bb3485c95330065294071ec155bfe7c) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "kf10-c2b.bin", 0x0800001, 0x400000, CRC(6cc4c6e1) SHA1(be824a944e745ee18efdc45c81fd496a4d624b9c) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "kf10-c3a.bin", 0x1000000, 0x400000, CRC(5b3d4a16) SHA1(93ac1cd7739100f8c32732644f81f2a19837b131) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "kf10-c4a.bin", 0x1000001, 0x400000, CRC(c6f3419b) SHA1(340c17a73aeb7bf8a6209f8459e6f00000075b50) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "kf10-c3b.bin", 0x1800000, 0x400000, CRC(9d2bba19) SHA1(5ebbd0af3f83a60e33c8ccb743e3d5f5a96f1273) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "kf10-c4b.bin", 0x1800001, 0x400000, CRC(5a4050cb) SHA1(8fd2291f349efa1ed5cd37ad4e273b60fe831a77) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "kf10-c5a.bin", 0x2000000, 0x400000, CRC(a289d1e1) SHA1(50c7d7ebde6e118a01036cc3e40827fcd9f0d3fd) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "kf10-c6a.bin", 0x2000001, 0x400000, CRC(e6494b5d) SHA1(18e064b9867ae0b0794065f8dbefd486620419db) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "kf10-c5b.bin", 0x2800000, 0x400000, CRC(404fff02) SHA1(56d1b32c87ea4885e49264e8b21846e465a20e1f) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "kf10-c6b.bin", 0x2800001, 0x400000, CRC(f2ccfc9e) SHA1(69db7fac7023785ab94ea711a72dbc2826cfe1a3) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "kf10-c7a.bin", 0x3000000, 0x400000, CRC(be79c5a8) SHA1(ded3c5eb3571647f50533eb682c2675372ace3fb) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "kf10-c8a.bin", 0x3000001, 0x400000, CRC(a5952ca4) SHA1(76dbb3cb45ce5a4beffa1ed29491204fc6617e42) ) /* Plane 2,3 */
       ROM_LOAD16_BYTE( "kf10-c7b.bin", 0x3800000, 0x400000, CRC(3fdb3542) SHA1(7d2050752a2064cd6729f483a0da93808e2c6033) ) /* Plane 0,1 */
       ROM_LOAD16_BYTE( "kf10-c8b.bin", 0x3800001, 0x400000, CRC(661b7a52) SHA1(0ae2ad2389134892f156337332b77adade3ddad1) ) /* Plane 2,3 */
ROM_END


static data16_t kof10th_sram16_2[0x2000];

READ16_HANDLER( kof10th_sram16_2_r )
{
return kof10th_sram16_2[offset];
}

WRITE16_HANDLER( kof10th_sram16_2_w )
{
COMBINE_DATA(&kof10th_sram16_2[offset]);
}

DRIVER_INIT( kof10th )
{
int i,j;
UINT16 *prom = (UINT16*)memory_region(REGION_CPU1);
UINT16 *buf  = (UINT16*)malloc(0x800000);
UINT16 *srom = (UINT16*)memory_region(REGION_GFX1);

if (buf){
 memcpy(buf,prom,0x800000);
 for(i=0;i<0x800000/2;i++){
	 j=BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,1,8,7,6,0,4,3,2,9,5);
	 prom[j]=buf[i];
 }
 free(buf);
}

 // get 8x8 tiles from P rom
 // bank 1, game does this on the fly!
 for (i=0;i<0x10000/2;i++){
	 srom[i+0x00000/2]=BITSWAP16(prom[i+0x600000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13);
	 srom[i+0x10000/2]=BITSWAP16(prom[i+0x6d0000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13);
	 }
 for (i=0;i<0x4000/2;i++){
 srom[i+0x02000/2]=BITSWAP16(prom[i+0x6c2000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13);
 srom[i+0x12000/2]=BITSWAP16(prom[i+0x612000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13);
 }
// bank 2, game does this on the fly!
for (i=0;i<0x20000/2;i++){
 srom[i+0x40000/2]=BITSWAP16(prom[i+0x600000/2]^0xf3f3,7,6,0,4,3,2,1,5,15,14,8,12,11,10,9,13);
 srom[i+0x60000/2]=srom[i+0x20000/2]; // copy bios again
 }

// Altera protection chip patches these over P ROM

prom[0x00124/2] = 0x000d;	// Run code that gives XOR for RAM moves and forces SoftDIPs
prom[0x00126/2] = 0xf7a8;	// (how to play off and always teamplay). Also forces USA region. 

prom[0x08bf4/2] = 0x4ef9;	// Run code to change 8x8 tiles (needed for neogeo logo tiles)
prom[0x08bf6/2] = 0x000d;
prom[0x08bf8/2] = 0xf980;

// remove protection (game has ram mapped to 0xe0000 and 0xf0000 and moves code into it)

for(i=0;i<0x40;i++){
 prom[0xe0000/2+i]=((prom[0x531680/2+i]^(0xc11d-0xc0c8))^prom[0x531600/2+i]);
}
for(i=0;i<0x270;i++){
 prom[0xe1000/2+i]=((prom[0x531970/2+i]^(0xc11d-0xc0d9))^prom[0x531700/2+i]);
}

prom[0xe1154/2] = 0x125c;	// fix a jmp offset (was in 0xe0000 range)
prom[0xdf986/2] = 0x168C;	// fix a bsr offset (was in 0xe0000 range)
prom[0xdf998/2] = 0x1668;	// fix a bsr offset (was in 0xe0000 range)

prom[0xdd880/2] = 0x4e75;	// fix level drawing   (from 0xf0000 range)
prom[0xdd89e/2] = 0x4e75;	// fix level anim      (from 0xf0000 range)
prom[0xdd8bc/2] = 0x4e75;	// fix continue screen (from 0xf0000 range)


neogeo_fix_bank_type = 0;

memory_install_read16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000,0x2fffff, 0, 0, kof10th_sram16_2_r);
memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2fe000,0x2fffff, 0, 0, kof10th_sram16_2_w);
memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, 0x2ffff0,0x2fffff, 0, 0, neo_bankswitch_w);

init_neogeo();
}


GAMEB( 2004, kof10th,  kof2002,  neogeo, neogeo, neogeo,  kof10th,  ROT0, "Bootleg", "The King of Fighters 10th Anniversary - All Team Battle (Hack)" )

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...