summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2018-10-25 18:10:50 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2018-10-25 18:10:50 +0200
commitc9a3b21a9912f4cd3e3beac7a2ca43727fd08ddb (patch)
tree142dcdf6bd82afdb8c270eaafe962d46ade8e088
parentd29cc63ca0af77d75058885567b1d6161cf9a515 (diff)
snesb.cpp: decrypted rushbeat [iq_132]
still needs emulation (nw)
-rw-r--r--src/mame/drivers/snesb.cpp58
1 files changed, 56 insertions, 2 deletions
diff --git a/src/mame/drivers/snesb.cpp b/src/mame/drivers/snesb.cpp
index f24de19381c..f656cc8d8ee 100644
--- a/src/mame/drivers/snesb.cpp
+++ b/src/mame/drivers/snesb.cpp
@@ -1052,7 +1052,61 @@ void snesb_state::init_endless()
void snesb_state::init_rushbeat()
{
- //TODO: decryption
+ uint8_t *src = memregion("user7")->base();
+ uint8_t *dst = memregion("user3")->base();
+
+ static const uint8_t address_tab_high[32] = {
+ 0x0b, 0x1d, 0x05, 0x15, 0x09, 0x19, 0x04, 0x13, 0x02, 0x1f, 0x07, 0x17, 0x0d, 0x11, 0x0a, 0x1a,
+ 0x14, 0x0e, 0x18, 0x06, 0x1e, 0x01, 0x10, 0x0c, 0x1b, 0x0f, 0x16, 0x00, 0x12, 0x08, 0x1c, 0x03
+ };
+
+ static const uint8_t address_tab_low[64] = {
+ 0x14, 0x1d, 0x11, 0x3c, 0x0a, 0x29, 0x2d, 0x2e, 0x30, 0x32, 0x16, 0x36, 0x05, 0x25, 0x26, 0x37,
+ 0x20, 0x21, 0x27, 0x28, 0x33, 0x34, 0x23, 0x12, 0x1e, 0x1f, 0x3b, 0x24, 0x2c, 0x35, 0x38, 0x39,
+ 0x3d, 0x0c, 0x2a, 0x0d, 0x22, 0x18, 0x19, 0x1a, 0x03, 0x08, 0x04, 0x3a, 0x0b, 0x0f, 0x15, 0x17,
+ 0x1b, 0x13, 0x00, 0x1c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 0x65, 0x24, 0x64, 0x6d, 0x2d, 0x25, 0x4d, 0x04, 0x0c, 0x4c, 0x45, 0x6c, 0x0d, 0x44,
+ 0x2e, 0x07, 0x67, 0x26, 0x66, 0x6f, 0x2f, 0x27, 0x4f, 0x06, 0x0e, 0x4e, 0x47, 0x6e, 0x0f, 0x46,
+ 0x3a, 0x13, 0x73, 0x32, 0x72, 0x7b, 0x3b, 0x33, 0x5b, 0x12, 0x1a, 0x5a, 0x53, 0x7a, 0x1b, 0x52,
+ 0xae, 0x87, 0xe7, 0xa6, 0xe6, 0xef, 0xaf, 0xa7, 0xcf, 0x86, 0x8e, 0xce, 0xc7, 0xee, 0x8f, 0xc6,
+ 0x3c, 0x15, 0x75, 0x34, 0x74, 0x7d, 0x3d, 0x35, 0x5d, 0x14, 0x1c, 0x5c, 0x55, 0x7c, 0x1d, 0x54,
+ 0x2a, 0x03, 0x63, 0x22, 0x62, 0x6b, 0x2b, 0x23, 0x4b, 0x02, 0x0a, 0x4a, 0x43, 0x6a, 0x0b, 0x42
+ };
+
+ for (int i = 0; i < 0x200000; i++) {
+ int j = (address_tab_high[(i >> 15) & 0x1f] << 15) + (i & 0x107fc0) + address_tab_low[i & 0x3f];
+
+ dst[i] = data_table[src[j]];
+
+ if (i >= 0x00000 && i < 0x10000) {
+ dst[i] = bitswap<8>(dst[i], 0, 7, 6, 3, 5, 4, 1, 2) ^ 0xff;
+ }
+
+ if (i >= 0x10000 && i < 0x20000) {
+ dst[i] = bitswap<8>(dst[i], 2, 1, 3, 7, 6, 5, 4, 0) ^ 0xff;
+ }
+
+ if (i >= 0x20000 && i < 0x30000) {
+ dst[i] = bitswap<8>(dst[i], 4, 6, 0, 2, 7, 3, 5, 1);
+ }
+
+ if (i >= 0x30000 && i < 0x40000) {
+ dst[i] = bitswap<8>(dst[i], 5, 4, 7, 1, 0, 6, 2, 3) ^ 0xff;
+ }
+ }
init_snes();
}
@@ -1255,4 +1309,4 @@ GAME( 1996, denseib, 0, kinstb, denseib, snesb_state, init_den
GAME( 1997, sblast2b, 0, kinstb, sblast2b, snesb_state, init_sblast2b, ROT0, "bootleg", "Sonic Blast Man 2 Special Turbo (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS)
GAME( 1996, endless, 0, kinstb, endless, snesb_state, init_endless, ROT0, "bootleg", "Gundam Wing: Endless Duel (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1996, legendsb, 0, kinstb, kinstb, snesb_state, init_legendsb, ROT0, "bootleg", "Legend (SNES bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 199?, rushbeat, 0, kinstb, kinstb, snesb_state, init_rushbeat, ROT0, "bootleg", "Rushing Beat (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Encrypted
+GAME( 1997, rushbeat, 0, kinstb, kinstb, snesb_state, init_rushbeat, ROT0, "bootleg", "Rushing Beat (SNES bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )