summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-06-22 18:06:15 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2015-06-22 18:06:15 +0200
commit946156afbb27bc517dcd662f48fb0b0fef141e8e (patch)
tree4b08e67f473e03110f477095b528e9f7520634eb /src
parentc5c718beb8b41ade55349a6da7f7412b0e1bb99b (diff)
fix separate compile (nw)
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/acesp.c22
-rw-r--r--src/mame/drivers/mpu4hw.c2
2 files changed, 20 insertions, 4 deletions
diff --git a/src/mame/drivers/acesp.c b/src/mame/drivers/acesp.c
index 55762c4e582..aa052919ad1 100644
--- a/src/mame/drivers/acesp.c
+++ b/src/mame/drivers/acesp.c
@@ -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);
diff --git a/src/mame/drivers/mpu4hw.c b/src/mame/drivers/mpu4hw.c
index 33efa218e90..50a7d20ce98 100644
--- a/src/mame/drivers/mpu4hw.c
+++ b/src/mame/drivers/mpu4hw.c
@@ -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++)
{