Skip to content

Commit 4832f65

Browse files
authored
dataeast/deco156_m.cpp: Updated comments and cleaned up code a little. (#13240)
* Updated source file names and system names in comments. * Reduced variable scope, made some variables const, fixed tabulation.
1 parent 02ee19d commit 4832f65

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

src/mame/dataeast/deco156_m.cpp

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,33 @@
66
77
The 156 Chip is used on the following games:
88
9-
deco_mlc.c
9+
dataeast/deco_mlc.cpp
1010
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)
1415
15-
deco32.c
16+
dataeast/deco32.cpp
1617
17-
Night Slashers (nslasher, nslashej)
18+
Night Slashers (nslasher*)
1819
19-
simpl156
20+
dataeast/simpl156.cpp
2021
2122
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*)
2425
Party Time / Ganbare! Gonta!! 2 (prtytime, gangonta)
26+
Osman / Cannon Dancer (osman, candance)
2527
26-
deco156.c
28+
dataeast/deco156.cpp
2729
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*)
3236
3337
*/
3438

@@ -38,13 +42,9 @@
3842

3943
static void decrypt(uint32_t *src, uint32_t *dst, int length)
4044
{
41-
int a;
42-
43-
for (a = 0; a < length/4; a++)
45+
for (int a = 0; a < length / 4; a++)
4446
{
45-
int addr, dword;
46-
47-
addr = (a & 0xff0000) | 0x92c6;
47+
int addr = (a & 0xff0000) | 0x92c6;
4848

4949
if (a & 0x0001) addr ^= 0xce4a;
5050
if (a & 0x0002) addr ^= 0x4db2;
@@ -63,7 +63,7 @@ static void decrypt(uint32_t *src, uint32_t *dst, int length)
6363
if (a & 0x4000) addr ^= 0x1eef;
6464
if (a & 0x8000) addr ^= 0xf5a5;
6565

66-
dword = src[addr];
66+
uint32_t dword = src[addr];
6767

6868
// note that each of the following lines affects exactly two bits
6969

@@ -87,35 +87,35 @@ static void decrypt(uint32_t *src, uint32_t *dst, int length)
8787
switch (a & 3)
8888
{
8989
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,
9292
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);
9595
break;
9696

9797
case 1:
98-
dword = bitswap<32>( dword ^ 0x58a5a55f,
98+
dword = bitswap<32>(dword ^ 0x58a5a55f,
9999
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,
101101
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);
103103
break;
104104

105105
case 2:
106-
dword = bitswap<32>( dword ^ 0xe3a65f16,
106+
dword = bitswap<32>(dword ^ 0xe3a65f16,
107107
19, 30, 21, 4, 2, 18, 15, 1,
108108
12, 25, 8, 0, 24, 20, 17, 23,
109109
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);
111111
break;
112112

113113
case 3:
114-
dword = bitswap<32>( dword ^ 0x28d93783,
114+
dword = bitswap<32>(dword ^ 0x28d93783,
115115
30, 6, 15, 0, 31, 18, 26, 22,
116116
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);
119119
break;
120120
}
121121

@@ -127,8 +127,8 @@ static void decrypt(uint32_t *src, uint32_t *dst, int length)
127127
void deco156_decrypt(running_machine &machine)
128128
{
129129
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);
132132

133133
memcpy(&buf[0], rom, length);
134134
decrypt(&buf[0], rom, length);

0 commit comments

Comments
 (0)