From 9b5357da53e461f1ae80807d97455b09333b83cb Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 3 Dec 2018 18:29:42 +0100 Subject: goldstar.cpp: preliminary decryption for luckylad. Not really close yet (nw) --- src/mame/drivers/goldstar.cpp | 33 ++++++++++++++++++++++++++++++++- src/mame/includes/goldstar.h | 1 + 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp index 5777bb691c3..bed79dad2f9 100644 --- a/src/mame/drivers/goldstar.cpp +++ b/src/mame/drivers/goldstar.cpp @@ -16536,6 +16536,37 @@ void cmaster_state::init_super7() } } +void wingco_state::init_luckylad() +{ + uint8_t *ROM = memregion("maincpu")->base(); + + for (int i = 0x0000; i < 0x8000; i++) + { + uint8_t x = ROM[i]; + switch (i & 0x1111) // preliminary, text in 0x3ab0-0x3c70, 0x4c00-0x5160 ranges seems mostly ok, seems similar to the one used in luckygrl (jangou.cpp). + { + case 0x0000: x = bitswap<8>(x ^ 0x00, 7, 6, 5, 4, 3, 2, 1, 0); break; + case 0x0001: x = bitswap<8>(x ^ 0xa0, 3, 6, 5, 4, 7, 2, 1, 0); break; + case 0x0010: x = bitswap<8>(x ^ 0x88, 5, 6, 7, 4, 3, 2, 1, 0); break; + case 0x0011: x = bitswap<8>(x ^ 0x28, 3, 6, 7, 4, 5, 2, 1, 0); break; + case 0x0100: x = bitswap<8>(x ^ 0x28, 3, 6, 7, 4, 5, 2, 1, 0); break; + case 0x0101: x = bitswap<8>(x ^ 0x20, 5, 6, 7, 4, 3, 2, 1, 0); break; + case 0x0110: x = bitswap<8>(x ^ 0x28, 5, 6, 3, 4, 7, 2, 1, 0); break; + case 0x0111: x = bitswap<8>(x ^ 0x88, 5, 6, 7, 4, 3, 2, 1, 0); break; + case 0x1000: x = bitswap<8>(x ^ 0x20, 5, 6, 7, 4, 3, 2, 1, 0); break; + case 0x1001: x = bitswap<8>(x ^ 0x00, 7, 6, 5, 4, 3, 2, 1, 0); break; + case 0x1010: x = bitswap<8>(x ^ 0xa0, 3, 6, 5, 4, 7, 2, 1, 0); break; + case 0x1011: x = bitswap<8>(x ^ 0x80, 7, 6, 3, 4, 5, 2, 1, 0); break; + case 0x1100: x = bitswap<8>(x ^ 0x28, 5, 6, 3, 4, 7, 2, 1, 0); break; + case 0x1101: x = bitswap<8>(x ^ 0x28, 5, 6, 3, 4, 7, 2, 1, 0); break; + case 0x1110: x = bitswap<8>(x ^ 0x80, 7, 6, 3, 4, 5, 2, 1, 0); break; + case 0x1111: x = bitswap<8>(x ^ 0x00, 7, 6, 5, 4, 3, 2, 1, 0); break; + } + + ROM[i] = x; + } +} + /********************************************* * Game Drivers * ********************************************** @@ -16627,7 +16658,7 @@ GAMEL( 198?, kkotnoli, 0, kkotnoli, kkotnoli, goldstar_state, empty_init GAME( 198?, ladylinr, 0, ladylinr, ladylinr, goldstar_state, empty_init, ROT0, "TAB Austria", "Lady Liner", 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, empty_init, ROT0, "Wing Co., Ltd.", "Lucky Lady (Wing, encrypted)", MACHINE_NOT_WORKING ) // encrypted (see notes in rom_load)... +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)... GAME( 1991, megaline, 0, megaline, megaline, unkch_state, empty_init, ROT0, "Fun World", "Mega Lines", MACHINE_NOT_WORKING ) GAMEL( 1993, bingowng, 0, bingowng, bingowng, wingco_state, empty_init, ROT0, "Wing Co., Ltd.", "Bingo (set 1)", 0, layout_bingowng ) diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h index dd41a4748b7..50c77924a12 100644 --- a/src/mame/includes/goldstar.h +++ b/src/mame/includes/goldstar.h @@ -221,6 +221,7 @@ public: void init_magoddsc(); void init_flaming7(); void init_flam7_tw(); + void init_luckylad(); DECLARE_VIDEO_START(bingowng); DECLARE_VIDEO_START(magical); -- cgit v1.2.3