fix separate compile (nw)

This commit is contained in:
Miodrag Milanovic 2015-06-22 18:06:15 +02:00
parent c5c718beb8
commit 946156afbb
2 changed files with 20 additions and 4 deletions

View File

@ -3848,9 +3848,25 @@ ROM_START( sp_cpal )
SP_CPAL_SOUND
ROM_END
// mpu4.c
extern void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor);
static void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor)
{
for (int i=start;i<end;i++)
{
UINT8 x = region[i];
switch (i & 0x58)
{
case 0x00: // same as 0x08
case 0x08: x = BITSWAP8( x^0xca , 3,2,1,0,7,4,6,5 ); break;
case 0x10: x = BITSWAP8( x^0x30 , 3,0,4,6,1,5,7,2 ); break;
case 0x18: x = BITSWAP8( x^0x89 , 4,1,2,5,7,0,6,3 ); break;
case 0x40: x = BITSWAP8( x^0x14 , 6,1,4,3,2,5,0,7 ); break;
case 0x48: x = BITSWAP8( x^0x40 , 1,0,3,2,5,4,7,6 ); break;
case 0x50: x = BITSWAP8( x^0xcb , 3,2,1,0,7,6,5,4 ); break;
case 0x58: x = BITSWAP8( x^0xc0 , 2,3,6,0,5,1,7,4 ); break;
}
region[i] = x ^ extra_xor;
}
}
DRIVER_INIT_MEMBER(ace_sp_state,ace_cr)
{
descramble_crystal(memregion( "maincpu" )->base(), 0x0000, 0x10000, 0x00);

View File

@ -2394,7 +2394,7 @@ DRIVER_INIT_MEMBER(mpu4_state,m_frkstn)
}
// thanks to Project Amber for descramble information
void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor)
static void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor)
{
for (int i=start;i<end;i++)
{