From 2fc3b81502b882c0d1c5d0ffbaab161d451b0e39 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 4 Sep 2019 07:19:08 +0200 Subject: clones promoted to working ----------------------------------------------- Lady Liner (encrypted, set 3) [Team Europe, Roberto Fresca, Ivan Vangelista] --- src/mame/drivers/goldstar.cpp | 91 +++++++++++++++++++++++++++++++++++++++---- src/mame/includes/goldstar.h | 1 + 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp index 18e57a043d8..2b2efb4bdb0 100644 --- a/src/mame/drivers/goldstar.cpp +++ b/src/mame/drivers/goldstar.cpp @@ -16511,7 +16511,7 @@ void goldstar_state::init_ladylinrb() { { 0x10, 0x01, unkn, 0x75, 0x01, 0x11, 0x41, 0x11 }, // 0x0x and 0x2x { 0x43, 0x53, 0x42, 0x12, unkn, 0x40, 0x50, 0x40 }, // 0x1x and 0x3x - { 0x51, 0x52, 0x13, 0x51, 0x10, unkn, 0x51, 0x41 }, // 0x4x and 0x6x + { 0x51, 0x52, 0x13, 0x51, 0x10, 0x00, 0x51, 0x41 }, // 0x4x and 0x6x { 0x52, 0x03, 0x12, 0x50, 0x41, 0x51, 0x51, 0x01 }, // 0x5x and 0x7x { 0x50, 0x43, 0x43, 0x02, 0x02, 0x43, 0x50, 0x10 }, // 0x8x and 0xax { 0x42, 0x01, 0x43, unkn, 0x13, 0x03, unkn, 0x42 }, // 0x9x and 0xbx @@ -16523,7 +16523,7 @@ void goldstar_state::init_ladylinrb() { { 0x12, 0x11, 0x42, 0x51, 0x03, 0x52, 0x53, 0x41 }, // 0x0x and 0x2x { 0x53, 0x41, 0x11, 0x52, 0x01, 0x03, 0x13, 0x11 }, // 0x1x and 0x3x - { 0x13, 0x41, 0x53, 0x01, unkn, unkn, 0x10, 0x50 }, // 0x4x and 0x6x + { 0x13, 0x41, 0x53, 0x01, unkn, 0x00, 0x10, 0x50 }, // 0x4x and 0x6x { 0x51, 0x53, 0x41, 0x02, 0x40, 0x01, 0x52, 0x10 }, // 0x5x and 0x7x { 0x10, 0x50, unkn, 0x03, 0x03, unkn, unkn, 0x10 }, // 0x8x and 0xax { 0x01, 0x53, 0x13, 0x10, 0x42, 0x03, 0x52, unkn }, // 0x9x and 0xbx @@ -16535,7 +16535,7 @@ void goldstar_state::init_ladylinrb() { { 0x13, 0x02, 0x40, 0x52, 0x03, 0x53, 0x51, unkn }, // 0x0x and 0x2x { 0x12, unkn, 0x12, 0x01, 0x02, 0x41, 0x50, 0x03 }, // 0x1x and 0x3x - { 0x01, 0x11, 0x01, 0x03, 0x40, unkn, 0x02, unkn }, // 0x4x and 0x6x + { 0x01, 0x11, 0x01, 0x03, 0x40, 0x00, 0x02, unkn }, // 0x4x and 0x6x { 0x51, 0x03, 0x01, 0x43, 0x52, 0x50, 0x03, 0x42 }, // 0x5x and 0x7x { unkn, 0x40, 0x13, 0x13, unkn, unkn, 0x40, 0x01 }, // 0x8x and 0xax { 0x13, 0x41, 0x52, 0x12, unkn, 0x43, 0x41, unkn }, // 0x9x and 0xbx @@ -16547,7 +16547,7 @@ void goldstar_state::init_ladylinrb() { { 0x50, 0x13, 0x41, 0x42, 0x11, 0x53, 0x10, 0x41 }, // 0x0x and 0x2x { 0x42, unkn, 0x41, 0x51, 0x12, 0x40, 0x51, 0x40 }, // 0x1x and 0x3x - { 0x50, 0x52, 0x40, 0x12, 0x50, unkn, 0x02, 0x50 }, // 0x4x and 0x6x + { 0x50, 0x52, 0x40, 0x12, 0x50, 0x00, 0x02, 0x50 }, // 0x4x and 0x6x { 0x10, 0x51, 0x53, 0x50, 0x53, 0x01, 0x53, 0x53 }, // 0x5x and 0x7x { unkn, unkn, 0x01, 0x13, unkn, unkn, unkn, unkn }, // 0x8x and 0xax { unkn, 0x10, 0x40, 0x52, 0x13, 0x43, 0x41, unkn }, // 0x9x and 0xbx @@ -16586,7 +16586,7 @@ void goldstar_state::init_ladylinrc() { { 0x00, 0x40, 0x40, 0x10, 0x02, 0x10, 0x10, 0x51 }, // 0x0x and 0x2x { 0x02, 0x40, 0x11, 0x41, 0x13, 0x02, unkn, 0x40 }, // 0x1x and 0x3x - { 0x51, unkn, 0x11, 0x03, 0x40, unkn, unkn, unkn }, // 0x4x and 0x6x + { 0x51, unkn, 0x11, 0x03, 0x40, 0x00, unkn, unkn }, // 0x4x and 0x6x { 0x51, 0x53, 0x02, 0x43, unkn, unkn, 0x53, 0x43 }, // 0x5x and 0x7x { unkn, 0x40, 0x03, 0x03, 0x02, 0x02, 0x51, 0x11 }, // 0x8x and 0xax { 0x12, 0x43, unkn, 0x42, 0x41, unkn, 0x01, unkn }, // 0x9x and 0xbx @@ -16598,7 +16598,7 @@ void goldstar_state::init_ladylinrc() { { 0x02, 0x42, 0x53, 0x51, 0x50, 0x53, 0x53, 0x41 }, // 0x0x and 0x2x { 0x13, 0x01, unkn, 0x53, 0x53, 0x42, 0x52, 0x13 }, // 0x1x and 0x3x - { 0x51, 0x52, 0x03, 0x01, 0x41, unkn, 0x40, 0x40 }, // 0x4x and 0x6x + { 0x51, 0x52, 0x03, 0x01, 0x41, 0x00, 0x40, 0x40 }, // 0x4x and 0x6x { unkn, 0x50, 0x01, 0x53, 0x42, 0x41, 0x43, 0x40 }, // 0x5x and 0x7x { 0x40, 0x11, 0x13, 0x01, 0x03, 0x13, 0x40, 0x52 }, // 0x8x and 0xax { 0x02, 0x50, 0x11, 0x51, 0x12, 0x11, unkn, unkn }, // 0x9x and 0xbx @@ -16610,7 +16610,7 @@ void goldstar_state::init_ladylinrc() { { 0x52, 0x13, 0x43, 0x41, 0x42, 0x13, 0x02, unkn }, // 0x0x and 0x2x { 0x43, 0x52, 0x12, 0x11, 0x50, 0x10, 0x10, 0x41 }, // 0x1x and 0x3x - { 0x50, 0x42, 0x12, 0x12, 0x11, unkn, 0x01, 0x53 }, // 0x4x and 0x6x + { 0x50, 0x42, 0x12, 0x12, 0x11, 0x00, 0x01, 0x53 }, // 0x4x and 0x6x { 0x43, 0x50, 0x43, 0x13, unkn, 0x52, 0x01, 0x42 }, // 0x5x and 0x7x { 0x01, 0x02, unkn, 0x12, unkn, 0x43, unkn, 0x51 }, // 0x8x and 0xax { 0x50, 0x52, 0x42, 0x13, 0x03, 0x51, unkn, unkn }, // 0x9x and 0xbx @@ -16639,6 +16639,81 @@ void goldstar_state::init_ladylinrc() } +void goldstar_state::init_ladylinrd() +{ + uint8_t *ROM = memregion("maincpu")->base(); + + uint8_t unkn = 0x00; + + static const uint8_t xor_table_00[0x08][0x08] = + { + { 0x41, 0x11, 0x42, unkn, 0x52, 0x10, unkn, unkn }, // 0x0x and 0x2x + { 0x13, 0x02, unkn, 0x11, 0x43, 0x41, 0x51, 0x12 }, // 0x1x and 0x3x + { 0x10, 0x13, 0x42, 0x42, 0x53, 0x00, 0x50, 0x41 }, // 0x4x and 0x6x + { 0x01, 0x40, 0x01, 0x11, 0x50, 0x41, 0x10, 0x02 }, // 0x5x and 0x7x + { 0x12, 0x11, 0x53, unkn, unkn, 0x13, 0x52, 0x12 }, // 0x8x and 0xax + { 0x12, 0x52, 0x13, unkn, unkn, 0x53, 0x11, 0x42 }, // 0x9x and 0xbx + { 0x01, 0x01, 0x12, unkn, 0x13, 0x00, 0x02, 0x41 }, // 0xcx and 0xex + { 0x41, 0x03, 0x52, 0x11, 0x02, unkn, 0x41, unkn }, // 0xdx and 0xfx + }; + + static const uint8_t xor_table_01[0x08][0x08] = + { + { 0x53, 0x43, 0x02, 0x43, 0x12, 0x50, 0x12, 0x03 }, // 0x0x and 0x2x + { unkn, 0x02, 0x11, 0x43, 0x43, 0x53, 0x03, 0x43 }, // 0x1x and 0x3x + { 0x03, unkn, 0x10, 0x42, 0x12, 0x00, 0x40, 0x40 }, // 0x4x and 0x6x + { 0x42, 0x53, 0x43, 0x02, 0x51, 0x42, 0x11, 0x13 }, // 0x5x and 0x7x + { 0x43, 0x02, 0x13, 0x03, 0x02, 0x50, 0x52, 0x51 }, // 0x8x and 0xax + { unkn, 0x50, 0x13, 0x51, 0x52, 0x52, unkn, unkn }, // 0x9x and 0xbx + { 0x11, 0x01, 0x50, 0x41, 0x43, 0x00, 0x02, 0x10 }, // 0xcx and 0xex + { unkn, 0x42, unkn, 0x43, unkn, 0x43, 0x41, unkn }, // 0xdx and 0xfx + }; + + static const uint8_t xor_table_02[0x08][0x08] = + { + { 0x53, 0x50, 0x41, 0x12, 0x52, 0x43, unkn, 0x52 }, // 0x0x and 0x2x + { 0x03, 0x41, 0x40, 0x12, unkn, 0x13, 0x13, 0x02 }, // 0x1x and 0x3x + { 0x52, 0x01, unkn, 0x40, unkn, 0x00, 0x12, unkn }, // 0x4x and 0x6x + { 0x50, 0x53, 0x42, 0x12, 0x03, 0x52, 0x52, 0x41 }, // 0x5x and 0x7x + { 0x11, 0x53, 0x41, 0x03, 0x12, unkn, unkn, unkn }, // 0x8x and 0xax + { 0x02, 0x10, 0x11, unkn, unkn, unkn, 0x41, unkn }, // 0x9x and 0xbx + { 0x11, unkn, 0x02, unkn, 0x02, 0x00, 0x51, 0x41 }, // 0xcx and 0xex + { unkn, 0x01, 0x10, 0x43, 0x01, 0x03, 0x12, unkn }, // 0xdx and 0xfx + }; + + static const uint8_t xor_table_03[0x08][0x08] = + { + { 0x52, 0x01, 0x42, 0x52, 0x02, 0x13, 0x52, 0x03 }, // 0x0x and 0x2x + { 0x53, 0x01, 0x50, unkn, 0x13, 0x53, 0x03, 0x12 }, // 0x1x and 0x3x + { 0x42, 0x42, 0x43, 0x52, 0x12, 0x00, 0x52, 0x50 }, // 0x4x and 0x6x + { 0x42, 0x02, 0x13, 0x03, 0x03, unkn, 0x12, 0x10 }, // 0x5x and 0x7x + { 0x11, 0x11, 0x52, 0x42, unkn, unkn, unkn, unkn }, // 0x8x and 0xax + { unkn, 0x03, 0x01, unkn, 0x41, 0x43, unkn, 0x10 }, // 0x9x and 0xbx + { 0x41, 0x01, 0x41, 0x01, unkn, 0x00, 0x40, unkn }, // 0xcx and 0xex + { 0x02, 0x12, 0x52, 0x02, 0x12, 0x43, 0x01, 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) @@ -17640,7 +17715,7 @@ GAME( 198?, ladylinr, 0, ladylinr, ladylinr, goldstar_state, empty_init GAME( 198?, ladylinra, ladylinr, ladylinr, ladylinr, goldstar_state, empty_init, ROT0, "TAB Austria", "Lady Liner (set 2)", 0 ) 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, empty_init, ROT0, "TAB Austria", "Lady Liner (encrypted, set 3)", MACHINE_NOT_WORKING ) // same encryption as ladylinrb with different xor values +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?, wcat3, 0, wcat3, lucky8, wingco_state, empty_init, ROT0, "E.A.I.", "Wild Cat 3", MACHINE_NOT_WORKING ) diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h index fedc1aa78da..07127713b8f 100644 --- a/src/mame/includes/goldstar.h +++ b/src/mame/includes/goldstar.h @@ -57,6 +57,7 @@ public: void init_super9(); void init_ladylinrb(); void init_ladylinrc(); + void init_ladylinrd(); DECLARE_VIDEO_START(goldstar); void cm_palette(palette_device &palette) const; DECLARE_VIDEO_START(cherrym); -- cgit v1.2.3