Oopsie. Forgot to pass "machine" to the function
static void extract_neogeo_fix_data(running_machine *machine)
{
int i;
int tx_size = machine->region("fixed")->bytes();
int rom_size = machine->region("sprites")->bytes();
UINT8 *src = machine->region( "sprites" )->base()+rom_size-tx_size;
UINT8 *dst = machine->region( "fixed" )->base();
for (i = 0;i < tx_size;i++)
dst[i] = src[(i & ~0x1f) + ((i & 7) << 2) + ((~i & 8) >> 2) + ((i & 0x10) >> 4)];
}
static DRIVER_INIT( rotdnd )
{
neogeo_state *state = machine->driver_data<neogeo_state>();
state->fixed_layer_bank_type = 1;
extract_neogeo_fix_data(machine);
DRIVER_INIT_CALL(neogeo);
}
static DRIVER_INIT( mslug5nd )
{
extract_neogeo_fix_data(machine);
DRIVER_INIT_CALL(neogeo);
}
static DRIVER_INIT( svcplusb )
{
neogeo_state *state = machine->driver_data<neogeo_state>();
int i;
/* Descrambling 512k S1 */
unsigned int sec2[]={0x60000,0x40000,0x20000,0x00000};
UINT8 *srom = machine->region( "fixed" )->base();
UINT8 *dst2 = auto_alloc_array(machine, UINT8, 0x80000 );
if (dst2)
{
memcpy( dst2, srom, 0x80000 );
for ( i=0; i<4; ++i )
{
memcpy( srom+i*0x20000, dst2+sec2[i], 0x20000 );
}
}
free(dst2);
DRIVER_INIT_CALL(neogeo);
state->fixed_layer_bank_type = 2;
}
static DRIVER_INIT( kof2k3br )
{
neogeo_state *state = machine->driver_data<neogeo_state>();
state->fixed_layer_bank_type = 2;
extract_neogeo_fix_data(machine);
DRIVER_INIT_CALL(neogeo);
}
static DRIVER_INIT( kof10thu )
{
UINT8 *rom = machine->region( "maincpu" )->base();
UINT8 *pTemp = auto_alloc_array(machine, UINT8, 0x800000 );
int nBank[] = { 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x07, };
int i, ofst;
for( i = 0; i < 0x800000 / 0x100000; i++ ) {
memcpy( &pTemp[ i * 0x100000 ], &rom[ nBank[ i ] * 0x100000 ], 0x100000 );
}
for( i = 0; i < 0x800000 / 2; i++ ){
ofst = BITSWAP8( (i & 0x0000ff), 7, 6, 2, 3, 4, 5, 0, 1 );
ofst += (i & 0xffff00);
memcpy( &rom[ ofst * 2 ], &pTemp[ i * 2 ], 0x02 );
}
free( pTemp );
svcsplus_sx_decrypt(machine);
DRIVER_INIT_CALL(neogeo);
}
static DRIVER_INIT( kof2knd )
{
extract_neogeo_fix_data(machine);
DRIVER_INIT_CALL(neogeo);
}
static DRIVER_INIT( kof96rm )
{
// Change CLR.W to CLR.B. Is this a bug in the 68k
// emulation of MAME or that of every other emulator?
machine->region( "maincpu" )->base()[0x8CE4] = 0x2d;
DRIVER_INIT_CALL(neogeo);
}
DRIVER_INIT( ms5boot )
{
//neogeo_bootleg_text_decrypt(machine, 1); // ????
DRIVER_INIT_CALL(neogeo);
ms5boot_install_protection(machine);
}
void samsh5bl_cx_decrypt( running_machine *machine )
{
int cx_size = machine->region( "sprites" )->bytes();
UINT8 *rom = machine->region( "sprites" )->base();
UINT8 *buf = auto_alloc_array(machine, UINT8, cx_size );
int i;
memcpy( buf, rom, cx_size );
for( i = 0; i < cx_size / 0x40; i++ ) {
memcpy( &rom[ i * 0x40 ], &buf[ (i ^ 1) * 0x40 ], 0x40 );
}
auto_free( machine, buf );
}
void svcsplus_sx_decrypt( running_machine *machine )
{
int i;
UINT8 *rom = machine->region( "fixed" )->base();
for( i = 0; i < 0x20000; i++)
rom[i] = BITSWAP8(rom[i], 7, 6, 0, 4, 3, 2, 1, 5);
}