ISO C90 forbids mixed declarations and code make.
I need to know if the DRIVER_INIT( samsho5 ) is out dated. Can you tell me how to fixs it? Thanks.
static void samsho5_vx_decrypt( void )
{
int i;
const unsigned char xor[ 0x08 ] = {
0xcb, 0x29, 0x7d, 0x43, 0xd2, 0x3a, 0xc2, 0xb4
};
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 ^= 0x0a000;
rom[ ofst ] = buf[ ((i + 0xfeb2c0) & 0xffffff) ] ^ xor[ (ofst & 0x07) ];
}
free( buf );
}
DRIVER_INIT( samsho5 )
{
samsho5_vx_decrypt();
int i;
/* conversion from FBA source by JMD */
unsigned char *src = memory_region(REGION_CPU1);
unsigned char* dst = (unsigned char*)malloc(0x800000);
int sec[] =
{
0x000000,0x080000,0x700000,0x680000,
0x500000,0x180000,0x200000,0x480000,
0x300000,0x780000,0x600000,0x280000,
0x100000,0x580000,0x400000,0x380000
};
if (dst)
{
memcpy(dst,src,0x800000);
for(i = 0; i < 16; ++i)
{
memcpy(src+i*0x80000,dst+sec[i],0x80000);
}
free(dst);
}
neogeo_fix_bank_type = 1;
kof2000_neogeo_gfx_decrypt(0x0f);
init_neogeo();
}
All the rest is right bellow.
ROM_START( samsho5 )
ROM_REGION( 0x800000, REGION_CPU1, 0 )
ROM_LOAD16_WORD_SWAP( "270-p1.bin", 0x000000, 0x400000, CRC(4a2a09e6) SHA1(2644de02cdab8ccc605488a7c76b8c9cd1d5bcb9) )
ROM_LOAD16_WORD_SWAP( "270-p2.bin", 0x400000, 0x400000, CRC(e0c74c85) SHA1(df24a4ee76438e40c2f04a714175a7f85cacdfe0) )
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) )
NEO_BIOS_SOUND_128K( "270-m1d.bin", CRC(18114fb1) SHA1(016dc2f328340f3637a9bff373a20973df29f6b8) )
ROM_REGION( 0x1000000, REGION_SOUND1, 0)
ROM_LOAD( "270-v1.bin", 0x000000, 0x800000, CRC(7541763a) SHA1(59ab05876ab508e36451ef2bedb29bd304894a33) )
ROM_LOAD( "270-v2.bin", 0x800000, 0x800000, CRC(4e6e7d98) SHA1(bde7568f60a65a9df74598d2463987bc9d93999c) )
NO_DELTAT_REGION
ROM_REGION( 0x4000000, REGION_GFX3, 0 )
ROM_LOAD16_BYTE( "270-c1.bin", 0x0000000, 0x800000, CRC(14ffffac) SHA1(2ccebfdd0c7907679ae95bf6eca85b8d322441e2) )
ROM_LOAD16_BYTE( "270-c2.bin", 0x0000001, 0x800000, CRC(401f7299) SHA1(94e48cdf1682b1250f53c59f3f71d995e928d17b) )
ROM_LOAD16_BYTE( "270-c3.bin", 0x1000000, 0x800000, CRC(1bff0d0e) SHA1(a6fcbed491dde02789063fbf061f7fcd66ce5617) )
ROM_LOAD16_BYTE( "270-c4.bin", 0x1000001, 0x800000, CRC(041560a5) SHA1(d165e533699f15b1e079c82f97db3542b3a7dd66) )
ROM_LOAD16_BYTE( "270-c5.bin", 0x2000000, 0x800000, CRC(bd30b52d) SHA1(9f8282e684415b4045218cf764ef7d75a70e3240) )
ROM_LOAD16_BYTE( "270-c6.bin", 0x2000001, 0x800000, CRC(86a69c70) SHA1(526732cdb408cf680af9da39057bce6a4dfb5e13) )
ROM_LOAD16_BYTE( "270-c7.bin", 0x3000000, 0x800000, CRC(d28fbc3c) SHA1(a82a6ba6760fad14d9309f9147cb7d80bd6f70fc) )
ROM_LOAD16_BYTE( "270-c8.bin", 0x3000001, 0x800000, CRC(02c530a6) SHA1(7a3fafa6075506c6ef78cc4ec2cb72118ec83cb9) )
ROM_END
machine/neogeo.c
if (!strcmp(Machine->gamedrv->name,"samsho5"))
{
/* conversion from FBA source by JMD */
/* Protection MVS */
UINT16 *mem16 = (UINT16 *)memory_region(REGION_CPU1);
mem16[0xEC98 >> 1] = 0x4E71;
mem16[0xEC9A >> 1] = 0x4E71;
/* Blood fix Arcade/Japan mode */
mem16[0xD4642 >> 1] = 0x4F30;
mem16[0xD4644 >> 1] = 0x6E20;
mem16[0xD4646 >> 1] = 0x0D20;
mem16[0xD4648 >> 1] = 0x6B10;
mem16[0xD464A >> 1] = 0x4A10;
mem16[0xD464C >> 1] = 0x2900;
mem16[0xD464E >> 1] = 0x4700;
/* Menu AES color fix */
mem16[0xE7EC2 >> 1] = 0x7CCC;
mem16[0xE7EC4 >> 1] = 0x1DC7;
mem16[0xE7ECA >> 1] = 0x2DB0;
mem16[0xE7ECE >> 1] = 0x4C90;
mem16[0xE7ED2 >> 1] = 0x4C60;
mem16[0xE7ED6 >> 1] = 0x6B30;
mem16[0xE7EE2 >> 1] = 0x7CCC;
mem16[0xE7EE4 >> 1] = 0x1BCE;
mem16[0xE7EEA >> 1] = 0x549D;
mem16[0xE7EEE >> 1] = 0x117D;
mem16[0xE7EF2 >> 1] = 0x204C;
mem16[0xE7EF6 >> 1] = 0x302C;
mem16[0xE7E02 >> 1] = 0x7CCC;
mem16[0xE7E04 >> 1] = 0x45B1;
mem16[0xE7E06 >> 1] = 0x14A0;
mem16[0xE7E08 >> 1] = 0x2290;
mem16[0xE7E0A >> 1] = 0x4390;
mem16[0xE7E0C >> 1] = 0x2280;
mem16[0xE7E0E >> 1] = 0x2170;
mem16[0xE7E12 >> 1] = 0x0060;
mem16[0xE7E16 >> 1] = 0x0050;
mem16[0xE7E18 >> 1] = 0x0040;
mem16[0xE7E1C >> 1] = 0x0020;
}
!strcmp(Machine->gamedrv->name,"samsho5") ||
I gotting the samsho5h though.