This should give an idea for FBA
ROM_START( svcchaos ) /* Jamma PCB */
ROM_REGION( 0x600000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "269-p1.bin", 0x000000, 0x200000, CRC(336f219f) SHA1(d93459cb1447d70ff97506b84fc169e69f2e7560) )
ROM_LOAD16_WORD_SWAP( "269-p2.bin", 0x200000, 0x400000, CRC(e5a6589e) SHA1(cdd31645e8edbd7c0624a68c0e50e0687bcc90ba) )
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( "269-m1d.bin", CRC(fd602218) SHA1(d7af0af3e116a7c2f594d1ca77a1289b4e31cd7e) )
ROM_REGION( 0X1000000, REGION_SOUND1, ROMREGION_SOUNDONLY )
/* decrypted */
ROM_LOAD( "269-v1d.bin", 0x000000, 0x800000, CRC(dab37bef) SHA1(1f2f7159f932adad72b29f34a1b746932fd07b34) )
ROM_LOAD( "269-v2d.bin", 0x800000, 0x800000, CRC(7b3e9487) SHA1(59f250b9c99a891c80204c3be307356b751b4c82) )
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
#define BITSWAP32(val,B31,B30,B29,B28,B27,B26,B25,B24,B23,B22,B21,B20,B19,B18,B17,B16,B15,B14,B13,B12,B11,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) \
((BIT(val,B31) << 31) | \
(BIT(val,B30) << 30) | \
(BIT(val,B29) << 29) | \
(BIT(val,B28) << 28) | \
(BIT(val,B27) << 27) | \
(BIT(val,B26) << 26) | \
(BIT(val,B25) << 25) | \
(BIT(val,B24) << 24) | \
(BIT(val,B23) << 23) | \
(BIT(val,B22) << 22) | \
(BIT(val,B21) << 21) | \
(BIT(val,B20) << 20) | \
(BIT(val,B19) << 19) | \
(BIT(val,B18) << 18) | \
(BIT(val,B17) << 17) | \
(BIT(val,B16) << 16) | \
(BIT(val,B15) << 15) | \
(BIT(val,B14) << 14) | \
(BIT(val,B13) << 13) | \
(BIT(val,B12) << 12) | \
(BIT(val,B11) << 11) | \
(BIT(val,B10) << 10) | \
(BIT(val, B9) << 9) | \
(BIT(val, B8) << 8) | \
(BIT(val, B7) << 7) | \
(BIT(val, B6) << 6) | \
(BIT(val, B5) << 5) | \
(BIT(val, B4) << 4) | \
(BIT(val, B3) << 3) | \
(BIT(val, B2) << 2) | \
(BIT(val, B1) << 1) | \
(BIT(val, B0) << 0))
static void svcchaos_cx_sx_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 );
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);
UINT8 *s1 = memory_region( REGION_GFX1 );
size_t s1_size = memory_region_length( REGION_GFX1 );
for( i = 0; i < s1_size; i++ ){
s1[ i ] = BITSWAP8( s1[ i ] ^ 0xd2, 4, 0, 7, 2, 5, 1, 6, 3 );
}
}
DRIVER_INIT( svcchaos )
{
neogeo_fix_bank_type = 2;
svcchaos_cx_sx_decrypt();
init_neogeo();
}