ROM_START( kf2k2mag )
ROM_REGION( 0x800000, REGION_CPU1, 0 ) /* Encrypted Program Data */
ROM_LOAD16_WORD_SWAP( "kf02m-p1.bin", 0x000000, 0x400000, CRC(ff7c6ec0) )
ROM_LOAD16_WORD_SWAP( "kf02m-p2.bin", 0x400000, 0x400000, CRC(91584716) )
NEO_SFIX_128K( "kf02m-s1.bin", CRC(348d6f2c) )
NEO_BIOS_SOUND_128K( "kf2k2_m1.rom", CRC(ab9d360e) )
ROM_REGION( 0x1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
ROM_LOAD( "kf2k2_v1.rom", 0x000000, 0x400000, CRC(13d98607) )
ROM_LOAD( "kf2k2_v2.rom", 0x400000, 0x400000, CRC(9cf74677) )
ROM_LOAD( "kf2k2_v3.rom", 0x800000, 0x400000, CRC(8e9448b5) )
ROM_LOAD( "kf2k2_v4.rom", 0xc00000, 0x400000, CRC(067271b5) )
NO_DELTAT_REGION
ROM_REGION( 0x4000000, REGION_GFX3, 0 )
/* Encrypted */
ROM_LOAD16_BYTE( "kf2k2_c1.rom", 0x0000000, 0x800000, CRC(7efa6ef7) )
ROM_LOAD16_BYTE( "kf2k2_c2.rom", 0x0000001, 0x800000, CRC(aa82948b) )
ROM_LOAD16_BYTE( "kf2k2_c3.rom", 0x1000000, 0x800000, CRC(959fad0B) )
ROM_LOAD16_BYTE( "kf2k2_c4.rom", 0x1000001, 0x800000, CRC(efe6a468) )
ROM_LOAD16_BYTE( "kf2k2_c5.rom", 0x2000000, 0x800000, CRC(74bba7c6) )
ROM_LOAD16_BYTE( "kf2k2_c6.rom", 0x2000001, 0x800000, CRC(e20d2216) )
ROM_LOAD16_BYTE( "kf2k2_c7.rom", 0x3000000, 0x800000, CRC(8a5b561c) )
ROM_LOAD16_BYTE( "kf2k2_c8.rom", 0x3000001, 0x800000, CRC(bef667a3) )
ROM_END
static void kf2k2mag_decrypt( void )
{
int i,j;
unsigned char *src = memory_region(REGION_CPU1);
unsigned char *dst = (unsigned char*)malloc(0x80);
memcpy(src, src + 0x300000, 0x500000);
if (dst)
{
for (i = 0; i < 0x800000; i+=0x80)
{
for (j = 0; j < 0x80 / 2; j++)
{
int ofst = BITSWAP8( j, 6, 7, 2, 3, 4, 5, 0, 1 );
memcpy(dst + j * 2, src + i + ofst * 2, 2);
}
memcpy(src + i, dst, 0x80);
}
}
free(dst);
}
DRIVER_INIT( kf2k2mag )
{
kf2k2mag_decrypt();
svcsplus_sx_decrypt();
init_neogeo();
}