summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2019-09-05 18:03:30 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2019-09-05 18:03:30 +0200
commit62cfc07c60a9bc3c10f246c641f6c2261e25e5b2 (patch)
tree2bac57b82a0ed25683487614165051a2cf87e22c
parent7863ce2b0f39e755060f1b3d351a202dc6f543eb (diff)
clones promoted to working
---------------------------------------- Lady Liner (encrypted, set 4) [Team Europe, Roberto Fresca, Ivan Vangelista]
-rw-r--r--src/mame/drivers/goldstar.cpp77
-rw-r--r--src/mame/includes/goldstar.h1
2 files changed, 77 insertions, 1 deletions
diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp
index 2b2efb4bdb0..df0959cc7e3 100644
--- a/src/mame/drivers/goldstar.cpp
+++ b/src/mame/drivers/goldstar.cpp
@@ -16714,6 +16714,81 @@ void goldstar_state::init_ladylinrd()
}
+void goldstar_state::init_ladylinre()
+{
+ uint8_t *ROM = memregion("maincpu")->base();
+
+ uint8_t unkn = 0x00;
+
+ static const uint8_t xor_table_00[0x08][0x08] =
+ {
+ { 0x03, 0x03, 0x53, 0x13, 0x12, 0x10, 0x02, 0x02 }, // 0x0x and 0x2x
+ { 0x10, 0x02, 0x53, 0x53, unkn, 0x53, unkn, 0x50 }, // 0x1x and 0x3x
+ { 0x41, 0x13, 0x12, unkn, 0x12, 0x00, 0x40, 0x40 }, // 0x4x and 0x6x
+ { 0x03, 0x40, 0x40, 0x11, unkn, 0x42, 0x03, unkn }, // 0x5x and 0x7x
+ { 0x40, 0x11, 0x13, 0x11, unkn, 0x13, unkn, 0x10 }, // 0x8x and 0xax
+ { 0x41, unkn, 0x11, 0x11, 0x01, unkn, 0x42, 0x10 }, // 0x9x and 0xbx
+ { 0x03, 0x40, unkn, 0x01, unkn, 0x00, 0x02, unkn }, // 0xcx and 0xex
+ { unkn, 0x51, 0x13, 0x01, 0x12, 0x02, 0x03, 0x01 }, // 0xdx and 0xfx
+ };
+
+ static const uint8_t xor_table_01[0x08][0x08] =
+ {
+ { 0x51, 0x03, 0x40, 0x03, 0x53, 0x43, 0x42, 0x53 }, // 0x0x and 0x2x
+ { 0x02, 0x02, 0x41, 0x12, unkn, 0x11, 0x51, 0x02 }, // 0x1x and 0x3x
+ { 0x03, 0x11, 0x10, 0x03, 0x53, 0x00, 0x41, 0x42 }, // 0x4x and 0x6x
+ { 0x41, 0x10, 0x42, 0x50, 0x02, unkn, 0x40, 0x51 }, // 0x5x and 0x7x
+ { 0x10, 0x42, 0x11, 0x43, 0x52, unkn, unkn, unkn }, // 0x8x and 0xax
+ { 0x51, unkn, 0x40, 0x11, 0x40, unkn, 0x10, 0x40 }, // 0x9x and 0xbx
+ { 0x40, 0x40, unkn, 0x01, unkn, 0x00, unkn, 0x01 }, // 0xcx and 0xex
+ { 0x42, unkn, 0x02, 0x50, 0x43, 0x12, 0x03, 0x41 }, // 0xdx and 0xfx
+ };
+
+ static const uint8_t xor_table_02[0x08][0x08] =
+ {
+ { 0x40, 0x02, 0x10, 0x12, 0x02, 0x01, 0x42, 0x02 }, // 0x0x and 0x2x
+ { 0x03, 0x43, 0x13, 0x52, 0x02, 0x12, 0x50, 0x40 }, // 0x1x and 0x3x
+ { 0x13, 0x03, 0x13, unkn, unkn, 0x00, 0x53, 0x13 }, // 0x4x and 0x6x
+ { 0x50, 0x01, 0x42, 0x51, 0x13, 0x41, unkn, 0x02 }, // 0x5x and 0x7x
+ { unkn, unkn, 0x53, 0x12, unkn, 0x53, 0x01, unkn }, // 0x8x and 0xax
+ { 0x42, 0x03, 0x51, 0x51, 0x03, unkn, 0x43, 0x51 }, // 0x9x and 0xbx
+ { unkn, 0x41, 0x52, 0x03, 0x13, 0x00, unkn, unkn }, // 0xcx and 0xex
+ { unkn, 0x52, 0x13, unkn, 0x52, 0x11, unkn, 0x41 }, // 0xdx and 0xfx
+ };
+
+ static const uint8_t xor_table_03[0x08][0x08] =
+ {
+ { 0x53, 0x43, 0x01, 0x02, 0x43, 0x53, 0x51, 0x52 }, // 0x0x and 0x2x
+ { 0x42, 0x11, 0x03, 0x42, 0x02, 0x53, 0x42, 0x02 }, // 0x1x and 0x3x
+ { 0x03, 0x43, 0x51, 0x51, 0x50, 0x00, 0x02, 0x50 }, // 0x4x and 0x6x
+ { 0x11, 0x41, 0x12, 0x03, 0x51, 0x51, 0x51, 0x51 }, // 0x5x and 0x7x
+ { unkn, 0x41, 0x03, 0x12, 0x40, 0x53, unkn, unkn }, // 0x8x and 0xax
+ { 0x02, 0x52, 0x01, 0x41, unkn, 0x11, unkn, 0x40 }, // 0x9x and 0xbx
+ { 0x02, 0x51, 0x42, 0x02, 0x43, 0x00, unkn, unkn }, // 0xcx and 0xex
+ { unkn, 0x52, 0x03, unkn, 0x01, 0x43, unkn, 0x40 }, // 0xdx and 0xfx
+ };
+
+ for (int i = 0; i < 0x8000; i++)
+ {
+ uint8_t x = ROM[i];
+
+ uint8_t row = (BIT(x, 4) + (BIT(x, 6) << 1) + (BIT(x, 7) << 2));
+
+ uint8_t xor_v = x & 0x07;
+
+ switch(i & 0x03)
+ {
+ case 0x00: x ^= xor_table_00[row][xor_v]; break;
+ case 0x01: x ^= xor_table_01[row][xor_v]; break;
+ case 0x02: x ^= xor_table_02[row][xor_v]; break;
+ case 0x03: x ^= xor_table_03[row][xor_v]; break;
+ }
+
+ m_decrypted_opcodes[i] = x;
+ }
+}
+
+
// this block swapping is the same for chry10, chrygld and cb3
// the underlying bitswaps / xors are different however
void cb3_state::do_blockswaps(uint8_t* ROM)
@@ -17716,7 +17791,7 @@ GAME( 198?, ladylinra, ladylinr, ladylinr, ladylinr, goldstar_state, empty_init
GAME( 198?, ladylinrb, ladylinr, ladylinrb,ladylinr, goldstar_state, init_ladylinrb, ROT0, "TAB Austria", "Lady Liner (encrypted, set 1)", 0 )
GAME( 198?, ladylinrc, ladylinr, ladylinrb,ladylinr, goldstar_state, init_ladylinrc, ROT0, "TAB Austria", "Lady Liner (encrypted, set 2)", 0 )
GAME( 198?, ladylinrd, ladylinr, ladylinrb,ladylinr, goldstar_state, init_ladylinrd, ROT0, "TAB Austria", "Lady Liner (encrypted, set 3)", 0 )
-GAME( 198?, ladylinre, ladylinr, ladylinrb,ladylinr, goldstar_state, empty_init, ROT0, "TAB Austria", "Lady Liner (encrypted, set 4)", MACHINE_NOT_WORKING ) // same encryption as ladylinrb with different xor values
+GAME( 198?, ladylinre, ladylinr, ladylinrb,ladylinr, goldstar_state, init_ladylinre, ROT0, "TAB Austria", "Lady Liner (encrypted, set 4)", 0 )
GAME( 198?, wcat3, 0, wcat3, lucky8, wingco_state, empty_init, ROT0, "E.A.I.", "Wild Cat 3", MACHINE_NOT_WORKING )
GAME( 1985, luckylad, 0, lucky8, luckylad, wingco_state, init_luckylad, ROT0, "Wing Co., Ltd.", "Lucky Lady (Wing, encrypted)", MACHINE_NOT_WORKING ) // encrypted (see notes in rom_load)...
diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h
index 07127713b8f..507a5cd1c87 100644
--- a/src/mame/includes/goldstar.h
+++ b/src/mame/includes/goldstar.h
@@ -58,6 +58,7 @@ public:
void init_ladylinrb();
void init_ladylinrc();
void init_ladylinrd();
+ void init_ladylinre();
DECLARE_VIDEO_START(goldstar);
void cm_palette(palette_device &palette) const;
DECLARE_VIDEO_START(cherrym);