6
6
7
7
The 156 Chip is used on the following games:
8
8
9
- deco_mlc.c
9
+ dataeast/ deco_mlc.cpp
10
10
11
- Stadium Hero 96 (stadhr96, stadh96a)
12
- Skull Fang (skullfng)
13
- Dunk Dream '95 / Hoops '96 (ddream95, hoops96)
11
+ Stadium Hero 96 (stadhr96*)
12
+ Skull Fang (skullfng*)
13
+ Dunk Dream '95 / Hoops / Hoops '96 (ddream95, hoops95, hoops96)
14
+ Janken Game Acchi Muite Hoi! (acchi)
14
15
15
- deco32.c
16
+ dataeast/ deco32.cpp
16
17
17
- Night Slashers (nslasher, nslashej )
18
+ Night Slashers (nslasher* )
18
19
19
- simpl156
20
+ dataeast/ simpl156.cpp
20
21
21
22
Charlie Ninja (charlien)
22
- Magical Drop / Magical Drop Plus / Chain Reaction (magdrop, magdropp, chainrec)
23
- Joe & Mac Returns (joemacr, joemacra )
23
+ Magical Drop / Magical Drop Plus 1 / Chain Reaction (magdrop, magdropp, chainrec)
24
+ Joe & Mac Returns (joemacr* )
24
25
Party Time / Ganbare! Gonta!! 2 (prtytime, gangonta)
26
+ Osman / Cannon Dancer (osman, candance)
25
27
26
- deco156.c
28
+ dataeast/ deco156.cpp
27
29
28
- Osman (osman)
29
- Heavy Smash (hvysmsh)
30
- World Cup Volly '95 (wcvol95)
31
- Backfire!! (backfire, backfira)
30
+ Heavy Smash (hvysmsh*)
31
+ World Cup Volley '95 (wcvol95*)
32
+
33
+ dataeast/backfire.cpp
34
+
35
+ Backfire! (backfire*)
32
36
33
37
*/
34
38
38
42
39
43
static void decrypt (uint32_t *src, uint32_t *dst, int length)
40
44
{
41
- int a;
42
-
43
- for (a = 0 ; a < length/4 ; a++)
45
+ for (int a = 0 ; a < length / 4 ; a++)
44
46
{
45
- int addr, dword;
46
-
47
- addr = (a & 0xff0000 ) | 0x92c6 ;
47
+ int addr = (a & 0xff0000 ) | 0x92c6 ;
48
48
49
49
if (a & 0x0001 ) addr ^= 0xce4a ;
50
50
if (a & 0x0002 ) addr ^= 0x4db2 ;
@@ -63,7 +63,7 @@ static void decrypt(uint32_t *src, uint32_t *dst, int length)
63
63
if (a & 0x4000 ) addr ^= 0x1eef ;
64
64
if (a & 0x8000 ) addr ^= 0xf5a5 ;
65
65
66
- dword = src[addr];
66
+ uint32_t dword = src[addr];
67
67
68
68
// note that each of the following lines affects exactly two bits
69
69
@@ -87,35 +87,35 @@ static void decrypt(uint32_t *src, uint32_t *dst, int length)
87
87
switch (a & 3 )
88
88
{
89
89
case 0 :
90
- dword = bitswap<32 >( dword ^ 0xec63197a ,
91
- 1 , 4 , 7 , 28 , 22 , 18 , 20 , 9 ,
90
+ dword = bitswap<32 >(dword ^ 0xec63197a ,
91
+ 1 , 4 , 7 , 28 , 22 , 18 , 20 , 9 ,
92
92
16 , 10 , 30 , 2 , 31 , 24 , 19 , 29 ,
93
- 6 , 21 , 23 , 11 , 12 , 13 , 5 , 0 ,
94
- 8 , 26 , 27 , 15 , 14 , 17 , 25 , 3 );
93
+ 6 , 21 , 23 , 11 , 12 , 13 , 5 , 0 ,
94
+ 8 , 26 , 27 , 15 , 14 , 17 , 25 , 3 );
95
95
break ;
96
96
97
97
case 1 :
98
- dword = bitswap<32 >( dword ^ 0x58a5a55f ,
98
+ dword = bitswap<32 >(dword ^ 0x58a5a55f ,
99
99
14 , 23 , 28 , 29 , 6 , 24 , 10 , 1 ,
100
- 5 , 16 , 7 , 2 , 30 , 8 , 18 , 3 ,
100
+ 5 , 16 , 7 , 2 , 30 , 8 , 18 , 3 ,
101
101
31 , 22 , 25 , 20 , 17 , 0 , 19 , 27 ,
102
- 9 , 12 , 21 , 15 , 26 , 13 , 4 , 11 );
102
+ 9 , 12 , 21 , 15 , 26 , 13 , 4 , 11 );
103
103
break ;
104
104
105
105
case 2 :
106
- dword = bitswap<32 >( dword ^ 0xe3a65f16 ,
106
+ dword = bitswap<32 >(dword ^ 0xe3a65f16 ,
107
107
19 , 30 , 21 , 4 , 2 , 18 , 15 , 1 ,
108
108
12 , 25 , 8 , 0 , 24 , 20 , 17 , 23 ,
109
109
22 , 26 , 28 , 16 , 9 , 27 , 6 , 11 ,
110
- 31 , 10 , 3 , 13 , 14 , 7 , 29 , 5 );
110
+ 31 , 10 , 3 , 13 , 14 , 7 , 29 , 5 );
111
111
break ;
112
112
113
113
case 3 :
114
- dword = bitswap<32 >( dword ^ 0x28d93783 ,
114
+ dword = bitswap<32 >(dword ^ 0x28d93783 ,
115
115
30 , 6 , 15 , 0 , 31 , 18 , 26 , 22 ,
116
116
14 , 23 , 19 , 17 , 10 , 8 , 11 , 20 ,
117
- 1 , 28 , 2 , 4 , 9 , 24 , 25 , 27 ,
118
- 7 , 21 , 13 , 29 , 5 , 3 , 16 , 12 );
117
+ 1 , 28 , 2 , 4 , 9 , 24 , 25 , 27 ,
118
+ 7 , 21 , 13 , 29 , 5 , 3 , 16 , 12 );
119
119
break ;
120
120
}
121
121
@@ -127,8 +127,8 @@ static void decrypt(uint32_t *src, uint32_t *dst, int length)
127
127
void deco156_decrypt (running_machine &machine)
128
128
{
129
129
uint32_t *rom = (uint32_t *)machine.root_device ().memregion (" maincpu" )->base ();
130
- int length = machine.root_device ().memregion (" maincpu" )->bytes ();
131
- std::vector<uint32_t > buf (length/ 4 );
130
+ int const length = machine.root_device ().memregion (" maincpu" )->bytes ();
131
+ std::vector<uint32_t > buf (length / 4 );
132
132
133
133
memcpy (&buf[0 ], rom, length);
134
134
decrypt (&buf[0 ], rom, length);
0 commit comments